asn1c-0.9.24+dfsg/0000755000000000000000000000000012121077150012224 5ustar rootrootasn1c-0.9.24+dfsg/ChangeLog0000644000000000000000000005156012121074461014007 0ustar rootroot 0.9.24: 2013-Mar-16 * GeneralizedTime fix for working with time offsets which are not representable in whole hours. (Severity: low; Security impact: low) Thanks to IP Fabrics, Inc. * Added -fincludes-quoted to asn1c to generate #includes in "double" instead of quotes. * PER encoding correctness fix. (Severity: high; Security impact: low) Reported by Grzegorz Aksamit. * ENUMERATED extension values check relaxed. Reported by Gabriel Burca. * Fixed decimal decoding of REAL values in -fnative-types mode (Severity: medium; Security impact: medium) * Removed webcgi subproject (introduced in 2004) as useless. 0.9.22: 2008-Nov-19 * Added -pdu=all and -pdu= switches to asn1c. * Added PER support for most known-multiplier string types: IA5String, VisibleString, PrintableString, BMPString, UniversalString; useful types: GeneralizedTime, UTCTime, ObjectDescriptor; as well as REAL and OBJECT IDENTIFIER. TODO: SET type. * Added PER support for extensions in SEQUENCE. * Multiple enhancements by Daniele Varrazzo * Fixed explicit tagging of an in-lined constructed type. (Severity: low; Security impact: none). * Memory leak fixed in SET OF / SEQUENCE OF when wrong encoding is encountered. (Severity: medium; Security impact: low) * Fixed extensibility handling of second SEQUENCE production. (Severity: low; Security impact: none) * Added DEFAULT handling for known multiplier string. * Added a sample OMA ULP decoder (./examples/sample.source.ULP). * Added full-width 32-bit integer encoding support in PER. * Fixed 1-byte OOB write issue with non-standard and Windows memory allocators (Severity: low; Security impact: medium). Reported by Sheng Yu. 0.9.21: 2006-Sep-17 * skeletons/standard-modules directory is now used for standard types. * Fixed class field access problem (Test case 98) (Severity: medium; Security impact: none) * Refactored Information Object Classes parsing. * Refactored Parameterization support. * [typedef enum foo {}] foo_e; is now e_foo, see #1287989 * Refactored ValueSetTypeAssignment parsing. * asn-decoder-template.c renamed into converter-sample.c * MEGACO (Media Gateway Control Protocol) decoder sample added. * First release of PER encoder (does not encode SETs yet). * Added a sample LDAP decoder (./examples/sample.source.LDAP3). * Added a sample 3GPP RRC decoder (./examples/sample.source.RRC). * Added a sample MEGACO (H.248.1) decoder (sample.source.MEGACO). 0.9.20: 2006-Mar-06 * SET OF CHOICE, SEQUENCE OF CHOICE and a certain named S/O types are represented differently in XER. THIS IS AN INCOMPATIBLE CHANGE. (Test case 70) (Severity: low; Security impact: low) * asn1c: Removed -ftypes88 command line option. * Started PER implementation. Somewhat experimental! 0.9.19: 2005-Oct-06 * A proper solution to circular references. No kludge flags should be necessary anymore to produce reference-free code: recursive dependencies are resolved automatically. * Test cases 73 & 92 keep track of various circular references. * Introduced compiler directives to allow finer control over the generated code ("----" in comments), (Test case 93). * New feature for unber(1): -s bytes. * Mandatory elements map for SET was not getting generated properly. (Test case 94) (Severity: high; Security impact: low) * asn1c: new command line option: -fskeletons-copy. 0.9.18: 2005-Aug-14 * The obsolete X.208 syntax is handled gracefully now (compound types' member names are invented on the fly). (Test case 87). * Generating enumeration tables for INTEGER types (Test case 88). * Generating enumeration tables for BIT STRING types (Test case 89). * Conditional INTEGER/ENUMERATED representation: long vs. INTEGER_t type is chosen based on PER visible constraints (Test cases 90, 91). * Union structures for CHOICE type are not anonymous anymore. * Made unber(1) program more verbose: effective structure length is now displayed as L="" at the closing tag. (Test check-xxber.sh). * Fixed unber(1)'s -1 switch for indefinite encoding length. * New command line option for unber(1): -m to enable minimalistic mode. 0.9.17: 2005-Aug-07 * Tagging mode is implicitly IMPLICIT if AUTOMATIC TAGS is used, #30.6. (Test cases 55, 86). * Started to use extern "C" {} in skeleton headers. * Introduced -finline-choice command line option to fix yet another class of circular references. 0.9.16: 2005-July-04 * GeneralizedTime API now supports fractions of seconds. Thanks to Bent Nicolaisen for support. * ASN.1 parser has been tweaked to allow parsing something like "SEQUENCE----comment----", which is ambiguous for many reasons. * XER decoder better handles not-yet-defined future extensions. 0.9.15: 2005-July-02 * Compiler now checks 64-bit overflows in constraints range handling code. No effect on the code produced by the compiler. * Compiler support for tagged and marked parametrized members. * Empty tags to element map avoided. * Compiled code GCC 4.x compatibility. 0.9.14: 2005-Apr-29 * Fixed check-70.-fnative-integers.c test (it was failing when no test directory was found). 0.9.13: 2005-Apr-24 * Added extra const qualifiers into the support code. * More RFC variations supported in crfc2asn1.pl. * Refined string values compatibility. (Test cases 77, 78). * Support for ContainedSubtype constraints. (Test case 16). * Parsing support for CONSTRAINED BY. (Test case 79). * Support for CharsDefn (Quadruple and Tuple, most used in ASN1-CHARACTER-MODULE) (Test case 80). * Pretty-printing support for WITH COMPONENT[S]. (Test case 82). * Streamed OCTET STRING decoding of large values: fixed allocation problem introduced in 0.9.9. (Severity: high; Security impact: medium) Reported by Yann Grossel . * Fixed BASIC-XER encoding of REAL numbers. 0.9.12: 2005-Mar-10 * Fixed a name clash in produced constraint checking code. * #includes are now in single quotes (to solve a name clash with system's on a Win32 system). * Small refinement of XML DTD generation (`asn1c -X`). * Relaxed XER processing rules to skip extra whitespace in some more places. It also skips XML comments (although XML comments in XER are prohibited by X.693, #8.2.1). (Test case 70) (Severity: medium; Security impact: none) Reported by . * Constraints on primitive types being defined are now supported. (Test case 74) (Severity: low; Security impact: none) * XMLValueList generation fixed for CHOICE type. (Severity: medium; Security impact: none) * Added the GSM TAP3 decoder into ./examples/sample.source.TAP3 0.9.11: 2005-Mar-04 * Released -fcompound-names to fix the name clashes in the code produced by the asn1c. * Released -fno-include-deps to avoid #including non-critical external dependencies. * Compiler is taught to produce compilable code for yet another class of circular ASN.1 type references. * X.693:8.3.4 prohibits anything but SignedNumber; fixed XER codec. * Fixed ENUMERATED identifier to value conversion in XER. Reported by . * If the compiled file contents are the same as in already existing file (left from previous compilation), the old file is retained. This prevents thrashing `make` dependencies if amount of changes in the original ASN.1 module(s) is small. 0.9.10: 2005-Feb-25 * Completed the XER XMLValueList encoding and decoding. * Native integer type is now using "long". * Fixed #1150856. Reported by . * Some WIN32 portability fixes. 0.9.9: 2005-Feb-22 * First release of XER (XML) decoding implementation (somewhat experimental). * ANY allocation routine fixed. Reported by . * Fixed tag parsing (tags like "[ 0 ]" were not supported). * Compiler now checks for duplicate ASN.1 types across modules. 0.9.8: 2005-Jan-17 * [NEW PLATFORM] Compiled and tested on Linux @ alpha64 (LP64). Some code needed to be fixed regarding int-long conversions (mostly inside the test suite), and floating point handling code needed to be restructured to handle signalling NAN and other floating point exceptions quietly. Smooth transition! * [NEW PLATFORM] Compiled and tested on Sun Solaris 9 @ sparc. Improved includes/defines of/for system headers. * -X command line option added to asn1c to generate XML DTD. * Empty SEQUENCE and SET clauses are now allowed. * Removed confusion between &xNN; and &#xNN; in enber and unber. * Removed order dependency in DEFAULT references to ENUMERATED identifiers (./tests/68-*-OK.asn1). * ber_dec_rval_t renamed into asn_dec_rval_t: more generality. * Extensions in CHOICE types are properly marked as non-pointers (Test case 59) (Severity: medium; Security impact: medium) Reported by . * Tagged CHOICE type is now supported again. (Test case 59) (Severity: low; Security impact: low) Reported by . * Implemented der_encode_to_buffer() procedure. 0.9.7.1: 2004-Oct-12 * Fixed automatic tagging for extensions of compound types. * Fixed ParametrizedReference parsing: {} are now recognized. 0.9.7: 2004-Oct-11 * Finished CXER implementation by adding SET and SET OF canonical ordering support. * Fixed unber(1) limits controlling logic. * Removed C99'izm from the x509dump, now understood by older compilers. * Enhanced UTF8String constraint validation, now it checks for the minimal encoding length; API of UTF8String_length() changed. * Fixed SEQUENCE dealing with premature termination of the optionals-laden indefinite length structure. The code was previously refusing to parse such structures. * Fixed explicitly tagged ANY type encoding and decoding (Severity: medium; Security impact: low). * Fixed CHOICE code spin when indefinite length structures appear in the extensions (Severity: medium; Security impact: medium). Reported by . * BIT STRING now stores the number of unused octets in a separate field. 0.9.6: 2004-Sep-29 * Added several security firewalls: decoder's stack usage control and the stricter checking of the TLV length. * Implemented BASIC-XER encoding support (X.693). * Implemented unber(1) and enber(1) for BER<->XML translation. * Implemented CGI for online ASN.1 compilation (asn1c/webcgi). * Implemented the sample X.509 decoder (./examples/sample.source.PKIX1). * NamedType is now supported for SET OF/SEQUENCE OF type. * Added -fno-constraints option to asn1c, which disabled generation of ASN.1 subtype constraints checking code. * Added ASN1C_ENVIRONMENT_VERSION and get_asn1c_environment_version(). * Fixed ANY type decoding (Severity: high; Security impact: low). * Fixed BER decoder restartability problem with certain primitive types (BOOLEAN, INTEGER, and REAL). The problem occured when the encoding of such type is split between several bytes. (Severity: high; Security impact: low) * Support for cross-referencing type definitions (updated ./tests/43-*). * Fixed pretty-printing of the REAL type. Added lots of test cases. * Renamed asn1_* into asn_* in function and type names. * Updated documentation. 0.9.5: 2004-Sep-17 * Fixed CER (common BER) decoder code. See check-25.c/VisibleString case for details. X.690 specifies that inner structures in BER encoding must be tagged by stripping off the outer tag for each subsequent containment level. See also X.690: 8.21.5.4 and the "Spouse" case in A.3. (Severity: medium; Security impact: low) * Added converters between any generic type and the ANY type. * Parser fixed: Information Object Class fields may be taged. * Parser fixed: tagged types inside SEQUENCE OF/SET OF support. * Improved DEFAULT Value parsing and pretty-printing. * Condition on distinct tags checker was incorrectly dealing with tagged CHOICE types. Fixed. Modified tests/37-indirect-choice-OK.asn1 * Improved type name generation code ("struct foo" vs "foo_t"). * Fixed constraint checking code incorrectly dealing with imported types with constraint values defined in other modules. * Real REAL support! (Haven't tested denormals support yet!) See skeletons/tests/check-REAL.c 0.9.4: 2004-Sep-10 * More support for recursive type definitions. * Explicit support for ANY type decoding. * Refactored tags processing code. * Fixed constraints checking code: non-exploitable buffer overflow. (Severity: medium; Security impact: low) 0.9.3: 2004-Sep-07 * Extended constraints support in parametrized types. * Better support for parametrization and constraints handling. * Better handling of recursive type definitions. * Added support for ANY type. 0.9.2: 2004-Aug-24 * More flexible subtype constraints handling, with relaxed PER visibility rules for actual constraints checking code generator. * Indirect references in constraints resolver code fixed. * Avoided compilation warning on gcc 3.3.3 systems. * Better ValueSet printing. 0.9.1: 2004-Aug-23 * Documentation updated: doc/asn1c-usage.pdf * Fixed OBJECT IDENTIFIER human-readable printing. Reported by . 0.9: 2004-Aug-23 * Reworked subtype constraints handling, aiming at PER-applicability. * BOOLEAN and NULL are now implemented in terms of native int type. * Compiler now links in only necessary skeleton files. * -t option added to asn1c to ease manual BER/CER/DER decoding. * Added support COMPONENTS OF construct. * Numerous parser fixes and enhancements. * Better constraint failure reporting. 0.8.19: 2004-Aug-18 * Fixed BER encoder (problem encoding large tag values) (Severity: medium; Security impact: low) 0.8.18: 2004-Aug-12 * Parser: fixed multiple IMPORTS problem (incorrect assertion). * Parser: constraints extensibility parsing fix. 0.8.17: 2004-Aug-11 * Improved compiler output: duplicate #includes eliminated. * Win32 portability fixes. * More compatibility with C++ or non-GCC compilers. 0.8.16: 2004-Jul-22 * Fixed application-level problem in SET OF/SEQUENCE OF array cleanup. (Severity: medium; Security impact: low) * Improved asn_GT2time() and added asn_time2{GT,UT}() functions. * BIT STRING pretty-printing. 0.8.15: 2004-Jul-20 * Fixed parser: memory leak in free_struct code for SET OF/SEQUENCE OF. (Severity: high; Security impact: medium) * Fixed parser: invalid memory reference in code constructing tags. (Test case 48) (Severity: high; Security impact: medium) When encoding data for certain ASN.1 specifications containing explicit tags, the tag is always written incorrectly due to incorrect memory reference. The encoding will almost always produce unparseable data and might well reference unmapped region so program would produce segmentation violation. Fortunately, memory is read, not written, so remote exploits cannot execute arbitrary code and triggering unmapped memory reference is highly unlikely even it attacker knows the code (basically, the compiler should place asn1_DEF_... right before the end of the mapped memory region, which is extremely rare). * Improved INTEGER type printing. 0.8.14: 2004-Jun-30 * Fixed compiler: extensibility of CHOICE and SET type has not been taken into account during table construction. (Test case 47) (Severity: high; Security impact: low) 0.8.13: 2004-Jun-29 * Fixed compiler: the skip values for IMPLICIT tagging were broken in some complex cases where one type is defined using another. (Test case 46) (Severity: medium; Security impact: low). * Added -fknown-extern-type command line parameter to asn1c. * Removed -N command line flag and underlying functionality to honor KISS principle. 0.8.12: 2004-Jun-17 * RELATIVE-OID and OBJECT IDENTIFIER encoders/decoders are not bound anymore to an integer type of specific size (unsigned long). The size of an integer must be provided explicitly. See {OBJECT_IDENTIFIER|RELATIVE_OID}_{get|set}_arcs(). * SEQUENCE BER decoder fixed again for complex CHOICE case (Test case 44) (Severity: medium; Security impact: low). 0.8.11: 2004-Jun-05 * Enforced stricter conformance with C standards. * SEQUENCE BER decoder is now equipped with the sorted map in case of complex CHOICE descendants. Test case 44 created. 0.8.10: 2004-Jun-02 * Added const qualifier where necessary. * Changed position of outmost_tag fetcher within asn1_TYPE_descriptor_t structure. 0.8.9: 2004-May-26 * Added *_{get|set}_arcs_*() functions for OBJECT IDENTIFIER and RELATIVE-OID, together with test cases. 0.8.8: 2004-May-09 * Introduced subtype constraints support (incomplete!). * Fixed compiler. If the last member of the SEQUENCE is OPTIONAL and absent in the encoding, and the type is extensible (...) or EXTENSIBILITY IMPLIED flag is set, then the structure could not be correctly decoded. (Severity: high; Security impact: low). * Compiler: fixed recursive ASN.1 types inclusion (Severity: low, Security impact: none). * Parser: IMPORTS/FROM fixes, now allowing multiple sections. * NEW PLATFORM: Compiled and tested on MacOS X (@ PowerPC). No major portability issues experienced. 0.8.7: 2004-Apr-11 T-version-0-8-7 * Fixed SEQUENCE BER decoder: if the last member of the SEQUENCE is OPTIONAL and absent in the encoding, RC_FAIL was returned instead of RC_OK (Severity: high; Security impact: low). * Added test case to check the above problem. * Added test case to check -fnative-integers mode. 0.8.6: 2004-Apr-03 T-version-0-8-6 * Fixed compiler output for embedded ASN.1 structures. 0.8.5: 2004-Mar-28 T-version-0-8-5 * Fixed ber_tlv_length() computation problem (Severity: high, Security impact: none). Reported by 0.8.4: 2004-Mar-22 * Removed RC_ITAG enumeration element from BER decoder. This return code did not have much practical value. 0.8.3: 2004-Mar-14 T-version-0-8-3 * Fixed SET::BER decoder: restart after reaching a buffer boundary weas broken (Severity: high; Security impact: low). * Fixed OCTET STRING::BER decoder: restart after reaching a buffer boundary was broken (Severity: high; Security impact: low). Reported by * Added test cases to check decoders restartability. * Slightly more general INTEGER2long decoder. * Allowed nested /* C-type */ comments, as per X.680:2002. 0.8.2: 2004-Mar-01 T-version-0-8-2 * Fixed SEQUENCE BER decoder: an OPTIONAL element was required, where should not have been (Severity: major; Security impact: low). * Fixed print_struct pointer inheritance. * Added -fno-c99 and -funnamed-unions 0.8.1: 2004-Feb-22 * -R switch to asn1c: Omit support code, compile only the tables. * Introduced NativeInteger pseudotype. * Corrected the informal print_struct()'s output format. 0.8.0: 2004-Feb-03 T-version-0-8-0 * Some documentation is created (a .pdf and a short manual page). * Last touches to the code. 0.7.9: 2004-Feb-01 T-version-0-7-9 * Human readable printing support. * Support for implicit (standard) constraints. 0.7.8: 2004-Jan-31 * SET now rejects duplicate fields in the data stream. 0.7.7: 2004-Jan-25 * Added types: GeneralizedTime and UTCTime. 0.7.6: 2004-Jan-24 T-version-0-7-6 * DER encoding of a SET OF now involves dynamic sorting. 0.7.5: 2004-Jan-24 T-version-0-7-5 * DER encoding of a SET with untagged CHOICE now involves dynamic sorting. 0.7.0: 2004-Jan-19 T-version-0-7-0 * A bunch of DER encoders is implemented. 0.6.6: 2004-Jan-11 * Implemented CHOICE decoder. * Implemented destructors support. 0.6.5: 2004-Jan-03 * Implemented SET decoder. * Implemented SET OF and SEQUENCE OF decoders. 0.6.4: 2003-Dec-31 * Implemented BOOLEAN, NULL, ENUMERATED decoders. * Implemented OCTET STRING decoder. * Implemented BIT STRING decoder. 0.6: 2003-Dec-30 * First decoding of a BER-encoded structure! 0.5: 2003-Dec-28 * Framework and most of the compiler backbone coding done. 0.1: 2003-Nov-28 * Programming started. === Bug importance disclosure terms === SEVERITY. This term applies to the frequence the particular construct is used in the real world. The higher the frequency, the more chances of triggering this bug. low: The ASN.1 specifications which could trigger this kind of bug are not widespread. medium: The particular ASN.1 construct is used quite often, so the chance of triggering an error is considerable. high: This fix is considered urgent, or the particular ASN.1 construct triggering this bug is in wide use. SECURITY IMPACT. This term applies to the amount of potential damage a bug exploitation could cause. none: No malicious exploitation is possible. low: The local exploitation is unlikely; the remote exploitation is impossible. medium: The remote exploitation is possible when a particular ASN.1 construct is being used. If possible, only hard failure, spin or memory leak are the possible outcome: no shellcode injection could possibly be carried by the attack. high: The remote shellcode injection is possible, or the bug is otherwise remotely exploitable for most specifications. asn1c-0.9.24+dfsg/aclocal.m40000644000000000000000000012103112121076146014066 0ustar rootroot# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, [m4_warning([this file was generated for autoconf 2.63. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) asn1c-0.9.24+dfsg/libasn1compiler/0000755000000000000000000000000012223077270015316 5ustar rootrootasn1c-0.9.24+dfsg/libasn1compiler/asn1c_compat.h0000644000000000000000000000114111505405150020026 0ustar rootroot#ifndef ASN1C_COMPAT_H #define ASN1C_COMPAT_H /* * Open the arbitrary file by its base name and extension. * If opt_tmpname is given, a temporary file will be created and * its name returned in (*opt_tmpname). * The (*opt_tmpname) should then be subsequently freed by free(3). */ FILE *asn1c_open_file(const char *base_part, const char *extension, char **opt_tmpname); /* * Obtain base name and directory name of a path. * Some systems have them in as dirname(3) and basename(3). */ char *a1c_basename(const char *path); char *a1c_dirname(const char *path); #endif /* ASN1C_COMPAT_H */ asn1c-0.9.24+dfsg/libasn1compiler/asn1c_constraint.c0000644000000000000000000004341612015121740020732 0ustar rootroot#include "asn1c_internal.h" #include "asn1c_constraint.h" #include "asn1c_misc.h" #include "asn1c_out.h" #include /* constraint groker from libasn1fix */ #include /* other exportables from libasn1fix */ static int asn1c_emit_constraint_tables(arg_t *arg, int got_size); static int emit_alphabet_check_loop(arg_t *arg, asn1cnst_range_t *range); static int emit_value_determination_code(arg_t *arg, asn1p_expr_type_e etype, asn1cnst_range_t *r_value); static int emit_size_determination_code(arg_t *arg, asn1p_expr_type_e etype); static asn1p_expr_type_e _find_terminal_type(arg_t *arg); static int emit_range_comparison_code(arg_t *arg, asn1cnst_range_t *range, const char *varname, asn1c_integer_t natural_start, asn1c_integer_t natural_stop); static int native_long_sign(asn1cnst_range_t *r); /* -1, 0, 1 */ static int ulong_optimization(asn1p_expr_type_e etype, asn1cnst_range_t *r_size, asn1cnst_range_t *r_value) { return (!r_size && r_value && (etype == ASN_BASIC_INTEGER || etype == ASN_BASIC_ENUMERATED) && native_long_sign(r_value) == 0); } int asn1c_emit_constraint_checking_code(arg_t *arg) { asn1cnst_range_t *r_size; asn1cnst_range_t *r_value; asn1p_expr_t *expr = arg->expr; asn1p_expr_type_e etype; asn1p_constraint_t *ct; int got_something = 0; int alphabet_table_compiled; int produce_st = 0; int ulong_optimize = 0; ct = expr->combined_constraints; if(ct == NULL) return 1; /* No additional constraints defined */ etype = _find_terminal_type(arg); r_value=asn1constraint_compute_PER_range(etype, ct, ACT_EL_RANGE,0,0,0); r_size =asn1constraint_compute_PER_range(etype, ct, ACT_CT_SIZE, 0,0,0); if(r_value) { if(r_value->incompatible || r_value->empty_constraint || (r_value->left.type == ARE_MIN && r_value->right.type == ARE_MAX) || (etype == ASN_BASIC_BOOLEAN && r_value->left.value == 0 && r_value->right.value == 1) ) { asn1constraint_range_free(r_value); r_value = 0; } } if(r_size) { if(r_size->incompatible || r_size->empty_constraint || (r_size->left.value == 0 /* or .type == MIN */ && r_size->right.type == ARE_MAX) ) { asn1constraint_range_free(r_size); r_size = 0; } } /* * Do we really need an "*st = sptr" pointer? */ switch(etype) { case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: if(asn1c_type_fits_long(arg, arg->expr) == FL_NOTFIT) produce_st = 1; break; case ASN_BASIC_REAL: if(!(arg->flags & A1C_USE_NATIVE_TYPES)) produce_st = 1; break; case ASN_BASIC_BIT_STRING: case ASN_BASIC_OCTET_STRING: produce_st = 1; break; default: if(etype & ASN_STRING_MASK) produce_st = 1; break; } if(produce_st) { char *tname = asn1c_type_name(arg, arg->expr, TNF_SAFE); OUT("const %s_t *st = (const %s_t *)sptr;\n", tname, tname); } if(r_size || r_value) { if(r_size) { OUT("size_t size;\n"); } if(r_value) switch(etype) { case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: if(native_long_sign(r_value) >= 0) { ulong_optimize = ulong_optimization(etype, r_size, r_value); if(!ulong_optimize) { OUT("unsigned long value;\n"); } } else { OUT("long value;\n"); } break; case ASN_BASIC_REAL: OUT("double value;\n"); break; case ASN_BASIC_BOOLEAN: OUT("BOOLEAN_t value;\n"); break; default: break; } } OUT("\n"); /* * Protection against null input. */ OUT("if(!sptr) {\n"); INDENT(+1); OUT("_ASN_CTFAIL(app_key, td, sptr,\n"); OUT("\t\"%%s: value not given (%%s:%%d)\",\n"); OUT("\ttd->name, __FILE__, __LINE__);\n"); OUT("return -1;\n"); INDENT(-1); OUT("}\n"); OUT("\n"); if((r_value) && (!ulong_optimize)) emit_value_determination_code(arg, etype, r_value); if(r_size) emit_size_determination_code(arg, etype); INDENT(-1); REDIR(OT_CTABLES); /* Emit FROM() tables */ alphabet_table_compiled = (asn1c_emit_constraint_tables(arg, r_size?1:0) == 1); REDIR(OT_CODE); INDENT(+1); /* * Optimization for unsigned longs. */ if(ulong_optimize) { OUT("\n"); OUT("/* Constraint check succeeded */\n"); OUT("return 0;\n"); return 0; } /* * Here is an if() {} else {} consrtaint checking code. */ OUT("\n"); OUT("if("); INDENT(+1); if(r_size) { if(got_something++) { OUT("\n"); OUT(" && "); } OUT("("); emit_range_comparison_code(arg, r_size, "size", 0, -1); OUT(")"); } if(r_value) { if(got_something++) { OUT("\n"); OUT(" && "); } OUT("("); if(etype == ASN_BASIC_BOOLEAN) emit_range_comparison_code(arg, r_value, "value", 0, 1); else emit_range_comparison_code(arg, r_value, "value", -1, -1); OUT(")"); } if(alphabet_table_compiled) { if(got_something++) { OUT("\n"); OUT(" && "); } OUT("!check_permitted_alphabet_%d(%s)", arg->expr->_type_unique_index, produce_st ? "st" : "sptr"); } if(!got_something) { OUT("1 /* No applicable constraints whatsoever */"); OUT(") {\n"); INDENT(-1); INDENTED(OUT("/* Nothing is here. See below */\n")); OUT("}\n"); OUT("\n"); return 1; } INDENT(-1); OUT(") {\n"); INDENT(+1); switch(etype) { case ASN_CONSTR_SEQUENCE_OF: case ASN_CONSTR_SET_OF: OUT("/* Perform validation of the inner elements */\n"); OUT("return td->check_constraints(td, sptr, ctfailcb, app_key);\n"); break; default: OUT("/* Constraint check succeeded */\n"); OUT("return 0;\n"); } INDENT(-1); OUT("} else {\n"); INDENT(+1); OUT("_ASN_CTFAIL(app_key, td, sptr,\n"); OUT("\t\"%%s: constraint failed (%%s:%%d)\",\n"); OUT("\ttd->name, __FILE__, __LINE__);\n"); OUT("return -1;\n"); INDENT(-1); OUT("}\n"); return 0; } static int asn1c_emit_constraint_tables(arg_t *arg, int got_size) { asn1c_integer_t range_start; asn1c_integer_t range_stop; asn1p_expr_type_e etype; asn1cnst_range_t *range; asn1p_constraint_t *ct; int utf8_full_alphabet_check = 0; int max_table_size = 256; int table[256]; int use_table; ct = arg->expr->combined_constraints; if(!ct) return 0; etype = _find_terminal_type(arg); range = asn1constraint_compute_PER_range(etype, ct, ACT_CT_FROM, 0,0,0); if(!range) return 0; if(range->incompatible || range->empty_constraint) { asn1constraint_range_free(range); return 0; } if(range->left.type == ARE_MIN && range->right.type == ARE_MAX) { /* * The permitted alphabet constraint checker code guarantees * that either both bounds (left/right) are present, or * they're absent simultaneously. Thus, this assertion * legitimately holds true. */ assert(range->el_count == 0); /* The full range is specified. Ignore it. */ return 0; } range_start = range->left.value; range_stop = range->right.value; assert(range->left.type == ARE_VALUE); assert(range->right.type == ARE_VALUE); assert(range_start <= range_stop); range_start = 0; /* Force old behavior */ /* * Check if we need a test table to check the alphabet. */ use_table = 1; if(range->el_count == 0) { /* * It's better to have a short if() check * than waste 1k of table space */ use_table = 0; } if((range_stop - range_start) > 255) use_table = 0; if(etype == ASN_STRING_UTF8String) { if(range_stop >= 0x80) use_table = 0; else max_table_size = 128; } if(use_table) { int cardinal = 0; int i, n = 0; int untl; memset(table, 0, sizeof(table)); for(i = -1; i < range->el_count; i++) { asn1cnst_range_t *r; asn1c_integer_t v; if(i == -1) { if(range->el_count) continue; r = range; } else { r = range->elements[i]; } for(v = r->left.value; v <= r->right.value; v++) { assert((v - range_start) >= 0); assert((v - range_start) < max_table_size); table[v - range_start] = ++n; } } untl = (range_stop - range_start) + 1; untl += (untl % 16)?16 - (untl % 16):0; OUT("static int permitted_alphabet_table_%d[%d] = {\n", arg->expr->_type_unique_index, max_table_size); for(n = 0; n < untl; n++) { cardinal += table[n] ? 1 : 0; OUT("%2d,", table[n]); if(!((n+1) % 16)) { int c; if(!n || (n-15) + range_start >= 0x80) { OUT("\n"); continue; } OUT("\t/* "); for(c = n - 15; c <= n; c++) { if(table[c]) { int a = c + range_start; if(a > 0x20 && a < 0x80) OUT("%c", a); else OUT("."); } else { OUT(" "); } } OUT(" */"); OUT("\n"); } } OUT("};\n"); if((arg->flags & A1C_GEN_PER) && (etype & ASN_STRING_KM_MASK)) { int c; OUT("static int permitted_alphabet_code2value_%d[%d] = {\n", arg->expr->_type_unique_index, cardinal); for(n = c = 0; c < max_table_size; c++) { if(table[c]) { OUT("%d,", c); if(!((++n) % 16)) OUT("\n"); } } OUT("};\n"); OUT("\n"); DEBUG("code2value map gen for %s", arg->expr->Identifier); arg->expr->_mark |= TM_PERFROMCT; } OUT("\n"); } else if(etype == ASN_STRING_UTF8String) { /* * UTF8String type is a special case in many respects. */ if(got_size) { /* * Size has been already determined. * The UTF8String length checker also checks * for the syntax validity, so we don't have * to repeat this process twice. */ asn1constraint_range_free(range); return 0; } else { utf8_full_alphabet_check = 1; } } else { /* * This permitted alphabet check will be * expressed using conditional statements * instead of table lookups. Table would be * to large or otherwise inappropriate (too sparse?). */ } OUT("static int check_permitted_alphabet_%d(const void *sptr) {\n", arg->expr->_type_unique_index); INDENT(+1); if(utf8_full_alphabet_check) { OUT("if(UTF8String_length((const UTF8String_t *)sptr) < 0)\n"); OUT("\treturn -1; /* Alphabet (sic!) test failed. */\n"); OUT("\n"); } else { if(use_table) { OUT("int *table = permitted_alphabet_table_%d;\n", arg->expr->_type_unique_index); emit_alphabet_check_loop(arg, 0); } else { emit_alphabet_check_loop(arg, range); } } OUT("return 0;\n"); INDENT(-1); OUT("}\n"); OUT("\n"); asn1constraint_range_free(range); return 1; } static int emit_alphabet_check_loop(arg_t *arg, asn1cnst_range_t *range) { asn1c_integer_t natural_stop; asn1p_expr_t *terminal; char *tname; terminal = asn1f_find_terminal_type_ex(arg->asn, arg->expr); if(terminal) { OUT("/* The underlying type is %s */\n", ASN_EXPR_TYPE2STR(terminal->expr_type)); } else { terminal = arg->expr; } tname = asn1c_type_name(arg, terminal, TNF_SAFE); OUT("const %s_t *st = (const %s_t *)sptr;\n", tname, tname); switch(terminal->expr_type) { case ASN_STRING_UTF8String: OUT("const uint8_t *ch = st->buf;\n"); OUT("const uint8_t *end = ch + st->size;\n"); OUT("\n"); OUT("for(; ch < end; ch++) {\n"); INDENT(+1); OUT("uint8_t cv = *ch;\n"); if(!range) OUT("if(cv >= 0x80) return -1;\n"); natural_stop = 0xffffffffUL; break; case ASN_STRING_UniversalString: OUT("const uint8_t *ch = st->buf;\n"); OUT("const uint8_t *end = ch + st->size;\n"); OUT("\n"); OUT("if(st->size %% 4) return -1; /* (size%%4)! */\n"); OUT("for(; ch < end; ch += 4) {\n"); INDENT(+1); OUT("uint32_t cv = (ch[0] << 24)\n"); OUT("\t\t| (ch[1] << 16)\n"); OUT("\t\t| (ch[2] << 8)\n"); OUT("\t\t| ch[3];\n"); if(!range) OUT("if(cv > 255) return -1;\n"); natural_stop = 0xffffffffUL; break; case ASN_STRING_BMPString: OUT("const uint8_t *ch = st->buf;\n"); OUT("const uint8_t *end = ch + st->size;\n"); OUT("\n"); OUT("if(st->size %% 2) return -1; /* (size%%2)! */\n"); OUT("for(; ch < end; ch += 2) {\n"); INDENT(+1); OUT("uint16_t cv = (ch[0] << 8)\n"); OUT("\t\t| ch[1];\n"); if(!range) OUT("if(cv > 255) return -1;\n"); natural_stop = 0xffff; break; case ASN_BASIC_OCTET_STRING: default: OUT("const uint8_t *ch = st->buf;\n"); OUT("const uint8_t *end = ch + st->size;\n"); OUT("\n"); OUT("for(; ch < end; ch++) {\n"); INDENT(+1); OUT("uint8_t cv = *ch;\n"); natural_stop = 0xff; break; } if(range) { OUT("if(!("); emit_range_comparison_code(arg, range, "cv", 0, natural_stop); OUT(")) return -1;\n"); } else { OUT("if(!table[cv]) return -1;\n"); } INDENT(-1); OUT("}\n"); return 0; } static int emit_range_comparison_code(arg_t *arg, asn1cnst_range_t *range, const char *varname, asn1c_integer_t natural_start, asn1c_integer_t natural_stop) { int ignore_left; int ignore_right; int generated_something = 0; int i; for(i = -1; i < range->el_count; i++) { asn1cnst_range_t *r; if(i == -1) { if(range->el_count) continue; r = range; } else { if(i) OUT(" || "); r = range->elements[i]; } if(r != range) OUT("("); ignore_left = (r->left.type == ARE_MIN) || (natural_start != -1 && r->left.value <= natural_start); ignore_right = (r->right.type == ARE_MAX) || (natural_stop != -1 && r->right.value >= natural_stop); if(ignore_left && ignore_right) { OUT("1 /* Constraint matches natural range of %s */", varname); continue; } if(ignore_left) { OUT("%s <= ", varname); OINT(r->right.value); } else if(ignore_right) { OUT("%s >= ", varname); OINT(r->left.value); } else if(r->left.value == r->right.value) { OUT("%s == ", varname); OINT(r->right.value); } else { OUT("%s >= ", varname); OINT(r->left.value); OUT(" && "); OUT("%s <= ", varname); OINT(r->right.value); } if(r != range) OUT(")"); generated_something = 1; } return generated_something; } static int emit_size_determination_code(arg_t *arg, asn1p_expr_type_e etype) { switch(etype) { case ASN_BASIC_BIT_STRING: OUT("if(st->size > 0) {\n"); OUT("\t/* Size in bits */\n"); OUT("\tsize = 8 * st->size - (st->bits_unused & 0x07);\n"); OUT("} else {\n"); OUT("\tsize = 0;\n"); OUT("}\n"); break; case ASN_STRING_UniversalString: OUT("size = st->size >> 2;\t/* 4 byte per character */\n"); break; case ASN_STRING_BMPString: OUT("size = st->size >> 1;\t/* 2 byte per character */\n"); break; case ASN_STRING_UTF8String: OUT("size = UTF8String_length(st);\n"); OUT("if((ssize_t)size < 0) {\n"); OUT("\t_ASN_CTFAIL(app_key, td, sptr,\n"); OUT("\t\t\"%%s: UTF-8: broken encoding (%%s:%%d)\",\n"); OUT("\t\ttd->name, __FILE__, __LINE__);\n"); OUT("\treturn -1;\n"); OUT("}\n"); break; case ASN_CONSTR_SET_OF: case ASN_CONSTR_SEQUENCE_OF: OUT("/* Determine the number of elements */\n"); OUT("size = _A_C%s_FROM_VOID(sptr)->count;\n", etype==ASN_CONSTR_SET_OF?"SET":"SEQUENCE"); break; case ASN_BASIC_OCTET_STRING: OUT("size = st->size;\n"); break; default: if(etype & ASN_STRING_MASK) { OUT("size = st->size;\n"); break; } else { const char *type_name = ASN_EXPR_TYPE2STR(etype); if(!type_name) type_name = arg->expr->Identifier; WARNING("SizeConstraint is not defined for %s", type_name); OUT_NOINDENT("#warning SizeConstraint " "is not defined for %s!\n", type_name); OUT("size = st->size;\n"); } return -1; } return 0; } static int emit_value_determination_code(arg_t *arg, asn1p_expr_type_e etype, asn1cnst_range_t *r_value) { switch(etype) { case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: if(asn1c_type_fits_long(arg, arg->expr) == FL_FITS_UNSIGN) { OUT("value = *(const unsigned long *)sptr;\n"); } else if(asn1c_type_fits_long(arg, arg->expr) != FL_NOTFIT) { OUT("value = *(const long *)sptr;\n"); } else { /* * In some cases we can explore our knowledge of * underlying INTEGER_t->buf format. */ if(r_value->el_count == 0 && ( /* Speed-up common case: (0..MAX) */ (r_value->left.type == ARE_VALUE && r_value->left.value == 0 && r_value->right.type == ARE_MAX) || /* Speed-up common case: (MIN..-1) */ (r_value->left.type == ARE_MIN && r_value->right.type == ARE_VALUE && r_value->right.value == -1) )) { OUT("/* Check if the sign bit is present */\n"); OUT("value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;\n"); break; } if(native_long_sign(r_value) >= 0) { /* Special case for treating unsigned longs */ OUT("if(asn_INTEGER2ulong(st, &value)) {\n"); INDENT(+1); OUT("_ASN_CTFAIL(app_key, td, sptr,\n"); OUT("\t\"%%s: value too large (%%s:%%d)\",\n"); OUT("\ttd->name, __FILE__, __LINE__);\n"); OUT("return -1;\n"); INDENT(-1); OUT("}\n"); } else { OUT("if(asn_INTEGER2long(st, &value)) {\n"); INDENT(+1); OUT("_ASN_CTFAIL(app_key, td, sptr,\n"); OUT("\t\"%%s: value too large (%%s:%%d)\",\n"); OUT("\ttd->name, __FILE__, __LINE__);\n"); OUT("return -1;\n"); INDENT(-1); OUT("}\n"); } } break; case ASN_BASIC_REAL: if(arg->flags & A1C_USE_NATIVE_TYPES) { OUT("value = *(const double *)sptr;\n"); } else { OUT("if(asn_REAL2double(st, &value)) {\n"); INDENT(+1); OUT("_ASN_CTFAIL(app_key, td, sptr,\n"); OUT("\t\"%%s: value too large (%%s:%%d)\",\n"); OUT("\ttd->name, __FILE__, __LINE__);\n"); OUT("return -1;\n"); INDENT(-1); OUT("}\n"); } break; case ASN_BASIC_BOOLEAN: OUT("value = (*(const long *)sptr) ? 1 : 0;\n"); break; default: WARNING("%s:%d: Value cannot be determined " "for constraint check for %s", arg->expr->module->source_file_name, arg->expr->_lineno, arg->expr->Identifier ); OUT_NOINDENT( "#error %s:%d: Value of %s cannot be determined\n", arg->expr->module->source_file_name, arg->expr->_lineno, arg->expr->Identifier ); break; } return 0; } static asn1p_expr_type_e _find_terminal_type(arg_t *arg) { asn1p_expr_t *expr; expr = asn1f_find_terminal_type_ex(arg->asn, arg->expr); if(expr) return expr->expr_type; return A1TC_INVALID; } static int native_long_sign(asn1cnst_range_t *r) { if(r->left.type == ARE_VALUE && r->left.value >= 0 && r->right.type == ARE_VALUE && r->right.value > 2147483647UL && r->right.value <= 4294967295UL) { if(r->el_count == 0 && r->left.value == 0 && r->right.value == 4294967295UL) return 0; else return 1; } else { return -1; } } asn1c-0.9.24+dfsg/libasn1compiler/asn1c_lang.c0000644000000000000000000000130511472004363017465 0ustar rootroot#include "asn1c_internal.h" #include "asn1c_C.h" asn1_language_map_t asn1_lang_map[AMT_EXPR_META_MAX][ASN_EXPR_TYPE_MAX]; int asn1c_with_language(asn1c_target_language_e lang) { asn1_language_map_t *lptr; int lsize; if(lang != ASN1C_LANGUAGE_C) { errno = EINVAL; return -1; } lptr = asn1_lang_C; lsize = sizeof(asn1_lang_C)/sizeof(asn1_lang_C[0]); memset(asn1_lang_map, 0, sizeof(asn1_lang_map)); for(; lsize && lptr->expr_match; lsize--, lptr++) { assert(lptr->meta_match > 0); assert(lptr->meta_match < AMT_EXPR_META_MAX); assert(lptr->expr_match > 0); assert(lptr->expr_match < ASN_EXPR_TYPE_MAX); asn1_lang_map[lptr->meta_match][lptr->expr_match] = *lptr; } return 0; } asn1c-0.9.24+dfsg/libasn1compiler/asn1c_misc.c0000644000000000000000000002304711472004363017506 0ustar rootroot#include "asn1c_internal.h" #include "asn1c_misc.h" #include /* constraint groker from libasn1fix */ #include /* other exportable stuff from libasn1fix */ /* * Checks that the given string is not a reserved C/C++ keyword. * ISO/IEC 9899:1999 (C99), A.1.2 */ static char *res_kwd[] = { "const", "auto", "register", "volatile", "restrict", "extern", "static", "inline", "signed", "unsigned", "void", "char", "short", "int", "long", "float", "double", "enum", "union", "struct", "typedef", "class", "switch", "case", "default", "break", "continue", "if", "else", "do", "for", "while", "goto", "sizeof", "return" }; static int reserved_keyword(const char *str) { size_t i; for(i = 0 ; i < sizeof(res_kwd)/sizeof(res_kwd[0]); i++) { if(strcmp(str, res_kwd[i]) == 0) return 1; } return 0; } /* * Construct identifier from multiple parts. * Convert unsafe characters to underscores. */ char * asn1c_make_identifier(enum ami_flags_e flags, asn1p_expr_t *expr, ...) { static char *storage; static int storage_size; int nodelimiter = 0; va_list ap; char *str; char *nextstr; char *first = 0; char *second = 0; ssize_t size; char *p; if(expr) { /* * Estimate the necessary storage size */ if(expr->Identifier == NULL) return "Member"; size = strlen(expr->Identifier); if(expr->spec_index != -1) { static char buf[32]; second = buf; size += 1 + snprintf(buf, sizeof buf, "%dP%d", expr->_lineno, expr->spec_index); } } else { size = -1; } va_start(ap, expr); while((str = va_arg(ap, char *))) size += 1 + strlen(str); va_end(ap); if(size == -1) return NULL; /* * Make sure we have this amount of storage. */ if(storage_size <= size) { if(storage) free(storage); storage = malloc(size + 1); if(storage) { storage_size = size; } else { storage_size = 0; return NULL; } } /* * Fill-in the storage. */ va_start(ap, expr); p = storage; nextstr = ""; for(p = storage, str = 0; str || nextstr; str = nextstr) { int subst_made = 0; nextstr = second ? second : va_arg(ap, char *); if(str == 0) { if(expr) { str = expr->Identifier; first = str; second = 0; } else { first = nextstr; continue; } } if(str[0] == ' ' && str[1] == '\0') { *p++ = ' '; nodelimiter = 1; /* No delimiter */ continue; } if(str != first && !nodelimiter && !(flags & AMI_NODELIMITER)) *p++ = '_'; /* Delimiter between tokens */ nodelimiter = 0; /* * If it is a single argument, check that it does not clash * with C/C++ language keywords. */ if((flags & AMI_CHECK_RESERVED) && str == first && !nextstr && reserved_keyword(str)) { *p++ = toupper(*str++); /* Fall through */ } for(; *str; str++) { if(isalnum(*str)) { *p++ = *str; subst_made = 0; } else if(!subst_made++) { if((flags & AMI_MASK_ONLY_SPACES) && !isspace(*str)) { *p ++ = *str; } else { *p++ = '_'; } } } } va_end(ap); *p = '\0'; assert((p - storage) <= storage_size); return storage; } char * asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format) { asn1p_expr_t *exprid = 0; asn1p_expr_t *top_parent; asn1p_expr_t *terminal; int stdname = 0; char *typename; /* Rewind to the topmost parent expression */ if((top_parent = expr->parent_expr)) while(top_parent->parent_expr) top_parent = top_parent->parent_expr; if(0) DEBUG("asn1c_type_name(%s: 0x%x)", expr->Identifier, expr->expr_type); switch(expr->expr_type) { case A1TC_REFERENCE: typename = expr->reference->components[ expr->reference->comp_count-1].name; if(typename[0] == '&') { arg_t tmp = *arg; /* * This is a reference to a type defined in a class. * Resolve it and use instead. */ tmp.expr = asn1f_class_access_ex(arg->asn, arg->expr->module, arg->expr, expr->rhs_pspecs, expr->reference); if(!tmp.expr) return NULL; return asn1c_type_name(&tmp, tmp.expr, _format); } terminal = asn1f_find_terminal_type_ex(arg->asn, expr); if(_format == TNF_RSAFE) { if(terminal && terminal->expr_type & ASN_CONSTR_MASK) { typename = terminal->Identifier; } } if(_format == TNF_CTYPE) { /* * If the component references the type itself, * switch to a recursion-safe type naming * ("struct foo" instead of "foo_t"). */ if(terminal && terminal == top_parent) { _format = TNF_RSAFE; } } if(terminal && terminal->spec_index != -1) { exprid = terminal; typename = 0; } break; case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: case ASN_BASIC_REAL: if((expr->expr_type == ASN_BASIC_REAL && (arg->flags & A1C_USE_NATIVE_TYPES)) || asn1c_type_fits_long(arg, expr)) { switch(_format) { case TNF_CTYPE: case TNF_RSAFE: if(expr->expr_type == ASN_BASIC_REAL) return "double"; else if(asn1c_type_fits_long(arg, expr) == FL_FITS_UNSIGN) return "unsigned long"; else return "long"; default: typename = 0; switch(expr->expr_type) { case ASN_BASIC_INTEGER: typename = "NativeInteger"; break; case ASN_BASIC_ENUMERATED: typename = "NativeEnumerated"; break; case ASN_BASIC_REAL: typename = "NativeReal"; break; default: break; } break; } if(typename) { if(_format != TNF_INCLUDE) return typename; stdname = 1; break; } } /* Fall through */ default: if(expr->expr_type & (ASN_CONSTR_MASK | ASN_BASIC_MASK | ASN_STRING_MASK)) { if(_format == TNF_RSAFE) _format = TNF_CTYPE; stdname = 1; typename = ASN_EXPR_TYPE2STR(expr->expr_type); } else { _format = TNF_RSAFE; typename = expr->Identifier; } } switch(_format) { case TNF_UNMODIFIED: return asn1c_make_identifier(AMI_MASK_ONLY_SPACES, 0, exprid ? exprid->Identifier : typename, 0); case TNF_INCLUDE: return asn1c_make_identifier( AMI_MASK_ONLY_SPACES | AMI_NODELIMITER, 0, ((!stdname || (arg->flags & A1C_INCLUDES_QUOTED)) ? "\"" : "<"), exprid ? exprid->Identifier : typename, ((!stdname || (arg->flags & A1C_INCLUDES_QUOTED)) ? ".h\"" : ".h>"), 0); case TNF_SAFE: return asn1c_make_identifier(0, exprid, typename, 0); case TNF_CTYPE: /* C type */ return asn1c_make_identifier(0, exprid, exprid?"t":typename, exprid?0:"t", 0); case TNF_RSAFE: /* Recursion-safe type */ return asn1c_make_identifier(AMI_CHECK_RESERVED, 0, "struct", " ", typename, 0); } assert(!"unreachable"); return typename; } /* * Check whether the specified INTEGER or ENUMERATED type can be represented * using the generic 'long' or 'unsigned long' type. */ enum asn1c_fitslong_e asn1c_type_fits_long(arg_t *arg, asn1p_expr_t *expr) { asn1cnst_range_t *range = 0; asn1cnst_edge_t left; asn1cnst_edge_t right; asn1p_expr_t *v; /* * Since we don't know the sizeof(long) on the possible target platform * which will be compiling the code generated by asn1c, let's play it * simple: long's range is equal to or greater than int32_t. * NOTE: the most negative integer cannot be written in C, as the C99 * standard will give it an unsigned type. * It is defined here as a constant expression. */ #define RIGHTMAX 2147483647 /* of 32-bit integer type */ #define LEFTMIN (-RIGHTMAX-1) /* of 32-bit integer type */ /* Descend to the terminal type */ expr = asn1f_find_terminal_type_ex(arg->asn, expr); if(expr == 0) return FL_NOTFIT; /* The "fits into long" operation is relevant only for integer types */ switch(expr->expr_type) { case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: break; default: return FL_NOTFIT; } /* * First, evaluate the range of explicitly given identifiers. */ TQ_FOR(v, &(expr->members), next) { if(v->expr_type != A1TC_UNIVERVAL) continue; if(v->value->value.v_integer < LEFTMIN || v->value->value.v_integer > RIGHTMAX) return FL_NOTFIT; } if(!expr->combined_constraints) return (arg->flags & A1C_USE_NATIVE_TYPES) ? FL_FORCED : FL_NOTFIT; /* * Second, if -fbless-SIZE is given, the (SIZE()) constraint may be * applied (non-standard! but we can deal with this) to the type. * Check the range. */ range = asn1constraint_compute_PER_range(expr->expr_type, expr->combined_constraints, ACT_CT_SIZE, 0, 0, CPR_simulate_fbless_SIZE); if(range) { if(!range->incompatible) { right = range->right; /* Use 4 instead of sizeof(long) is justified! */ if(right.type == ARE_VALUE && right.value <= 4) return FL_FITS_SIGNED; } asn1constraint_range_free(range); } /* * Third, pull up the PER visible range of the INTEGER. */ range = asn1constraint_compute_PER_range(expr->expr_type, expr->combined_constraints, ACT_EL_RANGE, 0, 0, 0); if(!range || range->empty_constraint || range->extensible || range->incompatible || range->not_PER_visible ) { asn1constraint_range_free(range); return (arg->flags & A1C_USE_NATIVE_TYPES) ? FL_FORCED : FL_NOTFIT; } left = range->left; right = range->right; asn1constraint_range_free(range); /* Special case for unsigned */ if(left.type == ARE_VALUE && left.value >= 0 && right.type == ARE_VALUE && right.value > 2147483647 && right.value <= 4294967295UL) return FL_FITS_UNSIGN; /* If some fixed value is outside of target range, not fit */ if(left.type == ARE_VALUE && (left.value < LEFTMIN || left.value > RIGHTMAX)) return FL_NOTFIT; if(right.type == ARE_VALUE && (right.value > RIGHTMAX || right.value < LEFTMIN)) return FL_NOTFIT; /* If the range is open, fits only if -fnative-types is given */ if(left.type != ARE_VALUE || right.type != ARE_VALUE) { return (arg->flags & A1C_USE_NATIVE_TYPES) ? FL_FORCED : FL_NOTFIT; } return FL_FITS_SIGNED; } asn1c-0.9.24+dfsg/libasn1compiler/asn1c_misc.h0000644000000000000000000000301611472004363017505 0ustar rootroot#ifndef _ASN1_COMPILER_MISC_H_ #define _ASN1_COMPILER_MISC_H_ /* * Make the target language identifier out of one or more names. * The function will concatenate the names and replace unsafe characters * with safe ones. */ enum ami_flags_e { AMI_MASK_ONLY_SPACES = 1, /* Mask only spaces, everything else's safe */ AMI_CHECK_RESERVED = 2, /* Check against reserved keywords */ AMI_NODELIMITER = 4, /* Do not put delimiter, just concatenate */ }; char *asn1c_make_identifier(enum ami_flags_e, asn1p_expr_t *expr, ...); /* * Return the type name of the specified expression. */ enum tnfmt { TNF_UNMODIFIED = 0x10, /* Return unmodified type name */ TNF_INCLUDE = 0x20, /* Format for #include <> */ TNF_CTYPE = 0x30, /* Format as normal C-ish type (append "_t") */ TNF_SAFE = 0x40, /* Replace unsafe characters with _ */ TNF_RSAFE = 0x50, /* Recursion-safe C type format */ }; char *asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format); /* * Check whether the specified INTEGER or ENUMERATED type can be represented * using the generic 'long' type. * Return values: * FL_NOTFIT: No, it cannot be represented using long. * FL_FITS_SIGNED: It can be represented using signed long. * FL_FITS_UNSIGN: It can be represented using unsigned long. * FL_FORCED: Probably can't, but -fnative-types is in force. */ enum asn1c_fitslong_e { FL_NOTFIT, FL_FITS_SIGNED, FL_FITS_UNSIGN, FL_FORCED, }; enum asn1c_fitslong_e asn1c_type_fits_long(arg_t *arg, asn1p_expr_t *expr); #endif /* _ASN1_COMPILER_MISC_H_ */ asn1c-0.9.24+dfsg/libasn1compiler/asn1c_save.h0000644000000000000000000000025711472004363017514 0ustar rootroot#ifndef _ASN1C_SAVE_H_ #define _ASN1C_SAVE_H_ int asn1c_save_compiled_output(arg_t *arg, const char *datadir, int argc, int optc, char **argv); #endif /* _ASN1C_SAVE_H_ */ asn1c-0.9.24+dfsg/libasn1compiler/asn1c_save.c0000644000000000000000000003555112015121740017505 0ustar rootroot#include "asn1c_internal.h" #include "asn1c_compat.h" #include "asn1c_fdeps.h" #include "asn1c_lang.h" #include "asn1c_misc.h" #include "asn1c_save.h" #include "asn1c_out.h" #define HINCLUDE(s) \ ((arg->flags & A1C_INCLUDES_QUOTED) \ ? fprintf(fp_h, "#include \"%s\"\n", s) \ : fprintf(fp_h, "#include <%s>\n", s)) \ static int asn1c_dump_streams(arg_t *arg, asn1c_fdeps_t *, int, char **); static int asn1c_print_streams(arg_t *arg); static int asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *, int, char **); static int asn1c_copy_over(arg_t *arg, char *path); static int identical_files(const char *fname1, const char *fname2); static int need_to_generate_pdu_collection(arg_t *arg); static int generate_pdu_collection_file(arg_t *arg); static int generate_preamble(arg_t *, FILE *, int optc, char **argv); static int include_type_to_pdu_collection(arg_t *arg); static void pdu_collection_print_unused_types(arg_t *arg); static const char *generate_pdu_C_definition(void); int asn1c_save_compiled_output(arg_t *arg, const char *datadir, int argc, int optc, char **argv) { asn1c_fdeps_t *deps = 0; asn1c_fdeps_t *dlist; asn1p_module_t *mod; FILE *mkf; /* Makefile.am.sample */ int i; deps = asn1c_read_file_dependencies(arg, datadir); if(!deps && datadir) { WARNING("Cannot read file-dependencies information " "from %s\n", datadir); } TQ_FOR(mod, &(arg->asn->modules), mod_next) { TQ_FOR(arg->expr, &(mod->members), next) { if(asn1_lang_map[arg->expr->meta_type] [arg->expr->expr_type].type_cb) { if(asn1c_dump_streams(arg, deps, optc, argv)) return -1; } } } /* * Dump out the Makefile template and the rest of the support code. */ if((arg->flags & A1C_PRINT_COMPILED) || (arg->flags & A1C_OMIT_SUPPORT_CODE)) { return 0; /* Finished */ } mkf = asn1c_open_file("Makefile.am", ".sample", 0); if(mkf == NULL) { perror("Makefile.am.sample"); return -1; } fprintf(mkf, "ASN_MODULE_SOURCES="); TQ_FOR(mod, &(arg->asn->modules), mod_next) { TQ_FOR(arg->expr, &(mod->members), next) { if(asn1_lang_map[arg->expr->meta_type] [arg->expr->expr_type].type_cb) { fprintf(mkf, "\t\\\n\t%s.c", arg->expr->Identifier); } } } fprintf(mkf, "\n\nASN_MODULE_HEADERS="); TQ_FOR(mod, &(arg->asn->modules), mod_next) { TQ_FOR(arg->expr, &(mod->members), next) { if(asn1_lang_map[arg->expr->meta_type] [arg->expr->expr_type].type_cb) { fprintf(mkf, "\t\\\n\t%s.h", arg->expr->Identifier); } } } fprintf(mkf, "\n\n"); /* * Move necessary skeleton files and add them to Makefile.am.sample. */ dlist = asn1c_deps_makelist(deps); if(dlist) { char buf[8129]; char *dir_end; size_t dlen = strlen(datadir); assert(dlen < (sizeof(buf) / 2 - 2)); memcpy(buf, datadir, dlen); dir_end = buf + dlen; *dir_end++ = '/'; for(i = 0; i < dlist->el_count; i++) { char *what_class; /* MODULE or CONVERTER */ char *what_kind; /* HEADERS or SOURCES */ char *fname = dlist->elements[i]->filename; char *dotH; assert(strlen(fname) < (sizeof(buf) / 2)); strcpy(dir_end, fname); if(asn1c_copy_over(arg, buf) == -1) { fprintf(mkf, ">>>ABORTED<<<"); fclose(mkf); return -1; } /* MODULE data versus CONVERTER data */ switch(dlist->elements[i]->usage) { case FDEP_CONVERTER: what_class = "CONVERTER"; break; default: what_class= "MODULE"; break; } /* HEADERS versus SOURCES */ dotH = strrchr(fname, 'h'); if(dotH && fnameflags & A1C_PDU_TYPE) ? generate_pdu_C_definition() : "" , need_to_generate_pdu_collection(arg) ? " -DASN_PDU_COLLECTION" : "" ); for(i = 0; i < argc; i++) fprintf(mkf, "%s%s", i ? " " : "", argv[i]); fprintf(mkf, "\n\n"); fclose(mkf); fprintf(stderr, "Generated Makefile.am.sample\n"); return 0; } /* * Dump the streams. */ static int asn1c_dump_streams(arg_t *arg, asn1c_fdeps_t *deps, int optc, char **argv) { if(arg->flags & A1C_PRINT_COMPILED) { return asn1c_print_streams(arg); } else { return asn1c_save_streams(arg, deps, optc, argv); } } static int asn1c_print_streams(arg_t *arg) { compiler_streams_t *cs = arg->expr->data; asn1p_expr_t *expr = arg->expr; int i; for(i = 1; i < OT_MAX; i++) { out_chunk_t *ot; if(TQ_FIRST(&cs->destination[i].chunks) == NULL) continue; printf("\n/*** <<< %s [%s] >>> ***/\n\n", _compiler_stream2str[i], expr->Identifier); TQ_FOR(ot, &(cs->destination[i].chunks), next) { fwrite(ot->buf, ot->len, 1, stdout); } } return 0; } static int asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps, int optc, char **argv) { asn1p_expr_t *expr = arg->expr; compiler_streams_t *cs = expr->data; out_chunk_t *ot; FILE *fp_c, *fp_h; char *tmpname_c, *tmpname_h; char *name_buf; char *header_id; const char *c_retained = ""; const char *h_retained = ""; if(cs == NULL) { fprintf(stderr, "Cannot compile %s at line %d\n", expr->Identifier, expr->_lineno); return -1; } fp_c = asn1c_open_file(expr->Identifier, ".c", &tmpname_c); fp_h = asn1c_open_file(expr->Identifier, ".h", &tmpname_h); if(fp_c == NULL || fp_h == NULL) { if(fp_c) { unlink(tmpname_c); free(tmpname_c); fclose(fp_c); } if(fp_h) { unlink(tmpname_h); free(tmpname_h); fclose(fp_h); } return -1; } generate_preamble(arg, fp_c, optc, argv); generate_preamble(arg, fp_h, optc, argv); header_id = asn1c_make_identifier(0, expr, NULL); fprintf(fp_h, "#ifndef\t_%s_H_\n" "#define\t_%s_H_\n" "\n", header_id, header_id); fprintf(fp_h, "\n"); HINCLUDE("asn_application.h"); #define SAVE_STREAM(fp, idx, msg, actdep) do { \ if(TQ_FIRST(&(cs->destination[idx].chunks)) && *msg) \ fprintf(fp, "\n/* %s */\n", msg); \ TQ_FOR(ot, &(cs->destination[idx].chunks), next) { \ if(actdep) asn1c_activate_dependency(deps, 0, ot->buf); \ fwrite(ot->buf, ot->len, 1, fp); \ } \ } while(0) SAVE_STREAM(fp_h, OT_INCLUDES, "Including external dependencies", 1); fprintf(fp_h, "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"); SAVE_STREAM(fp_h, OT_DEPS, "Dependencies", 0); SAVE_STREAM(fp_h, OT_FWD_DECLS, "Forward declarations", 0); SAVE_STREAM(fp_h, OT_TYPE_DECLS, expr->Identifier, 0); SAVE_STREAM(fp_h, OT_FUNC_DECLS,"Implementation", 0); fprintf(fp_h, "\n#ifdef __cplusplus\n}\n#endif\n"); if(!(arg->flags & A1C_NO_INCLUDE_DEPS)) SAVE_STREAM(fp_h, OT_POST_INCLUDE, "Referred external types", 1); fprintf(fp_h, "\n#endif\t/* _%s_H_ */\n", header_id); HINCLUDE("asn_internal.h"); fprintf(fp_c, "#include \"%s.h\"\n\n", expr->Identifier); if(arg->flags & A1C_NO_INCLUDE_DEPS) SAVE_STREAM(fp_c, OT_POST_INCLUDE, "", 1); TQ_FOR(ot, &(cs->destination[OT_CTABLES].chunks), next) fwrite(ot->buf, ot->len, 1, fp_c); TQ_FOR(ot, &(cs->destination[OT_CODE].chunks), next) fwrite(ot->buf, ot->len, 1, fp_c); TQ_FOR(ot, &(cs->destination[OT_CTDEFS].chunks), next) fwrite(ot->buf, ot->len, 1, fp_c); TQ_FOR(ot, &(cs->destination[OT_STAT_DEFS].chunks), next) fwrite(ot->buf, ot->len, 1, fp_c); assert(OT_MAX == 11); /* Protection from reckless changes */ fclose(fp_c); fclose(fp_h); name_buf = alloca(strlen(expr->Identifier) + 3); sprintf(name_buf, "%s.c", expr->Identifier); if(identical_files(name_buf, tmpname_c)) { c_retained = " (contents unchanged)"; unlink(tmpname_c); } else { if(rename(tmpname_c, name_buf)) { unlink(tmpname_c); perror(tmpname_c); free(tmpname_c); free(tmpname_h); return -1; } } sprintf(name_buf, "%s.h", expr->Identifier); if(identical_files(name_buf, tmpname_h)) { h_retained = " (contents unchanged)"; unlink(tmpname_h); } else { if(rename(tmpname_h, name_buf)) { unlink(tmpname_h); perror(tmpname_h); free(tmpname_c); free(tmpname_h); return -1; } } free(tmpname_c); free(tmpname_h); fprintf(stderr, "Compiled %s.c%s\n", expr->Identifier, c_retained); fprintf(stderr, "Compiled %s.h%s\n", expr->Identifier, h_retained); return 0; } static int generate_preamble(arg_t *arg, FILE *fp, int optc, char **argv) { fprintf(fp, "/*\n" " * Generated by asn1c-" VERSION " (http://lionet.info/asn1c)\n" " * From ASN.1 module \"%s\"\n" " * \tfound in \"%s\"\n", arg->expr->module->ModuleName, arg->expr->module->source_file_name); if(optc > 1) { int i; fprintf(fp, " * \t`asn1c "); for(i = 1; i < optc; i++) fprintf(fp, "%s%s", i>1?" ":"", argv[i]); fprintf(fp, "`\n"); } fprintf(fp, " */\n\n"); return 0; } static int identical_files(const char *fname1, const char *fname2) { char buf[2][4096]; FILE *fp1, *fp2; size_t olen, nlen; int retval = 1; /* Files are identical */ #ifndef _WIN32 struct stat sb; if(lstat(fname1, &sb) || !S_ISREG(sb.st_mode) || lstat(fname2, &sb) || !S_ISREG(sb.st_mode)) { return 0; /* Files are not identical */ } #endif fp1 = fopen(fname1, "r"); if(!fp1) { return 0; } fp2 = fopen(fname2, "r"); if(!fp2) { fclose(fp1); return 0; } while((olen = fread(buf[0], 1, sizeof(buf[0]), fp1))) { nlen = fread(buf[1], 1, olen, fp2); if(nlen != olen || memcmp(buf[0], buf[1], nlen)) { retval = 0; break; } } nlen = fread(buf[1], 1, 1, fp2); if(nlen) retval = 0; fclose(fp1); fclose(fp2); return retval; } /* * Copy file for real. */ static int real_copy(const char *src, const char *dst) { unsigned char buf[4096]; char *tmpname; FILE *fpsrc, *fpdst; size_t len; int retval = 0; if(identical_files(src, dst)) return retval; /* Success, no need to copy for real. */ fpsrc = fopen(src, "r"); if(!fpsrc) { errno = EIO; return -1; } fpdst = asn1c_open_file(dst, "", &tmpname); if(!fpdst) { fclose(fpsrc); errno = EIO; return -1; } while(!feof(fpsrc)) { len = fread(buf, 1, sizeof(buf), fpsrc); if(fwrite(buf, 1, len, fpdst) != len) { perror(tmpname); errno = EIO; retval = -1; break; } } fclose(fpsrc); fclose(fpdst); /* Check if copied correctly, and rename into a permanent name */ if(retval) { unlink(tmpname); } else if(rename(tmpname, dst)) { unlink(tmpname); perror(tmpname); retval = -1; } free(tmpname); return retval; } static int asn1c_copy_over(arg_t *arg, char *path) { char *fname; #ifdef _WIN32 int use_real_copy = 1; #else int use_real_copy = (arg->flags & A1C_SKELETONS_COPY); #endif fname = a1c_basename(path); if(!fname || (use_real_copy ? real_copy(path, fname) : symlink(path, fname)) ) { if(errno == EEXIST) { struct stat sb1, sb2; if(stat(path, &sb1) == 0 && stat(fname, &sb2) == 0 && sb1.st_dev == sb2.st_dev && sb1.st_ino == sb2.st_ino) { /* * Nothing to do. */ fprintf(stderr, "File %s is already here as %s\n", path, fname); return 1; } else { fprintf(stderr, "Retaining local %s (%s suggested)\n", fname, path); return 1; } } else if(errno == ENOENT) { /* Ignore this */ return 0; } else { fprintf(stderr, "%s %s -> %s failed: %s\n", use_real_copy ? "Copy" : "Symlink", path, fname, strerror(errno)); return -1; } } fprintf(stderr, "%s %s\t-> %s\n", use_real_copy ? "Copied" : "Symlinked", path, fname); return 1; } static int generate_pdu_collection_file(arg_t *arg) { asn1p_module_t *mod; FILE *fp; fp = asn1c_open_file("pdu_collection", ".c", 0); if(fp == NULL) { perror("pdu_collection.c"); return -1; } fprintf(fp, "/*\n" " * Generated by asn1c-" VERSION " (http://lionet.info/asn1c)\n" " */\n\n"); fprintf(fp, "struct asn_TYPE_descriptor_s;\t" "/* Forward declaration */\n\n"); TQ_FOR(mod, &(arg->asn->modules), mod_next) { TQ_FOR(arg->expr, &(mod->members), next) { if(!include_type_to_pdu_collection(arg)) continue; fprintf(fp, "extern struct asn_TYPE_descriptor_s " "asn_DEF_%s;\n", asn1c_make_identifier(0, arg->expr, NULL)); } } fprintf(fp, "\n\n"); fprintf(fp, "struct asn_TYPE_descriptor_s *asn_pdu_collection[] = {\n"); TQ_FOR(mod, &(arg->asn->modules), mod_next) { int mod_printed = 0; TQ_FOR(arg->expr, &(mod->members), next) { if(!include_type_to_pdu_collection(arg)) continue; if(!mod_printed++) fprintf(fp, "\t/* From module %s in %s */\n", arg->expr->module->ModuleName, arg->expr->module->source_file_name); fprintf(fp, "\t&asn_DEF_%s,\t\n", asn1c_make_identifier(0, arg->expr, NULL)); } } fprintf(fp, "\t0\n};\n\n"); pdu_collection_print_unused_types(arg); fclose(fp); fprintf(stderr, "Generated pdu_collection.c\n"); return 0; } static struct PDUType { char *typename; int used; } *pduType; static int pduTypes; static const char * generate_pdu_C_definition(void) { const char *src; char *def; char *dst; if(pduTypes == 0) return ""; def = malloc(strlen(pduType[0].typename) + 20); strcpy(def, " -DPDU="); for(src = pduType[0].typename, dst = def + 7; *src; src++, dst++) if((*dst = *src) == '-') *dst = '_'; *dst = 0; return def; } void asn1c__add_pdu_type(const char *ctypename) { char *typename = strdup(ctypename); assert(typename && *typename); pduType = realloc(pduType, sizeof(pduType[0]) * (pduTypes + 1)); assert(pduType); pduType[pduTypes].used = 0; pduType[pduTypes].typename = typename; pduTypes++; } static int asn1c__pdu_type_lookup(const char *typename) { int i; for(i = 0; i < pduTypes; i++) { struct PDUType *pt = &pduType[i]; if(strcmp(pt->typename, typename) == 0) { pt->used++; return 1; } } return 0; } static int need_to_generate_pdu_collection(arg_t *arg) { if(arg->flags & (A1C_PDU_ALL|A1C_PDU_AUTO)) return 1; if(arg->flags & A1C_PDU_TYPE) return (pduTypes > 1) ? 1 : 0; return 0; } static void pdu_collection_print_unused_types(arg_t *arg) { int i; for(i = 0; i < pduTypes; i++) { struct PDUType *pt = &pduType[i]; if(!pt->used) { WARNING("Missing type specified in -pdu=%s", pt->typename); } } } static int include_type_to_pdu_collection(arg_t *arg) { if(!asn1_lang_map[arg->expr->meta_type] [arg->expr->expr_type].type_cb) return 0; if((arg->flags & A1C_PDU_ALL) || ((arg->flags & A1C_PDU_AUTO) && !arg->expr->_type_referenced) || asn1c__pdu_type_lookup(arg->expr->Identifier)) { return 1; } return 0; } asn1c-0.9.24+dfsg/libasn1compiler/asn1c_internal.h0000644000000000000000000000265412015121740020366 0ustar rootroot#ifndef _ASN1_COMPILER_INTERNAL_H_ #define _ASN1_COMPILER_INTERNAL_H_ #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* for strlen(3) and memset(3) */ #include /* for isalnum(3) */ #include /* for fstat(2) */ #include #include #include #ifdef HAVE_SYS_STAT_H #include /* for fstat(2) */ #endif #ifdef HAVE_UNISTD_H #include /* for unlink(2) */ #endif #ifdef _WIN32 #include #include #include #define open _open #define close _close #define snprintf _snprintf #define vsnprintf _vsnprintf #else #include /* for glob(3) */ #endif #include /* for open(2) */ #ifdef HAVE_SYS_PARAM_H #include /* For MAXPATHLEN */ #endif #include "asn1compiler.h" typedef struct arg_s { enum asn1c_flags flags; void (*logger_cb)(int _severity, const char *fmt, ...); int (*default_cb)(struct arg_s *); struct compiler_streams *target; asn1p_t *asn; asn1p_expr_t *expr; int embed; } arg_t; /* * Logging. */ #define LOG(ll, fmt, args...) do { \ arg->logger_cb(ll, fmt, ##args); \ } while(0) #define DEBUG(fmt, args...) do { \ if(arg->flags & A1C_DEBUG) \ LOG(-1, fmt, ##args); \ } while(0) #define WARNING(fmt, args...) LOG(0, fmt, ##args); #define FATAL(fmt, args...) LOG(1, fmt, ##args); #endif /* _ASN1_COMPILER_INTERNAL_H_ */ asn1c-0.9.24+dfsg/libasn1compiler/asn1c_out.h0000644000000000000000000000733211472004363017366 0ustar rootroot#ifndef _ASN1_COMPILED_OUTPUT_H_ #define _ASN1_COMPILED_OUTPUT_H_ /* * An elementary chunk of target language text. */ typedef struct out_chunk { char *buf; int len; TQ_ENTRY(struct out_chunk) next; } out_chunk_t; typedef struct compiler_streams { enum { OT_IGNORE, /* Ignore this output */ OT_INCLUDES, /* #include files */ OT_DEPS, /* Dependencies (other than #includes) */ OT_FWD_DECLS, /* Forward declarations */ OT_TYPE_DECLS, /* Type declarations */ OT_FUNC_DECLS, /* Function declarations */ OT_POST_INCLUDE,/* #include after type definition */ OT_CTABLES, /* Constraint tables */ OT_CODE, /* Some code */ OT_CTDEFS, /* Constraint definitions */ OT_STAT_DEFS, /* Static definitions */ OT_MAX } target; struct compiler_stream_destination_s { TQ_HEAD(out_chunk_t) chunks; int indent_level; int indented; } destination[OT_MAX]; } compiler_streams_t; static char *_compiler_stream2str[] __attribute__ ((unused)) = { "IGNORE", "INCLUDES", "DEPS", "FWD-DECLS", "TYPE-DECLS", "FUNC-DECLS", "POST-INCLUDE", "CTABLES", "CODE", "CTDEFS", "STAT-DEFS" }; int asn1c_compiled_output(arg_t *arg, const char *fmt, ...); /***************************************************************** * Useful macros for invoking asn1c_compiled_output() and friends. */ /* Redirect output to a different stream. */ #define REDIR(foo) do { arg->target->target = foo; } while(0) #define INDENT_LEVEL \ arg->target->destination[arg->target->target].indent_level #define INDENT(val) INDENT_LEVEL += (val) #define INDENTED(code) do { \ INDENT(+1); \ do { code; } while(0); \ INDENT(-1); \ } while(0) #define EMBED(ev) do { \ int saved_target = arg->target->target; \ REDIR(OT_TYPE_DECLS); \ arg->embed++; \ INDENTED(arg_t _tmp = *arg; \ _tmp.expr = ev; \ _tmp.default_cb(&_tmp); \ ); \ arg->embed--; \ if(ev->expr_type != A1TC_EXTENSIBLE) \ OUT(";\n"); \ assert(arg->target->target == OT_TYPE_DECLS); \ REDIR(saved_target); \ } while(0) /* Output a piece of text into a default stream */ #define OUT(fmt, args...) asn1c_compiled_output(arg, fmt, ##args) #define OUT_NOINDENT(fmt, args...) do { \ int _saved_indent = INDENT_LEVEL; \ INDENT_LEVEL = 0; \ OUT(fmt, ##args); \ INDENT_LEVEL = _saved_indent; \ } while(0) #define OUT_DEBUG(fmt, args...) do { \ if(arg->flags & A1C_DEBUG) OUT(fmt, ##args); \ } while(0) /* Generate #include line */ #define GEN_INCLUDE_STD(typename) do { \ if((arg->flags & A1C_INCLUDES_QUOTED)) { \ GEN_INCLUDE("\"" typename ".h\""); \ } else { \ GEN_INCLUDE("<" typename ".h>"); \ } } while(0) #define GEN_INCLUDE(filename) do { \ int saved_target = arg->target->target; \ if(!filename) break; \ REDIR(OT_INCLUDES); \ OUT_NOINDENT("#include %s\n", filename); \ REDIR(saved_target); \ } while(0) #define GEN_POSTINCLUDE(filename) do { \ int saved_target = arg->target->target; \ if(!filename) break; \ REDIR(OT_POST_INCLUDE); \ OUT_NOINDENT("#include %s\n", filename); \ REDIR(saved_target); \ } while(0) /* Generate ASN.1 type declaration */ #define GEN_DECLARE(expr) do { \ int saved_target = arg->target->target; \ REDIR(OT_FUNC_DECLS); \ OUT_NOINDENT("extern asn_TYPE_descriptor_t " \ "asn_DEF_%s;\n", MKID(expr)); \ REDIR(saved_target); \ } while(0) /* * Format LONG_MIN according to C90 rules. */ #define OINT(iv) do { \ if(iv == (-2147483647L - 1)) \ OUT("(-2147483647L - 1)"); \ else \ OUT("%" PRIdASN, iv); \ } while(0) #define OINTS(iv) do { \ if(iv == (-2147483647L - 1)) \ OUT("(-2147483647L - 1)"); \ else \ OUT("% " PRIdASN, iv); \ } while(0) #endif /* _ASN1_COMPILED_OUTPUT_H_ */ asn1c-0.9.24+dfsg/libasn1compiler/asn1c_fdeps.c0000644000000000000000000000745311472004363017657 0ustar rootroot#include "asn1c_internal.h" #include "asn1c_fdeps.h" static asn1c_fdeps_t *asn1c_new_dep(const char *filename); static int asn1c_dep_add(asn1c_fdeps_t *deps, asn1c_fdeps_t *d); int asn1c_activate_dependency(asn1c_fdeps_t *deps, asn1c_fdeps_t *cur, const char *data) { const char *fname; int i; if(!deps || !data || !*data) return 0; if(!cur) cur = deps; if(cur->usage > FDEP_NOTUSED) return 1; /* Already activated */ fname = data; if(*data == '#') { const char *start = data; const char *end = 0; start = strchr(data, '<'); if(start) { start++; end = strchr(start, '>'); } else if((start = strchr(data, '\"'))) { start++; end = strchr(start, '\"'); } if(end) { char *p = alloca((end - start) + 1); memcpy(p, start, end - start); p[end-start] = '\0'; fname = p; } else { return 0; } } if(cur->filename && strcmp(cur->filename, fname) == 0) { cur->usage = FDEP_REFERRED; /* Activate subdependencies */ for(i = 0; i < cur->el_count; i++) { asn1c_activate_dependency(deps, cur->elements[i], cur->elements[i]->filename); } /* * This might be a link to someplace else. */ return asn1c_activate_dependency(deps, NULL, fname); } else { for(i = 0; i < cur->el_count; i++) { asn1c_activate_dependency(deps, cur->elements[i], fname); } } return 0; } asn1c_fdeps_t * asn1c_read_file_dependencies(arg_t *arg, const char *datadir) { char buf[4096]; asn1c_fdeps_t *deps; asn1c_fdeps_t *cur; FILE *f; enum fdep_usage special_section = FDEP_NOTUSED; (void)arg; if(!datadir || strlen(datadir) > sizeof(buf) / 2) { errno = EINVAL; return NULL; } else { sprintf(buf, "%s/file-dependencies", datadir); } f = fopen(buf, "r"); if(!f) return NULL; deps = asn1c_new_dep(0); assert(deps); while(fgets(buf, sizeof(buf), f)) { char *p = strchr(buf, '#'); if(p) *p = '\0'; /* Remove comments */ cur = deps; for(p = strtok(buf, " \t\r\n"); p; p = strtok(NULL, " \t\r\n")) { asn1c_fdeps_t *d; /* * Special "prefix" section. */ if(strchr(p, ':')) { special_section = FDEP_IGNORE; if(strcmp(p, "COMMON-FILES:") == 0) { special_section = FDEP_COMMON_FILES; } else if(strcmp(p, "CONVERTER:") == 0) { special_section = FDEP_CONVERTER; } else if((arg->flags & A1C_GEN_PER) && strcmp(p, "CODEC-PER:") == 0) { special_section = FDEP_CODEC_PER; } break; } if(special_section == FDEP_IGNORE) continue; d = asn1c_new_dep(p); d->usage = special_section; if(asn1c_dep_add(cur, d) == 1) cur = d; } } fclose(f); return deps; } static asn1c_fdeps_t * asn1c_new_dep(const char *filename) { asn1c_fdeps_t *d; d = calloc(1, sizeof(*d)); if(filename) { d->filename = strdup(filename); if(!d->filename) return NULL; } return d; } static int asn1c_dep_add(asn1c_fdeps_t *deps, asn1c_fdeps_t *d) { int n; /* Check for duplicates */ for(n = 0; n < deps->el_count; n++) { if(strcmp(deps->elements[n]->filename, d->filename) == 0) return 0; } if(deps->el_count == deps->el_size) { void *p; n = deps->el_size?deps->el_size << 2:16; p = realloc(deps->elements, n * sizeof(deps->elements[0])); assert(p); deps->elements = p; deps->el_size = n; } deps->elements[deps->el_count++] = d; return 1; } asn1c_fdeps_t * asn1c_deps_makelist(asn1c_fdeps_t *deps) { asn1c_fdeps_t *dlist; asn1c_fdeps_t *d; int i; if(!deps) { errno = EINVAL; return 0; } dlist = asn1c_new_dep(0); if(deps->filename && deps->usage != FDEP_NOTUSED) { d = asn1c_new_dep(deps->filename); d->usage = deps->usage; asn1c_dep_add(dlist, d); } for(i = 0; i < deps->el_count; i++) { int j; d = asn1c_deps_makelist(deps->elements[i]); assert(!d->filename); for(j = 0; j < d->el_count; j++) { asn1c_dep_add(dlist, d->elements[j]); } } return dlist; } asn1c-0.9.24+dfsg/libasn1compiler/asn1compiler.c0000644000000000000000000000745511472004363020070 0ustar rootroot#include "asn1c_internal.h" #include "asn1c_lang.h" #include "asn1c_out.h" #include "asn1c_save.h" static void default_logger_cb(int, const char *fmt, ...); static int asn1c_compile_expr(arg_t *arg); static int asn1c_attach_streams(asn1p_expr_t *expr); int asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags flags, int argc, int optc, char **argv) { arg_t arg_s; arg_t *arg = &arg_s; asn1p_module_t *mod; int ret; /* * Initialize target language. */ ret = asn1c_with_language(ASN1C_LANGUAGE_C); assert(ret == 0); memset(arg, 0, sizeof(*arg)); arg->default_cb = asn1c_compile_expr; arg->logger_cb = default_logger_cb; arg->flags = flags; arg->asn = asn; /* * Compile each individual top level structure. */ TQ_FOR(mod, &(asn->modules), mod_next) { TQ_FOR(arg->expr, &(mod->members), next) { compiler_streams_t *cs = NULL; if(asn1c_attach_streams(arg->expr)) return -1; cs = arg->expr->data; cs->target = OT_TYPE_DECLS; arg->target = cs; ret = asn1c_compile_expr(arg); if(ret) { FATAL("Cannot compile \"%s\" (%x:%x) at line %d", arg->expr->Identifier, arg->expr->expr_type, arg->expr->meta_type, arg->expr->_lineno); return ret; } } } DEBUG("Saving compiled data"); /* * Save or print out the compiled result. */ if(asn1c_save_compiled_output(arg, datadir, argc, optc, argv)) return -1; return 0; } static int asn1c_compile_expr(arg_t *arg) { asn1p_expr_t *expr = arg->expr; int (*type_cb)(arg_t *); int ret; assert((int)expr->meta_type >= AMT_INVALID); assert(expr->meta_type < AMT_EXPR_META_MAX); assert((int)expr->expr_type >= A1TC_INVALID); assert(expr->expr_type < ASN_EXPR_TYPE_MAX); type_cb = asn1_lang_map[expr->meta_type][expr->expr_type].type_cb; if(type_cb) { DEBUG("Compiling %s at line %d", expr->Identifier, expr->_lineno); if(expr->lhs_params && expr->spec_index == -1) { int i; ret = 0; DEBUG("Parameterized type %s at line %d: %s (%d)", expr->Identifier, expr->_lineno, expr->specializations.pspecs_count ? "compiling" : "unused, skipping"); for(i = 0; ispecializations.pspecs_count; i++) { arg->expr = expr->specializations .pspec[i].my_clone; ret = asn1c_compile_expr(arg); if(ret) break; } arg->expr = expr; /* Restore */ } else { ret = type_cb(arg); if(arg->target->destination[OT_TYPE_DECLS] .indent_level == 0) OUT(";\n"); } } else { ret = -1; /* * Even if the target language compiler does not know * how to compile the given expression, we know that * certain expressions need not to be compiled at all. */ switch(expr->meta_type) { case AMT_OBJECT: case AMT_OBJECTCLASS: case AMT_OBJECTFIELD: case AMT_VALUE: case AMT_VALUESET: ret = 0; break; default: break; } } if(ret == -1) { FATAL("Cannot compile \"%s\" (%x:%x) at line %d", arg->expr->Identifier, arg->expr->expr_type, arg->expr->meta_type, arg->expr->_lineno); OUT("#error Cannot compile \"%s\" (%x/%x) at line %d\n", arg->expr->Identifier, arg->expr->meta_type, arg->expr->expr_type, arg->expr->_lineno ); } return ret; } static int asn1c_attach_streams(asn1p_expr_t *expr) { compiler_streams_t *cs; int i; if(expr->data) return 0; /* Already attached? */ expr->data = calloc(1, sizeof(compiler_streams_t)); if(expr->data == NULL) return -1; cs = expr->data; for(i = 0; i < OT_MAX; i++) { TQ_INIT(&(cs->destination[i].chunks)); } return 0; } static void default_logger_cb(int _severity, const char *fmt, ...) { va_list ap; char *pfx = ""; switch(_severity) { case -1: pfx = "DEBUG: "; break; case 0: pfx = "WARNING: "; break; case 1: pfx = "FATAL: "; break; } fprintf(stderr, "%s", pfx); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n"); } asn1c-0.9.24+dfsg/libasn1compiler/asn1c_C.c0000644000000000000000000022074511702614013016734 0ustar rootroot/* * Don't look into this file. First, because it's a mess, and second, because * it's a brain of the compiler, and you don't wanna mess with brains do you? ;) */ #include "asn1c_internal.h" #include "asn1c_C.h" #include "asn1c_constraint.h" #include "asn1c_out.h" #include "asn1c_misc.h" #include /* constraint groker from libasn1fix */ #include /* other exportables from libasn1fix */ typedef struct tag2el_s { struct asn1p_type_tag_s el_tag; int el_no; int toff_first; int toff_last; asn1p_expr_t *from_expr; } tag2el_t; typedef enum fte { FTE_ALLTAGS, FTE_CANONICAL_XER, } fte_e; static int _fill_tag2el_map(arg_t *arg, tag2el_t **tag2el, int *count, int el_no, fte_e flags); static int _add_tag2el_member(arg_t *arg, tag2el_t **tag2el, int *count, int el_no, fte_e flags); enum onc_flags { ONC_noflags = 0x00, ONC_avoid_keywords = 0x01, ONC_force_compound_name = 0x02, }; static int out_name_chain(arg_t *arg, enum onc_flags); static int asn1c_lang_C_type_SEQUENCE_def(arg_t *arg); static int asn1c_lang_C_type_SET_def(arg_t *arg); static int asn1c_lang_C_type_CHOICE_def(arg_t *arg); static int asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of); static int _print_tag(arg_t *arg, struct asn1p_type_tag_s *tag_p); static int compute_extensions_start(asn1p_expr_t *expr); static int expr_break_recursion(arg_t *arg, asn1p_expr_t *expr); static int expr_as_xmlvaluelist(arg_t *arg, asn1p_expr_t *expr); static int expr_elements_count(arg_t *arg, asn1p_expr_t *expr); static int emit_single_member_PER_constraint(arg_t *arg, asn1cnst_range_t *range, int juscountvalues, char *type); static int emit_member_PER_constraints(arg_t *arg, asn1p_expr_t *expr, const char *pfx); static int emit_member_table(arg_t *arg, asn1p_expr_t *expr); static int emit_tag2member_map(arg_t *arg, tag2el_t *tag2el, int tag2el_count, const char *opt_modifier); static int emit_include_dependencies(arg_t *arg); static asn1p_expr_t *terminal_structable(arg_t *arg, asn1p_expr_t *expr); static int expr_defined_recursively(arg_t *arg, asn1p_expr_t *expr); static int asn1c_recurse(arg_t *arg, asn1p_expr_t *expr, int (*callback)(arg_t *arg, void *key), void *key); static asn1p_expr_type_e expr_get_type(arg_t *arg, asn1p_expr_t *expr); static int try_inline_default(arg_t *arg, asn1p_expr_t *expr, int out); static int *compute_canonical_members_order(arg_t *arg, int el_count); enum tvm_compat { _TVM_SAME = 0, /* tags and all_tags are same */ _TVM_SUBSET = 1, /* tags are subset of all_tags */ _TVM_DIFFERENT = 2, /* tags and all_tags are different */ }; static enum tvm_compat emit_tags_vectors(arg_t *arg, asn1p_expr_t *expr, int *tc, int *atc); enum etd_spec { ETD_NO_SPECIFICS, ETD_HAS_SPECIFICS }; static int emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_count, int all_tags_count, int elements_count, enum etd_spec); #define C99_MODE (!(arg->flags & A1C_NO_C99)) #define UNNAMED_UNIONS (arg->flags & A1C_UNNAMED_UNIONS) #define HIDE_INNER_DEFS (arg->embed && !(arg->flags & A1C_ALL_DEFS_GLOBAL)) #define PCTX_DEF INDENTED( \ OUT("\n"); \ OUT("/* Context for parsing across buffer boundaries */\n"); \ OUT("asn_struct_ctx_t _asn_ctx;\n")); #define DEPENDENCIES do { \ emit_include_dependencies(arg); \ if(expr->expr_type == ASN_CONSTR_SET_OF) \ GEN_INCLUDE_STD("asn_SET_OF"); \ if(expr->expr_type == ASN_CONSTR_SEQUENCE_OF) \ GEN_INCLUDE_STD("asn_SEQUENCE_OF"); \ } while(0) /* MKID_safe() without checking for reserved keywords */ #define MKID(expr) (asn1c_make_identifier(0, expr, 0)) #define MKID_safe(expr) (asn1c_make_identifier(AMI_CHECK_RESERVED, expr, 0)) int asn1c_lang_C_type_REAL(arg_t *arg) { return asn1c_lang_C_type_SIMPLE_TYPE(arg); } struct value2enum { asn1c_integer_t value; const char *name; int idx; }; static int compar_enumMap_byName(const void *ap, const void *bp) { const struct value2enum *a = (const struct value2enum *)ap; const struct value2enum *b = (const struct value2enum *)bp; return strcmp(a->name, b->name); } static int compar_enumMap_byValue(const void *ap, const void *bp) { const struct value2enum *a = (const struct value2enum *)ap; const struct value2enum *b = (const struct value2enum *)bp; if(a->value < b->value) return -1; else if(a->value == b->value) return 0; return 1; } int asn1c_lang_C_type_common_INTEGER(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int el_count = expr_elements_count(arg, expr); struct value2enum *v2e; int map_extensions = (expr->expr_type == ASN_BASIC_INTEGER); int eidx; v2e = alloca((el_count + 1) * sizeof(*v2e)); /* * For all ENUMERATED types and for those INTEGER types which * have identifiers, print out an enumeration table. */ if(expr->expr_type == ASN_BASIC_ENUMERATED || el_count) { eidx = 0; REDIR(OT_DEPS); OUT("typedef enum "); out_name_chain(arg, ONC_avoid_keywords); OUT(" {\n"); TQ_FOR(v, &(expr->members), next) { switch(v->expr_type) { case A1TC_UNIVERVAL: OUT("\t"); out_name_chain(arg, ONC_noflags); OUT("_%s", MKID(v)); OUT("\t= %" PRIdASN "%s\n", v->value->value.v_integer, (eidx+1 < el_count) ? "," : ""); v2e[eidx].name = v->Identifier; v2e[eidx].value = v->value->value.v_integer; eidx++; break; case A1TC_EXTENSIBLE: OUT("\t/*\n"); OUT("\t * Enumeration is extensible\n"); OUT("\t */\n"); if(!map_extensions) map_extensions = eidx + 1; break; default: return -1; } } OUT("} e_"); out_name_chain(arg, ONC_noflags); OUT(";\n"); assert(eidx == el_count); } /* * For all ENUMERATED types print out a mapping table * between identifiers and associated values. * This is prohibited for INTEGER types by by X.693:8.3.4. */ if(expr->expr_type == ASN_BASIC_ENUMERATED) { /* * Generate a enumerationName<->value map for XER codec. */ REDIR(OT_STAT_DEFS); OUT("static asn_INTEGER_enum_map_t asn_MAP_%s_value2enum_%d[] = {\n", MKID(expr), expr->_type_unique_index); qsort(v2e, el_count, sizeof(v2e[0]), compar_enumMap_byValue); for(eidx = 0; eidx < el_count; eidx++) { v2e[eidx].idx = eidx; OUT("\t{ %" PRIdASN ",\t%ld,\t\"%s\" }%s\n", v2e[eidx].value, (long)strlen(v2e[eidx].name), v2e[eidx].name, (eidx + 1 < el_count) ? "," : ""); } if(map_extensions) OUT("\t/* This list is extensible */\n"); OUT("};\n"); OUT("static unsigned int asn_MAP_%s_enum2value_%d[] = {\n", MKID(expr), expr->_type_unique_index); qsort(v2e, el_count, sizeof(v2e[0]), compar_enumMap_byName); for(eidx = 0; eidx < el_count; eidx++) { OUT("\t%d%s\t/* %s(%" PRIdASN ") */\n", v2e[eidx].idx, (eidx + 1 < el_count) ? "," : "", v2e[eidx].name, v2e[eidx].value); } if(map_extensions) OUT("\t/* This list is extensible */\n"); OUT("};\n"); OUT("static asn_INTEGER_specifics_t asn_SPC_%s_specs_%d = {\n", MKID(expr), expr->_type_unique_index); INDENT(+1); OUT("asn_MAP_%s_value2enum_%d,\t" "/* \"tag\" => N; sorted by tag */\n", MKID(expr), expr->_type_unique_index); OUT("asn_MAP_%s_enum2value_%d,\t" "/* N => \"tag\"; sorted by N */\n", MKID(expr), expr->_type_unique_index); OUT("%d,\t/* Number of elements in the maps */\n", el_count); if(map_extensions) { OUT("%d,\t/* Extensions before this member */\n", map_extensions); } else { OUT("0,\t/* Enumeration is not extensible */\n"); } if(expr->expr_type == ASN_BASIC_ENUMERATED) OUT("1,\t/* Strict enumeration */\n"); else OUT("0,\n"); OUT("0,\t/* Native long size */\n"); OUT("0\n"); INDENT(-1); OUT("};\n"); } if(expr->expr_type == ASN_BASIC_INTEGER && asn1c_type_fits_long(arg, expr) == FL_FITS_UNSIGN) { REDIR(OT_STAT_DEFS); OUT("static asn_INTEGER_specifics_t asn_SPC_%s_specs_%d = {\n", MKID(expr), expr->_type_unique_index); INDENT(+1); OUT("0,\t"); OUT("0,\t"); OUT("0,\t"); OUT("0,\t"); OUT("0,\n"); OUT("0,\t/* Native long size */\n"); OUT("1\t/* Unsigned representation */\n"); INDENT(-1); OUT("};\n"); } return asn1c_lang_C_type_SIMPLE_TYPE(arg); } int asn1c_lang_C_type_BIT_STRING(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int el_count = expr_elements_count(arg, expr); if(el_count) { int eidx = 0; REDIR(OT_DEPS); OUT("typedef enum "); out_name_chain(arg, ONC_avoid_keywords); OUT(" {\n"); TQ_FOR(v, &(expr->members), next) { if(v->expr_type != A1TC_UNIVERVAL) { OUT("/* Unexpected BIT STRING element: %s */\n", v->Identifier); continue; } eidx++; OUT("\t"); out_name_chain(arg, ONC_noflags); OUT("_%s", MKID(v)); OUT("\t= %" PRIdASN "%s\n", v->value->value.v_integer, (eidx < el_count) ? "," : ""); } OUT("} e_"); out_name_chain(arg, ONC_noflags); OUT(";\n"); assert(eidx == el_count); } return asn1c_lang_C_type_SIMPLE_TYPE(arg); } int asn1c_lang_C_type_SEQUENCE(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int comp_mode = 0; /* {root,ext=1,root,root,...} */ DEPENDENCIES; if(arg->embed) { OUT("struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(" {\n"); } else { OUT("typedef struct %s {\n", MKID_safe(expr)); } TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) if(comp_mode < 3) comp_mode++; if(comp_mode == 1) v->marker.flags |= EM_OMITABLE | EM_INDIRECT; try_inline_default(arg, v, 1); EMBED(v); } PCTX_DEF; OUT("} %s%s%s", (expr->marker.flags & EM_INDIRECT)?"*":"", expr->_anonymous_type ? "" : arg->embed ? MKID_safe(expr) : MKID(expr), arg->embed ? "" : "_t"); return asn1c_lang_C_type_SEQUENCE_def(arg); } static int asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int elements; /* Number of elements */ int ext_start = -2; int ext_stop = -2; tag2el_t *tag2el = NULL; int tag2el_count = 0; int tags_count; int all_tags_count; enum tvm_compat tv_mode; int roms_count; /* Root optional members */ int aoms_count; /* Additions optional members */ /* * Fetch every inner tag from the tag to elements map. */ if(_fill_tag2el_map(arg, &tag2el, &tag2el_count, -1, FTE_ALLTAGS)) { if(tag2el) free(tag2el); return -1; } GEN_INCLUDE_STD("constr_SEQUENCE"); if(!arg->embed) GEN_DECLARE(expr); /* asn_DEF_xxx */ REDIR(OT_STAT_DEFS); /* * Print out the table according to which parsing is performed. */ if(expr_elements_count(arg, expr)) { int comp_mode = 0; /* {root,ext=1,root,root,...} */ OUT("static asn_TYPE_member_t asn_MBR_%s_%d[] = {\n", MKID(expr), expr->_type_unique_index); elements = 0; roms_count = 0; aoms_count = 0; INDENTED(TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) { if((++comp_mode) == 1) ext_start = elements - 1; else ext_stop = elements - 1; continue; } if(v->marker.flags & EM_OMITABLE) comp_mode == 1 ? ++aoms_count : ++roms_count; emit_member_table(arg, v); elements++; }); OUT("};\n"); if((roms_count + aoms_count) && (arg->flags & A1C_GEN_PER)) { int elm = 0; int comma = 0; comp_mode = 0; OUT("static int asn_MAP_%s_oms_%d[] = {", MKID(expr), expr->_type_unique_index); TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) { ++comp_mode; continue; } if((v->marker.flags & EM_OMITABLE) && comp_mode != 1) { if(!comma) comma++; else OUT(","); OUT(" %d", elm); } ++elm; } elm = 0; comp_mode = 0; TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) { ++comp_mode; continue; } if((v->marker.flags & EM_OMITABLE) && comp_mode == 1) { if(!comma) comma++; else OUT(","); OUT(" %d", elm); } ++elm; } OUT(" };\n"); if(roms_count > 65536) FATAL("Too many optional elements in %s " "at line %d!", arg->expr->Identifier, arg->expr->_lineno); } else { roms_count = 0; aoms_count = 0; } } else { elements = 0; roms_count = 0; aoms_count = 0; } /* * Print out asn_DEF__[all_]tags[] vectors. */ tv_mode = emit_tags_vectors(arg, expr, &tags_count, &all_tags_count); /* * Tags to elements map. */ emit_tag2member_map(arg, tag2el, tag2el_count, 0); OUT("static asn_SEQUENCE_specifics_t asn_SPC_%s_specs_%d = {\n", MKID(expr), expr->_type_unique_index); INDENT(+1); OUT("sizeof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT("),\n"); OUT("offsetof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(", _asn_ctx),\n"); if(tag2el_count) { OUT("asn_MAP_%s_tag2el_%d,\n", MKID(expr), expr->_type_unique_index); OUT("%d,\t/* Count of tags in the map */\n", tag2el_count); } else { OUT("0,\t/* No top level tags */\n"); OUT("0,\t/* No tags in the map */\n"); } if(roms_count + aoms_count) { OUT("asn_MAP_%s_oms_%d,\t/* Optional members */\n", MKID(expr), expr->_type_unique_index); OUT("%d, %d,\t/* Root/Additions */\n", roms_count, aoms_count); } else { OUT("0, 0, 0,\t/* Optional elements (not needed) */\n"); } OUT("%d,\t/* Start extensions */\n", ext_start<0 ? -1 : ext_start); OUT("%d\t/* Stop extensions */\n", (ext_stopexpr; asn1p_expr_t *v; long mcount; char *id; int comp_mode = 0; /* {root,ext=1,root,root,...} */ DEPENDENCIES; REDIR(OT_DEPS); OUT("\n"); OUT("/*\n"); OUT(" * Method of determining the components presence\n"); OUT(" */\n"); mcount = 0; OUT("typedef enum "); out_name_chain(arg, ONC_noflags); OUT("_PR {\n"); TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) continue; INDENTED( out_name_chain(arg, ONC_noflags); OUT("_PR_"); id = MKID(v); OUT("%s,\t/* Member %s is present */\n", id, id) ); mcount++; } OUT("} "); out_name_chain(arg, ONC_noflags); OUT("_PR;\n"); REDIR(OT_TYPE_DECLS); if(arg->embed) { OUT("struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(" {\n"); } else { OUT("typedef struct %s {\n", MKID_safe(expr)); } TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) if(comp_mode < 3) comp_mode++; if(comp_mode == 1) v->marker.flags |= EM_OMITABLE | EM_INDIRECT; try_inline_default(arg, v, 1); EMBED(v); } INDENTED( id = MKID(expr); OUT("\n"); OUT("/* Presence bitmask: ASN_SET_ISPRESENT(p%s, %s_PR_x) */\n", id, id); OUT("unsigned int _presence_map\n"); OUT("\t[((%ld+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];\n", mcount); ); PCTX_DEF; OUT("} %s%s%s", (expr->marker.flags & EM_INDIRECT)?"*":"", expr->_anonymous_type ? "" : MKID_safe(expr), arg->embed ? "" : "_t"); return asn1c_lang_C_type_SET_def(arg); } static int asn1c_lang_C_type_SET_def(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int elements; tag2el_t *tag2el = NULL; int tag2el_count = 0; tag2el_t *tag2el_cxer = NULL; int tag2el_cxer_count = 0; int tags_count; int all_tags_count; enum tvm_compat tv_mode; char *p; /* * Fetch every inner tag from the tag to elements map. */ if(_fill_tag2el_map(arg, &tag2el, &tag2el_count, -1, FTE_ALLTAGS)) { if(tag2el) free(tag2el); return -1; } if(_fill_tag2el_map(arg, &tag2el_cxer, &tag2el_cxer_count, -1, FTE_CANONICAL_XER)) { if(tag2el) free(tag2el); if(tag2el_cxer) free(tag2el_cxer); return -1; } if(tag2el_cxer_count == tag2el_count && memcmp(tag2el, tag2el_cxer, tag2el_count) == 0) { free(tag2el_cxer); tag2el_cxer = 0; } GEN_INCLUDE_STD("constr_SET"); if(!arg->embed) GEN_DECLARE(expr); /* asn_DEF_xxx */ REDIR(OT_STAT_DEFS); /* * Print out the table according to which parsing is performed. */ if(expr_elements_count(arg, expr)) { int comp_mode = 0; /* {root,ext=1,root,root,...} */ OUT("static asn_TYPE_member_t asn_MBR_%s_%d[] = {\n", MKID(expr), expr->_type_unique_index); elements = 0; INDENTED(TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) { if(comp_mode < 3) comp_mode++; } else { emit_member_table(arg, v); elements++; } }); OUT("};\n"); } else { elements = 0; } /* * Print out asn_DEF__[all_]tags[] vectors. */ tv_mode = emit_tags_vectors(arg, expr, &tags_count, &all_tags_count); /* * Tags to elements map. */ emit_tag2member_map(arg, tag2el, tag2el_count, 0); if(tag2el_cxer) emit_tag2member_map(arg, tag2el_cxer, tag2el_cxer_count, "_cxer"); /* * Emit a map of mandatory elements. */ OUT("static uint8_t asn_MAP_%s_mmap_%d", MKID(expr), expr->_type_unique_index); p = MKID_safe(expr); OUT("[(%d + (8 * sizeof(unsigned int)) - 1) / 8]", elements); OUT(" = {\n"); INDENTED( if(elements) { int el = 0; TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) continue; if(el) { if((el % 8) == 0) OUT(",\n"); else OUT(" | "); } OUT("(%d << %d)", (v->marker.flags & EM_OMITABLE) != EM_OMITABLE, 7 - (el % 8)); el++; } } else { OUT("0"); } ); OUT("\n"); OUT("};\n"); OUT("static asn_SET_specifics_t asn_SPC_%s_specs_%d = {\n", MKID(expr), expr->_type_unique_index); INDENTED( OUT("sizeof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT("),\n"); OUT("offsetof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(", _asn_ctx),\n"); OUT("offsetof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(", _presence_map),\n"); p = MKID(expr); OUT("asn_MAP_%s_tag2el_%d,\n", p, expr->_type_unique_index); OUT("%d,\t/* Count of tags in the map */\n", tag2el_count); if(tag2el_cxer) OUT("asn_MAP_%s_tag2el_cxer_%d,\n", p, expr->_type_unique_index); else OUT("asn_MAP_%s_tag2el_%d,\t/* Same as above */\n", p, expr->_type_unique_index); OUT("%d,\t/* Count of tags in the CXER map */\n", tag2el_cxer_count); OUT("%d,\t/* Whether extensible */\n", compute_extensions_start(expr) == -1 ? 0 : 1); OUT("(unsigned int *)asn_MAP_%s_mmap_%d\t/* Mandatory elements map */\n", p, expr->_type_unique_index); ); OUT("};\n"); /* * Emit asn_DEF_xxx table. */ emit_type_DEF(arg, expr, tv_mode, tags_count, all_tags_count, elements, ETD_HAS_SPECIFICS); REDIR(OT_TYPE_DECLS); return 0; } /* _SET_def() */ int asn1c_lang_C_type_SEx_OF(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *memb = TQ_FIRST(&expr->members); DEPENDENCIES; if(arg->embed) { OUT("struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(" {\n"); } else { OUT("typedef struct %s {\n", MKID_safe(expr)); } INDENT(+1); OUT("A_%s_OF(", (arg->expr->expr_type == ASN_CONSTR_SET_OF) ? "SET" : "SEQUENCE"); /* * README README * The implementation of the A_SET_OF() macro is already indirect. */ memb->marker.flags |= EM_INDIRECT; if(memb->expr_type & ASN_CONSTR_MASK || ((memb->expr_type == ASN_BASIC_ENUMERATED || (0 /* -- prohibited by X.693:8.3.4 */ && memb->expr_type == ASN_BASIC_INTEGER)) && expr_elements_count(arg, memb))) { arg_t tmp; asn1p_expr_t tmp_memb; arg->embed++; tmp = *arg; tmp.expr = &tmp_memb; tmp_memb = *memb; tmp_memb.marker.flags &= ~EM_INDIRECT; tmp_memb._anonymous_type = 1; if(tmp_memb.Identifier == 0) { tmp_memb.Identifier = "Member"; if(0) tmp_memb.Identifier = strdup( asn1c_make_identifier(0, expr, "Member", 0)); assert(tmp_memb.Identifier); } tmp.default_cb(&tmp); if(tmp_memb.Identifier != memb->Identifier) if(0) free(tmp_memb.Identifier); arg->embed--; assert(arg->target->target == OT_TYPE_DECLS); } else { OUT("%s", asn1c_type_name(arg, memb, (memb->marker.flags & EM_UNRECURSE) ? TNF_RSAFE : TNF_CTYPE)); } /* README README (above) */ if(0 && (memb->marker.flags & EM_INDIRECT)) OUT(" *"); OUT(") list;\n"); INDENT(-1); PCTX_DEF; OUT("} %s%s%s", (expr->marker.flags & EM_INDIRECT)?"*":"", expr->_anonymous_type ? "" : MKID_safe(expr), arg->embed ? "" : "_t"); /* * SET OF/SEQUENCE OF definition */ return asn1c_lang_C_type_SEx_OF_def(arg, (arg->expr->expr_type == ASN_CONSTR_SEQUENCE_OF)); } static int asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int tags_count; int all_tags_count; enum tvm_compat tv_mode; /* * Print out the table according to which parsing is performed. */ if(seq_of) { GEN_INCLUDE_STD("constr_SEQUENCE_OF"); } else { GEN_INCLUDE_STD("constr_SET_OF"); } if(!arg->embed) GEN_DECLARE(expr); /* asn_DEF_xxx */ REDIR(OT_STAT_DEFS); /* * Print out the table according to which parsing is performed. */ OUT("static asn_TYPE_member_t asn_MBR_%s_%d[] = {\n", MKID(expr), expr->_type_unique_index); INDENT(+1); v = TQ_FIRST(&(expr->members)); if(!v->Identifier) { v->Identifier = strdup("Member"); assert(v->Identifier); } v->_anonymous_type = 1; arg->embed++; emit_member_table(arg, v); arg->embed--; INDENT(-1); OUT("};\n"); /* * Print out asn_DEF__[all_]tags[] vectors. */ tv_mode = emit_tags_vectors(arg, expr, &tags_count, &all_tags_count); OUT("static asn_SET_OF_specifics_t asn_SPC_%s_specs_%d = {\n", MKID(expr), expr->_type_unique_index); INDENTED( OUT("sizeof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT("),\n"); OUT("offsetof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(", _asn_ctx),\n"); { int as_xvl = expr_as_xmlvaluelist(arg, v); OUT("%d,\t/* XER encoding is %s */\n", as_xvl, as_xvl ? "XMLValueList" : "XMLDelimitedItemList"); } ); OUT("};\n"); /* * Emit asn_DEF_xxx table. */ emit_type_DEF(arg, expr, tv_mode, tags_count, all_tags_count, 1, ETD_HAS_SPECIFICS); REDIR(OT_TYPE_DECLS); return 0; } /* _SEx_OF_def() */ int asn1c_lang_C_type_CHOICE(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; char *id; DEPENDENCIES; REDIR(OT_DEPS); OUT("typedef enum "); out_name_chain(arg, ONC_noflags); OUT("_PR {\n"); INDENTED( int skipComma = 1; out_name_chain(arg, ONC_noflags); OUT("_PR_NOTHING,\t/* No components present */\n"); TQ_FOR(v, &(expr->members), next) { if(skipComma) skipComma = 0; else OUT(",\n"); if(v->expr_type == A1TC_EXTENSIBLE) { OUT("/* Extensions may appear below */\n"); skipComma = 1; continue; } out_name_chain(arg, ONC_noflags); id = MKID(v); OUT("_PR_%s", id); } OUT("\n"); ); OUT("} "); out_name_chain(arg, ONC_noflags); OUT("_PR;\n"); REDIR(OT_TYPE_DECLS); if(arg->embed) { OUT("struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(" {\n"); } else { OUT("typedef struct %s {\n", MKID_safe(expr)); } INDENTED( out_name_chain(arg, ONC_noflags); OUT("_PR present;\n"); OUT("union "); if(UNNAMED_UNIONS == 0) { out_name_chain(arg, ONC_force_compound_name); OUT("_u "); } OUT("{\n"); TQ_FOR(v, &(expr->members), next) { EMBED(v); } if(UNNAMED_UNIONS) OUT("};\n"); else OUT("} choice;\n"); ); PCTX_DEF; OUT("} %s%s%s", (expr->marker.flags & EM_INDIRECT)?"*":"", expr->_anonymous_type ? "" : arg->embed ? MKID_safe(expr) : MKID(expr), arg->embed ? "" : "_t"); return asn1c_lang_C_type_CHOICE_def(arg); } static int asn1c_lang_C_type_CHOICE_def(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int elements; /* Number of elements */ tag2el_t *tag2el = NULL; int tag2el_count = 0; int tags_count; int all_tags_count; enum tvm_compat tv_mode; int *cmap = 0; /* * Fetch every inner tag from the tag to elements map. */ if(_fill_tag2el_map(arg, &tag2el, &tag2el_count, -1, FTE_ALLTAGS)) { if(tag2el) free(tag2el); return -1; } GEN_INCLUDE_STD("constr_CHOICE"); if(!arg->embed) GEN_DECLARE(expr); /* asn_DEF_xxx */ REDIR(OT_STAT_DEFS); /* * Print out the table according to which parsing is performed. */ if(expr_elements_count(arg, expr)) { OUT("static asn_TYPE_member_t asn_MBR_%s_%d[] = {\n", MKID(expr), expr->_type_unique_index); elements = 0; INDENTED(TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) continue; emit_member_table(arg, v); elements++; }); OUT("};\n"); } else { elements = 0; } /* Create a canonical elements map */ if(elements && (arg->flags & A1C_GEN_PER)) { int i; cmap = compute_canonical_members_order(arg, elements); if(cmap) { OUT("static int asn_MAP_%s_cmap_%d[] = {", MKID(expr), expr->_type_unique_index); for(i = 0; i < elements; i++) { if(i) OUT(","); OUT(" %d", cmap[i]); } OUT(" };\n"); free(cmap); } } if(arg->embed) { /* * Our parent structure has already taken this into account. */ tv_mode = _TVM_SAME; tags_count = all_tags_count = 0; } else { tv_mode = emit_tags_vectors(arg, expr, &tags_count, &all_tags_count); } /* * Tags to elements map. */ emit_tag2member_map(arg, tag2el, tag2el_count, 0); OUT("static asn_CHOICE_specifics_t asn_SPC_%s_specs_%d = {\n", MKID(expr), expr->_type_unique_index); INDENTED( OUT("sizeof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT("),\n"); OUT("offsetof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(", _asn_ctx),\n"); OUT("offsetof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(", present),\n"); OUT("sizeof(((struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(" *)0)->present),\n"); OUT("asn_MAP_%s_tag2el_%d,\n", MKID(expr), expr->_type_unique_index); OUT("%d,\t/* Count of tags in the map */\n", tag2el_count); if(C99_MODE) OUT(".canonical_order = "); if(cmap) OUT("asn_MAP_%s_cmap_%d,\t/* Canonically sorted */\n", MKID(expr), expr->_type_unique_index); else OUT("0,\n"); if(C99_MODE) OUT(".ext_start = "); OUT("%d\t/* Extensions start */\n", compute_extensions_start(expr)); ); OUT("};\n"); /* * Emit asn_DEF_xxx table. */ emit_type_DEF(arg, expr, tv_mode, tags_count, all_tags_count, elements, ETD_HAS_SPECIFICS); REDIR(OT_TYPE_DECLS); return 0; } /* _CHOICE_def() */ int asn1c_lang_C_type_REFERENCE(arg_t *arg) { asn1p_ref_t *ref; ref = arg->expr->reference; if(ref->components[ref->comp_count-1].name[0] == '&') { asn1p_expr_t *extract; arg_t tmp; int ret; extract = asn1f_class_access_ex(arg->asn, arg->expr->module, arg->expr, arg->expr->rhs_pspecs, ref); if(extract == NULL) return -1; extract = asn1p_expr_clone(extract, 0); if(extract) { if(extract->Identifier) free(extract->Identifier); extract->Identifier = strdup(arg->expr->Identifier); if(extract->Identifier == NULL) { asn1p_expr_free(extract); return -1; } } else { return -1; } tmp = *arg; tmp.asn = arg->asn; tmp.expr = extract; ret = arg->default_cb(&tmp); asn1p_expr_free(extract); return ret; } return asn1c_lang_C_type_SIMPLE_TYPE(arg); } int asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) { asn1p_expr_t *expr = arg->expr; int tags_count; int all_tags_count; enum tvm_compat tv_mode; enum etd_spec etd_spec; char *p; if(arg->embed) { enum tnfmt tnfmt = TNF_CTYPE; /* * If this is an optional compound type, * refer it using "struct X" convention, * as it may recursively include the current structure. */ if(expr->marker.flags & (EM_INDIRECT | EM_UNRECURSE)) { if(terminal_structable(arg, expr)) { tnfmt = TNF_RSAFE; REDIR(OT_FWD_DECLS); OUT("%s;\n", asn1c_type_name(arg, arg->expr, tnfmt)); } } REDIR(OT_TYPE_DECLS); OUT("%s", asn1c_type_name(arg, arg->expr, tnfmt)); if(!expr->_anonymous_type) { OUT("%s", (expr->marker.flags&EM_INDIRECT)?"\t*":"\t "); OUT("%s", MKID_safe(expr)); if((expr->marker.flags & (EM_DEFAULT & ~EM_INDIRECT)) == (EM_DEFAULT & ~EM_INDIRECT)) OUT("\t/* DEFAULT %s */", asn1f_printable_value( expr->marker.default_value)); else if((expr->marker.flags & EM_OPTIONAL) == EM_OPTIONAL) OUT("\t/* OPTIONAL */"); } } else { GEN_INCLUDE(asn1c_type_name(arg, expr, TNF_INCLUDE)); REDIR(OT_TYPE_DECLS); OUT("typedef %s\t", asn1c_type_name(arg, arg->expr, TNF_CTYPE)); OUT("%s%s_t", (expr->marker.flags & EM_INDIRECT)?"*":" ", MKID(expr)); } if((expr->expr_type == ASN_BASIC_ENUMERATED) || (0 /* -- prohibited by X.693:8.3.4 */ && expr->expr_type == ASN_BASIC_INTEGER && expr_elements_count(arg, expr)) || (expr->expr_type == ASN_BASIC_INTEGER && asn1c_type_fits_long(arg, expr) == FL_FITS_UNSIGN) ) etd_spec = ETD_HAS_SPECIFICS; else etd_spec = ETD_NO_SPECIFICS; /* * If this type just blindly refers the other type, alias it. * Type1 ::= Type2 */ if(arg->embed && etd_spec == ETD_NO_SPECIFICS) { REDIR(OT_TYPE_DECLS); return 0; } if((!expr->constraints || (arg->flags & A1C_NO_CONSTRAINTS)) && (arg->embed || expr->tag.tag_class == TC_NOCLASS) && etd_spec == ETD_NO_SPECIFICS && 0 /* This shortcut is incompatible with XER */ ) { char *type_name; REDIR(OT_FUNC_DECLS); type_name = asn1c_type_name(arg, expr, TNF_SAFE); OUT("/* This type is equivalent to %s */\n", type_name); if(HIDE_INNER_DEFS) OUT("/* "); OUT("#define\tasn_DEF_%s\t", MKID(expr)); type_name = asn1c_type_name(arg, expr, TNF_SAFE); OUT("asn_DEF_%s", type_name); if(HIDE_INNER_DEFS) OUT("\t// (Use -fall-defs-global to expose) */"); OUT("\n"); REDIR(OT_CODE); OUT("/* This type is equivalent to %s */\n", type_name); OUT("\n"); REDIR(OT_TYPE_DECLS); return 0; } REDIR(OT_CODE); /* * Constraint checking. */ if(!(arg->flags & A1C_NO_CONSTRAINTS)) { p = MKID(expr); if(HIDE_INNER_DEFS) OUT("static "); OUT("int\n"); OUT("%s", p); if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); OUT("_constraint(asn_TYPE_descriptor_t *td, const void *sptr,\n"); INDENT(+1); OUT("\t\tasn_app_constraint_failed_f *ctfailcb, void *app_key) {"); OUT("\n"); DEBUG("expr constraint checking code for %s", p); if(asn1c_emit_constraint_checking_code(arg) == 1) { OUT("/* Replace with underlying type checker */\n"); OUT("td->check_constraints " "= asn_DEF_%s.check_constraints;\n", asn1c_type_name(arg, expr, TNF_SAFE)); OUT("return td->check_constraints" "(td, sptr, ctfailcb, app_key);\n"); } INDENT(-1); OUT("}\n"); OUT("\n"); } REDIR(OT_STAT_DEFS); /* * Print out asn_DEF__[all_]tags[] vectors. */ tv_mode = emit_tags_vectors(arg, expr, &tags_count, &all_tags_count); DEBUG("emit tag vectors for %s %d, %d, %d", expr->Identifier, tv_mode, tags_count, all_tags_count); emit_type_DEF(arg, expr, tv_mode, tags_count, all_tags_count, 0, etd_spec); REDIR(OT_CODE); /* * Emit suicidal functions. */ /* * This function replaces certain fields from the definition * of a type with the corresponding fields from the basic type * (from which the current type is inherited). */ OUT("/*\n"); OUT(" * This type is implemented using %s,\n", asn1c_type_name(arg, expr, TNF_SAFE)); OUT(" * so here we adjust the DEF accordingly.\n"); OUT(" */\n"); OUT("static void\n"); OUT("%s_%d_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {\n", MKID(expr), expr->_type_unique_index); INDENT(+1); { asn1p_expr_t *terminal = asn1f_find_terminal_type_ex(arg->asn, expr); char *type_name = asn1c_type_name(arg, expr, TNF_SAFE); OUT("td->free_struct = asn_DEF_%s.free_struct;\n", type_name); OUT("td->print_struct = asn_DEF_%s.print_struct;\n", type_name); OUT("td->ber_decoder = asn_DEF_%s.ber_decoder;\n", type_name); OUT("td->der_encoder = asn_DEF_%s.der_encoder;\n", type_name); OUT("td->xer_decoder = asn_DEF_%s.xer_decoder;\n", type_name); OUT("td->xer_encoder = asn_DEF_%s.xer_encoder;\n", type_name); OUT("td->uper_decoder = asn_DEF_%s.uper_decoder;\n", type_name); OUT("td->uper_encoder = asn_DEF_%s.uper_encoder;\n", type_name); if(!terminal && !tags_count) { OUT("/* The next four lines are here because of -fknown-extern-type */\n"); OUT("td->tags = asn_DEF_%s.tags;\n", type_name); OUT("td->tags_count = asn_DEF_%s.tags_count;\n", type_name); OUT("td->all_tags = asn_DEF_%s.all_tags;\n", type_name); OUT("td->all_tags_count = asn_DEF_%s.all_tags_count;\n",type_name); OUT("/* End of these lines */\n"); } OUT("if(!td->per_constraints)\n"); OUT("\ttd->per_constraints = asn_DEF_%s.per_constraints;\n", type_name); OUT("td->elements = asn_DEF_%s.elements;\n", type_name); OUT("td->elements_count = asn_DEF_%s.elements_count;\n", type_name); if(etd_spec != ETD_NO_SPECIFICS) { INDENT(-1); OUT(" /* "); } OUT("td->specifics = asn_DEF_%s.specifics;", type_name); if(etd_spec == ETD_NO_SPECIFICS) { INDENT(-1); OUT("\n"); } else { OUT("\t// Defined explicitly */\n"); } } OUT("}\n"); OUT("\n"); p = MKID(expr); if(HIDE_INNER_DEFS) OUT("static "); OUT("void\n"); OUT("%s", p); if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); OUT("_free(asn_TYPE_descriptor_t *td,\n"); INDENTED( OUT("\tvoid *struct_ptr, int contents_only) {\n"); OUT("%s_%d_inherit_TYPE_descriptor(td);\n", p, expr->_type_unique_index); OUT("td->free_struct(td, struct_ptr, contents_only);\n"); ); OUT("}\n"); OUT("\n"); p = MKID(expr); if(HIDE_INNER_DEFS) OUT("static "); OUT("int\n"); OUT("%s", p); if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); OUT("_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,\n"); INDENTED( OUT("\tint ilevel, asn_app_consume_bytes_f *cb, void *app_key) {\n"); OUT("%s_%d_inherit_TYPE_descriptor(td);\n", p, expr->_type_unique_index); OUT("return td->print_struct(td, struct_ptr, ilevel, cb, app_key);\n"); ); OUT("}\n"); OUT("\n"); p = MKID(expr); if(HIDE_INNER_DEFS) OUT("static "); OUT("asn_dec_rval_t\n"); OUT("%s", p); if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); OUT("_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,\n"); INDENTED( OUT("\tvoid **structure, const void *bufptr, size_t size, int tag_mode) {\n"); OUT("%s_%d_inherit_TYPE_descriptor(td);\n", p, expr->_type_unique_index); OUT("return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);\n"); ); OUT("}\n"); OUT("\n"); p = MKID(expr); if(HIDE_INNER_DEFS) OUT("static "); OUT("asn_enc_rval_t\n"); OUT("%s", p); if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); OUT("_encode_der(asn_TYPE_descriptor_t *td,\n"); INDENTED( OUT("\tvoid *structure, int tag_mode, ber_tlv_tag_t tag,\n"); OUT("\tasn_app_consume_bytes_f *cb, void *app_key) {\n"); OUT("%s_%d_inherit_TYPE_descriptor(td);\n", p, expr->_type_unique_index); OUT("return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);\n"); ); OUT("}\n"); OUT("\n"); p = MKID(expr); if(HIDE_INNER_DEFS) OUT("static "); OUT("asn_dec_rval_t\n"); OUT("%s", p); if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); OUT("_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,\n"); INDENTED( OUT("\tvoid **structure, const char *opt_mname, const void *bufptr, size_t size) {\n"); OUT("%s_%d_inherit_TYPE_descriptor(td);\n", p, expr->_type_unique_index); OUT("return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);\n"); ); OUT("}\n"); OUT("\n"); p = MKID(expr); if(HIDE_INNER_DEFS) OUT("static "); OUT("asn_enc_rval_t\n"); OUT("%s", p); if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); OUT("_encode_xer(asn_TYPE_descriptor_t *td, void *structure,\n"); INDENTED( OUT("\tint ilevel, enum xer_encoder_flags_e flags,\n"); OUT("\tasn_app_consume_bytes_f *cb, void *app_key) {\n"); OUT("%s_%d_inherit_TYPE_descriptor(td);\n", p, expr->_type_unique_index); OUT("return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);\n"); ); OUT("}\n"); OUT("\n"); if(arg->flags & A1C_GEN_PER) { p = MKID(expr); if(HIDE_INNER_DEFS) OUT("static "); OUT("asn_dec_rval_t\n"); OUT("%s", p); if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); OUT("_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,\n"); INDENTED( OUT("\tasn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {\n"); OUT("%s_%d_inherit_TYPE_descriptor(td);\n", p, expr->_type_unique_index); OUT("return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);\n"); ); OUT("}\n"); OUT("\n"); p = MKID(expr); if(HIDE_INNER_DEFS) OUT("static "); OUT("asn_enc_rval_t\n"); OUT("%s", p); if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); OUT("_encode_uper(asn_TYPE_descriptor_t *td,\n"); INDENTED( OUT("\tasn_per_constraints_t *constraints,\n"); OUT("\tvoid *structure, asn_per_outp_t *per_out) {\n"); OUT("%s_%d_inherit_TYPE_descriptor(td);\n", p, expr->_type_unique_index); OUT("return td->uper_encoder(td, constraints, structure, per_out);\n"); ); OUT("}\n"); OUT("\n"); } REDIR(OT_FUNC_DECLS); p = MKID(expr); if(HIDE_INNER_DEFS) { OUT("/* extern asn_TYPE_descriptor_t asn_DEF_%s_%d;" "\t// (Use -fall-defs-global to expose) */\n", p, expr->_type_unique_index); } else { OUT("extern asn_TYPE_descriptor_t asn_DEF_%s;\n", p); OUT("asn_struct_free_f %s_free;\n", p); OUT("asn_struct_print_f %s_print;\n", p); OUT("asn_constr_check_f %s_constraint;\n", p); OUT("ber_type_decoder_f %s_decode_ber;\n", p); OUT("der_type_encoder_f %s_encode_der;\n", p); OUT("xer_type_decoder_f %s_decode_xer;\n", p); OUT("xer_type_encoder_f %s_encode_xer;\n", p); if(arg->flags & A1C_GEN_PER) { OUT("per_type_decoder_f %s_decode_uper;\n", p); OUT("per_type_encoder_f %s_encode_uper;\n", p); } } REDIR(OT_TYPE_DECLS); return 0; } int asn1c_lang_C_type_EXTENSIBLE(arg_t *arg) { OUT("/*\n"); OUT(" * This type is extensible,\n"); OUT(" * possible extensions are below.\n"); OUT(" */\n"); return 0; } static int compute_extensions_start(asn1p_expr_t *expr) { asn1p_expr_t *v; int eidx = 0; TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) return eidx; eidx++; } return -1; } static int _print_tag(arg_t *arg, struct asn1p_type_tag_s *tag) { OUT("("); switch(tag->tag_class) { case TC_UNIVERSAL: OUT("ASN_TAG_CLASS_UNIVERSAL"); break; case TC_APPLICATION: OUT("ASN_TAG_CLASS_APPLICATION"); break; case TC_CONTEXT_SPECIFIC: OUT("ASN_TAG_CLASS_CONTEXT"); break; case TC_PRIVATE: OUT("ASN_TAG_CLASS_PRIVATE"); break; case TC_NOCLASS: break; } OUT(" | (%" PRIdASN " << 2))", tag->tag_value); return 0; } static int _tag2el_cmp(const void *ap, const void *bp) { const tag2el_t *a = ap; const tag2el_t *b = bp; const struct asn1p_type_tag_s *ta = &a->el_tag; const struct asn1p_type_tag_s *tb = &b->el_tag; if(ta->tag_class == tb->tag_class) { if(ta->tag_value == tb->tag_value) { /* * Sort by their respective positions. */ if(a->el_no < b->el_no) return -1; else if(a->el_no > b->el_no) return 1; return 0; } else if(ta->tag_value < tb->tag_value) return -1; else return 1; } else if(ta->tag_class < tb->tag_class) { return -1; } else { return 1; } } /* * For constructed types, number of external tags may be greater than * number of elements in the type because of CHOICE type. * T ::= SET { -- Three possible tags: * a INTEGER, -- One tag is here... * b Choice1 -- ... and two more tags are there. * } * Choice1 ::= CHOICE { * s1 IA5String, * s2 ObjectDescriptor * } */ static int _fill_tag2el_map(arg_t *arg, tag2el_t **tag2el, int *count, int el_no, fte_e flags) { asn1p_expr_t *expr = arg->expr; arg_t tmparg = *arg; asn1p_expr_t *v; int element = 0; int original_count = *count; int sort_until = -1; TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) { /* * CXER mandates sorting * only for the root part. */ if(flags == FTE_CANONICAL_XER && sort_until == -1) sort_until = *count; continue; } tmparg.expr = v; if(_add_tag2el_member(&tmparg, tag2el, count, (el_no==-1)?element:el_no, flags)) { return -1; } element++; } if(flags == FTE_CANONICAL_XER) { if(sort_until == -1) sort_until = *count; qsort((*tag2el) + original_count, sort_until - original_count, sizeof(**tag2el), _tag2el_cmp); if(arg->expr->expr_type == ASN_CONSTR_CHOICE && (sort_until - original_count) >= 1) { /* Only take in account the root component */ *count = original_count + 1; } } else { /* * Sort the map according to canonical order of their * tags and element numbers. */ qsort(*tag2el, *count, sizeof(**tag2el), _tag2el_cmp); } /* * Initialize .toff_{first|last} members. */ if(*count) { struct asn1p_type_tag_s *cur_tag = 0; tag2el_t *cur = *tag2el; tag2el_t *end = cur + *count; int occur, i; for(occur = 0; cur < end; cur++) { if(cur_tag == 0 || cur_tag->tag_value != cur->el_tag.tag_value || cur_tag->tag_class != cur->el_tag.tag_class) { cur_tag = &cur->el_tag; occur = 0; } else { occur++; } cur->toff_first = -occur; for(i = 0; i >= -occur; i--) cur[i].toff_last = -i; } } return 0; } static int _add_tag2el_member(arg_t *arg, tag2el_t **tag2el, int *count, int el_no, fte_e flags) { struct asn1p_type_tag_s tag; int ret; assert(el_no >= 0); ret = asn1f_fetch_outmost_tag(arg->asn, arg->expr->module, arg->expr, &tag, AFT_IMAGINARY_ANY); if(ret == 0) { tag2el_t *te; int new_count = (*count) + 1; void *p; if(tag.tag_value == -1) { /* * This is an untagged ANY type, * proceed without adding a tag */ return 0; } p = realloc(*tag2el, new_count * sizeof(tag2el_t)); if(p) *tag2el = p; else return -1; if(0) DEBUG("Found tag for %s: %ld", arg->expr->Identifier, (long)tag.tag_value); te = &((*tag2el)[*count]); te->el_tag = tag; te->el_no = el_no; te->from_expr = arg->expr; *count = new_count; return 0; } DEBUG("Searching tag in complex expression %s:%x at line %d", arg->expr->Identifier, arg->expr->expr_type, arg->expr->_lineno); /* * Iterate over members of CHOICE type. */ if(arg->expr->expr_type == ASN_CONSTR_CHOICE) { return _fill_tag2el_map(arg, tag2el, count, el_no, flags); } if(arg->expr->expr_type == A1TC_REFERENCE) { arg_t tmp = *arg; asn1p_expr_t *expr; expr = asn1f_lookup_symbol_ex(tmp.asn, tmp.expr, arg->expr->reference); if(expr) { tmp.expr = expr; return _add_tag2el_member(&tmp, tag2el, count, el_no, flags); } else { FATAL("Cannot dereference %s at line %d", arg->expr->Identifier, arg->expr->_lineno); return -1; } } DEBUG("No tag for %s at line %d", arg->expr->Identifier, arg->expr->_lineno); return -1; } static int emit_tag2member_map(arg_t *arg, tag2el_t *tag2el, int tag2el_count, const char *opt_modifier) { asn1p_expr_t *expr = arg->expr; int i; if(!tag2el_count) return 0; /* No top level tags */ OUT("static asn_TYPE_tag2member_t asn_MAP_%s_tag2el%s_%d[] = {\n", MKID(expr), opt_modifier?opt_modifier:"", expr->_type_unique_index); for(i = 0; i < tag2el_count; i++) { OUT(" { "); _print_tag(arg, &tag2el[i].el_tag); OUT(", "); OUT("%d, ", tag2el[i].el_no); OUT("%d, ", tag2el[i].toff_first); OUT("%d ", tag2el[i].toff_last); OUT("}%s /* %s at %d */\n", (i + 1 < tag2el_count) ? "," : "", tag2el[i].from_expr->Identifier, tag2el[i].from_expr->_lineno ); } OUT("};\n"); return 0; } static enum tvm_compat emit_tags_vectors(arg_t *arg, asn1p_expr_t *expr, int *tags_count_r, int *all_tags_count_r) { struct asn1p_type_tag_s *tags = 0; /* Effective tags */ struct asn1p_type_tag_s *all_tags = 0; /* The full array */ int tags_count = 0; int all_tags_count = 0; enum tvm_compat tv_mode = _TVM_SAME; int i; /* Cleanup before proceeding. */ *tags_count_r = 0; *all_tags_count_r = 0; /* Fetch a chain of tags */ tags_count = asn1f_fetch_tags(arg->asn, expr->module, expr, &tags, 0); if(tags_count < 0) { DEBUG("fail to fetch tags for %s", expr->Identifier); return -1; } /* Fetch a chain of tags */ all_tags_count = asn1f_fetch_tags(arg->asn, expr->module, expr, &all_tags, AFT_FULL_COLLECT); if(all_tags_count < 0) { if(tags) free(tags); DEBUG("fail to fetch tags chain for %s", expr->Identifier); return -1; } assert(tags_count <= all_tags_count); assert((tags_count?0:1) == (all_tags_count?0:1)); if(tags_count <= all_tags_count) { for(i = 0; i < tags_count; i++) { if(tags[i].tag_value != all_tags[i].tag_value || tags[i].tag_class != all_tags[i].tag_class) { tv_mode = _TVM_DIFFERENT; break; } } if(i == tags_count && tags_count < all_tags_count) tv_mode = _TVM_SUBSET; } else { tv_mode = _TVM_DIFFERENT; } #define EMIT_TAGS_TABLE(name, tags, tags_count) do { \ OUT("static ber_tlv_tag_t asn_DEF_%s%s_tags_%d[] = {\n",\ MKID(expr), name, \ expr->_type_unique_index); \ INDENT(+1); \ /* Print the array of collected tags */ \ for(i = 0; i < tags_count; i++) { \ if(i) OUT(",\n"); \ _print_tag(arg, &tags[i]); \ } \ OUT("\n"); \ INDENT(-1); \ OUT("};\n"); \ } while(0) if(tags_count) { if(tv_mode == _TVM_SUBSET) EMIT_TAGS_TABLE("", all_tags, all_tags_count); else EMIT_TAGS_TABLE("", tags, tags_count); } if(all_tags_count) { if(tv_mode == _TVM_DIFFERENT) EMIT_TAGS_TABLE("_all", all_tags, all_tags_count); } if(tags) free(tags); if(all_tags) free(all_tags); *tags_count_r = tags_count; *all_tags_count_r = all_tags_count; return tv_mode; } static int expr_elements_count(arg_t *arg, asn1p_expr_t *expr) { asn1p_expr_t *topmost_parent; asn1p_expr_t *v; int elements = 0; topmost_parent = asn1f_find_terminal_type_ex(arg->asn, expr); if(!topmost_parent) return 0; if(!(topmost_parent->expr_type & ASN_CONSTR_MASK) && !topmost_parent->expr_type == ASN_BASIC_INTEGER && !topmost_parent->expr_type == ASN_BASIC_ENUMERATED) return 0; TQ_FOR(v, &(topmost_parent->members), next) { if(v->expr_type != A1TC_EXTENSIBLE) elements++; } return elements; } static asn1p_expr_type_e expr_get_type(arg_t *arg, asn1p_expr_t *expr) { asn1p_expr_t *terminal; terminal = asn1f_find_terminal_type_ex(arg->asn, expr); if(terminal) return terminal->expr_type; return A1TC_INVALID; } static asn1c_integer_t PER_FROM_alphabet_characters(asn1cnst_range_t *range) { asn1c_integer_t numchars = 0; if(range->el_count) { int i; for(i = 0; i < range->el_count; i++) numchars += PER_FROM_alphabet_characters(range->elements[i]); } else { assert(range->left.type == ARE_VALUE); assert(range->right.type == ARE_VALUE); numchars = 1 + (range->right.value - range->left.value); } return numchars; } static int emit_single_member_PER_constraint(arg_t *arg, asn1cnst_range_t *range, int alphabetsize, char *type) { if(!range || range->incompatible || range->not_PER_visible) { OUT("{ APC_UNCONSTRAINED,\t-1, -1, 0, 0 }"); return 0; } if(range->left.type == ARE_VALUE) { if(range->right.type == ARE_VALUE) { asn1c_integer_t cover = 1; asn1c_integer_t r = 1 + range->right.value - range->left.value; size_t rbits; /* Value range bits */ ssize_t ebits; /* Value effective range bits */ if(range->empty_constraint) r = 0; if(alphabetsize) { /* X.691: 27.5.2 */ r = PER_FROM_alphabet_characters(range); } /* Compute real constraint */ for(rbits = 0; rbits < (8 * sizeof(r)); rbits++) { if(r <= cover) break; cover *= 2; /* Can't do shifting */ if(cover < 0) { FATAL("Constraint at line %d too wide " "for %d-bits integer type", arg->expr->_lineno, sizeof(r) * 8); rbits = sizeof(r); break; } } if(alphabetsize) { ebits = rbits; } else { /* X.691, #10.9.4.1 */ for(ebits = 0; ebits <= 16; ebits++) if(r <= 1 << ebits) break; if(ebits == 17 || range->right.value >= 65536) ebits = -1; if(0) { /* X.691, #10.5.7.1 */ for(ebits = 0; ebits <= 8; ebits++) if(r <= 1 << ebits) break; if(ebits == 9) { if(r <= 65536) ebits = 16; else ebits = -1; } } } OUT("{ APC_CONSTRAINED%s,%s% d, % d, ", range->extensible ? " | APC_EXTENSIBLE" : "", range->extensible ? " " : "\t", rbits, ebits); if(alphabetsize) { asn1c_integer_t lv = range->left.value; asn1c_integer_t rv = range->right.value; int gcmt = 0; if(lv > 0x7fffffff) { lv = 0x7fffffff; gcmt++; } if(rv > 0x7fffffff) { rv = 0x7fffffff; gcmt++; } if(gcmt) { OINTS(lv); OUT(", "); OINTS(rv); OUT(" }"); goto pcmt; } } } else { if(range->extensible) { OUT("{ APC_SEMI_CONSTRAINED | APC_EXTENSIBLE, " "-1, "); } else { OUT("{ APC_SEMI_CONSTRAINED,\t-1, -1, "); } } OINTS(range->left.value); OUT(", "); OINTS(range->right.value); OUT(" }"); } else { OUT("{ APC_UNCONSTRAINED,\t-1, -1, 0, 0 }"); } pcmt: /* * Print some courtesy debug information. */ if(range->left.type == ARE_VALUE || range->right.type == ARE_VALUE) { OUT("\t/* "); if(type) OUT("(%s", type); OUT("("); if(range->left.type == ARE_VALUE) OUT("%" PRIdASN, range->left.value); else OUT("MIN"); OUT(".."); if(range->right.type == ARE_VALUE) OUT("%" PRIdASN, range->right.value); else OUT("MAX"); if(range->extensible) OUT(",..."); if(type) OUT(")"); OUT(") */"); } return 0; } static int emit_member_PER_constraints(arg_t *arg, asn1p_expr_t *expr, const char *pfx) { int save_target = arg->target->target; asn1cnst_range_t *range; asn1p_expr_type_e etype; etype = expr_get_type(arg, expr); if((arg->flags & A1C_GEN_PER) && (expr->constraints || etype == ASN_BASIC_ENUMERATED || etype == ASN_CONSTR_CHOICE) ) { /* Fall through */ } else { return 0; } REDIR(OT_CTDEFS); OUT("static asn_per_constraints_t " "asn_PER_%s_%s_constr_%d = {\n", pfx, MKID(expr), expr->_type_unique_index); INDENT(+1); /* * ENUMERATED and CHOICE are special. */ if(etype == ASN_BASIC_ENUMERATED || etype == ASN_CONSTR_CHOICE) { asn1cnst_range_t tmprng; asn1p_expr_t *v; int extensible = 0; int eidx = -1; expr = asn1f_find_terminal_type_ex(arg->asn, expr); assert(expr); TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) { extensible++; break; } eidx++; } memset(&tmprng, 0, sizeof (tmprng)); tmprng.extensible = extensible; if(eidx < 0) tmprng.empty_constraint = 1; tmprng.left.type = ARE_VALUE; tmprng.left.value = 0; tmprng.right.type = ARE_VALUE; tmprng.right.value = eidx < 0 ? 0 : eidx; if(emit_single_member_PER_constraint(arg, &tmprng, 0, 0)) return -1; } else if(etype & ASN_STRING_KM_MASK) { range = asn1constraint_compute_PER_range(etype, expr->combined_constraints, ACT_CT_FROM, 0, 0, 0); DEBUG("Emitting FROM constraint for %s", expr->Identifier); if((range->left.type == ARE_MIN && range->right.type == ARE_MAX) || range->not_PER_visible) { switch(etype) { case ASN_STRING_BMPString: range->left.type = ARE_VALUE; range->left.value = 0; range->right.type = ARE_VALUE; range->right.value = 65535; range->not_PER_visible = 0; range->extensible = 0; break; case ASN_STRING_UniversalString: OUT("{ APC_CONSTRAINED,\t32, 32," " 0, 2147483647 }" " /* special case 1 */\n"); goto avoid; default: break; } } if(emit_single_member_PER_constraint(arg, range, 1, 0)) return -1; avoid: asn1constraint_range_free(range); } else { range = asn1constraint_compute_PER_range(etype, expr->combined_constraints, ACT_EL_RANGE, 0, 0, 0); if(emit_single_member_PER_constraint(arg, range, 0, 0)) return -1; asn1constraint_range_free(range); } OUT(",\n"); range = asn1constraint_compute_PER_range(etype, expr->combined_constraints, ACT_CT_SIZE, 0, 0, 0); if(emit_single_member_PER_constraint(arg, range, 0, "SIZE")) return -1; asn1constraint_range_free(range); OUT(",\n"); if((etype & ASN_STRING_KM_MASK) && (expr->_mark & TM_PERFROMCT)) { int old_target = arg->target->target; REDIR(OT_CODE); OUT("static int asn_PER_MAP_%s_%d_v2c(unsigned int value) {\n", MKID(expr), expr->_type_unique_index); OUT("\tif(value >= sizeof(permitted_alphabet_table_%d)/" "sizeof(permitted_alphabet_table_%d[0]))\n", expr->_type_unique_index, expr->_type_unique_index); OUT("\t\treturn -1;\n"); OUT("\treturn permitted_alphabet_table_%d[value] - 1;\n", expr->_type_unique_index); OUT("}\n"); OUT("static int asn_PER_MAP_%s_%d_c2v(unsigned int code) {\n", MKID(expr), expr->_type_unique_index); OUT("\tif(code >= sizeof(permitted_alphabet_code2value_%d)/" "sizeof(permitted_alphabet_code2value_%d[0]))\n", expr->_type_unique_index, expr->_type_unique_index); OUT("\t\treturn -1;\n"); OUT("\treturn permitted_alphabet_code2value_%d[code];\n", expr->_type_unique_index); OUT("}\n"); REDIR(old_target); OUT("asn_PER_MAP_%s_%d_v2c,\t/* Value to PER code map */\n", MKID(expr), expr->_type_unique_index); OUT("asn_PER_MAP_%s_%d_c2v\t/* PER code to value map */\n", MKID(expr), expr->_type_unique_index); } else if(etype & ASN_STRING_KM_MASK) { DEBUG("No PER value map necessary for %s", MKID(expr)); OUT("0, 0\t/* No PER character map necessary */\n"); } else { OUT("0, 0\t/* No PER value map */\n"); } INDENT(-1); OUT("};\n"); REDIR(save_target); return 0; } static int safe_string(const uint8_t *buf, int size) { const uint8_t *end = buf + size; for(; buf < end; buf++) { int ch = *buf; if((ch < 0x20 || ch > 0x7e) || ch == '"') return 0; } return 1; } static void emit_default_value(arg_t *arg, asn1p_value_t *v) { OUT("static uint8_t defv[] = "); assert(v->type == ATV_STRING); if(safe_string(v->value.string.buf, v->value.string.size)) { OUT("\"%s\";\n", v->value.string.buf); } else { uint8_t *b = v->value.string.buf; uint8_t *e = v->value.string.size + b; OUT("{ "); for(;b < e; b++) OUT("0x%02x, ", *b); OUT("0 };\n"); } } static int try_inline_default(arg_t *arg, asn1p_expr_t *expr, int out) { int save_target = arg->target->target; asn1p_expr_type_e etype = expr_get_type(arg, expr); int fits_long = 0; switch(etype) { case ASN_BASIC_BOOLEAN: fits_long = 1; case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: if(expr->marker.default_value == NULL || expr->marker.default_value->type != ATV_INTEGER) break; if(!fits_long) fits_long = asn1c_type_fits_long(arg, expr)!=FL_NOTFIT; if(fits_long && !expr->marker.default_value->value.v_integer) expr->marker.flags &= ~EM_INDIRECT; if(!out) { OUT("asn_DFL_%d_set_%" PRIdASN ",\t/* DEFAULT %" PRIdASN " */\n", expr->_type_unique_index, expr->marker.default_value->value.v_integer, expr->marker.default_value->value.v_integer); return 1; } REDIR(OT_STAT_DEFS); OUT("static int asn_DFL_%d_set_%" PRIdASN "(int set_value, void **sptr) {\n", expr->_type_unique_index, expr->marker.default_value->value.v_integer); INDENT(+1); OUT("%s *st = *sptr;\n", asn1c_type_name(arg, expr, TNF_CTYPE)); OUT("\n"); OUT("if(!st) {\n"); OUT("\tif(!set_value) return -1;\t/* Not a default value */\n"); OUT("\tst = (*sptr = CALLOC(1, sizeof(*st)));\n"); OUT("\tif(!st) return -1;\n"); OUT("}\n"); OUT("\n"); OUT("if(set_value) {\n"); INDENT(+1); OUT("/* Install default value %" PRIdASN " */\n", expr->marker.default_value->value.v_integer); if(fits_long) { OUT("*st = "); OINT(expr->marker.default_value->value.v_integer); OUT(";\n"); OUT("return 0;\n"); } else { OUT("return asn_long2INTEGER(st, "); OINT(expr->marker.default_value->value.v_integer); OUT(");\n"); } INDENT(-1); OUT("} else {\n"); INDENT(+1); OUT("/* Test default value %" PRIdASN " */\n", expr->marker.default_value->value.v_integer); if(fits_long) { OUT("return (*st == %" PRIdASN ");\n", expr->marker.default_value->value.v_integer); } else { OUT("long value;\n"); OUT("if(asn_INTEGER2long(st, &value))\n"); OUT("\treturn -1;\n"); OUT("return (value == %" PRIdASN ");\n", expr->marker.default_value->value.v_integer); } INDENT(-1); OUT("}\n"); INDENT(-1); OUT("}\n"); REDIR(save_target); return 1; case ASN_BASIC_NULL: //expr->marker.flags &= ~EM_INDIRECT; return 0; default: if(etype & ASN_STRING_KM_MASK) { if(expr->marker.default_value == NULL || expr->marker.default_value->type != ATV_STRING) break; if(!out) { OUT("asn_DFL_%d_set,\t/* DEFAULT \"%s\" */\n", expr->_type_unique_index, expr->marker.default_value->value.string.buf); return 1; } REDIR(OT_STAT_DEFS); OUT("static int asn_DFL_%d_set(int set_value, void **sptr) {\n", expr->_type_unique_index); INDENT(+1); emit_default_value(arg, expr->marker.default_value); OUT("%s *st = *sptr;\n", asn1c_type_name(arg, expr, TNF_CTYPE)); OUT("\n"); OUT("if(!st) {\n"); OUT("\tif(!set_value) return -1;\t/* Not a default value */\n"); OUT("\tst = (*sptr = CALLOC(1, sizeof(*st)));\n"); OUT("\tif(!st) return -1;\n"); OUT("}\n"); OUT("\n"); OUT("if(set_value) {\n"); INDENT(+1); OUT("uint8_t *ptr = MALLOC(sizeof(defv));\n"); OUT("if(!ptr) return -1;\n"); OUT("memcpy(ptr, &defv, sizeof(defv));\n"); OUT("FREEMEM(st->buf);\n"); OUT("st->buf = ptr;\n"); OUT("st->size = sizeof(defv) - 1;\n"); OUT("return 0;\n"); INDENT(-1); OUT("} else {\n"); INDENT(+1); OUT("if(st->size != (sizeof(defv) - 1)\n"); OUT("|| memcmp(st->buf, &defv, sizeof(defv) - 1))\n"); OUT("\treturn 0;\n"); OUT("return 1;\n"); INDENT(-1); OUT("}\n"); OUT("\n"); INDENT(-1); OUT("}\n"); REDIR(save_target); return 1; } break; } return 0; } static int emit_member_table(arg_t *arg, asn1p_expr_t *expr) { int save_target; arg_t tmp_arg; struct asn1p_type_tag_s outmost_tag_s; struct asn1p_type_tag_s *outmost_tag; int complex_contents; char *p; if(asn1f_fetch_outmost_tag(arg->asn, expr->module, expr, &outmost_tag_s, AFT_IMAGINARY_ANY)) { outmost_tag = 0; } else { outmost_tag = &outmost_tag_s; } OUT("{ "); if(outmost_tag && outmost_tag->tag_value == -1) OUT("ATF_OPEN_TYPE | "); OUT("%s, ", (expr->marker.flags & EM_INDIRECT)?"ATF_POINTER":"ATF_NOFLAGS"); if((expr->marker.flags & EM_OMITABLE) == EM_OMITABLE) { asn1p_expr_t *tv; int opts = 0; for(tv = expr; tv && (tv->marker.flags & EM_OMITABLE) == EM_OMITABLE; tv = TQ_NEXT(tv, next), opts++) { if(tv->expr_type == A1TC_EXTENSIBLE) opts--; } OUT("%d, ", opts); } else { OUT("0, "); } if(expr->_anonymous_type) { assert(arg->expr->expr_type == ASN_CONSTR_SET_OF || arg->expr->expr_type == ASN_CONSTR_SEQUENCE_OF); OUT("0,\n"); } else { OUT("offsetof(struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(", "); if(arg->expr->expr_type == ASN_CONSTR_CHOICE && (!UNNAMED_UNIONS)) OUT("choice."); OUT("%s),\n", MKID_safe(expr)); } INDENT(+1); if(C99_MODE) OUT(".tag = "); if(outmost_tag) { if(outmost_tag->tag_value == -1) OUT("-1 /* Ambiguous tag (ANY?) */"); else _print_tag(arg, outmost_tag); } else { OUT("-1 /* Ambiguous tag (CHOICE?) */"); } OUT(",\n"); if(C99_MODE) OUT(".tag_mode = "); if((!(expr->expr_type & ASN_CONSTR_MASK) || expr->expr_type == ASN_CONSTR_CHOICE) && expr->tag.tag_class) { if(expr->tag.tag_mode == TM_IMPLICIT) OUT("-1,\t/* IMPLICIT tag at current level */\n"); else OUT("+1,\t/* EXPLICIT tag at current level */\n"); } else { OUT("0,\n"); } complex_contents = (expr->expr_type & ASN_CONSTR_MASK) || expr->expr_type == ASN_BASIC_ENUMERATED || (0 /* -- prohibited by X.693:8.3.4 */ && expr->expr_type == ASN_BASIC_INTEGER && expr_elements_count(arg, expr)) || (expr->expr_type == ASN_BASIC_INTEGER && asn1c_type_fits_long(arg, expr) == FL_FITS_UNSIGN); if(C99_MODE) OUT(".type = "); OUT("&asn_DEF_"); if(complex_contents) { OUT("%s", MKID(expr)); if(!(arg->flags & A1C_ALL_DEFS_GLOBAL)) OUT("_%d", expr->_type_unique_index); } else { OUT("%s", asn1c_type_name(arg, expr, TNF_SAFE)); } OUT(",\n"); if(C99_MODE) OUT(".memb_constraints = "); if(expr->constraints) { if(arg->flags & A1C_NO_CONSTRAINTS) { OUT("0,\t/* No check because of -fno-constraints */\n"); } else { char *id = MKID(expr); if(expr->_anonymous_type && !strcmp(expr->Identifier, "Member")) id = asn1c_type_name(arg, expr, TNF_SAFE); OUT("memb_%s_constraint_%d,\n", id, arg->expr->_type_unique_index); } } else { OUT("0,\t/* Defer constraints checking to the member type */\n"); } if(C99_MODE) OUT(".per_constraints = "); if(arg->flags & A1C_GEN_PER) { if(expr->constraints) { OUT("&asn_PER_memb_%s_constr_%d,\n", MKID(expr), expr->_type_unique_index); } else { OUT("0,\t/* No PER visible constraints */\n"); } } else { OUT("0,\t/* PER is not compiled, use -gen-PER */\n"); } if(C99_MODE) OUT(".default_value = "); if(try_inline_default(arg, expr, 0)) { } else { OUT("0,\n"); } if(C99_MODE) OUT(".name = "); if(expr->_anonymous_type && !strcmp(expr->Identifier, "Member")) { OUT("\"\"\n"); } else { OUT("\"%s\"\n", expr->Identifier); } OUT("},\n"); INDENT(-1); if(!expr->constraints || (arg->flags & A1C_NO_CONSTRAINTS)) return 0; save_target = arg->target->target; REDIR(OT_CODE); if(expr->_anonymous_type && !strcmp(expr->Identifier, "Member")) p = asn1c_type_name(arg, expr, TNF_SAFE); else p = MKID(expr); OUT("static int\n"); OUT("memb_%s_constraint_%d(asn_TYPE_descriptor_t *td, const void *sptr,\n", p, arg->expr->_type_unique_index); INDENT(+1); OUT("\t\tasn_app_constraint_failed_f *ctfailcb, void *app_key) {\n"); tmp_arg = *arg; tmp_arg.expr = expr; DEBUG("member constraint checking code for %s", p); if(asn1c_emit_constraint_checking_code(&tmp_arg) == 1) { OUT("return td->check_constraints" "(td, sptr, ctfailcb, app_key);\n"); } INDENT(-1); OUT("}\n"); OUT("\n"); if(emit_member_PER_constraints(arg, expr, "memb")) return -1; REDIR(save_target); return 0; } /* * Generate "asn_DEF_XXX" type definition. */ static int emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_count, int all_tags_count, int elements_count, enum etd_spec spec) { asn1p_expr_t *terminal; int using_type_name = 0; char *p = MKID(expr); terminal = asn1f_find_terminal_type_ex(arg->asn, expr); if(emit_member_PER_constraints(arg, expr, "type")) return -1; if(HIDE_INNER_DEFS) OUT("static /* Use -fall-defs-global to expose */\n"); OUT("asn_TYPE_descriptor_t asn_DEF_%s", p); if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); OUT(" = {\n"); INDENT(+1); if(expr->_anonymous_type) { p = ASN_EXPR_TYPE2STR(expr->expr_type); OUT("\"%s\",\n", p?p:""); OUT("\"%s\",\n", p ? asn1c_make_identifier(AMI_CHECK_RESERVED, 0, p, 0) : ""); } else { OUT("\"%s\",\n", expr->Identifier); OUT("\"%s\",\n", expr->Identifier); } if(expr->expr_type & ASN_CONSTR_MASK) { using_type_name = 1; p = asn1c_type_name(arg, arg->expr, TNF_SAFE); } else { p = MKID(expr); } #define FUNCREF(foo) do { \ OUT("%s", p); \ if(HIDE_INNER_DEFS && !using_type_name) \ OUT("_%d", expr->_type_unique_index); \ OUT("_" #foo ",\n"); \ } while(0) FUNCREF(free); FUNCREF(print); FUNCREF(constraint); FUNCREF(decode_ber); FUNCREF(encode_der); FUNCREF(decode_xer); FUNCREF(encode_xer); if(arg->flags & A1C_GEN_PER) { FUNCREF(decode_uper); FUNCREF(encode_uper); } else { OUT("0, 0,\t/* No PER support, " "use \"-gen-PER\" to enable */\n"); } if(!terminal || terminal->expr_type == ASN_CONSTR_CHOICE) { //if(expr->expr_type == ASN_CONSTR_CHOICE) { OUT("CHOICE_outmost_tag,\n"); } else { OUT("0,\t/* Use generic outmost tag fetcher */\n"); } p = MKID(expr); if(tags_count) { OUT("asn_DEF_%s_tags_%d,\n", p, expr->_type_unique_index); OUT("sizeof(asn_DEF_%s_tags_%d)\n", p, expr->_type_unique_index); OUT("\t/sizeof(asn_DEF_%s_tags_%d[0])", p, expr->_type_unique_index); if(tv_mode == _TVM_SUBSET && tags_count != all_tags_count) OUT(" - %d", all_tags_count - tags_count); OUT(", /* %d */\n", tags_count); } else { OUT("0,\t/* No effective tags (pointer) */\n"); OUT("0,\t/* No effective tags (count) */\n"); } if(all_tags_count && tv_mode == _TVM_DIFFERENT) { OUT("asn_DEF_%s_all_tags_%d,\n", p, expr->_type_unique_index); OUT("sizeof(asn_DEF_%s_all_tags_%d)\n", p, expr->_type_unique_index); OUT("\t/sizeof(asn_DEF_%s_all_tags_%d[0]), /* %d */\n", p, expr->_type_unique_index, all_tags_count); } else if(all_tags_count) { OUT("asn_DEF_%s_tags_%d,\t/* Same as above */\n", p, expr->_type_unique_index); OUT("sizeof(asn_DEF_%s_tags_%d)\n", p, expr->_type_unique_index); OUT("\t/sizeof(asn_DEF_%s_tags_%d[0]), /* %d */\n", p, expr->_type_unique_index, all_tags_count); } else { OUT("0,\t/* No tags (pointer) */\n"); OUT("0,\t/* No tags (count) */\n"); } if(arg->flags & A1C_GEN_PER) { if(expr->constraints || expr->expr_type == ASN_BASIC_ENUMERATED || expr->expr_type == ASN_CONSTR_CHOICE) { OUT("&asn_PER_type_%s_constr_%d,\n", p, expr->_type_unique_index); } else { OUT("0,\t/* No PER visible constraints */\n"); } } else { OUT("0,\t/* No PER visible constraints */\n"); } if(elements_count) { OUT("asn_MBR_%s_%d,\n", p, expr->_type_unique_index); if(expr->expr_type == ASN_CONSTR_SEQUENCE_OF || expr->expr_type == ASN_CONSTR_SET_OF) { OUT("%d,\t/* Single element */\n", elements_count); assert(elements_count == 1); } else { OUT("%d,\t/* Elements count */\n", elements_count); } } else { if(expr_elements_count(arg, expr)) OUT("0, 0,\t/* Defined elsewhere */\n"); else OUT("0, 0,\t/* No members */\n"); } switch(spec) { case ETD_NO_SPECIFICS: OUT("0\t/* No specifics */\n"); break; case ETD_HAS_SPECIFICS: OUT("&asn_SPC_%s_specs_%d\t/* Additional specs */\n", p, expr->_type_unique_index); } INDENT(-1); OUT("};\n"); OUT("\n"); return 0; } static int expr_as_xmlvaluelist(arg_t *arg, asn1p_expr_t *expr) { /* * X.680, 25.5, Table 5 */ switch(expr_get_type(arg, expr)) { case ASN_BASIC_BOOLEAN: case ASN_BASIC_ENUMERATED: case ASN_BASIC_NULL: return 1; case ASN_CONSTR_CHOICE: return 2; default: return 0; } } static int out_name_chain(arg_t *arg, enum onc_flags onc_flags) { asn1p_expr_t *expr = arg->expr; char *id; assert(expr->Identifier); if((arg->flags & A1C_COMPOUND_NAMES || onc_flags & ONC_force_compound_name) && ((expr->expr_type & ASN_CONSTR_MASK) || expr->expr_type == ASN_BASIC_ENUMERATED || ((expr->expr_type == ASN_BASIC_INTEGER || expr->expr_type == ASN_BASIC_BIT_STRING) && expr_elements_count(arg, expr)) ) && expr->parent_expr && expr->parent_expr->Identifier) { arg_t tmparg = *arg; tmparg.expr = expr->parent_expr; if(0) tmparg.flags &= ~A1C_COMPOUND_NAMES; out_name_chain(&tmparg, onc_flags); OUT("__"); /* a separator between id components */ /* Fall through */ } if(onc_flags & ONC_avoid_keywords) id = MKID_safe(expr); else id = MKID(expr); OUT("%s", id); return 0; } static int emit_include_dependencies(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *memb; /* Avoid recursive definitions. */ TQ_FOR(memb, &(expr->members), next) { expr_break_recursion(arg, memb); } TQ_FOR(memb, &(expr->members), next) { if(memb->marker.flags & (EM_INDIRECT | EM_UNRECURSE)) { if(terminal_structable(arg, memb)) { int saved_target = arg->target->target; REDIR(OT_FWD_DECLS); OUT("%s;\n", asn1c_type_name(arg, memb, TNF_RSAFE)); REDIR(saved_target); } } if((!(memb->expr_type & ASN_CONSTR_MASK) && memb->expr_type > ASN_CONSTR_MASK) || memb->meta_type == AMT_TYPEREF) { if(memb->marker.flags & EM_UNRECURSE) { GEN_POSTINCLUDE(asn1c_type_name(arg, memb, TNF_INCLUDE)); } else { GEN_INCLUDE(asn1c_type_name(arg, memb, TNF_INCLUDE)); } } } return 0; } /* * Check if it is better to make this type indirectly accessed via * a pointer. * This may be the case for the following recursive definition: * Type ::= CHOICE { member Type }; */ static int expr_break_recursion(arg_t *arg, asn1p_expr_t *expr) { int ret; if(expr->marker.flags & EM_UNRECURSE) return 1; /* Already broken */ /* -findirect-choice compiles members of CHOICE as indirect pointers */ if((arg->flags & A1C_INDIRECT_CHOICE) && arg->expr->expr_type == ASN_CONSTR_CHOICE && (expr_get_type(arg, expr) & ASN_CONSTR_MASK) ) { /* Break cross-reference */ expr->marker.flags |= EM_INDIRECT | EM_UNRECURSE; return 1; } if((expr->marker.flags & EM_INDIRECT) || arg->expr->expr_type == ASN_CONSTR_SET_OF || arg->expr->expr_type == ASN_CONSTR_SEQUENCE_OF) { if(terminal_structable(arg, expr)) { expr->marker.flags |= EM_UNRECURSE; if(arg->expr->expr_type == ASN_CONSTR_SET_OF || arg->expr->expr_type == ASN_CONSTR_SEQUENCE_OF) { /* Don't put EM_INDIRECT even if recursion */ return 1; } /* Fall through */ } } /* Look for recursive back-references */ ret = expr_defined_recursively(arg, expr); switch(ret) { case 2: /* Explicitly break the recursion */ case 1: /* Use safer typing */ expr->marker.flags |= EM_INDIRECT; expr->marker.flags |= EM_UNRECURSE; break; } return 0; } /* * Check if the type can be represented using simple `struct TYPE`. */ static asn1p_expr_t * terminal_structable(arg_t *arg, asn1p_expr_t *expr) { asn1p_expr_t *terminal = asn1f_find_terminal_type_ex(arg->asn, expr); if(terminal && !terminal->parent_expr && (terminal->expr_type & ASN_CONSTR_MASK)) { return terminal; } return 0; } static int asn1c_recurse(arg_t *arg, asn1p_expr_t *expr, int (*callback)(arg_t *arg, void *key), void *key) { arg_t tmp = *arg; int maxret = 0; int ret; if(expr->_mark) return 0; expr->_mark |= TM_RECURSION; /* Invoke callback for every type going into recursion */ tmp.expr = expr; maxret = callback(&tmp, key); if(maxret <= 1) { /* * Recursively invoke myself and the callbacks. */ TQ_FOR(tmp.expr, &(expr->members), next) { ret = asn1c_recurse(&tmp, tmp.expr, callback, key); if(ret > maxret) maxret = ret; if(maxret > 1) break; } } expr->_mark &= ~TM_RECURSION; return maxret; } static int check_is_refer_to(arg_t *arg, void *key) { asn1p_expr_t *terminal = terminal_structable(arg, arg->expr); if(terminal == key) { if(arg->expr->marker.flags & EM_INDIRECT) return 1; /* This is almost safe indirection */ return 2; } else if(terminal) { /* This might be N-step circular loop. Dive into it. */ return asn1c_recurse(arg, terminal, check_is_refer_to, key); } return 0; } /* * Check if the possibly inner expression defined recursively. */ static int expr_defined_recursively(arg_t *arg, asn1p_expr_t *expr) { asn1p_expr_t *terminal; asn1p_expr_t *topmost; /* If expression is top-level, there's no way it can be recursive. */ if(expr->parent_expr == 0) return 0; if(expr->expr_type != A1TC_REFERENCE) return 0; /* Basic types are never recursive */ terminal = terminal_structable(arg, expr); if(!terminal) return 0; /* Terminal cannot be indirected */ /* Search for the parent container for the given expression */ topmost = expr; while(topmost->parent_expr) topmost = topmost->parent_expr; /* Look inside the terminal type if it mentions the parent expression */ return asn1c_recurse(arg, terminal, check_is_refer_to, topmost); } struct canonical_map_element { int eidx; asn1p_expr_t *expr; }; static int compar_cameo(const void *ap, const void *bp); static arg_t *cameo_arg; static int * compute_canonical_members_order(arg_t *arg, int el_count) { struct canonical_map_element *cmap; int *rmap; asn1p_expr_t *v; int eidx = 0; int ext_start = -1; int nextmax = -1; int already_sorted = 1; cmap = calloc(el_count, sizeof *cmap); assert(cmap); TQ_FOR(v, &(arg->expr->members), next) { if(v->expr_type != A1TC_EXTENSIBLE) { cmap[eidx].eidx = eidx; cmap[eidx].expr = v; eidx++; } else if(ext_start == -1) ext_start = eidx; } cameo_arg = arg; if(ext_start == -1) { /* Sort the whole thing */ qsort(cmap, el_count, sizeof(*cmap), compar_cameo); } else { /* Sort root and extensions independently */ qsort(cmap, ext_start, sizeof(*cmap), compar_cameo); qsort(cmap + ext_start, el_count - ext_start, sizeof(*cmap), compar_cameo); } /* move data back to a simpler map */ rmap = calloc(el_count, sizeof *rmap); assert(rmap); for(eidx = 0; eidx < el_count; eidx++) { rmap[eidx] = cmap[eidx].eidx; if(rmap[eidx] <= nextmax) already_sorted = 0; else nextmax = rmap[eidx]; } free(cmap); if(already_sorted) { free(rmap); rmap = 0; } return rmap; } static int compar_cameo(const void *ap, const void *bp) { const struct canonical_map_element *a = (const void *)ap; const struct canonical_map_element *b = (const void *)bp; struct asn1p_type_tag_s atag, btag; arg_t *arg = cameo_arg; if(asn1f_fetch_outmost_tag(arg->asn, a->expr->module, a->expr, &atag, AFT_IMAGINARY_ANY | AFT_CANON_CHOICE)) return 1; if(asn1f_fetch_outmost_tag(arg->asn, b->expr->module, b->expr, &btag, AFT_IMAGINARY_ANY | AFT_CANON_CHOICE)) return -1; if(atag.tag_class < btag.tag_class) return -1; if(atag.tag_class > btag.tag_class) return 1; if(atag.tag_value < btag.tag_value) return -1; if(atag.tag_value > btag.tag_value) return 1; return 0; } asn1c-0.9.24+dfsg/libasn1compiler/asn1compiler.h0000644000000000000000000000353411472004363020067 0ustar rootroot#ifndef ASN1_COMPILER_H #define ASN1_COMPILER_H #include enum asn1c_flags { A1C_NOFLAGS, /* * Debug the compiler. */ A1C_DEBUG = 0x0001, /* * Do not split the target output in several files, just print it. * (Note: the output is not likely to be compilable in this case). */ A1C_PRINT_COMPILED = 0x0002, /* * Generate only the tables for ASN.1 types, * do not emit ASN.1 parsing support code. */ A1C_OMIT_SUPPORT_CODE = 0x0004, /* * Use native data types instead of INTEGER_t et al. */ A1C_USE_NATIVE_TYPES = 0x0008, /* * Do not use C99 extensions. */ A1C_NO_C99 = 0x0010, /* * Enable use of unnamed unions (non-portable feature). */ A1C_UNNAMED_UNIONS = 0x0020, /* * Don't make the asn1_DEF_'s of structure members "static". */ A1C_ALL_DEFS_GLOBAL = 0x0040, /* * Do not generate constraint checking code. */ A1C_NO_CONSTRAINTS = 0x0080, /* * Generate type_id_PR_member things identifiers of id_PR_member. */ A1C_COMPOUND_NAMES = 0x0100, /* * Do not generate courtesy #includes for external dependencies. */ A1C_NO_INCLUDE_DEPS = 0x0200, /* * Compile members of CHOICE as indirect pointers. */ A1C_INDIRECT_CHOICE = 0x0400, /* * -fskeletons-copy * Copy support files rather than symlink them. */ A1C_SKELETONS_COPY = 0x0800, /* * -gen-PER * Generate PER support code */ A1C_GEN_PER = 0x1000, /* * -pdu={all|auto|Type} * Generate PDU table */ A1C_PDU_ALL = 0x2000, A1C_PDU_AUTO = 0x4000, A1C_PDU_TYPE = 0x8000, /* * -fincludes-quoted * Avoid generating #include , generate "foo" instead. */ A1C_INCLUDES_QUOTED = 0x10000 }; /* * Compile the ASN.1 specification. */ int asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags, int argc, int optc, char **argv); void asn1c__add_pdu_type(const char *typename); #endif /* ASN1_COMPILER_H */ asn1c-0.9.24+dfsg/libasn1compiler/Makefile.in0000644000000000000000000003636212121076150017366 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libasn1compiler DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libasn1compiler_la_LIBADD = am_libasn1compiler_la_OBJECTS = asn1compiler.lo asn1c_misc.lo \ asn1c_out.lo asn1c_lang.lo asn1c_save.lo asn1c_C.lo \ asn1c_constraint.lo asn1c_compat.lo asn1c_fdeps.lo libasn1compiler_la_OBJECTS = $(am_libasn1compiler_la_OBJECTS) libasn1compiler_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libasn1compiler_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libasn1compiler_la_SOURCES) DIST_SOURCES = $(libasn1compiler_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = @ADD_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir)/libasn1parser \ -I$(top_srcdir)/libasn1fix noinst_LTLIBRARIES = libasn1compiler.la libasn1compiler_la_LDFLAGS = -all-static libasn1compiler_la_SOURCES = \ asn1compiler.c asn1compiler.h \ asn1c_misc.c asn1c_misc.h \ asn1c_out.c asn1c_out.h \ asn1c_lang.c asn1c_lang.h \ asn1c_save.c asn1c_save.h \ asn1c_C.c asn1c_C.h \ asn1c_constraint.c asn1c_constraint.h \ asn1c_compat.c asn1c_compat.h \ asn1c_fdeps.c asn1c_fdeps.h \ asn1c_internal.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libasn1compiler/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libasn1compiler/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libasn1compiler.la: $(libasn1compiler_la_OBJECTS) $(libasn1compiler_la_DEPENDENCIES) $(libasn1compiler_la_LINK) $(libasn1compiler_la_OBJECTS) $(libasn1compiler_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1c_C.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1c_compat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1c_constraint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1c_fdeps.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1c_lang.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1c_misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1c_out.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1c_save.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1compiler.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/libasn1compiler/asn1c_lang.h0000644000000000000000000000126111472004363017473 0ustar rootroot#ifndef ASN1_COMPILER_LANGUAGE_H #define ASN1_COMPILER_LANGUAGE_H struct arg_s; typedef struct asn1_language_map_s { asn1p_expr_meta_e meta_match; /* meta_type */ asn1p_expr_type_e expr_match; /* expr_type */ /* * A callback that would create a language-specific type declaration. */ int (*type_cb)(struct arg_s *arg); } asn1_language_map_t; extern asn1_language_map_t asn1_lang_map[AMT_EXPR_META_MAX][ASN_EXPR_TYPE_MAX]; typedef enum asn1c_target_language { ASN1C_LANGUAGE_C, } asn1c_target_language_e; /* * Initialize the compiler to generate specified target language. */ int asn1c_with_language(asn1c_target_language_e lang); #endif /* ASN1_COMPILER_LANGUAGE_H */ asn1c-0.9.24+dfsg/libasn1compiler/asn1c_C.h0000644000000000000000000000634611505405150016741 0ustar rootroot#ifndef ASN1_COMPILER_LANGUAGE_C_H #define ASN1_COMPILER_LANGUAGE_C_H #include "asn1c_lang.h" int asn1c_lang_C_type_REFERENCE(arg_t *); int asn1c_lang_C_type_EXTENSIBLE(arg_t *); int asn1c_lang_C_type_SEQUENCE(arg_t *); int asn1c_lang_C_type_SET(arg_t *); int asn1c_lang_C_type_SEx_OF(arg_t *); /* SET OF or SEQUENCE OF */ int asn1c_lang_C_type_CHOICE(arg_t *); int asn1c_lang_C_type_common_INTEGER(arg_t *); int asn1c_lang_C_type_BIT_STRING(arg_t *); int asn1c_lang_C_type_REAL(arg_t *); int asn1c_lang_C_type_SIMPLE_TYPE(arg_t *); static asn1_language_map_t asn1_lang_C[] __attribute__ ((unused)) = { { AMT_TYPE, A1TC_REFERENCE, asn1c_lang_C_type_REFERENCE }, { AMT_TYPEREF, A1TC_REFERENCE, asn1c_lang_C_type_REFERENCE }, { AMT_TYPE, A1TC_EXTENSIBLE, asn1c_lang_C_type_EXTENSIBLE }, /* * Constructed types */ { AMT_TYPE, ASN_CONSTR_SEQUENCE, asn1c_lang_C_type_SEQUENCE }, { AMT_TYPE, ASN_CONSTR_SEQUENCE_OF, asn1c_lang_C_type_SEx_OF, }, { AMT_TYPEREF, ASN_CONSTR_SEQUENCE_OF, asn1c_lang_C_type_SEx_OF }, { AMT_TYPE, ASN_CONSTR_SET, asn1c_lang_C_type_SET }, { AMT_TYPE, ASN_CONSTR_SET_OF, asn1c_lang_C_type_SEx_OF }, { AMT_TYPEREF, ASN_CONSTR_SET_OF, asn1c_lang_C_type_SEx_OF }, { AMT_TYPE, ASN_CONSTR_CHOICE, asn1c_lang_C_type_CHOICE }, /* * ANY type (deprecated) */ { AMT_TYPE, ASN_TYPE_ANY, asn1c_lang_C_type_SIMPLE_TYPE }, /* * Basic types */ { AMT_TYPE, ASN_BASIC_BOOLEAN, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_BASIC_NULL, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_BASIC_INTEGER, asn1c_lang_C_type_common_INTEGER }, { AMT_TYPE, ASN_BASIC_REAL, asn1c_lang_C_type_REAL }, { AMT_TYPE, ASN_BASIC_ENUMERATED, asn1c_lang_C_type_common_INTEGER }, { AMT_TYPE, ASN_BASIC_BIT_STRING, asn1c_lang_C_type_BIT_STRING }, { AMT_TYPE, ASN_BASIC_OCTET_STRING, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_BASIC_OBJECT_IDENTIFIER,asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_BASIC_RELATIVE_OID, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_BASIC_CHARACTER_STRING, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_BASIC_UTCTime, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_BASIC_GeneralizedTime, asn1c_lang_C_type_SIMPLE_TYPE }, /* * String types */ { AMT_TYPE, ASN_STRING_BMPString, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_GeneralString, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_GraphicString, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_IA5String, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_ISO646String, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_NumericString, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_PrintableString,asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_TeletexString, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_T61String, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_UniversalString,asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_UTF8String, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_VideotexString,asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_VisibleString, asn1c_lang_C_type_SIMPLE_TYPE }, { AMT_TYPE, ASN_STRING_ObjectDescriptor,asn1c_lang_C_type_SIMPLE_TYPE }, { 0, 0, 0 } }; #endif /* ASN1_COMPILER_LANGUAGE_C_H */ asn1c-0.9.24+dfsg/libasn1compiler/asn1c_out.c0000644000000000000000000000327111472004363017357 0ustar rootroot#include "asn1c_internal.h" #include "asn1c_out.h" /* * Add an elementary chunk of target language text * into appropriate output stream. */ int asn1c_compiled_output(arg_t *arg, const char *fmt, ...) { struct compiler_stream_destination_s *dst; const char *p; int lf_found; va_list ap; out_chunk_t *m; int ret; switch(arg->target->target) { case OT_IGNORE: return 0; default: dst = &arg->target->destination[arg->target->target]; break; } /* * Make sure the output has a single LF and only at the end. */ for(lf_found = 0, p = fmt; *p; p++) { if(*p == '\n') { lf_found++; assert(p[1] == '\0'); } } assert(lf_found <= 1); /* * Print out the indentation. */ if(dst->indented == 0) { int i = dst->indent_level; dst->indented = 1; while(i--) { ret = asn1c_compiled_output(arg, "\t"); if(ret == -1) return -1; } } if(lf_found) dst->indented = 0; /* * Allocate buffer. */ m = calloc(1, sizeof(out_chunk_t)); if(m == NULL) return -1; m->len = 16; do { void *tmp; m->len <<= 2; tmp = realloc(m->buf, m->len); if(tmp) { m->buf = (char *)tmp; } else { free(m->buf); free(m); return -1; } va_start(ap, fmt); ret = vsnprintf(m->buf, m->len, fmt, ap); va_end(ap); } while(ret >= (m->len - 1) || ret < 0); m->len = ret; if(arg->target->target == OT_INCLUDES || arg->target->target == OT_FWD_DECLS || arg->target->target == OT_POST_INCLUDE) { out_chunk_t *v; TQ_FOR(v, &dst->chunks, next) { if(m->len == v->len && !memcmp(m->buf, v->buf, m->len)) break; } if(v) { /* Entry is already present. Skip it. */ free(m->buf); free(m); return 0; } } TQ_ADD(&dst->chunks, m, next); return 0; } asn1c-0.9.24+dfsg/libasn1compiler/asn1c_fdeps.h0000644000000000000000000000163111472004363017654 0ustar rootroot#ifndef _ASN1C_FDEPS_H_ #define _ASN1C_FDEPS_H_ typedef struct asn1c_fdeps_s { char *filename; /* Or 0, if root. */ enum fdep_usage { FDEP_IGNORE = -1, /* Ignore contents of the section */ FDEP_NOTUSED = 0, FDEP_REFERRED = 1, /* Dynamic list of dependencies */ FDEP_CONVERTER = 2, /* Name of the int main() file */ FDEP_COMMON_FILES = 3, /* Section for mandatory dependencies */ FDEP_CODEC_PER = 4, /* Use contents only if -gen-PER */ } usage; /* Some file refers to it */ struct asn1c_fdeps_s **elements; int el_size; int el_count; } asn1c_fdeps_t; asn1c_fdeps_t *asn1c_read_file_dependencies(arg_t *arg, const char *datadir); /* Data may be a filename or an "#include <>" string. */ int asn1c_activate_dependency(asn1c_fdeps_t *deps, asn1c_fdeps_t *cur, const char *data); asn1c_fdeps_t *asn1c_deps_makelist(asn1c_fdeps_t *deps); #endif /* _ASN1C_FDEPS_H_ */ asn1c-0.9.24+dfsg/libasn1compiler/Makefile.am0000644000000000000000000000101311505405150017337 0ustar rootroot AM_CFLAGS = @ADD_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir)/libasn1parser \ -I$(top_srcdir)/libasn1fix noinst_LTLIBRARIES = libasn1compiler.la libasn1compiler_la_LDFLAGS = -all-static libasn1compiler_la_SOURCES = \ asn1compiler.c asn1compiler.h \ asn1c_misc.c asn1c_misc.h \ asn1c_out.c asn1c_out.h \ asn1c_lang.c asn1c_lang.h \ asn1c_save.c asn1c_save.h \ asn1c_C.c asn1c_C.h \ asn1c_constraint.c asn1c_constraint.h \ asn1c_compat.c asn1c_compat.h \ asn1c_fdeps.c asn1c_fdeps.h \ asn1c_internal.h asn1c-0.9.24+dfsg/libasn1compiler/asn1c_compat.c0000644000000000000000000000623412015121740020026 0ustar rootroot#include "asn1c_internal.h" #include "asn1c_compat.h" #ifndef MAXPATHLEN #define MAXPATHLEN 1024 #endif #ifndef DEFFILEMODE /* Normally in */ #ifdef _WIN32 #define DEFFILEMODE (S_IREAD|S_IWRITE) #else #define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) #endif #endif #ifdef HAVE_MKSTEMPS #undef mkstemp #define mkstemp(foo) mkstemps(foo, 0) #endif FILE * asn1c_open_file(const char *name, const char *ext, char **opt_tmpname) { int created = 1; #ifndef _WIN32 struct stat sb; #endif char *fname; size_t len; FILE *fp; int ret; int fd; /* * Compute filenames. */ len = strlen(name) + strlen(ext) + sizeof(".XXXXXX"); fname = alloca(len); ret = snprintf(fname, len, "%s%s%s", name, ext, opt_tmpname ? ".XXXXXX" : ""); assert(ret > 0 && ret < (ssize_t)len); if(opt_tmpname) { /* * Create temporary file. */ fd = mkstemp(fname); #ifndef _WIN32 (void)fchmod(fd, DEFFILEMODE); #endif } else { /* * Create specified file, or open the old one. */ fd = open(fname, O_CREAT | O_EXCL | O_WRONLY, DEFFILEMODE); if(fd == -1 && errno == EEXIST) { fd = open(fname, O_WRONLY, DEFFILEMODE); created = 0; } } if(fd == -1) { perror(fname); return NULL; } #ifndef _WIN32 /* * Check sanity. */ if(fstat(fd, &sb) || !S_ISREG(sb.st_mode)) { fprintf(stderr, "%s: Not a regular file\n", fname); if(created) unlink(fname); close(fd); return NULL; } (void)ftruncate(fd, 0); #else _chsize(fd, 0); #endif /* _WIN32 */ /* * Convert file descriptor into file pointer. */ fp = fdopen(fd, "w"); if(fp == NULL) { if(created) unlink(fname); close(fd); return NULL; } /* Return the temporary file name */ if(opt_tmpname) { *opt_tmpname = strdup(fname); if(*opt_tmpname) { /* Successfull */ } else { if(created) unlink(fname); fclose(fp); return NULL; } } return fp; } char * a1c_basename(const char *path) { static char strbuf[MAXPATHLEN]; const char *pend; const char *name; pend = path + strlen(path); if(pend == path) { strcpy(strbuf, "."); return strbuf; } /* Skip tailing slashes */ for(pend--; pend > path && *pend == '/'; pend--); if(pend == path && *path == '/') { strcpy(strbuf, "/"); return strbuf; } for(name = pend; name > path && name[-1] != '/'; name--); if((pend - name) >= (int)sizeof(strbuf) - 1) { errno = ENAMETOOLONG; return 0; } memcpy(strbuf, name, pend - name + 1); strbuf[pend - name + 1] = '\0'; return strbuf; } char * a1c_dirname(const char *path) { static char strbuf[MAXPATHLEN]; const char *pend; const char *last = 0; int in_slash = 0; /* One-pass determination of the last char of the pathname */ for(pend = path; ; pend++) { switch(*pend) { case '\0': break; case '/': if(!in_slash) { last = pend; in_slash = 1; } continue; default: if(in_slash) in_slash = 0; continue; } break; } if(last <= path) { strcpy(strbuf, *path == '/' ? "/" : "."); return strbuf; } if(!last) { strcpy(strbuf, "/"); return strbuf; } if((last - path) >= (int)sizeof(strbuf)) { errno = ENAMETOOLONG; return 0; } memcpy(strbuf, path, last - path); strbuf[last - path] = '\0'; return strbuf; } asn1c-0.9.24+dfsg/libasn1compiler/asn1c_constraint.h0000644000000000000000000000022311472004363020733 0ustar rootroot#ifndef _ASN1C_CONSTRAINT_H_ #define _ASN1C_CONSTRAINT_H_ int asn1c_emit_constraint_checking_code(arg_t *arg); #endif /* _ASN1C_CONSTRAINT_H_ */ asn1c-0.9.24+dfsg/README0000644000000000000000000000555611461150505013121 0ustar rootrootWHAT TO READ? ============= If you haven't installed the asn1c yet, read the INSTALL file for a short installation guide. For the list of asn1c command line options, see `asn1c -h` or `man asn1c`. For more complete documentation on this compiler and on using the results of compilation phase, please look into asn1c-quick.pdf and asn1c-usage.{pdf,html}. If you are building the compiler from the sources, these documents reside in the ./doc directory, otherwise they lie nearby the README file you're reading right now. Please also read the FAQ file. An excellent book on ASN.1 is written by Olivier Dubuisson: "ASN.1 Communication between heterogeneous systems", ISBN:0-12-6333361-0. QUICK START (also check out asn1c-quick.pdf) ============================================ After building [and installing] the compiler (see INSTALL), you may use the asn1c command to compile the ASN.1 specification: asn1c # Compile module If several specifications contain interdependencies, all of them must be specified: asn1c ... # Compile interdependent modules If you are building the asn1c from the sources, the ./examples directory contains several ASN.1 modules and a script to extract the ASN.1 modules from RFC documents. Refer to the README file in that directory. To compile the X.509 PKI module: ./asn1c/asn1c -P ./examples/rfc3280-*.asn1 # Compile-n-print In this example, -P option is used to instruct the compiler to print the compiled text on the standard output instead of creating multiple .c and .h files for every ASN.1 type found inside the specified ASN.1 modules. This is useful for debugging and test automation. The compiler -E and -EF options are used for testing the parser and the semantic fixer, respectively. These options will instruct the compiler to dump out the parsed (and fixed) ASN.1 specification as it was "understood" by the compiler. It might be useful for checking whether a particular syntactic construction is properly supported by the compiler. asn1c -EF # Check semantic validity MODEL OF OPERATION ================== The asn1c compiler works by processing the ASN.1 module specification in several stages: 1. In the first stage, the ASN.1 file is parsed. (Parsing produces an ASN.1 syntax tree for the subsequent levels) 2. In the second stage, the syntax tree is "fixed". (Fixing is a process of checking the tree for semantic errors, accompanied by the tree transformation into the canonical form) 3. In the third stage, the syntax tree is compiled into the target language. There are several command-line options reserved for printing the results after each stage of operation: => print (-E) => => print (-E -F) => => => print (-P) => => => save-compiled [default] -- Lev Walkin vlm@lionet.info asn1c-0.9.24+dfsg/doc/0000755000000000000000000000000012223077270012777 5ustar rootrootasn1c-0.9.24+dfsg/doc/docsrc/0000755000000000000000000000000012121077153014251 5ustar rootrootasn1c-0.9.24+dfsg/doc/docsrc/asn1c-usage.tex0000644000000000000000000014262312015121740017104 0ustar rootroot\documentclass[english,oneside,12pt]{book} \usepackage{fontspec} \usepackage{xunicode} \usepackage{xltxtra} \usepackage[hmargin={1in,1in},vmargin={2in,2in}]{geometry} \defaultfontfeatures{Mapping=tex-text} \setmainfont{Myriad Pro} \setsansfont{Myriad Pro} \setmonofont{Consolas} \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{longtable} \usepackage{booktabs} \usepackage{varioref} \usepackage{url} \makeatletter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands. %% Because html converters don't know tabularnewline \providecommand{\tabularnewline}{\\} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands. \newenvironment{lyxcode} {\par\begin{list}{}{ \setlength{\rightmargin}{\leftmargin} \setlength{\listparindent}{0pt}% needed for AMS classes \raggedright \setlength{\itemsep}{0pt} \setlength{\parsep}{0pt} \normalfont\ttfamily}% \item[]} {\end{list}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. \usepackage{extramarks} \lhead{\firstxmark} \rfoot{\lastxmark} \usepackage{color} \definecolor{linkred}{rgb}{0.8235,0.0863,0.1843} \definecolor{urlblue}{rgb}{0,0,.6} \usepackage[colorlinks=true, linkcolor={linkred}, urlcolor={urlblue}, pdfauthor={Lev Walkin}, pdftitle={Using the Open Source ASN.1 Compiler}, pdfkeywords={ASN.1,asn1c,compiler}, xetex ]{hyperref} %\fancyhf{} %\fancyhead[LE,RO]{\thepage} %\fancyhead[LO]{\rightmark} %\fancyhead[RE]{\leftmark} %\fancyfoot[R]{\lastxmark} \makeatother \usepackage{babel} \begin{document} \title{Using the Open Source ASN.1 Compiler} \author{Lev Walkin <\href{mailto:vlm@lionet.info?Subject=asn1c}{vlm@lionet.info}>} \maketitle \lhead{This document describes \href{http://lionet.info/asn1c}{asn1c-0.9.21}} \rhead{$Revision$} \tableofcontents{} \pagestyle{headings} \part{Using the ASN.1 Compiler} \chapter{Introduction to the ASN.1 Compiler} The purpose of the ASN.1 compiler is to convert the specifications in ASN.1 notation into some other language. At this moment, only C and C++ target languages are supported, the latter is in upward compatibility mode. The compiler reads the specification and emits a series of target language structures (C structs, unions, enums) describing the corresponding ASN.1 types. The compiler also creates the code which allows automatic serialization and deserialization of these structures using several standardized encoding rules (BER, DER, XER, PER). For example, suppose the following ASN.1 module is given% \footnote{Part \vref{par:ASN.1-Basics} provides a quick reference on the ASN.1 notation.}: \begin{lyxcode} RectangleTest~DEFINITIONS~::= BEGIN ~ Rectangle~::=~SEQUENCE~\{ ~~~~height~~INTEGER,~~~~~~~~-{}-~Height~of~the~rectangle ~~~~width~~~INTEGER~~~~~~~~~-{}-~Width~of~the~rectangle \} ~ END \end{lyxcode} The compiler would read this ASN.1 definition and produce the following C type% \footnote{\emph{-fnative-types} compiler option is used to produce basic C \emph{int} types instead of infinite width INTEGER\_t structures. See Section \vref{sec:Command-line-options}.% }: \begin{lyxcode} typedef~struct~Rectangle\_s~\{ ~~~~int~height; ~~~~int~width; \}~Rectangle\_t; \end{lyxcode} It would also create the code for converting this structure into platform-independent wire representation (a serializer API) and the decoder of such wire representation back into local, machine-specific type (a deserializer API). \section{Quick start with asn1c} After building and installing the compiler, the \emph{asn1c}% \footnote{The 1 symbol in asn\textbf{1}c is a digit, not an ``ell'' letter.% } command may be used to compile the ASN.1 module% \footnote{This is probably \textbf{not} what you want to try out right now. Read through the rest of this chapter and check the Section \vref{sec:Command-line-options} to find out about \textbf{-P} and \textbf{-R} options.% }: \begin{lyxcode} asn1c~\emph{} \end{lyxcode} If several ASN.1 modules contain interdependencies, all of the files must be specified altogether: \begin{lyxcode} asn1c~\emph{~~...} \end{lyxcode} The compiler \textbf{-E} and \textbf{-EF} options are used for testing the parser and the semantic fixer, respectively. These options will instruct the compiler to dump out the parsed (and fixed, if \textbf{-F} is involved) ASN.1 specification as it was ``understood'' by the compiler. It might be useful to check whether a particular syntactic construction is properly supported by the compiler. \begin{lyxcode} asn1c~\textbf{-EF}~\emph{} \end{lyxcode} The \textbf{-P} option is used to dump the compiled output on the screen instead of creating a bunch of .c and .h files on disk in the current directory. You would probably want to start with \textbf{-P} option instead of creating a mess in your current directory. Another option, \textbf{-R}, asks compiler to only generate the files which need to be generated, and supress linking in the numerous support files. Print the compiled output instead of creating multiple source files: \begin{lyxcode} asn1c~\textbf{-P}~\emph{} \end{lyxcode} \section{Recognizing compiler output} After compiling, the following entities will be created in your current directory: \begin{itemize} \item A set of .c and .h files, generally a single pair for each type defined in the ASN.1 specifications. These files will be named similarly to the ASN.1 types (\emph{Rectangle.c} and \emph{Rectangle.h} for the RectangleTest ASN.1 module defined in the beginning of this document). \item A set of helper .c and .h files which contain generic encoders, decoders and other useful routines. There will be quite a few of them, some of them even are not always necessary, but the overall amount of code after compilation will be rather small anyway. \item A \emph{Makefile.am.sample} file mentioning all the files created at the earlier steps. This file is suitable for either automake suite or the plain `make` utility. \end{itemize} It is your responsibility to create .c file with the \emph{int main()} routine. In other words, after compiling the Rectangle module, you have the following set of files: \{~Makefile.am.sample, Rectangle.c, Rectangle.h, \textbf{\ldots{}} \}, where ``\textbf{\ldots{}}'' stands for the set of additional ``helper'' files created by the compiler. If you add a simple file with the \emph{int main()} routine, it would even be possible to compile everything with the single instruction: \begin{lyxcode} cc~-I.~-o~rectangle.exe~{*}.c~~~\#~It~could~be~\emph{that}~simple \end{lyxcode} Refer to the Chapter \vref{cha:Step-by-step-examples} for a sample \emph{int main()} routine. \section{\label{sec:Command-line-options}Command line options} The following table summarizes the asn1c command line options. \renewcommand{\arraystretch}{1.33} \begin{longtable}{lp{4in}} \toprule \textbf{\small Overall Options} & \textbf{\small Description}\tabularnewline \midrule {\small -E} & {\small Stop after the parsing stage and print the reconstructed ASN.1 specification code to the standard output.}\tabularnewline {\small -F} & {\small Used together with -E, instructs the compiler to stop after the ASN.1 syntax tree fixing stage and dump the reconstructed ASN.1 specification to the standard output.}\tabularnewline {\small -P} & {\small Dump the compiled output to the standard output instead of creating the target language files on disk.}\tabularnewline {\small -R} & {\small Restrict the compiler to generate only the ASN.1 tables, omitting the usual support code.}\tabularnewline {\small -S }\emph{\small } & {\small Use the specified directory with ASN.1 skeleton files.}\tabularnewline {\small -X} & {\small Generate the XML DTD for the specified ASN.1 modules.}\tabularnewline \midrule\tabularnewline \textbf{\small Warning Options} & \textbf{\small Description}\tabularnewline \midrule {\small -Werror} & {\small Treat warnings as errors; abort if any warning is produced.}\tabularnewline {\small -Wdebug-lexer} & {\small Enable lexer debugging during the ASN.1 parsing stage.}\tabularnewline {\small -Wdebug-fixer} & {\small Enable ASN.1 syntax tree fixer debugging during the fixing stage.}\tabularnewline {\small -Wdebug-compiler} & {\small Enable debugging during the actual compile time.}\tabularnewline \midrule\tabularnewline \textbf{\small Language Options} & \textbf{\small Description}\tabularnewline \midrule {\small -fbless-SIZE} & {\small Allow SIZE() constraint for INTEGER, ENUMERATED, and other types for which this constraint is normally prohibited by the standard. This is a violation of an ASN.1 standard and compiler may fail to produce the meaningful code.}\tabularnewline {\small -fcompound-names} & {\small Use complex names for C structures. Using complex names prevents name clashes in case the module reuses the same identifiers in multiple contexts.}\tabularnewline {\small -findirect-choice} & {\small When generating code for a CHOICE type, compile the CHOICE members as indirect pointers instead of declaring them inline. Consider using this option together with }\textbf{\small -fno-include-deps}{\small{} to prevent circular references. }\tabularnewline {\small -fknown-extern-type=}\emph{\small } & {\small Pretend the specified type is known. The compiler will assume the target language source files for the given type have been provided manually. }\tabularnewline {\small -fnative-types} & {\small Use the native machine's data types (int, double) whenever possible, instead of the compound INTEGER\_t, ENUMERATED\_t and REAL\_t types. }\tabularnewline {\small -fno-constraints} & {\small Do not generate ASN.1 subtype constraint checking code. This may produce a shorter executable.}\tabularnewline {\small -fno-include-deps} & {\small Do not generate courtesy \#include lines for non-critical dependencies.}\tabularnewline {\small -funnamed-unions} & {\small Enable unnamed unions in the definitions of target language's structures.}\tabularnewline {\small -fskeletons-copy} & {\small Copy support files rather than symlink them.}\tabularnewline \midrule\tabularnewline \textbf{\small Codecs Generation Options} & \textbf{\small Description}\tabularnewline \midrule {\small -gen-PER} & {\small Generate Packed Encoding Rules (PER) support code.}\tabularnewline {\small -pdu=}\emph{\small auto} & {\small Generate PDU tables by discovering Protocol Data Units automatically.}\tabularnewline \midrule\tabularnewline \textbf{\small Output Options} & \textbf{\small Description}\tabularnewline \midrule {\small -print-constraints} & {\small When -EF are also specified, this option forces the compiler to explain its internal understanding of subtype constraints.}\tabularnewline {\small -print-lines} & {\small Generate ``-{}- \#line'' comments in -E output.}\tabularnewline \bottomrule \end{longtable} \renewcommand{\arraystretch}{1} \chapter{Using the ASN.1 Compiler} \section[Invoking the helper code]{Invoking the ASN.1 helper code} First of all, you should include one or more header files into your application. Typically, it is enough to include the header file of the main PDU type. For our Rectangle module, including the Rectangle.h file is sufficient: \begin{lyxcode} \#include~ \end{lyxcode} The header files defines the C structure corresponding to the ASN.1 definition of a rectangle and the declaration of the ASN.1 type descriptor, which is used as an argument to most of the functions provided by the ASN.1 module. For example, here is the code which frees the Rectangle\_t structure: \begin{lyxcode} Rectangle\_t~{*}rect~=~...; ~ asn\_DEF\_Rectangle.free\_struct(\&asn\_DEF\_Rectangle, rect,~0); \end{lyxcode} This code defines a \emph{rect} pointer which points to the Rectangle\_t structure which needs to be freed. The second line invokes the generic \emph{free\_struct()} routine created specifically for this Rectangle\_t structure. The \emph{asn\_DEF\_Rectangle} is the type descriptor, which holds a collection of routines to deal with the Rectangle\_t structure. The following member functions of the asn\_DEF\_Rectangle type descriptor are of interest: \begin{description} \item [{ber\_decoder}] This is the generic \emph{restartable}% \footnote{Restartable means that if the decoder encounters the end of the buffer, it will fail, but may later be invoked again with the rest of the buffer to continue decoding.% } BER decoder (Basic Encoding Rules). This decoder would create and/or fill the target structure for you. See Section \vref{sub:Decoding-BER}. \item [{der\_encoder}] This is the generic DER encoder (Distinguished Encoding Rules). This encoder will take the target structure and encode it into a series of bytes. See Section \vref{sub:Encoding-DER}. NOTE: DER encoding is a subset of BER. Any BER decoder should be able to handle DER input. \item [{xer\_decoder}] This is the generic XER decoder. It takes both BASIC-XER or CANONICAL-XER encodings and deserializes the data into a local, machine-dependent representation. See Section \vref{sub:Decoding-XER}. \item [{xer\_encoder}] This is the XER encoder (XML Encoding Rules). This encoder will take the target structure and represent it as an XML (text) document using either BASIC-XER or CANONICAL-XER encoding rules. See Section \vref{sub:Encoding-XER}. \item [{uper\_decoder}] This is the Unaligned PER decoder. \item [{uper\_encoder}] This is the Unaligned Basic PER encoder. This encoder will take the target structure and encode it into a series of bytes. \item [{check\_constraints}] Check that the contents of the target structure are semantically valid and constrained to appropriate implicit or explicit subtype constraints. See Section \vref{sub:Validating-the-target}. \item [{print\_struct}] This function convert the contents of the passed target structure into human readable form. This form is not formal and cannot be converted back into the structure, but it may turn out to be useful for debugging or quick-n-dirty printing. See Section \vref{sub:Printing-the-target}. \item [{free\_struct}] This is a generic disposal which frees the target structure. See Section \vref{sub:Freeing-the-target}. \end{description} Each of the above function takes the type descriptor (\emph{asn\_DEF\_\ldots{}}) and the target structure (\emph{rect}, in the above example). \subsection{\label{sub:Decoding-BER}Decoding BER} The Basic Encoding Rules describe the most widely used (by the ASN.1 community) way to encode and decode a given structure in a machine-independent way. Several other encoding rules (CER, DER) define a more restrictive versions of BER, so the generic BER parser is also capable of decoding the data encoded by CER and DER encoders. The opposite is not true. \emph{The ASN.1 compiler provides the generic BER decoder which is implicitly capable of decoding BER, CER and DER encoded data.} The decoder is restartable (stream-oriented), which means that in case the buffer has less data than it is expected, the decoder will process whatever there is available and ask for more data to be provided. Please note that the decoder may actually process less data than it was given in the buffer, which means that you must be able to make the next buffer contain the unprocessed part of the previous buffer. Suppose, you have two buffers of encoded data: 100 bytes and 200 bytes. \begin{itemize} \item You may concatenate these buffers and feed the BER decoder with 300 bytes of data, or \item You may feed it the first buffer of 100 bytes of data, realize that the ber\_decoder consumed only 95 bytes from it and later feed the decoder with 205 bytes buffer which consists of 5 unprocessed bytes from the first buffer and the additional 200 bytes from the second buffer. \end{itemize} This is not as convenient as it could be (like, the BER encoder could consume the whole 100 bytes and keep these 5 bytes in some temporary storage), but in case of existing stream based processing it might actually fit well into existing algorithm. Suggestions are welcome. Here is the simplest example of BER decoding. \begin{lyxcode} Rectangle\_t~{*} simple\_deserializer(const~void~{*}buffer,~size\_t~buf\_size)~\{ ~~~~Rectangle\_t~{*}rect~=~0;~~~~/{*}~Note~this~0!~{*}/ ~~~~asn\_dec\_rval\_t~rval; ~ ~~~~rval~=~\textbf{asn\_DEF\_Rectangle.ber\_decoder}(0, ~~~~~~~~~~\&asn\_DEF\_Rectangle, ~~~~~~~~~~(void~{*}{*})\&rect, ~~~~~~~~~~buffer,~buf\_size, ~~~~~~~~~~0); ~ ~~~~if(rval\textbf{.code}~==~RC\_OK)~\{ ~~~~~~~~return~rect;~~~~~~~~~~/{*}~Decoding~succeeded~{*}/ ~~~~\}~else~\{ ~~~~~~~~/{*}~Free~partially~decoded~rect~{*}/ ~~~~~~~~asn\_DEF\_Rectangle.free\_struct(\&asn\_DEF\_Rectangle,~rect,~0); ~~~~~~~~return~0; ~~~~\} \} \end{lyxcode} The code above defines a function, \emph{simple\_deserializer}, which takes a buffer and its length and is expected to return a pointer to the Rectangle\_t structure. Inside, it tries to convert the bytes passed into the target structure (rect) using the BER decoder and returns the rect pointer afterwards. If the structure cannot be deserialized, it frees the memory which might be left allocated by the unfinished \emph{ber\_decoder} routine and returns 0 (no data). (This \textbf{freeing is necessary} because the ber\_decoder is a restartable procedure, and may fail just because there is more data needs to be provided before decoding could be finalized). The code above obviously does not take into account the way the \emph{ber\_decoder()} failed, so the freeing is necessary because the part of the buffer may already be decoded into the structure by the time something goes wrong. A little less wordy would be to invoke a globally available \emph{ber\_decode()} function instead of dereferencing the asn\_DEF\_Rectangle type descriptor: \begin{lyxcode} rval~=~ber\_decode(0,~\&asn\_DEF\_Rectangle,~(void~{*}{*})\&rect, ~~~~buffer,~buf\_size); \end{lyxcode} Note that the initial (asn\_DEF\_Rectangle.ber\_decoder) reference is gone, and also the last argument (0) is no longer necessary. These two ways of BER decoder invocations are fully equivalent. The BER de\emph{coder} may fail because of (\emph{the following RC\_\ldots{} codes are defined in ber\_decoder.h}): \begin{itemize} \item RC\_WMORE: There is more data expected than it is provided (stream mode continuation feature); \item RC\_FAIL: General failure to decode the buffer; \item \ldots{} other codes may be defined as well. \end{itemize} Together with the return code (.code) the asn\_dec\_rval\_t type contains the number of bytes which is consumed from the buffer. In the previous hypothetical example of two buffers (of 100 and 200 bytes), the first call to ber\_decode() would return with .code = RC\_WMORE and .consumed = 95. The .consumed field of the BER decoder return value is \textbf{always} valid, even if the decoder succeeds or fails with any other return code. Look into ber\_decoder.h for the precise definition of ber\_decode() and related types. \subsection{\label{sub:Encoding-DER}Encoding DER} The Distinguished Encoding Rules is the \emph{canonical} variant of BER encoding rules. The DER is best suited to encode the structures where all the lengths are known beforehand. This is probably exactly how you want to encode: either after a BER decoding or after a manual fill-up, the target structure contains the data which size is implicitly known before encoding. Among other uses, the DER encoding is used to encode X.509 certificates. As with BER decoder, the DER encoder may be invoked either directly from the ASN.1 type descriptor (asn\_DEF\_Rectangle) or from the stand-alone function, which is somewhat simpler: \begin{lyxcode} ~ /{*} ~{*}~This~is~the~serializer~itself, ~{*}~it~supplies~the~DER~encoder~with~the ~{*}~pointer~to~the~custom~output~function. ~{*}/ ssize\_t simple\_serializer(FILE~{*}ostream,~Rectangle\_t~{*}rect)~\{ ~~~~asn\_enc\_rval\_t~er;~~/{*}~Encoder~return~value~{*}/ ~ ~~~~er~=~der\_encode(\&asn\_DEF\_Rect,~rect, ~~~~~~~~write\_stream,~ostream); ~~~~if(er.\textbf{encoded}~==~-1)~\{ ~~~~~~~~/{*} ~~~~~~~~~{*}~Failed~to~encode~the~rectangle~data. ~~~~~~~~~{*}/ ~~~~~~~~fprintf(stderr,~''Cannot~encode~\%s:~\%s\textbackslash{}n'', ~~~~~~~~~~~~er.\textbf{failed\_type}->name, strerror(errno)); ~~~~~~~~return~-1; ~~~~\}~else~\{ ~~~~~~~~/{*}~Return~the~number~of~bytes~{*}/ ~~~~~~~~return~er.encoded; ~~~~\} \} \end{lyxcode} As you see, the DER encoder does not write into some sort of buffer or something. It just invokes the custom function (possible, multiple times) which would save the data into appropriate storage. The optional argument \emph{app\_key} is opaque for the DER encoder code and just used by \emph{\_write\_stream()} as the pointer to the appropriate output stream to be used. If the custom write function is not given (passed as 0), then the DER encoder will essentially do the same thing (i.e., encode the data) but no callbacks will be invoked (so the data goes nowhere). It may prove useful to determine the size of the structure's encoding before actually doing the encoding% \footnote{It is actually faster too: the encoder might skip over some computations which aren't important for the size determination.% }. Look into der\_encoder.h for the precise definition of der\_encode() and related types. \subsection{\label{sub:Encoding-XER}Encoding XER} The XER stands for XML Encoding Rules, where XML, in turn, is eXtensible Markup Language, a text-based format for information exchange. The encoder routine API comes in two flavors: stdio-based and callback-based. With the callback-based encoder, the encoding process is very similar to the DER one, described in Section \vref{sub:Encoding-DER}. The following example uses the definition of write\_stream() from up there. \begin{lyxcode} /{*} ~{*}~This~procedure~generates~the~XML~document ~{*}~by~invoking~the~XER~encoder. ~{*}~NOTE:~Do~not~copy~this~code~verbatim! ~{*}~~~~~~~If~the~stdio~output~is~necessary, ~{*}~~~~~~~use~the~xer\_fprint()~procedure~instead. ~{*}~~~~~~~See~Section~\vref{sub:Printing-the-target}. ~{*}/ int print\_as\_XML(FILE~{*}ostream,~Rectangle\_t~{*}rect)~\{ ~~~~asn\_enc\_rval\_t~er;~~/{*}~Encoder~return~value~{*}/ ~ ~~~~er~=~xer\_encode(\&asn\_DEF\_Rectangle,~rect, ~~~~~~~~XER\_F\_BASIC,~/{*}~BASIC-XER~or~CANONICAL-XER~{*}/ ~~~~~~~~write\_stream,~ostream); ~ ~~~~return~(er.encoded~==~-1)~?~-1~:~0; \} \end{lyxcode} Look into xer\_encoder.h for the precise definition of xer\_encode() and related types. See Section \ref{sub:Printing-the-target} for the example of stdio-based XML encoder and other pretty-printing suggestions. \subsection{\label{sub:Decoding-XER}Decoding XER} The data encoded using the XER rules can be subsequently decoded using the xer\_decode() API call: \begin{lyxcode} Rectangle\_t~{*} XML\_to\_Rectangle(const~void~{*}buffer,~size\_t~buf\_size)~\{ ~~~~Rectangle\_t~{*}rect~=~0;~/{*}~Note~this~0!~{*}/ ~~~~asn\_dec\_rval\_t~rval; ~~ ~~~~rval~=~xer\_decode(0,~\&asn\_DEF\_Rectangle,~(void~{*}{*})\&rect, ~~~~~~~~buffer,~buf\_size); ~~~~if(rval\textbf{.code}~==~RC\_OK)~\{ ~~~~~~~~return~rect;~~~~~~~~~~/{*}~Decoding~succeeded~{*}/ ~~~~\}~else~\{ ~~~~~~~~/{*}~Free~partially~decoded~rect~{*}/ ~~~~~~~~asn\_DEF\_Rectangle.free\_struct(\&asn\_DEF\_Rectangle,~rect,~0); ~~~~~~~~return~0; ~~~~\} \} \end{lyxcode} The decoder takes both BASIC-XER and CANONICAL-XER encodings. The decoder shares its data consumption properties with BER decoder; please read the Section \vref{sub:Decoding-BER} to know more. Look into xer\_decoder.h for the precise definition of xer\_decode() and related types. \subsection{\label{sub:Validating-the-target}Validating the target structure} Sometimes the target structure needs to be validated. For example, if the structure was created by the application (as opposed to being decoded from some external source), some important information required by the ASN.1 specification might be missing. On the other hand, the successful decoding of the data from some external source does not necessarily mean that the data is fully valid either. It might well be the case that the specification describes some subtype constraints that were not taken into account during decoding, and it would actually be useful to perform the last check when the data is ready to be encoded or when the data has just been decoded to ensure its validity according to some stricter rules. The asn\_check\_constraints() function checks the type for various implicit and explicit constraints. It is recommended to use asn\_check\_constraints() function after each decoding and before each encoding. Look into constraints.h for the precise definition of asn\_check\_constraints() and related types. \subsection{\label{sub:Printing-the-target}Printing the target structure} There are two ways to print the target structure: either invoke the print\_struct member of the ASN.1 type descriptor, or using the asn\_fprint() function, which is a simpler wrapper of the former: \begin{lyxcode} asn\_fprint(stdout,~\&asn\_DEF\_Rectangle,~rect); \end{lyxcode} Look into constr\_TYPE.h for the precise definition of asn\_fprint() and related types. Another practical alternative to this custom format printing would be to invoke XER encoder. The default BASIC-XER encoder performs reasonable formatting for the output to be useful and human readable. To invoke the XER decoder in a manner similar to asn\_fprint(), use the xer\_fprint() call: \begin{lyxcode} xer\_fprint(stdout,~\&asn\_DEF\_Rectangle,~rect); \end{lyxcode} See Section \vref{sub:Encoding-XER} for XML-related details. \subsection{\label{sub:Freeing-the-target}Freeing the target structure} Freeing the structure is slightly more complex than it may seem to. When the ASN.1 structure is freed, all the members of the structure and their submembers are recursively freed as well. But it might not be feasible to free the structure itself. Consider the following case: \begin{lyxcode} struct~my\_figure~\{~~~~~~~/{*}~The~custom~structure~{*}/ ~~~~int~flags;~~~~~~~~~~~/{*}~~{*}/ ~~~~/{*}~The~type~is~generated~by~the~ASN.1~compiler~{*}/ ~~~~\emph{Rectangle\_t~rect;} ~~~~/{*}~other~members~of~the~structure~{*}/ \}; \end{lyxcode} In this example, the application programmer defined a custom structure with one ASN.1-derived member (rect). This member is not a reference to the Rectangle\_t, but an in-place inclusion of the Rectangle\_t structure. If the freeing is necessary, the usual procedure of freeing everything must not be applied to the \&rect pointer itself, because it does not point to the memory block directly allocated by the memory allocation routine, but instead lies within a block allocated for the my\_figure structure. To solve this problem, the free\_struct routine has the additional argument (besides the obvious type descriptor and target structure pointers), which is the flag specifying whether the outer pointer itself must be freed (0, default) or it should be left intact (non-zero value). \begin{lyxcode} \textbf{/{*}~1.~Rectangle\_t~is~defined~within~my\_figure~{*}/} struct~my\_figure~\{ ~~~~Rectangle\_t~rect; \}~{*}mf~=~\textbf{...}; /{*} ~{*}~Freeing~the~Rectangle\_t ~{*}~without~freeing~the~mf->rect~area ~{*}/ asn\_DEF\_Rectangle.free\_struct( ~~~~\&asn\_DEF\_Rectangle,~\&mf->rect,~\textbf{1}~\textbf{/{*}~!free~{*}/}); ~~~~ ~~ \textbf{/{*}~2.~Rectangle\_t~is~a~stand-alone~pointer~{*}/} Rectangle\_t~{*}rect~=~\textbf{...}; /{*} ~{*}~Freeing~the~Rectangle\_t ~{*}~and~freeing~the~rect~pointer ~{*}/ asn\_DEF\_Rectangle.free\_struct( ~~~~\&asn\_DEF\_Rectangle,~rect,~\textbf{0}~\textbf{/{*}~free~the~pointer~too~{*}/}); \end{lyxcode} It is safe to invoke the \emph{free\_struct} function with the target structure pointer set to 0 (NULL), the function will do nothing. For the programmer's convenience, the following macros are available: \begin{lyxcode} ASN\_STRUCT\_FREE(asn\_DEF,~ptr); ASN\_STRUCT\_FREE\_CONTENTS\_ONLY(asn\_DEF,~ptr); \end{lyxcode} These macros bear the same semantics as the \emph{free\_struct} function invocation, discussed above. \chapter{\label{cha:Step-by-step-examples}Step by step examples} \section{A ``Rectangle'' Encoder} This example will help you create a simple BER and XER encoder of a ``Rectangle'' type used throughout this document. \begin{enumerate} \item Create a file named \textbf{rectangle.asn1} with the following contents: \begin{lyxcode} RectangleModule1~DEFINITIONS~::= BEGIN ~ Rectangle~::=~SEQUENCE~\{ ~~~~height~~INTEGER, ~~~~width~~~INTEGER \} ~ END \end{lyxcode} \item Compile it into the set of .c and .h files using asn1c compiler \cite{ASN1C}: \begin{lyxcode} \emph{asn1c~-fnative-types}~\textbf{rectangle.asn1} \end{lyxcode} \item Alternatively, use the Online ASN.1 compiler \cite{AONL} by uploading the \textbf{rectangle.asn1} file into the Web form and unpacking the produced archive on your computer. \item By this time, you should have gotten multiple files in the current directory, including the \textbf{Rectangle.c} and \textbf{Rectangle.h}. \item Create a main() routine which creates the Rectangle\_t structure in memory and encodes it using BER and XER encoding rules. Let's name the file \textbf{main.c}:\clearpage{} \begin{lyxcode} {\small \#include~}{\small \par} {\small \#include~}{\small \par} {\small \#include~~~~/{*}~Rectangle~ASN.1~type~~{*}/}{\small \par} ~ {\small /{*}}{\small \par} {\small{}~{*}~This~is~a~custom~function~which~writes~the}{\small \par} {\small{}~{*}~encoded~output~into~some~FILE~stream.}{\small \par} {\small{}~{*}/}{\small \par} {\small static~int}{\small \par} {\small write\_out(const~void~{*}buffer,~size\_t~size,~void~{*}app\_key)~\{}{\small \par} {\small{}~~~~FILE~{*}out\_fp~=~app\_key;}{\small \par} {\small{}~~~~size\_t~wrote;}{\small \par} {\small{}~}{\small \par} {\small{}~~~~wrote~=~fwrite(buffer,~1,~size,~out\_fp);}{\small \par} {\small{}~}{\small \par} {\small{}~~~~return~(wrote~==~size)~?~0~:~-1;}{\small \par} {\small \}}{\small \par} ~ {\small int~main(int~ac,~char~{*}{*}av)~\{}{\small \par} {\small{}~~~~Rectangle\_t~{*}rectangle;~/{*}~Type~to~encode~~~~~~~~{*}/}{\small \par} {\small{}~~~~asn\_enc\_rval\_t~ec;~~~~~~/{*}~Encoder~return~value~~{*}/}{\small \par} {\small{}~}{\small \par} {\small{}~~~~/{*}~Allocate~the~Rectangle\_t~{*}/}{\small \par} {\small{}~~~~rectangle~=~calloc(1,~sizeof(Rectangle\_t));~/{*}~not~malloc!~{*}/}{\small \par} {\small{}~~~~if(!rectangle)~\{}{\small \par} {\small{}~~~~~~perror(''calloc()~failed'');}{\small \par} {\small{}~~~~~~exit(71);~/{*}~better,~EX\_OSERR~{*}/}{\small \par} {\small{}~~~~\}}{\small \par} {\small{}~}{\small \par} {\small{}~~~~/{*}~Initialize~the~Rectangle~members~{*}/}{\small \par} {\small{}~~~~rectangle->height~=~42;~~/{*}~any~random~value~{*}/}{\small \par} {\small{}~~~~rectangle->width~~=~23;~~/{*}~any~random~value~{*}/}{\small \par} {\small{}~~~~~}{\small \par} {\small{}~~~~/{*}~BER~encode~the~data~if~filename~is~given~{*}/}{\small \par} {\small{}~~~~if(ac~<~2)~\{}{\small \par} {\small{}~~~~~~fprintf(stderr,~''Specify~filename~for~BER~output\textbackslash{}n'');}{\small \par} {\small{}~~~~\}~else~\{}{\small \par} {\small{}~~~~~~const~char~{*}filename~=~av{[}1{]};}{\small \par} {\small{}~~~~~~FILE~{*}fp~=~fopen(filename,~''wb'');~~~/{*}~for~BER~output~{*}/}{\small \par} ~ {\small{}~~~~~~if(!fp)~\{}{\small \par} {\small{}~~~~~~~~perror(filename);}{\small \par} {\small{}~~~~~~~~exit(71);~/{*}~better,~EX\_OSERR~{*}/}{\small \par} {\small{}~~~~~~\}}{\small \par} {\small{}~~}{\small \par} {\small{}~~~~~~/{*}~Encode~the~Rectangle~type~as~BER~(DER)~{*}/}{\small \par} {\small{}~~~~~~ec~=~der\_encode(\&asn\_DEF\_Rectangle,}{\small \par} {\small{}~~~~~~~~~~~~rectangle,~write\_out,~fp);}{\small \par} {\small{}~~~~~~fclose(fp);}{\small \par} {\small{}~~~~~~if(ec.encoded~==~-1)~\{}{\small \par} {\small{}~~~~~~~~fprintf(stderr,}{\small \par} {\small{}~~~~~~~~~~''Could~not~encode~Rectangle~(at~\%s)\textbackslash{}n'',}{\small \par} {\small{}~~~~~~~~~~ec.failed\_type~?~ec.failed\_type->name~:~''unknown'');}{\small \par} {\small{}~~~~~~~~exit(65);~/{*}~better,~EX\_DATAERR~{*}/}{\small \par} {\small{}~~~~~~\}~else~\{}{\small \par} {\small{}~~~~~~~~fprintf(stderr,~''Created~\%s~with~BER~encoded~Rectangle\textbackslash{}n'',}{\small \par} {\small{}~~~~~~~~~~filename);}{\small \par} {\small{}~~~~~~\}}{\small \par} {\small{}~~~~\}}{\small \par} {\small{}~}{\small \par} {\small{}~~~~/{*}~Also~print~the~constructed~Rectangle~XER~encoded~(XML)~{*}/}{\small \par} {\small{}~~~~xer\_fprint(stdout,~\&asn\_DEF\_Rectangle,~rectangle);}{\small \par} {\small{}~}{\small \par} {\small{}~~~~return~0;~/{*}~Encoding~finished~successfully~{*}/}{\small \par} {\small \}}{\small \par} \end{lyxcode} \item Compile all files together using C compiler (varies by platform): \begin{lyxcode} \emph{cc~-I.~-o}~\textbf{\emph{rencode}}~\emph{{*}.c} \end{lyxcode} \item Voila! You have just created the BER and XER encoder of a Rectangle type, named \textbf{rencode}! \end{enumerate} \clearpage{} \section{\label{sec:A-Rectangle-Decoder}A ``Rectangle'' Decoder} This example will help you to create a simple BER decoder of a simple ``Rectangle'' type used throughout this document. \begin{enumerate} \item Create a file named \textbf{rectangle.asn1} with the following contents: \begin{lyxcode} RectangleModule1~DEFINITIONS~::= BEGIN ~ Rectangle~::=~SEQUENCE~\{ ~~~~height~~INTEGER, ~~~~width~~~INTEGER \} ~ END \end{lyxcode} \item Compile it into the set of .c and .h files using asn1c compiler \cite{ASN1C}: \begin{lyxcode} \emph{asn1c~-fnative-types}~\textbf{rectangle.asn1} \end{lyxcode} \item Alternatively, use the Online ASN.1 compiler \cite{AONL} by uploading the \textbf{rectangle.asn1} file into the Web form and unpacking the produced archive on your computer. \item By this time, you should have gotten multiple files in the current directory, including the \textbf{Rectangle.c} and \textbf{Rectangle.h}. \item Create a main() routine which takes the binary input file, decodes it as it were a BER-encoded Rectangle type, and prints out the text (XML) representation of the Rectangle type. Let's name the file \textbf{main.c}:\clearpage{} \begin{lyxcode} {\small \#include~}{\small \par} {\small \#include~}{\small \par} {\small \#include~~~~/{*}~Rectangle~ASN.1~type~~{*}/}{\small \par} {\small{}~}{\small \par} {\small int~main(int~ac,~char~{*}{*}av)~\{}{\small \par} {\small{}~~~~char~buf{[}1024{]};~~~~~~/{*}~Temporary~buffer~~~~~~{*}/}{\small \par} {\small{}~~~~Rectangle\_t~{*}rectangle~=~0;~/{*}~Type~to~decode~{*}/}{\small \par} {\small{}~~~~asn\_dec\_rval\_t~rval;~/{*}~Decoder~return~value~~{*}/}{\small \par} {\small{}~~~~FILE~{*}fp;~~~~~~~~~~~~/{*}~Input~file~handler~~~~{*}/}{\small \par} {\small{}~~~~size\_t~size;~~~~~~~~~/{*}~Number~of~bytes~read~~{*}/}{\small \par} {\small{}~~~~char~{*}filename;~~~~~~/{*}~Input~file~name~{*}/}{\small \par} {\small{}~}{\small \par} {\small{}~~~~/{*}~Require~a~single~filename~argument~{*}/}{\small \par} {\small{}~~~~if(ac~!=~2)~\{}{\small \par} {\small{}~~~~~~fprintf(stderr,~''Usage:~\%s~\textbackslash{}n'',~av{[}0{]});}{\small \par} {\small{}~~~~~~exit(64);~/{*}~better,~EX\_USAGE~{*}/}{\small \par} {\small{}~~~~\}~else~\{}{\small \par} {\small{}~~~~~~filename~=~av{[}1{]};}{\small \par} {\small{}~~~~\}}{\small \par} {\small{}~}{\small \par} {\small{}~~~~/{*}~Open~input~file~as~read-only~binary~{*}/}{\small \par} {\small{}~~~~fp~=~fopen(filename,~''rb'');}{\small \par} {\small{}~~~~if(!fp)~\{}{\small \par} {\small{}~~~~~~perror(filename);}{\small \par} {\small{}~~~~~~exit(66);~/{*}~better,~EX\_NOINPUT~{*}/}{\small \par} {\small{}~~~~\}}{\small \par} {\small{}~~}{\small \par} {\small{}~~~~/{*}~Read~up~to~the~buffer~size~{*}/}{\small \par} {\small{}~~~~size~=~fread(buf,~1,~sizeof(buf),~fp);}{\small \par} {\small{}~~~~fclose(fp);}{\small \par} {\small{}~~~~if(!size)~\{}{\small \par} {\small{}~~~~~~fprintf(stderr,~''\%s:~Empty~or~broken\textbackslash{}n'',~filename);}{\small \par} {\small{}~~~~~~exit(65);~/{*}~better,~EX\_DATAERR~{*}/}{\small \par} {\small{}~~~~\}}{\small \par} {\small{}~}{\small \par} {\small{}~~~~/{*}~Decode~the~input~buffer~as~Rectangle~type~{*}/}{\small \par} {\small{}~~~~rval~=~ber\_decode(0,~\&asn\_DEF\_Rectangle,}{\small \par} {\small{}~~~~~~(void~{*}{*})\&rectangle,~buf,~size);}{\small \par} {\small{}~~~~if(rval.code~!=~RC\_OK)~\{}{\small \par} {\small{}~~~~~~fprintf(stderr,}{\small \par} {\small{}~~~~~~~~''\%s:~Broken~Rectangle~encoding~at~byte~\%ld\textbackslash{}n'',}{\small \par} {\small{}~~~~~~~~filename,~(long)rval.consumed);}{\small \par} {\small{}~~~~~~exit(65);~/{*}~better,~EX\_DATAERR~{*}/}{\small \par} {\small{}~~~~\}}{\small \par} {\small{}~}{\small \par} {\small{}~~~~/{*}~Print~the~decoded~Rectangle~type~as~XML~{*}/}{\small \par} {\small{}~~~~xer\_fprint(stdout,~\&asn\_DEF\_Rectangle,~rectangle);}{\small \par} {\small{}~}{\small \par} {\small{}~~~~return~0;~/{*}~Decoding~finished~successfully~{*}/}{\small \par} {\small \}}{\small \par} \end{lyxcode} \item Compile all files together using C compiler (varies by platform): \begin{lyxcode} \emph{cc~-I.~-o}~\textbf{\emph{rdecode}}~\emph{{*}.c} \end{lyxcode} \item Voila! You have just created the BER decoder of a Rectangle type, named \textbf{rdecode}! \end{enumerate} \chapter{Constraint validation examples} This chapter shows how to define ASN.1 constraints and use the generated validation code. \section{Adding constraints into ``Rectangle'' type} This example shows how to add basic constraints to the ASN.1 specification and how to invoke the constraints validation code in your application. \begin{enumerate} \item Create a file named \textbf{rectangle.asn1} with the following contents: \begin{lyxcode} RectangleModuleWithConstraints~DEFINITIONS~::= BEGIN ~ Rectangle~::=~SEQUENCE~\{ ~~~~height~~INTEGER~(0..100),~-{}-~Value~range~constraint ~~~~width~~~INTEGER~(0..MAX)~~-{}-~Makes~width~non-negative~ \} ~ END \end{lyxcode} \item Compile the file according to procedures shown in the previous chapter. \item Modify the Rectangle type processing routine (you can start with the main() routine shown in the Section \vref{sec:A-Rectangle-Decoder}) by placing the following snippet of code \emph{before} encoding and/or \emph{after} decoding the Rectangle type% \footnote{Placing the constraint checking code \emph{before} encoding helps to make sure you know the data is correct and within constraints before sharing the data with anyone else. Placing the constraint checking code \emph{after} decoding, but before any further action depending on the decoded data, helps to make sure the application got the valid contents before making use of it.% }:\clearpage{} \begin{lyxcode} {\small int~ret;~~~~~~~~~~~/{*}~Return~value~{*}/}{\small \par} {\small char~errbuf{[}128{]};~~/{*}~Buffer~for~error~message~{*}/}{\small \par} {\small size\_t~errlen~=~sizeof(errbuf);~~/{*}~Size~of~the~buffer~{*}/}{\small \par} {\small{}~~}{\small \par} {\small /{*}~...~here~may~go~Rectangle~decoding~code~...~{*}/}{\small \par} {\small{}~}{\small \par} {\small ret~=~asn\_check\_constraints(\&asn\_DEF\_Rectangle,}{\small \par} {\small{}~~~~~~~~rectangle,~errbuf,~\&errlen);}{\small \par} {\small /{*}~assert(errlen~<~sizeof(errbuf));~//~you~may~rely~on~that~{*}/}{\small \par} {\small if(ret)~\{}{\small \par} {\small{}~~~~~~~~fprintf(stderr,~''Constraint~validation~failed:~\%s\textbackslash{}n'',}{\small \par} {\small{}~~~~~~~~~~errbuf~~~/{*}~errbuf~is~properly~nul-terminated~{*}/}{\small \par} {\small{}~~~~~~~~);}{\small \par} {\small{}~~~~~~~~/{*}~exit(...);~//~Replace~with~appropriate~action~{*}/}{\small \par} {\small \}}{\small \par} {\small{}~}{\small \par} {\small /{*}~...~here~may~go~Rectangle~encoding~code~...~{*}/}{\small \par} \end{lyxcode} \item Compile the resulting C code as shown in the previous chapters. \item Try to test the constraints checking code by assigning integer value 101 to the \textbf{.height} member of the Rectangle structure, or a negative value to the \textbf{.width} member. In either case, the program should print ``Constraint validation failed'' message, followed by the short explanation why validation did not succeed. \item Done. \end{enumerate} \part{\label{par:ASN.1-Basics}ASN.1 Basics} \chapter{\label{cha:Abstract-Syntax-Notation:}Abstract Syntax Notation: ASN.1} \emph{This chapter defines some basic ASN.1 concepts and describes several most widely used types. It is by no means an authoritative or complete reference. For more complete ASN.1 description, please refer to Olivier Dubuisson's book \cite{Dub00} or the ASN.1 body of standards itself \cite{ITU-T/ASN.1}.} The Abstract Syntax Notation One is used to formally describe the semantics of data transmitted across the network. Two communicating parties may have different formats of their native data types (i.e. number of bits in the integer type), thus it is important to have a way to describe the data in a manner which is independent from the particular machine's representation. The ASN.1 specifications are used to achieve the following: \begin{itemize} \item The specification expressed in the ASN.1 notation is a formal and precise way to communicate the data semantics to human readers; \item The ASN.1 specifications may be used as input for automatic compilers which produce the code for some target language (C, C++, Java, etc) to encode and decode the data according to some encoding rules (which are also defined by the ASN.1 standard). \end{itemize} Consider the following example: \begin{lyxcode} Rectangle~::=~SEQUENCE~\{ ~~~~height~~INTEGER, ~~~~width~~~INTEGER \} \end{lyxcode} This ASN.1 specification describes a constructed type, \emph{Rectangle}, containing two integer fields. This specification may tell the reader that there exists this kind of data structure and that some entity may be prepared to send or receive it. The question on \emph{how} that entity is going to send or receive the \emph{encoded data} is outside the scope of ASN.1. For example, this data structure may be encoded according to some encoding rules and sent to the destination using the TCP protocol. The ASN.1 specifies several ways of encoding (or ``serializing'', or ``marshaling'') the data: BER, PER, XER and others, including CER and DER derivatives from BER. The complete specification must be wrapped in a module, which looks like this: \begin{lyxcode} RectangleModule1 ~~~~\{~iso~org(3)~dod(6)~internet(1)~private(4) ~~~~~~enterprise(1)~spelio(9363)~software(1) ~~~~~~asn1c(5)~docs(2)~rectangle(1)~1~\}~ ~~~~DEFINITIONS~AUTOMATIC~TAGS~::= BEGIN ~ -{}-~This~is~a~comment~which~describes~nothing. Rectangle~::=~SEQUENCE~\{ ~~~~height~~INTEGER,~~~~~~~~-{}-~Height~of~the~rectangle ~~~~width~~~INTEGER~~~~~~~~~-{}-~Width~of~the~rectangle \} ~ END \end{lyxcode} The module header consists of module name (RectangleModule1), the module object identifier (\{...\}), a keyword ``DEFINITIONS'', a set of module flags (AUTOMATIC TAGS) and ``::= BEGIN''. The module ends with an ``END'' statement. \section{Some of the ASN.1 Basic Types} \subsection{The BOOLEAN type} The BOOLEAN type models the simple binary TRUE/FALSE, YES/NO, ON/OFF or a similar kind of two-way choice. \subsection{The INTEGER type} The INTEGER type is a signed natural number type without any restrictions on its size. If the automatic checking on INTEGER value bounds are necessary, the subtype constraints must be used. \begin{lyxcode} SimpleInteger~::=~INTEGER ~ -{}-~An~integer~with~a~very~limited~range SmallPositiveInt~::=~INTEGER~(0..127) ~ -{}-~Integer,~negative NegativeInt~::=~INTEGER~(MIN..0) \end{lyxcode} \subsection{The ENUMERATED type} The ENUMERATED type is semantically equivalent to the INTEGER type with some integer values explicitly named. \begin{lyxcode} FruitId~::=~ENUMERATED~\{~apple(1),~orange(2)~\} ~ -{}-~The~numbers~in~braces~are~optional, -{}-~the~enumeration~can~be~performed -{}-~automatically~by~the~compiler ComputerOSType~::=~ENUMERATED~\{ ~~~~FreeBSD,~~~~~~~~~~-{}-~acquires~value~0 ~~~~Windows,~~~~~~~~~~-{}-~acquires~value~1 ~~~~Solaris(5),~~~~~~~-{}-~remains~5 ~~~~Linux,~~~~~~~~~~~~-{}-~becomes~6 ~~~~MacOS~~~~~~~~~~~~~-{}-~becomes~7 \} \end{lyxcode} \subsection{The OCTET STRING type} This type models the sequence of 8-bit bytes. This may be used to transmit some opaque data or data serialized by other types of encoders (i.e. video file, photo picture, etc). \subsection{The OBJECT IDENTIFIER type} The OBJECT IDENTIFIER is used to represent the unique identifier of any object, starting from the very root of the registration tree. If your organization needs to uniquely identify something (a router, a room, a person, a standard, or whatever), you are encouraged to get your own identification subtree at \url{http://www.iana.org/protocols/forms.htm}. For example, the very first ASN.1 module in this Chapter (RectangleModule1) has the following OBJECT IDENTIFIER: 1 3 6 1 4 1 9363 1 5 2 1 1. \begin{lyxcode} ExampleOID~::=~OBJECT~IDENTIFIER ~ rectangleModule1-oid~ExampleOID ~~::=~\{~1~3~6~1~4~1~9363~1~5~2~1~1~\} ~ -{}-~An~identifier~of~the~Internet. internet-id~OBJECT~IDENTIFIER ~~::=~\{~iso(1)~identified-organization(3) ~~~~~~~~dod(6)~internet(1)~\} \end{lyxcode} As you see, names are optional. \subsection{The RELATIVE-OID type} The RELATIVE-OID type has the semantics of a subtree of an OBJECT IDENTIFIER. There may be no need to repeat the whole sequence of numbers from the root of the registration tree where the only thing of interest is some of the tree's subsequence. \begin{lyxcode} this-document~RELATIVE-OID~::=~\{~docs(2)~usage(1)~\} ~ this-example~RELATIVE-OID~::=~\{ ~~~~this-document~assorted-examples(0)~this-example(1)~\} \end{lyxcode} \section{Some of the ASN.1 String Types} \subsection{The IA5String type} This is essentially the ASCII, with 128 character codes available (7 lower bits of an 8-bit byte). \subsection{The UTF8String type} This is the character string which encodes the full Unicode range (4 bytes) using multibyte character sequences. \subsection{The NumericString type} This type represents the character string with the alphabet consisting of numbers (``0'' to ``9'') and a space. \subsection{The PrintableString type} The character string with the following alphabet: space, ``\textbf{'}'' (single quote), ``\textbf{(}'', ``\textbf{)}'', ``\textbf{+}'', ``\textbf{,}'' (comma), ``\textbf{-}'', ``\textbf{.}'', ``\textbf{/}'', digits (``0'' to ``9''), ``\textbf{:}'', ``\textbf{=}'', ``\textbf{?}'', upper-case and lower-case letters (``A'' to ``Z'' and ``a'' to ``z''). \subsection{The VisibleString type} The character string with the alphabet which is more or less a subset of ASCII between the space and the ``\textbf{\textasciitilde{}}'' symbol (tilde). Alternatively, the alphabet may be described as the PrintableString alphabet presented earlier, plus the following characters: ``\textbf{!}'', ``\textbf{``}'', ``\textbf{\#}'', ``\textbf{\$}'', ``\textbf{\%}'', ``\textbf{\&}'', ``\textbf{{*}}'', ``\textbf{;}'', ``\textbf{<}'', ``\textbf{>}'', ``\textbf{{[}}'', ``\textbf{\textbackslash{}}'', ``\textbf{{]}}'', ``\textbf{\textasciicircum{}}'', ``\textbf{\_}'', ``\textbf{`}`` (single left quote), ``\textbf{\{}'', ``\textbf{|}'', ``\textbf{\}}'', ``\textbf{\textasciitilde{}}''. \section{ASN.1 Constructed Types} \subsection{The SEQUENCE type} This is an ordered collection of other simple or constructed types. The SEQUENCE constructed type resembles the C ``struct'' statement. \begin{lyxcode} Address~::=~SEQUENCE~\{ ~~~~-{}-~The~apartment~number~may~be~omitted ~~~~apartmentNumber~~~~~~NumericString~OPTIONAL, ~~~~streetName~~~~~~~~~~~PrintableString, ~~~~cityName~~~~~~~~~~~~~PrintableString, ~~~~stateName~~~~~~~~~~~~PrintableString, ~~~~-{}-~This~one~may~be~omitted~too ~~~~zipNo~~~~~~~~~~~~~~~~NumericString~OPTIONAL \} \end{lyxcode} \subsection{The SET type} This is a collection of other simple or constructed types. Ordering is not important. The data may arrive in the order which is different from the order of specification. Data is encoded in the order not necessarily corresponding to the order of specification. \subsection{The CHOICE type} This type is just a choice between the subtypes specified in it. The CHOICE type contains at most one of the subtypes specified, and it is always implicitly known which choice is being decoded or encoded. This one resembles the C ``union'' statement. The following type defines a response code, which may be either an integer code or a boolean ``true''/``false'' code. \begin{lyxcode} ResponseCode~::=~CHOICE~\{ ~~~~intCode~~~~INTEGER, ~~~~boolCode~~~BOOLEAN \} \end{lyxcode} \subsection{The SEQUENCE OF type} This one is the list (array) of simple or constructed types: \begin{lyxcode} -{}-~Example~1 ManyIntegers~::=~SEQUENCE~OF~INTEGER ~ -{}-~Example~2 ManyRectangles~::=~SEQUENCE~OF~Rectangle ~ -{}-~More~complex~example: -{}-~an~array~of~structures~defined~in~place. ManyCircles~::=~SEQUENCE~OF~SEQUENCE~\{ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~radius~INTEGER ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\} \end{lyxcode} \subsection{The SET OF type} The SET OF type models the bag of structures. It resembles the SEQUENCE OF type, but the order is not important: i.e. the elements may arrive in the order which is not necessarily the same as the in-memory order on the remote machines. \begin{lyxcode} -{}-~A~set~of~structures~defined~elsewhere SetOfApples~::~SET~OF~Apple ~ -{}-~Set~of~integers~encoding~the~kind~of~a~fruit FruitBag~::=~SET~OF~ENUMERATED~\{~apple,~orange~\}\end{lyxcode} \begin{thebibliography}{ITU-T/ASN.1} \bibitem[ASN1C]{ASN1C}The Open Source ASN.1 Compiler. \url{http://lionet.info/asn1c} \bibitem[AONL]{AONL}Online ASN.1 Compiler. \url{http://lionet.info/asn1c/asn1c.cgi} \bibitem[Dub00]{Dub00}Olivier Dubuisson --- \emph{ASN.1 Communication between heterogeneous systems}~---~Morgan Kaufmann Publishers, 2000. \url{http://asn1.elibel.tm.fr/en/book/}. ISBN:0-12-6333361-0. \bibitem[ITU-T/ASN.1]{ITU-T/ASN.1}ITU-T Study Group 17 --- Languages for Telecommunication Systems \url{http://www.itu.int/ITU-T/studygroups/com17/languages/} \end{thebibliography} \end{document} asn1c-0.9.24+dfsg/doc/docsrc/Makefile.in0000644000000000000000000002322212121076150016313 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/docsrc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ XELATEX_FLAGS = -halt-on-error -file-line-error XELATEX = xelatex EXTRA_DIST = $(srcdir)/*.tex CLEANFILES = *.*~ *.aux *.dvi *.log *.out *.toc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/docsrc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/docsrc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am regen: $(XELATEX) $(XELATEX_FLAGS) -no-pdf asn1c-usage $(XELATEX) $(XELATEX_FLAGS) -no-pdf asn1c-usage $(XELATEX) $(XELATEX_FLAGS) asn1c-usage # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/doc/docsrc/Makefile.am0000644000000000000000000000044512015121740016302 0ustar rootroot XELATEX_FLAGS = -halt-on-error -file-line-error XELATEX = xelatex regen: $(XELATEX) $(XELATEX_FLAGS) -no-pdf asn1c-usage $(XELATEX) $(XELATEX_FLAGS) -no-pdf asn1c-usage $(XELATEX) $(XELATEX_FLAGS) asn1c-usage EXTRA_DIST = $(srcdir)/*.tex CLEANFILES = *.*~ *.aux *.dvi *.log *.out *.toc asn1c-0.9.24+dfsg/doc/Makefile.in0000644000000000000000000004457112121076150015050 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = docsrc docsdir = $(datadir)/doc/asn1c docs_DATA = $(srcdir)/*.pdf EXTRA_DIST = $(srcdir)/*.pdf all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-docsDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-docsDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-docsDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-docsDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/doc/Makefile.am0000644000000000000000000000015612015121740015024 0ustar rootroot SUBDIRS = docsrc docsdir = $(datadir)/doc/asn1c docs_DATA = $(srcdir)/*.pdf EXTRA_DIST = $(srcdir)/*.pdf asn1c-0.9.24+dfsg/depcomp0000755000000000000000000004224612015121740013606 0ustar rootroot#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2006-10-15.18 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: asn1c-0.9.24+dfsg/libasn1print/0000755000000000000000000000000012223077270014640 5ustar rootrootasn1c-0.9.24+dfsg/libasn1print/README0000644000000000000000000000023011456135550015516 0ustar rootroot Ad hoc ASN tree printing procedures. Use for debugging purposes, this library isn't thought through enough to be universally useful or even accurate. asn1c-0.9.24+dfsg/libasn1print/asn1print.h0000644000000000000000000000076511472004364016737 0ustar rootroot#ifndef _ASN1PRINT_H_ #define _ASN1PRINT_H_ enum asn1print_flags { APF_NOFLAGS, APF_NOINDENT = 0x01, /* Disable indentation */ APF_LINE_COMMENTS = 0x02, /* Include line comments */ APF_PRINT_XML_DTD = 0x04, /* Generate XML DTD */ APF_PRINT_CONSTRAINTS = 0x08, /* Explain constraints */ APF_PRINT_CLASS_MATRIX = 0x10, /* Dump class matrix */ }; /* * Print the contents of the parsed ASN.1 syntax tree. */ int asn1print(asn1p_t *asn, enum asn1print_flags flags); #endif /* _ASN1PRINT_H_ */ asn1c-0.9.24+dfsg/libasn1print/Makefile.in0000644000000000000000000003431112121076150016700 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libasn1print DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libasn1print_la_LIBADD = am_libasn1print_la_OBJECTS = asn1print.lo libasn1print_la_OBJECTS = $(am_libasn1print_la_OBJECTS) libasn1print_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libasn1print_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libasn1print_la_SOURCES) DIST_SOURCES = $(libasn1print_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = @ADD_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir)/libasn1parser \ -I$(top_srcdir)/libasn1fix noinst_LTLIBRARIES = libasn1print.la libasn1print_la_LDFLAGS = -all-static libasn1print_la_SOURCES = \ asn1print.c asn1print.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libasn1print/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libasn1print/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libasn1print.la: $(libasn1print_la_OBJECTS) $(libasn1print_la_DEPENDENCIES) $(libasn1print_la_LINK) $(libasn1print_la_OBJECTS) $(libasn1print_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1print.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/libasn1print/Makefile.am0000644000000000000000000000036011461150505016667 0ustar rootroot AM_CFLAGS = @ADD_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir)/libasn1parser \ -I$(top_srcdir)/libasn1fix noinst_LTLIBRARIES = libasn1print.la libasn1print_la_LDFLAGS = -all-static libasn1print_la_SOURCES = \ asn1print.c asn1print.h asn1c-0.9.24+dfsg/libasn1print/asn1print.c0000644000000000000000000005455611505405150016734 0ustar rootroot#include #include #include #include #include #include #include #include "asn1print.h" #define INDENT(fmt, args...) do { \ if(!(flags & APF_NOINDENT)) { \ int __i = level; \ while(__i--) printf(" "); \ } \ printf(fmt, ##args); \ } while(0) static int asn1print_module(asn1p_t *asn, asn1p_module_t *mod, enum asn1print_flags flags); static int asn1print_oid(int prior_len, asn1p_oid_t *oid, enum asn1print_flags flags); static int asn1print_ref(asn1p_ref_t *ref, enum asn1print_flags flags); static int asn1print_tag(asn1p_expr_t *tc, enum asn1print_flags flags); static int asn1print_params(asn1p_paramlist_t *pl,enum asn1print_flags flags); static int asn1print_with_syntax(asn1p_wsyntx_t *wx, enum asn1print_flags flags); static int asn1print_constraint(asn1p_constraint_t *, enum asn1print_flags); static int asn1print_value(asn1p_value_t *val, enum asn1print_flags flags); static int asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1print_flags flags, int level); static int asn1print_expr_dtd(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1print_flags flags, int level); /* * Print the contents of the parsed ASN tree. */ int asn1print(asn1p_t *asn, enum asn1print_flags flags) { asn1p_module_t *mod; int modno = 0; if(asn == NULL) { errno = EINVAL; return -1; } if(flags & APF_PRINT_XML_DTD) printf("\n\n"); TQ_FOR(mod, &(asn->modules), mod_next) { if(mod->_tags & MT_STANDARD_MODULE) return 0; /* Ignore modules imported from skeletons */ if(modno++) printf("\n"); asn1print_module(asn, mod, flags); } if(flags & APF_PRINT_XML_DTD) { /* Values for BOOLEAN */ printf("\n"); printf("\n"); } return 0; } static int asn1print_module(asn1p_t *asn, asn1p_module_t *mod, enum asn1print_flags flags) { asn1p_expr_t *tc; if(flags & APF_PRINT_XML_DTD) printf("\n\n"); TQ_FOR(tc, &(mod->members), next) { asn1print_expr_dtd(asn, mod, tc, flags, 0); } return 0; } printf("DEFINITIONS"); if(mod->module_flags & MSF_TAG_INSTRUCTIONS) printf(" TAG INSTRUCTIONS"); if(mod->module_flags & MSF_XER_INSTRUCTIONS) printf(" XER INSTRUCTIONS"); if(mod->module_flags & MSF_EXPLICIT_TAGS) printf(" EXPLICIT TAGS"); if(mod->module_flags & MSF_IMPLICIT_TAGS) printf(" IMPLICIT TAGS"); if(mod->module_flags & MSF_AUTOMATIC_TAGS) printf(" AUTOMATIC TAGS"); if(mod->module_flags & MSF_EXTENSIBILITY_IMPLIED) printf(" EXTENSIBILITY IMPLIED"); printf(" ::=\n"); printf("BEGIN\n\n"); TQ_FOR(tc, &(mod->members), next) { asn1print_expr(asn, mod, tc, flags, 0); if(flags & APF_PRINT_CONSTRAINTS) printf("\n"); else printf("\n\n"); } printf("END\n"); return 0; } static int asn1print_oid(int prior_len, asn1p_oid_t *oid, enum asn1print_flags flags) { size_t accum = prior_len; int ac; (void)flags; /* Unused argument */ printf("{"); for(ac = 0; ac < oid->arcs_count; ac++) { const char *arcname = oid->arcs[ac].name; if(accum + strlen(arcname ? arcname : "") > 72) { printf("\n\t"); accum = 8; } else { accum += printf(" "); } if(arcname) { accum += printf("%s", arcname); if(oid->arcs[ac].number >= 0) { accum += printf("(%" PRIdASN ")", oid->arcs[ac].number); } } else { accum += printf("%" PRIdASN, oid->arcs[ac].number); } } printf(" }"); return 0; } static int asn1print_ref(asn1p_ref_t *ref, enum asn1print_flags flags) { int cc; (void)flags; /* Unused argument */ for(cc = 0; cc < ref->comp_count; cc++) { if(cc) printf("."); printf("%s", ref->components[cc].name); } return 0; } static int asn1print_tag(asn1p_expr_t *tc, enum asn1print_flags flags) { struct asn1p_type_tag_s *tag = &tc->tag; (void)flags; /* Unused argument */ printf("%s", asn1p_tag2string(tag, 0)); return 0; } static int asn1print_value(asn1p_value_t *val, enum asn1print_flags flags) { if(val == NULL) return 0; switch(val->type) { case ATV_NOVALUE: break; case ATV_NULL: printf("NULL"); return 0; case ATV_REAL: printf("%f", val->value.v_double); return 0; case ATV_TYPE: asn1print_expr(val->value.v_type->module->asn1p, val->value.v_type->module, val->value.v_type, flags, 0); return 0; case ATV_INTEGER: printf("%" PRIdASN, val->value.v_integer); return 0; case ATV_MIN: printf("MIN"); return 0; case ATV_MAX: printf("MAX"); return 0; case ATV_FALSE: printf("FALSE"); return 0; case ATV_TRUE: printf("TRUE"); return 0; case ATV_TUPLE: printf("{%d, %d}", (int)(val->value.v_integer >> 4), (int)(val->value.v_integer & 0x0f)); return 0; case ATV_QUADRUPLE: printf("{%d, %d, %d, %d}", (int)((val->value.v_integer >> 24) & 0xff), (int)((val->value.v_integer >> 16) & 0xff), (int)((val->value.v_integer >> 8) & 0xff), (int)((val->value.v_integer >> 0) & 0xff) ); return 0; case ATV_STRING: { char *p = (char *)val->value.string.buf; putchar('"'); if(strchr(p, '"')) { /* Mask quotes */ for(; *p; p++) { if(*p == '"') putchar(*p); putchar(*p); } } else { fputs(p, stdout); } putchar('"'); } return 0; case ATV_UNPARSED: fputs((char *)val->value.string.buf, stdout); return 0; case ATV_BITVECTOR: { uint8_t *bitvector; int bits; int i; bitvector = val->value.binary_vector.bits; bits = val->value.binary_vector.size_in_bits; printf("'"); if(bits%8) { for(i = 0; i < bits; i++) { uint8_t uc; uc = bitvector[i>>3]; putchar(((uc >> (7-(i%8)))&1)?'1':'0'); } printf("'B"); } else { char hextable[16] = "0123456789ABCDEF"; for(i = 0; i < (bits>>3); i++) { putchar(hextable[bitvector[i] >> 4]); putchar(hextable[bitvector[i] & 0x0f]); } printf("'H"); } return 0; } case ATV_REFERENCED: return asn1print_ref(val->value.reference, flags); case ATV_VALUESET: return asn1print_constraint(val->value.constraint, flags); case ATV_CHOICE_IDENTIFIER: printf("%s: ", val->value.choice_identifier.identifier); return asn1print_value(val->value.choice_identifier.value, flags); } assert(val->type || !"Unknown"); return 0; } static int asn1print_constraint(asn1p_constraint_t *ct, enum asn1print_flags flags) { int symno = 0; if(ct == 0) return 0; if(ct->type == ACT_CA_SET) printf("("); switch(ct->type) { case ACT_EL_TYPE: asn1print_value(ct->containedSubtype, flags); break; case ACT_EL_VALUE: asn1print_value(ct->value, flags); break; case ACT_EL_RANGE: case ACT_EL_LLRANGE: case ACT_EL_RLRANGE: case ACT_EL_ULRANGE: asn1print_value(ct->range_start, flags); switch(ct->type) { case ACT_EL_RANGE: printf(".."); break; case ACT_EL_LLRANGE: printf("<.."); break; case ACT_EL_RLRANGE: printf("..<"); break; case ACT_EL_ULRANGE: printf("<..<"); break; default: printf("?..?"); break; } asn1print_value(ct->range_stop, flags); break; case ACT_EL_EXT: printf("..."); break; case ACT_CT_SIZE: case ACT_CT_FROM: switch(ct->type) { case ACT_CT_SIZE: printf("SIZE("); break; case ACT_CT_FROM: printf("FROM("); break; default: printf("??? ("); break; } assert(ct->el_count != 0); assert(ct->el_count == 1); asn1print_constraint(ct->elements[0], flags); printf(")"); break; case ACT_CT_WCOMP: assert(ct->el_count != 0); assert(ct->el_count == 1); printf("WITH COMPONENT ("); asn1print_constraint(ct->elements[0], flags); printf(")"); break; case ACT_CT_WCOMPS: { unsigned int i; printf("WITH COMPONENTS { "); for(i = 0; i < ct->el_count; i++) { asn1p_constraint_t *cel = ct->elements[i]; if(i) printf(", "); fwrite(cel->value->value.string.buf, 1, cel->value->value.string.size, stdout); if(cel->el_count) { assert(cel->el_count == 1); printf(" "); asn1print_constraint(cel->elements[0], flags); } switch(cel->presence) { case ACPRES_DEFAULT: break; case ACPRES_PRESENT: printf(" PRESENT"); break; case ACPRES_ABSENT: printf(" ABSENT"); break; case ACPRES_OPTIONAL: printf(" OPTIONAL");break; } } printf(" }"); } break; case ACT_CT_CTDBY: printf("CONSTRAINED BY "); assert(ct->value->type == ATV_UNPARSED); fwrite(ct->value->value.string.buf, 1, ct->value->value.string.size, stdout); break; case ACT_CT_CTNG: printf("CONTAINING "); asn1print_expr(ct->value->value.v_type->module->asn1p, ct->value->value.v_type->module, ct->value->value.v_type, flags, 1); break; case ACT_CT_PATTERN: printf("PATTERN "); asn1print_value(ct->value, flags); break; case ACT_CA_SET: symno++; case ACT_CA_CRC: symno++; case ACT_CA_CSV: symno++; case ACT_CA_UNI: symno++; case ACT_CA_INT: symno++; case ACT_CA_EXC: { char *symtable[] = { " EXCEPT ", " ^ ", " | ", ",", "", "(" }; unsigned int i; for(i = 0; i < ct->el_count; i++) { if(i) fputs(symtable[symno], stdout); if(ct->type == ACT_CA_CRC) fputs("{", stdout); asn1print_constraint(ct->elements[i], flags); if(ct->type == ACT_CA_CRC) fputs("}", stdout); if(i+1 < ct->el_count && ct->type == ACT_CA_SET) fputs(")", stdout); } } break; case ACT_CA_AEX: assert(ct->el_count == 1); printf("ALL EXCEPT "); asn1print_constraint(ct->elements[0], flags); break; case ACT_INVALID: assert(ct->type != ACT_INVALID); break; } if(ct->type == ACT_CA_SET) printf(")"); return 0; } static int asn1print_params(asn1p_paramlist_t *pl, enum asn1print_flags flags) { if(pl) { int i; printf("{"); for(i = 0; i < pl->params_count; i++) { if(i) printf(", "); if(pl->params[i].governor) { asn1print_ref(pl->params[i].governor, flags); printf(":"); } printf("%s", pl->params[i].argument); } printf("}"); } return 0; } static int asn1print_with_syntax(asn1p_wsyntx_t *wx, enum asn1print_flags flags) { if(wx) { asn1p_wsyntx_chunk_t *wc; TQ_FOR(wc, &(wx->chunks), next) { switch(wc->type) { case WC_LITERAL: case WC_WHITESPACE: case WC_FIELD: printf("%s", wc->content.token); break; case WC_OPTIONALGROUP: printf("["); asn1print_with_syntax(wc->content.syntax,flags); printf("]"); break; } } } return 0; } static int asn1print_crange_value(asn1cnst_edge_t *edge, int as_char) { switch(edge->type) { case ARE_MIN: printf("MIN"); break; case ARE_MAX: printf("MAX"); break; case ARE_VALUE: if(as_char) { printf("\"%c\"", (unsigned char)edge->value); } else { printf("%" PRIdASN, edge->value); } } return 0; } static int asn1print_constraint_explain_type(asn1p_expr_type_e expr_type, asn1p_constraint_t *ct, enum asn1p_constraint_type_e type, int strict_PER_visible) { asn1cnst_range_t *range; int as_char = (type==ACT_CT_FROM); int i; range = asn1constraint_compute_PER_range(expr_type, ct, type, 0, 0, strict_PER_visible ? CPR_strict_PER_visibility : 0); if(!range) return -1; if(range->incompatible || (strict_PER_visible && range->not_PER_visible)) { asn1constraint_range_free(range); return 0; } switch(type) { case ACT_CT_FROM: printf("(FROM("); break; case ACT_CT_SIZE: printf("(SIZE("); break; default: printf("("); break; } for(i = -1; i < range->el_count; i++) { asn1cnst_range_t *r; if(i == -1) { if(range->el_count) continue; r = range; } else { r = range->elements[i]; } if(i > 0) { printf(" | "); } asn1print_crange_value(&r->left, as_char); if(r->left.type != r->right.type || r->left.value != r->right.value) { printf(".."); asn1print_crange_value(&r->right, as_char); } } if(range->extensible) printf(",..."); printf(type==ACT_EL_RANGE?")":"))"); if(range->empty_constraint) printf(":Empty!"); asn1constraint_range_free(range); return 0; } static int asn1print_constraint_explain(asn1p_expr_type_e expr_type, asn1p_constraint_t *ct, int s_PV) { asn1print_constraint_explain_type(expr_type, ct, ACT_EL_RANGE, s_PV); printf(" "); asn1print_constraint_explain_type(expr_type, ct, ACT_CT_SIZE, s_PV); printf(" "); asn1print_constraint_explain_type(expr_type, ct, ACT_CT_FROM, s_PV); return 0; } static int asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1print_flags flags, int level) { int SEQ_OF = 0; if(flags & APF_LINE_COMMENTS && !(flags & APF_NOINDENT)) INDENT("-- #line %d\n", tc->_lineno); /* Reconstruct compiler directive information */ if((tc->marker.flags & EM_INDIRECT) && (tc->marker.flags & EM_OMITABLE) != EM_OMITABLE) { if((flags & APF_NOINDENT)) printf(" ---- "); else INDENT("----\n"); } if(tc->Identifier && (!(tc->meta_type == AMT_VALUE && tc->expr_type == A1TC_REFERENCE) || level == 0)) INDENT("%s", tc->Identifier); if(tc->lhs_params) { asn1print_params(tc->lhs_params, flags); } if(tc->meta_type != AMT_VALUE && tc->meta_type != AMT_VALUESET && tc->expr_type != A1TC_EXTENSIBLE) { if(level) { if(tc->Identifier && !(flags & APF_NOINDENT)) printf("\t"); } else { printf(" ::="); } } if(tc->tag.tag_class) { printf(" "); asn1print_tag(tc, flags); } switch(tc->expr_type) { case A1TC_EXTENSIBLE: if(tc->value) { printf("!"); asn1print_value(tc->value, flags); } break; case A1TC_COMPONENTS_OF: SEQ_OF = 1; /* Equivalent to SET OF for printint purposes */ printf(" COMPONENTS OF"); break; case A1TC_REFERENCE: case A1TC_UNIVERVAL: break; case A1TC_CLASSDEF: printf(" CLASS"); break; case A1TC_CLASSFIELD_TFS ... A1TC_CLASSFIELD_OSFS: /* Nothing to print here */ break; case ASN_CONSTR_SET_OF: case ASN_CONSTR_SEQUENCE_OF: SEQ_OF = 1; if(tc->expr_type == ASN_CONSTR_SET_OF) printf(" SET"); else printf(" SEQUENCE"); if(tc->constraints) { printf(" "); asn1print_constraint(tc->constraints, flags); } printf(" OF"); break; case A1TC_VALUESET: break; default: { char *p = ASN_EXPR_TYPE2STR(tc->expr_type); printf(" %s", p?p:""); } break; } /* * Put the name of the referred type. */ if(tc->reference) { printf(" "); asn1print_ref(tc->reference, flags); } if(tc->meta_type == AMT_VALUESET && level == 0) printf(" ::="); /* * Display the descendants (children) of the current type. */ if(TQ_FIRST(&(tc->members)) || (tc->expr_type & ASN_CONSTR_MASK) || tc->meta_type == AMT_OBJECT || tc->meta_type == AMT_OBJECTCLASS || tc->meta_type == AMT_OBJECTFIELD ) { asn1p_expr_t *se; /* SubExpression */ int put_braces = (!SEQ_OF) /* Don't need 'em, if SET OF... */ && (tc->meta_type != AMT_OBJECTFIELD); if(put_braces) { if(flags & APF_NOINDENT) { printf("{"); if(!TQ_FIRST(&tc->members)) printf("}"); } else { printf(" {"); if(TQ_FIRST(&tc->members)) printf("\n"); else printf(" }"); } } TQ_FOR(se, &(tc->members), next) { /* * Print the expression as it were a stand-alone type. */ asn1print_expr(asn, mod, se, flags, level + 1); if((se->marker.flags & EM_DEFAULT) == EM_DEFAULT) { printf(" DEFAULT "); asn1print_value(se->marker.default_value, flags); } else if((se->marker.flags & EM_OPTIONAL) == EM_OPTIONAL) { printf(" OPTIONAL"); } if(TQ_NEXT(se, next)) { printf(","); if(!(flags & APF_NOINDENT)) INDENT("\n"); } } if(put_braces && TQ_FIRST(&tc->members)) { if(!(flags & APF_NOINDENT)) printf("\n"); INDENT("}"); } } if(tc->with_syntax) { printf(" WITH SYNTAX {"); asn1print_with_syntax(tc->with_syntax, flags); printf("}\n"); } /* Right hand specialization */ if(tc->rhs_pspecs) { asn1p_expr_t *se; printf("{"); TQ_FOR(se, &(tc->rhs_pspecs->members), next) { asn1print_expr(asn, mod, se, flags, level + 1); if(TQ_NEXT(se, next)) printf(", "); } printf("}"); } if(!SEQ_OF && tc->constraints) { printf(" "); if(tc->meta_type == AMT_VALUESET) printf("{"); asn1print_constraint(tc->constraints, flags); if(tc->meta_type == AMT_VALUESET) printf("}"); } if(tc->unique) { printf(" UNIQUE"); } if(tc->meta_type == AMT_VALUE && tc->expr_type != A1TC_EXTENSIBLE) { if(tc->expr_type == A1TC_UNIVERVAL) { if(tc->value) { printf("("); asn1print_value(tc->value, flags); printf(")"); } } else { if(level == 0) printf(" ::= "); asn1print_value(tc->value, flags); } } /* * The following section exists entirely for debugging. */ if(flags & APF_PRINT_CONSTRAINTS && tc->expr_type != A1TC_EXTENSIBLE) { asn1p_expr_t *top_parent; if(tc->combined_constraints) { printf("\n-- Combined constraints: "); asn1print_constraint(tc->combined_constraints, flags); } top_parent = asn1f_find_terminal_type_ex(asn, tc); if(top_parent) { printf("\n-- Practical constraints (%s): ", top_parent->Identifier); asn1print_constraint_explain(top_parent->expr_type, tc->combined_constraints, 0); printf("\n-- PER-visible constraints (%s): ", top_parent->Identifier); asn1print_constraint_explain(top_parent->expr_type, tc->combined_constraints, 1); } printf("\n"); } if(flags & APF_PRINT_CLASS_MATRIX && tc->expr_type == A1TC_CLASSDEF) do { int r, col, maxidlen; if(tc->object_class_matrix.rows == 0) { printf("\n-- Class matrix is empty"); break; } printf("\n-- Class matrix has %d entr%s:\n", tc->object_class_matrix.rows, tc->object_class_matrix.rows==1 ? "y" : "ies"); maxidlen = tc->object_class_matrix.max_identifier_length; for(r = -1; r < tc->object_class_matrix.rows; r++) { struct asn1p_ioc_row_s *row; row = tc->object_class_matrix.row[r<0?0:r]; if(r < 0) printf("-- %s", r > 9 ? " " : ""); else printf("-- [%*d]", r > 9 ? 2 : 1, r+1); for(col = 0; col < row->columns; col++) { struct asn1p_ioc_cell_s *cell; cell = &row->column[col]; if(r < 0) { printf("[%*s]", maxidlen, cell->field->Identifier); continue; } if(!cell->value) { printf(" %*s ", maxidlen, ""); continue; } printf(" %*s ", maxidlen, cell->value->Identifier); } printf("\n"); } } while(0); if(flags & APF_PRINT_CLASS_MATRIX && tc->lhs_params) do { int i; if(tc->specializations.pspecs_count == 0) { printf("\n-- No specializations found\n"); break; } printf("\n-- Specializations list has %d entr%s:\n", tc->specializations.pspecs_count, tc->specializations.pspecs_count == 1 ? "y" : "ies"); for(i = 0; i < tc->specializations.pspecs_count; i++) { asn1p_expr_t *se; struct asn1p_pspec_s *pspec; pspec = &tc->specializations.pspec[i]; printf("-- "); TQ_FOR(se, &(pspec->rhs_pspecs->members), next) { asn1print_expr(asn, mod, se, flags, level+1); } printf("\n"); } } while(0); return 0; } static int asn1print_expr_dtd(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, enum asn1print_flags flags, int level) { asn1p_expr_t *se; int expr_unordered = 0; int dont_involve_children = 0; switch(expr->meta_type) { case AMT_TYPE: case AMT_TYPEREF: break; default: if(expr->expr_type == A1TC_UNIVERVAL) break; return 0; } if(!expr->Identifier) return 0; if(flags & APF_LINE_COMMENTS) INDENT("\n", expr->_lineno); INDENT("Identifier); if(expr->expr_type == A1TC_REFERENCE) { se = asn1f_find_terminal_type_ex(asn, expr); if(!se) { printf(" (ANY)"); return 0; } expr = se; dont_involve_children = 1; } if(expr->expr_type == ASN_CONSTR_CHOICE || expr->expr_type == ASN_CONSTR_SEQUENCE_OF || expr->expr_type == ASN_CONSTR_SET_OF || expr->expr_type == ASN_CONSTR_SET || expr->expr_type == ASN_BASIC_INTEGER || expr->expr_type == ASN_BASIC_ENUMERATED) { expr_unordered = 1; } if(TQ_FIRST(&expr->members)) { int extensible = 0; if(expr->expr_type == ASN_BASIC_BIT_STRING) dont_involve_children = 1; printf(" ("); TQ_FOR(se, &(expr->members), next) { if(se->expr_type == A1TC_EXTENSIBLE) { extensible = 1; continue; } else if(!se->Identifier && se->expr_type == A1TC_REFERENCE) { asn1print_ref(se->reference, flags); } else if(se->Identifier) { printf("%s", se->Identifier); } else { printf("ANY"); } if(expr->expr_type != ASN_CONSTR_SET && expr->expr_type != ASN_CONSTR_CHOICE && expr->expr_type != ASN_BASIC_INTEGER && expr->expr_type != ASN_BASIC_ENUMERATED) { if(expr_unordered) printf("*"); else if(se->marker.flags) printf("?"); else if(expr->expr_type == ASN_BASIC_BIT_STRING) printf("?"); } if(TQ_NEXT(se, next) && TQ_NEXT(se, next)->expr_type != A1TC_EXTENSIBLE) { printf(expr_unordered?"|":", "); } } if(extensible) { printf(expr_unordered?"|":", "); printf("ANY"); if(expr->expr_type != ASN_CONSTR_SET && expr->expr_type != ASN_CONSTR_CHOICE && expr->expr_type != ASN_BASIC_INTEGER && expr->expr_type != ASN_BASIC_ENUMERATED) printf("*"); } printf(")"); if(expr->expr_type == ASN_CONSTR_SET) printf("*"); } else switch(expr->expr_type) { case ASN_BASIC_BOOLEAN: printf(" (true|false)"); break; case ASN_CONSTR_CHOICE: case ASN_CONSTR_SET: case ASN_CONSTR_SET_OF: case ASN_CONSTR_SEQUENCE: case ASN_CONSTR_SEQUENCE_OF: case ASN_BASIC_NULL: case A1TC_UNIVERVAL: printf(" EMPTY"); break; case ASN_TYPE_ANY: printf(" ANY"); break; case ASN_BASIC_BIT_STRING: case ASN_BASIC_OCTET_STRING: case ASN_BASIC_OBJECT_IDENTIFIER: case ASN_BASIC_RELATIVE_OID: case ASN_BASIC_INTEGER: case ASN_BASIC_UTCTime: case ASN_BASIC_GeneralizedTime: case ASN_STRING_NumericString: case ASN_STRING_PrintableString: printf(" (#PCDATA)"); break; case ASN_STRING_VisibleString: case ASN_STRING_ISO646String: /* Entity references, but not XML elements may be present */ printf(" (#PCDATA)"); break; case ASN_BASIC_REAL: /* e.g. */ case ASN_BASIC_ENUMERATED: /* e.g. */ default: /* * XML elements are allowed. * For example, a UTF8String may contain "". */ printf(" ANY"); } printf(">\n"); /* * Display the descendants (children) of the current type. */ if(!dont_involve_children) { TQ_FOR(se, &(expr->members), next) { if(se->expr_type == A1TC_EXTENSIBLE) continue; asn1print_expr_dtd(asn, mod, se, flags, level + 1); } } return 0; } asn1c-0.9.24+dfsg/missing0000755000000000000000000002557712015121740013640 0ustar rootroot#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: asn1c-0.9.24+dfsg/libasn1parser/0000755000000000000000000000000012223077270015000 5ustar rootrootasn1c-0.9.24+dfsg/libasn1parser/asn1p_oid.h0000644000000000000000000000254311505405150017024 0ustar rootroot/* * Object Identifier definition. */ #ifndef ASN1_PARSER_OID_H #define ASN1_PARSER_OID_H /******************************** * Single Object Identifier Arc * ********************************/ /* * Object identifier arc (one number in the hierarchy). */ typedef struct asn1p_oid_arc_s { asn1c_integer_t number; /* -1 if not yet defined */ char *name; /* 0 if not defined */ } asn1p_oid_arc_t; /* * Arc constructor. */ asn1p_oid_arc_t *asn1p_oid_arc_new( const char *optName, asn1c_integer_t optNumber /* = -1 */); /* * Arc destructor. */ void asn1p_oid_arc_free(asn1p_oid_arc_t *); /************************************************** * Object Identifier itself, a collection of arcs * **************************************************/ /* * Object Identifier as a collection of arcs. */ typedef struct asn1p_oid_s { asn1p_oid_arc_t *arcs; int arcs_count; } asn1p_oid_t; /* * OID constructors. */ asn1p_oid_t *asn1p_oid_new(void); asn1p_oid_t *asn1p_oid_construct(asn1p_oid_arc_t *, int narcs); /* * Add another arc using given one as a template */ int asn1p_oid_add_arc(asn1p_oid_t *, asn1p_oid_arc_t *template); /* * OID destructor. */ void asn1p_oid_free(asn1p_oid_t *); /* * RETURN VALUES: * 0: The specified OIDs are equal. * -1 or 1 otherwise. */ int asn1p_oid_compare(asn1p_oid_t *a, asn1p_oid_t *b); #endif /* ASN1_PARSER_OID_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_module.h0000644000000000000000000000360711472004364017545 0ustar rootroot/* * A Module definition structure used by the ASN.1 parser. */ #ifndef ASN1_PARSER_MODULE_H #define ASN1_PARSER_MODULE_H struct asn1p_module_s; /* * A simple container for several modules. */ typedef struct asn1p_s { TQ_HEAD(struct asn1p_module_s) modules; } asn1p_t; asn1p_t *asn1p_new(void); void asn1p_delete(asn1p_t *asn); /* * Flags specific to a module. */ typedef enum asn1p_module_flags { MSF_NOFLAGS, MSF_unk_INSTRUCTIONS = 0x001, MSF_TAG_INSTRUCTIONS = 0x002, MSF_XER_INSTRUCTIONS = 0x004, MSF_EXPLICIT_TAGS = 0x010, MSF_IMPLICIT_TAGS = 0x020, MSF_AUTOMATIC_TAGS = 0x040, MSF_EXTENSIBILITY_IMPLIED = 0x100, } asn1p_module_flags_e; #define MSF_MASK_INSTRUCTIONS 0x0f #define MSF_MASK_TAGS 0xf0 /* * === EXAMPLE === * MySyntax DEFINITIONS AUTOMATIC TAGS ::= * BEGIN * ... * END * === EOF === */ typedef struct asn1p_module_s { /* * Name of the source file. */ char *source_file_name; /* * Human-readable module reference. */ char *ModuleName; /* * Unique module identifier, OID. */ asn1p_oid_t *module_oid; /* Optional OID of the module */ /* * Module flags. */ asn1p_module_flags_e module_flags; /* AUTOMATIC TAGS? */ /* * List of everything that this module EXPORTS. */ TQ_HEAD(struct asn1p_xports_s) exports; /* * List of everything that this module IMPORTS. */ TQ_HEAD(struct asn1p_xports_s) imports; /* * List of everything that this module defines itself. */ TQ_HEAD(struct asn1p_expr_s) members; /* * Next module in the list. */ TQ_ENTRY(struct asn1p_module_s) mod_next; /* All modules */ asn1p_t *asn1p; /* * Internally useful properties. */ enum { MT_STANDARD_MODULE = 0x01, /* Module came from standard-modules */ } _tags; } asn1p_module_t; /* * Constructor and destructor. */ asn1p_module_t *asn1p_module_new(void); void asn1p_module_free(asn1p_module_t *mod); #endif /* ASN1_PARSER_MODULE_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_constr.h0000644000000000000000000000510211472004364017560 0ustar rootroot/* * Type constraints. */ #ifndef ASN1_PARSER_CONSTRAINT_H #define ASN1_PARSER_CONSTRAINT_H typedef struct asn1p_constraint_s { enum asn1p_constraint_type_e { ACT_INVALID, /* for assertions */ /* * Constraint elements. */ ACT_EL_TYPE, /* T (contained subtype) */ ACT_EL_VALUE, /* 123, "A", (elementary value) */ ACT_EL_RANGE, /* 1..2 (elementary range) */ ACT_EL_LLRANGE, /* 1<..2 (elementary range) */ ACT_EL_RLRANGE, /* 1..<2 (elementary range) */ ACT_EL_ULRANGE, /* 1<..<2 (elementary range) */ ACT_EL_EXT, /* ... (extensibility mark) */ /* * Constraint types. */ ACT_CT_SIZE, /* SIZE constraint type */ ACT_CT_FROM, /* FROM constraint type */ ACT_CT_WCOMP, /* WITH COMPONENT */ ACT_CT_WCOMPS, /* WITH COMPONENTS */ ACT_CT_CTDBY, /* CONSTRAINED BY */ ACT_CT_CTNG, /* CONTAINING Type */ ACT_CT_PATTERN, /* PATTERN Value */ /* * Arrays of constraints. */ ACT_CA_SET, /* A set of constraints: (c1)(c2) */ ACT_CA_CRC, /* Comp. relation c-t: ({a}{@b}) */ ACT_CA_CSV, /* Comma-separated constraints array */ ACT_CA_UNI, /* UNION (|) */ ACT_CA_INT, /* INTERSECTION (^) */ ACT_CA_EXC, /* EXCEPT */ ACT_CA_AEX, /* ALL EXCEPT */ } type; enum asn1p_constr_pres_e { ACPRES_DEFAULT, ACPRES_PRESENT, ACPRES_ABSENT, ACPRES_OPTIONAL, } presence; /* * Separate types and values. */ asn1p_value_t *containedSubtype; asn1p_value_t *value; asn1p_value_t *range_start; asn1p_value_t *range_stop; /* * A collection of constraint elements. */ struct asn1p_constraint_s **elements; unsigned int el_count; /* Number of meaningful elements */ unsigned int el_size; /* Size of the allocated (elements) */ int _lineno; /* Position in a source file */ } asn1p_constraint_t; /* Human-readable constraint type description */ char *asn1p_constraint_type2str(enum asn1p_constraint_type_e); /* * Constructors and a recursive destructor. */ asn1p_constraint_t *asn1p_constraint_new(int _lineno); void asn1p_constraint_free(asn1p_constraint_t *); /* * Clone the constraint and all its children. */ asn1p_constraint_t *asn1p_constraint_clone(asn1p_constraint_t *source_to_clone); asn1p_constraint_t *asn1p_constraint_clone_with_resolver( asn1p_constraint_t *source_to_clone, asn1p_value_t *(*resolver)(asn1p_value_t *, void *), void *); /* * Insert additional element into the element array of a (to) constraint. */ int asn1p_constraint_insert(asn1p_constraint_t *into, asn1p_constraint_t *what); int asn1p_constraint_prepend(asn1p_constraint_t *before, asn1p_constraint_t *what); #endif /* ASN1_PARSER_CONSTRAINT_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_y.c0000644000000000000000000041557411505405150016530 0ustar rootroot/* A Bison parser, made from asn1p_y.y, by GNU bison 1.75. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* If NAME_PREFIX is specified substitute the variables and functions names. */ #define yyparse asn1p_parse #define yylex asn1p_lex #define yyerror asn1p_error #define yylval asn1p_lval #define yychar asn1p_char #define yydebug asn1p_debug #define yynerrs asn1p_nerrs /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOK_PPEQ = 258, TOK_whitespace = 259, TOK_opaque = 260, TOK_bstring = 261, TOK_cstring = 262, TOK_hstring = 263, TOK_identifier = 264, TOK_number = 265, TOK_number_negative = 266, TOK_realnumber = 267, TOK_tuple = 268, TOK_quadruple = 269, TOK_typereference = 270, TOK_capitalreference = 271, TOK_typefieldreference = 272, TOK_valuefieldreference = 273, TOK_Literal = 274, TOK_ABSENT = 275, TOK_ABSTRACT_SYNTAX = 276, TOK_ALL = 277, TOK_ANY = 278, TOK_APPLICATION = 279, TOK_AUTOMATIC = 280, TOK_BEGIN = 281, TOK_BIT = 282, TOK_BMPString = 283, TOK_BOOLEAN = 284, TOK_BY = 285, TOK_CHARACTER = 286, TOK_CHOICE = 287, TOK_CLASS = 288, TOK_COMPONENT = 289, TOK_COMPONENTS = 290, TOK_CONSTRAINED = 291, TOK_CONTAINING = 292, TOK_DEFAULT = 293, TOK_DEFINITIONS = 294, TOK_DEFINED = 295, TOK_EMBEDDED = 296, TOK_ENCODED = 297, TOK_ENCODING_CONTROL = 298, TOK_END = 299, TOK_ENUMERATED = 300, TOK_EXPLICIT = 301, TOK_EXPORTS = 302, TOK_EXTENSIBILITY = 303, TOK_EXTERNAL = 304, TOK_FALSE = 305, TOK_FROM = 306, TOK_GeneralizedTime = 307, TOK_GeneralString = 308, TOK_GraphicString = 309, TOK_IA5String = 310, TOK_IDENTIFIER = 311, TOK_IMPLICIT = 312, TOK_IMPLIED = 313, TOK_IMPORTS = 314, TOK_INCLUDES = 315, TOK_INSTANCE = 316, TOK_INSTRUCTIONS = 317, TOK_INTEGER = 318, TOK_ISO646String = 319, TOK_MAX = 320, TOK_MIN = 321, TOK_MINUS_INFINITY = 322, TOK_NULL = 323, TOK_NumericString = 324, TOK_OBJECT = 325, TOK_ObjectDescriptor = 326, TOK_OCTET = 327, TOK_OF = 328, TOK_OPTIONAL = 329, TOK_PATTERN = 330, TOK_PDV = 331, TOK_PLUS_INFINITY = 332, TOK_PRESENT = 333, TOK_PrintableString = 334, TOK_PRIVATE = 335, TOK_REAL = 336, TOK_RELATIVE_OID = 337, TOK_SEQUENCE = 338, TOK_SET = 339, TOK_SIZE = 340, TOK_STRING = 341, TOK_SYNTAX = 342, TOK_T61String = 343, TOK_TAGS = 344, TOK_TeletexString = 345, TOK_TRUE = 346, TOK_TYPE_IDENTIFIER = 347, TOK_UNIQUE = 348, TOK_UNIVERSAL = 349, TOK_UniversalString = 350, TOK_UTCTime = 351, TOK_UTF8String = 352, TOK_VideotexString = 353, TOK_VisibleString = 354, TOK_WITH = 355, TOK_EXCEPT = 356, TOK_INTERSECTION = 357, TOK_UNION = 358, TOK_TwoDots = 359, TOK_ThreeDots = 360 }; #endif #define TOK_PPEQ 258 #define TOK_whitespace 259 #define TOK_opaque 260 #define TOK_bstring 261 #define TOK_cstring 262 #define TOK_hstring 263 #define TOK_identifier 264 #define TOK_number 265 #define TOK_number_negative 266 #define TOK_realnumber 267 #define TOK_tuple 268 #define TOK_quadruple 269 #define TOK_typereference 270 #define TOK_capitalreference 271 #define TOK_typefieldreference 272 #define TOK_valuefieldreference 273 #define TOK_Literal 274 #define TOK_ABSENT 275 #define TOK_ABSTRACT_SYNTAX 276 #define TOK_ALL 277 #define TOK_ANY 278 #define TOK_APPLICATION 279 #define TOK_AUTOMATIC 280 #define TOK_BEGIN 281 #define TOK_BIT 282 #define TOK_BMPString 283 #define TOK_BOOLEAN 284 #define TOK_BY 285 #define TOK_CHARACTER 286 #define TOK_CHOICE 287 #define TOK_CLASS 288 #define TOK_COMPONENT 289 #define TOK_COMPONENTS 290 #define TOK_CONSTRAINED 291 #define TOK_CONTAINING 292 #define TOK_DEFAULT 293 #define TOK_DEFINITIONS 294 #define TOK_DEFINED 295 #define TOK_EMBEDDED 296 #define TOK_ENCODED 297 #define TOK_ENCODING_CONTROL 298 #define TOK_END 299 #define TOK_ENUMERATED 300 #define TOK_EXPLICIT 301 #define TOK_EXPORTS 302 #define TOK_EXTENSIBILITY 303 #define TOK_EXTERNAL 304 #define TOK_FALSE 305 #define TOK_FROM 306 #define TOK_GeneralizedTime 307 #define TOK_GeneralString 308 #define TOK_GraphicString 309 #define TOK_IA5String 310 #define TOK_IDENTIFIER 311 #define TOK_IMPLICIT 312 #define TOK_IMPLIED 313 #define TOK_IMPORTS 314 #define TOK_INCLUDES 315 #define TOK_INSTANCE 316 #define TOK_INSTRUCTIONS 317 #define TOK_INTEGER 318 #define TOK_ISO646String 319 #define TOK_MAX 320 #define TOK_MIN 321 #define TOK_MINUS_INFINITY 322 #define TOK_NULL 323 #define TOK_NumericString 324 #define TOK_OBJECT 325 #define TOK_ObjectDescriptor 326 #define TOK_OCTET 327 #define TOK_OF 328 #define TOK_OPTIONAL 329 #define TOK_PATTERN 330 #define TOK_PDV 331 #define TOK_PLUS_INFINITY 332 #define TOK_PRESENT 333 #define TOK_PrintableString 334 #define TOK_PRIVATE 335 #define TOK_REAL 336 #define TOK_RELATIVE_OID 337 #define TOK_SEQUENCE 338 #define TOK_SET 339 #define TOK_SIZE 340 #define TOK_STRING 341 #define TOK_SYNTAX 342 #define TOK_T61String 343 #define TOK_TAGS 344 #define TOK_TeletexString 345 #define TOK_TRUE 346 #define TOK_TYPE_IDENTIFIER 347 #define TOK_UNIQUE 348 #define TOK_UNIVERSAL 349 #define TOK_UniversalString 350 #define TOK_UTCTime 351 #define TOK_UTF8String 352 #define TOK_VideotexString 353 #define TOK_VisibleString 354 #define TOK_WITH 355 #define TOK_EXCEPT 356 #define TOK_INTERSECTION 357 #define TOK_UNION 358 #define TOK_TwoDots 359 #define TOK_ThreeDots 360 /* Copy the first part of user declarations. */ #line 1 "asn1p_y.y" #include #include #include #include #include #include "asn1parser.h" #define YYPARSE_PARAM param #define YYPARSE_PARAM_TYPE void ** #define YYERROR_VERBOSE int yylex(void); int yyerror(const char *msg); #ifdef YYBYACC int yyparse(void **param); /* byacc does not produce a prototype */ #endif void asn1p_lexer_hack_push_opaque_state(void); void asn1p_lexer_hack_enable_with_syntax(void); void asn1p_lexer_hack_push_encoding_control(void); #define yylineno asn1p_lineno extern int asn1p_lineno; /* * Process directives as */ extern int asn1p_as_pointer; /* * This temporary variable is used to solve the shortcomings of 1-lookahead * parser. */ static struct AssignedIdentifier *saved_aid; static asn1p_value_t *_convert_bitstring2binary(char *str, int base); static void _fixup_anonymous_identifier(asn1p_expr_t *expr); static asn1p_module_t *currentModule; #define NEW_EXPR() (asn1p_expr_new(yylineno, currentModule)) #define checkmem(ptr) do { \ if(!(ptr)) \ return yyerror("Memory failure"); \ } while(0) #define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \ if(arg1->type != constr_type) { \ int __ret; \ root = asn1p_constraint_new(yylineno); \ checkmem(root); \ root->type = constr_type; \ __ret = asn1p_constraint_insert(root, \ arg1); \ checkmem(__ret == 0); \ } else { \ root = arg1; \ } \ if(arg2) { \ int __ret \ = asn1p_constraint_insert(root, arg2); \ checkmem(__ret == 0); \ } \ } while(0) #ifdef AL_IMPORT #error AL_IMPORT DEFINED ELSEWHERE! #endif #define AL_IMPORT(to,where,from,field) do { \ if(!(from)) break; \ while(TQ_FIRST(&((from)->where))) { \ TQ_ADD(&((to)->where), \ TQ_REMOVE(&((from)->where), field), \ field); \ } \ assert(TQ_FIRST(&((from)->where)) == 0); \ } while(0) /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #ifndef YYSTYPE #line 88 "asn1p_y.y" typedef union { asn1p_t *a_grammar; asn1p_module_flags_e a_module_flags; asn1p_module_t *a_module; asn1p_expr_type_e a_type; /* ASN.1 Type */ asn1p_expr_t *a_expr; /* Constructed collection */ asn1p_constraint_t *a_constr; /* Constraint */ enum asn1p_constraint_type_e a_ctype;/* Constraint type */ asn1p_xports_t *a_xports; /* IMports/EXports */ struct AssignedIdentifier a_aid; /* Assigned Identifier */ asn1p_oid_t *a_oid; /* Object Identifier */ asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */ struct asn1p_type_tag_s a_tag; /* A tag */ asn1p_ref_t *a_ref; /* Reference to custom type */ asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */ asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */ struct asn1p_ref_component_s a_refcomp; /* Component of a reference */ asn1p_value_t *a_value; /* Number, DefinedValue, etc */ struct asn1p_param_s a_parg; /* A parameter argument */ asn1p_paramlist_t *a_plist; /* A pargs list */ struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */ enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */ asn1c_integer_t a_int; double a_dbl; char *tv_str; struct { char *buf; int len; } tv_opaque; struct { char *name; struct asn1p_type_tag_s tag; } tv_nametag; } yystype; /* Line 193 of /usr/local/share/bison/yacc.c. */ #line 408 "asn1p_y.c" # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 #endif #ifndef YYLTYPE typedef struct yyltype { int first_line; int first_column; int last_line; int last_column; } yyltype; # define YYLTYPE yyltype # define YYLTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 213 of /usr/local/share/bison/yacc.c. */ #line 429 "asn1p_y.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAX) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 7 #define YYLAST 805 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 121 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 122 /* YYNRULES -- Number of rules. */ #define YYNRULES 312 /* YYNRULES -- Number of states. */ #define YYNSTATES 470 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 360 #define YYTRANSLATE(X) \ ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 117, 2, 2, 2, 2, 2, 2, 110, 111, 2, 2, 113, 2, 118, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 114, 112, 119, 2, 2, 2, 120, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 115, 2, 116, 102, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 108, 104, 109, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 103, 105, 106, 107 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned short yyprhs[] = { 0, 0, 3, 5, 7, 10, 11, 21, 22, 24, 28, 31, 33, 36, 38, 43, 45, 46, 48, 50, 53, 56, 59, 62, 65, 68, 69, 71, 75, 77, 80, 82, 84, 86, 87, 91, 93, 94, 96, 100, 103, 104, 106, 108, 111, 112, 114, 119, 121, 125, 127, 131, 133, 134, 136, 140, 144, 147, 149, 153, 155, 159, 161, 165, 170, 172, 174, 179, 183, 187, 194, 201, 203, 207, 209, 213, 217, 221, 225, 227, 231, 233, 235, 237, 239, 240, 242, 244, 248, 252, 255, 259, 261, 263, 267, 270, 272, 274, 280, 281, 283, 285, 289, 292, 297, 301, 305, 309, 313, 317, 318, 320, 321, 328, 330, 333, 335, 337, 339, 343, 345, 349, 353, 357, 358, 361, 363, 368, 373, 378, 385, 392, 394, 399, 403, 405, 409, 413, 417, 419, 423, 425, 429, 431, 433, 435, 437, 441, 445, 447, 452, 454, 456, 460, 461, 465, 467, 469, 471, 473, 475, 477, 479, 481, 485, 487, 489, 491, 493, 496, 498, 500, 502, 504, 507, 510, 512, 514, 517, 520, 522, 524, 526, 528, 530, 533, 535, 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, 558, 560, 562, 564, 566, 568, 570, 572, 574, 575, 577, 579, 581, 586, 590, 595, 597, 599, 603, 609, 611, 613, 617, 619, 623, 625, 629, 631, 635, 640, 644, 646, 648, 652, 656, 660, 664, 666, 668, 671, 674, 676, 678, 680, 682, 684, 686, 688, 690, 692, 694, 696, 700, 706, 708, 712, 714, 718, 719, 721, 723, 725, 727, 729, 731, 733, 734, 740, 743, 745, 748, 751, 755, 757, 759, 763, 768, 770, 774, 777, 781, 783, 787, 788, 790, 792, 795, 798, 802, 804, 808, 810, 815, 820, 822, 824, 826, 828, 830, 832, 833, 835, 838, 843, 844, 846, 848, 850, 851, 853, 855, 857, 859, 861, 862, 864 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short yyrhs[] = { 122, 0, -1, 123, -1, 124, -1, 123, 124, -1, -1, 239, 125, 126, 39, 130, 3, 26, 133, 44, -1, -1, 127, -1, 108, 128, 109, -1, 108, 109, -1, 129, -1, 128, 129, -1, 242, -1, 242, 110, 10, 111, -1, 10, -1, -1, 131, -1, 132, -1, 131, 132, -1, 46, 89, -1, 57, 89, -1, 25, 89, -1, 48, 58, -1, 16, 62, -1, -1, 134, -1, 146, 138, 135, -1, 136, -1, 135, 136, -1, 153, -1, 183, -1, 151, -1, -1, 43, 16, 137, -1, 193, -1, -1, 139, -1, 59, 140, 112, -1, 59, 51, -1, -1, 141, -1, 143, -1, 141, 143, -1, -1, 127, -1, 144, 51, 239, 142, -1, 145, -1, 144, 113, 145, -1, 239, -1, 239, 108, 109, -1, 242, -1, -1, 147, -1, 47, 148, 112, -1, 47, 22, 112, -1, 47, 112, -1, 149, -1, 148, 113, 149, -1, 239, -1, 239, 108, 109, -1, 242, -1, 108, 200, 109, -1, 239, 152, 3, 150, -1, 192, -1, 177, -1, 177, 108, 156, 109, -1, 239, 3, 173, -1, 239, 3, 163, -1, 239, 108, 154, 109, 3, 173, -1, 239, 108, 154, 109, 3, 163, -1, 155, -1, 154, 113, 155, -1, 239, -1, 239, 114, 242, -1, 239, 114, 239, -1, 190, 114, 242, -1, 190, 114, 239, -1, 157, -1, 156, 113, 157, -1, 173, -1, 186, -1, 242, -1, 150, -1, -1, 159, -1, 160, -1, 159, 113, 160, -1, 242, 173, 227, -1, 173, 227, -1, 35, 73, 173, -1, 172, -1, 162, -1, 161, 113, 162, -1, 242, 173, -1, 172, -1, 173, -1, 33, 108, 165, 109, 167, -1, -1, 93, -1, 166, -1, 165, 113, 166, -1, 17, 227, -1, 18, 173, 164, 227, -1, 18, 181, 227, -1, 18, 182, 227, -1, 17, 181, 227, -1, 17, 173, 227, -1, 17, 182, 227, -1, -1, 168, -1, -1, 100, 87, 108, 169, 170, 109, -1, 171, -1, 170, 171, -1, 4, -1, 19, -1, 180, -1, 115, 170, 116, -1, 107, -1, 107, 117, 187, -1, 107, 117, 232, -1, 234, 175, 196, -1, -1, 174, 176, -1, 152, -1, 32, 108, 161, 109, -1, 83, 108, 158, 109, -1, 84, 108, 158, 109, -1, 83, 196, 73, 241, 234, 175, -1, 84, 196, 73, 241, 234, 175, -1, 23, -1, 23, 40, 30, 242, -1, 61, 73, 177, -1, 15, -1, 15, 118, 239, -1, 240, 118, 239, -1, 15, 118, 242, -1, 240, -1, 240, 118, 178, -1, 179, -1, 178, 118, 179, -1, 180, -1, 17, -1, 18, -1, 17, -1, 181, 118, 17, -1, 181, 118, 18, -1, 16, -1, 242, 173, 3, 184, -1, 186, -1, 187, -1, 242, 114, 184, -1, -1, 108, 185, 189, -1, 68, -1, 50, -1, 91, -1, 6, -1, 8, -1, 188, -1, 232, -1, 242, -1, 239, 118, 242, -1, 7, -1, 13, -1, 14, -1, 5, -1, 189, 5, -1, 29, -1, 68, -1, 81, -1, 191, -1, 72, 86, -1, 70, 56, -1, 82, -1, 49, -1, 41, 76, -1, 31, 86, -1, 96, -1, 52, -1, 193, -1, 63, -1, 45, -1, 27, 86, -1, 190, -1, 191, 229, -1, 28, -1, 53, -1, 54, -1, 55, -1, 64, -1, 69, -1, 79, -1, 88, -1, 90, -1, 95, -1, 97, -1, 98, -1, 99, -1, 71, -1, 104, -1, 105, -1, 102, -1, 103, -1, -1, 197, -1, 198, -1, 199, -1, 85, 110, 200, 111, -1, 110, 200, 111, -1, 199, 110, 200, 111, -1, 107, -1, 201, -1, 201, 113, 107, -1, 201, 113, 107, 113, 201, -1, 216, -1, 202, -1, 22, 101, 205, -1, 203, -1, 202, 194, 203, -1, 204, -1, 203, 195, 204, -1, 205, -1, 205, 101, 205, -1, 207, 110, 200, 111, -1, 110, 200, 111, -1, 208, -1, 210, -1, 208, 220, 208, -1, 66, 220, 208, -1, 208, 220, 65, -1, 66, 220, 65, -1, 211, -1, 206, -1, 75, 7, -1, 75, 242, -1, 85, -1, 51, -1, 50, -1, 91, -1, 233, -1, 188, -1, 209, -1, 242, -1, 6, -1, 8, -1, 239, -1, 100, 34, 199, -1, 100, 35, 108, 212, 109, -1, 213, -1, 212, 113, 213, -1, 107, -1, 242, 196, 214, -1, -1, 215, -1, 78, -1, 20, -1, 74, -1, 217, -1, 221, -1, 219, -1, -1, 36, 30, 108, 218, 189, -1, 37, 173, -1, 106, -1, 106, 119, -1, 119, 106, -1, 119, 106, 119, -1, 222, -1, 223, -1, 108, 239, 109, -1, 222, 108, 224, 109, -1, 225, -1, 224, 113, 225, -1, 120, 226, -1, 120, 118, 226, -1, 242, -1, 226, 118, 242, -1, -1, 228, -1, 74, -1, 38, 184, -1, 108, 109, -1, 108, 230, 109, -1, 231, -1, 230, 113, 231, -1, 242, -1, 242, 110, 232, 111, -1, 242, 110, 187, 111, -1, 232, -1, 107, -1, 10, -1, 11, -1, 232, -1, 12, -1, -1, 235, -1, 236, 238, -1, 115, 237, 10, 116, -1, -1, 94, -1, 24, -1, 80, -1, -1, 57, -1, 46, -1, 15, -1, 16, -1, 16, -1, -1, 242, -1, 9, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short yyrline[] = { 0, 355, 355, 361, 367, 384, 383, 412, 414, 417, 421, 426, 433, 441, 446, 450, 459, 461, 469, 473, 481, 485, 488, 491, 495, 515, 517, 525, 534, 538, 553, 561, 574, 582, 581, 595, 607, 609, 611, 622, 627, 629, 631, 637, 643, 645, 648, 659, 665, 671, 678, 684, 693, 695, 706, 710, 713, 720, 726, 732, 739, 745, 754, 756, 766, 780, 790, 806, 816, 832, 838, 845, 855, 865, 870, 877, 884, 892, 902, 908, 914, 918, 926, 937, 959, 961, 963, 969, 975, 983, 989, 996, 1001, 1007, 1013, 1019, 1022, 1028, 1038, 1040, 1043, 1051, 1058, 1071, 1082, 1092, 1103, 1113, 1124, 1135, 1137, 1144, 1142, 1151, 1156, 1162, 1167, 1170, 1174, 1179, 1188, 1197, 1208, 1230, 1237, 1256, 1260, 1266, 1272, 1278, 1288, 1298, 1304, 1315, 1329, 1338, 1348, 1358, 1368, 1376, 1397, 1406, 1415, 1417, 1424, 1431, 1437, 1441, 1447, 1467, 1477, 1479, 1480, 1487, 1487, 1492, 1499, 1505, 1510, 1514, 1518, 1521, 1526, 1538, 1555, 1560, 1565, 1572, 1582, 1596, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1615, 1617, 1618, 1621, 1628, 1640, 1642, 1646, 1650, 1651, 1652, 1653, 1654, 1658, 1659, 1660, 1661, 1665, 1666, 1673, 1673, 1674, 1674, 1676, 1678, 1683, 1687, 1691, 1700, 1704, 1709, 1714, 1717, 1723, 1731, 1736, 1738, 1743, 1745, 1750, 1752, 1758, 1760, 1765, 1774, 1782, 1788, 1794, 1801, 1809, 1817, 1826, 1829, 1834, 1840, 1850, 1854, 1859, 1865, 1870, 1871, 1872, 1873, 1886, 1891, 1897, 1911, 1915, 1920, 1924, 1929, 1936, 1949, 1951, 1954, 1958, 1961, 1968, 1970, 1971, 1976, 1974, 1986, 1994, 1996, 1997, 1998, 2000, 2004, 2012, 2027, 2033, 2040, 2053, 2065, 2080, 2084, 2101, 2106, 2109, 2114, 2136, 2141, 2146, 2152, 2158, 2166, 2174, 2182, 2189, 2199, 2204, 2210, 2212, 2242, 2244, 2247, 2254, 2260, 2262, 2263, 2264, 2267, 2269, 2270, 2273, 2278, 2285, 2292, 2294, 2299 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "TOK_PPEQ", "TOK_whitespace", "TOK_opaque", "TOK_bstring", "TOK_cstring", "TOK_hstring", "TOK_identifier", "TOK_number", "TOK_number_negative", "TOK_realnumber", "TOK_tuple", "TOK_quadruple", "TOK_typereference", "TOK_capitalreference", "TOK_typefieldreference", "TOK_valuefieldreference", "TOK_Literal", "TOK_ABSENT", "TOK_ABSTRACT_SYNTAX", "TOK_ALL", "TOK_ANY", "TOK_APPLICATION", "TOK_AUTOMATIC", "TOK_BEGIN", "TOK_BIT", "TOK_BMPString", "TOK_BOOLEAN", "TOK_BY", "TOK_CHARACTER", "TOK_CHOICE", "TOK_CLASS", "TOK_COMPONENT", "TOK_COMPONENTS", "TOK_CONSTRAINED", "TOK_CONTAINING", "TOK_DEFAULT", "TOK_DEFINITIONS", "TOK_DEFINED", "TOK_EMBEDDED", "TOK_ENCODED", "TOK_ENCODING_CONTROL", "TOK_END", "TOK_ENUMERATED", "TOK_EXPLICIT", "TOK_EXPORTS", "TOK_EXTENSIBILITY", "TOK_EXTERNAL", "TOK_FALSE", "TOK_FROM", "TOK_GeneralizedTime", "TOK_GeneralString", "TOK_GraphicString", "TOK_IA5String", "TOK_IDENTIFIER", "TOK_IMPLICIT", "TOK_IMPLIED", "TOK_IMPORTS", "TOK_INCLUDES", "TOK_INSTANCE", "TOK_INSTRUCTIONS", "TOK_INTEGER", "TOK_ISO646String", "TOK_MAX", "TOK_MIN", "TOK_MINUS_INFINITY", "TOK_NULL", "TOK_NumericString", "TOK_OBJECT", "TOK_ObjectDescriptor", "TOK_OCTET", "TOK_OF", "TOK_OPTIONAL", "TOK_PATTERN", "TOK_PDV", "TOK_PLUS_INFINITY", "TOK_PRESENT", "TOK_PrintableString", "TOK_PRIVATE", "TOK_REAL", "TOK_RELATIVE_OID", "TOK_SEQUENCE", "TOK_SET", "TOK_SIZE", "TOK_STRING", "TOK_SYNTAX", "TOK_T61String", "TOK_TAGS", "TOK_TeletexString", "TOK_TRUE", "TOK_TYPE_IDENTIFIER", "TOK_UNIQUE", "TOK_UNIVERSAL", "TOK_UniversalString", "TOK_UTCTime", "TOK_UTF8String", "TOK_VideotexString", "TOK_VisibleString", "TOK_WITH", "TOK_EXCEPT", "'^'", "TOK_INTERSECTION", "'|'", "TOK_UNION", "TOK_TwoDots", "TOK_ThreeDots", "'{'", "'}'", "'('", "')'", "';'", "','", "':'", "'['", "']'", "'!'", "'.'", "'<'", "'@'", "$accept", "ParsedGrammar", "ModuleList", "ModuleDefinition", "@1", "optObjectIdentifier", "ObjectIdentifier", "ObjectIdentifierBody", "ObjectIdentifierElement", "optModuleDefinitionFlags", "ModuleDefinitionFlags", "ModuleDefinitionFlag", "optModuleBody", "ModuleBody", "AssignmentList", "Assignment", "@2", "optImports", "ImportsDefinition", "optImportsBundleSet", "ImportsBundleSet", "AssignedIdentifier", "ImportsBundle", "ImportsList", "ImportsElement", "optExports", "ExportsDefinition", "ExportsBody", "ExportsElement", "ValueSet", "ValueSetTypeAssignment", "DefinedType", "DataTypeReference", "ParameterArgumentList", "ParameterArgumentName", "ActualParameterList", "ActualParameter", "optComponentTypeLists", "ComponentTypeLists", "ComponentType", "AlternativeTypeLists", "AlternativeType", "ObjectClass", "optUnique", "FieldSpec", "ClassField", "optWithSyntax", "WithSyntax", "@3", "WithSyntaxList", "WithSyntaxToken", "ExtensionAndException", "Type", "NSTD_IndirectMarker", "TypeDeclaration", "TypeDeclarationSet", "ComplexTypeReference", "ComplexTypeReferenceAmpList", "ComplexTypeReferenceElement", "PrimitiveFieldReference", "FieldName", "DefinedObjectClass", "ValueAssignment", "Value", "@4", "SimpleValue", "DefinedValue", "RestrictedCharacterStringValue", "Opaque", "BasicTypeId", "BasicTypeId_UniverationCompatible", "BasicType", "BasicString", "UnionMark", "IntersectionMark", "optConstraints", "Constraint", "SubtypeConstraint", "SetOfConstraints", "ElementSetSpecs", "ElementSetSpec", "Unions", "Intersections", "IntersectionElements", "ConstraintSubtypeElement", "PatternConstraint", "ConstraintSpec", "SingleValue", "BitStringValue", "ContainedSubtype", "InnerTypeConstraint", "WithComponentsList", "WithComponentsElement", "optPresenceConstraint", "PresenceConstraint", "GeneralConstraint", "UserDefinedConstraint", "@5", "ContentsConstraint", "ConstraintRangeSpec", "TableConstraint", "SimpleTableConstraint", "ComponentRelationConstraint", "AtNotationList", "AtNotationElement", "ComponentIdList", "optMarker", "Marker", "UniverationDefinition", "UniverationList", "UniverationElement", "SignedNumber", "RealValue", "optTag", "Tag", "TagTypeValue", "TagClass", "TagPlicit", "TypeRefName", "ObjectClassReference", "optIdentifier", "Identifier", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 94, 357, 124, 358, 359, 360, 123, 125, 40, 41, 59, 44, 58, 91, 93, 33, 46, 60, 64 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 121, 122, 123, 123, 125, 124, 126, 126, 127, 127, 128, 128, 129, 129, 129, 130, 130, 131, 131, 132, 132, 132, 132, 132, 133, 133, 134, 135, 135, 136, 136, 136, 137, 136, 136, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, 144, 144, 145, 145, 145, 146, 146, 147, 147, 147, 148, 148, 149, 149, 149, 150, 151, 152, 152, 152, 153, 153, 153, 153, 154, 154, 155, 155, 155, 155, 155, 156, 156, 157, 157, 157, 157, 158, 158, 159, 159, 160, 160, 160, 160, 161, 161, 162, 162, 162, 163, 164, 164, 165, 165, 166, 166, 166, 166, 166, 166, 166, 167, 167, 169, 168, 170, 170, 171, 171, 171, 171, 172, 172, 172, 173, 174, 175, 176, 176, 176, 176, 176, 176, 176, 176, 176, 177, 177, 177, 177, 177, 177, 178, 178, 179, 180, 180, 181, 181, 181, 182, 183, 184, 184, 184, 185, 184, 184, 186, 186, 186, 186, 186, 186, 187, 187, 188, 188, 188, 189, 189, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 191, 191, 191, 192, 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, 194, 195, 195, 196, 196, 197, 198, 198, 199, 199, 200, 200, 200, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 206, 206, 207, 207, 208, 208, 208, 208, 208, 208, 209, 209, 210, 211, 211, 212, 212, 213, 213, 214, 214, 215, 215, 215, 216, 216, 216, 218, 217, 219, 220, 220, 220, 220, 221, 221, 222, 223, 224, 224, 225, 225, 226, 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 231, 231, 231, 231, 232, 232, 233, 233, 234, 234, 235, 236, 237, 237, 237, 237, 238, 238, 238, 239, 239, 240, 241, 241, 242 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 1, 1, 2, 0, 9, 0, 1, 3, 2, 1, 2, 1, 4, 1, 0, 1, 1, 2, 2, 2, 2, 2, 2, 0, 1, 3, 1, 2, 1, 1, 1, 0, 3, 1, 0, 1, 3, 2, 0, 1, 1, 2, 0, 1, 4, 1, 3, 1, 3, 1, 0, 1, 3, 3, 2, 1, 3, 1, 3, 1, 3, 4, 1, 1, 4, 3, 3, 6, 6, 1, 3, 1, 3, 3, 3, 3, 1, 3, 1, 1, 1, 1, 0, 1, 1, 3, 3, 2, 3, 1, 1, 3, 2, 1, 1, 5, 0, 1, 1, 3, 2, 4, 3, 3, 3, 3, 3, 0, 1, 0, 6, 1, 2, 1, 1, 1, 3, 1, 3, 3, 3, 0, 2, 1, 4, 4, 4, 6, 6, 1, 4, 3, 1, 3, 3, 3, 1, 3, 1, 3, 1, 1, 1, 1, 3, 3, 1, 4, 1, 1, 3, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 4, 3, 4, 1, 1, 3, 5, 1, 1, 3, 1, 3, 1, 3, 1, 3, 4, 3, 1, 1, 3, 3, 3, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 1, 3, 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, 0, 5, 2, 1, 2, 2, 3, 1, 1, 3, 4, 1, 3, 2, 3, 1, 3, 0, 1, 1, 2, 2, 3, 1, 3, 1, 4, 4, 1, 1, 1, 1, 1, 1, 0, 1, 2, 4, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned short yydefact[] = { 0, 307, 308, 0, 2, 3, 5, 1, 4, 7, 0, 0, 8, 312, 15, 10, 0, 11, 13, 16, 9, 12, 0, 0, 0, 0, 0, 0, 0, 17, 18, 0, 24, 22, 20, 23, 21, 0, 19, 14, 52, 0, 0, 26, 36, 53, 0, 56, 0, 57, 59, 61, 6, 40, 0, 37, 55, 54, 0, 0, 39, 0, 41, 42, 0, 47, 49, 51, 187, 0, 188, 189, 190, 191, 192, 200, 193, 194, 195, 196, 197, 198, 199, 27, 28, 32, 30, 31, 35, 0, 296, 58, 60, 38, 43, 0, 0, 0, 33, 29, 296, 134, 309, 0, 169, 0, 0, 183, 176, 180, 182, 170, 0, 0, 171, 175, 179, 0, 0, 65, 185, 172, 64, 181, 138, 300, 0, 123, 297, 304, 44, 48, 50, 34, 0, 68, 67, 0, 184, 178, 177, 174, 173, 0, 71, 0, 172, 73, 0, 296, 0, 186, 0, 302, 303, 301, 0, 0, 0, 205, 306, 305, 298, 45, 46, 0, 135, 137, 0, 0, 0, 0, 0, 63, 158, 164, 159, 292, 293, 165, 166, 156, 157, 83, 0, 78, 80, 81, 160, 161, 82, 291, 283, 0, 285, 290, 287, 143, 144, 139, 140, 142, 136, 0, 155, 153, 149, 150, 151, 0, 162, 131, 0, 0, 205, 205, 125, 124, 0, 0, 122, 206, 207, 208, 296, 296, 0, 100, 296, 72, 77, 76, 75, 74, 245, 246, 295, 0, 0, 296, 239, 238, 0, 0, 237, 240, 0, 212, 0, 0, 242, 0, 213, 217, 219, 221, 223, 234, 0, 227, 243, 228, 233, 216, 259, 261, 260, 269, 270, 294, 241, 247, 244, 66, 296, 284, 0, 0, 0, 299, 0, 0, 0, 0, 296, 0, 296, 0, 296, 0, 0, 0, 0, 148, 145, 0, 281, 279, 279, 279, 102, 280, 98, 279, 279, 109, 0, 70, 69, 0, 0, 264, 265, 0, 0, 235, 236, 0, 0, 0, 0, 62, 0, 201, 202, 0, 203, 204, 0, 0, 0, 0, 0, 79, 286, 0, 0, 162, 141, 167, 154, 163, 152, 0, 119, 0, 92, 95, 96, 296, 133, 0, 0, 85, 86, 91, 279, 296, 310, 0, 310, 0, 210, 0, 282, 107, 0, 106, 108, 99, 279, 104, 105, 0, 97, 110, 101, 218, 262, 266, 267, 232, 230, 248, 0, 271, 226, 214, 220, 222, 224, 0, 231, 229, 0, 0, 273, 289, 288, 168, 132, 0, 126, 296, 94, 296, 127, 296, 89, 279, 296, 311, 128, 296, 209, 211, 146, 147, 103, 0, 0, 268, 252, 0, 250, 205, 0, 225, 0, 275, 277, 272, 0, 120, 121, 93, 90, 87, 88, 123, 123, 111, 263, 249, 0, 254, 215, 276, 0, 274, 129, 130, 0, 251, 257, 258, 256, 253, 255, 278, 115, 116, 0, 0, 113, 117, 0, 112, 114, 118 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { -1, 3, 4, 5, 9, 11, 12, 16, 17, 28, 29, 30, 42, 43, 83, 84, 133, 54, 55, 61, 62, 164, 63, 64, 65, 44, 45, 48, 49, 183, 85, 118, 86, 143, 144, 184, 185, 352, 353, 354, 345, 346, 135, 370, 226, 227, 374, 375, 452, 463, 464, 355, 356, 158, 159, 217, 119, 199, 200, 465, 298, 299, 87, 206, 280, 207, 208, 250, 340, 120, 121, 122, 123, 325, 328, 220, 221, 222, 223, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 423, 424, 457, 458, 263, 264, 420, 265, 314, 266, 267, 268, 395, 396, 429, 300, 301, 151, 193, 194, 269, 270, 127, 128, 129, 156, 162, 271, 124, 410, 272 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -287 static const short yypact[] = { 80, -287, -287, 24, 80, -287, -287, -287, -287, -57, 7, 17, -287, -287, -287, -287, 44, -287, -42, 240, -287, -287, 77, 42, 61, 119, 107, 129, 168, 240, -287, 114, -287, -287, -287, -287, -287, 205, -287, -287, 82, 68, 190, -287, 178, -287, 140, -287, 98, -287, 191, -287, -287, 198, 538, -287, -287, -287, 232, 184, -287, 202, 232, -287, 69, -287, 209, -287, -287, 304, -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, 538, -287, -287, -287, -287, -287, 274, 207, -287, -287, -287, -287, 80, 232, 223, -287, -287, 9, 218, -287, 255, -287, 261, 273, -287, -287, -287, -287, -287, 295, 266, -287, -287, -287, 706, 351, 249, -287, 250, -287, -287, 241, 79, 357, -287, -287, 186, -57, -287, -287, -287, 253, -287, -287, 232, -287, -287, -287, -287, -287, 145, -287, 251, -287, 252, 259, 101, 16, -287, 291, -287, -287, -287, 353, 213, 630, -16, -287, -287, -287, -287, -287, 243, -287, -287, 365, 706, 232, 232, 413, -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, 146, -287, -287, -287, -287, -287, -287, -287, -287, 166, -287, -287, 265, -287, -287, 258, -287, -287, -287, 262, -287, -287, -287, -287, -287, 263, 269, 337, 271, 312, 85, 130, -287, -287, 270, 413, -287, -287, -287, 276, 81, 48, 171, -287, 9, -287, -287, -287, -287, -287, -287, -287, -287, 286, 358, 207, -287, -287, -17, 23, -287, -287, 234, -287, 80, 413, -287, 280, 277, 206, 210, -287, 293, -287, 282, -17, -287, -287, -287, -287, -287, -287, -287, 287, -287, -287, -287, -287, -287, -287, 101, -287, 71, 235, 307, -287, 391, 389, 213, 369, 51, 315, 70, 327, 70, 328, 413, 292, 413, -287, -287, 213, -287, -27, -19, -27, -287, -287, 309, -19, -27, 305, 243, -287, -287, 564, 296, -287, 288, 302, 192, -287, -287, 299, 303, 301, 306, -287, 308, -287, -287, 564, -287, -287, 564, 564, 413, 446, 294, -287, -287, 319, 320, -287, -287, -287, 407, -287, -287, 389, 316, 182, -287, -287, -287, 207, -287, 340, 323, 324, -287, -287, -27, 207, 389, 330, 389, 325, -287, 329, -287, -287, 317, -287, -287, -287, -27, -287, -287, 354, -287, -287, -287, -287, -287, -287, 297, -287, -287, 276, 76, -287, -287, 331, 210, -287, -287, 332, -287, -287, -1, 183, -287, -287, -287, -287, -287, 235, -287, 51, -287, 207, -287, 6, -287, -27, 207, -287, -287, 207, -287, -287, -287, -287, -287, 334, 391, -287, -287, 185, -287, -16, 459, -287, 389, 333, -287, -287, 294, -287, -287, -287, -287, -287, -287, -287, -287, -287, 407, -287, 76, 161, -287, 333, 389, -287, -287, -287, 57, -287, -287, -287, -287, -287, -287, -287, -287, -287, 57, 19, -287, -287, 53, -287, -287, -287 }; /* YYPGOTO[NTERM-NUM]. */ static const short yypgoto[] = { -287, -287, -287, 441, -287, -287, 318, -287, 430, -287, -287, 418, -287, -287, -287, 378, -287, -287, -287, -287, -287, -287, 400, -287, 380, -287, -287, -287, 419, 335, -287, 322, -287, -287, 313, -287, 204, 196, -287, 78, -287, 83, 264, -287, -287, 181, -287, -287, -287, 27, -277, -270, -87, -287, -100, -287, 208, -287, 212, -148, 272, 275, -287, -65, -287, -142, -265, -139, 74, -51, 67, -287, -5, -287, -287, -213, -287, -287, 174, -199, 73, -287, 170, 173, -165, -287, -287, -286, -287, -287, -287, -287, 58, -287, -287, -287, -287, -287, -287, 244, -287, -287, -287, -287, 75, 84, -264, -287, -287, -287, 229, -128, -287, -222, -287, -287, -287, -287, 5, -287, 148, -10 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, parse error. */ #define YYTABLE_NINF -280 static const short yytable[] = { 18, 287, 289, 126, 201, 6, 18, 187, 13, 6, 188, 295, 335, 136, 347, 13, 13, 14, 188, 295, 291, 189, 195, 460, 7, 13, 177, 178, 382, 189, 315, 51, 13, 365, 367, 368, 197, 198, 461, 371, 372, 351, 134, 67, 90, 393, 50, 296, 51, 88, 320, 10, 67, 13, 14, 296, 19, 460, 66, 89, 13, 460, 186, 50, 293, 294, 145, 66, 22, 218, 197, 198, 461, 90, 197, 198, 461, 13, 88, 13, 13, 177, 178, 1, 2, 13, 67, 31, 89, 312, 46, 361, 408, 363, 219, 1, 2, 293, 294, 366, 130, 66, 313, 153, 32, 351, 418, 174, 175, 176, 13, 177, 178, 344, 179, 180, 15, 428, 145, 295, 95, 125, 147, 191, 125, 192, -25, 167, 467, 41, 201, 391, 187, 347, 462, 188, 433, 297, 302, 190, 196, 308, 166, 188, 377, 438, 189, 210, 195, 336, 33, 181, 311, 20, 189, 296, 188, 202, 344, 154, 231, 233, 209, 125, 390, 35, 125, 189, 462, 469, 218, 37, 462, 155, 147, 230, 232, 344, 191, -84, 47, 454, 96, 422, 146, 125, 468, 186, 439, 468, -279, 440, 182, 286, -279, 219, 125, 348, 234, 175, 235, 13, 177, 178, 236, 179, 180, 13, 34, 172, 57, 58, 445, 1, 2, 218, 125, 342, 36, 174, 175, 176, 13, 177, 178, 39, 179, 180, 1, 2, 364, 40, 160, 316, 52, 455, 146, 53, 288, 456, 219, 13, 240, 161, 13, 177, 178, 1, 2, 60, 1, 2, 56, 319, 168, 273, 23, 381, 169, 274, 224, 225, 404, 181, 190, 24, 196, 337, 317, 318, 409, 341, 210, 434, 349, 275, 357, 100, 357, 276, 305, 204, 209, 245, 306, 210, 25, 209, 26, 101, 102, 402, 431, 92, 443, 403, 432, 27, 444, 59, 209, 103, 68, 104, 182, 105, 1, 2, 197, 198, 323, 324, 326, 327, 93, 106, 348, 97, 436, 107, 98, 205, 125, 108, 197, 198, 109, 70, 71, 72, 101, 102, 132, 400, 416, 417, 137, 110, 73, 450, 451, 138, 111, 74, 112, 75, 113, 139, 411, 140, 411, 141, 142, 76, 148, 114, 115, 149, 150, 152, 157, 165, 77, 203, 78, 170, 171, 172, 228, 79, 116, 80, 81, 82, 425, 277, 278, 283, 279, 284, 290, 281, 117, 282, 430, 285, 292, 309, 310, 321, 322, 337, 330, 349, 329, 332, 339, 357, 13, 343, 358, 360, 369, 362, 378, 373, 209, 379, 380, 219, 385, 384, 399, 405, 394, 387, 421, 386, 430, 234, 175, 235, 13, 177, 178, 236, 179, 180, 1, 2, 397, 398, 406, 401, 425, 237, 414, 407, 459, 412, 415, 419, 441, 427, 426, 8, 21, 38, 163, 238, 239, 448, 234, 175, 235, 13, 177, 178, 236, 179, 180, 99, 94, 240, 241, 234, 175, 235, 13, 177, 178, 236, 179, 180, 1, 2, 131, 91, 333, 242, 216, 237, 229, 173, 359, 437, 435, 376, 243, 466, 338, 383, 307, 350, 442, 388, 240, 303, 244, 446, 304, 389, 453, 331, 245, 334, 0, 449, 413, 240, 241, 392, 447, 246, 0, 0, 0, 0, 0, 0, 247, 248, 0, 249, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 243, 0, 0, 245, 0, 0, 0, 0, 0, 0, 244, 0, 0, 13, 0, 0, 245, 0, 0, 1, 2, 0, 0, 0, 0, 246, 0, 0, 0, 0, 0, 0, 68, 0, 0, 249, 234, 175, 235, 13, 177, 178, 236, 179, 180, 1, 2, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, 0, 74, 0, 75, 0, 0, 0, 0, 240, 241, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 78, 0, 242, 0, 0, 79, 0, 80, 81, 82, 0, 243, 0, 0, 0, 0, 0, 101, 102, 0, 0, 244, 0, 0, 0, 211, 0, 245, 0, 103, 68, 104, 0, 105, 212, 0, 246, 0, 0, 0, 0, 0, 0, 106, 0, 0, 249, 107, 0, 0, 0, 108, 0, 0, 109, 70, 71, 72, 0, 0, 0, 0, 0, 213, 0, 110, 73, 0, 0, 0, 111, 74, 112, 75, 113, 0, 0, 0, 0, 0, 0, 76, 0, 114, 115, 214, 215, 0, 0, 0, 77, 0, 78, 1, 2, 0, 0, 79, 116, 80, 81, 82, 0, 0, 0, 103, 68, 104, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 0, 0, 0, 107, 0, 0, 0, 108, 0, 0, 109, 70, 71, 72, 0, 0, 0, 0, 0, 0, 0, 110, 73, 0, 0, 0, 111, 74, 112, 75, 113, 0, 0, 0, 0, 0, 0, 76, 0, 114, 115, 0, 0, 0, 0, 0, 77, 0, 78, 0, 0, 0, 0, 79, 116, 80, 81, 82 }; static const short yycheck[] = { 10, 214, 215, 90, 152, 0, 16, 149, 9, 4, 149, 38, 277, 100, 284, 9, 9, 10, 157, 38, 219, 149, 150, 4, 0, 9, 10, 11, 314, 157, 7, 41, 9, 297, 298, 299, 17, 18, 19, 303, 304, 35, 33, 53, 54, 331, 41, 74, 58, 54, 249, 108, 62, 9, 10, 74, 39, 4, 53, 54, 9, 4, 149, 58, 16, 17, 117, 62, 110, 85, 17, 18, 19, 83, 17, 18, 19, 9, 83, 9, 9, 10, 11, 15, 16, 9, 96, 10, 83, 106, 22, 290, 356, 292, 110, 15, 16, 16, 17, 118, 95, 96, 119, 24, 62, 35, 370, 6, 7, 8, 9, 10, 11, 107, 13, 14, 109, 118, 169, 38, 51, 115, 117, 107, 115, 109, 44, 137, 109, 47, 278, 330, 274, 403, 115, 274, 401, 224, 225, 149, 150, 228, 137, 282, 309, 409, 274, 157, 276, 277, 89, 50, 239, 109, 282, 74, 295, 152, 107, 80, 170, 171, 157, 115, 329, 58, 115, 295, 115, 116, 85, 3, 115, 94, 169, 170, 171, 107, 107, 109, 112, 20, 113, 107, 117, 115, 463, 274, 410, 466, 109, 413, 91, 108, 113, 110, 115, 284, 6, 7, 8, 9, 10, 11, 12, 13, 14, 9, 89, 108, 112, 113, 425, 15, 16, 85, 115, 282, 89, 6, 7, 8, 9, 10, 11, 111, 13, 14, 15, 16, 295, 26, 46, 243, 44, 74, 169, 59, 108, 78, 110, 9, 50, 57, 9, 10, 11, 15, 16, 51, 15, 16, 112, 248, 109, 109, 16, 65, 113, 113, 17, 18, 349, 50, 274, 25, 276, 277, 34, 35, 357, 281, 282, 401, 284, 109, 286, 3, 288, 113, 109, 68, 277, 91, 113, 295, 46, 282, 48, 15, 16, 109, 109, 109, 109, 113, 113, 57, 113, 108, 295, 27, 28, 29, 91, 31, 15, 16, 17, 18, 104, 105, 102, 103, 112, 41, 403, 108, 405, 45, 16, 108, 115, 49, 17, 18, 52, 53, 54, 55, 15, 16, 109, 343, 17, 18, 118, 63, 64, 439, 440, 86, 68, 69, 70, 71, 72, 86, 358, 76, 360, 56, 86, 79, 3, 81, 82, 108, 108, 118, 3, 108, 88, 10, 90, 114, 114, 108, 3, 95, 96, 97, 98, 99, 384, 110, 118, 40, 116, 108, 110, 118, 108, 114, 394, 73, 110, 101, 30, 109, 113, 401, 110, 403, 101, 108, 5, 407, 9, 30, 73, 73, 93, 111, 108, 100, 401, 119, 106, 110, 109, 108, 5, 73, 120, 107, 119, 111, 428, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 111, 111, 109, 117, 444, 22, 111, 113, 448, 109, 111, 87, 108, 111, 113, 4, 16, 29, 130, 36, 37, 118, 6, 7, 8, 9, 10, 11, 12, 13, 14, 83, 62, 50, 51, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 96, 58, 274, 66, 158, 22, 169, 148, 288, 407, 403, 306, 75, 462, 278, 317, 228, 285, 420, 325, 50, 225, 85, 426, 225, 328, 444, 259, 91, 276, -1, 432, 360, 50, 51, 65, 428, 100, -1, -1, -1, -1, -1, -1, 107, 108, -1, 110, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, 75, -1, -1, 91, -1, -1, -1, -1, -1, -1, 85, -1, -1, 9, -1, -1, 91, -1, -1, 15, 16, -1, -1, -1, -1, 100, -1, -1, -1, -1, -1, -1, 28, -1, -1, 110, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, 69, -1, 71, -1, -1, -1, -1, 50, 51, -1, 79, -1, -1, -1, -1, -1, -1, -1, -1, 88, -1, 90, -1, 66, -1, -1, 95, -1, 97, 98, 99, -1, 75, -1, -1, -1, -1, -1, 15, 16, -1, -1, 85, -1, -1, -1, 23, -1, 91, -1, 27, 28, 29, -1, 31, 32, -1, 100, -1, -1, -1, -1, -1, -1, 41, -1, -1, 110, 45, -1, -1, -1, 49, -1, -1, 52, 53, 54, 55, -1, -1, -1, -1, -1, 61, -1, 63, 64, -1, -1, -1, 68, 69, 70, 71, 72, -1, -1, -1, -1, -1, -1, 79, -1, 81, 82, 83, 84, -1, -1, -1, 88, -1, 90, 15, 16, -1, -1, 95, 96, 97, 98, 99, -1, -1, -1, 27, 28, 29, -1, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, 49, -1, -1, 52, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, 63, 64, -1, -1, -1, 68, 69, 70, 71, 72, -1, -1, -1, -1, -1, -1, 79, -1, 81, 82, -1, -1, -1, -1, -1, 88, -1, 90, -1, -1, -1, -1, 95, 96, 97, 98, 99 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 15, 16, 122, 123, 124, 239, 0, 124, 125, 108, 126, 127, 9, 10, 109, 128, 129, 242, 39, 109, 129, 110, 16, 25, 46, 48, 57, 130, 131, 132, 10, 62, 89, 89, 58, 89, 3, 132, 111, 26, 47, 133, 134, 146, 147, 22, 112, 148, 149, 239, 242, 44, 59, 138, 139, 112, 112, 113, 108, 51, 140, 141, 143, 144, 145, 239, 242, 28, 43, 53, 54, 55, 64, 69, 71, 79, 88, 90, 95, 97, 98, 99, 135, 136, 151, 153, 183, 193, 239, 242, 149, 109, 112, 143, 51, 113, 108, 16, 136, 3, 15, 16, 27, 29, 31, 41, 45, 49, 52, 63, 68, 70, 72, 81, 82, 96, 108, 152, 177, 190, 191, 192, 193, 240, 115, 173, 234, 235, 236, 239, 145, 109, 137, 33, 163, 173, 118, 86, 86, 76, 56, 86, 154, 155, 190, 191, 239, 3, 108, 108, 229, 118, 24, 80, 94, 237, 3, 174, 175, 46, 57, 238, 127, 142, 108, 239, 242, 109, 113, 114, 114, 108, 150, 6, 7, 8, 10, 11, 13, 14, 50, 91, 150, 156, 157, 173, 186, 188, 232, 242, 107, 109, 230, 231, 232, 242, 17, 18, 178, 179, 180, 239, 10, 68, 108, 184, 186, 187, 239, 242, 23, 32, 61, 83, 84, 152, 176, 85, 110, 196, 197, 198, 199, 17, 18, 165, 166, 3, 155, 239, 242, 239, 242, 6, 8, 12, 22, 36, 37, 50, 51, 66, 75, 85, 91, 100, 107, 108, 110, 188, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 216, 217, 219, 221, 222, 223, 232, 233, 239, 242, 109, 113, 109, 113, 110, 118, 116, 185, 118, 114, 40, 108, 73, 108, 196, 108, 196, 110, 200, 110, 16, 17, 38, 74, 173, 181, 182, 227, 228, 173, 181, 182, 109, 113, 163, 173, 101, 30, 173, 106, 119, 220, 7, 242, 34, 35, 239, 200, 109, 113, 104, 105, 194, 102, 103, 195, 101, 110, 220, 108, 157, 231, 187, 232, 242, 179, 5, 189, 242, 184, 30, 107, 161, 162, 172, 173, 242, 177, 35, 158, 159, 160, 172, 173, 242, 73, 158, 73, 200, 111, 200, 184, 227, 118, 227, 227, 93, 164, 227, 227, 100, 167, 168, 166, 205, 108, 119, 106, 65, 208, 199, 108, 109, 111, 107, 203, 204, 205, 200, 65, 208, 120, 224, 225, 111, 111, 5, 242, 117, 109, 113, 173, 73, 109, 113, 227, 173, 241, 242, 109, 241, 111, 111, 17, 18, 227, 87, 218, 119, 107, 212, 213, 242, 113, 111, 118, 226, 242, 109, 113, 187, 232, 162, 173, 160, 227, 234, 234, 108, 189, 109, 113, 196, 201, 226, 118, 225, 175, 175, 169, 213, 20, 74, 78, 214, 215, 242, 4, 19, 115, 170, 171, 180, 170, 109, 171, 116 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.first_line = Rhs[1].first_line; \ Current.first_column = Rhs[1].first_column; \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #define YYLEX yylex () /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YYDSYMPRINT(Args) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #if YYDEBUG /*-----------------------------. | Print this symbol on YYOUT. | `-----------------------------*/ static void #if defined (__STDC__) || defined (__cplusplus) yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue) #else yysymprint (yyout, yytype, yyvalue) FILE* yyout; int yytype; YYSTYPE yyvalue; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvalue; if (yytype < YYNTOKENS) { YYFPRINTF (yyout, "token %s (", yytname[yytype]); # ifdef YYPRINT YYPRINT (yyout, yytoknum[yytype], yyvalue); # endif } else YYFPRINTF (yyout, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyout, ")"); } #endif /* YYDEBUG. */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void #if defined (__STDC__) || defined (__cplusplus) yydestruct (int yytype, YYSTYPE yyvalue) #else yydestruct (yytype, yyvalue) int yytype; YYSTYPE yyvalue; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvalue; switch (yytype) { default: break; } } /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM # define YYPARSE_PARAM_DECL # else # define YYPARSE_PARAM_ARG YYPARSE_PARAM # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif #else /* !YYPARSE_PARAM */ # define YYPARSE_PARAM_ARG # define YYPARSE_PARAM_DECL #endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ # ifdef YYPARSE_PARAM int yyparse (void *); # else int yyparse (void); # endif #endif /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of parse errors so far. */ int yynerrs; int yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yychar1 = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyssp >= yyss + yystacksize - 1) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with. */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more. */ YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yychar1 = YYTRANSLATE (yychar); /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ YYDPRINTF ((stderr, "Next token is ")); YYDSYMPRINT ((stderr, yychar1, yylval)); YYDPRINTF ((stderr, "\n")); } /* If the proper action on seeing token YYCHAR1 is to reduce or to detect an error, take that action. */ yyn += yychar1; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { int yyi; YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", yyn - 1, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++) YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 2: #line 356 "asn1p_y.y" { *(void **)param = yyvsp[0].a_grammar; } break; case 3: #line 362 "asn1p_y.y" { yyval.a_grammar = asn1p_new(); checkmem(yyval.a_grammar); TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next); } break; case 4: #line 367 "asn1p_y.y" { yyval.a_grammar = yyvsp[-1].a_grammar; TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next); } break; case 5: #line 384 "asn1p_y.y" { currentModule = asn1p_module_new(); } break; case 6: #line 389 "asn1p_y.y" { yyval.a_module = currentModule; if(yyvsp[-1].a_module) { asn1p_module_t tmp = *(yyval.a_module); *(yyval.a_module) = *(yyvsp[-1].a_module); *(yyvsp[-1].a_module) = tmp; asn1p_module_free(yyvsp[-1].a_module); } else { /* There's a chance that a module is just plain empty */ } yyval.a_module->ModuleName = yyvsp[-8].tv_str; yyval.a_module->module_oid = yyvsp[-6].a_oid; yyval.a_module->module_flags = yyvsp[-4].a_module_flags; } break; case 7: #line 413 "asn1p_y.y" { yyval.a_oid = 0; } break; case 8: #line 414 "asn1p_y.y" { yyval.a_oid = yyvsp[0].a_oid; } break; case 9: #line 418 "asn1p_y.y" { yyval.a_oid = yyvsp[-1].a_oid; } break; case 10: #line 421 "asn1p_y.y" { yyval.a_oid = 0; } break; case 11: #line 427 "asn1p_y.y" { yyval.a_oid = asn1p_oid_new(); asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc); if(yyvsp[0].a_oid_arc.name) free(yyvsp[0].a_oid_arc.name); } break; case 12: #line 433 "asn1p_y.y" { yyval.a_oid = yyvsp[-1].a_oid; asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc); if(yyvsp[0].a_oid_arc.name) free(yyvsp[0].a_oid_arc.name); } break; case 13: #line 442 "asn1p_y.y" { /* iso */ yyval.a_oid_arc.name = yyvsp[0].tv_str; yyval.a_oid_arc.number = -1; } break; case 14: #line 446 "asn1p_y.y" { /* iso(1) */ yyval.a_oid_arc.name = yyvsp[-3].tv_str; yyval.a_oid_arc.number = yyvsp[-1].a_int; } break; case 15: #line 450 "asn1p_y.y" { /* 1 */ yyval.a_oid_arc.name = 0; yyval.a_oid_arc.number = yyvsp[0].a_int; } break; case 16: #line 460 "asn1p_y.y" { yyval.a_module_flags = MSF_NOFLAGS; } break; case 17: #line 461 "asn1p_y.y" { yyval.a_module_flags = yyvsp[0].a_module_flags; } break; case 18: #line 470 "asn1p_y.y" { yyval.a_module_flags = yyvsp[0].a_module_flags; } break; case 19: #line 473 "asn1p_y.y" { yyval.a_module_flags = yyvsp[-1].a_module_flags | yyvsp[0].a_module_flags; } break; case 20: #line 482 "asn1p_y.y" { yyval.a_module_flags = MSF_EXPLICIT_TAGS; } break; case 21: #line 485 "asn1p_y.y" { yyval.a_module_flags = MSF_IMPLICIT_TAGS; } break; case 22: #line 488 "asn1p_y.y" { yyval.a_module_flags = MSF_AUTOMATIC_TAGS; } break; case 23: #line 491 "asn1p_y.y" { yyval.a_module_flags = MSF_EXTENSIBILITY_IMPLIED; } break; case 24: #line 495 "asn1p_y.y" { /* X.680Amd1 specifies TAG and XER */ if(strcmp(yyvsp[-1].tv_str, "TAG") == 0) { yyval.a_module_flags = MSF_TAG_INSTRUCTIONS; } else if(strcmp(yyvsp[-1].tv_str, "XER") == 0) { yyval.a_module_flags = MSF_XER_INSTRUCTIONS; } else { fprintf(stderr, "WARNING: %s INSTRUCTIONS at line %d: " "Unrecognized encoding reference\n", yyvsp[-1].tv_str, yylineno); yyval.a_module_flags = MSF_unk_INSTRUCTIONS; } free(yyvsp[-1].tv_str); } break; case 25: #line 516 "asn1p_y.y" { yyval.a_module = 0; } break; case 26: #line 517 "asn1p_y.y" { yyval.a_module = yyvsp[0].a_module; } break; case 27: #line 526 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); AL_IMPORT(yyval.a_module, exports, yyvsp[-2].a_module, xp_next); AL_IMPORT(yyval.a_module, imports, yyvsp[-1].a_module, xp_next); AL_IMPORT(yyval.a_module, members, yyvsp[0].a_module, next); } break; case 28: #line 535 "asn1p_y.y" { yyval.a_module = yyvsp[0].a_module; } break; case 29: #line 538 "asn1p_y.y" { if(yyvsp[-1].a_module) { yyval.a_module = yyvsp[-1].a_module; } else { yyval.a_module = yyvsp[0].a_module; break; } AL_IMPORT(yyval.a_module, members, yyvsp[0].a_module, next); } break; case 30: #line 554 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); checkmem(yyval.a_module); assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID); assert(yyvsp[0].a_expr->meta_type != AMT_INVALID); TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next); } break; case 31: #line 561 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); checkmem(yyval.a_module); assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID); assert(yyvsp[0].a_expr->meta_type != AMT_INVALID); TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next); } break; case 32: #line 574 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); checkmem(yyval.a_module); assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID); assert(yyvsp[0].a_expr->meta_type != AMT_INVALID); TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next); } break; case 33: #line 582 "asn1p_y.y" { asn1p_lexer_hack_push_encoding_control(); } break; case 34: #line 583 "asn1p_y.y" { fprintf(stderr, "WARNING: ENCODING-CONTROL %s " "specification at line %d ignored\n", yyvsp[-1].tv_str, yylineno); free(yyvsp[-1].tv_str); yyval.a_module = 0; } break; case 35: #line 595 "asn1p_y.y" { return yyerror( "Attempt to redefine a standard basic string type, " "please comment out or remove this type redefinition."); } break; case 36: #line 608 "asn1p_y.y" { yyval.a_module = 0; } break; case 38: #line 612 "asn1p_y.y" { if(!saved_aid && 0) return yyerror("Unterminated IMPORTS FROM, " "expected semicolon ';'"); saved_aid = 0; yyval.a_module = yyvsp[-1].a_module; } break; case 39: #line 622 "asn1p_y.y" { return yyerror("Empty IMPORTS list"); } break; case 40: #line 628 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); } break; case 42: #line 632 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); checkmem(yyval.a_module); TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next); } break; case 43: #line 637 "asn1p_y.y" { yyval.a_module = yyvsp[-1].a_module; TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next); } break; case 44: #line 644 "asn1p_y.y" { memset(&yyval.a_aid, 0, sizeof(yyval.a_aid)); } break; case 45: #line 645 "asn1p_y.y" { yyval.a_aid.oid = yyvsp[0].a_oid; } break; case 46: #line 649 "asn1p_y.y" { yyval.a_xports = yyvsp[-3].a_xports; yyval.a_xports->fromModuleName = yyvsp[-1].tv_str; yyval.a_xports->identifier = yyvsp[0].a_aid; /* This stupid thing is used for look-back hack. */ saved_aid = yyval.a_xports->identifier.oid ? 0 : &(yyval.a_xports->identifier); checkmem(yyval.a_xports); } break; case 47: #line 660 "asn1p_y.y" { yyval.a_xports = asn1p_xports_new(); checkmem(yyval.a_xports); TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); } break; case 48: #line 665 "asn1p_y.y" { yyval.a_xports = yyvsp[-2].a_xports; TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); } break; case 49: #line 672 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[0].tv_str; yyval.a_expr->expr_type = A1TC_REFERENCE; } break; case 50: #line 678 "asn1p_y.y" { /* Completely equivalent to above */ yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[-2].tv_str; yyval.a_expr->expr_type = A1TC_REFERENCE; } break; case 51: #line 684 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[0].tv_str; yyval.a_expr->expr_type = A1TC_REFERENCE; } break; case 52: #line 694 "asn1p_y.y" { yyval.a_module = 0; } break; case 53: #line 695 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); checkmem(yyval.a_module); if(yyvsp[0].a_xports) { TQ_ADD(&(yyval.a_module->exports), yyvsp[0].a_xports, xp_next); } else { /* "EXPORTS ALL;" */ } } break; case 54: #line 707 "asn1p_y.y" { yyval.a_xports = yyvsp[-1].a_xports; } break; case 55: #line 710 "asn1p_y.y" { yyval.a_xports = 0; } break; case 56: #line 713 "asn1p_y.y" { /* Empty EXPORTS clause effectively prohibits export. */ yyval.a_xports = asn1p_xports_new(); checkmem(yyval.a_xports); } break; case 57: #line 721 "asn1p_y.y" { yyval.a_xports = asn1p_xports_new(); assert(yyval.a_xports); TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); } break; case 58: #line 726 "asn1p_y.y" { yyval.a_xports = yyvsp[-2].a_xports; TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); } break; case 59: #line 733 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[0].tv_str; yyval.a_expr->expr_type = A1TC_EXPORTVAR; } break; case 60: #line 739 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[-2].tv_str; yyval.a_expr->expr_type = A1TC_EXPORTVAR; } break; case 61: #line 745 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[0].tv_str; yyval.a_expr->expr_type = A1TC_EXPORTVAR; } break; case 62: #line 754 "asn1p_y.y" { yyval.a_constr = yyvsp[-1].a_constr; } break; case 63: #line 757 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; assert(yyval.a_expr->Identifier == 0); yyval.a_expr->Identifier = yyvsp[-3].tv_str; yyval.a_expr->meta_type = AMT_VALUESET; yyval.a_expr->constraints = yyvsp[0].a_constr; } break; case 64: #line 767 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; } break; case 65: #line 780 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->reference = yyvsp[0].a_ref; yyval.a_expr->expr_type = A1TC_REFERENCE; yyval.a_expr->meta_type = AMT_TYPEREF; } break; case 66: #line 790 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->reference = yyvsp[-3].a_ref; yyval.a_expr->rhs_pspecs = yyvsp[-1].a_expr; yyval.a_expr->expr_type = A1TC_REFERENCE; yyval.a_expr->meta_type = AMT_TYPEREF; } break; case 67: #line 810 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; yyval.a_expr->Identifier = yyvsp[-2].tv_str; assert(yyval.a_expr->expr_type); assert(yyval.a_expr->meta_type); } break; case 68: #line 816 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; yyval.a_expr->Identifier = yyvsp[-2].tv_str; assert(yyval.a_expr->expr_type == A1TC_CLASSDEF); assert(yyval.a_expr->meta_type == AMT_OBJECTCLASS); } break; case 69: #line 832 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; yyval.a_expr->Identifier = yyvsp[-5].tv_str; yyval.a_expr->lhs_params = yyvsp[-3].a_plist; } break; case 70: #line 838 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; yyval.a_expr->Identifier = yyvsp[-5].tv_str; yyval.a_expr->lhs_params = yyvsp[-3].a_plist; } break; case 71: #line 846 "asn1p_y.y" { int ret; yyval.a_plist = asn1p_paramlist_new(yylineno); checkmem(yyval.a_plist); ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument); checkmem(ret == 0); if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor); if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument); } break; case 72: #line 855 "asn1p_y.y" { int ret; yyval.a_plist = yyvsp[-2].a_plist; ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument); checkmem(ret == 0); if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor); if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument); } break; case 73: #line 866 "asn1p_y.y" { yyval.a_parg.governor = NULL; yyval.a_parg.argument = yyvsp[0].tv_str; } break; case 74: #line 870 "asn1p_y.y" { int ret; yyval.a_parg.governor = asn1p_ref_new(yylineno); ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0); checkmem(ret == 0); yyval.a_parg.argument = yyvsp[0].tv_str; } break; case 75: #line 877 "asn1p_y.y" { int ret; yyval.a_parg.governor = asn1p_ref_new(yylineno); ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0); checkmem(ret == 0); yyval.a_parg.argument = yyvsp[0].tv_str; } break; case 76: #line 884 "asn1p_y.y" { int ret; yyval.a_parg.governor = asn1p_ref_new(yylineno); ret = asn1p_ref_add_component(yyval.a_parg.governor, ASN_EXPR_TYPE2STR(yyvsp[-2].a_type), 1); checkmem(ret == 0); yyval.a_parg.argument = yyvsp[0].tv_str; } break; case 77: #line 892 "asn1p_y.y" { int ret; yyval.a_parg.governor = asn1p_ref_new(yylineno); ret = asn1p_ref_add_component(yyval.a_parg.governor, ASN_EXPR_TYPE2STR(yyvsp[-2].a_type), 1); checkmem(ret == 0); yyval.a_parg.argument = yyvsp[0].tv_str; } break; case 78: #line 903 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 79: #line 908 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 80: #line 915 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; } break; case 81: #line 918 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = "?"; yyval.a_expr->expr_type = A1TC_REFERENCE; yyval.a_expr->meta_type = AMT_VALUE; yyval.a_expr->value = yyvsp[0].a_value; } break; case 82: #line 926 "asn1p_y.y" { asn1p_ref_t *ref; yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[0].tv_str; yyval.a_expr->expr_type = A1TC_REFERENCE; yyval.a_expr->meta_type = AMT_VALUE; ref = asn1p_ref_new(yylineno); asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); yyval.a_expr->value = asn1p_value_fromref(ref, 0); } break; case 83: #line 937 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); yyval.a_expr->expr_type = A1TC_VALUESET; yyval.a_expr->meta_type = AMT_VALUESET; yyval.a_expr->constraints = yyvsp[0].a_constr; } break; case 84: #line 960 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); } break; case 85: #line 961 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; } break; case 86: #line 964 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 87: #line 969 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 88: #line 976 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; assert(yyval.a_expr->Identifier == 0); yyval.a_expr->Identifier = yyvsp[-2].tv_str; yyvsp[0].a_marker.flags |= yyval.a_expr->marker.flags; yyval.a_expr->marker = yyvsp[0].a_marker; } break; case 89: #line 983 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; yyvsp[0].a_marker.flags |= yyval.a_expr->marker.flags; yyval.a_expr->marker = yyvsp[0].a_marker; _fixup_anonymous_identifier(yyval.a_expr); } break; case 90: #line 989 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->meta_type = yyvsp[0].a_expr->meta_type; yyval.a_expr->expr_type = A1TC_COMPONENTS_OF; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 91: #line 996 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; } break; case 92: #line 1002 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 93: #line 1007 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 94: #line 1014 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; assert(yyval.a_expr->Identifier == 0); yyval.a_expr->Identifier = yyvsp[-1].tv_str; } break; case 95: #line 1019 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; } break; case 96: #line 1022 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; _fixup_anonymous_identifier(yyval.a_expr); } break; case 97: #line 1029 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; checkmem(yyval.a_expr); yyval.a_expr->with_syntax = yyvsp[0].a_wsynt; assert(yyval.a_expr->expr_type == A1TC_CLASSDEF); assert(yyval.a_expr->meta_type == AMT_OBJECTCLASS); } break; case 98: #line 1039 "asn1p_y.y" { yyval.a_int = 0; } break; case 99: #line 1040 "asn1p_y.y" { yyval.a_int = 1; } break; case 100: #line 1044 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->expr_type = A1TC_CLASSDEF; yyval.a_expr->meta_type = AMT_OBJECTCLASS; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 101: #line 1051 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 102: #line 1061 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[-1].tv_str; yyval.a_expr->meta_type = AMT_OBJECTFIELD; yyval.a_expr->expr_type = A1TC_CLASSFIELD_TFS; /* TypeFieldSpec */ yyval.a_expr->marker = yyvsp[0].a_marker; } break; case 103: #line 1071 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); yyval.a_expr->Identifier = yyvsp[-3].tv_str; yyval.a_expr->meta_type = AMT_OBJECTFIELD; yyval.a_expr->expr_type = A1TC_CLASSFIELD_FTVFS; /* FixedTypeValueFieldSpec */ yyval.a_expr->unique = yyvsp[-1].a_int; yyval.a_expr->marker = yyvsp[0].a_marker; asn1p_expr_add(yyval.a_expr, yyvsp[-2].a_expr); } break; case 104: #line 1082 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); yyval.a_expr->Identifier = yyvsp[-2].tv_str; yyval.a_expr->meta_type = AMT_OBJECTFIELD; yyval.a_expr->expr_type = A1TC_CLASSFIELD_VTVFS; yyval.a_expr->reference = yyvsp[-1].a_ref; yyval.a_expr->marker = yyvsp[0].a_marker; } break; case 105: #line 1092 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[-2].tv_str; yyval.a_expr->reference = yyvsp[-1].a_ref; yyval.a_expr->meta_type = AMT_OBJECTFIELD; yyval.a_expr->expr_type = A1TC_CLASSFIELD_OFS; yyval.a_expr->marker = yyvsp[0].a_marker; } break; case 106: #line 1103 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); yyval.a_expr->Identifier = yyvsp[-2].tv_str; yyval.a_expr->meta_type = AMT_OBJECTFIELD; yyval.a_expr->expr_type = A1TC_CLASSFIELD_VTVSFS; yyval.a_expr->reference = yyvsp[-1].a_ref; yyval.a_expr->marker = yyvsp[0].a_marker; } break; case 107: #line 1113 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[-2].tv_str; yyval.a_expr->meta_type = AMT_OBJECTFIELD; yyval.a_expr->expr_type = A1TC_CLASSFIELD_FTVSFS; asn1p_expr_add(yyval.a_expr, yyvsp[-1].a_expr); yyval.a_expr->marker = yyvsp[0].a_marker; } break; case 108: #line 1124 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = yyvsp[-2].tv_str; yyval.a_expr->reference = yyvsp[-1].a_ref; yyval.a_expr->meta_type = AMT_OBJECTFIELD; yyval.a_expr->expr_type = A1TC_CLASSFIELD_OSFS; yyval.a_expr->marker = yyvsp[0].a_marker; } break; case 109: #line 1136 "asn1p_y.y" { yyval.a_wsynt = 0; } break; case 110: #line 1137 "asn1p_y.y" { yyval.a_wsynt = yyvsp[0].a_wsynt; } break; case 111: #line 1144 "asn1p_y.y" { asn1p_lexer_hack_enable_with_syntax(); } break; case 112: #line 1146 "asn1p_y.y" { yyval.a_wsynt = yyvsp[-1].a_wsynt; } break; case 113: #line 1152 "asn1p_y.y" { yyval.a_wsynt = asn1p_wsyntx_new(); TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next); } break; case 114: #line 1156 "asn1p_y.y" { yyval.a_wsynt = yyvsp[-1].a_wsynt; TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next); } break; case 115: #line 1163 "asn1p_y.y" { yyval.a_wchunk = asn1p_wsyntx_chunk_fromstring(yyvsp[0].tv_opaque.buf, 0); yyval.a_wchunk->type = WC_WHITESPACE; } break; case 116: #line 1167 "asn1p_y.y" { yyval.a_wchunk = asn1p_wsyntx_chunk_fromstring(yyvsp[0].tv_str, 0); } break; case 117: #line 1170 "asn1p_y.y" { yyval.a_wchunk = asn1p_wsyntx_chunk_fromstring(yyvsp[0].a_refcomp.name, 0); yyval.a_wchunk->type = WC_FIELD; } break; case 118: #line 1174 "asn1p_y.y" { yyval.a_wchunk = asn1p_wsyntx_chunk_fromsyntax(yyvsp[-1].a_wsynt); } break; case 119: #line 1180 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = strdup("..."); checkmem(yyval.a_expr->Identifier); yyval.a_expr->expr_type = A1TC_EXTENSIBLE; yyval.a_expr->meta_type = AMT_TYPE; } break; case 120: #line 1188 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = strdup("..."); checkmem(yyval.a_expr->Identifier); yyval.a_expr->value = yyvsp[0].a_value; yyval.a_expr->expr_type = A1TC_EXTENSIBLE; yyval.a_expr->meta_type = AMT_TYPE; } break; case 121: #line 1197 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = strdup("..."); yyval.a_expr->value = yyvsp[0].a_value; checkmem(yyval.a_expr->Identifier); yyval.a_expr->expr_type = A1TC_EXTENSIBLE; yyval.a_expr->meta_type = AMT_TYPE; } break; case 122: #line 1209 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; yyval.a_expr->tag = yyvsp[-2].a_tag; /* * Outer constraint for SEQUENCE OF and SET OF applies * to the inner type. */ if(yyval.a_expr->expr_type == ASN_CONSTR_SEQUENCE_OF || yyval.a_expr->expr_type == ASN_CONSTR_SET_OF) { assert(!TQ_FIRST(&(yyval.a_expr->members))->constraints); TQ_FIRST(&(yyval.a_expr->members))->constraints = yyvsp[0].a_constr; } else { if(yyval.a_expr->constraints) { assert(!yyvsp[-1].a_expr); } else { yyval.a_expr->constraints = yyvsp[0].a_constr; } } } break; case 123: #line 1231 "asn1p_y.y" { yyval.a_int = asn1p_as_pointer ? EM_INDIRECT : 0; asn1p_as_pointer = 0; } break; case 124: #line 1238 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; yyval.a_expr->marker.flags |= yyvsp[-1].a_int; if((yyval.a_expr->marker.flags & EM_INDIRECT) && (yyval.a_expr->marker.flags & EM_OPTIONAL) != EM_OPTIONAL) { fprintf(stderr, "INFO: Directive " "applied to %s at line %d\n", ASN_EXPR_TYPE2STR(yyval.a_expr->expr_type) ? ASN_EXPR_TYPE2STR(yyval.a_expr->expr_type) : "member", yyval.a_expr->_lineno ); } } break; case 125: #line 1257 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; } break; case 126: #line 1260 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; assert(yyval.a_expr->expr_type == A1TC_INVALID); yyval.a_expr->expr_type = ASN_CONSTR_CHOICE; yyval.a_expr->meta_type = AMT_TYPE; } break; case 127: #line 1266 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; assert(yyval.a_expr->expr_type == A1TC_INVALID); yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE; yyval.a_expr->meta_type = AMT_TYPE; } break; case 128: #line 1272 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; assert(yyval.a_expr->expr_type == A1TC_INVALID); yyval.a_expr->expr_type = ASN_CONSTR_SET; yyval.a_expr->meta_type = AMT_TYPE; } break; case 129: #line 1278 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->constraints = yyvsp[-4].a_constr; yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE_OF; yyval.a_expr->meta_type = AMT_TYPE; yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str; yyvsp[0].a_expr->tag = yyvsp[-1].a_tag; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 130: #line 1288 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->constraints = yyvsp[-4].a_constr; yyval.a_expr->expr_type = ASN_CONSTR_SET_OF; yyval.a_expr->meta_type = AMT_TYPE; yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str; yyvsp[0].a_expr->tag = yyvsp[-1].a_tag; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 131: #line 1298 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->expr_type = ASN_TYPE_ANY; yyval.a_expr->meta_type = AMT_TYPE; } break; case 132: #line 1304 "asn1p_y.y" { int ret; yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->reference = asn1p_ref_new(yylineno); ret = asn1p_ref_add_component(yyval.a_expr->reference, yyvsp[0].tv_str, RLT_lowercase); checkmem(ret == 0); yyval.a_expr->expr_type = ASN_TYPE_ANY; yyval.a_expr->meta_type = AMT_TYPE; } break; case 133: #line 1315 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->reference = yyvsp[0].a_ref; yyval.a_expr->expr_type = A1TC_INSTANCE; yyval.a_expr->meta_type = AMT_TYPE; } break; case 134: #line 1330 "asn1p_y.y" { int ret; yyval.a_ref = asn1p_ref_new(yylineno); checkmem(yyval.a_ref); ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN); checkmem(ret == 0); free(yyvsp[0].tv_str); } break; case 135: #line 1338 "asn1p_y.y" { int ret; yyval.a_ref = asn1p_ref_new(yylineno); checkmem(yyval.a_ref); ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN); checkmem(ret == 0); ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN); checkmem(ret == 0); free(yyvsp[-2].tv_str); } break; case 136: #line 1348 "asn1p_y.y" { int ret; yyval.a_ref = asn1p_ref_new(yylineno); checkmem(yyval.a_ref); ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN); checkmem(ret == 0); ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN); checkmem(ret == 0); free(yyvsp[-2].tv_str); } break; case 137: #line 1358 "asn1p_y.y" { int ret; yyval.a_ref = asn1p_ref_new(yylineno); checkmem(yyval.a_ref); ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN); checkmem(ret == 0); ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_lowercase); checkmem(ret == 0); free(yyvsp[-2].tv_str); } break; case 138: #line 1368 "asn1p_y.y" { int ret; yyval.a_ref = asn1p_ref_new(yylineno); checkmem(yyval.a_ref); ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS); free(yyvsp[0].tv_str); checkmem(ret == 0); } break; case 139: #line 1376 "asn1p_y.y" { int ret; yyval.a_ref = yyvsp[0].a_ref; ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_CAPITALS); free(yyvsp[-2].tv_str); checkmem(ret == 0); /* * Move the last element infront. */ { struct asn1p_ref_component_s tmp_comp; tmp_comp = yyval.a_ref->components[yyval.a_ref->comp_count-1]; memmove(&yyval.a_ref->components[1], &yyval.a_ref->components[0], sizeof(yyval.a_ref->components[0]) * (yyval.a_ref->comp_count - 1)); yyval.a_ref->components[0] = tmp_comp; } } break; case 140: #line 1398 "asn1p_y.y" { int ret; yyval.a_ref = asn1p_ref_new(yylineno); checkmem(yyval.a_ref); ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type); free(yyvsp[0].a_refcomp.name); checkmem(ret == 0); } break; case 141: #line 1406 "asn1p_y.y" { int ret; yyval.a_ref = yyvsp[-2].a_ref; ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type); free(yyvsp[0].a_refcomp.name); checkmem(ret == 0); } break; case 143: #line 1419 "asn1p_y.y" { yyval.a_refcomp.lex_type = RLT_AmpUppercase; yyval.a_refcomp.name = yyvsp[0].tv_str; } break; case 144: #line 1424 "asn1p_y.y" { yyval.a_refcomp.lex_type = RLT_Amplowercase; yyval.a_refcomp.name = yyvsp[0].tv_str; } break; case 145: #line 1433 "asn1p_y.y" { yyval.a_ref = asn1p_ref_new(yylineno); asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_AmpUppercase); } break; case 146: #line 1437 "asn1p_y.y" { yyval.a_ref = yyval.a_ref; asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_AmpUppercase); } break; case 147: #line 1441 "asn1p_y.y" { yyval.a_ref = yyval.a_ref; asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_Amplowercase); } break; case 148: #line 1448 "asn1p_y.y" { yyval.a_ref = asn1p_ref_new(yylineno); asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS); } break; case 149: #line 1468 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; assert(yyval.a_expr->Identifier == NULL); yyval.a_expr->Identifier = yyvsp[-3].tv_str; yyval.a_expr->meta_type = AMT_VALUE; yyval.a_expr->value = yyvsp[0].a_value; } break; case 152: #line 1480 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(0); checkmem(yyval.a_value); yyval.a_value->type = ATV_CHOICE_IDENTIFIER; yyval.a_value->value.choice_identifier.identifier = yyvsp[-2].tv_str; yyval.a_value->value.choice_identifier.value = yyvsp[0].a_value; } break; case 153: #line 1487 "asn1p_y.y" { asn1p_lexer_hack_push_opaque_state(); } break; case 154: #line 1487 "asn1p_y.y" { yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); checkmem(yyval.a_value); yyval.a_value->type = ATV_UNPARSED; } break; case 155: #line 1492 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(0); checkmem(yyval.a_value); yyval.a_value->type = ATV_NULL; } break; case 156: #line 1500 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(0); checkmem(yyval.a_value); yyval.a_value->type = ATV_FALSE; } break; case 157: #line 1505 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(0); checkmem(yyval.a_value); yyval.a_value->type = ATV_TRUE; } break; case 158: #line 1510 "asn1p_y.y" { yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B'); checkmem(yyval.a_value); } break; case 159: #line 1514 "asn1p_y.y" { yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H'); checkmem(yyval.a_value); } break; case 160: #line 1518 "asn1p_y.y" { yyval.a_value = yyval.a_value; } break; case 161: #line 1521 "asn1p_y.y" { yyval.a_value = yyvsp[0].a_value; } break; case 162: #line 1527 "asn1p_y.y" { asn1p_ref_t *ref; int ret; ref = asn1p_ref_new(yylineno); checkmem(ref); ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); checkmem(ret == 0); yyval.a_value = asn1p_value_fromref(ref, 0); checkmem(yyval.a_value); free(yyvsp[0].tv_str); } break; case 163: #line 1538 "asn1p_y.y" { asn1p_ref_t *ref; int ret; ref = asn1p_ref_new(yylineno); checkmem(ref); ret = asn1p_ref_add_component(ref, yyvsp[-2].tv_str, RLT_UNKNOWN); checkmem(ret == 0); ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); checkmem(ret == 0); yyval.a_value = asn1p_value_fromref(ref, 0); checkmem(yyval.a_value); free(yyvsp[-2].tv_str); free(yyvsp[0].tv_str); } break; case 164: #line 1556 "asn1p_y.y" { yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); checkmem(yyval.a_value); } break; case 165: #line 1560 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); checkmem(yyval.a_value); yyval.a_value->type = ATV_TUPLE; } break; case 166: #line 1565 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); checkmem(yyval.a_value); yyval.a_value->type = ATV_QUADRUPLE; } break; case 167: #line 1573 "asn1p_y.y" { yyval.tv_opaque.len = yyvsp[0].tv_opaque.len + 1; yyval.tv_opaque.buf = malloc(yyval.tv_opaque.len + 1); checkmem(yyval.tv_opaque.buf); yyval.tv_opaque.buf[0] = '{'; memcpy(yyval.tv_opaque.buf + 1, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len); yyval.tv_opaque.buf[yyval.tv_opaque.len] = '\0'; free(yyvsp[0].tv_opaque.buf); } break; case 168: #line 1582 "asn1p_y.y" { int newsize = yyvsp[-1].tv_opaque.len + yyvsp[0].tv_opaque.len; char *p = malloc(newsize + 1); checkmem(p); memcpy(p , yyvsp[-1].tv_opaque.buf, yyvsp[-1].tv_opaque.len); memcpy(p + yyvsp[-1].tv_opaque.len, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len); p[newsize] = '\0'; free(yyvsp[-1].tv_opaque.buf); free(yyvsp[0].tv_opaque.buf); yyval.tv_opaque.buf = p; yyval.tv_opaque.len = newsize; } break; case 169: #line 1597 "asn1p_y.y" { yyval.a_type = ASN_BASIC_BOOLEAN; } break; case 170: #line 1598 "asn1p_y.y" { yyval.a_type = ASN_BASIC_NULL; } break; case 171: #line 1599 "asn1p_y.y" { yyval.a_type = ASN_BASIC_REAL; } break; case 172: #line 1600 "asn1p_y.y" { yyval.a_type = yyvsp[0].a_type; } break; case 173: #line 1601 "asn1p_y.y" { yyval.a_type = ASN_BASIC_OCTET_STRING; } break; case 174: #line 1602 "asn1p_y.y" { yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; } break; case 175: #line 1603 "asn1p_y.y" { yyval.a_type = ASN_BASIC_RELATIVE_OID; } break; case 176: #line 1604 "asn1p_y.y" { yyval.a_type = ASN_BASIC_EXTERNAL; } break; case 177: #line 1605 "asn1p_y.y" { yyval.a_type = ASN_BASIC_EMBEDDED_PDV; } break; case 178: #line 1606 "asn1p_y.y" { yyval.a_type = ASN_BASIC_CHARACTER_STRING; } break; case 179: #line 1607 "asn1p_y.y" { yyval.a_type = ASN_BASIC_UTCTime; } break; case 180: #line 1608 "asn1p_y.y" { yyval.a_type = ASN_BASIC_GeneralizedTime; } break; case 181: #line 1609 "asn1p_y.y" { yyval.a_type = yyvsp[0].a_type; } break; case 182: #line 1616 "asn1p_y.y" { yyval.a_type = ASN_BASIC_INTEGER; } break; case 183: #line 1617 "asn1p_y.y" { yyval.a_type = ASN_BASIC_ENUMERATED; } break; case 184: #line 1618 "asn1p_y.y" { yyval.a_type = ASN_BASIC_BIT_STRING; } break; case 185: #line 1622 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->expr_type = yyvsp[0].a_type; yyval.a_expr->meta_type = AMT_TYPE; } break; case 186: #line 1628 "asn1p_y.y" { if(yyvsp[0].a_expr) { yyval.a_expr = yyvsp[0].a_expr; } else { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); } yyval.a_expr->expr_type = yyvsp[-1].a_type; yyval.a_expr->meta_type = AMT_TYPE; } break; case 187: #line 1641 "asn1p_y.y" { yyval.a_type = ASN_STRING_BMPString; } break; case 188: #line 1642 "asn1p_y.y" { yyval.a_type = ASN_STRING_GeneralString; fprintf(stderr, "WARNING: GeneralString is not fully supported\n"); } break; case 189: #line 1646 "asn1p_y.y" { yyval.a_type = ASN_STRING_GraphicString; fprintf(stderr, "WARNING: GraphicString is not fully supported\n"); } break; case 190: #line 1650 "asn1p_y.y" { yyval.a_type = ASN_STRING_IA5String; } break; case 191: #line 1651 "asn1p_y.y" { yyval.a_type = ASN_STRING_ISO646String; } break; case 192: #line 1652 "asn1p_y.y" { yyval.a_type = ASN_STRING_NumericString; } break; case 193: #line 1653 "asn1p_y.y" { yyval.a_type = ASN_STRING_PrintableString; } break; case 194: #line 1654 "asn1p_y.y" { yyval.a_type = ASN_STRING_T61String; fprintf(stderr, "WARNING: T61String is not fully supported\n"); } break; case 195: #line 1658 "asn1p_y.y" { yyval.a_type = ASN_STRING_TeletexString; } break; case 196: #line 1659 "asn1p_y.y" { yyval.a_type = ASN_STRING_UniversalString; } break; case 197: #line 1660 "asn1p_y.y" { yyval.a_type = ASN_STRING_UTF8String; } break; case 198: #line 1661 "asn1p_y.y" { yyval.a_type = ASN_STRING_VideotexString; fprintf(stderr, "WARNING: VideotexString is not fully supported\n"); } break; case 199: #line 1665 "asn1p_y.y" { yyval.a_type = ASN_STRING_VisibleString; } break; case 200: #line 1666 "asn1p_y.y" { yyval.a_type = ASN_STRING_ObjectDescriptor; } break; case 205: #line 1677 "asn1p_y.y" { yyval.a_constr = 0; } break; case 206: #line 1678 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; } break; case 208: #line 1688 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[0].a_constr, 0); } break; case 209: #line 1691 "asn1p_y.y" { /* * This is a special case, for compatibility purposes. * It goes without parentheses. */ CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_SIZE, yyvsp[-1].a_constr, 0); } break; case 210: #line 1701 "asn1p_y.y" { yyval.a_constr = yyvsp[-1].a_constr; } break; case 211: #line 1704 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[-3].a_constr, yyvsp[-1].a_constr); } break; case 212: #line 1710 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); yyval.a_constr->type = ACT_EL_EXT; } break; case 213: #line 1714 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; } break; case 214: #line 1717 "asn1p_y.y" { asn1p_constraint_t *ct; ct = asn1p_constraint_new(yylineno); ct->type = ACT_EL_EXT; CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct); } break; case 215: #line 1723 "asn1p_y.y" { asn1p_constraint_t *ct; ct = asn1p_constraint_new(yylineno); ct->type = ACT_EL_EXT; CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-4].a_constr, ct); ct = yyval.a_constr; CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr); } break; case 216: #line 1731 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; } break; case 218: #line 1738 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_AEX, yyvsp[0].a_constr, 0); } break; case 220: #line 1745 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_UNI, yyvsp[-2].a_constr, yyvsp[0].a_constr); } break; case 222: #line 1752 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_INT, yyvsp[-2].a_constr, yyvsp[0].a_constr); } break; case 224: #line 1760 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_EXC, yyvsp[-2].a_constr, yyvsp[0].a_constr); } break; case 225: #line 1766 "asn1p_y.y" { int ret; yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = yyvsp[-3].a_ctype; ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr); checkmem(ret == 0); } break; case 226: #line 1774 "asn1p_y.y" { int ret; yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = ACT_CA_SET; ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr); checkmem(ret == 0); } break; case 227: #line 1782 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = ACT_EL_VALUE; yyval.a_constr->value = yyvsp[0].a_value; } break; case 228: #line 1788 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = ACT_EL_TYPE; yyval.a_constr->containedSubtype = yyvsp[0].a_value; } break; case 229: #line 1794 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = yyvsp[-1].a_ctype; yyval.a_constr->range_start = yyvsp[-2].a_value; yyval.a_constr->range_stop = yyvsp[0].a_value; } break; case 230: #line 1801 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = yyvsp[-1].a_ctype; yyval.a_constr->range_start = asn1p_value_fromint(-123); yyval.a_constr->range_stop = yyvsp[0].a_value; yyval.a_constr->range_start->type = ATV_MIN; } break; case 231: #line 1809 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = yyvsp[-1].a_ctype; yyval.a_constr->range_start = yyvsp[-2].a_value; yyval.a_constr->range_stop = asn1p_value_fromint(321); yyval.a_constr->range_stop->type = ATV_MAX; } break; case 232: #line 1817 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = yyvsp[-1].a_ctype; yyval.a_constr->range_start = asn1p_value_fromint(-123); yyval.a_constr->range_stop = asn1p_value_fromint(321); yyval.a_constr->range_start->type = ATV_MIN; yyval.a_constr->range_stop->type = ATV_MAX; } break; case 233: #line 1826 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; } break; case 234: #line 1829 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; } break; case 235: #line 1835 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); yyval.a_constr->type = ACT_CT_PATTERN; yyval.a_constr->value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); } break; case 236: #line 1840 "asn1p_y.y" { asn1p_ref_t *ref; yyval.a_constr = asn1p_constraint_new(yylineno); yyval.a_constr->type = ACT_CT_PATTERN; ref = asn1p_ref_new(yylineno); asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); yyval.a_constr->value = asn1p_value_fromref(ref, 0); } break; case 237: #line 1851 "asn1p_y.y" { yyval.a_ctype = ACT_CT_SIZE; } break; case 238: #line 1854 "asn1p_y.y" { yyval.a_ctype = ACT_CT_FROM; } break; case 239: #line 1860 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(0); checkmem(yyval.a_value); yyval.a_value->type = ATV_FALSE; } break; case 240: #line 1865 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(1); checkmem(yyval.a_value); yyval.a_value->type = ATV_TRUE; } break; case 244: #line 1873 "asn1p_y.y" { asn1p_ref_t *ref; int ret; ref = asn1p_ref_new(yylineno); checkmem(ref); ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); checkmem(ret == 0); yyval.a_value = asn1p_value_fromref(ref, 0); checkmem(yyval.a_value); free(yyvsp[0].tv_str); } break; case 245: #line 1887 "asn1p_y.y" { yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B'); checkmem(yyval.a_value); } break; case 246: #line 1891 "asn1p_y.y" { yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H'); checkmem(yyval.a_value); } break; case 247: #line 1898 "asn1p_y.y" { asn1p_ref_t *ref; int ret; ref = asn1p_ref_new(yylineno); checkmem(ref); ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_UNKNOWN); checkmem(ret == 0); yyval.a_value = asn1p_value_fromref(ref, 0); checkmem(yyval.a_value); free(yyvsp[0].tv_str); } break; case 248: #line 1912 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMP, yyvsp[0].a_constr, 0); } break; case 249: #line 1915 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-1].a_constr, 0); } break; case 250: #line 1921 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; } break; case 251: #line 1924 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-2].a_constr, yyvsp[0].a_constr); } break; case 252: #line 1930 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = ACT_EL_EXT; yyval.a_constr->value = asn1p_value_frombuf("...", 3, 1); } break; case 253: #line 1936 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = ACT_EL_VALUE; yyval.a_constr->value = asn1p_value_frombuf(yyvsp[-2].tv_str, strlen(yyvsp[-2].tv_str), 0); yyval.a_constr->presence = yyvsp[0].a_pres; if(yyvsp[-1].a_constr) asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr); } break; case 254: #line 1950 "asn1p_y.y" { yyval.a_pres = ACPRES_DEFAULT; } break; case 255: #line 1951 "asn1p_y.y" { yyval.a_pres = yyvsp[0].a_pres; } break; case 256: #line 1955 "asn1p_y.y" { yyval.a_pres = ACPRES_PRESENT; } break; case 257: #line 1958 "asn1p_y.y" { yyval.a_pres = ACPRES_ABSENT; } break; case 258: #line 1961 "asn1p_y.y" { yyval.a_pres = ACPRES_OPTIONAL; } break; case 262: #line 1976 "asn1p_y.y" { asn1p_lexer_hack_push_opaque_state(); } break; case 263: #line 1976 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = ACT_CT_CTDBY; yyval.a_constr->value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); checkmem(yyval.a_constr->value); yyval.a_constr->value->type = ATV_UNPARSED; } break; case 264: #line 1987 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); yyval.a_constr->type = ACT_CT_CTNG; yyval.a_constr->value = asn1p_value_fromtype(yyvsp[0].a_expr); } break; case 265: #line 1995 "asn1p_y.y" { yyval.a_ctype = ACT_EL_RANGE; } break; case 266: #line 1996 "asn1p_y.y" { yyval.a_ctype = ACT_EL_RLRANGE; } break; case 267: #line 1997 "asn1p_y.y" { yyval.a_ctype = ACT_EL_LLRANGE; } break; case 268: #line 1998 "asn1p_y.y" { yyval.a_ctype = ACT_EL_ULRANGE; } break; case 269: #line 2001 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; } break; case 270: #line 2004 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; } break; case 271: #line 2013 "asn1p_y.y" { asn1p_ref_t *ref = asn1p_ref_new(yylineno); asn1p_constraint_t *ct; int ret; ret = asn1p_ref_add_component(ref, yyvsp[-1].tv_str, 0); checkmem(ret == 0); ct = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); ct->type = ACT_EL_VALUE; ct->value = asn1p_value_fromref(ref, 0); CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, ct, 0); } break; case 272: #line 2028 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, yyvsp[-3].a_constr, yyvsp[-1].a_constr); } break; case 273: #line 2034 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); yyval.a_constr->type = ACT_EL_VALUE; yyval.a_constr->value = asn1p_value_fromref(yyvsp[0].a_ref, 0); } break; case 274: #line 2040 "asn1p_y.y" { asn1p_constraint_t *ct; ct = asn1p_constraint_new(yylineno); checkmem(ct); ct->type = ACT_EL_VALUE; ct->value = asn1p_value_fromref(yyvsp[0].a_ref, 0); CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct); } break; case 275: #line 2054 "asn1p_y.y" { char *p = malloc(strlen(yyvsp[0].tv_str) + 2); int ret; *p = '@'; strcpy(p + 1, yyvsp[0].tv_str); yyval.a_ref = asn1p_ref_new(yylineno); ret = asn1p_ref_add_component(yyval.a_ref, p, 0); checkmem(ret == 0); free(p); free(yyvsp[0].tv_str); } break; case 276: #line 2065 "asn1p_y.y" { char *p = malloc(strlen(yyvsp[0].tv_str) + 3); int ret; p[0] = '@'; p[1] = '.'; strcpy(p + 2, yyvsp[0].tv_str); yyval.a_ref = asn1p_ref_new(yylineno); ret = asn1p_ref_add_component(yyval.a_ref, p, 0); checkmem(ret == 0); free(p); free(yyvsp[0].tv_str); } break; case 277: #line 2081 "asn1p_y.y" { yyval.tv_str = yyvsp[0].tv_str; } break; case 278: #line 2084 "asn1p_y.y" { int l1 = strlen(yyvsp[-2].tv_str); int l3 = strlen(yyvsp[0].tv_str); yyval.tv_str = malloc(l1 + 1 + l3 + 1); memcpy(yyval.tv_str, yyvsp[-2].tv_str, l1); yyval.tv_str[l1] = '.'; memcpy(yyval.tv_str + l1 + 1, yyvsp[0].tv_str, l3); yyval.tv_str[l1 + 1 + l3] = '\0'; } break; case 279: #line 2102 "asn1p_y.y" { yyval.a_marker.flags = EM_NOMARK; yyval.a_marker.default_value = 0; } break; case 280: #line 2106 "asn1p_y.y" { yyval.a_marker = yyvsp[0].a_marker; } break; case 281: #line 2110 "asn1p_y.y" { yyval.a_marker.flags = EM_OPTIONAL | EM_INDIRECT; yyval.a_marker.default_value = 0; } break; case 282: #line 2114 "asn1p_y.y" { yyval.a_marker.flags = EM_DEFAULT; yyval.a_marker.default_value = yyvsp[0].a_value; } break; case 283: #line 2137 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); } break; case 284: #line 2141 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; } break; case 285: #line 2147 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 286: #line 2152 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); } break; case 287: #line 2159 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->expr_type = A1TC_UNIVERVAL; yyval.a_expr->meta_type = AMT_VALUE; yyval.a_expr->Identifier = yyvsp[0].tv_str; } break; case 288: #line 2166 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->expr_type = A1TC_UNIVERVAL; yyval.a_expr->meta_type = AMT_VALUE; yyval.a_expr->Identifier = yyvsp[-3].tv_str; yyval.a_expr->value = yyvsp[-1].a_value; } break; case 289: #line 2174 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->expr_type = A1TC_UNIVERVAL; yyval.a_expr->meta_type = AMT_VALUE; yyval.a_expr->Identifier = yyvsp[-3].tv_str; yyval.a_expr->value = yyvsp[-1].a_value; } break; case 290: #line 2182 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->expr_type = A1TC_UNIVERVAL; yyval.a_expr->meta_type = AMT_VALUE; yyval.a_expr->value = yyvsp[0].a_value; } break; case 291: #line 2189 "asn1p_y.y" { yyval.a_expr = NEW_EXPR(); checkmem(yyval.a_expr); yyval.a_expr->Identifier = strdup("..."); checkmem(yyval.a_expr->Identifier); yyval.a_expr->expr_type = A1TC_EXTENSIBLE; yyval.a_expr->meta_type = AMT_VALUE; } break; case 292: #line 2200 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); checkmem(yyval.a_value); } break; case 293: #line 2204 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); checkmem(yyval.a_value); } break; case 295: #line 2212 "asn1p_y.y" { yyval.a_value = asn1p_value_fromdouble(yyvsp[0].a_dbl); checkmem(yyval.a_value); } break; case 296: #line 2243 "asn1p_y.y" { memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); } break; case 297: #line 2244 "asn1p_y.y" { yyval.a_tag = yyvsp[0].a_tag; } break; case 298: #line 2248 "asn1p_y.y" { yyval.a_tag = yyvsp[-1].a_tag; yyval.a_tag.tag_mode = yyvsp[0].a_tag.tag_mode; } break; case 299: #line 2255 "asn1p_y.y" { yyval.a_tag = yyvsp[-2].a_tag; yyval.a_tag.tag_value = yyvsp[-1].a_int; } break; case 300: #line 2261 "asn1p_y.y" { yyval.a_tag.tag_class = TC_CONTEXT_SPECIFIC; } break; case 301: #line 2262 "asn1p_y.y" { yyval.a_tag.tag_class = TC_UNIVERSAL; } break; case 302: #line 2263 "asn1p_y.y" { yyval.a_tag.tag_class = TC_APPLICATION; } break; case 303: #line 2264 "asn1p_y.y" { yyval.a_tag.tag_class = TC_PRIVATE; } break; case 304: #line 2268 "asn1p_y.y" { yyval.a_tag.tag_mode = TM_DEFAULT; } break; case 305: #line 2269 "asn1p_y.y" { yyval.a_tag.tag_mode = TM_IMPLICIT; } break; case 306: #line 2270 "asn1p_y.y" { yyval.a_tag.tag_mode = TM_EXPLICIT; } break; case 307: #line 2274 "asn1p_y.y" { checkmem(yyvsp[0].tv_str); yyval.tv_str = yyvsp[0].tv_str; } break; case 308: #line 2278 "asn1p_y.y" { checkmem(yyvsp[0].tv_str); yyval.tv_str = yyvsp[0].tv_str; } break; case 309: #line 2286 "asn1p_y.y" { checkmem(yyvsp[0].tv_str); yyval.tv_str = yyvsp[0].tv_str; } break; case 310: #line 2293 "asn1p_y.y" { yyval.tv_str = 0; } break; case 311: #line 2294 "asn1p_y.y" { yyval.tv_str = yyvsp[0].tv_str; } break; case 312: #line 2300 "asn1p_y.y" { checkmem(yyvsp[0].tv_str); yyval.tv_str = yyvsp[0].tv_str; } break; } /* Line 1016 of /usr/local/share/bison/yacc.c. */ #line 4391 "asn1p_y.c" yyvsp -= yylen; yyssp -= yylen; #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("parse error, unexpected ") + 1; yysize += yystrlen (yytname[yytype]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "parse error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("parse error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("parse error"); } goto yyerrlab1; /*----------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action. | `----------------------------------------------------*/ yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* Return failure if at end of input. */ if (yychar == YYEOF) { /* Pop the error token. */ YYPOPSTACK; /* Pop the rest of the stack. */ while (yyssp > yyss) { YYDPRINTF ((stderr, "Error: popping ")); YYDSYMPRINT ((stderr, yystos[*yyssp], *yyvsp)); YYDPRINTF ((stderr, "\n")); yydestruct (yystos[*yyssp], *yyvsp); YYPOPSTACK; } YYABORT; } YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); yydestruct (yychar1, yylval); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDPRINTF ((stderr, "Error: popping ")); YYDSYMPRINT ((stderr, yystos[*yyssp], *yyvsp)); YYDPRINTF ((stderr, "\n")); yydestruct (yystos[yystate], *yyvsp); yyvsp--; yystate = *--yyssp; #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "Error: state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 2306 "asn1p_y.y" /* * Convert Xstring ('0101'B or '5'H) to the binary vector. */ static asn1p_value_t * _convert_bitstring2binary(char *str, int base) { asn1p_value_t *val; int slen; int memlen; int baselen; int bits; uint8_t *binary_vector; uint8_t *bv_ptr; uint8_t cur_val; assert(str); assert(str[0] == '\''); switch(base) { case 'B': baselen = 1; break; case 'H': baselen = 4; break; default: assert(base == 'B' || base == 'H'); errno = EINVAL; return NULL; } slen = strlen(str); assert(str[slen - 1] == base); assert(str[slen - 2] == '\''); memlen = slen / (8 / baselen); /* Conservative estimate */ bv_ptr = binary_vector = malloc(memlen + 1); if(bv_ptr == NULL) /* ENOMEM */ return NULL; cur_val = 0; bits = 0; while(*(++str) != '\'') { switch(baselen) { case 1: switch(*str) { case '1': cur_val |= 1 << (7 - (bits % 8)); case '0': break; default: assert(!"_y UNREACH1"); case ' ': case '\r': case '\n': continue; } break; case 4: switch(*str) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': cur_val |= (*str - '0') << (4 - (bits % 8)); break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': cur_val |= ((*str - 'A') + 10) << (4 - (bits % 8)); break; default: assert(!"_y UNREACH2"); case ' ': case '\r': case '\n': continue; } break; } bits += baselen; if((bits % 8) == 0) { *bv_ptr++ = cur_val; cur_val = 0; } } *bv_ptr = cur_val; assert((bv_ptr - binary_vector) <= memlen); val = asn1p_value_frombits(binary_vector, bits, 0); if(val == NULL) { free(binary_vector); } return val; } /* * For unnamed types (used in old X.208 compliant modules) * generate some sort of interim names, to not to force human being to fix * the specification's compliance to modern ASN.1 standards. */ static void _fixup_anonymous_identifier(asn1p_expr_t *expr) { char *p; assert(expr->Identifier == 0); /* * Try to figure out the type name * without going too much into details */ expr->Identifier = ASN_EXPR_TYPE2STR(expr->expr_type); if(expr->reference && expr->reference->comp_count > 0) expr->Identifier = expr->reference->components[0].name; fprintf(stderr, "WARNING: Line %d: expected lower-case member identifier, " "found an unnamed %s.\n" "WARNING: Obsolete X.208 syntax detected, " "please give the member a name.\n", yylineno, expr->Identifier ? expr->Identifier : "type"); if(!expr->Identifier) expr->Identifier = "unnamed"; expr->Identifier = strdup(expr->Identifier); assert(expr->Identifier); /* Make a lowercase identifier from the type name */ for(p = expr->Identifier; *p; p++) { switch(*p) { case 'A' ... 'Z': *p += 32; break; case ' ': *p = '_'; break; case '-': *p = '_'; break; } } fprintf(stderr, "NOTE: Assigning temporary identifier \"%s\". " "Name clash may occur later.\n", expr->Identifier); } int yyerror(const char *msg) { extern char *asn1p_text; fprintf(stderr, "ASN.1 grammar parse error " "near line %d (token \"%s\"): %s\n", yylineno, asn1p_text, msg); return -1; } asn1c-0.9.24+dfsg/libasn1parser/asn1p_expr2uclass.h0000644000000000000000000000552211472004364020531 0ustar rootroot#ifndef ASN1_PARSER_EXPR2UCLASS_H #define ASN1_PARSER_EXPR2UCLASS_H #ifndef __GNUC__ #define __attribute__(x) /* unused */ #endif static int expr_type2uclass_value[ASN_EXPR_TYPE_MAX] __attribute__ ((unused)) = { [ ASN_BASIC_BOOLEAN ] = 1, [ ASN_BASIC_INTEGER ] = 2, [ ASN_BASIC_BIT_STRING ] = 3, [ ASN_BASIC_OCTET_STRING ] = 4, [ ASN_BASIC_NULL ] = 5, [ ASN_BASIC_OBJECT_IDENTIFIER ] = 6, [ ASN_STRING_ObjectDescriptor ] = 7, [ ASN_BASIC_EXTERNAL ] = 8, [ ASN_BASIC_REAL ] = 9, [ ASN_BASIC_ENUMERATED ] = 10, [ ASN_BASIC_EMBEDDED_PDV ] = 11, [ ASN_STRING_UTF8String ] = 12, [ ASN_BASIC_RELATIVE_OID ] = 13, [ ASN_CONSTR_SEQUENCE ] = 16, [ ASN_CONSTR_SEQUENCE_OF ] = 16, [ ASN_CONSTR_SET ] = 17, [ ASN_CONSTR_SET_OF ] = 17, [ ASN_STRING_NumericString ] = 18, [ ASN_STRING_PrintableString ] = 19, [ ASN_STRING_TeletexString ] = 20, [ ASN_STRING_T61String ] = 20, [ ASN_STRING_VideotexString ] = 21, [ ASN_STRING_IA5String ] = 22, [ ASN_BASIC_UTCTime ] = 23, [ ASN_BASIC_GeneralizedTime ] = 24, [ ASN_STRING_GraphicString ] = 25, [ ASN_STRING_VisibleString ] = 26, [ ASN_STRING_ISO646String ] = 26, [ ASN_STRING_GeneralString ] = 27, [ ASN_STRING_UniversalString ] = 28, [ ASN_BASIC_CHARACTER_STRING ] = 29, [ ASN_STRING_BMPString ] = 30, }; static enum asn1p_expr_type expr_utag2type[32] __attribute__ ((unused)) = { [ 0 ] = 0, /* If zero length, end-of-content */ [ 1 ] = ASN_BASIC_BOOLEAN, [ 2 ] = ASN_BASIC_INTEGER, [ 3 ] = ASN_BASIC_BIT_STRING, [ 4 ] = ASN_BASIC_OCTET_STRING, [ 5 ] = ASN_BASIC_NULL, [ 6 ] = ASN_BASIC_OBJECT_IDENTIFIER, [ 7 ] = ASN_STRING_ObjectDescriptor, [ 8 ] = ASN_BASIC_EXTERNAL, [ 9 ] = ASN_BASIC_REAL, [ 10 ] = ASN_BASIC_ENUMERATED, [ 11 ] = ASN_BASIC_EMBEDDED_PDV, [ 12 ] = ASN_STRING_UTF8String, [ 13 ] = ASN_BASIC_RELATIVE_OID, [ 14 ] = 0, [ 15 ] = 0, [ 16 ] = ASN_CONSTR_SEQUENCE, /* Or SEQUENCE OF */ [ 17 ] = ASN_CONSTR_SET, /* Or SET OF */ [ 18 ] = ASN_STRING_NumericString, /* " "|"0".."9" */ [ 19 ] = ASN_STRING_PrintableString, [ 20 ] = ASN_STRING_TeletexString, [ 21 ] = ASN_STRING_VideotexString, [ 22 ] = ASN_STRING_IA5String, [ 23 ] = ASN_BASIC_UTCTime, [ 24 ] = ASN_BASIC_GeneralizedTime, [ 25 ] = ASN_STRING_GraphicString, [ 26 ] = ASN_STRING_VisibleString, [ 27 ] = ASN_STRING_GeneralString, [ 28 ] = ASN_STRING_UniversalString, /* 32-bit UCS-4 */ [ 29 ] = ASN_BASIC_CHARACTER_STRING, [ 30 ] = ASN_STRING_BMPString, /* 16-bit UCS-2 */ }; /* * Convert the [UNIVERSAL value] into the internal type or a string. */ #define ASN_UNIVERSAL_TAG2TYPE(utag) \ ( \ (((int)(utag)) < 0 \ || ((int)(utag)) >= (int)(sizeof(expr_utag2type) \ / sizeof(expr_utag2type[0]))) \ ? 0 \ : expr_utag2type[(int)(utag)] \ ) #define ASN_UNIVERSAL_TAG2STR(utag) \ ASN_EXPR_TYPE2STR(ASN_UNIVERSAL_TAG2TYPE(utag)) #endif /* ASN1_PARSER_EXPR2UCLASS_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_class.c0000644000000000000000000000655711472004364017367 0ustar rootroot#include #include #include #include #include #include "asn1parser.h" asn1p_ioc_row_t * asn1p_ioc_row_new(asn1p_expr_t *oclass) { asn1p_ioc_row_t *row; asn1p_expr_t *field; int columns = 0; assert(oclass->expr_type == A1TC_CLASSDEF); row = calloc(1, sizeof *row); if(!row) return NULL; TQ_FOR(field, &oclass->members, next) columns++; row->column = calloc(columns, sizeof *row->column); if(!row->column) { free(row); return NULL; } row->columns = columns; columns = 0; TQ_FOR(field, &oclass->members, next) { int fieldIdLen = strlen(field->Identifier); if(fieldIdLen > row->max_identifier_length) row->max_identifier_length = fieldIdLen; row->column[columns].field = field; row->column[columns].value = NULL; columns++; } return row; } void asn1p_ioc_row_delete(asn1p_ioc_row_t *row) { if(row) { if(row->column) { free(row->column); } free(row); } } struct asn1p_ioc_cell_s * asn1p_ioc_row_cell_fetch(asn1p_ioc_row_t *row, const char *fieldname) { int i; for(i = 0; i < row->columns; i++) { if(strcmp(row->column[i].field->Identifier, fieldname) == 0) return &row->column[i]; } errno = ESRCH; return NULL; } asn1p_wsyntx_chunk_t * asn1p_wsyntx_chunk_new() { asn1p_wsyntx_chunk_t *wc; wc = calloc(1, sizeof(*wc)); return wc; } void asn1p_wsyntx_chunk_free(asn1p_wsyntx_chunk_t *wc) { if(wc) { switch(wc->type) { case WC_LITERAL: case WC_WHITESPACE: case WC_FIELD: free(wc->content.token); break; case WC_OPTIONALGROUP: asn1p_wsyntx_free(wc->content.syntax); break; } free(wc); } } asn1p_wsyntx_chunk_t * asn1p_wsyntx_chunk_clone(asn1p_wsyntx_chunk_t *wc) { asn1p_wsyntx_chunk_t *nc; nc = asn1p_wsyntx_chunk_new(); if(nc) { nc->type = wc->type; switch(wc->type) { case WC_LITERAL: case WC_WHITESPACE: case WC_FIELD: nc->content.token = malloc(strlen(wc->content.token)+1); strcpy(nc->content.token, wc->content.token); break; case WC_OPTIONALGROUP: nc->content.syntax = asn1p_wsyntx_clone(wc->content.syntax); break; } } return nc; } asn1p_wsyntx_t * asn1p_wsyntx_new() { asn1p_wsyntx_t *wx; wx = calloc(1, sizeof(*wx)); if(wx) { TQ_INIT(&(wx->chunks)); } return wx; } void asn1p_wsyntx_free(asn1p_wsyntx_t *wx) { if(wx) { asn1p_wsyntx_chunk_t *wc; while((wc = TQ_REMOVE(&(wx->chunks), next))) asn1p_wsyntx_chunk_free(wc); free(wx); } } asn1p_wsyntx_t * asn1p_wsyntx_clone(asn1p_wsyntx_t *wx) { asn1p_wsyntx_t *nw; nw = asn1p_wsyntx_new(); if(nw) { asn1p_wsyntx_chunk_t *wc; asn1p_wsyntx_chunk_t *nc; TQ_FOR(wc, &(wx->chunks), next) { nc = asn1p_wsyntx_chunk_clone(wc); if(nc) { TQ_ADD(&(nw->chunks), nc, next); } else { asn1p_wsyntx_free(nw); return NULL; } } } return nw; } asn1p_wsyntx_chunk_t * asn1p_wsyntx_chunk_fromstring(char *token, int do_copy) { asn1p_wsyntx_chunk_t *wc; if(do_copy) { static asn1p_wsyntx_chunk_t tmp; tmp.type = WC_LITERAL; tmp.content.token = token; wc = asn1p_wsyntx_chunk_clone(&tmp); } else { wc = asn1p_wsyntx_chunk_new(); if(wc) { wc->type = WC_LITERAL; wc->content.token = token; } } return wc; } asn1p_wsyntx_chunk_t * asn1p_wsyntx_chunk_fromsyntax(asn1p_wsyntx_t *syntax) { asn1p_wsyntx_chunk_t *wc; wc = asn1p_wsyntx_chunk_new(); if(wc) { wc->type = WC_OPTIONALGROUP; wc->content.syntax = syntax; } return wc; } asn1c-0.9.24+dfsg/libasn1parser/asn1p_module.c0000644000000000000000000000163411472004364017536 0ustar rootroot#include #include #include "asn1parser.h" /* * Construct a new empty module. */ asn1p_module_t * asn1p_module_new() { asn1p_module_t *mod; mod = calloc(1, sizeof *mod); if(mod) { TQ_INIT(&(mod->exports)); TQ_INIT(&(mod->imports)); TQ_INIT(&(mod->members)); } return mod; } /* * Destroy the module. */ void asn1p_module_free(asn1p_module_t *mod) { if(mod) { asn1p_expr_t *expr; if(mod->ModuleName) free(mod->ModuleName); if(mod->module_oid) asn1p_oid_free(mod->module_oid); while((expr = TQ_REMOVE(&(mod->members), next))) asn1p_expr_free(expr); free(mod); } } asn1p_t * asn1p_new() { asn1p_t *asn; asn = calloc(1, sizeof(*asn)); if(asn) { TQ_INIT(&(asn->modules)); } return asn; } void asn1p_delete(asn1p_t *asn) { if(asn) { asn1p_module_t *mod; while((mod = TQ_REMOVE(&(asn->modules), mod_next))) asn1p_module_free(mod); free(asn); } } asn1c-0.9.24+dfsg/libasn1parser/asn1p_class.h0000644000000000000000000000341411472004364017361 0ustar rootroot/* * CLASS-related stuff. */ #ifndef ASN1_PARSER_CLASS_H #define ASN1_PARSER_CLASS_H #include "asn1p_ref.h" struct asn1p_expr_s; /* Forward declaration */ typedef struct asn1p_ioc_row_s { struct asn1p_ioc_cell_s { struct asn1p_expr_s *field; /* may never be NULL */ struct asn1p_expr_s *value; /* may be left uninitialized */ } *column; int columns; int max_identifier_length; } asn1p_ioc_row_t; asn1p_ioc_row_t *asn1p_ioc_row_new(struct asn1p_expr_s *oclass); void asn1p_ioc_row_delete(asn1p_ioc_row_t *); struct asn1p_ioc_cell_s *asn1p_ioc_row_cell_fetch(asn1p_ioc_row_t *, const char *fieldname); /* * WITH SYNTAX free-form chunks. */ typedef struct asn1p_wsyntx_chunk_s { enum { WC_LITERAL, WC_WHITESPACE, WC_FIELD, WC_OPTIONALGROUP } type; /* * WC_LITERAL -> {token} * WC_WHITESPACE -> {token} * WC_FIELD -> {token} * WC_OPTIONALGROUP -> {syntax} */ union { char *token; struct asn1p_wsyntx_s *syntax; } content; TQ_ENTRY(struct asn1p_wsyntx_chunk_s) next; } asn1p_wsyntx_chunk_t; typedef struct asn1p_wsyntx_s { TQ_HEAD(struct asn1p_wsyntx_chunk_s) chunks; } asn1p_wsyntx_t; /* * Constructor, destructor and cloning function. */ asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_new(void); void asn1p_wsyntx_chunk_free(asn1p_wsyntx_chunk_t *); asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_clone(asn1p_wsyntx_chunk_t *); asn1p_wsyntx_t *asn1p_wsyntx_new(void); void asn1p_wsyntx_free(asn1p_wsyntx_t *); asn1p_wsyntx_t *asn1p_wsyntx_clone(asn1p_wsyntx_t *); /* * RETURN VALUES: * 0: Component has been added * -1: Failure to add component (refer to errno) */ asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_fromstring(char *token, int _copy); asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_fromsyntax(asn1p_wsyntx_t *syntax); #endif /* ASN1_PARSER_CLASS_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_param.c0000644000000000000000000000417611472004364017355 0ustar rootroot#include #include #include #include #include #include "asn1parser.h" /* * Construct a new empty parameters list. */ asn1p_paramlist_t * asn1p_paramlist_new(int _lineno) { asn1p_paramlist_t *pl; pl = calloc(1, sizeof *pl); if(pl) { pl->_lineno = _lineno; } return pl; } void asn1p_paramlist_free(asn1p_paramlist_t *pl) { if(pl) { if(pl->params) { int i = pl->params_count; while(i--) { if(pl->params[i].governor) asn1p_ref_free(pl->params[i].governor); if(pl->params[i].argument) free(pl->params[i].argument); pl->params[i].governor = 0; pl->params[i].argument = 0; } free(pl->params); pl->params = 0; } free(pl); } } int asn1p_paramlist_add_param(asn1p_paramlist_t *pl, asn1p_ref_t *gov, char *arg) { if(!pl || !arg) { errno = EINVAL; return -1; } /* * Make sure there's enough space to insert a new element. */ if(pl->params_count == pl->params_size) { int newsize = pl->params_size?pl->params_size<<2:4; void *p; p = realloc(pl->params, newsize * sizeof(pl->params[0])); if(p) { pl->params = p; pl->params_size = newsize; memset(&pl->params[pl->params_count], 0, (newsize - pl->params_size) * sizeof(pl->params[0])); } else { return -1; } } if(gov) { pl->params[pl->params_count].governor = asn1p_ref_clone(gov); if(pl->params[pl->params_count].governor == NULL) return -1; } else { pl->params[pl->params_count].governor = 0; } pl->params[pl->params_count].argument = strdup(arg); if(pl->params[pl->params_count].argument) { pl->params_count++; return 0; } else { if(pl->params[pl->params_count].governor) asn1p_ref_free(pl->params[pl->params_count].governor); return -1; } } asn1p_paramlist_t * asn1p_paramlist_clone(asn1p_paramlist_t *pl) { asn1p_paramlist_t *newpl; newpl = asn1p_paramlist_new(pl->_lineno); if(newpl) { int i; for(i = 0; i < pl->params_count; i++) { if(asn1p_paramlist_add_param(newpl, pl->params[i].governor, pl->params[i].argument )) { asn1p_paramlist_free(newpl); newpl = NULL; break; } } } return newpl; } asn1c-0.9.24+dfsg/libasn1parser/asn1p_list.h0000644000000000000000000000272011472004364017226 0ustar rootroot/* * Singly linked tail queue support. */ #ifndef ASN1_PARSER_LIST_H #define ASN1_PARSER_LIST_H #define TQ_HEAD(type) \ struct { \ type *tq_head; \ type**tq_tail; \ } #define TQ_MOVE(to, from) do { \ if(&(TQ_FIRST(from)) == (from)->tq_tail) { \ TQ_INIT(to); \ } else { \ (to)->tq_head = (from)->tq_head; \ (to)->tq_tail = (from)->tq_tail; \ } \ TQ_INIT(from); \ } while(0) #define TQ_ENTRY(type) \ struct { \ type *tq_next; \ } #define TQ_FIRST(headp) ((headp)->tq_head) #define TQ_NEXT(el, field) ((el)->field.tq_next) #define TQ_INIT(head) do { \ TQ_FIRST((head)) = 0; \ (head)->tq_tail = &TQ_FIRST((head)); \ } while(0) #define TQ_FOR(var, head, field) \ for((var) = TQ_FIRST((head)); \ (var); (var) = TQ_NEXT((var), field)) /* MSVC does not have typeof(), cannot prevent side effects! */ #define TQ_ADD(head, xel, field) do { \ typeof(xel) __el = (xel); \ assert(TQ_NEXT((__el), field) == 0); \ *(head)->tq_tail = (__el); \ (head)->tq_tail = &TQ_NEXT((__el), field); \ } while(0) /* * Remove the first element and return it. */ #define TQ_REMOVE(head, field) ({ \ typeof(TQ_FIRST((head))) __fel; \ __fel = TQ_FIRST((head)); \ if(__fel == 0 \ || (TQ_FIRST((head)) = TQ_NEXT(__fel, field)) \ == 0) { \ (head)->tq_tail = &TQ_FIRST((head)); \ } else { \ TQ_NEXT(__fel, field) = 0; \ } \ __fel; }) #endif /* ASN1_PARSER_LIST_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_expr.c0000644000000000000000000001656211472004364017235 0ustar rootroot#include #include #include #include #include #include "asn1parser.h" static asn1p_expr_t *asn1p_expr_clone_impl(asn1p_expr_t *expr, int skip_extensions, asn1p_expr_t *(*)(asn1p_expr_t *, void *), void *); static asn1p_value_t *value_resolver(asn1p_value_t *, void *arg); /* * Construct a new empty types collection. */ asn1p_expr_t * asn1p_expr_new(int _lineno, asn1p_module_t *mod) { asn1p_expr_t *expr; expr = calloc(1, sizeof *expr); if(expr) { TQ_INIT(&(expr->members)); expr->spec_index = -1; expr->module = mod; expr->_lineno = _lineno; } return expr; } asn1p_expr_t * asn1p_expr_clone(asn1p_expr_t *expr, int skip_extensions) { return asn1p_expr_clone_impl(expr, skip_extensions, 0, 0); } asn1p_expr_t * asn1p_expr_clone_with_resolver(asn1p_expr_t *expr, asn1p_expr_t *(*r)(asn1p_expr_t *, void *), void *rarg) { return asn1p_expr_clone_impl(expr, 0, r, rarg); } static asn1p_expr_t * asn1p_expr_clone_impl(asn1p_expr_t *expr, int skip_extensions, asn1p_expr_t *(*r)(asn1p_expr_t *, void *), void *rarg) { asn1p_value_t *(*vr)(asn1p_value_t *, void *) = 0; asn1p_expr_t *clone = 0; asn1p_expr_t *tcmemb; /* Child of tc */ int hit_ext = 0; #define CLCOPY(field) do { clone->field = expr->field; } while(0) #define CLCLONE(field, func) do { if(expr->field) { \ clone->field = func(expr->field); \ if(clone->field == NULL) { \ asn1p_expr_free(clone); \ return NULL; \ } \ } } while(0) #define CLVRCLONE(field, func) do { if(expr->field) { \ clone->field = func(expr->field, vr, rarg); \ if(clone->field == NULL) { \ asn1p_expr_free(clone); \ return NULL; \ } \ } } while(0) if(r) { vr = value_resolver; clone = r(expr, rarg); if(clone) { /* Merge constraints */ if(expr->constraints) { asn1p_constraint_t *tmpct = asn1p_constraint_clone_with_resolver(expr->constraints, vr, rarg); if(clone->constraints) { if(asn1p_constraint_insert(clone->constraints, tmpct)) { asn1p_constraint_free(tmpct); asn1p_expr_free(clone); return NULL; } } else { clone->constraints = tmpct; } assert(expr->combined_constraints == 0); } /* Merge defaults */ CLCOPY(marker.flags); CLVRCLONE(marker.default_value, asn1p_value_clone_with_resolver); if(clone->tag.tag_class == TC_NOCLASS) { CLCOPY(tag); } else if(expr->tag.tag_class != TC_NOCLASS) { fprintf(stderr, "asn1c does not support " "nested tagging in parameterization, " "necessary at line %d\n", expr->_lineno); asn1p_expr_free(clone); return NULL; } return clone; } else if(errno != ESRCH) { return NULL; /* Hard error */ } } if(!clone) clone = asn1p_expr_new(expr->_lineno, expr->module); if(!clone) return NULL; /* * Copy simple fields. */ CLCOPY(meta_type); CLCOPY(expr_type); CLCOPY(tag); CLCOPY(marker.flags); /* OPTIONAL/DEFAULT */ CLCOPY(_mark); clone->data = 0; /* Do not clone this */ clone->data_free = 0; /* Do not clone this */ /* * Clone complex fields. */ CLCLONE(Identifier, strdup); CLCLONE(reference, asn1p_ref_clone); CLVRCLONE(constraints, asn1p_constraint_clone_with_resolver); CLVRCLONE(combined_constraints, asn1p_constraint_clone_with_resolver); CLCLONE(lhs_params, asn1p_paramlist_clone); CLVRCLONE(value, asn1p_value_clone_with_resolver); CLVRCLONE(marker.default_value, asn1p_value_clone_with_resolver); CLCLONE(with_syntax, asn1p_wsyntx_clone); /* * Copy all the children of this expr. */ TQ_FOR(tcmemb, &(expr->members), next) { asn1p_expr_t *cmemb; if(skip_extensions && tcmemb->expr_type == A1TC_EXTENSIBLE) { hit_ext++; /* Even if hit_ext wraps around, we're OK. */ continue; } if(hit_ext == 1) continue; /* Skip between ...'s */ cmemb = asn1p_expr_clone_impl(tcmemb, skip_extensions, r, rarg); if(cmemb == NULL) { asn1p_expr_free(clone); return NULL; } asn1p_expr_add(clone, cmemb); } return clone; } static asn1p_value_t * value_resolver(asn1p_value_t *value, void *rarg) { asn1p_value_t *cval; asn1p_expr_t *tmpexpr; asn1p_expr_t *target; asn1p_ref_t *ref; struct { asn1p_expr_t *(*expr_resolve)(asn1p_expr_t *, void *arg); } *varg = rarg; if(!value || value->type != ATV_REFERENCED) { errno = ESRCH; return NULL; } ref = value->value.reference; tmpexpr = asn1p_expr_new(ref->_lineno, 0); tmpexpr->meta_type = AMT_TYPEREF; tmpexpr->expr_type = A1TC_REFERENCE; tmpexpr->reference = ref; target = varg->expr_resolve(tmpexpr, rarg); tmpexpr->reference = 0; asn1p_expr_free(tmpexpr); if(!target) return NULL; /* errno's are compatible */ if(target->meta_type == AMT_VALUE) { if(!target->value) { fprintf(stderr, "FATAL: Parameterization did not resolve " "value reference at line %d\n", ref->_lineno); asn1p_expr_free(target); errno = EPERM; return NULL; } cval = asn1p_value_clone(target->value); } else if(target->meta_type == AMT_VALUESET) { if(!target->constraints) { fprintf(stderr, "FATAL: Parameterization did not resolve " "value set reference at line %d\n", ref->_lineno); asn1p_expr_free(target); errno = EPERM; return NULL; } cval = asn1p_value_fromconstr(target->constraints, 1); } else { errno = EPERM; cval = NULL; } asn1p_expr_free(target); return cval; } /* * Add expression as a member of another. */ void asn1p_expr_add(asn1p_expr_t *to, asn1p_expr_t *what) { TQ_ADD(&(to->members), what, next); what->parent_expr = to; } /* * Destruct the types collection structure. */ void asn1p_expr_free(asn1p_expr_t *expr) { if(expr) { asn1p_expr_t *tm; /* Remove all children */ while((tm = TQ_REMOVE(&(expr->members), next))) { if(tm->parent_expr != expr) printf("<%s:%p !-> %s:%p>\n", tm->Identifier, tm->parent_expr, expr->Identifier, expr); assert(tm->parent_expr == expr); asn1p_expr_free(tm); } if(expr->Identifier) free(expr->Identifier); if(expr->reference) asn1p_ref_free(expr->reference); if(expr->constraints) asn1p_constraint_free(expr->constraints); if(expr->combined_constraints) asn1p_constraint_free(expr->combined_constraints); if(expr->lhs_params) asn1p_paramlist_free(expr->lhs_params); if(expr->value) asn1p_value_free(expr->value); if(expr->marker.default_value) asn1p_value_free(expr->marker.default_value); if(expr->with_syntax) asn1p_wsyntx_free(expr->with_syntax); if(expr->data && expr->data_free) expr->data_free(expr->data); memset(expr, 0, sizeof(*expr)); free(expr); } } char *asn1p_tag2string(struct asn1p_type_tag_s *tag, char *buf) { static char buf_stat[TAG2STRING_BUFFER_SIZE]; char *start; char *end; if(!buf) buf = buf_stat; start = buf; end = buf + TAG2STRING_BUFFER_SIZE; if(tag->tag_class == TC_NOCLASS) { *buf = 0; return buf; } strcpy(buf, "["); switch(tag->tag_class) { case TC_NOCLASS: assert(tag->tag_class != TC_NOCLASS); break; case TC_UNIVERSAL: strcat(buf, "UNIVERSAL "); break; case TC_PRIVATE: strcat(buf, "PRIVATE "); break; case TC_APPLICATION: strcat(buf, "APPLICATION "); break; case TC_CONTEXT_SPECIFIC: break; } buf += snprintf(buf + strlen(buf), end - buf, "%" PRIdASN "]", tag->tag_value); assert((unsigned int)(buf - end) > sizeof(" IMPLICIT ")); switch(tag->tag_mode) { case TM_DEFAULT: break; case TM_IMPLICIT: strcat(buf, " IMPLICIT"); break; case TM_EXPLICIT: strcat(buf, " EXPLICIT"); break; } return start; } asn1c-0.9.24+dfsg/libasn1parser/asn1p_oid.c0000644000000000000000000000363411505405150017021 0ustar rootroot#include #include #include #include "asn1parser.h" asn1p_oid_t * asn1p_oid_construct(asn1p_oid_arc_t *arc, int narcs) { asn1p_oid_t *oid; if(narcs <= 0) return NULL; oid = asn1p_oid_new(); if(oid) { for(; narcs--; arc++) { if(asn1p_oid_add_arc(oid, arc)) { asn1p_oid_free(oid); return NULL; } } } return oid; } asn1p_oid_t * asn1p_oid_new() { return calloc(1, sizeof(asn1p_oid_t)); } int asn1p_oid_add_arc(asn1p_oid_t *oid, asn1p_oid_arc_t *template) { void *p; p = realloc(oid->arcs, (oid->arcs_count + 1) * sizeof(oid->arcs[0])); if(p) { oid->arcs = p; oid->arcs[oid->arcs_count].name = template->name?strdup(template->name):0; oid->arcs[oid->arcs_count].number = template->number; oid->arcs_count++; return 0; } else { return -1; } } void asn1p_oid_free(asn1p_oid_t *oid) { if(oid) { if(oid->arcs) { while(oid->arcs_count--) { if(oid->arcs[oid->arcs_count].name) free(oid->arcs[oid->arcs_count].name); } } free(oid); } } asn1p_oid_arc_t * asn1p_oid_arc_new(const char *optName, asn1c_integer_t optNumber /* = -1 */) { asn1p_oid_arc_t *arc; arc = calloc(1, sizeof *arc); if(arc) { if(optName) arc->name = strdup(optName); arc->number = optNumber; } return arc; } void asn1p_oid_arc_free(asn1p_oid_arc_t *arc) { if(arc) { if(arc->name) free(arc->name); free(arc); } } int asn1p_oid_compare(asn1p_oid_t *a, asn1p_oid_t *b) { int i; for(i = 0; ; i++) { asn1c_integer_t cmp; if(b->arcs_count > i) { if(a->arcs_count <= i) return -1; } else if(a->arcs_count > i) { if(b->arcs_count <= i) return 1; } else if(b->arcs_count <= i && a->arcs_count <= i) { cmp = b->arcs_count - a->arcs_count; if(cmp < 0) return -1; else if(cmp > 0) return 1; return 0; } cmp = b->arcs[i].number - a->arcs[i].number; if(cmp < 0) return -1; else if(cmp > 0) return 1; } } asn1c-0.9.24+dfsg/libasn1parser/asn1p_y.h0000644000000000000000000001770711505405150016531 0ustar rootroot/* A Bison parser, made from asn1p_y.y, by GNU bison 1.75. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ #ifndef BISON_ASN_P_Y_H # define BISON_ASN_P_Y_H /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOK_PPEQ = 258, TOK_whitespace = 259, TOK_opaque = 260, TOK_bstring = 261, TOK_cstring = 262, TOK_hstring = 263, TOK_identifier = 264, TOK_number = 265, TOK_number_negative = 266, TOK_realnumber = 267, TOK_tuple = 268, TOK_quadruple = 269, TOK_typereference = 270, TOK_capitalreference = 271, TOK_typefieldreference = 272, TOK_valuefieldreference = 273, TOK_Literal = 274, TOK_ABSENT = 275, TOK_ABSTRACT_SYNTAX = 276, TOK_ALL = 277, TOK_ANY = 278, TOK_APPLICATION = 279, TOK_AUTOMATIC = 280, TOK_BEGIN = 281, TOK_BIT = 282, TOK_BMPString = 283, TOK_BOOLEAN = 284, TOK_BY = 285, TOK_CHARACTER = 286, TOK_CHOICE = 287, TOK_CLASS = 288, TOK_COMPONENT = 289, TOK_COMPONENTS = 290, TOK_CONSTRAINED = 291, TOK_CONTAINING = 292, TOK_DEFAULT = 293, TOK_DEFINITIONS = 294, TOK_DEFINED = 295, TOK_EMBEDDED = 296, TOK_ENCODED = 297, TOK_ENCODING_CONTROL = 298, TOK_END = 299, TOK_ENUMERATED = 300, TOK_EXPLICIT = 301, TOK_EXPORTS = 302, TOK_EXTENSIBILITY = 303, TOK_EXTERNAL = 304, TOK_FALSE = 305, TOK_FROM = 306, TOK_GeneralizedTime = 307, TOK_GeneralString = 308, TOK_GraphicString = 309, TOK_IA5String = 310, TOK_IDENTIFIER = 311, TOK_IMPLICIT = 312, TOK_IMPLIED = 313, TOK_IMPORTS = 314, TOK_INCLUDES = 315, TOK_INSTANCE = 316, TOK_INSTRUCTIONS = 317, TOK_INTEGER = 318, TOK_ISO646String = 319, TOK_MAX = 320, TOK_MIN = 321, TOK_MINUS_INFINITY = 322, TOK_NULL = 323, TOK_NumericString = 324, TOK_OBJECT = 325, TOK_ObjectDescriptor = 326, TOK_OCTET = 327, TOK_OF = 328, TOK_OPTIONAL = 329, TOK_PATTERN = 330, TOK_PDV = 331, TOK_PLUS_INFINITY = 332, TOK_PRESENT = 333, TOK_PrintableString = 334, TOK_PRIVATE = 335, TOK_REAL = 336, TOK_RELATIVE_OID = 337, TOK_SEQUENCE = 338, TOK_SET = 339, TOK_SIZE = 340, TOK_STRING = 341, TOK_SYNTAX = 342, TOK_T61String = 343, TOK_TAGS = 344, TOK_TeletexString = 345, TOK_TRUE = 346, TOK_TYPE_IDENTIFIER = 347, TOK_UNIQUE = 348, TOK_UNIVERSAL = 349, TOK_UniversalString = 350, TOK_UTCTime = 351, TOK_UTF8String = 352, TOK_VideotexString = 353, TOK_VisibleString = 354, TOK_WITH = 355, TOK_EXCEPT = 356, TOK_INTERSECTION = 357, TOK_UNION = 358, TOK_TwoDots = 359, TOK_ThreeDots = 360 }; #endif #define TOK_PPEQ 258 #define TOK_whitespace 259 #define TOK_opaque 260 #define TOK_bstring 261 #define TOK_cstring 262 #define TOK_hstring 263 #define TOK_identifier 264 #define TOK_number 265 #define TOK_number_negative 266 #define TOK_realnumber 267 #define TOK_tuple 268 #define TOK_quadruple 269 #define TOK_typereference 270 #define TOK_capitalreference 271 #define TOK_typefieldreference 272 #define TOK_valuefieldreference 273 #define TOK_Literal 274 #define TOK_ABSENT 275 #define TOK_ABSTRACT_SYNTAX 276 #define TOK_ALL 277 #define TOK_ANY 278 #define TOK_APPLICATION 279 #define TOK_AUTOMATIC 280 #define TOK_BEGIN 281 #define TOK_BIT 282 #define TOK_BMPString 283 #define TOK_BOOLEAN 284 #define TOK_BY 285 #define TOK_CHARACTER 286 #define TOK_CHOICE 287 #define TOK_CLASS 288 #define TOK_COMPONENT 289 #define TOK_COMPONENTS 290 #define TOK_CONSTRAINED 291 #define TOK_CONTAINING 292 #define TOK_DEFAULT 293 #define TOK_DEFINITIONS 294 #define TOK_DEFINED 295 #define TOK_EMBEDDED 296 #define TOK_ENCODED 297 #define TOK_ENCODING_CONTROL 298 #define TOK_END 299 #define TOK_ENUMERATED 300 #define TOK_EXPLICIT 301 #define TOK_EXPORTS 302 #define TOK_EXTENSIBILITY 303 #define TOK_EXTERNAL 304 #define TOK_FALSE 305 #define TOK_FROM 306 #define TOK_GeneralizedTime 307 #define TOK_GeneralString 308 #define TOK_GraphicString 309 #define TOK_IA5String 310 #define TOK_IDENTIFIER 311 #define TOK_IMPLICIT 312 #define TOK_IMPLIED 313 #define TOK_IMPORTS 314 #define TOK_INCLUDES 315 #define TOK_INSTANCE 316 #define TOK_INSTRUCTIONS 317 #define TOK_INTEGER 318 #define TOK_ISO646String 319 #define TOK_MAX 320 #define TOK_MIN 321 #define TOK_MINUS_INFINITY 322 #define TOK_NULL 323 #define TOK_NumericString 324 #define TOK_OBJECT 325 #define TOK_ObjectDescriptor 326 #define TOK_OCTET 327 #define TOK_OF 328 #define TOK_OPTIONAL 329 #define TOK_PATTERN 330 #define TOK_PDV 331 #define TOK_PLUS_INFINITY 332 #define TOK_PRESENT 333 #define TOK_PrintableString 334 #define TOK_PRIVATE 335 #define TOK_REAL 336 #define TOK_RELATIVE_OID 337 #define TOK_SEQUENCE 338 #define TOK_SET 339 #define TOK_SIZE 340 #define TOK_STRING 341 #define TOK_SYNTAX 342 #define TOK_T61String 343 #define TOK_TAGS 344 #define TOK_TeletexString 345 #define TOK_TRUE 346 #define TOK_TYPE_IDENTIFIER 347 #define TOK_UNIQUE 348 #define TOK_UNIVERSAL 349 #define TOK_UniversalString 350 #define TOK_UTCTime 351 #define TOK_UTF8String 352 #define TOK_VideotexString 353 #define TOK_VisibleString 354 #define TOK_WITH 355 #define TOK_EXCEPT 356 #define TOK_INTERSECTION 357 #define TOK_UNION 358 #define TOK_TwoDots 359 #define TOK_ThreeDots 360 #ifndef YYSTYPE #line 88 "asn1p_y.y" typedef union { asn1p_t *a_grammar; asn1p_module_flags_e a_module_flags; asn1p_module_t *a_module; asn1p_expr_type_e a_type; /* ASN.1 Type */ asn1p_expr_t *a_expr; /* Constructed collection */ asn1p_constraint_t *a_constr; /* Constraint */ enum asn1p_constraint_type_e a_ctype;/* Constraint type */ asn1p_xports_t *a_xports; /* IMports/EXports */ struct AssignedIdentifier a_aid; /* Assigned Identifier */ asn1p_oid_t *a_oid; /* Object Identifier */ asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */ struct asn1p_type_tag_s a_tag; /* A tag */ asn1p_ref_t *a_ref; /* Reference to custom type */ asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */ asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */ struct asn1p_ref_component_s a_refcomp; /* Component of a reference */ asn1p_value_t *a_value; /* Number, DefinedValue, etc */ struct asn1p_param_s a_parg; /* A parameter argument */ asn1p_paramlist_t *a_plist; /* A pargs list */ struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */ enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */ asn1c_integer_t a_int; double a_dbl; char *tv_str; struct { char *buf; int len; } tv_opaque; struct { char *name; struct asn1p_type_tag_s tag; } tv_nametag; } yystype; /* Line 1281 of /usr/local/share/bison/yacc.c. */ #line 285 "asn1p_y.h" # define YYSTYPE yystype #endif extern YYSTYPE asn1p_lval; #endif /* not BISON_ASN_P_Y_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_value.h0000644000000000000000000000437511505405150017372 0ustar rootroot/* * A generic value of different syntaxes. */ #ifndef ASN1_PARSER_VALUE_H #define ASN1_PARSER_VALUE_H struct asn1p_constraint_s; /* Forward declaration */ struct asn1p_expr_s; /* * A wrapper around various kinds of values. */ typedef struct asn1p_value_s { /* * The value of the element. */ enum { ATV_NOVALUE, ATV_TYPE, /* A type (as in CONTAINING Type) */ ATV_NULL, /* A "NULL" value of type NULL. */ ATV_REAL, /* A constant floating-point value */ ATV_INTEGER, /* An integer constant */ ATV_MAX, ATV_MIN, ATV_TRUE, ATV_FALSE, ATV_TUPLE, /* { 1, 15 } */ ATV_QUADRUPLE, /* { 0, 14, 0, 255 } */ ATV_STRING, /* "abcdef" */ ATV_UNPARSED, ATV_BITVECTOR, ATV_VALUESET, /* { 1 | 2 | 3 } */ ATV_REFERENCED, /* Reference to a value defined elsewhere */ ATV_CHOICE_IDENTIFIER, /* ChoiceIdentifier value */ } type; /* Value type and location */ union { struct asn1p_constraint_s *constraint; /* ValueSet */ struct asn1p_expr_s *v_type; /* Type */ asn1p_ref_t *reference; asn1c_integer_t v_integer; double v_double; /* * Binary bits vector. */ struct { uint8_t *buf; int size; } string; struct { uint8_t *bits; int size_in_bits; } binary_vector; struct { char *identifier; struct asn1p_value_s *value; } choice_identifier; } value; } asn1p_value_t; /* * Destructor and constructors for value. * If ref, bits or buffer are omitted, the corresponding function returns * (asn1p_value_t *)0 with errno = EINVAL. * Allocated value (where applicable) is guaranteed to be NUL-terminated. */ void asn1p_value_free(asn1p_value_t *); asn1p_value_t *asn1p_value_fromref(asn1p_ref_t *ref, int do_copy); asn1p_value_t *asn1p_value_fromconstr(struct asn1p_constraint_s *ct, int dc); asn1p_value_t *asn1p_value_frombits(uint8_t *bits, int size_in_bits, int dc); asn1p_value_t *asn1p_value_frombuf(char *buffer, int size, int do_copy); asn1p_value_t *asn1p_value_fromdouble(double); asn1p_value_t *asn1p_value_fromint(asn1c_integer_t); asn1p_value_t *asn1p_value_fromtype(struct asn1p_expr_s *); asn1p_value_t *asn1p_value_clone(asn1p_value_t *); asn1p_value_t *asn1p_value_clone_with_resolver(asn1p_value_t *, asn1p_value_t *(*resolver)(asn1p_value_t *, void *rarg), void *rarg); #endif /* ASN1_PARSER_VALUE_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_param.h0000644000000000000000000000134711472004364017357 0ustar rootroot/* * Structures and prototypes related to parameterization */ #ifndef ASN1_PARSER_PARAMETERIZATION_H #define ASN1_PARSER_PARAMETERIZATION_H struct asn1p_expr_s; /* Forward declaration */ typedef struct asn1p_paramlist_s { struct asn1p_param_s { /* Translated from */ asn1p_ref_t *governor; char *argument; } *params; int params_count; int params_size; int _lineno; } asn1p_paramlist_t; /* * Constructor and destructor. */ asn1p_paramlist_t *asn1p_paramlist_new(int _lineno); void asn1p_paramlist_free(asn1p_paramlist_t *); asn1p_paramlist_t *asn1p_paramlist_clone(asn1p_paramlist_t *ref); int asn1p_paramlist_add_param(asn1p_paramlist_t *, asn1p_ref_t *opt_gov, char *arg); #endif /* ASN1_PARSER_PARAMETERIZATION_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1parser.c0000644000000000000000000000601012015121740017207 0ustar rootroot#include #include #include #include #include #include #include #include "asn1parser.h" #include "asn1p_list.h" int asn1p_parse(void **param); void *asn1p__scan_bytes(const char *, int len); void *asn1p__delete_buffer(void *); void *asn1p_restart(FILE *); extern int asn1p_lineno; static int _asn1p_set_flags(enum asn1p_flags flags); static int _asn1p_fix_modules(asn1p_t *a, const char *fname); /* * Parse the given buffer. */ asn1p_t * asn1p_parse_buffer(const char *buffer, int size /* = -1 */, enum asn1p_flags flags) { asn1p_t *a = 0; void *ap; void *ybuf; int ret; if(_asn1p_set_flags(flags)) { /* EINVAL */ return 0; } if(size < 0) size = (int)strlen(buffer); ybuf = asn1p__scan_bytes(buffer, size); if(!ybuf) { assert(ybuf); return 0; } asn1p_lineno = 1; ap = (void *)&a; ret = asn1p_parse(ap); asn1p__delete_buffer(ybuf); if(ret == 0) { assert(a); if(_asn1p_fix_modules(a, "-")) return NULL; /* FIXME: destroy (a) */ } else if(a) { asn1p_delete(a); a = NULL; } return a; } /* * Parse the file identified by its name. */ asn1p_t * asn1p_parse_file(const char *filename, enum asn1p_flags flags) { #ifndef _WIN32 struct stat sb; #endif asn1p_t *a = 0; void *ap; FILE *fp; int ret; if(_asn1p_set_flags(flags)) { /* EINVAL */ return 0; } fp = fopen(filename, "r"); if(fp == NULL) { perror(filename); return NULL; } #ifndef _WIN32 if(fstat(fileno(fp), &sb) || !S_ISREG(sb.st_mode)) { fclose(fp); fprintf(stderr, "%s file not recognized: Bad file format\n", filename); errno = EINVAL; return NULL; } #endif /* _WIN32 */ asn1p_lineno = 1; asn1p_restart(fp); ap = (void *)&a; ret = asn1p_parse(ap); fclose(fp); if(ret == 0) { assert(a); if(_asn1p_fix_modules(a, filename)) return NULL; /* FIXME: destroy (a) */ } else if(a) { asn1p_delete(a); a = NULL; } return a; } extern int asn1p_lexer_types_year; extern int asn1p_lexer_constructs_year; extern int asn1p__flex_debug; static int _asn1p_set_flags(enum asn1p_flags flags) { asn1p_lexer_types_year = 0; asn1p_lexer_constructs_year = 0; asn1p__flex_debug = 0; /* * Enable debugging in lexer. */ if(flags & A1P_LEXER_DEBUG) { flags &= ~A1P_LEXER_DEBUG; asn1p__flex_debug = 1; } /* * Check that we haven't missed an unknown flag. */ if(flags) { errno = EINVAL; return -1; } return 0; } static int _asn1p_fix_modules(asn1p_t *a, const char *fname) { asn1p_module_t *mod; TQ_FOR(mod, &(a->modules), mod_next) { mod->source_file_name = strdup(fname); if(mod->source_file_name == NULL) return -1; mod->asn1p = a; } return 0; } int asn1p_atoi(const char *ptr, asn1c_integer_t *value) { errno = 0; /* Clear the error code */ if(sizeof(*value) <= sizeof(int)) { *value = strtol(ptr, 0, 10); } else { #ifdef HAVE_STRTOIMAX *value = strtoimax(ptr, 0, 10); #elif HAVE_STRTOLL *value = strtoll(ptr, 0, 10); #else *value = strtol(ptr, 0, 10); #endif } return errno == 0 ? 0 : -1; } asn1c-0.9.24+dfsg/libasn1parser/asn1parser.h0000644000000000000000000000413111472004364017226 0ustar rootroot/* * This is a parser of the ASN.1 grammar. */ #ifndef ASN1PARSER_H #define ASN1PARSER_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_SYS_TYPES_H #include #endif /* HAVE_SYS_TYPES_H */ #ifdef HAVE_INTTYPES_H #include /* POSIX 1003.1-2001, C99 */ #else /* HAVE_INTTYPES_H */ #ifdef HAVE_STDINT_H #include /* SUSv2+ */ #endif /* HAVE_STDINT_H */ #endif /* HAVE_INTTYPES_H */ /* * Basic integer type used in numerous places. * ASN.1 does not define any limits on this number, so it must be sufficiently * large to accomodate typical inputs. It does not have to be a dynamically * allocated type with potentially unlimited width: consider the width of * an integer defined here as one of the "compiler limitations". * NOTE: this is NOT a type for ASN.1 "INTEGER" type representation, this * type is used by the compiler itself to handle large integer values * specified inside ASN.1 grammar. */ typedef intmax_t asn1c_integer_t; #ifdef PRIdMAX #define PRIdASN PRIdMAX #define PRIuASN PRIuMAX #else #define PRIdASN "lld" /* Or j? */ #define PRIuASN "llu" /* Or j? */ #endif #include "asn1p_list.h" #include "asn1p_oid.h" /* Object identifiers (OIDs) */ #include "asn1p_ref.h" /* References to custom types */ #include "asn1p_value.h" /* Value definition */ #include "asn1p_param.h" /* Parameterization */ #include "asn1p_constr.h" /* Type Constraints */ #include "asn1p_xports.h" /* IMports/EXports */ #include "asn1p_module.h" /* ASN.1 definition module */ #include "asn1p_class.h" /* CLASS-related stuff */ #include "asn1p_expr.h" /* A single ASN.1 expression */ /* * Parser flags. */ enum asn1p_flags { A1P_NOFLAGS, /* * Enable verbose debugging output from lexer. */ A1P_LEXER_DEBUG = 0x0001 }; /* * Perform low-level parsing of ASN.1 module[s] * and return a list of module trees. */ asn1p_t *asn1p_parse_file(const char *filename, enum asn1p_flags); asn1p_t *asn1p_parse_buffer(const char *buffer, int size /* = -1 */, enum asn1p_flags); int asn1p_atoi(const char *ptr, asn1c_integer_t *r_value); #endif /* ASN1PARSER_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_xports.c0000644000000000000000000000102411472004364017601 0ustar rootroot#include #include #include "asn1parser.h" /* * Construct a new structure that would hold the EXPORTS or IMPORTS * clause data. */ asn1p_xports_t * asn1p_xports_new() { asn1p_xports_t *xp; xp = calloc(1, sizeof *xp); if(xp) { TQ_INIT(&(xp->members)); } return xp; } /* * Destroy the xports structure. */ void asn1p_xports_free(asn1p_xports_t *xp) { if(xp) { if(xp->fromModuleName) free(xp->fromModuleName); if(xp->identifier.oid) asn1p_oid_free(xp->identifier.oid); free(xp); } } asn1c-0.9.24+dfsg/libasn1parser/asn1p_expr.h0000644000000000000000000001634211472004364017236 0ustar rootroot/* * A collection of data members of unspecified types. */ #ifndef ASN1_PARSER_EXPR_H #define ASN1_PARSER_EXPR_H /* * Meta type of the ASN expression. */ typedef enum asn1p_expr_meta { AMT_INVALID, AMT_TYPE, /* Type1 ::= INTEGER */ AMT_TYPEREF, /* Type2 ::= Type1 */ AMT_VALUE, /* value1 Type1 ::= 1 */ AMT_VALUESET, /* ValueSet Type1 ::= { value1 } */ AMT_OBJECT, /* object CLASS ::= {...} */ AMT_OBJECTCLASS, /* FUNCTION ::= CLASS {...} */ AMT_OBJECTFIELD, /* ... */ AMT_EXPR_META_MAX } asn1p_expr_meta_e; /* * ASN type of the expression. */ typedef enum asn1p_expr_type { /* * Internal types. */ A1TC_INVALID, /* Invalid type */ A1TC_REFERENCE, /* Reference to the type defined elsewhere */ A1TC_EXPORTVAR, /* We're exporting this definition */ A1TC_UNIVERVAL, /* A value of an ENUMERATED, INTEGER or BS */ A1TC_BITVECTOR, /* A plain collection of bits */ A1TC_OPAQUE, /* Opaque data encoded as a bitvector */ A1TC_EXTENSIBLE, /* An extension marker "..." */ A1TC_COMPONENTS_OF, /* COMPONENTS OF clause */ A1TC_VALUESET, /* Value set definition */ A1TC_CLASSDEF, /* Information Object Class */ A1TC_INSTANCE, /* Instance of Object Class */ /* * ASN.1 Class field types */ #define ASN_CLASSFIELD_MASK 0x10 /* Every class field type */ A1TC_CLASSFIELD_TFS = ASN_CLASSFIELD_MASK, /* TypeFieldSpec */ A1TC_CLASSFIELD_FTVFS, /* FixedTypeValueFieldSpec */ A1TC_CLASSFIELD_VTVFS, /* VariableTypeValueFieldSpec */ A1TC_CLASSFIELD_FTVSFS, /* FixedTypeValueSetFieldSpec */ A1TC_CLASSFIELD_VTVSFS, /* VariableTypeValueSetFieldSpec */ A1TC_CLASSFIELD_OFS, /* ObjectFieldSpec */ A1TC_CLASSFIELD_OSFS, /* ObjectSetFieldSpec */ /* * ASN.1 Constructed types */ #define ASN_CONSTR_MASK 0x20 /* Every constructed type */ ASN_CONSTR_SEQUENCE = ASN_CONSTR_MASK, /* SEQUENCE */ ASN_CONSTR_CHOICE, /* CHOICE */ ASN_CONSTR_SET, /* SET */ ASN_CONSTR_SEQUENCE_OF, /* SEQUENCE OF */ ASN_CONSTR_SET_OF, /* SET OF */ /* * ASN.1 Basic types */ #define ASN_BASIC_MASK 0x40 /* Every basic type */ ASN_TYPE_ANY = ASN_BASIC_MASK, /* ANY (deprecated) */ ASN_BASIC_BOOLEAN, ASN_BASIC_NULL, ASN_BASIC_INTEGER, ASN_BASIC_REAL, ASN_BASIC_ENUMERATED, ASN_BASIC_BIT_STRING, ASN_BASIC_OCTET_STRING, ASN_BASIC_OBJECT_IDENTIFIER, ASN_BASIC_RELATIVE_OID, ASN_BASIC_EXTERNAL, ASN_BASIC_EMBEDDED_PDV, ASN_BASIC_CHARACTER_STRING, ASN_BASIC_UTCTime, ASN_BASIC_GeneralizedTime, /* * ASN.1 String types */ #define ASN_STRING_KM_MASK 0x100 /* Known multiplier */ #define ASN_STRING_NKM_MASK 0x200 /* Not a known multiplier */ #define ASN_STRING_MASK 0x300 /* Every restricted string type */ ASN_STRING_IA5String = ASN_STRING_KM_MASK, ASN_STRING_PrintableString, ASN_STRING_VisibleString, ASN_STRING_ISO646String, /* aka VisibleString */ ASN_STRING_NumericString, ASN_STRING_UniversalString, ASN_STRING_BMPString, ASN_STRING_UTF8String = ASN_STRING_NKM_MASK, ASN_STRING_GeneralString, ASN_STRING_GraphicString, ASN_STRING_TeletexString, ASN_STRING_T61String, ASN_STRING_VideotexString, ASN_STRING_ObjectDescriptor, ASN_EXPR_TYPE_MAX } asn1p_expr_type_e; #include "asn1p_expr_str.h" #include "asn1p_expr2uclass.h" struct asn1p_module_s; /* Forward declaration */ /* * A named collection of types. */ typedef struct asn1p_expr_s { /* * Human readable name. */ char *Identifier; /* * Meta type of the expression (type, value, value set, etc). */ asn1p_expr_meta_e meta_type; /* * ASN type of the expression. */ asn1p_expr_type_e expr_type; /* * Referenced type, defined elsewhere. * (If expr_type == A1TC_REFERENCE) */ asn1p_ref_t *reference; /* * Constraints for the type. */ asn1p_constraint_t *constraints; /* * This field is holding the transformed constraints, with all the * parent constraints taken into account. */ asn1p_constraint_t *combined_constraints; /* * Left hand side parameters for parametrized type declaration * Type{Param1, Param2} ::= SEQUENCE { a Param1, b Param2 } */ asn1p_paramlist_t *lhs_params; /* * Right hand type specialization. * Type2 ::= Type{Param1} */ struct asn1p_expr_s *rhs_pspecs; /* ->members */ /* * If lhs_params is defined, this structure represents all possible * specializations of the parent expression. */ struct { struct asn1p_pspec_s { struct asn1p_expr_s *rhs_pspecs; struct asn1p_expr_s *my_clone; } *pspec; int pspecs_count; /* Number of specializations */ } specializations; int spec_index; /* -1, or 0-based specialization index in the parent */ /* * The actual value (DefinedValue or inlined value). */ asn1p_value_t *value; /* * The WITH SYNTAX clause. */ asn1p_wsyntx_t *with_syntax; /* Information Object Class matrix, specific for this class */ struct asn1p_ioc_matrix_s { asn1p_ioc_row_t **row; int rows; int max_identifier_length; } object_class_matrix; /* * A tag. */ struct asn1p_type_tag_s { enum { TC_NOCLASS, TC_UNIVERSAL, TC_APPLICATION, TC_CONTEXT_SPECIFIC, TC_PRIVATE, } tag_class; enum { TM_DEFAULT, TM_IMPLICIT, TM_EXPLICIT, } tag_mode; asn1c_integer_t tag_value; } tag; struct asn1p_expr_marker_s { enum asn1p_expr_marker_e { EM_NOMARK, EM_INDIRECT = 0x01, /* 00001 Represent as pointer */ EM_OMITABLE = 0x02, /* 00010 May be absent in encoding */ EM_OPTIONAL = 0x07, /* 00111 Optional member */ EM_DEFAULT = 0x0F, /* 01111 default_value */ EM_UNRECURSE = 0x10, /* 10000 Use safe naming */ } flags; asn1p_value_t *default_value; /* For EM_DEFAULT case */ } marker; int unique; /* UNIQUE */ /* * Whether automatic tagging may be applied for subtypes. */ int auto_tags_OK; /* * Members of the constructed type. */ TQ_HEAD(struct asn1p_expr_s) members; /* * Next expression in the list. */ TQ_ENTRY(struct asn1p_expr_s) next; struct asn1p_expr_s *parent_expr; /* optional */ struct asn1p_module_s *module; /* Defined in module */ /* * Line number where this structure is defined in the original * grammar source. */ int _lineno; /* * Marks are used for various purposes. * Here are some predefined ones. */ enum { TM_NOMARK = 0, TM_RECURSION = (1<<0), /* Used to break recursion */ TM_BROKEN = (1<<1), /* A warning was already issued */ TM_PERFROMCT = (1<<2), /* PER FROM() constraint tables emitted */ } _mark; /* * Some tags used by the compiler. */ int _anonymous_type; /* This type is unnamed */ int _type_unique_index; /* A per top-level-type unique index */ int _type_referenced; /* This type is referenced from another place */ /* * Opaque data may be attached to this structure, * probably by compiler. */ void *data; void (*data_free)(void *data); } asn1p_expr_t; /* * Constructor and destructor. */ asn1p_expr_t *asn1p_expr_new(int _lineno, struct asn1p_module_s *); asn1p_expr_t *asn1p_expr_clone(asn1p_expr_t *, int skip_extensions); asn1p_expr_t *asn1p_expr_clone_with_resolver(asn1p_expr_t *, asn1p_expr_t *(*resolver)(asn1p_expr_t *to_resolve, void *resolver_arg), void *resolver_arg); void asn1p_expr_add(asn1p_expr_t *to, asn1p_expr_t *what); void asn1p_expr_free(asn1p_expr_t *expr); #define TAG2STRING_BUFFER_SIZE 64 /* buf should be at least this big */ char *asn1p_tag2string(struct asn1p_type_tag_s *tag, char *opt_buf); #endif /* ASN1_PARSER_EXPR_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_expr_str.h0000644000000000000000000000420411505405150020113 0ustar rootroot/* * This file is automatically generated by ./expr-h.pl * DO NOT EDIT MANUALLY, fix the ./expr-h.pl instead if necessary. */ #ifndef ASN1_PARSER_EXPR_STR_H #define ASN1_PARSER_EXPR_STR_H #ifndef __GNUC__ #define __attribute__(x) /* unused */ #endif static char *asn1p_expr_type2str[] __attribute__ ((unused)) = { [ ASN_CONSTR_SEQUENCE ] = "SEQUENCE", [ ASN_CONSTR_CHOICE ] = "CHOICE", [ ASN_CONSTR_SET ] = "SET", [ ASN_CONSTR_SEQUENCE_OF ] = "SEQUENCE OF", [ ASN_CONSTR_SET_OF ] = "SET OF", [ ASN_TYPE_ANY ] = "ANY", [ ASN_BASIC_BOOLEAN ] = "BOOLEAN", [ ASN_BASIC_NULL ] = "NULL", [ ASN_BASIC_INTEGER ] = "INTEGER", [ ASN_BASIC_REAL ] = "REAL", [ ASN_BASIC_ENUMERATED ] = "ENUMERATED", [ ASN_BASIC_BIT_STRING ] = "BIT STRING", [ ASN_BASIC_OCTET_STRING ] = "OCTET STRING", [ ASN_BASIC_OBJECT_IDENTIFIER ] = "OBJECT IDENTIFIER", [ ASN_BASIC_RELATIVE_OID ] = "RELATIVE-OID", [ ASN_BASIC_EXTERNAL ] = "EXTERNAL", [ ASN_BASIC_EMBEDDED_PDV ] = "EMBEDDED PDV", [ ASN_BASIC_CHARACTER_STRING ] = "CHARACTER STRING", [ ASN_BASIC_UTCTime ] = "UTCTime", [ ASN_BASIC_GeneralizedTime ] = "GeneralizedTime", [ ASN_STRING_IA5String ] = "IA5String", [ ASN_STRING_PrintableString ] = "PrintableString", [ ASN_STRING_VisibleString ] = "VisibleString", [ ASN_STRING_ISO646String ] = "ISO646String", [ ASN_STRING_NumericString ] = "NumericString", [ ASN_STRING_UniversalString ] = "UniversalString", [ ASN_STRING_BMPString ] = "BMPString", [ ASN_STRING_UTF8String ] = "UTF8String", [ ASN_STRING_GeneralString ] = "GeneralString", [ ASN_STRING_GraphicString ] = "GraphicString", [ ASN_STRING_TeletexString ] = "TeletexString", [ ASN_STRING_T61String ] = "T61String", [ ASN_STRING_VideotexString ] = "VideotexString", [ ASN_STRING_ObjectDescriptor ] = "ObjectDescriptor", }; /* * Convert the ASN.1 expression type back into the string representation. */ #define ASN_EXPR_TYPE2STR(type) \ ( \ (((ssize_t)(type)) < 0 \ || ((size_t)(type)) >= sizeof(asn1p_expr_type2str) \ / sizeof(asn1p_expr_type2str[0])) \ ? (char *)0 \ : asn1p_expr_type2str[(int)(type)] \ ) #endif /* ASN1_PARSER_EXPR_STR_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_ref.h0000644000000000000000000000300511472004364017024 0ustar rootroot/* * Generic reference to the yet unknown type defined elsewhere. */ #ifndef ASN1_PARSER_REFERENCE_H #define ASN1_PARSER_REFERENCE_H typedef struct asn1p_ref_s { /* * A set of reference name components. * A reference name consists of several components separated by dots: * "OBJECT-CLASS.&Algorithm.&id" */ struct asn1p_ref_component_s { enum asn1p_ref_lex_type_e { RLT_UNKNOWN, /* Invalid? */ /* * Object class reference "OCLASS1", * type reference "Type1", * value reference "id", * type field reference "&Type1", * value field reference "&id", * "OBJECT-CLASS" */ RLT_CAPITALS, RLT_Uppercase, RLT_lowercase, RLT_AmpUppercase, RLT_Amplowercase, RLT_Atlowercase, RLT_AtDotlowercase, RLT_MAX } lex_type; /* Inferred lexical type of the identifier */ char *name; /* An identifier */ } *components; int comp_count; /* Number of the components in the reference name. */ int comp_size; /* Number of allocated structures */ int _lineno; /* Number of line in the file */ } asn1p_ref_t; /* * Constructor and destructor. */ asn1p_ref_t *asn1p_ref_new(int _lineno); void asn1p_ref_free(asn1p_ref_t *); asn1p_ref_t *asn1p_ref_clone(asn1p_ref_t *ref); /* * Add a new reference component to the existing reference structure. * * RETURN VALUES: * 0: All clear. * -1/EINVAL: Invalid arguments * -1/ENOMEM: Memory allocation failed */ int asn1p_ref_add_component(asn1p_ref_t *, char *name, enum asn1p_ref_lex_type_e); #endif /* ASN1_PARSER_REFERENCE_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_constr.c0000644000000000000000000000775711472004364017575 0ustar rootroot#include #include #include #include #include #include "asn1parser.h" asn1p_constraint_t * asn1p_constraint_new(int _lineno) { asn1p_constraint_t *ct; ct = calloc(1, sizeof(*ct)); if(ct) { ct->_lineno = _lineno; } return ct; } void asn1p_constraint_free(asn1p_constraint_t *ct) { if(ct) { if(ct->containedSubtype) asn1p_value_free(ct->containedSubtype); if(ct->value) asn1p_value_free(ct->value); if(ct->range_start) asn1p_value_free(ct->range_start); if(ct->range_stop) asn1p_value_free(ct->range_stop); if(ct->elements) { while(ct->el_count--) { asn1p_constraint_free( ct->elements[ct->el_count]); } free(ct->elements); } free(ct); } } asn1p_constraint_t * asn1p_constraint_clone(asn1p_constraint_t *src) { return asn1p_constraint_clone_with_resolver(src, 0, 0); } asn1p_constraint_t * asn1p_constraint_clone_with_resolver(asn1p_constraint_t *src, asn1p_value_t *(*vr)(asn1p_value_t *, void *varg), void *varg) { asn1p_constraint_t *clone; #define CLONE(field, func) do { if(src->field) { \ clone->field = func(src->field, vr, varg); \ if(clone->field == NULL) { \ asn1p_constraint_free(clone); \ return NULL; \ } \ } } while(0) clone = asn1p_constraint_new(src->_lineno); if(clone) { unsigned int i; clone->type = src->type; clone->presence = src->presence; CLONE(containedSubtype, asn1p_value_clone_with_resolver); CLONE(value, asn1p_value_clone_with_resolver); CLONE(range_start, asn1p_value_clone_with_resolver); CLONE(range_stop, asn1p_value_clone_with_resolver); for(i = 0; i < src->el_count; i++) { asn1p_constraint_t *t; t = asn1p_constraint_clone_with_resolver(src->elements[i], vr, varg); if(!t) { asn1p_constraint_free(clone); return NULL; } if(asn1p_constraint_insert(clone, t)) { asn1p_constraint_free(clone); asn1p_constraint_free(t); return NULL; } } assert(clone->el_count == src->el_count); clone->_lineno = src->_lineno; } return clone; } /* * Make sure there's enough space to add an element. */ static int asn1p_constraint_make_memory(asn1p_constraint_t *ct) { if(ct->el_count == ct->el_size) { unsigned int newsize = ct->el_size ? ct->el_size << 2 : 4; void *p; p = realloc(ct->elements, newsize * sizeof(ct->elements[0])); if(p) { ct->elements = p; ct->el_size = newsize; } else { return -1; } } return 0; } int asn1p_constraint_insert(asn1p_constraint_t *into, asn1p_constraint_t *what) { assert(into); assert(what); if(asn1p_constraint_make_memory(into)) return -1; into->elements[into->el_count++] = what; return 0; } int asn1p_constraint_prepend(asn1p_constraint_t *before, asn1p_constraint_t *what) { assert(before); assert(what); if(asn1p_constraint_make_memory(before)) return -1; memmove(&before->elements[1], &before->elements[0], before->el_count * sizeof(before->elements[0])); before->elements[0] = what; before->el_count++; return 0; } char * asn1p_constraint_type2str(enum asn1p_constraint_type_e type) { switch(type) { case ACT_INVALID: return "INVALID"; case ACT_EL_TYPE: return "ContainedSubtype"; case ACT_EL_VALUE: return "SingleValue"; case ACT_EL_RANGE: case ACT_EL_LLRANGE: case ACT_EL_RLRANGE: case ACT_EL_ULRANGE: return "ValueRange"; case ACT_EL_EXT: return "..."; case ACT_CT_SIZE: return "SizeConstraint"; case ACT_CT_FROM: return "PermittedAlphabet"; case ACT_CT_WCOMP: return "SingleTypeConstraint"; case ACT_CT_WCOMPS: return "MultipleTypeConstraints"; case ACT_CT_CTDBY: return "UserDefinedConstraint"; case ACT_CT_CTNG: return "ContentsConstraint"; case ACT_CT_PATTERN: return "PatternConstraint"; case ACT_CA_SET: return "SET"; case ACT_CA_CRC: return "ComponentRelationConstraint"; case ACT_CA_CSV: return "CSV"; case ACT_CA_UNI: return "UNION"; case ACT_CA_INT: return "INTERSECTION"; case ACT_CA_EXC: return "EXCEPT"; case ACT_CA_AEX: return "ALL EXCEPT"; } return "UNKNOWN"; } asn1c-0.9.24+dfsg/libasn1parser/Makefile.in0000644000000000000000000003724212121077110017043 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libasn1parser DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libasn1parser_la_LIBADD = am_libasn1parser_la_OBJECTS = asn1parser.lo asn1p_y.lo asn1p_l.lo \ asn1p_module.lo asn1p_oid.lo asn1p_value.lo asn1p_expr.lo \ asn1p_xports.lo asn1p_constr.lo asn1p_param.lo asn1p_class.lo \ asn1p_ref.lo libasn1parser_la_OBJECTS = $(am_libasn1parser_la_OBJECTS) libasn1parser_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libasn1parser_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libasn1parser_la_SOURCES) DIST_SOURCES = $(libasn1parser_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = @ADD_CFLAGS@ AM_YFLAGS = -p asn1p_ -d AM_LFLAGS = -s -p -Cem -Pasn1p_ -olex.yy.c noinst_LTLIBRARIES = libasn1parser.la libasn1parser_la_LDFLAGS = -all-static libasn1parser_la_SOURCES = \ asn1parser.c asn1parser.h \ asn1p_y.c asn1p_y.h asn1p_l.c \ asn1p_module.c asn1p_module.h \ asn1p_oid.c asn1p_oid.h \ asn1p_value.c asn1p_value.h \ asn1p_expr.c asn1p_expr.h \ asn1p_expr_str.h \ asn1p_expr2uclass.h \ asn1p_xports.c asn1p_xports.h \ asn1p_constr.c asn1p_constr.h \ asn1p_param.c asn1p_param.h \ asn1p_class.c asn1p_class.h \ asn1p_ref.c asn1p_ref.h \ asn1p_list.h EXTRA_DIST = expr-h.pl all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libasn1parser/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libasn1parser/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libasn1parser.la: $(libasn1parser_la_OBJECTS) $(libasn1parser_la_DEPENDENCIES) $(libasn1parser_la_LINK) $(libasn1parser_la_OBJECTS) $(libasn1parser_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_class.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_constr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_expr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_l.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_oid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_param.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_ref.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_value.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_xports.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1p_y.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1parser.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am asn1parser.h: asn1p_expr_str.h asn1p_expr_str.h: expr-h.pl asn1p_expr.h ./expr-h.pl asn1p_expr.h > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/libasn1parser/asn1p_xports.h0000644000000000000000000000153311472004364017613 0ustar rootroot/* * Imports and exports structure. */ #ifndef ASN1_PARSE_XPORTS_H #define ASN1_PARSE_XPORTS_H typedef struct asn1p_xports_s { /* * Type of the xports structure. */ enum asn1p_xports { XPT_IMPORTS, XPT_EXPORTS, } xports_type; /* * Module name and optional OID, occur after FROM. */ char *fromModuleName; /* Name of the module */ struct AssignedIdentifier { asn1p_oid_t *oid; /* Optional OID of the module */ asn1p_value_t *value; /* DefinedValue */ } identifier; /* * Number of entities to import. */ TQ_HEAD(struct asn1p_expr_s) members; /* * Pointer to the next xports structure in whatever list. */ TQ_ENTRY(struct asn1p_xports_s) xp_next; } asn1p_xports_t; /* * Constructor and destructor. */ asn1p_xports_t *asn1p_xports_new(void); void asn1p_xports_free(asn1p_xports_t *); #endif /* ASN1_PARSE_XPORTS_H */ asn1c-0.9.24+dfsg/libasn1parser/asn1p_value.c0000644000000000000000000001313611505405150017360 0ustar rootroot#include #include #include #include #include "asn1parser.h" asn1p_value_t * asn1p_value_fromref(asn1p_ref_t *ref, int do_copy) { if(ref) { asn1p_value_t *v = calloc(1, sizeof *v); if(v) { if(do_copy) { v->value.reference = asn1p_ref_clone(ref); if(v->value.reference == NULL) { free(v); return NULL; } } else { v->value.reference = ref; } v->type = ATV_REFERENCED; } return v; } else { errno = EINVAL; return NULL; } } asn1p_value_t * asn1p_value_fromconstr(asn1p_constraint_t *ct, int do_copy) { if(ct) { asn1p_value_t *v = calloc(1, sizeof *v); if(v) { if(do_copy) { v->value.constraint = asn1p_constraint_clone(ct); if(v->value.constraint == NULL) { free(v); return NULL; } } else { v->value.constraint = ct; } v->type = ATV_VALUESET; } return v; } else { errno = EINVAL; return NULL; } } asn1p_value_t * asn1p_value_frombits(uint8_t *bits, int size_in_bits, int do_copy) { if(bits) { asn1p_value_t *v = calloc(1, sizeof *v); assert(size_in_bits >= 0); if(v) { if(do_copy) { int size = ((size_in_bits + 7) >> 3); void *p; p = malloc(size + 1); if(p) { memcpy(p, bits, size); ((char *)p)[size] = '\0'; /* JIC */ } else { free(v); return NULL; } v->value.binary_vector.bits = p; } else { v->value.binary_vector.bits = (void *)bits; } v->value.binary_vector.size_in_bits = size_in_bits; v->type = ATV_BITVECTOR; } return v; } else { errno = EINVAL; return NULL; } } asn1p_value_t * asn1p_value_frombuf(char *buffer, int size, int do_copy) { if(buffer) { asn1p_value_t *v = calloc(1, sizeof *v); assert(size >= 0); if(v) { if(do_copy) { void *p = malloc(size + 1); if(p) { memcpy(p, buffer, size); ((char *)p)[size] = '\0'; /* JIC */ } else { free(v); return NULL; } v->value.string.buf = p; } else { v->value.string.buf = (uint8_t *)buffer; } v->value.string.size = size; v->type = ATV_STRING; } return v; } else { errno = EINVAL; return NULL; } } asn1p_value_t * asn1p_value_fromdouble(double d) { asn1p_value_t *v = calloc(1, sizeof *v); if(v) { v->value.v_double = d; v->type = ATV_REAL; } return v; } asn1p_value_t * asn1p_value_fromint(asn1c_integer_t i) { asn1p_value_t *v = calloc(1, sizeof *v); if(v) { v->value.v_integer = i; v->type = ATV_INTEGER; } return v; } asn1p_value_t * asn1p_value_fromtype(asn1p_expr_t *expr) { asn1p_value_t *v = calloc(1, sizeof *v); if(v) { v->value.v_type = expr; v->type = ATV_TYPE; } return v; } asn1p_value_t * asn1p_value_clone(asn1p_value_t *v) { return asn1p_value_clone_with_resolver(v, 0, 0); } asn1p_value_t * asn1p_value_clone_with_resolver(asn1p_value_t *v, asn1p_value_t *(*resolver)(asn1p_value_t *, void *rarg), void *rarg) { asn1p_value_t *clone = NULL; if(v) { switch(v->type) { case ATV_NOVALUE: case ATV_NULL: return calloc(1, sizeof(*clone)); case ATV_REAL: return asn1p_value_fromdouble(v->value.v_double); case ATV_TYPE: return asn1p_value_fromtype(v->value.v_type); case ATV_INTEGER: case ATV_MIN: case ATV_MAX: case ATV_FALSE: case ATV_TRUE: case ATV_TUPLE: case ATV_QUADRUPLE: clone = asn1p_value_fromint(v->value.v_integer); if(clone) clone->type = v->type; return clone; case ATV_STRING: clone = asn1p_value_frombuf((char *)v->value.string.buf, v->value.string.size, 1); if(clone) clone->type = v->type; return clone; case ATV_UNPARSED: clone = asn1p_value_frombuf((char *)v->value.string.buf, v->value.string.size, 1); if(clone) clone->type = ATV_UNPARSED; return clone; case ATV_BITVECTOR: return asn1p_value_frombits(v->value.binary_vector.bits, v->value.binary_vector.size_in_bits, 1); case ATV_REFERENCED: if(resolver) { clone = resolver(v, rarg); if(clone) return clone; else if(errno != ESRCH) return NULL; } return asn1p_value_fromref(v->value.reference, 1); case ATV_VALUESET: if(resolver) { clone = resolver(v, rarg); if(clone) return clone; else if(errno != ESRCH) return NULL; } return asn1p_value_fromconstr(v->value.constraint, 1); case ATV_CHOICE_IDENTIFIER: { char *id = v->value.choice_identifier.identifier; clone = calloc(1, sizeof(*clone)); if(!clone) return NULL; clone->type = v->type; id = strdup(id); if(!id) { asn1p_value_free(clone); return NULL; } clone->value.choice_identifier.identifier = id; v = asn1p_value_clone(v->value.choice_identifier.value); if(!v) { asn1p_value_free(clone); return NULL; } clone->value.choice_identifier.value = v; return clone; } } assert(!"UNREACHABLE"); } return v; } void asn1p_value_free(asn1p_value_t *v) { if(v) { switch(v->type) { case ATV_NOVALUE: case ATV_NULL: break; case ATV_TYPE: asn1p_expr_free(v->value.v_type); break; case ATV_REAL: case ATV_INTEGER: case ATV_MIN: case ATV_MAX: case ATV_FALSE: case ATV_TRUE: case ATV_TUPLE: case ATV_QUADRUPLE: /* No freeing necessary */ break; case ATV_STRING: case ATV_UNPARSED: assert(v->value.string.buf); free(v->value.string.buf); break; case ATV_BITVECTOR: assert(v->value.binary_vector.bits); free(v->value.binary_vector.bits); break; case ATV_REFERENCED: asn1p_ref_free(v->value.reference); break; case ATV_VALUESET: asn1p_constraint_free(v->value.constraint); break; case ATV_CHOICE_IDENTIFIER: free(v->value.choice_identifier.identifier); asn1p_value_free(v->value.choice_identifier.value); break; } free(v); } } asn1c-0.9.24+dfsg/libasn1parser/asn1p_l.c0000644000000000000000000046544012015121740016505 0ustar rootroot#line 2 "asn1p_l.c" #line 4 "asn1p_l.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ /* %not-for-header */ /* %if-c-only */ /* %if-not-reentrant */ #define yy_create_buffer asn1p__create_buffer #define yy_delete_buffer asn1p__delete_buffer #define yy_flex_debug asn1p__flex_debug #define yy_init_buffer asn1p__init_buffer #define yy_flush_buffer asn1p__flush_buffer #define yy_load_buffer_state asn1p__load_buffer_state #define yy_switch_to_buffer asn1p__switch_to_buffer #define yyin asn1p_in #define yyleng asn1p_leng #define yylex asn1p_lex #define yylineno asn1p_lineno #define yyout asn1p_out #define yyrestart asn1p_restart #define yytext asn1p_text #define yywrap asn1p_wrap #define yyalloc asn1p_alloc #define yyrealloc asn1p_realloc #define yyfree asn1p_free /* %endif */ /* %endif */ /* %ok-for-header */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* %if-c++-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ /* %if-c-only */ #include #include #include #include /* %endif */ /* %if-tables-serialization */ /* %endif */ /* end standard C headers. */ /* %if-c-or-c++ */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ /* %endif */ /* %if-c++-only */ /* %endif */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* %not-for-header */ /* Returned upon end-of-file. */ #define YY_NULL 0 /* %ok-for-header */ /* %not-for-header */ /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* %ok-for-header */ /* %if-reentrant */ /* %endif */ /* %if-not-reentrant */ /* %endif */ /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE asn1p_restart(asn1p_in ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif /* %if-not-reentrant */ extern int asn1p_leng; /* %endif */ /* %if-c-only */ /* %if-not-reentrant */ extern FILE *asn1p_in, *asn1p_out; /* %endif */ /* %endif */ #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break * existing scanners that call yyless() from OUTSIDE asn1p_lex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-asn1p_lineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int yyl;\ for ( yyl = n; yyl < asn1p_leng; ++yyl )\ if ( asn1p_text[yyl] == '\n' )\ --asn1p_lineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up asn1p_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up asn1p_text again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { /* %if-c-only */ FILE *yy_input_file; /* %endif */ /* %if-c++-only */ /* %endif */ char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via asn1p_restart()), so that the user can continue scanning by * just pointing asn1p_in at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ /* %if-not-reentrant */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* %endif */ /* %ok-for-header */ /* %endif */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* %if-c-only Standard (non-C++) definition */ /* %if-not-reentrant */ /* %not-for-header */ /* yy_hold_char holds the character lost when asn1p_text is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int asn1p_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow asn1p_wrap()'s to do buffer switches * instead of setting up a fresh asn1p_in. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; /* %ok-for-header */ /* %endif */ void asn1p_restart (FILE *input_file ); void asn1p__switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE asn1p__create_buffer (FILE *file,int size ); void asn1p__delete_buffer (YY_BUFFER_STATE b ); void asn1p__flush_buffer (YY_BUFFER_STATE b ); void asn1p_push_buffer_state (YY_BUFFER_STATE new_buffer ); void asn1p_pop_buffer_state (void ); static void asn1p_ensure_buffer_stack (void ); static void asn1p__load_buffer_state (void ); static void asn1p__init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER asn1p__flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE asn1p__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE asn1p__scan_string (yyconst char *yy_str ); YY_BUFFER_STATE asn1p__scan_bytes (yyconst char *bytes,int len ); /* %endif */ void *asn1p_alloc (yy_size_t ); void *asn1p_realloc (void *,yy_size_t ); void asn1p_free (void * ); #define yy_new_buffer asn1p__create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ asn1p_ensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ asn1p__create_buffer(asn1p_in,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ asn1p_ensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ asn1p__create_buffer(asn1p_in,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* %% [1.0] asn1p_text/asn1p_in/asn1p_out/yy_state_type/asn1p_lineno etc. def's & init go here */ /* Begin user sect3 */ #define asn1p_wrap(n) 1 #define YY_SKIP_YYWRAP #define FLEX_DEBUG typedef unsigned char YY_CHAR; FILE *asn1p_in = (FILE *) 0, *asn1p_out = (FILE *) 0; typedef int yy_state_type; extern int asn1p_lineno; int asn1p_lineno = 1; extern char *asn1p_text; #define yytext_ptr asn1p_text /* %if-c-only Standard (non-C++) definition */ static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* %endif */ /* Done after the current pattern has been matched and before the * corresponding action - sets up asn1p_text. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ /* %% [2.0] code to fiddle asn1p_text and asn1p_leng for yymore() goes here \ */\ asn1p_leng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ /* %% [3.0] code to copy yytext_ptr to asn1p_text[] goes here, if %array \ */\ (yy_c_buf_p) = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ #define YY_NUM_RULES 138 #define YY_END_OF_BUFFER 139 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_acclist[1264] = { 0, 139, 137, 138, 132, 137, 138, 132, 138, 135, 137, 138, 19, 137, 138, 135, 137, 138, 137, 138, 135, 137, 138, 137, 138, 137, 138, 135, 137, 138, 137, 138, 33, 137, 138, 32, 137, 138, 135, 137, 138, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 120, 121, 137, 138, 119, 137, 138, 135, 137, 138, 9, 137, 138, 6, 138, 6, 137, 138, 8, 137, 138, 8, 137, 138, 11, 13, 137, 138, 11, 138, 13, 137, 138, 13, 137, 138, 13, 137, 138, 21, 137, 138, 21, 138, 22, 137, 138, 16, 137, 138, 16, 138, 18, 137, 138, 18, 137, 138, 14, 137, 138, 15, 137, 138, 25, 27, 137, 138, 27, 137, 138, 28, 138, 25, 26, 27, 137, 138, 25, 26, 27, 137, 138, 130, 137, 138, 130, 138, 137, 138, 126, 137, 138, 137, 138, 137, 138, 125, 137, 138, 128, 137, 138, 129, 137, 138, 127, 137, 138, 131, 137, 138, 132, 19, 19, 117, 118, 5, 31, 124, 10, 34, 32, 34, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 44, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 120, 121, 89, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 120, 121, 121, 121, 120, 121, 119, 9, 7, 7, 12, 21, 20, 16, 25, 25, 26, 25, 26, 130, 5, 125, 136, 117, 118, 31, 34, 123, 34, 122, 120, 121, 121, 120, 121, 36, 120, 121, 37, 120, 121, 120, 121, 120, 121, 120, 121, 41, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 58, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 81, 120, 121, 82, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 92, 120, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 100, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 121, 121, 121, 120, 121, 119, 3, 17, 25, 26, 24, 25, 26, 125, 117, 118, 30, 29, 2, 1, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 66, 120, 121, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 84, 120, 121, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 97, 120, 121, 120, 121, 120, 121, 101, 120, 121, 120, 121, 120, 121, 120, 121, 105, 120, 121, 107, 120, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 121, 121, 116, 120, 121, 3, 25, 26, 120, 121, 120, 121, 120, 121, 40, 120, 121, 121, 120, 121, 120, 121, 120, 121, 47, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 65, 120, 121, 121, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 88, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 121, 108, 120, 121, 120, 121, 120, 121, 121, 120, 121, 121, 121, 121, 133, 25, 26, 35, 120, 121, 120, 121, 120, 121, 121, 120, 121, 120, 121, 46, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 60, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 86, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 120, 121, 102, 120, 121, 103, 120, 121, 121, 121, 109, 120, 121, 120, 121, 121, 121, 121, 121, 121, 25, 26, 120, 121, 120, 121, 121, 43, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 52, 120, 121, 53, 120, 121, 120, 121, 120, 121, 56, 120, 121, 120, 121, 120, 121, 120, 121, 62, 120, 121, 120, 121, 120, 121, 121, 121, 121, 120, 121, 120, 121, 73, 120, 121, 74, 120, 121, 120, 121, 120, 121, 120, 121, 78, 120, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 121, 91, 120, 121, 120, 121, 94, 120, 121, 96, 120, 121, 121, 120, 121, 120, 121, 121, 121, 120, 121, 112, 121, 121, 121, 121, 121, 25, 26, 120, 121, 120, 121, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 55, 120, 121, 120, 121, 120, 121, 61, 120, 121, 120, 121, 64, 120, 121, 121, 121, 121, 121, 120, 121, 72, 120, 121, 75, 120, 121, 76, 120, 121, 120, 121, 120, 121, 121, 120, 121, 121, 90, 120, 121, 121, 120, 121, 121, 120, 121, 99, 120, 121, 121, 121, 120, 121, 121, 121, 121, 121, 25, 26, 120, 121, 39, 120, 121, 42, 121, 45, 120, 121, 48, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 120, 121, 121, 121, 121, 70, 121, 120, 121, 120, 121, 120, 121, 121, 120, 121, 121, 121, 120, 121, 121, 104, 121, 121, 110, 120, 121, 121, 121, 121, 121, 134, 25, 120, 121, 49, 120, 121, 120, 121, 51, 120, 121, 120, 121, 120, 121, 59, 120, 121, 120, 121, 121, 121, 121, 71, 120, 121, 120, 121, 120, 121, 121, 120, 121, 121, 121, 120, 121, 121, 120, 121, 121, 113, 121, 121, 121, 121, 25, 38, 120, 121, 50, 120, 121, 54, 120, 121, 120, 121, 120, 121, 121, 121, 121, 120, 121, 120, 121, 121, 120, 121, 121, 121, 120, 121, 121, 120, 121, 121, 121, 121, 121, 25, 120, 121, 120, 121, 121, 121, 121, 77, 120, 121, 79, 120, 121, 80, 121, 120, 121, 121, 121, 120, 121, 121, 98, 120, 121, 121, 121, 121, 121, 25, 120, 121, 63, 120, 121, 68, 121, 121, 69, 121, 120, 121, 85, 121, 121, 93, 120, 121, 121, 106, 121, 121, 121, 115, 121, 25, 120, 121, 121, 83, 120, 121, 121, 121, 121, 114, 121, 25, 120, 121, 67, 121, 121, 95, 121, 111, 121, 25, 57, 120, 121, 87, 121, 23, 25, 4 } ; static yyconst flex_int16_t yy_accept[743] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 7, 9, 12, 15, 18, 20, 23, 25, 27, 30, 32, 35, 38, 41, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99, 103, 107, 111, 115, 119, 122, 125, 128, 130, 133, 136, 139, 143, 145, 148, 151, 154, 157, 159, 162, 165, 167, 170, 173, 176, 179, 183, 186, 188, 193, 198, 201, 203, 205, 208, 210, 212, 215, 218, 221, 224, 227, 227, 228, 229, 230, 230, 231, 231, 232, 232, 232, 232, 233, 234, 235, 236, 236, 237, 237, 239, 239, 239, 241, 243, 245, 247, 249, 251, 252, 254, 256, 258, 260, 263, 265, 267, 269, 271, 273, 275, 277, 279, 281, 282, 283, 285, 287, 289, 291, 293, 295, 297, 299, 300, 302, 304, 307, 309, 310, 312, 314, 316, 318, 319, 321, 323, 325, 327, 329, 331, 333, 335, 336, 338, 340, 341, 342, 344, 344, 345, 345, 345, 345, 346, 347, 348, 349, 350, 351, 352, 352, 353, 355, 357, 358, 359, 359, 360, 361, 361, 361, 362, 362, 363, 363, 363, 363, 363, 365, 366, 367, 367, 368, 370, 371, 373, 376, 379, 381, 383, 383, 385, 388, 390, 392, 394, 396, 398, 400, 402, 404, 406, 408, 411, 413, 415, 417, 419, 421, 423, 424, 425, 427, 429, 431, 433, 435, 437, 439, 442, 445, 447, 448, 450, 452, 454, 455, 457, 460, 462, 464, 466, 467, 469, 471, 473, 476, 478, 480, 482, 484, 486, 488, 489, 491, 493, 495, 496, 497, 498, 500, 501, 501, 501, 502, 503, 505, 508, 509, 509, 510, 511, 512, 513, 514, 515, 515, 515, 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, 555, 557, 559, 562, 563, 564, 566, 568, 570, 572, 574, 576, 578, 580, 582, 585, 586, 588, 590, 592, 593, 595, 597, 599, 601, 602, 605, 607, 609, 612, 614, 616, 618, 621, 624, 625, 627, 629, 631, 633, 635, 636, 637, 638, 641, 641, 641, 641, 641, 642, 644, 644, 646, 648, 650, 653, 654, 656, 658, 660, 663, 665, 667, 669, 671, 673, 675, 677, 679, 681, 683, 685, 687, 689, 692, 693, 694, 695, 697, 699, 701, 703, 705, 707, 709, 711, 713, 715, 716, 718, 721, 723, 724, 726, 726, 728, 730, 731, 733, 735, 737, 739, 740, 741, 744, 746, 748, 749, 751, 752, 753, 754, 754, 754, 755, 757, 757, 760, 762, 764, 765, 767, 769, 772, 774, 776, 778, 780, 782, 784, 786, 788, 790, 792, 795, 797, 799, 801, 803, 804, 805, 806, 808, 810, 812, 814, 816, 818, 820, 822, 824, 826, 826, 827, 830, 832, 833, 835, 837, 839, 841, 842, 844, 846, 849, 852, 853, 854, 857, 859, 860, 861, 862, 863, 864, 864, 864, 866, 866, 868, 870, 871, 874, 876, 878, 880, 882, 885, 888, 890, 892, 895, 897, 899, 901, 904, 906, 908, 909, 910, 911, 913, 915, 918, 921, 923, 925, 927, 930, 932, 934, 936, 937, 939, 940, 943, 945, 948, 951, 952, 954, 956, 957, 958, 960, 962, 963, 964, 965, 966, 966, 968, 968, 970, 972, 973, 975, 977, 979, 981, 983, 986, 988, 990, 993, 995, 998, 999, 1000, 1001, 1002, 1004, 1007, 1010, 1013, 1015, 1017, 1018, 1020, 1021, 1024, 1025, 1027, 1028, 1030, 1033, 1034, 1035, 1037, 1038, 1039, 1040, 1041, 1041, 1041, 1043, 1043, 1045, 1048, 1050, 1053, 1056, 1058, 1060, 1062, 1062, 1064, 1066, 1067, 1068, 1069, 1071, 1073, 1075, 1077, 1078, 1080, 1081, 1082, 1084, 1085, 1085, 1087, 1088, 1091, 1092, 1093, 1094, 1095, 1095, 1096, 1097, 1097, 1099, 1102, 1104, 1107, 1109, 1111, 1114, 1116, 1117, 1118, 1119, 1122, 1124, 1126, 1127, 1129, 1130, 1131, 1133, 1134, 1136, 1137, 1139, 1140, 1141, 1142, 1143, 1143, 1146, 1149, 1152, 1154, 1156, 1157, 1158, 1159, 1161, 1163, 1164, 1166, 1167, 1168, 1170, 1171, 1173, 1174, 1175, 1176, 1177, 1178, 1178, 1180, 1182, 1183, 1184, 1185, 1188, 1191, 1193, 1195, 1196, 1197, 1199, 1200, 1203, 1204, 1205, 1206, 1207, 1208, 1208, 1210, 1213, 1215, 1216, 1218, 1220, 1222, 1223, 1226, 1227, 1229, 1230, 1231, 1233, 1234, 1234, 1236, 1237, 1240, 1241, 1242, 1243, 1245, 1246, 1246, 1248, 1250, 1251, 1253, 1255, 1256, 1256, 1259, 1261, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1264, 1264 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 6, 7, 1, 1, 1, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 19, 23, 24, 25, 26, 27, 28, 29, 1, 10, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 1, 57, 58, 1, 1, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 64, 69, 70, 71, 72, 73, 64, 74, 75, 76, 77, 78, 64, 79, 64, 80, 81, 82, 83, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[84] = { 0, 1, 2, 3, 4, 4, 1, 5, 1, 6, 1, 1, 1, 1, 7, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 9, 1, 1, 9, 1, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 1, 1, 1, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 1, 13 } ; static yyconst flex_int16_t yy_base[768] = { 0, 0, 0, 81, 84, 87, 99, 94, 96, 93, 108, 91, 103, 186, 269, 352, 0, 1657, 1646, 130, 138, 1645, 1643, 427, 146, 4507, 158, 207, 1633, 109, 230, 493, 1621, 4507, 543, 268, 115, 274, 289, 488, 593, 191, 599, 509, 215, 491, 621, 406, 638, 655, 658, 678, 689, 1631, 733, 0, 4507, 4507, 1630, 1629, 4507, 4507, 1621, 1622, 4507, 0, 0, 1622, 0, 0, 1602, 4507, 4507, 4507, 0, 4507, 4507, 757, 839, 122, 166, 127, 4507, 1612, 1609, 1604, 4507, 4507, 4507, 4507, 1605, 201, 0, 1603, 1603, 1589, 96, 1585, 656, 1588, 772, 103, 807, 1580, 4507, 839, 857, 886, 907, 1565, 912, 681, 757, 892, 903, 909, 962, 1578, 963, 978, 979, 994, 1000, 1016, 1022, 1033, 1046, 1049, 1069, 1066, 1077, 1090, 95, 79, 1105, 1108, 1116, 1131, 1142, 1153, 1159, 1170, 147, 1183, 1186, 1199, 1207, 94, 1210, 1223, 1234, 1247, 143, 1263, 1269, 1280, 1286, 1297, 1308, 1314, 1325, 169, 1331, 1347, 194, 225, 1346, 0, 1572, 757, 943, 1381, 0, 4507, 1570, 4507, 0, 4507, 0, 1554, 0, 1536, 258, 333, 4507, 0, 1561, 4507, 1554, 0, 1552, 0, 1550, 226, 1526, 204, 143, 1391, 4507, 866, 894, 4507, 1441, 1548, 1385, 1386, 1401, 1402, 1417, 1547, 1425, 1428, 1441, 1449, 1491, 1492, 1508, 1509, 1524, 1540, 1546, 1557, 1563, 1574, 1580, 1591, 1597, 1608, 1619, 223, 241, 1632, 1640, 1643, 1658, 1661, 1664, 1690, 1682, 1693, 1706, 226, 1714, 1727, 1735, 495, 1738, 1751, 1759, 1767, 1775, 245, 1788, 1791, 1799, 1812, 1820, 1828, 1836, 1849, 1857, 1870, 506, 1878, 1894, 1895, 470, 507, 221, 1910, 1546, 1954, 1962, 1543, 4507, 285, 1505, 1533, 1489, 1531, 1530, 4507, 4507, 4507, 4507, 436, 319, 1495, 1956, 1957, 1972, 1978, 1989, 1995, 2011, 2012, 2027, 2035, 2043, 2059, 2056, 2067, 2080, 2083, 2098, 2104, 2115, 2121, 2132, 2147, 2153, 469, 535, 2164, 2170, 2185, 2186, 2201, 2207, 2222, 2225, 2233, 2246, 554, 2254, 2257, 2270, 205, 2278, 2291, 2299, 2307, 523, 2315, 2323, 2336, 2344, 2347, 2365, 2362, 2368, 2383, 557, 2386, 2389, 2406, 2412, 2423, 612, 528, 631, 2439, 2473, 2496, 2519, 2531, 1517, 190, 1486, 2515, 2530, 2546, 2543, 623, 2564, 2567, 2570, 2585, 2588, 2596, 2609, 2617, 2630, 2641, 2647, 2658, 2669, 2684, 2690, 2701, 2707, 2722, 248, 558, 632, 2723, 2743, 2740, 2761, 2760, 2776, 2782, 2793, 2806, 2817, 613, 2814, 2830, 2838, 617, 2846, 309, 2854, 2867, 625, 2880, 2883, 2891, 2904, 636, 641, 2915, 2921, 2932, 643, 2943, 668, 639, 621, 441, 2987, 4507, 302, 1508, 2971, 2987, 2984, 649, 2995, 3008, 3011, 3028, 3034, 3045, 3051, 3066, 3072, 3089, 3095, 3106, 3112, 3123, 3129, 3140, 3146, 3162, 656, 680, 730, 3163, 3178, 3184, 3195, 3201, 3216, 3222, 3233, 3248, 3254, 785, 878, 3265, 3281, 511, 3278, 1482, 3289, 3302, 885, 3310, 3325, 3328, 3331, 734, 664, 3346, 3349, 806, 735, 733, 830, 880, 3398, 3410, 1481, 1461, 3364, 3404, 732, 3405, 3422, 3421, 3437, 3438, 3453, 3454, 3469, 3475, 3486, 3492, 3503, 3514, 3525, 3531, 3542, 982, 790, 887, 3548, 3559, 3570, 3576, 3587, 3593, 3608, 3609, 3624, 3630, 1445, 823, 3641, 905, 3647, 1448, 3658, 3664, 933, 3679, 3685, 924, 984, 3701, 1467, 987, 941, 918, 1000, 3735, 101, 0, 3729, 3730, 1003, 3745, 3753, 3756, 3769, 3777, 3785, 3793, 3806, 3814, 3822, 3830, 1012, 634, 1019, 1004, 3843, 3851, 3854, 3867, 3875, 3878, 1056, 1444, 1028, 3891, 1042, 1427, 1022, 3912, 3899, 1041, 1037, 3915, 1002, 1068, 1057, 1048, 3964, 1381, 290, 1410, 3930, 3948, 1436, 3959, 3965, 3980, 3981, 3996, 514, 4002, 4013, 1070, 1065, 1115, 1435, 4019, 4030, 4041, 1026, 1403, 1131, 1109, 1397, 1127, 798, 1425, 1138, 4047, 1089, 1129, 1142, 1151, 1493, 4507, 1392, 1358, 4058, 4064, 4079, 4080, 4095, 1374, 4096, 4111, 1111, 1146, 1124, 4117, 4128, 4139, 1150, 1322, 1179, 1193, 1299, 1185, 1296, 1196, 1318, 1220, 1202, 1205, 1254, 1218, 4145, 4156, 4162, 1227, 4173, 1168, 1118, 1174, 4184, 4190, 1218, 1224, 1209, 1255, 1148, 1229, 1138, 1272, 1233, 1257, 1273, 1126, 1012, 1009, 4205, 1244, 1281, 1287, 4206, 4221, 1020, 966, 1302, 1268, 915, 1306, 0, 1357, 1340, 1275, 1409, 902, 886, 889, 4222, 822, 1291, 820, 779, 818, 1223, 0, 1349, 807, 1366, 1420, 805, 771, 742, 767, 1424, 0, 1288, 1462, 1463, 796, 696, 670, 676, 697, 1379, 541, 539, 504, 459, 0, 441, 0, 378, 422, 373, 397, 366, 281, 275, 268, 280, 267, 814, 1166, 115, 100, 4507, 4507, 4272, 4285, 4298, 4311, 4324, 4337, 4349, 4353, 4364, 4377, 4390, 4401, 4412, 4417, 4422, 4427, 4431, 4436, 4440, 4444, 4448, 4452, 4463, 4470, 4481, 4493 } ; static yyconst flex_int16_t yy_def[768] = { 0, 741, 1, 742, 742, 742, 742, 743, 743, 744, 744, 745, 745, 746, 746, 741, 15, 741, 741, 741, 741, 741, 747, 741, 748, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 749, 741, 750, 741, 741, 741, 741, 741, 741, 741, 741, 741, 751, 751, 741, 752, 752, 741, 741, 741, 741, 753, 741, 741, 754, 754, 741, 741, 23, 741, 741, 741, 755, 741, 741, 741, 741, 741, 741, 747, 747, 741, 756, 741, 757, 748, 748, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 758, 34, 34, 34, 34, 34, 34, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 759, 34, 34, 34, 34, 34, 34, 34, 34, 759, 34, 34, 34, 34, 759, 34, 34, 34, 34, 759, 34, 34, 34, 34, 34, 34, 34, 34, 759, 34, 34, 759, 759, 34, 760, 749, 741, 741, 741, 750, 741, 741, 741, 751, 741, 752, 741, 753, 78, 78, 741, 741, 761, 755, 741, 741, 762, 756, 763, 757, 741, 741, 764, 741, 741, 741, 741, 741, 741, 758, 765, 34, 34, 34, 34, 34, 765, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 34, 34, 34, 759, 34, 34, 34, 34, 34, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 34, 34, 34, 759, 759, 759, 34, 760, 741, 741, 741, 741, 78, 78, 761, 741, 762, 763, 741, 741, 741, 741, 764, 741, 741, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 34, 34, 34, 759, 34, 34, 34, 34, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 34, 34, 34, 34, 34, 759, 759, 759, 34, 741, 741, 741, 741, 741, 78, 741, 34, 34, 34, 34, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 759, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 34, 34, 34, 759, 34, 202, 34, 34, 759, 34, 34, 34, 34, 759, 759, 34, 34, 34, 759, 34, 759, 759, 759, 741, 741, 741, 78, 741, 34, 34, 34, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 759, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 202, 759, 34, 34, 759, 34, 202, 34, 34, 759, 34, 34, 34, 34, 759, 759, 34, 34, 759, 759, 759, 759, 759, 741, 741, 78, 741, 34, 34, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 759, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 202, 759, 34, 759, 34, 202, 34, 34, 759, 34, 34, 759, 759, 34, 759, 759, 759, 759, 759, 741, 78, 766, 34, 34, 759, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 759, 759, 759, 759, 34, 34, 34, 34, 34, 34, 759, 202, 759, 34, 759, 202, 759, 34, 34, 759, 759, 34, 759, 759, 759, 759, 741, 767, 78, 741, 34, 34, 759, 34, 34, 34, 34, 34, 202, 34, 34, 759, 759, 759, 759, 34, 34, 34, 759, 202, 759, 759, 202, 759, 202, 759, 759, 34, 759, 759, 759, 759, 741, 741, 753, 741, 34, 34, 34, 34, 34, 202, 34, 34, 759, 759, 759, 34, 34, 34, 759, 202, 759, 759, 202, 759, 202, 759, 759, 759, 759, 759, 753, 741, 34, 34, 34, 202, 34, 759, 759, 759, 34, 34, 759, 202, 759, 759, 202, 759, 202, 759, 759, 759, 759, 753, 741, 202, 34, 759, 759, 759, 34, 34, 759, 202, 759, 759, 202, 759, 202, 759, 759, 759, 759, 753, 741, 202, 34, 759, 759, 759, 202, 759, 759, 202, 759, 759, 759, 759, 759, 753, 741, 202, 759, 202, 759, 759, 759, 759, 753, 741, 202, 759, 759, 759, 759, 753, 741, 202, 759, 753, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 0, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741 } ; static yyconst flex_int16_t yy_nxt[4591] = { 0, 18, 19, 20, 19, 19, 21, 22, 23, 24, 25, 18, 26, 25, 27, 28, 29, 30, 31, 31, 31, 31, 31, 31, 31, 32, 21, 33, 33, 18, 34, 35, 36, 37, 38, 39, 40, 41, 42, 41, 41, 41, 43, 44, 45, 46, 41, 47, 48, 49, 50, 51, 52, 41, 41, 41, 25, 21, 21, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 54, 21, 25, 56, 57, 57, 56, 57, 57, 56, 57, 57, 209, 69, 58, 66, 61, 58, 61, 67, 59, 56, 57, 57, 62, 69, 62, 209, 209, 63, 66, 63, 59, 740, 67, 70, 195, 90, 71, 104, 64, 94, 64, 183, 183, 183, 183, 70, 739, 196, 71, 91, 91, 91, 91, 741, 582, 230, 90, 91, 91, 91, 91, 181, 286, 111, 90, 98, 98, 98, 98, 123, 741, 96, 90, 124, 209, 111, 125, 111, 209, 245, 98, 98, 111, 229, 90, 183, 183, 183, 183, 72, 287, 73, 100, 100, 100, 100, 100, 100, 100, 100, 209, 72, 741, 73, 74, 75, 76, 75, 75, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 91, 91, 91, 91, 284, 209, 284, 251, 74, 74, 74, 74, 74, 90, 241, 285, 209, 78, 101, 111, 422, 100, 102, 102, 102, 102, 102, 102, 102, 111, 181, 111, 209, 111, 209, 262, 209, 209, 111, 74, 74, 74, 105, 111, 106, 106, 106, 106, 106, 106, 106, 106, 209, 111, 281, 111, 209, 111, 266, 209, 282, 107, 141, 399, 75, 74, 75, 74, 75, 76, 75, 75, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 311, 267, 350, 323, 275, 276, 142, 107, 74, 74, 74, 74, 74, 111, 268, 181, 118, 78, 618, 111, 119, 446, 126, 111, 120, 111, 121, 111, 312, 111, 332, 111, 111, 111, 111, 286, 122, 741, 111, 74, 74, 74, 181, 357, 111, 127, 128, 181, 111, 183, 183, 183, 183, 111, 484, 736, 129, 735, 734, 181, 733, 465, 732, 287, 75, 74, 75, 33, 79, 80, 79, 79, 33, 33, 81, 33, 33, 33, 33, 82, 83, 33, 84, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, 87, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 88, 33, 89, 90, 111, 731, 284, 153, 284, 730, 419, 419, 419, 419, 111, 729, 111, 285, 111, 728, 94, 727, 209, 111, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 209, 209, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 105, 209, 108, 108, 108, 108, 108, 108, 108, 108, 130, 111, 209, 209, 143, 144, 421, 209, 145, 107, 741, 111, 726, 111, 111, 111, 111, 131, 146, 209, 111, 139, 111, 111, 209, 382, 521, 725, 625, 140, 348, 209, 111, 147, 111, 209, 111, 209, 107, 110, 327, 111, 111, 111, 111, 111, 111, 111, 111, 111, 209, 342, 349, 209, 209, 111, 112, 111, 111, 111, 111, 111, 111, 111, 111, 111, 113, 111, 114, 111, 115, 111, 111, 111, 111, 116, 111, 111, 111, 111, 111, 404, 417, 383, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 111, 447, 209, 209, 395, 134, 111, 209, 135, 410, 111, 209, 111, 209, 111, 209, 111, 136, 137, 111, 111, 209, 209, 138, 209, 111, 209, 148, 111, 209, 149, 209, 132, 209, 98, 98, 98, 98, 150, 209, 111, 193, 111, 133, 151, 111, 209, 111, 154, 98, 98, 416, 155, 158, 209, 111, 460, 111, 209, 111, 468, 159, 111, 156, 111, 111, 481, 418, 157, 463, 209, 152, 111, 427, 111, 111, 111, 162, 160, 111, 474, 111, 448, 163, 111, 111, 473, 209, 111, 477, 596, 480, 488, 723, 161, 111, 111, 111, 111, 111, 111, 505, 111, 166, 111, 164, 111, 111, 111, 722, 111, 169, 169, 169, 169, 111, 721, 506, 479, 530, 209, 165, 209, 209, 209, 209, 170, 170, 170, 170, 170, 170, 171, 171, 180, 169, 169, 169, 169, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 170, 170, 170, 170, 170, 170, 171, 171, 180, 180, 180, 180, 180, 105, 111, 106, 106, 106, 106, 106, 106, 106, 106, 507, 111, 741, 111, 529, 111, 542, 209, 204, 107, 111, 534, 533, 209, 716, 741, 180, 180, 180, 737, 715, 714, 209, 209, 209, 105, 518, 197, 197, 197, 197, 197, 197, 197, 197, 209, 709, 209, 107, 209, 209, 556, 180, 180, 107, 640, 738, 209, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 199, 199, 199, 199, 199, 199, 199, 199, 180, 180, 180, 180, 180, 532, 107, 566, 105, 107, 106, 106, 106, 106, 106, 106, 106, 106, 182, 199, 199, 199, 199, 199, 199, 199, 199, 107, 209, 535, 209, 180, 180, 180, 200, 209, 200, 209, 107, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 209, 107, 180, 105, 111, 108, 108, 108, 108, 108, 108, 108, 108, 209, 205, 111, 111, 707, 111, 209, 519, 111, 107, 111, 536, 111, 526, 111, 209, 111, 706, 111, 705, 111, 111, 207, 209, 271, 206, 557, 111, 171, 171, 171, 171, 171, 171, 171, 171, 568, 699, 107, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 111, 111, 573, 209, 578, 209, 210, 577, 209, 570, 111, 111, 111, 111, 111, 111, 111, 111, 208, 111, 111, 209, 696, 209, 209, 209, 111, 111, 111, 111, 111, 212, 111, 209, 211, 111, 111, 554, 111, 574, 209, 209, 111, 209, 111, 213, 111, 209, 111, 209, 111, 111, 111, 214, 111, 579, 555, 111, 209, 216, 111, 576, 209, 209, 111, 691, 111, 215, 111, 209, 111, 111, 111, 111, 111, 586, 598, 209, 209, 111, 612, 111, 217, 218, 111, 111, 209, 220, 219, 209, 111, 209, 607, 690, 111, 595, 111, 111, 111, 111, 634, 111, 597, 111, 111, 224, 111, 111, 221, 222, 209, 604, 614, 609, 111, 111, 111, 111, 225, 111, 610, 111, 226, 111, 605, 227, 223, 111, 111, 111, 209, 615, 209, 231, 111, 629, 209, 602, 111, 209, 111, 228, 111, 111, 613, 209, 111, 111, 209, 232, 209, 628, 209, 111, 111, 111, 111, 111, 111, 209, 111, 642, 111, 209, 111, 111, 111, 209, 233, 111, 234, 209, 209, 111, 674, 737, 689, 637, 684, 111, 111, 111, 639, 111, 643, 653, 235, 236, 111, 209, 111, 111, 111, 237, 111, 209, 630, 111, 655, 111, 209, 111, 738, 111, 682, 111, 209, 111, 111, 239, 111, 111, 636, 238, 209, 654, 111, 209, 240, 641, 111, 111, 111, 209, 111, 644, 209, 111, 658, 242, 209, 111, 645, 111, 111, 111, 111, 111, 111, 209, 111, 209, 243, 111, 209, 111, 673, 111, 111, 111, 209, 111, 675, 660, 209, 111, 111, 111, 111, 111, 111, 111, 111, 244, 111, 209, 246, 111, 663, 679, 665, 111, 111, 111, 661, 111, 209, 671, 209, 668, 111, 247, 111, 667, 111, 111, 111, 680, 249, 209, 678, 248, 250, 209, 209, 111, 209, 111, 670, 111, 252, 111, 209, 666, 111, 669, 710, 111, 209, 209, 683, 253, 209, 111, 686, 111, 693, 111, 111, 111, 111, 111, 254, 209, 111, 255, 111, 209, 111, 681, 111, 687, 111, 259, 111, 111, 111, 111, 111, 209, 257, 664, 256, 111, 662, 111, 111, 258, 698, 111, 685, 688, 111, 703, 111, 694, 111, 260, 111, 695, 111, 209, 111, 111, 111, 111, 111, 718, 708, 111, 209, 111, 659, 111, 697, 111, 263, 111, 209, 111, 700, 111, 261, 111, 111, 111, 264, 209, 111, 265, 616, 616, 616, 616, 111, 111, 111, 111, 111, 111, 209, 272, 269, 111, 111, 171, 171, 171, 171, 171, 171, 171, 171, 105, 702, 197, 197, 197, 197, 197, 197, 197, 197, 111, 111, 651, 288, 711, 647, 701, 209, 646, 107, 111, 111, 111, 111, 111, 111, 111, 111, 209, 111, 111, 712, 209, 209, 638, 635, 111, 289, 111, 111, 111, 111, 111, 209, 209, 111, 111, 724, 107, 110, 111, 619, 111, 111, 111, 290, 111, 291, 617, 606, 111, 111, 111, 111, 111, 111, 111, 111, 704, 111, 209, 209, 111, 603, 111, 209, 111, 569, 111, 713, 111, 717, 565, 292, 293, 111, 111, 539, 111, 616, 616, 616, 616, 111, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 111, 111, 538, 523, 485, 719, 720, 423, 295, 356, 111, 111, 111, 111, 111, 111, 294, 111, 111, 111, 111, 358, 191, 189, 187, 185, 181, 111, 111, 111, 111, 111, 297, 111, 296, 356, 111, 111, 167, 741, 209, 282, 191, 111, 189, 111, 278, 111, 300, 111, 298, 299, 111, 185, 617, 111, 301, 181, 302, 111, 274, 111, 273, 111, 167, 111, 111, 111, 111, 111, 209, 201, 111, 198, 111, 194, 111, 191, 111, 303, 111, 189, 111, 111, 111, 111, 111, 188, 187, 111, 187, 111, 305, 111, 304, 111, 185, 111, 104, 111, 111, 111, 111, 111, 184, 179, 111, 177, 111, 308, 306, 104, 111, 307, 111, 175, 111, 111, 111, 111, 111, 174, 173, 167, 109, 111, 103, 111, 111, 111, 93, 111, 90, 90, 309, 741, 111, 741, 111, 310, 111, 111, 111, 741, 741, 741, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 741, 741, 313, 111, 111, 314, 315, 111, 111, 316, 111, 111, 111, 741, 111, 111, 741, 111, 741, 741, 319, 317, 741, 111, 111, 111, 111, 111, 111, 111, 111, 111, 318, 111, 320, 111, 111, 741, 741, 741, 741, 741, 741, 111, 741, 111, 111, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 741, 741, 321, 741, 111, 741, 322, 324, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 741, 325, 741, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 326, 741, 741, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 741, 328, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 741, 111, 329, 111, 111, 111, 741, 111, 741, 741, 330, 111, 111, 111, 111, 111, 334, 111, 741, 741, 111, 331, 741, 741, 333, 111, 111, 111, 111, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 335, 741, 111, 741, 111, 336, 111, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 337, 111, 741, 111, 111, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 741, 741, 741, 338, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 741, 339, 111, 111, 111, 111, 111, 741, 341, 340, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 741, 347, 111, 111, 111, 343, 111, 344, 111, 111, 741, 111, 345, 741, 741, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 741, 346, 111, 111, 741, 351, 741, 741, 741, 111, 741, 111, 741, 111, 352, 352, 352, 352, 111, 741, 741, 741, 354, 354, 354, 354, 741, 741, 741, 353, 353, 353, 353, 353, 353, 353, 353, 355, 355, 355, 355, 355, 355, 355, 355, 111, 111, 741, 741, 741, 741, 741, 741, 360, 741, 111, 111, 359, 111, 111, 111, 111, 741, 741, 111, 111, 741, 111, 741, 741, 741, 111, 361, 111, 741, 111, 741, 111, 111, 362, 111, 111, 741, 741, 111, 741, 111, 364, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 365, 111, 111, 366, 111, 741, 741, 741, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 741, 741, 111, 111, 741, 741, 363, 111, 741, 111, 741, 111, 741, 111, 741, 111, 367, 111, 111, 111, 368, 111, 741, 741, 741, 111, 111, 111, 111, 111, 370, 111, 741, 369, 111, 741, 741, 741, 111, 111, 111, 111, 111, 111, 741, 111, 741, 371, 741, 111, 111, 372, 111, 111, 373, 111, 741, 374, 111, 741, 741, 741, 111, 741, 111, 111, 111, 111, 741, 111, 111, 111, 741, 375, 111, 741, 111, 741, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 376, 741, 741, 111, 377, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 378, 741, 741, 111, 741, 111, 741, 379, 741, 111, 111, 380, 741, 381, 111, 741, 111, 741, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 385, 111, 741, 741, 386, 741, 741, 111, 111, 111, 111, 111, 111, 111, 387, 741, 111, 111, 389, 111, 741, 384, 741, 111, 741, 111, 393, 111, 741, 111, 741, 111, 388, 111, 111, 390, 741, 111, 111, 391, 741, 741, 741, 741, 111, 111, 111, 111, 111, 111, 392, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 394, 741, 111, 741, 111, 396, 111, 111, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 401, 397, 111, 741, 111, 741, 111, 400, 111, 398, 111, 741, 741, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 111, 741, 111, 741, 111, 402, 111, 741, 111, 403, 111, 741, 111, 111, 111, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 741, 406, 741, 405, 111, 741, 111, 741, 111, 111, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 407, 741, 111, 111, 111, 408, 111, 111, 741, 111, 741, 741, 741, 111, 741, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 111, 741, 111, 741, 741, 741, 111, 741, 111, 111, 111, 411, 111, 111, 111, 111, 111, 741, 111, 111, 409, 412, 413, 741, 741, 111, 741, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 415, 741, 111, 741, 352, 352, 352, 352, 414, 111, 741, 111, 741, 111, 741, 741, 741, 741, 111, 353, 353, 353, 353, 353, 353, 353, 353, 419, 419, 419, 419, 741, 741, 741, 741, 741, 741, 741, 420, 741, 741, 741, 353, 353, 353, 353, 353, 353, 353, 353, 354, 354, 354, 354, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 355, 355, 355, 355, 355, 355, 355, 355, 420, 741, 111, 741, 355, 355, 355, 355, 355, 355, 355, 355, 111, 741, 111, 741, 111, 111, 425, 741, 424, 111, 741, 741, 741, 741, 741, 111, 741, 111, 111, 111, 426, 111, 741, 421, 111, 741, 741, 741, 111, 741, 111, 111, 111, 111, 741, 111, 741, 111, 428, 111, 111, 741, 111, 429, 741, 111, 741, 741, 430, 111, 741, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 111, 741, 741, 741, 741, 741, 111, 111, 111, 111, 111, 431, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 432, 741, 741, 111, 433, 111, 741, 111, 741, 111, 741, 111, 741, 741, 741, 434, 111, 111, 111, 111, 741, 435, 741, 741, 111, 436, 741, 741, 111, 111, 111, 437, 111, 741, 741, 111, 741, 111, 438, 111, 741, 111, 439, 111, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 111, 741, 111, 111, 111, 741, 111, 741, 440, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 442, 741, 441, 111, 741, 111, 741, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 443, 111, 741, 111, 741, 111, 741, 111, 741, 111, 444, 445, 111, 111, 111, 111, 741, 741, 111, 741, 741, 741, 449, 741, 111, 111, 111, 111, 111, 111, 741, 741, 111, 111, 111, 111, 450, 741, 451, 741, 741, 741, 111, 741, 111, 111, 111, 111, 741, 111, 452, 111, 111, 111, 111, 453, 741, 741, 741, 741, 741, 741, 111, 111, 454, 111, 111, 111, 111, 741, 741, 111, 111, 741, 111, 741, 741, 456, 111, 741, 111, 741, 111, 741, 111, 111, 111, 455, 111, 458, 741, 741, 459, 111, 741, 111, 741, 111, 111, 111, 741, 741, 457, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 111, 461, 111, 741, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 462, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 741, 464, 741, 111, 111, 466, 111, 111, 741, 741, 741, 741, 111, 741, 741, 741, 111, 741, 111, 111, 111, 741, 111, 741, 467, 111, 469, 741, 741, 111, 111, 111, 111, 111, 470, 471, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 111, 741, 741, 741, 111, 111, 111, 741, 111, 741, 741, 111, 741, 111, 475, 111, 472, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 111, 741, 111, 111, 111, 741, 111, 741, 476, 741, 741, 111, 741, 111, 741, 111, 741, 111, 482, 482, 482, 482, 111, 741, 741, 741, 741, 741, 741, 741, 741, 111, 741, 483, 483, 483, 483, 483, 483, 483, 483, 111, 741, 111, 111, 111, 486, 111, 478, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 111, 741, 111, 487, 111, 741, 111, 111, 489, 111, 111, 741, 111, 741, 741, 111, 741, 741, 741, 111, 741, 111, 111, 111, 111, 741, 111, 490, 111, 111, 741, 111, 491, 741, 492, 111, 741, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 111, 741, 493, 741, 111, 741, 111, 741, 111, 111, 111, 111, 741, 495, 494, 111, 741, 111, 741, 741, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 741, 741, 111, 496, 111, 497, 741, 741, 111, 741, 498, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 500, 111, 741, 111, 741, 111, 741, 499, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 111, 741, 111, 501, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 111, 741, 111, 503, 111, 741, 111, 502, 111, 111, 111, 504, 111, 111, 741, 111, 741, 508, 741, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 741, 741, 111, 111, 741, 111, 509, 510, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 512, 111, 741, 111, 741, 111, 741, 111, 511, 111, 111, 111, 111, 513, 741, 741, 111, 741, 111, 514, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 515, 741, 516, 111, 741, 111, 741, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 517, 741, 111, 741, 111, 741, 111, 111, 111, 520, 111, 741, 741, 111, 741, 741, 741, 111, 111, 522, 111, 111, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 525, 741, 524, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 741, 741, 111, 111, 111, 741, 111, 111, 528, 741, 111, 111, 527, 111, 741, 741, 741, 111, 741, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 111, 741, 741, 741, 741, 741, 111, 741, 111, 111, 111, 111, 741, 111, 111, 111, 531, 741, 111, 482, 482, 482, 482, 741, 111, 741, 111, 741, 111, 741, 741, 741, 540, 111, 483, 483, 483, 483, 483, 483, 483, 483, 537, 741, 741, 741, 483, 483, 483, 483, 483, 483, 483, 483, 111, 111, 741, 741, 741, 741, 741, 541, 741, 741, 111, 111, 111, 111, 111, 111, 741, 111, 111, 111, 111, 543, 741, 741, 741, 741, 741, 111, 111, 544, 111, 111, 111, 111, 111, 741, 111, 111, 741, 741, 545, 546, 741, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 111, 741, 741, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 741, 741, 111, 111, 741, 111, 547, 548, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 111, 549, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 111, 741, 111, 111, 111, 741, 111, 741, 741, 741, 550, 111, 741, 111, 111, 111, 741, 111, 741, 741, 552, 551, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 553, 741, 111, 558, 111, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 111, 741, 111, 111, 111, 741, 111, 741, 741, 111, 559, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 561, 111, 741, 111, 741, 111, 741, 111, 560, 111, 111, 111, 111, 111, 741, 741, 111, 741, 741, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 563, 562, 111, 111, 741, 111, 741, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 567, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 564, 111, 111, 111, 111, 741, 741, 571, 111, 741, 111, 741, 741, 572, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 575, 111, 741, 741, 111, 741, 580, 580, 580, 580, 741, 111, 741, 111, 741, 111, 741, 741, 741, 741, 111, 581, 581, 581, 581, 581, 581, 581, 581, 111, 111, 585, 741, 741, 741, 741, 584, 741, 741, 111, 111, 111, 111, 111, 111, 111, 741, 741, 111, 111, 741, 741, 741, 111, 741, 111, 111, 111, 741, 111, 741, 587, 741, 111, 111, 111, 111, 111, 589, 111, 111, 588, 111, 741, 741, 111, 592, 111, 741, 111, 741, 590, 741, 111, 741, 111, 741, 111, 111, 111, 591, 111, 741, 111, 741, 111, 111, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 741, 593, 741, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 594, 111, 741, 111, 111, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 741, 599, 741, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 741, 741, 111, 741, 111, 741, 111, 111, 111, 741, 111, 600, 741, 741, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 608, 601, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 741, 741, 111, 111, 111, 111, 111, 741, 111, 741, 741, 111, 741, 741, 741, 111, 741, 111, 611, 111, 111, 741, 111, 111, 111, 741, 741, 111, 580, 580, 580, 580, 741, 111, 741, 111, 620, 111, 741, 741, 741, 111, 111, 581, 581, 581, 581, 581, 581, 581, 581, 111, 111, 111, 741, 111, 741, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 621, 622, 111, 741, 623, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 741, 741, 111, 111, 741, 111, 741, 626, 741, 111, 741, 624, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 627, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 631, 741, 741, 111, 741, 111, 111, 111, 632, 111, 741, 741, 111, 633, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 111, 741, 648, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 649, 741, 111, 741, 741, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 111, 741, 741, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 650, 741, 111, 111, 741, 111, 652, 741, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 111, 741, 111, 111, 656, 741, 111, 741, 741, 111, 741, 111, 741, 111, 741, 111, 657, 111, 741, 111, 111, 111, 111, 111, 741, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 741, 111, 111, 111, 111, 111, 741, 741, 741, 741, 111, 741, 111, 111, 111, 741, 111, 741, 741, 111, 672, 111, 741, 111, 741, 111, 741, 111, 741, 111, 676, 677, 111, 111, 111, 111, 741, 741, 111, 741, 741, 741, 741, 741, 111, 111, 111, 111, 111, 111, 111, 111, 741, 111, 111, 741, 741, 692, 741, 741, 111, 111, 111, 111, 111, 111, 741, 741, 741, 111, 111, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 92, 92, 92, 92, 741, 92, 92, 92, 92, 92, 92, 92, 92, 99, 99, 99, 741, 99, 741, 99, 741, 99, 168, 168, 741, 168, 168, 172, 172, 741, 741, 172, 172, 741, 172, 172, 172, 172, 172, 172, 176, 176, 176, 176, 741, 176, 176, 176, 176, 176, 176, 176, 176, 178, 178, 178, 178, 178, 178, 178, 178, 741, 178, 178, 180, 741, 741, 741, 180, 180, 180, 180, 180, 180, 180, 181, 741, 741, 741, 181, 181, 181, 181, 181, 181, 181, 186, 186, 741, 186, 186, 190, 190, 741, 190, 190, 192, 192, 741, 192, 192, 202, 741, 202, 202, 117, 117, 741, 117, 117, 270, 741, 270, 270, 277, 741, 277, 277, 279, 741, 279, 279, 280, 741, 280, 280, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 203, 203, 741, 203, 203, 583, 583, 741, 583, 583, 583, 583, 583, 583, 583, 583, 583, 583, 581, 581, 581, 741, 741, 741, 581, 741, 741, 741, 741, 581, 17, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741 } ; static yyconst flex_int16_t yy_chk[4591] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 4, 4, 4, 5, 5, 5, 133, 11, 3, 9, 7, 4, 8, 9, 5, 6, 6, 6, 7, 12, 8, 147, 132, 7, 10, 8, 6, 739, 10, 11, 101, 29, 11, 29, 7, 96, 8, 79, 79, 79, 79, 12, 738, 101, 12, 19, 19, 19, 19, 81, 538, 133, 19, 20, 20, 20, 20, 538, 196, 36, 20, 24, 24, 24, 24, 36, 81, 96, 24, 36, 152, 36, 36, 36, 142, 147, 24, 24, 36, 132, 26, 80, 80, 80, 80, 11, 196, 11, 26, 26, 26, 26, 26, 26, 26, 26, 161, 12, 81, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 91, 91, 91, 91, 195, 164, 195, 152, 13, 13, 13, 13, 13, 27, 142, 195, 327, 13, 27, 41, 357, 27, 27, 27, 27, 27, 27, 27, 27, 41, 357, 41, 268, 41, 229, 161, 165, 241, 41, 13, 13, 13, 30, 44, 30, 30, 30, 30, 30, 30, 30, 30, 230, 44, 193, 44, 251, 44, 164, 382, 193, 30, 44, 327, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 229, 165, 268, 241, 182, 182, 44, 30, 14, 14, 14, 14, 14, 35, 165, 182, 35, 14, 582, 37, 35, 382, 37, 35, 35, 35, 35, 35, 230, 37, 251, 37, 35, 37, 38, 286, 35, 401, 37, 14, 14, 14, 275, 275, 38, 38, 38, 582, 38, 183, 183, 183, 183, 38, 422, 735, 38, 734, 733, 422, 732, 401, 731, 286, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 23, 47, 730, 285, 47, 285, 729, 419, 419, 419, 419, 47, 728, 47, 285, 47, 727, 23, 726, 724, 47, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 311, 266, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 31, 245, 31, 31, 31, 31, 31, 31, 31, 31, 39, 39, 262, 267, 45, 45, 419, 463, 45, 31, 592, 39, 722, 39, 45, 39, 45, 39, 45, 332, 39, 43, 43, 45, 349, 311, 463, 721, 592, 43, 266, 312, 43, 45, 43, 720, 43, 719, 31, 34, 245, 43, 34, 34, 34, 34, 34, 34, 34, 34, 323, 262, 267, 342, 383, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 332, 349, 312, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 40, 383, 348, 395, 323, 42, 42, 399, 42, 342, 40, 418, 40, 363, 40, 404, 42, 42, 42, 40, 42, 350, 384, 42, 555, 42, 409, 46, 46, 417, 46, 410, 40, 414, 98, 98, 98, 98, 46, 427, 46, 98, 46, 40, 46, 48, 446, 46, 48, 98, 98, 348, 48, 49, 474, 48, 395, 48, 416, 48, 404, 49, 49, 48, 48, 50, 418, 350, 48, 399, 447, 46, 49, 363, 49, 50, 49, 50, 49, 50, 410, 49, 384, 50, 50, 51, 409, 717, 111, 414, 555, 417, 427, 716, 49, 51, 52, 51, 111, 51, 111, 446, 111, 52, 51, 50, 52, 111, 52, 715, 52, 54, 54, 54, 54, 52, 714, 447, 416, 474, 448, 51, 488, 479, 473, 478, 54, 54, 54, 54, 54, 54, 54, 54, 77, 169, 169, 169, 169, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 169, 169, 169, 169, 169, 169, 169, 169, 77, 77, 77, 77, 77, 100, 112, 100, 100, 100, 100, 100, 100, 100, 100, 448, 112, 459, 112, 473, 112, 488, 506, 112, 100, 112, 479, 478, 713, 707, 608, 77, 77, 77, 736, 706, 705, 704, 477, 701, 102, 459, 102, 102, 102, 102, 102, 102, 102, 102, 697, 696, 695, 100, 693, 519, 506, 77, 78, 102, 608, 736, 480, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 105, 105, 105, 105, 105, 105, 105, 105, 78, 78, 78, 78, 78, 477, 102, 519, 106, 105, 106, 106, 106, 106, 106, 106, 106, 106, 78, 199, 199, 199, 199, 199, 199, 199, 199, 106, 460, 480, 481, 78, 78, 78, 107, 468, 107, 507, 105, 107, 107, 107, 107, 107, 107, 107, 107, 200, 200, 200, 200, 200, 200, 200, 200, 521, 106, 78, 108, 113, 108, 108, 108, 108, 108, 108, 108, 108, 535, 113, 114, 113, 691, 113, 529, 460, 115, 108, 113, 481, 114, 468, 114, 526, 114, 690, 115, 689, 115, 114, 115, 534, 170, 114, 507, 115, 170, 170, 170, 170, 170, 170, 170, 170, 521, 682, 108, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 116, 118, 529, 505, 535, 530, 118, 534, 533, 526, 116, 118, 116, 118, 116, 118, 119, 120, 116, 116, 118, 536, 679, 576, 542, 557, 119, 120, 119, 120, 119, 120, 121, 554, 119, 119, 120, 505, 122, 530, 556, 678, 121, 570, 121, 121, 121, 602, 122, 566, 122, 121, 122, 123, 123, 536, 505, 122, 574, 124, 124, 533, 573, 568, 123, 671, 123, 123, 123, 579, 124, 125, 124, 123, 124, 542, 557, 564, 578, 124, 576, 125, 125, 125, 126, 125, 596, 127, 126, 577, 125, 595, 570, 670, 126, 554, 126, 127, 126, 127, 602, 127, 556, 126, 129, 129, 127, 128, 128, 128, 612, 566, 578, 573, 129, 130, 129, 128, 129, 128, 574, 128, 129, 129, 568, 130, 128, 130, 131, 130, 605, 579, 628, 134, 130, 596, 597, 564, 131, 654, 131, 131, 131, 134, 577, 630, 135, 131, 607, 135, 613, 595, 604, 134, 136, 134, 135, 134, 135, 610, 135, 612, 134, 614, 136, 135, 136, 629, 136, 137, 137, 634, 615, 136, 654, 737, 669, 605, 664, 137, 138, 137, 607, 137, 613, 628, 137, 137, 137, 653, 138, 139, 138, 138, 138, 655, 597, 140, 630, 138, 636, 139, 737, 139, 662, 139, 639, 140, 141, 140, 139, 140, 604, 139, 637, 629, 140, 641, 141, 610, 141, 143, 141, 644, 144, 614, 645, 141, 634, 143, 660, 143, 615, 143, 144, 143, 144, 145, 144, 658, 143, 643, 144, 144, 698, 146, 653, 145, 148, 145, 663, 145, 655, 636, 666, 146, 145, 146, 148, 146, 148, 149, 148, 146, 146, 673, 148, 148, 639, 659, 641, 149, 150, 149, 637, 149, 661, 651, 667, 645, 149, 149, 150, 644, 150, 151, 150, 660, 151, 681, 658, 150, 151, 665, 668, 151, 687, 151, 647, 151, 153, 153, 674, 643, 151, 646, 698, 154, 675, 710, 663, 153, 694, 153, 666, 153, 673, 154, 155, 154, 153, 154, 154, 680, 156, 154, 154, 683, 155, 661, 155, 667, 155, 158, 156, 157, 156, 155, 156, 642, 156, 640, 155, 156, 638, 157, 158, 157, 681, 157, 665, 668, 159, 687, 157, 674, 158, 159, 158, 675, 158, 686, 159, 160, 159, 158, 159, 710, 694, 162, 700, 159, 635, 160, 680, 160, 162, 160, 685, 162, 683, 162, 160, 162, 166, 163, 163, 702, 162, 163, 581, 581, 581, 581, 166, 163, 166, 163, 166, 163, 718, 171, 166, 166, 163, 171, 171, 171, 171, 171, 171, 171, 171, 197, 686, 197, 197, 197, 197, 197, 197, 197, 197, 204, 205, 625, 204, 700, 619, 685, 688, 618, 197, 204, 205, 204, 205, 204, 205, 206, 207, 703, 204, 205, 702, 708, 609, 606, 603, 206, 207, 206, 207, 206, 207, 208, 598, 586, 206, 207, 718, 197, 202, 210, 583, 208, 211, 208, 208, 208, 210, 581, 569, 210, 208, 210, 211, 210, 211, 212, 211, 688, 210, 711, 712, 211, 565, 213, 532, 212, 523, 212, 703, 212, 708, 518, 212, 213, 212, 213, 485, 213, 616, 616, 616, 616, 213, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 214, 215, 484, 465, 423, 711, 712, 358, 215, 356, 214, 215, 214, 215, 214, 215, 214, 216, 217, 214, 215, 287, 280, 279, 278, 277, 276, 216, 217, 216, 217, 216, 217, 218, 216, 273, 216, 217, 270, 209, 203, 194, 192, 218, 190, 218, 188, 218, 219, 219, 218, 218, 218, 186, 616, 220, 219, 181, 220, 219, 179, 219, 174, 219, 168, 220, 221, 220, 219, 220, 117, 109, 222, 103, 220, 99, 221, 97, 221, 221, 221, 95, 222, 223, 222, 221, 222, 94, 93, 224, 90, 222, 224, 223, 223, 223, 85, 223, 84, 224, 225, 224, 223, 224, 83, 70, 226, 67, 224, 226, 225, 63, 225, 225, 225, 62, 226, 227, 226, 225, 226, 59, 58, 53, 32, 226, 28, 227, 228, 227, 22, 227, 21, 18, 227, 17, 227, 0, 228, 228, 228, 231, 228, 0, 0, 0, 0, 228, 0, 232, 0, 231, 233, 231, 0, 231, 0, 0, 231, 232, 231, 232, 233, 232, 233, 233, 233, 234, 232, 0, 235, 233, 0, 236, 0, 0, 236, 234, 0, 234, 235, 234, 235, 236, 235, 236, 234, 236, 235, 235, 237, 238, 236, 0, 0, 0, 0, 0, 0, 237, 0, 238, 239, 238, 0, 238, 0, 0, 0, 237, 238, 237, 239, 237, 239, 240, 239, 0, 237, 0, 0, 239, 0, 242, 0, 240, 242, 240, 0, 240, 0, 0, 0, 242, 240, 242, 243, 242, 0, 243, 0, 0, 242, 0, 244, 0, 243, 246, 243, 0, 243, 244, 0, 0, 244, 243, 244, 246, 244, 246, 247, 246, 0, 244, 0, 246, 246, 0, 248, 0, 247, 0, 247, 0, 247, 0, 249, 0, 248, 247, 248, 0, 248, 0, 250, 248, 249, 248, 249, 0, 249, 0, 0, 249, 250, 249, 250, 252, 250, 253, 253, 0, 0, 250, 250, 0, 0, 252, 254, 252, 253, 252, 253, 0, 253, 0, 252, 0, 254, 253, 254, 255, 254, 0, 0, 0, 0, 254, 0, 256, 0, 255, 256, 255, 0, 255, 0, 257, 0, 256, 255, 256, 0, 256, 257, 258, 0, 257, 256, 257, 0, 257, 0, 0, 0, 258, 257, 258, 259, 258, 0, 0, 0, 258, 258, 0, 260, 0, 259, 0, 259, 0, 259, 0, 0, 259, 260, 259, 260, 261, 260, 0, 261, 260, 0, 260, 0, 263, 0, 261, 0, 261, 0, 261, 0, 0, 265, 263, 261, 263, 263, 263, 263, 264, 265, 0, 263, 263, 0, 0, 0, 0, 0, 264, 265, 264, 265, 264, 265, 269, 0, 264, 264, 265, 0, 269, 0, 0, 0, 269, 0, 269, 0, 269, 271, 271, 271, 271, 269, 0, 0, 0, 272, 272, 272, 272, 0, 0, 0, 271, 271, 271, 271, 271, 271, 271, 271, 272, 272, 272, 272, 272, 272, 272, 272, 288, 289, 0, 0, 0, 0, 0, 0, 289, 0, 288, 289, 288, 289, 288, 289, 290, 0, 0, 288, 289, 0, 291, 0, 0, 0, 290, 290, 290, 0, 290, 0, 291, 292, 291, 290, 291, 0, 0, 293, 0, 291, 293, 292, 0, 292, 0, 292, 0, 293, 0, 293, 292, 293, 294, 294, 295, 295, 293, 0, 0, 0, 0, 0, 0, 294, 295, 294, 295, 294, 295, 296, 0, 0, 294, 295, 0, 0, 292, 297, 0, 296, 0, 296, 0, 296, 0, 298, 296, 297, 296, 297, 297, 297, 0, 0, 0, 298, 297, 298, 300, 298, 299, 299, 0, 298, 298, 0, 0, 0, 300, 301, 300, 299, 300, 299, 0, 299, 0, 300, 0, 301, 299, 301, 302, 301, 302, 303, 0, 303, 301, 0, 0, 0, 302, 0, 302, 303, 302, 303, 0, 303, 304, 302, 0, 304, 303, 0, 305, 0, 0, 0, 304, 0, 304, 0, 304, 0, 305, 306, 305, 304, 305, 0, 0, 307, 306, 305, 0, 306, 0, 306, 0, 306, 0, 307, 308, 307, 306, 307, 0, 307, 0, 0, 307, 0, 308, 0, 308, 0, 308, 309, 308, 0, 309, 308, 0, 310, 0, 0, 0, 309, 0, 309, 0, 309, 0, 310, 313, 310, 309, 310, 0, 0, 314, 0, 310, 0, 313, 0, 313, 0, 313, 0, 314, 0, 314, 313, 314, 315, 316, 0, 314, 314, 0, 0, 315, 0, 0, 315, 316, 315, 316, 315, 316, 317, 316, 0, 315, 316, 318, 318, 0, 313, 0, 317, 0, 317, 320, 317, 0, 318, 0, 318, 317, 318, 319, 318, 0, 320, 318, 319, 0, 0, 0, 0, 319, 321, 319, 320, 319, 320, 319, 320, 0, 319, 0, 321, 320, 321, 322, 321, 0, 0, 321, 0, 321, 0, 324, 324, 322, 325, 322, 0, 322, 0, 0, 0, 324, 322, 324, 325, 324, 325, 326, 325, 0, 324, 329, 325, 325, 0, 328, 0, 326, 328, 326, 326, 326, 0, 0, 0, 328, 326, 328, 329, 328, 0, 0, 0, 0, 328, 0, 330, 0, 329, 330, 329, 0, 329, 331, 331, 0, 330, 329, 330, 0, 330, 0, 333, 0, 331, 330, 331, 0, 331, 0, 334, 0, 333, 331, 333, 0, 333, 0, 0, 0, 334, 333, 334, 335, 334, 0, 335, 0, 334, 334, 0, 336, 0, 335, 337, 335, 0, 335, 0, 0, 0, 336, 335, 336, 337, 336, 337, 0, 337, 339, 336, 338, 338, 337, 0, 340, 0, 0, 0, 339, 0, 339, 338, 339, 338, 340, 338, 340, 339, 340, 341, 338, 0, 343, 340, 0, 344, 0, 0, 0, 341, 0, 341, 343, 341, 343, 344, 343, 344, 341, 344, 0, 343, 345, 339, 344, 345, 0, 0, 346, 0, 0, 0, 345, 0, 345, 0, 345, 0, 346, 347, 346, 345, 346, 0, 0, 0, 0, 346, 0, 347, 0, 347, 0, 347, 0, 351, 347, 0, 347, 0, 352, 352, 352, 352, 346, 351, 0, 351, 0, 351, 0, 0, 0, 0, 351, 352, 352, 352, 352, 352, 352, 352, 352, 353, 353, 353, 353, 0, 0, 0, 0, 0, 0, 0, 353, 0, 0, 0, 353, 353, 353, 353, 353, 353, 353, 353, 354, 354, 354, 354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 354, 354, 354, 354, 354, 354, 354, 354, 355, 0, 359, 0, 355, 355, 355, 355, 355, 355, 355, 355, 359, 0, 359, 0, 359, 360, 360, 0, 359, 359, 0, 0, 0, 0, 0, 360, 0, 360, 362, 360, 361, 361, 0, 353, 360, 0, 0, 0, 362, 0, 362, 361, 362, 361, 0, 361, 0, 362, 364, 364, 361, 0, 365, 365, 0, 366, 0, 0, 366, 364, 0, 364, 365, 364, 365, 366, 365, 366, 364, 366, 367, 365, 0, 368, 366, 0, 0, 0, 0, 0, 367, 369, 367, 368, 367, 368, 0, 368, 0, 367, 0, 369, 368, 369, 370, 369, 0, 369, 0, 0, 369, 370, 371, 0, 370, 0, 370, 0, 370, 0, 0, 0, 371, 370, 371, 372, 371, 0, 372, 0, 0, 371, 372, 0, 0, 372, 373, 372, 373, 372, 0, 0, 374, 0, 372, 374, 373, 0, 373, 374, 373, 0, 374, 375, 374, 373, 374, 0, 0, 0, 0, 374, 0, 375, 376, 375, 0, 375, 0, 375, 0, 0, 375, 0, 376, 0, 376, 0, 376, 377, 377, 0, 376, 376, 0, 378, 0, 0, 0, 377, 0, 377, 0, 377, 0, 378, 379, 378, 377, 378, 0, 0, 380, 378, 378, 0, 379, 0, 379, 0, 379, 0, 380, 379, 380, 379, 380, 381, 385, 0, 0, 380, 0, 0, 0, 385, 0, 381, 385, 381, 385, 381, 385, 0, 0, 387, 381, 385, 386, 386, 0, 386, 0, 0, 0, 387, 0, 387, 386, 387, 386, 0, 386, 387, 387, 389, 388, 386, 388, 0, 0, 0, 0, 0, 0, 389, 388, 389, 388, 389, 388, 390, 0, 0, 389, 388, 0, 391, 0, 0, 391, 390, 0, 390, 0, 390, 0, 391, 392, 391, 390, 391, 393, 0, 0, 394, 391, 0, 392, 0, 392, 393, 392, 0, 0, 392, 0, 392, 0, 396, 0, 393, 394, 393, 0, 393, 0, 0, 0, 396, 393, 396, 394, 396, 394, 397, 394, 396, 396, 0, 0, 394, 0, 398, 0, 397, 0, 397, 0, 397, 0, 400, 0, 398, 397, 398, 0, 398, 0, 402, 0, 400, 398, 400, 0, 400, 0, 400, 0, 402, 400, 402, 403, 402, 0, 0, 0, 0, 402, 0, 0, 0, 403, 0, 403, 405, 403, 0, 406, 0, 403, 403, 405, 0, 0, 405, 407, 405, 406, 405, 406, 407, 406, 0, 405, 0, 407, 406, 407, 408, 407, 0, 0, 0, 0, 407, 0, 0, 0, 408, 411, 408, 0, 408, 0, 0, 412, 0, 408, 412, 411, 408, 411, 0, 411, 0, 412, 413, 412, 411, 412, 0, 0, 0, 0, 412, 0, 413, 415, 413, 0, 413, 0, 413, 0, 0, 413, 0, 415, 0, 415, 0, 415, 420, 420, 420, 420, 415, 0, 0, 0, 0, 0, 0, 0, 0, 424, 0, 420, 420, 420, 420, 420, 420, 420, 420, 424, 0, 424, 426, 424, 425, 425, 415, 0, 424, 0, 0, 0, 426, 428, 426, 425, 426, 425, 0, 425, 426, 426, 0, 428, 425, 428, 429, 428, 0, 430, 0, 0, 428, 0, 0, 0, 429, 0, 429, 430, 429, 430, 0, 430, 429, 429, 431, 0, 430, 431, 0, 432, 432, 0, 0, 0, 431, 0, 431, 0, 431, 0, 432, 433, 432, 431, 432, 0, 0, 434, 0, 432, 0, 433, 0, 433, 0, 433, 0, 434, 0, 434, 433, 434, 435, 0, 435, 434, 434, 0, 436, 0, 0, 0, 435, 0, 435, 0, 435, 0, 436, 0, 436, 435, 436, 0, 0, 437, 436, 436, 437, 0, 0, 438, 0, 438, 0, 437, 0, 437, 0, 437, 0, 438, 439, 438, 437, 438, 0, 440, 440, 0, 438, 0, 439, 0, 439, 0, 439, 0, 440, 441, 440, 439, 440, 0, 0, 442, 0, 440, 0, 441, 0, 441, 442, 441, 0, 442, 443, 442, 441, 442, 0, 0, 444, 0, 442, 0, 443, 0, 443, 444, 443, 0, 444, 443, 444, 443, 444, 445, 445, 449, 0, 444, 0, 449, 0, 0, 0, 0, 445, 449, 445, 449, 445, 449, 450, 0, 0, 445, 449, 0, 451, 450, 451, 0, 450, 0, 450, 0, 450, 0, 451, 452, 451, 450, 451, 0, 0, 453, 0, 451, 453, 452, 0, 452, 0, 452, 0, 453, 452, 453, 452, 453, 454, 454, 0, 0, 453, 0, 455, 455, 0, 0, 454, 0, 454, 0, 454, 0, 455, 456, 455, 454, 455, 0, 0, 0, 0, 455, 0, 456, 0, 456, 0, 456, 457, 456, 0, 457, 456, 0, 458, 0, 0, 0, 457, 0, 457, 0, 457, 0, 458, 461, 458, 457, 458, 0, 0, 458, 0, 458, 0, 461, 0, 461, 464, 461, 462, 462, 0, 0, 461, 0, 0, 0, 464, 466, 464, 462, 464, 462, 0, 462, 0, 464, 0, 466, 462, 466, 467, 466, 0, 467, 0, 466, 466, 0, 469, 0, 467, 0, 467, 0, 467, 0, 0, 0, 469, 467, 469, 0, 469, 470, 470, 0, 471, 469, 469, 472, 0, 0, 0, 470, 0, 470, 471, 470, 471, 472, 471, 472, 470, 472, 475, 471, 0, 476, 472, 0, 0, 0, 0, 0, 475, 0, 475, 476, 475, 476, 0, 476, 486, 475, 476, 0, 476, 482, 482, 482, 482, 0, 486, 0, 486, 0, 486, 0, 0, 0, 486, 486, 482, 482, 482, 482, 482, 482, 482, 482, 483, 0, 0, 0, 483, 483, 483, 483, 483, 483, 483, 483, 487, 489, 0, 0, 0, 0, 0, 487, 0, 0, 487, 489, 487, 489, 487, 489, 0, 491, 490, 487, 489, 490, 0, 0, 0, 0, 0, 491, 490, 491, 490, 491, 490, 492, 493, 0, 491, 490, 0, 0, 492, 493, 0, 492, 493, 492, 493, 492, 493, 494, 495, 0, 492, 493, 0, 0, 0, 0, 0, 494, 495, 494, 495, 494, 495, 496, 0, 0, 494, 495, 0, 497, 496, 497, 0, 496, 0, 496, 0, 496, 0, 497, 498, 497, 496, 497, 0, 0, 499, 0, 497, 0, 498, 499, 498, 0, 498, 0, 499, 500, 499, 498, 499, 0, 0, 0, 0, 499, 0, 500, 501, 500, 0, 500, 0, 0, 0, 500, 500, 0, 501, 502, 501, 0, 501, 0, 0, 503, 501, 501, 0, 502, 0, 502, 0, 502, 0, 503, 504, 503, 502, 503, 0, 0, 508, 0, 503, 0, 504, 0, 504, 508, 504, 0, 508, 509, 508, 504, 508, 0, 0, 0, 0, 508, 0, 509, 510, 509, 0, 509, 0, 0, 511, 509, 509, 0, 510, 0, 510, 0, 510, 0, 511, 512, 511, 510, 511, 0, 0, 513, 0, 511, 513, 512, 0, 512, 0, 512, 0, 513, 512, 513, 512, 513, 514, 515, 0, 0, 513, 0, 0, 0, 0, 0, 514, 515, 514, 515, 514, 515, 516, 516, 514, 514, 515, 0, 517, 0, 0, 0, 516, 0, 516, 0, 516, 0, 517, 520, 517, 516, 517, 0, 0, 522, 0, 517, 0, 520, 0, 520, 0, 520, 0, 522, 524, 522, 520, 522, 0, 0, 525, 0, 522, 0, 524, 0, 524, 0, 524, 0, 525, 517, 525, 524, 525, 527, 0, 0, 527, 525, 0, 528, 0, 0, 528, 527, 0, 527, 0, 527, 0, 528, 0, 528, 527, 528, 531, 531, 0, 0, 528, 0, 537, 537, 537, 537, 0, 531, 0, 531, 0, 531, 0, 0, 0, 0, 531, 537, 537, 537, 537, 537, 537, 537, 537, 540, 541, 541, 0, 0, 0, 0, 540, 0, 0, 540, 541, 540, 541, 540, 541, 543, 0, 0, 540, 541, 0, 0, 0, 544, 0, 543, 545, 543, 0, 543, 0, 543, 0, 544, 543, 544, 545, 544, 545, 546, 545, 544, 544, 0, 0, 545, 549, 547, 0, 546, 0, 546, 0, 546, 0, 548, 0, 547, 546, 547, 547, 547, 0, 549, 0, 548, 547, 548, 0, 548, 0, 0, 0, 549, 548, 549, 550, 549, 0, 550, 0, 0, 549, 0, 551, 0, 550, 0, 550, 0, 550, 0, 552, 0, 551, 550, 551, 0, 551, 552, 553, 0, 552, 551, 552, 0, 552, 0, 0, 0, 553, 552, 553, 558, 553, 0, 558, 0, 0, 553, 0, 559, 0, 558, 560, 558, 0, 558, 0, 0, 0, 559, 558, 559, 560, 559, 560, 561, 560, 0, 559, 0, 0, 560, 0, 562, 0, 561, 563, 561, 0, 561, 562, 0, 0, 562, 561, 562, 563, 562, 563, 567, 563, 0, 562, 571, 563, 563, 0, 572, 0, 567, 0, 567, 0, 567, 0, 0, 0, 572, 567, 572, 571, 572, 0, 575, 0, 0, 572, 0, 0, 0, 571, 0, 571, 575, 571, 575, 0, 575, 584, 571, 0, 0, 575, 580, 580, 580, 580, 0, 584, 0, 584, 584, 584, 0, 0, 0, 585, 584, 580, 580, 580, 580, 580, 580, 580, 580, 585, 587, 585, 0, 585, 0, 0, 588, 0, 585, 0, 587, 0, 587, 0, 587, 0, 588, 0, 588, 587, 588, 589, 590, 588, 589, 588, 0, 590, 0, 0, 0, 589, 590, 589, 590, 589, 590, 591, 0, 0, 589, 590, 0, 593, 0, 593, 0, 591, 0, 591, 0, 591, 0, 593, 594, 593, 591, 593, 0, 0, 599, 0, 593, 0, 594, 0, 594, 0, 594, 0, 599, 600, 599, 594, 599, 0, 599, 0, 0, 599, 0, 600, 601, 600, 600, 600, 0, 0, 611, 601, 600, 0, 601, 0, 601, 0, 601, 0, 611, 620, 611, 601, 611, 0, 0, 621, 0, 611, 0, 620, 0, 620, 0, 620, 0, 621, 0, 621, 620, 621, 622, 623, 622, 0, 621, 0, 0, 0, 0, 0, 622, 623, 622, 623, 622, 623, 624, 626, 0, 622, 623, 0, 0, 0, 0, 0, 624, 626, 624, 626, 624, 626, 627, 624, 0, 624, 626, 0, 631, 627, 0, 0, 627, 0, 627, 0, 627, 0, 631, 632, 631, 627, 631, 0, 0, 0, 0, 631, 0, 632, 633, 632, 0, 632, 0, 0, 648, 0, 632, 0, 633, 0, 633, 633, 633, 0, 648, 649, 648, 633, 648, 0, 0, 650, 0, 648, 0, 649, 0, 649, 0, 649, 0, 650, 652, 650, 649, 650, 0, 0, 0, 0, 650, 0, 652, 656, 652, 0, 652, 0, 0, 657, 652, 652, 0, 656, 0, 656, 0, 656, 0, 657, 656, 657, 656, 657, 672, 676, 0, 0, 657, 0, 0, 0, 0, 0, 672, 676, 672, 676, 672, 676, 677, 692, 0, 672, 676, 0, 0, 672, 0, 0, 677, 692, 677, 692, 677, 692, 0, 0, 0, 677, 692, 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 744, 744, 744, 744, 744, 744, 744, 744, 744, 744, 744, 744, 744, 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 747, 747, 747, 747, 0, 747, 747, 747, 747, 747, 747, 747, 747, 748, 748, 748, 0, 748, 0, 748, 0, 748, 749, 749, 0, 749, 749, 750, 750, 0, 0, 750, 750, 0, 750, 750, 750, 750, 750, 750, 751, 751, 751, 751, 0, 751, 751, 751, 751, 751, 751, 751, 751, 752, 752, 752, 752, 752, 752, 752, 752, 0, 752, 752, 753, 0, 0, 0, 753, 753, 753, 753, 753, 753, 753, 754, 0, 0, 0, 754, 754, 754, 754, 754, 754, 754, 755, 755, 0, 755, 755, 756, 756, 0, 756, 756, 757, 757, 0, 757, 757, 758, 0, 758, 758, 759, 759, 0, 759, 759, 760, 0, 760, 760, 761, 0, 761, 761, 762, 0, 762, 762, 763, 0, 763, 763, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 765, 765, 0, 765, 765, 766, 766, 0, 766, 766, 766, 766, 766, 766, 766, 766, 766, 766, 767, 767, 767, 0, 0, 0, 767, 0, 0, 0, 0, 767, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741 } ; /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[139] = { 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, }; extern int asn1p__flex_debug; int asn1p__flex_debug = 1; static yyconst flex_int16_t yy_rule_linenum[138] = { 0, 96, 97, 99, 102, 104, 107, 109, 110, 111, 114, 116, 117, 118, 130, 137, 144, 150, 159, 167, 175, 176, 178, 197, 203, 204, 205, 206, 207, 210, 216, 223, 230, 237, 244, 251, 252, 253, 261, 262, 263, 264, 265, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 351, 352, 357, 358, 359, 362, 367, 373, 381, 391, 396, 398, 399, 403, 408, 413, 419, 420, 422, 428, 441, 444, 469, 513, 515, 526 } ; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; static char *yy_full_match; static int yy_lp; #define REJECT \ { \ *yy_cp = (yy_hold_char); /* undo effects of setting up asn1p_text */ \ yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ ++(yy_lp); \ goto find_rule; \ } #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *asn1p_text; #line 1 "asn1p_l.l" #line 2 "asn1p_l.l" #include #include #include #include "asn1parser.h" #include "asn1p_y.h" int asn1p_lex(void); void asn1p_lexer_hack_push_opaque_state(void); /* Used in .y */ void asn1p_lexer_hack_enable_with_syntax(void); /* Used in .y */ void asn1p_lexer_hack_push_encoding_control(void); /* Used in .y */ #define YY_FATAL_ERROR(msg) do { \ fprintf(stderr, \ "lexer error at line %d, " \ "text \"%s\"\n", \ asn1p_lineno, asn1p_text); \ exit(1); \ } while(0) int asn1p_lexer_pedantic_1990 = 0; int asn1p_lexer_types_year = 0; int asn1p_lexer_constructs_year = 0; int asn1p_as_pointer; static asn1c_integer_t _lex_atoi(const char *ptr); static double _lex_atod(const char *ptr); /* * Check that the type is defined in the year of the standard choosen. */ #define TYPE_LIFETIME(fyr, lyr) \ (!asn1p_lexer_types_year \ || (fyr && fyr <= asn1p_lexer_types_year) \ || (lyr && lyr > asn1p_lexer_types_year)) /* * Check the the construction (or concept, i.e. CLASS) is defined in * a given year. */ #define CONSTRUCT_LIFETIME(fyr, lyr) \ (!asn1p_lexer_constructs_year \ || (fyr && fyr <= asn1p_lexer_constructs_year) \ || (lyr && lyr > asn1p_lexer_constructs_year)) /* * Append quoted string. */ #define QAPPEND(text, tlen) do { \ char *prev_text = asn1p_lval.tv_opaque.buf; \ int prev_len = asn1p_lval.tv_opaque.len; \ char *p; \ \ p = malloc((tlen) + prev_len + 1); \ if(p == NULL) return -1; \ \ if(prev_text) memcpy(p, prev_text, prev_len); \ memcpy(p + prev_len, text, tlen); \ p[prev_len + (tlen)] = '\0'; \ \ free(asn1p_lval.tv_opaque.buf); \ asn1p_lval.tv_opaque.buf = p; \ asn1p_lval.tv_opaque.len = (tlen) + prev_len; \ } while(0) #define YY_NO_INPUT 1 /* Performance penalty is OK */ /* Controlled from within application */ /* Newline */ /* White-space */ #line 2085 "asn1p_l.c" #define INITIAL 0 #define dash_comment 1 #define idash_comment 2 #define cpp_comment 3 #define quoted 4 #define opaque 5 #define encoding_control 6 #define with_syntax 7 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ /* %if-c-only */ #include /* %endif */ /* %if-c++-only */ /* %endif */ #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* %if-c-only Reentrant structure and macros (non-C++). */ /* %if-reentrant */ /* %if-c-only */ static int yy_init_globals (void ); /* %endif */ /* %if-reentrant */ /* %endif */ /* %endif End reentrant structures and macros. */ /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int asn1p_lex_destroy (void ); int asn1p_get_debug (void ); void asn1p_set_debug (int debug_flag ); YY_EXTRA_TYPE asn1p_get_extra (void ); void asn1p_set_extra (YY_EXTRA_TYPE user_defined ); FILE *asn1p_get_in (void ); void asn1p_set_in (FILE * in_str ); FILE *asn1p_get_out (void ); void asn1p_set_out (FILE * out_str ); int asn1p_get_leng (void ); char *asn1p_get_text (void ); int asn1p_get_lineno (void ); void asn1p_set_lineno (int line_number ); /* %if-bison-bridge */ /* %endif */ /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int asn1p_wrap (void ); #else extern int asn1p_wrap (void ); #endif #endif /* %not-for-header */ static void yyunput (int c,char *buf_ptr ); /* %ok-for-header */ /* %endif */ #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif /* %ok-for-header */ /* %endif */ #endif /* %if-c-only */ static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = NULL; static void yy_push_state (int new_state ); static void yy_pop_state (void ); static int yy_top_state (void ); /* %endif */ /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* %if-c-only Standard (non-C++) definition */ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO fwrite( asn1p_text, asn1p_leng, 1, asn1p_out ) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( asn1p_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( asn1p_in ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, asn1p_in))==0 && ferror(asn1p_in)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(asn1p_in); \ } \ }\ \ /* %if-c++-only C++ definition \ */\ /* %endif */ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR /* %if-c-only */ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) /* %endif */ /* %if-c++-only */ /* %endif */ #endif /* %if-tables-serialization structures and prototypes */ /* %not-for-header */ /* %ok-for-header */ /* %not-for-header */ /* %tables-yydmap generated elements */ /* %endif */ /* end tables serialization structures and prototypes */ /* %ok-for-header */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 /* %if-c-only Standard (non-C++) definition */ extern int asn1p_lex (void); #define YY_DECL int asn1p_lex (void) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after asn1p_text and asn1p_leng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif /* %% [6.0] YY_RULE_SETUP definition goes here */ #define YY_RULE_SETUP \ YY_USER_ACTION /* %not-for-header */ /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; /* %% [7.0] user's declarations go here */ #line 94 "asn1p_l.l" #line 2347 "asn1p_l.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif /* Create the reject buffer large enough to save one state per allowed character. */ if ( ! (yy_state_buf) ) (yy_state_buf) = (yy_state_type *)asn1p_alloc(YY_STATE_BUF_SIZE ); if ( ! (yy_state_buf) ) YY_FATAL_ERROR( "out of dynamic memory in asn1p_lex()" ); if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! asn1p_in ) /* %if-c-only */ asn1p_in = stdin; /* %endif */ /* %if-c++-only */ /* %endif */ if ( ! asn1p_out ) /* %if-c-only */ asn1p_out = stdout; /* %endif */ /* %if-c++-only */ /* %endif */ if ( ! YY_CURRENT_BUFFER ) { asn1p_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = asn1p__create_buffer(asn1p_in,YY_BUF_SIZE ); } asn1p__load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { /* %% [8.0] yymore()-related code goes here */ yy_cp = (yy_c_buf_p); /* Support of asn1p_text. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; /* %% [9.0] code to set up and find next match goes here */ yy_current_state = (yy_start); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 742 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } while ( yy_current_state != 741 ); yy_find_action: /* %% [10.0] code to find the action number goes here */ yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; find_rule: /* we branch to this label when backing up */ for ( ; ; ) /* until we find what rule we matched */ { if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) { yy_act = yy_acclist[(yy_lp)]; { (yy_full_match) = yy_cp; break; } } --yy_cp; yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; /* %% [11.0] code for asn1p_lineno update goes here */ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { int yyl; for ( yyl = 0; yyl < asn1p_leng; ++yyl ) if ( asn1p_text[yyl] == '\n' ) asn1p_lineno++; ; } do_action: /* This label is used only to access EOF actions. */ /* %% [12.0] debug code goes here */ if ( asn1p__flex_debug ) { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); else if ( yy_act < 138 ) fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], asn1p_text ); else if ( yy_act == 138 ) fprintf( stderr, "--accepting default rule (\"%s\")\n", asn1p_text ); else if ( yy_act == 139 ) fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); } switch ( yy_act ) { /* beginning of action switch */ /* %% [13.0] actions go here */ case 1: /* rule 1 can match eol */ *yy_cp = (yy_hold_char); /* undo effects of setting up asn1p_text */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up asn1p_text again */ YY_RULE_SETUP #line 96 "asn1p_l.l" /* Immediately terminated long comment */ YY_BREAK case 2: *yy_cp = (yy_hold_char); /* undo effects of setting up asn1p_text */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up asn1p_text again */ YY_RULE_SETUP #line 97 "asn1p_l.l" yy_push_state(idash_comment); /* Incorrect, but acceptable */ YY_BREAK case 3: YY_RULE_SETUP #line 99 "asn1p_l.l" yy_pop_state(); /* Acceptable end of comment */ YY_BREAK case 4: YY_RULE_SETUP #line 102 "asn1p_l.l" asn1p_as_pointer = 1; YY_BREAK case 5: YY_RULE_SETUP #line 104 "asn1p_l.l" yy_push_state(dash_comment); YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP #line 107 "asn1p_l.l" yy_pop_state(); YY_BREAK case 7: YY_RULE_SETUP #line 109 "asn1p_l.l" yy_pop_state(); /* End of comment */ YY_BREAK case 8: YY_RULE_SETUP #line 110 "asn1p_l.l" /* Eat single dash */ YY_BREAK case 9: YY_RULE_SETUP #line 111 "asn1p_l.l" /* Eat */ YY_BREAK case 10: YY_RULE_SETUP #line 114 "asn1p_l.l" yy_push_state(cpp_comment); YY_BREAK case 11: /* rule 11 can match eol */ YY_RULE_SETUP #line 116 "asn1p_l.l" /* Eat */ YY_BREAK case 12: YY_RULE_SETUP #line 117 "asn1p_l.l" yy_pop_state(); YY_BREAK case 13: YY_RULE_SETUP #line 118 "asn1p_l.l" /* Eat */ YY_BREAK /* * This is state is being set from corresponding .y module when * higher-level data is necessary to make proper parsing of the * underlying data. Thus, we enter the state and save * everything for later processing. */ case 14: YY_RULE_SETUP #line 130 "asn1p_l.l" { yy_push_state(opaque); asn1p_lval.tv_opaque.buf = strdup(asn1p_text); asn1p_lval.tv_opaque.len = asn1p_leng; return TOK_opaque; } YY_BREAK case 15: YY_RULE_SETUP #line 137 "asn1p_l.l" { yy_pop_state(); asn1p_lval.tv_opaque.buf = strdup(asn1p_text); asn1p_lval.tv_opaque.len = asn1p_leng; return TOK_opaque; } YY_BREAK case 16: /* rule 16 can match eol */ YY_RULE_SETUP #line 144 "asn1p_l.l" { asn1p_lval.tv_opaque.buf = strdup(asn1p_text); asn1p_lval.tv_opaque.len = asn1p_leng; return TOK_opaque; } YY_BREAK case 17: YY_RULE_SETUP #line 150 "asn1p_l.l" { fprintf(stderr, "ASN.1 Parser syncronization failure: " "\"%s\" at line %d must not appear " "inside value definition\n", asn1p_text, asn1p_lineno); return -1; } YY_BREAK case 18: YY_RULE_SETUP #line 159 "asn1p_l.l" { asn1p_lval.tv_opaque.buf = strdup(asn1p_text); asn1p_lval.tv_opaque.len = asn1p_leng; return TOK_opaque; } YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP #line 167 "asn1p_l.l" { asn1p_lval.tv_opaque.buf = 0; asn1p_lval.tv_opaque.len = 0; QAPPEND(asn1p_text+1, asn1p_leng-1); yy_push_state(quoted); } YY_BREAK case 20: YY_RULE_SETUP #line 175 "asn1p_l.l" { QAPPEND(asn1p_text, asn1p_leng-1); } /* Add a single quote */ YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP #line 176 "asn1p_l.l" { QAPPEND(asn1p_text, asn1p_leng); } YY_BREAK case 22: YY_RULE_SETUP #line 178 "asn1p_l.l" { yy_pop_state(); /* Do not append last quote: // QAPPEND(asn1p_text, asn1p_leng); */ if(asn1p_lexer_pedantic_1990 && strchr(asn1p_text, '\n')) { fprintf(stderr, "%s: " "Newlines are prohibited by ASN.1:1990\n", asn1p_lval.tv_opaque.buf); return -1; } return TOK_cstring; } YY_BREAK case 23: YY_RULE_SETUP #line 197 "asn1p_l.l" { const char *s = "ENCODING-CONTROL"; const char *p = s + sizeof("ENCODING-CONTROL") - 2; for(; p >= s; p--) unput(*p); yy_pop_state(); } YY_BREAK case 24: YY_RULE_SETUP #line 203 "asn1p_l.l" unput('D'); unput('N'); unput('E'); yy_pop_state(); YY_BREAK case 25: YY_RULE_SETUP #line 204 "asn1p_l.l" YY_BREAK case 26: YY_RULE_SETUP #line 205 "asn1p_l.l" YY_BREAK case 27: YY_RULE_SETUP #line 206 "asn1p_l.l" /* Eat everything else */ YY_BREAK case 28: /* rule 28 can match eol */ YY_RULE_SETUP #line 207 "asn1p_l.l" YY_BREAK case 29: /* rule 29 can match eol */ YY_RULE_SETUP #line 210 "asn1p_l.l" { /* " \t\r\n" weren't allowed in ASN.1:1990. */ asn1p_lval.tv_str = asn1p_text; return TOK_hstring; } YY_BREAK case 30: /* rule 30 can match eol */ YY_RULE_SETUP #line 216 "asn1p_l.l" { /* " \t\r\n" weren't allowed in ASN.1:1990. */ asn1p_lval.tv_str = strdup(asn1p_text); return TOK_bstring; } YY_BREAK case 31: YY_RULE_SETUP #line 223 "asn1p_l.l" { asn1p_lval.a_int = _lex_atoi(asn1p_text); if(errno == ERANGE) return -1; return TOK_number_negative; } YY_BREAK case 32: YY_RULE_SETUP #line 230 "asn1p_l.l" { asn1p_lval.a_int = _lex_atoi(asn1p_text); if(errno == ERANGE) return -1; return TOK_number; } YY_BREAK case 33: YY_RULE_SETUP #line 237 "asn1p_l.l" { asn1p_lval.a_int = _lex_atoi(asn1p_text); if(errno == ERANGE) return -1; return TOK_number; } YY_BREAK case 34: YY_RULE_SETUP #line 244 "asn1p_l.l" { asn1p_lval.a_dbl = _lex_atod(asn1p_text); if(errno == ERANGE) return -1; return TOK_realnumber; } YY_BREAK case 35: YY_RULE_SETUP #line 251 "asn1p_l.l" return TOK_ABSENT; YY_BREAK case 36: YY_RULE_SETUP #line 252 "asn1p_l.l" return TOK_ALL; YY_BREAK case 37: YY_RULE_SETUP #line 253 "asn1p_l.l" { /* Appeared in 1990, removed in 1997 */ if(TYPE_LIFETIME(1990, 1997)) return TOK_ANY; fprintf(stderr, "Keyword \"%s\" at line %d " "is obsolete\n", asn1p_text, asn1p_lineno); REJECT; } YY_BREAK case 38: YY_RULE_SETUP #line 261 "asn1p_l.l" return TOK_APPLICATION; YY_BREAK case 39: YY_RULE_SETUP #line 262 "asn1p_l.l" return TOK_AUTOMATIC; YY_BREAK case 40: YY_RULE_SETUP #line 263 "asn1p_l.l" return TOK_BEGIN; YY_BREAK case 41: YY_RULE_SETUP #line 264 "asn1p_l.l" return TOK_BIT; YY_BREAK case 42: YY_RULE_SETUP #line 265 "asn1p_l.l" { if(TYPE_LIFETIME(1994, 0)) return TOK_BMPString; REJECT; } YY_BREAK case 43: YY_RULE_SETUP #line 270 "asn1p_l.l" return TOK_BOOLEAN; YY_BREAK case 44: YY_RULE_SETUP #line 271 "asn1p_l.l" return TOK_BY; YY_BREAK case 45: YY_RULE_SETUP #line 272 "asn1p_l.l" return TOK_CHARACTER; YY_BREAK case 46: YY_RULE_SETUP #line 273 "asn1p_l.l" return TOK_CHOICE; YY_BREAK case 47: YY_RULE_SETUP #line 274 "asn1p_l.l" return TOK_CLASS; YY_BREAK case 48: YY_RULE_SETUP #line 275 "asn1p_l.l" return TOK_COMPONENT; YY_BREAK case 49: YY_RULE_SETUP #line 276 "asn1p_l.l" return TOK_COMPONENTS; YY_BREAK case 50: YY_RULE_SETUP #line 277 "asn1p_l.l" return TOK_CONSTRAINED; YY_BREAK case 51: YY_RULE_SETUP #line 278 "asn1p_l.l" return TOK_CONTAINING; YY_BREAK case 52: YY_RULE_SETUP #line 279 "asn1p_l.l" return TOK_DEFAULT; YY_BREAK case 53: YY_RULE_SETUP #line 280 "asn1p_l.l" { /* Appeared in 1990, removed in 1997 */ if(TYPE_LIFETIME(1990, 1997)) return TOK_DEFINED; fprintf(stderr, "Keyword \"%s\" at line %d " "is obsolete\n", asn1p_text, asn1p_lineno); /* Deprecated since */ REJECT; } YY_BREAK case 54: YY_RULE_SETUP #line 289 "asn1p_l.l" return TOK_DEFINITIONS; YY_BREAK case 55: YY_RULE_SETUP #line 290 "asn1p_l.l" return TOK_EMBEDDED; YY_BREAK case 56: YY_RULE_SETUP #line 291 "asn1p_l.l" return TOK_ENCODED; YY_BREAK case 57: YY_RULE_SETUP #line 292 "asn1p_l.l" return TOK_ENCODING_CONTROL; YY_BREAK case 58: YY_RULE_SETUP #line 293 "asn1p_l.l" return TOK_END; YY_BREAK case 59: YY_RULE_SETUP #line 294 "asn1p_l.l" return TOK_ENUMERATED; YY_BREAK case 60: YY_RULE_SETUP #line 295 "asn1p_l.l" return TOK_EXCEPT; YY_BREAK case 61: YY_RULE_SETUP #line 296 "asn1p_l.l" return TOK_EXPLICIT; YY_BREAK case 62: YY_RULE_SETUP #line 297 "asn1p_l.l" return TOK_EXPORTS; YY_BREAK case 63: YY_RULE_SETUP #line 298 "asn1p_l.l" return TOK_EXTENSIBILITY; YY_BREAK case 64: YY_RULE_SETUP #line 299 "asn1p_l.l" return TOK_EXTERNAL; YY_BREAK case 65: YY_RULE_SETUP #line 300 "asn1p_l.l" return TOK_FALSE; YY_BREAK case 66: YY_RULE_SETUP #line 301 "asn1p_l.l" return TOK_FROM; YY_BREAK case 67: YY_RULE_SETUP #line 302 "asn1p_l.l" return TOK_GeneralizedTime; YY_BREAK case 68: YY_RULE_SETUP #line 303 "asn1p_l.l" return TOK_GeneralString; YY_BREAK case 69: YY_RULE_SETUP #line 304 "asn1p_l.l" return TOK_GraphicString; YY_BREAK case 70: YY_RULE_SETUP #line 305 "asn1p_l.l" return TOK_IA5String; YY_BREAK case 71: YY_RULE_SETUP #line 306 "asn1p_l.l" return TOK_IDENTIFIER; YY_BREAK case 72: YY_RULE_SETUP #line 307 "asn1p_l.l" return TOK_IMPLICIT; YY_BREAK case 73: YY_RULE_SETUP #line 308 "asn1p_l.l" return TOK_IMPLIED; YY_BREAK case 74: YY_RULE_SETUP #line 309 "asn1p_l.l" return TOK_IMPORTS; YY_BREAK case 75: YY_RULE_SETUP #line 310 "asn1p_l.l" return TOK_INCLUDES; YY_BREAK case 76: YY_RULE_SETUP #line 311 "asn1p_l.l" return TOK_INSTANCE; YY_BREAK case 77: YY_RULE_SETUP #line 312 "asn1p_l.l" return TOK_INSTRUCTIONS; YY_BREAK case 78: YY_RULE_SETUP #line 313 "asn1p_l.l" return TOK_INTEGER; YY_BREAK case 79: YY_RULE_SETUP #line 314 "asn1p_l.l" return TOK_INTERSECTION; YY_BREAK case 80: YY_RULE_SETUP #line 315 "asn1p_l.l" return TOK_ISO646String; YY_BREAK case 81: YY_RULE_SETUP #line 316 "asn1p_l.l" return TOK_MAX; YY_BREAK case 82: YY_RULE_SETUP #line 317 "asn1p_l.l" return TOK_MIN; YY_BREAK case 83: YY_RULE_SETUP #line 318 "asn1p_l.l" return TOK_MINUS_INFINITY; YY_BREAK case 84: YY_RULE_SETUP #line 319 "asn1p_l.l" return TOK_NULL; YY_BREAK case 85: YY_RULE_SETUP #line 320 "asn1p_l.l" return TOK_NumericString; YY_BREAK case 86: YY_RULE_SETUP #line 321 "asn1p_l.l" return TOK_OBJECT; YY_BREAK case 87: YY_RULE_SETUP #line 322 "asn1p_l.l" return TOK_ObjectDescriptor; YY_BREAK case 88: YY_RULE_SETUP #line 323 "asn1p_l.l" return TOK_OCTET; YY_BREAK case 89: YY_RULE_SETUP #line 324 "asn1p_l.l" return TOK_OF; YY_BREAK case 90: YY_RULE_SETUP #line 325 "asn1p_l.l" return TOK_OPTIONAL; YY_BREAK case 91: YY_RULE_SETUP #line 326 "asn1p_l.l" return TOK_PATTERN; YY_BREAK case 92: YY_RULE_SETUP #line 327 "asn1p_l.l" return TOK_PDV; YY_BREAK case 93: YY_RULE_SETUP #line 328 "asn1p_l.l" return TOK_PLUS_INFINITY; YY_BREAK case 94: YY_RULE_SETUP #line 329 "asn1p_l.l" return TOK_PRESENT; YY_BREAK case 95: YY_RULE_SETUP #line 330 "asn1p_l.l" return TOK_PrintableString; YY_BREAK case 96: YY_RULE_SETUP #line 331 "asn1p_l.l" return TOK_PRIVATE; YY_BREAK case 97: YY_RULE_SETUP #line 332 "asn1p_l.l" return TOK_REAL; YY_BREAK case 98: YY_RULE_SETUP #line 333 "asn1p_l.l" return TOK_RELATIVE_OID; YY_BREAK case 99: YY_RULE_SETUP #line 334 "asn1p_l.l" return TOK_SEQUENCE; YY_BREAK case 100: YY_RULE_SETUP #line 335 "asn1p_l.l" return TOK_SET; YY_BREAK case 101: YY_RULE_SETUP #line 336 "asn1p_l.l" return TOK_SIZE; YY_BREAK case 102: YY_RULE_SETUP #line 337 "asn1p_l.l" return TOK_STRING; YY_BREAK case 103: YY_RULE_SETUP #line 338 "asn1p_l.l" return TOK_SYNTAX; YY_BREAK case 104: YY_RULE_SETUP #line 339 "asn1p_l.l" return TOK_T61String; YY_BREAK case 105: YY_RULE_SETUP #line 340 "asn1p_l.l" return TOK_TAGS; YY_BREAK case 106: YY_RULE_SETUP #line 341 "asn1p_l.l" return TOK_TeletexString; YY_BREAK case 107: YY_RULE_SETUP #line 342 "asn1p_l.l" return TOK_TRUE; YY_BREAK case 108: YY_RULE_SETUP #line 343 "asn1p_l.l" return TOK_UNION; YY_BREAK case 109: YY_RULE_SETUP #line 344 "asn1p_l.l" return TOK_UNIQUE; YY_BREAK case 110: YY_RULE_SETUP #line 345 "asn1p_l.l" return TOK_UNIVERSAL; YY_BREAK case 111: YY_RULE_SETUP #line 346 "asn1p_l.l" { if(TYPE_LIFETIME(1994, 0)) return TOK_UniversalString; REJECT; } YY_BREAK case 112: YY_RULE_SETUP #line 351 "asn1p_l.l" return TOK_UTCTime; YY_BREAK case 113: YY_RULE_SETUP #line 352 "asn1p_l.l" { if(TYPE_LIFETIME(1994, 0)) return TOK_UTF8String; REJECT; } YY_BREAK case 114: YY_RULE_SETUP #line 357 "asn1p_l.l" return TOK_VideotexString; YY_BREAK case 115: YY_RULE_SETUP #line 358 "asn1p_l.l" return TOK_VisibleString; YY_BREAK case 116: YY_RULE_SETUP #line 359 "asn1p_l.l" return TOK_WITH; YY_BREAK case 117: YY_RULE_SETUP #line 362 "asn1p_l.l" { asn1p_lval.tv_str = strdup(asn1p_text); return TOK_typefieldreference; } YY_BREAK case 118: YY_RULE_SETUP #line 367 "asn1p_l.l" { asn1p_lval.tv_str = strdup(asn1p_text); return TOK_valuefieldreference; } YY_BREAK case 119: YY_RULE_SETUP #line 373 "asn1p_l.l" { asn1p_lval.tv_str = strdup(asn1p_text); return TOK_identifier; } YY_BREAK /* * objectclassreference */ case 120: YY_RULE_SETUP #line 381 "asn1p_l.l" { asn1p_lval.tv_str = strdup(asn1p_text); return TOK_capitalreference; } YY_BREAK /* * typereference, modulereference * NOTE: TOK_objectclassreference must be combined * with this token to produce true typereference. */ case 121: YY_RULE_SETUP #line 391 "asn1p_l.l" { asn1p_lval.tv_str = strdup(asn1p_text); return TOK_typereference; } YY_BREAK case 122: YY_RULE_SETUP #line 396 "asn1p_l.l" return TOK_PPEQ; YY_BREAK case 123: YY_RULE_SETUP #line 398 "asn1p_l.l" return TOK_ThreeDots; YY_BREAK case 124: YY_RULE_SETUP #line 399 "asn1p_l.l" return TOK_TwoDots; YY_BREAK case 125: YY_RULE_SETUP #line 403 "asn1p_l.l" { asn1p_lval.tv_str = strdup(asn1p_text); return TOK_Literal; } YY_BREAK case 126: YY_RULE_SETUP #line 408 "asn1p_l.l" { asn1p_lval.tv_str = strdup(asn1p_text); return TOK_Literal; } YY_BREAK case 127: YY_RULE_SETUP #line 413 "asn1p_l.l" { yy_push_state(with_syntax); asn1p_lval.tv_str = strdup(asn1p_text); return TOK_Literal; } YY_BREAK case 128: YY_RULE_SETUP #line 419 "asn1p_l.l" return '['; YY_BREAK case 129: YY_RULE_SETUP #line 420 "asn1p_l.l" return ']'; YY_BREAK case 130: /* rule 130 can match eol */ YY_RULE_SETUP #line 422 "asn1p_l.l" { asn1p_lval.tv_opaque.buf = strdup(asn1p_text); asn1p_lval.tv_opaque.len = asn1p_leng; return TOK_whitespace; } YY_BREAK case 131: YY_RULE_SETUP #line 428 "asn1p_l.l" { yy_pop_state(); if(YYSTATE == with_syntax) { asn1p_lval.tv_str = strdup(asn1p_text); return TOK_Literal; } else { return '}'; } } YY_BREAK case 132: /* rule 132 can match eol */ YY_RULE_SETUP #line 441 "asn1p_l.l" /* Ignore whitespace */ YY_BREAK case 133: /* rule 133 can match eol */ YY_RULE_SETUP #line 444 "asn1p_l.l" { asn1c_integer_t v1 = -1, v2 = -1; char *p; for(p = asn1p_text; *p; p++) if(*p >= '0' && *p <= '9') { v1 = _lex_atoi(p); break; } while(*p >= '0' && *p <= '9') p++; /* Skip digits */ for(; *p; p++) if(*p >= '0' && *p <= '9') { v2 = _lex_atoi(p); break; } if(v1 < 0 || v1 > 7) { fprintf(stderr, "%s at line %d: X.680:2003, #37.14 " "mandates 0..7 range for Tuple's TableColumn\n", asn1p_text, asn1p_lineno); return -1; } if(v2 < 0 || v2 > 15) { fprintf(stderr, "%s at line %d: X.680:2003, #37.14 " "mandates 0..15 range for Tuple's TableRow\n", asn1p_text, asn1p_lineno); return -1; } asn1p_lval.a_int = (v1 << 4) + v2; return TOK_tuple; } YY_BREAK case 134: /* rule 134 can match eol */ YY_RULE_SETUP #line 469 "asn1p_l.l" { asn1c_integer_t v1 = -1, v2 = -1, v3 = -1, v4 = -1; char *p; for(p = asn1p_text; *p; p++) if(*p >= '0' && *p <= '9') { v1 = _lex_atoi(p); break; } while(*p >= '0' && *p <= '9') p++; /* Skip digits */ for(; *p; p++) if(*p >= '0' && *p <= '9') { v2 = _lex_atoi(p); break; } while(*p >= '0' && *p <= '9') p++; for(; *p; p++) if(*p >= '0' && *p <= '9') { v3 = _lex_atoi(p); break; } while(*p >= '0' && *p <= '9') p++; for(; *p; p++) if(*p >= '0' && *p <= '9') { v4 = _lex_atoi(p); break; } if(v1 < 0 || v1 > 127) { fprintf(stderr, "%s at line %d: X.680:2003, #37.12 " "mandates 0..127 range for Quadruple's Group\n", asn1p_text, asn1p_lineno); return -1; } if(v2 < 0 || v2 > 255) { fprintf(stderr, "%s at line %d: X.680:2003, #37.12 " "mandates 0..255 range for Quadruple's Plane\n", asn1p_text, asn1p_lineno); return -1; } if(v3 < 0 || v3 > 255) { fprintf(stderr, "%s at line %d: X.680:2003, #37.12 " "mandates 0..255 range for Quadruple's Row\n", asn1p_text, asn1p_lineno); return -1; } if(v4 < 0 || v4 > 255) { fprintf(stderr, "%s at line %d: X.680:2003, #37.12 " "mandates 0..255 range for Quadruple's Cell\n", asn1p_text, asn1p_lineno); return -1; } asn1p_lval.a_int = (v1 << 24) | (v2 << 16) | (v3 << 8) | v4; return TOK_quadruple; } YY_BREAK case 135: YY_RULE_SETUP #line 513 "asn1p_l.l" return asn1p_text[0]; YY_BREAK case 136: /* rule 136 can match eol */ YY_RULE_SETUP #line 515 "asn1p_l.l" { if(TYPE_LIFETIME(1994, 0)) fprintf(stderr, "ERROR: "); fprintf(stderr, "Symbol '%c' at line %d is prohibited " "by ASN.1:1994 and ASN.1:1997\n", asn1p_text[0], asn1p_lineno); if(TYPE_LIFETIME(1994, 0)) return -1; } YY_BREAK case 137: YY_RULE_SETUP #line 526 "asn1p_l.l" { fprintf(stderr, "Unexpected token at line %d: \"%s\"\n", asn1p_lineno, asn1p_text); while(YYSTATE != INITIAL) yy_pop_state(); if(0) { yy_top_state(); /* Just to use this function. */ yy_fatal_error("Parse error"); } return -1; } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(dash_comment): case YY_STATE_EOF(idash_comment): case YY_STATE_EOF(cpp_comment): case YY_STATE_EOF(quoted): case YY_STATE_EOF(opaque): case YY_STATE_EOF(encoding_control): case YY_STATE_EOF(with_syntax): #line 539 "asn1p_l.l" { while(YYSTATE != INITIAL) yy_pop_state(); yyterminate(); } YY_BREAK case 138: YY_RULE_SETUP #line 546 "asn1p_l.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 3458 "asn1p_l.c" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed asn1p_in at a new source and called * asn1p_lex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = asn1p_in; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( asn1p_wrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * asn1p_text, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of asn1p_lex */ /* %ok-for-header */ /* %if-c++-only */ /* %not-for-header */ /* %ok-for-header */ /* %endif */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ /* %if-c-only */ static int yy_get_next_buffer (void) /* %endif */ /* %if-c++-only */ /* %endif */ { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; asn1p_restart(asn1p_in ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) asn1p_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ /* %if-c-only */ /* %not-for-header */ static yy_state_type yy_get_previous_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { register yy_state_type yy_current_state; register char *yy_cp; /* %% [15.0] code to get the start state into yy_current_state goes here */ yy_current_state = (yy_start); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { /* %% [16.0] code to find the next state goes here */ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 742 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ /* %if-c-only */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) /* %endif */ /* %if-c++-only */ /* %endif */ { register int yy_is_jam; /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ register YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 742 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 741); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; } /* %if-c-only */ static void yyunput (int c, register char * yy_bp ) /* %endif */ /* %if-c++-only */ /* %endif */ { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up asn1p_text */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; /* %% [18.0] update asn1p_lineno here */ if ( c == '\n' ){ --asn1p_lineno; } (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } /* %if-c-only */ /* %endif */ /* %if-c-only */ #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif /* %endif */ /* %if-c++-only */ /* %endif */ { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ asn1p_restart(asn1p_in ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( asn1p_wrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve asn1p_text */ (yy_hold_char) = *++(yy_c_buf_p); /* %% [19.0] update BOL and asn1p_lineno */ if ( c == '\n' ) asn1p_lineno++; ; return c; } /* %if-c-only */ #endif /* ifndef YY_NO_INPUT */ /* %endif */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ /* %if-c-only */ void asn1p_restart (FILE * input_file ) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( ! YY_CURRENT_BUFFER ){ asn1p_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = asn1p__create_buffer(asn1p_in,YY_BUF_SIZE ); } asn1p__init_buffer(YY_CURRENT_BUFFER,input_file ); asn1p__load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ /* %if-c-only */ void asn1p__switch_to_buffer (YY_BUFFER_STATE new_buffer ) /* %endif */ /* %if-c++-only */ /* %endif */ { /* TODO. We should be able to replace this entire function body * with * asn1p_pop_buffer_state(); * asn1p_push_buffer_state(new_buffer); */ asn1p_ensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; asn1p__load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (asn1p_wrap()) processing, but the only time this flag * is looked at is after asn1p_wrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } /* %if-c-only */ static void asn1p__load_buffer_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; asn1p_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ /* %if-c-only */ YY_BUFFER_STATE asn1p__create_buffer (FILE * file, int size ) /* %endif */ /* %if-c++-only */ /* %endif */ { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) asn1p_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in asn1p__create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) asn1p_alloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in asn1p__create_buffer()" ); b->yy_is_our_buffer = 1; asn1p__init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with asn1p__create_buffer() * */ /* %if-c-only */ void asn1p__delete_buffer (YY_BUFFER_STATE b ) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) asn1p_free((void *) b->yy_ch_buf ); asn1p_free((void *) b ); } /* %if-c-only */ /* %endif */ /* %if-c++-only */ /* %endif */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a asn1p_restart() or at EOF. */ /* %if-c-only */ static void asn1p__init_buffer (YY_BUFFER_STATE b, FILE * file ) /* %endif */ /* %if-c++-only */ /* %endif */ { int oerrno = errno; asn1p__flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then asn1p__init_buffer was _probably_ * called from asn1p_restart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } /* %if-c-only */ b->yy_is_interactive = 0; /* %endif */ /* %if-c++-only */ /* %endif */ errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ /* %if-c-only */ void asn1p__flush_buffer (YY_BUFFER_STATE b ) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) asn1p__load_buffer_state( ); } /* %if-c-or-c++ */ /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ /* %if-c-only */ void asn1p_push_buffer_state (YY_BUFFER_STATE new_buffer ) /* %endif */ /* %if-c++-only */ /* %endif */ { if (new_buffer == NULL) return; asn1p_ensure_buffer_stack(); /* This block is copied from asn1p__switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from asn1p__switch_to_buffer. */ asn1p__load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /* %endif */ /* %if-c-or-c++ */ /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ /* %if-c-only */ void asn1p_pop_buffer_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { if (!YY_CURRENT_BUFFER) return; asn1p__delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { asn1p__load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* %endif */ /* %if-c-or-c++ */ /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ /* %if-c-only */ static void asn1p_ensure_buffer_stack (void) /* %endif */ /* %if-c++-only */ /* %endif */ { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)asn1p_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in asn1p_ensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)asn1p_realloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in asn1p_ensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE asn1p__scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) asn1p_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in asn1p__scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; asn1p__switch_to_buffer(b ); return b; } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan a string. The next call to asn1p_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * asn1p__scan_bytes() instead. */ YY_BUFFER_STATE asn1p__scan_string (yyconst char * yystr ) { return asn1p__scan_bytes(yystr,strlen(yystr) ); } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan the given bytes. The next call to asn1p_lex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE asn1p__scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) asn1p_alloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in asn1p__scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = asn1p__scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in asn1p__scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } /* %endif */ /* %if-c-only */ static void yy_push_state (int new_state ) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) { yy_size_t new_size; (yy_start_stack_depth) += YY_START_STACK_INCR; new_size = (yy_start_stack_depth) * sizeof( int ); if ( ! (yy_start_stack) ) (yy_start_stack) = (int *) asn1p_alloc(new_size ); else (yy_start_stack) = (int *) asn1p_realloc((void *) (yy_start_stack),new_size ); if ( ! (yy_start_stack) ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; BEGIN(new_state); } /* %if-c-only */ static void yy_pop_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( --(yy_start_stack_ptr) < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); } /* %if-c-only */ static int yy_top_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { return (yy_start_stack)[(yy_start_stack_ptr) - 1]; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif /* %if-c-only */ static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* %endif */ /* %if-c++-only */ /* %endif */ /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up asn1p_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ asn1p_text[asn1p_leng] = (yy_hold_char); \ (yy_c_buf_p) = asn1p_text + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ asn1p_leng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /* %if-c-only */ /* %if-reentrant */ /* %endif */ /** Get the current line number. * */ int asn1p_get_lineno (void) { return asn1p_lineno; } /** Get the input stream. * */ FILE *asn1p_get_in (void) { return asn1p_in; } /** Get the output stream. * */ FILE *asn1p_get_out (void) { return asn1p_out; } /** Get the length of the current token. * */ int asn1p_get_leng (void) { return asn1p_leng; } /** Get the current token. * */ char *asn1p_get_text (void) { return asn1p_text; } /* %if-reentrant */ /* %endif */ /** Set the current line number. * @param line_number * */ void asn1p_set_lineno (int line_number ) { asn1p_lineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see asn1p__switch_to_buffer */ void asn1p_set_in (FILE * in_str ) { asn1p_in = in_str ; } void asn1p_set_out (FILE * out_str ) { asn1p_out = out_str ; } int asn1p_get_debug (void) { return asn1p__flex_debug; } void asn1p_set_debug (int bdebug ) { asn1p__flex_debug = bdebug ; } /* %endif */ /* %if-reentrant */ /* %if-bison-bridge */ /* %endif */ /* %endif if-c-only */ /* %if-c-only */ static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from asn1p_lex_destroy(), so don't allocate here. */ /* We do not touch asn1p_lineno unless the option is enabled. */ asn1p_lineno = 1; (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; (yy_start_stack_ptr) = 0; (yy_start_stack_depth) = 0; (yy_start_stack) = NULL; (yy_state_buf) = 0; (yy_state_ptr) = 0; (yy_full_match) = 0; (yy_lp) = 0; /* Defined in main.c */ #ifdef YY_STDINIT asn1p_in = stdin; asn1p_out = stdout; #else asn1p_in = (FILE *) 0; asn1p_out = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * asn1p_lex_init() */ return 0; } /* %endif */ /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ /* asn1p_lex_destroy is for both reentrant and non-reentrant scanners. */ int asn1p_lex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ asn1p__delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; asn1p_pop_buffer_state(); } /* Destroy the stack itself. */ asn1p_free((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Destroy the start condition stack. */ asn1p_free((yy_start_stack) ); (yy_start_stack) = NULL; asn1p_free ( (yy_state_buf) ); (yy_state_buf) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * asn1p_lex() is called, initialization will occur. */ yy_init_globals( ); /* %if-reentrant */ /* %endif */ return 0; } /* %endif */ /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *asn1p_alloc (yy_size_t size ) { return (void *) malloc( size ); } void *asn1p_realloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void asn1p_free (void * ptr ) { free( (char *) ptr ); /* see asn1p_realloc() for (char *) cast */ } /* %if-tables-serialization definitions */ /* %define-yytables The name for this specific scanner's tables. */ #define YYTABLES_NAME "yytables" /* %endif */ /* %ok-for-header */ #line 546 "asn1p_l.l" /* * Very dirty but wonderful hack allowing to rule states from within .y file. */ void asn1p_lexer_hack_push_opaque_state() { yy_push_state(opaque); } /* * Another hack which disables recognizing some tokens when inside WITH SYNTAX. */ void asn1p_lexer_hack_enable_with_syntax() { yy_push_state(with_syntax); } /* Yet another */ void asn1p_lexer_hack_push_encoding_control() { yy_push_state(encoding_control); } static asn1c_integer_t _lex_atoi(const char *ptr) { asn1c_integer_t value; if(asn1p_atoi(ptr, &value)) { fprintf(stderr, "Value \"%s\" at line %d is too large " "for this compiler! Please contact the asn1c author.\n", ptr, asn1p_lineno); errno = ERANGE; } return value; } static double _lex_atod(const char *ptr) { double value; errno = 0; value = strtod(ptr, 0); if(errno) { fprintf(stderr, "Value \"%s\" at line %d is outside of `double` range " "in this compiler! Please contact the asn1c author.\n", ptr, asn1p_lineno); errno = ERANGE; } return value; } asn1c-0.9.24+dfsg/libasn1parser/expr-h.pl0000755000000000000000000000170611505405150016541 0ustar rootroot#!/usr/bin/env perl print<) { chomp; next if(/TYPE_MAX/); next unless(/^[ \t]+(ASN_[A-Z]+_([A-Za-z0-9_]+))/); print "\t[ $1 ]\t = "; $_ = $2; if($_ eq "RELATIVE_OID") { print '"RELATIVE-OID"'; } else { s/_/ /; print '"'.$_.'"'; } print ",\n"; } print<= sizeof(asn1p_expr_type2str) \\ / sizeof(asn1p_expr_type2str[0])) \\ ? (char *)0 \\ : asn1p_expr_type2str[(int)(type)] \\ ) #endif /* ASN1_PARSER_EXPR_STR_H */ EOM asn1c-0.9.24+dfsg/libasn1parser/Makefile.am0000644000000000000000000000133312121077077017036 0ustar rootroot AM_CFLAGS = @ADD_CFLAGS@ AM_YFLAGS = -p asn1p_ -d AM_LFLAGS = -s -p -Cem -Pasn1p_ -olex.yy.c noinst_LTLIBRARIES = libasn1parser.la libasn1parser_la_LDFLAGS = -all-static libasn1parser_la_SOURCES = \ asn1parser.c asn1parser.h \ asn1p_y.c asn1p_y.h asn1p_l.c \ asn1p_module.c asn1p_module.h \ asn1p_oid.c asn1p_oid.h \ asn1p_value.c asn1p_value.h \ asn1p_expr.c asn1p_expr.h \ asn1p_expr_str.h \ asn1p_expr2uclass.h \ asn1p_xports.c asn1p_xports.h \ asn1p_constr.c asn1p_constr.h \ asn1p_param.c asn1p_param.h \ asn1p_class.c asn1p_class.h \ asn1p_ref.c asn1p_ref.h \ asn1p_list.h asn1parser.h: asn1p_expr_str.h asn1p_expr_str.h: expr-h.pl asn1p_expr.h ./expr-h.pl asn1p_expr.h > $@ EXTRA_DIST = expr-h.pl asn1c-0.9.24+dfsg/libasn1parser/asn1p_ref.c0000644000000000000000000000474311472004364017031 0ustar rootroot#include #include #include #include #include #include "asn1parser.h" /* * Construct a new empty reference. */ asn1p_ref_t * asn1p_ref_new(int _lineno) { asn1p_ref_t *ref; ref = calloc(1, sizeof *ref); if(ref) { ref->_lineno = _lineno; } return ref; } void asn1p_ref_free(asn1p_ref_t *ref) { if(ref) { if(ref->components) { int i = ref->comp_count; while(i--) { if(ref->components[i].name) free(ref->components[i].name); ref->components[i].name = 0; } free(ref->components); ref->components = 0; } free(ref); } } static enum asn1p_ref_lex_type_e asn1p_ref_name2lextype(char *name) { enum asn1p_ref_lex_type_e lex_type; int has_lowercase = 0; if(*name == '&') { if(name[1] >= 'A' && name[1] <= 'Z') { lex_type = RLT_AmpUppercase; } else { lex_type = RLT_Amplowercase; } } else if(*name >= 'A' && *name <= 'Z') { char *p; for(p = name; *p; p++) { if(*p >= 'a' && *p <= 'z') { has_lowercase = 1; break; } } if(has_lowercase) { lex_type = RLT_Uppercase; } else { lex_type = RLT_CAPITALS; } } else if(*name == '@') { if(name[1] == '.') lex_type = RLT_AtDotlowercase; else lex_type = RLT_Atlowercase; } else { lex_type = RLT_lowercase; } return lex_type; } int asn1p_ref_add_component(asn1p_ref_t *ref, char *name, enum asn1p_ref_lex_type_e lex_type) { if(!ref || !name || (int)lex_type < RLT_UNKNOWN || lex_type >= RLT_MAX) { errno = EINVAL; return -1; } if(ref->comp_count == ref->comp_size) { int newsize = ref->comp_size?(ref->comp_size<<2):4; void *p = realloc(ref->components, newsize * sizeof(ref->components[0])); if(p) { ref->components = p; ref->comp_size = newsize; } else { return -1; } } if(lex_type == RLT_UNKNOWN) { lex_type = asn1p_ref_name2lextype(name); } else { assert(lex_type == asn1p_ref_name2lextype(name)); } ref->components[ref->comp_count].name = strdup(name); ref->components[ref->comp_count].lex_type = lex_type; if(ref->components[ref->comp_count].name) { ref->comp_count++; return 0; } else { return -1; } } asn1p_ref_t * asn1p_ref_clone(asn1p_ref_t *ref) { asn1p_ref_t *newref; newref = asn1p_ref_new(ref->_lineno); if(newref) { int i; for(i = 0; i < ref->comp_count; i++) { if(asn1p_ref_add_component(newref, ref->components[i].name, ref->components[i].lex_type )) { asn1p_ref_free(newref); newref = NULL; break; } } } return newref; } asn1c-0.9.24+dfsg/install-sh0000755000000000000000000003160012015121740014225 0ustar rootroot#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-10-14.15 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" posix_glob= posix_mkdir= # Desired mode of installed file. mode=0755 chmodcmd=$chmodprog chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) mode=$2 shift shift case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac done if test $# -ne 0 && test -z "$dir_arg$dstarg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix=/ ;; -*) prefix=./ ;; *) prefix= ;; esac case $posix_glob in '') if (set -f) 2>/dev/null; then posix_glob=true else posix_glob=false fi ;; esac oIFS=$IFS IFS=/ $posix_glob && set -f set fnord $dstdir shift $posix_glob && set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dst"; then $doit $rmcmd -f "$dst" 2>/dev/null \ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } } || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: asn1c-0.9.24+dfsg/ylwrap0000755000000000000000000001406112015121740013467 0ustar rootroot#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2005-05-14.22 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) $prog "$input" ;; *) $prog "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: asn1c-0.9.24+dfsg/config.sub0000755000000000000000000007746012015121740014222 0ustar rootroot#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-09-20' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: asn1c-0.9.24+dfsg/examples/0000755000000000000000000000000012223077270014050 5ustar rootrootasn1c-0.9.24+dfsg/examples/crfc2asn1.pl0000755000000000000000000000562011461150505016171 0ustar rootroot#!/usr/bin/env perl # # $Id$ # $Author$ # # Simple tool to fetch the ASN.1 specifications from the given set of RFC files. # my $inasn = 0; # Are we inside ASN.1 grammar? my $found = 0; my $currentFname = ''; if(-t STDIN && $#ARGV == -1) { print STDERR "Rip ASN.1 specification from RFC file\n"; print STDERR "Usage: $0 ...\n"; print STDERR "Usage: | $0\n"; exit(1); } while(<>) { # # Strip RFC page delimiters. # next if /^[A-Z].*\[Page [0-9]+\]$/; next if /^ $/; next if /^RFC [0-9].*[0-9]+$/; if($inasn == 0) { # # The least correct way to find the start of ASN # definition. That is, to ask a user. # if(/^[ \t]*END[ \t]*(--.*)?$/) { print STDERR "Missed an ASN.1 grammar before line ". $. ."?\n"; exit(1); } my $modName = ''; # ASN.1 module name my $rfcid = ''; $rfcid = $1 . '-' if($ARGV =~ /([a-z0-9]+)/i); if(/^[ \t]*([A-Z][A-Za-z0-9-]*).*DEFINITIONS.*::=/) { $modName = $1; $currentFname = $rfcid . $modName . ".asn1"; $inasn = 1; } elsif(/^[ \t]*([A-Z][A-Za-z0-9-]*).*{[ \t]*iso/ || /^[ \t]*{[ \t]*iso/) { $modName = $1; unless(length($modName)) { next unless $prevLine =~ /^[ \t]*([A-Z][A-Za-z0-9-]*)[ \t]*$/; $modName = $1; } $currentFname = $rfcid . $modName . ".asn1"; my @a = ($_); my $i; for($i = 0; $i < 8; $i++) { $_ = <>; push(@a, $_); if(/DEFINITIONS/) { $_ = join('', @a); $inasn = 1; last; } } next unless $inasn; } elsif(/^\s*DEFINITIONS\s*$/ && $prevLine =~ /^\s*([A-Z][A-Za-z0-9-]*)\s*{[0-9a-z)( -]+}\s*$/) { $_ = $prevLine . $prevComments . $_; $modName = $1; $currentFname = $rfcid . $modName. ".asn1"; $inasn = 1; } else { if(/^[ \t]*--/) { $prevComments .= $_; } else { $prevComments = ''; $prevLine = $_; } next; } print STDERR "Found $modName at line $.\n=> Saving as $currentFname\n"; open(O, "> $currentFname") or die "Can't open $currentFname"; select(O); $found++; print "\n"; print "-- \n"; print "-- ASN.1 module found by $0 in $ARGV at line " . $. . "\n"; print "-- \n"; print "\n"; } if(/^[ \t]*END[ \t]*(--.*)?$/) { print; select(STDOUT); close(O); $inasn = 0; next; } # # The following clauses are primarily designed to make # asn1c command-line easier (i.e., to avoid "-ftypes88"). # You may want to get rid of them if you're doing generic # ASN.1 extraction and do not want to alter the ASN.1 specs. # if( /^([ \t]*)((UniversalString|BMPString|UTF8String)\s+::=\s+\[[A-Z]+\s\d+\]\sIMPLICIT\sOCTET\sSTRING)(.*)$/ms ) { print "\n-- Legacy redefinition of $3 removed by $0:\n"; print "$1-- $2 -- $4"; next; } elsif(/delete following line if \"new\" types are supported/) { print; print "/* Legacy stuff deleted by $0:\n"; $_ = <>; print; print " */\n"; next; } print; # Dump the ASN.1 module line out. } die "No ASN.1 modules found\n" unless $found; asn1c-0.9.24+dfsg/examples/README0000644000000000000000000000302611461150505014725 0ustar rootroot This directory contains a few examples. 1. The ./sample.source.PKIX1 directory contains the X.509 Certificate decoder, as specified in rfc3280.txt. Just type `make` in there to compile. 2. The ./sample.source.MHEG5 directory contains the decoder for ISO 13522 MHEG-5/ITU-T T.172 (Multimedia Hypermedia Experts Group, Multimedia Presentations). Read the README file in that directory. 3. The ./sample.source.MEGACO directory contains the decoder for Media Gateway Control Protocol data units as specified in rfc3525.txt. 4. The ./sample.source.LDAP3 directory contains the decoder for Lightweight Directory Access Protocol version 3 PDU as specified in rfc4211.txt. 6. The ./sample.source.RRC directory contains the 3GPP Radio Resource Control decoder. Just type `make` in there to compile. 5. The ./sample.source.TAP3 directory contains the GSM TAP3 decoder. Before trying to compile, read the README file in that directory. 6. The ./sample.source.ULP directory contains the Open Mobile Alliance UserPlane Location Protocol decoder. Before trying to compile, read the README file in that directory. The clyx2asn1.pl script can be used to extract ASN.1 data from LyX editor files. The crfc2asn1.pl script can be used to extract ASN.1 data from RFC texts. For instance, it is used to extract X.509, MEGACO, and LDAPv3 ASN.1 modules from the corresponding RFC texts (rfc3280.txt, rfc3525.txt, rfc4211.txt). To regenerate the .asn1 files from the original RFC texts, execute `make clean; make` in the current directory. asn1c-0.9.24+dfsg/examples/sample.source.RRC/0000755000000000000000000000000012223077270017255 5ustar rootrootasn1c-0.9.24+dfsg/examples/sample.source.RRC/sample-DL-DCCH-Message-1.per0000644000000000000000000000001611456135550023762 0ustar rootroot€À€À_@asn1c-0.9.24+dfsg/examples/sample.source.RRC/README0000644000000000000000000000221311456135550020136 0ustar rootroot GENERAL INFORMATION =================== The 3GPP TS 25.331 version 7.1.0 RRC (Radio Resource Control) PER decoder. Invoking `make` will compile the ASN.1 specifications from the ../rrc.asn1 file. OBTAINING THE RRC SPECIFICATION ================================ To obtain a different version of RRC ASN.1 specification, you should go to http://www.3gpp.org/ftp/Specs/html-info/25331.htm and download any version of RRC specification you like. A .ZIP file with a Microsoft Word .DOC files will download shortly. You should extract the ASN.1 modules from the chapter 11 of that .DOC file. Be careful not to copy any preambles, chapter titles and other non-ASN.1 text. rrc-dump USAGE ============== The rrc-dump utility may be used to dump the contents of a PER-encoded RRC protocol data unit. Since RRC specification contains multiple PDUs, a PDU must be selected manually using -p command line option: ./rrc-dump -p DL-DCCH-Message message.per ./rrc-dump -p PCCH-Message message.per The list of recognized PDUs may be obtained using `-p list`. The full list of recognized command line options may be obtained with > ./rrc-dump -h asn1c-0.9.24+dfsg/examples/sample.source.RRC/config.h0000644000000000000000000000031011472004363020663 0ustar rootroot extern int opt_debug; #define ASN_DEBUG(fmt, args...) do { \ if(opt_debug < 2) break; \ fprintf(stderr, fmt, ##args); \ fprintf(stderr, " (%s:%d)\n", \ __FILE__, __LINE__); \ } while(0) asn1c-0.9.24+dfsg/examples/sample.source.RRC/sample-BCCH-BCH-Message-2.per0000644000000000000000000000002611456135550024057 0ustar rootroot.VUUUUYY–j¥U"«Zª• asn1c-0.9.24+dfsg/examples/sample.source.RRC/sample-DL-CCCH-Message-2-nopad.per0000644000000000000000000000015311456135550025063 0ustar rootroot0÷&C=¢HÝL81ê”ɃIÓâ„øê0agÅR±æŠÂçO’Så©@RЧÍIóÔà)Ç Óè´újÕÑJüà€Ü2÷ëeŽ¥rå9ü€P¡ ‚‚8asn1c-0.9.24+dfsg/examples/sample.source.RRC/sample-DL-DCCH-Message-1-nopad.per0000644000000000000000000000001411456135550025057 0ustar rootroot€`@`/ asn1c-0.9.24+dfsg/examples/sample.source.RRC/Makefile0000644000000000000000000042136311461420051020716 0ustar rootrootASN_MODULE_SOURCES= \ DL-DCCH-Message.c \ DL-DCCH-MessageType.c \ UL-DCCH-Message.c \ UL-DCCH-MessageType.c \ DL-CCCH-Message.c \ DL-CCCH-MessageType.c \ UL-CCCH-Message.c \ UL-CCCH-MessageType.c \ PCCH-Message.c \ PCCH-MessageType.c \ DL-SHCCH-Message.c \ DL-SHCCH-MessageType.c \ UL-SHCCH-Message.c \ UL-SHCCH-MessageType.c \ BCCH-FACH-Message.c \ BCCH-FACH-MessageType.c \ BCCH-BCH-Message.c \ MCCH-Message.c \ MCCH-MessageType.c \ MSCH-Message.c \ MSCH-MessageType.c \ ActiveSetUpdate.c \ ActiveSetUpdate-r3-IEs.c \ ActiveSetUpdate-v4b0ext-IEs.c \ ActiveSetUpdate-v590ext-IEs.c \ ActiveSetUpdate-v690ext-IEs.c \ ActiveSetUpdate-r6-IEs.c \ ActiveSetUpdateComplete.c \ ActiveSetUpdateFailure.c \ AssistanceDataDelivery.c \ AssistanceDataDelivery-r3-IEs.c \ AssistanceDataDelivery-v3a0ext.c \ AssistanceDataDelivery-v4b0ext-IEs.c \ CellChangeOrderFromUTRAN.c \ CellChangeOrderFromUTRAN-r3-IEs.c \ CellChangeOrderFromUTRAN-v590ext-IEs.c \ CellChangeOrderFromUTRANFailure.c \ CellChangeOrderFromUTRANFailure-r3-IEs.c \ CellUpdate.c \ CellUpdate-v590ext.c \ CellUpdate-v690ext-IEs.c \ CellUpdate-v7xyext-IEs.c \ CellUpdateConfirm.c \ CellUpdateConfirm-r3-IEs.c \ CellUpdateConfirm-v3a0ext.c \ CellUpdateConfirm-v4b0ext-IEs.c \ CellUpdateConfirm-v590ext-IEs.c \ CellUpdateConfirm-v5d0ext-IEs.c \ CellUpdateConfirm-r4-IEs.c \ CellUpdateConfirm-r5-IEs.c \ CellUpdateConfirm-r6-IEs.c \ CellUpdateConfirm-v690ext-IEs.c \ CellUpdateConfirm-r7-IEs.c \ CellUpdateConfirm-CCCH.c \ CounterCheck.c \ CounterCheck-r3-IEs.c \ CounterCheckResponse.c \ DownlinkDirectTransfer.c \ DownlinkDirectTransfer-r3-IEs.c \ HandoverToUTRANCommand.c \ HandoverToUTRANCommand-r3-IEs.c \ HandoverToUTRANCommand-r4-IEs.c \ HandoverToUTRANCommand-r5-IEs.c \ HandoverToUTRANCommand-r6-IEs.c \ HandoverToUTRANCommand-r7-IEs.c \ HandoverToUTRANComplete.c \ InitialDirectTransfer.c \ InitialDirectTransfer-v3a0ext.c \ InitialDirectTransfer-v590ext.c \ InitialDirectTransfer-v690ext-IEs.c \ HandoverFromUTRANCommand-GSM.c \ HandoverFromUTRANCommand-GSM-r3-IEs.c \ HandoverFromUTRANCommand-GSM-r6-IEs.c \ HandoverFromUTRANCommand-GSM-v690ext-IEs.c \ HandoverFromUTRANCommand-GERANIu.c \ HandoverFromUTRANCommand-GERANIu-r5-IEs.c \ HandoverFromUTRANCommand-CDMA2000.c \ HandoverFromUTRANCommand-CDMA2000-r3-IEs.c \ HandoverFromUTRANFailure.c \ HandoverFromUtranFailure-v590ext-IEs.c \ InterRATHandoverInfo.c \ InterRATHandoverInfo-v390ext-IEs.c \ InterRATHandoverInfo-v3a0ext-IEs.c \ InterRATHandoverInfo-v3d0ext-IEs.c \ InterRATHandoverInfo-v3g0ext-IEs.c \ InterRATHandoverInfo-r3-add-ext-IEs.c \ InterRATHandoverInfo-v4b0ext-IEs.c \ InterRATHandoverInfo-v4d0ext-IEs.c \ InterRATHandoverInfo-v590ext-IEs.c \ InterRATHandoverInfo-v690ext1-IEs.c \ InterRATHandoverInfo-v690ext-IEs.c \ InterRATHandoverInfo-v7xyext-IEs.c \ MeasurementControl.c \ MeasurementControl-r3-IEs.c \ MeasurementControl-v390ext.c \ MeasurementControl-v3a0ext.c \ MeasurementControl-r4-IEs.c \ MeasurementControl-v590ext-IEs.c \ MeasurementControl-v5b0ext-IEs.c \ MeasurementControl-r6-IEs.c \ MeasurementControl-v6a0ext-IEs.c \ MeasurementControl-v7xyext-IEs.c \ MeasurementControlFailure.c \ MeasurementControlFailure-v590ext-IEs.c \ MeasurementReport.c \ MeasurementReport-v390ext.c \ MeasurementReport-v4b0ext-IEs.c \ MeasurementReport-v590ext-IEs.c \ MeasurementReport-v5b0ext-IEs.c \ MeasurementReport-v690ext-IEs.c \ MeasurementReport-v7xyext-IEs.c \ PagingType1.c \ PagingType1-v590ext-IEs.c \ PagingType2.c \ PhysicalChannelReconfiguration.c \ PhysicalChannelReconfiguration-r3-IEs.c \ PhysicalChannelReconfiguration-v3a0ext.c \ PhysicalChannelReconfiguration-v4b0ext-IEs.c \ PhysicalChannelReconfiguration-v590ext-IEs.c \ PhysicalChannelReconfiguration-r4-IEs.c \ PhysicalChannelReconfiguration-r5-IEs.c \ PhysicalChannelReconfiguration-r6-IEs.c \ PhysicalChannelReconfiguration-v690ext-IEs.c \ PhysicalChannelReconfiguration-r7-IEs.c \ PhysicalChannelReconfigurationComplete.c \ PhysicalChannelReconfigurationComplete-v7xyext-IEs.c \ PhysicalChannelReconfigurationFailure.c \ PhysicalSharedChannelAllocation.c \ PhysicalSharedChannelAllocation-r3-IEs.c \ PhysicalSharedChannelAllocation-r4-IEs.c \ PhysicalSharedChannelAllocation-v690ext-IEs.c \ PhysicalSharedChannelAllocation-v7xyext-IEs.c \ PUSCHCapacityRequest.c \ PUSCHCapacityRequest-v590ext.c \ RadioBearerReconfiguration.c \ RadioBearerReconfiguration-r3-IEs.c \ RadioBearerReconfiguration-v3a0ext.c \ RadioBearerReconfiguration-v4b0ext-IEs.c \ RadioBearerReconfiguration-v590ext-IEs.c \ RadioBearerReconfiguration-v5d0ext-IEs.c \ RadioBearerReconfiguration-r4-IEs.c \ RadioBearerReconfiguration-r5-IEs.c \ RadioBearerReconfiguration-r6-IEs.c \ RadioBearerReconfiguration-v690ext-IEs.c \ RadioBearerReconfiguration-r7-IEs.c \ RadioBearerReconfigurationComplete.c \ RadioBearerReconfigurationComplete-v7xyext-IEs.c \ RadioBearerReconfigurationFailure.c \ RadioBearerRelease.c \ RadioBearerRelease-r3-IEs.c \ RadioBearerRelease-v3a0ext.c \ RadioBearerRelease-v4b0ext-IEs.c \ RadioBearerRelease-v590ext-IEs.c \ RadioBearerRelease-r4-IEs.c \ RadioBearerRelease-r5-IEs.c \ RadioBearerRelease-v690ext-IEs.c \ RadioBearerRelease-r6-IEs.c \ RadioBearerRelease-r7-IEs.c \ RadioBearerReleaseComplete.c \ RadioBearerReleaseComplete-v7xyext-IEs.c \ RadioBearerReleaseFailure.c \ RadioBearerSetup.c \ RadioBearerSetup-r3-IEs.c \ RadioBearerSetup-v3a0ext.c \ RadioBearerSetup-v4b0ext-IEs.c \ RadioBearerSetup-v590ext-IEs.c \ RadioBearerSetup-v5d0ext-IEs.c \ RadioBearerSetup-r4-IEs.c \ RadioBearerSetup-r5-IEs.c \ RadioBearerSetup-v690ext-IEs.c \ RadioBearerSetup-r6-IEs.c \ RadioBearerSetup-r7-IEs.c \ RadioBearerSetupComplete.c \ RadioBearerSetupComplete-v7xyext-IEs.c \ RadioBearerSetupFailure.c \ RRCConnectionReject.c \ RRCConnectionReject-r3-IEs.c \ RRCConnectionReject-v690ext-IEs.c \ RRCConnectionRelease.c \ RRCConnectionRelease-r3-IEs.c \ RRCConnectionRelease-r4-IEs.c \ RRCConnectionRelease-v690ext-IEs.c \ RRCConnectionRelease-CCCH.c \ RRCConnectionRelease-CCCH-r3-IEs.c \ RRCConnectionRelease-CCCH-r4-IEs.c \ RRCConnectionRelease-CCCH-r5-IEs.c \ RRCConnectionRelease-CCCH-v690ext-IEs.c \ RRCConnectionReleaseComplete.c \ RRCConnectionRequest.c \ RRCConnectionRequest-v3d0ext-IEs.c \ RRCConnectionRequest-v4b0ext-IEs.c \ RRCConnectionRequest-v590ext-IEs.c \ RRCConnectionRequest-v690ext-IEs.c \ RRCConnectionSetup.c \ RRCConnectionSetup-r3-IEs.c \ RRCConnectionSetup-v4b0ext-IEs.c \ RRCConnectionSetup-v590ext-IEs.c \ RRCConnectionSetup-r4-IEs.c \ RRCConnectionSetup-r5-IEs.c \ RRCConnectionSetup-v690ext-IEs.c \ RRCConnectionSetup-r6-IEs.c \ RRCConnectionSetup-r7-IEs.c \ RRCConnectionSetup-v7xyext-IEs.c \ RRCConnectionSetupComplete.c \ RRCConnectionSetupComplete-v370ext.c \ RRCConnectionSetupComplete-v380ext-IEs.c \ RRCConnectionSetupComplete-v3a0ext-IEs.c \ RRCConnectionSetupComplete-v3g0ext-IEs.c \ RRCConnectionSetupComplete-r3-add-ext-IEs.c \ RRCConnectionSetupComplete-v4b0ext-IEs.c \ RRCConnectionSetupComplete-v590ext-IEs.c \ RRCConnectionSetupComplete-v5c0ext-IEs.c \ RRCConnectionSetupComplete-v650ext-IEs.c \ RRCConnectionSetupComplete-v680ext-IEs.c \ RRCConnectionSetupComplete-v690ext-IEs.c \ RRCConnectionSetupComplete-v7xyext-IEs.c \ RRC-FailureInfo.c \ RRC-FailureInfo-r3-IEs.c \ RRCStatus.c \ SecurityModeCommand.c \ SecurityModeCommand-r3-IEs.c \ SecurityModeComplete.c \ SecurityModeFailure.c \ SignallingConnectionRelease.c \ SignallingConnectionRelease-r3-IEs.c \ SignallingConnectionReleaseIndication.c \ SystemInformation-BCH.c \ SystemInformation-FACH.c \ FirstSegment.c \ FirstSegmentShort.c \ SubsequentSegment.c \ LastSegment.c \ LastSegmentShort.c \ CompleteSIB-List.c \ CompleteSIB.c \ CompleteSIBshort.c \ SystemInformationChangeIndication.c \ TransportChannelReconfiguration.c \ TransportChannelReconfiguration-r3-IEs.c \ TransportChannelReconfiguration-v3a0ext.c \ TransportChannelReconfiguration-v4b0ext-IEs.c \ TransportChannelReconfiguration-v590ext-IEs.c \ TransportChannelReconfiguration-r4-IEs.c \ TransportChannelReconfiguration-r5-IEs.c \ TransportChannelReconfiguration-v690ext-IEs.c \ TransportChannelReconfiguration-r6-IEs.c \ TransportChannelReconfiguration-r7-IEs.c \ TransportChannelReconfigurationComplete.c \ TransportChannelReconfigurationComplete-v7xyext-IEs.c \ TransportChannelReconfigurationFailure.c \ TransportFormatCombinationControl.c \ TransportFormatCombinationControlFailure.c \ UECapabilityEnquiry.c \ UECapabilityEnquiry-r3-IEs.c \ UECapabilityEnquiry-v4b0ext-IEs.c \ UECapabilityEnquiry-v590ext-IEs.c \ UECapabilityEnquiry-v7xyext-IEs.c \ UECapabilityInformation.c \ UECapabilityInformation-v370ext.c \ UECapabilityInformation-v380ext-IEs.c \ UECapabilityInformation-v3a0ext-IEs.c \ UECapabilityInformation-r3-add-ext-IEs.c \ UECapabilityInformation-v4b0ext.c \ UECapabilityInformation-v590ext.c \ UECapabilityInformation-v5c0ext.c \ UECapabilityInformation-v650ext-IEs.c \ UECapabilityInformation-v680ext-IEs.c \ UECapabilityInformation-v690ext-IEs.c \ UECapabilityInformation-v7xyext-IEs.c \ UECapabilityInformationConfirm.c \ UECapabilityInformationConfirm-r3-IEs.c \ UplinkDirectTransfer.c \ UplinkDirectTransfer-v690ext-IEs.c \ UplinkPhysicalChannelControl.c \ UplinkPhysicalChannelControl-r3-IEs.c \ UplinkPhysicalChannelControl-v4b0ext-IEs.c \ UplinkPhysicalChannelControl-r4-IEs.c \ UplinkPhysicalChannelControl-r5-IEs.c \ UplinkPhysicalChannelControl-v690ext-IEs.c \ UplinkPhysicalChannelControl-v6a0ext-IEs.c \ UplinkPhysicalChannelControl-r7-IEs.c \ URAUpdate.c \ URAUpdateConfirm.c \ URAUpdateConfirm-r3-IEs.c \ URAUpdateConfirm-r5-IEs.c \ URAUpdateConfirm-v690ext-IEs.c \ URAUpdateConfirm-CCCH.c \ URAUpdateConfirm-CCCH-r3-IEs.c \ UTRANMobilityInformation.c \ UTRANMobilityInformation-r3-IEs.c \ UTRANMobilityInformation-v3a0ext-IEs.c \ UTRANMobilityInformation-r5-IEs.c \ UtranMobilityInformation-v690ext-IEs.c \ UTRANMobilityInformationConfirm.c \ UTRANMobilityInformationFailure.c \ MBMSAccessInformation.c \ MBMSCommonPTMRBInformation.c \ MBMSCurrentCellPTMRBInformation.c \ MBMSGeneralInformation.c \ MBMSGeneralInformation-v7xyext-IEs.c \ MBMSModificationRequest.c \ MBMSModifiedServicesInformation.c \ MBMSNeighbouringCellPTMRBInformation.c \ MBMSSchedulingInformation.c \ MBMSUnmodifiedServicesInformation.c \ Ansi-41-IDNNS.c \ CN-DomainIdentity.c \ CN-DomainInformation.c \ CN-DomainInformationFull.c \ CN-DomainInformationList.c \ CN-DomainInformationListFull.c \ CN-DomainSysInfo.c \ CN-DomainSysInfoList.c \ CN-InformationInfo.c \ CN-InformationInfo-r6.c \ CN-InformationInfoFull.c \ Digit.c \ Gsm-map-IDNNS.c \ IMEI.c \ IMEI-Digit.c \ IMSI-GSM-MAP.c \ IntraDomainNasNodeSelector.c \ LAI.c \ MCC.c \ MNC.c \ MultiplePLMN-List-r6.c \ NAS-Message.c \ NAS-Synchronisation-Indicator.c \ NAS-SystemInformationGSM-MAP.c \ P-TMSI-GSM-MAP.c \ PagingRecordTypeID.c \ PLMN-Identity.c \ PLMN-IdentityWithOptionalMCC-r6.c \ PLMN-Type.c \ RAB-Identity.c \ RAI.c \ RoutingAreaCode.c \ RoutingParameter.c \ TMSI-GSM-MAP.c \ AccessClassBarred.c \ AccessClassBarredList.c \ AllowedIndicator.c \ CellAccessRestriction.c \ CellBarred.c \ CellIdentity.c \ CellIdentity-PerRL-List.c \ CellSelectReselectInfoSIB-3-4.c \ DomainSpecificAccessRestrictionForSharedNetwork-v670ext.c \ DomainSpecificAccessRestrictionList-v670ext.c \ DomainSpecificAccessRestrictionParam-v670ext.c \ DomainSpecificAccessRestriction-v670ext.c \ MapParameter.c \ Mapping.c \ Mapping-LCR-r4.c \ MappingFunctionParameter.c \ MappingFunctionParameterList.c \ MappingFunctionType.c \ MappingInfo.c \ Q-Hyst-S.c \ Q-Hyst-S-Fine.c \ RAT.c \ RAT-FDD-Info.c \ RAT-FDD-InfoList.c \ RAT-Identifier.c \ RAT-TDD-Info.c \ RAT-TDD-InfoList.c \ ReservedIndicator.c \ S-SearchQual.c \ S-SearchRXLEV.c \ SpeedDependentScalingFactor.c \ T-Barred.c \ T-Reselection-S.c \ T-Reselection-S-Fine.c \ TreselectionScalingFactor.c \ UpperLimit.c \ URA-Identity.c \ URA-IdentityList.c \ AccessStratumReleaseIndicator.c \ ActivationTime.c \ BackoffControlParams.c \ C-RNTI.c \ CapabilityUpdateRequirement.c \ CapabilityUpdateRequirement-r4-ext.c \ CapabilityUpdateRequirement-r4.c \ CapabilityUpdateRequirement-r7-ext.c \ CellUpdateCause.c \ CellUpdateCause-ext.c \ ChipRateCapability.c \ ChipRateCapability-r7.c \ CipheringAlgorithm.c \ CipheringModeCommand.c \ CipheringModeInfo.c \ CN-DRX-CycleLengthCoefficient.c \ CN-PagedUE-Identity.c \ CompressedModeMeasCapability.c \ CompressedModeMeasCapability-LCR-r4.c \ CompressedModeMeasCapabFDDList.c \ CompressedModeMeasCapabFDDList2.c \ CompressedModeMeasCapabFDDList-ext.c \ CompressedModeMeasCapabFDD.c \ CompressedModeMeasCapabFDD2.c \ CompressedModeMeasCapabFDD-ext.c \ CompressedModeMeasCapabTDDList.c \ CompressedModeMeasCapabTDD.c \ CompressedModeMeasCapabGSMList.c \ CompressedModeMeasCapabGSM.c \ CompressedModeMeasCapabMC.c \ CPCH-Parameters.c \ DL-CapabilityWithSimultaneousHS-DSCHConfig.c \ DL-DPCCH-BER.c \ DL-PhysChCapabilityFDD.c \ DL-PhysChCapabilityFDD-v380ext.c \ SupportOfDedicatedPilotsForChEstimation.c \ DL-PhysChCapabilityTDD.c \ DL-PhysChCapabilityTDD-LCR-r4.c \ DL-PhysChCapabilityTDD-768.c \ DL-TransChCapability.c \ DRAC-SysInfo.c \ DRAC-SysInfoList.c \ DSCH-RNTI.c \ DelayRestrictionFlag.c \ E-RNTI.c \ ESN-DS-41.c \ EstablishmentCause.c \ FailureCauseWithProtErr.c \ FailureCauseWithProtErrTrId.c \ GroupIdentityWithReleaseInformation.c \ GroupReleaseInformation.c \ GSM-Measurements.c \ H-RNTI.c \ HSDSCH-physical-layer-category.c \ UESpecificBehaviourInformation1idle.c \ UESpecificBehaviourInformation1interRAT.c \ IMSI-and-ESN-DS-41.c \ IMSI-DS-41.c \ InitialPriorityDelayList.c \ InitialUE-Identity.c \ IntegrityCheckInfo.c \ IntegrityProtActivationInfo.c \ IntegrityProtectionAlgorithm.c \ IntegrityProtectionModeCommand.c \ IntegrityProtectionModeInfo.c \ IntegrityProtInitNumber.c \ MaxHcContextSpace.c \ MaxHcContextSpace-r5-ext.c \ MaxROHC-ContextSessions-r4.c \ MaximumAM-EntityNumberRLC-Cap.c \ MaximumBitRate.c \ MaximumRLC-WindowSize.c \ MaxNoDPDCH-BitsTransmitted.c \ MaxNoBits.c \ MaxNoPhysChBitsReceived.c \ MaxNoSCCPCH-RL.c \ MaxNumberOfTF.c \ MaxNumberOfTFC-DL.c \ MaxNumberOfTFC-UL.c \ MaxPhysChPerFrame.c \ MaxPhysChPerFrame-768.c \ MaxPhysChPerSubFrame-r4.c \ MaxPhysChPerTimeslot.c \ MaxPhysChPerTS.c \ MaxPhysChPerTS-768.c \ MaxSimultaneousCCTrCH-Count.c \ MaxSimultaneousTransChsDL.c \ MaxSimultaneousTransChsUL.c \ MaxTransportBlocksDL.c \ MaxTransportBlocksUL.c \ MaxTS-PerFrame.c \ MaxTS-PerSubFrame-r4.c \ MeasurementCapability.c \ MeasurementCapabilityExt.c \ MeasurementCapabilityExt2.c \ MeasurementCapability-r4-ext.c \ MessageAuthenticationCode.c \ MinimumSF-DL.c \ MinimumSF-DL-768.c \ MinimumSF-UL.c \ MultiModeCapability.c \ MultiRAT-Capability.c \ MultiModeRAT-Capability-v590ext.c \ MultiModeRAT-Capability-v680ext.c \ N-300.c \ N-301.c \ N-302.c \ N-304.c \ N-308.c \ N-310.c \ N-312.c \ N-312ext.c \ N-312-r5.c \ N-313.c \ N-315.c \ N-315ext.c \ N-315-r5.c \ N-AccessFails.c \ N-AP-RetransMax.c \ NetworkAssistedGPS-Supported.c \ NF-BO-AllBusy.c \ NF-BO-NoAICH.c \ NF-BO-Mismatch.c \ NS-BO-Busy.c \ NS-IP.c \ P-TMSI-and-RAI-GSM-MAP.c \ PagingCause.c \ PagingRecord.c \ PagingRecord2-r5.c \ PagingRecordList.c \ PagingRecord2List-r5.c \ PDCP-Capability.c \ PDCP-Capability-r4-ext.c \ PDCP-Capability-r5-ext.c \ PDCP-Capability-r5-ext2.c \ PhysicalChannelCapability.c \ PhysicalChannelCapability-r7.c \ PhysicalChannelCapability-LCR-r4.c \ PhysicalChannelCapability-hspdsch-r5.c \ PNBSCH-Allocation-r4.c \ ProtocolErrorCause.c \ ProtocolErrorIndicator.c \ ProtocolErrorIndicatorWithMoreInfo.c \ ProtocolErrorMoreInformation.c \ RadioFrequencyBandFDD.c \ RadioFrequencyBandFDD2.c \ RadioFrequencyBandTDDList.c \ RadioFrequencyBandTDD.c \ RadioFrequencyBandGSM.c \ Rb-timer-indicator.c \ Re-EstablishmentTimer.c \ RedirectionInfo.c \ RedirectionInfo-r6.c \ RejectionCause.c \ ReleaseCause.c \ RF-Capability.c \ RF-Capability-r4-ext.c \ RF-Capability-r7.c \ RLC-Capability.c \ RLC-Capability-r5-ext.c \ RRC-ConnectionReleaseInformation.c \ RRC-MessageSequenceNumber.c \ RRC-MessageSequenceNumberList.c \ RRC-StateIndicator.c \ RRC-TransactionIdentifier.c \ S-RNTI.c \ S-RNTI-2.c \ SecurityCapability.c \ Serving-HSDSCH-CellInformation.c \ SimultaneousSCCPCH-DPCH-Reception.c \ SRNC-Identity.c \ START-Value.c \ STARTList.c \ STARTSingle.c \ CapabilityUpdateRequirement-r5.c \ SystemSpecificCapUpdateReq.c \ SystemSpecificCapUpdateReq-v590ext.c \ SystemSpecificCapUpdateReq-r5.c \ SystemSpecificCapUpdateReqList.c \ SystemSpecificCapUpdateReqList-r5.c \ T-300.c \ T-301.c \ T-302.c \ T-304.c \ T-305.c \ T-307.c \ T-308.c \ T-309.c \ T-310.c \ T-311.c \ T-312.c \ T-313.c \ T-314.c \ T-315.c \ T-316.c \ T-317.c \ T-318.c \ T-CPCH.c \ TMSI-and-LAI-GSM-MAP.c \ TMSI-DS-41.c \ TotalRLC-AM-BufferSize.c \ TotalRLC-AM-BufferSize-r5-ext.c \ TransmissionProbability.c \ TransportChannelCapability.c \ TurboSupport.c \ TxRxFrequencySeparation.c \ U-RNTI.c \ U-RNTI-Group.c \ U-RNTI-Short.c \ UE-CapabilityContainer-IEs.c \ UE-ConnTimersAndConstants.c \ UE-ConnTimersAndConstants-v3a0ext.c \ UE-ConnTimersAndConstants-r5.c \ UE-IdleTimersAndConstants.c \ UE-IdleTimersAndConstants-v3a0ext.c \ UE-MultiModeRAT-Capability.c \ UE-PowerClass.c \ UE-PowerClassExt.c \ UE-RadioAccessCapability.c \ UE-RadioAccessCapabilityInfo.c \ UE-RadioAccessCapability-v370ext.c \ UE-RadioAccessCapability-v380ext.c \ UE-RadioAccessCapability-v3a0ext.c \ UE-RadioAccessCapability-v3g0ext.c \ UE-RadioAccessCapability-v650ext.c \ UE-RadioAccessCapability-v690ext.c \ UE-RadioAccessCapability-v7xyext.c \ UE-RadioAccessCapabBandFDDList2.c \ UE-RadioAccessCapabBandFDD2.c \ UE-PositioningCapabilityExt-v380.c \ UE-PositioningCapabilityExt-v3a0.c \ UE-PositioningCapabilityExt-v3g0.c \ UE-RadioAccessCapabBandFDDList.c \ UE-RadioAccessCapabBandFDDList-ext.c \ UE-RadioAccessCapabBandFDD.c \ UE-RadioAccessCapabBandFDD-ext.c \ UE-RadioAccessCapability-v4b0ext.c \ UE-RadioAccessCapabilityComp.c \ UE-RadioAccessCapabilityComp-ext.c \ UE-RadioAccessCapabilityComp-r7.c \ UE-RadioAccessCapabilityComp2.c \ RF-CapabilityComp.c \ RF-CapabilityComp-r7.c \ RF-CapabBandFDDComp.c \ RF-CapabBandListFDDComp.c \ RF-CapabBandListFDDComp-ext.c \ UE-RadioAccessCapability-v590ext.c \ UE-RadioAccessCapability-v5c0ext.c \ UE-RadioAccessCapability-v680ext.c \ UL-PhysChCapabilityFDD.c \ UL-PhysChCapabilityFDD-r6.c \ UL-PhysChCapabilityTDD.c \ UL-PhysChCapabilityTDD-LCR-r4.c \ PhysicalChannelCapability-edch-r6.c \ UL-TransChCapability.c \ UE-Positioning-Capability.c \ UE-SecurityInformation.c \ UE-SecurityInformation2.c \ URA-UpdateCause.c \ UTRAN-DRX-CycleLengthCoefficient.c \ WaitTime.c \ AlgorithmSpecificInfo.c \ AlgorithmSpecificInfo-r4.c \ CID-InclusionInfo-r4.c \ COUNT-C.c \ COUNT-C-MSB.c \ DefaultConfigIdentity.c \ DefaultConfigIdentity-r4.c \ DefaultConfigIdentity-r5.c \ DefaultConfigIdentity-r6.c \ DefaultConfigMode.c \ DDI.c \ DL-AM-RLC-Mode.c \ DL-AM-RLC-Mode-r5.c \ DL-CounterSynchronisationInfo.c \ DL-CounterSynchronisationInfo-r5.c \ DL-LogicalChannelMapping.c \ DL-LogicalChannelMapping-r5.c \ DL-LogicalChannelMappingList.c \ DL-LogicalChannelMappingList-r5.c \ DL-Reception-Window-Size-r6.c \ DL-RFC3095-r4.c \ DL-RLC-Mode.c \ DL-RLC-Mode-r5.c \ DL-RLC-Mode-r6.c \ DL-RLC-StatusInfo.c \ DL-TM-RLC-Mode.c \ DL-TransportChannelType.c \ DL-TransportChannelType-r5.c \ DL-UM-RLC-LI-size.c \ DL-UM-RLC-Mode-r5.c \ DL-UM-RLC-Mode-r6.c \ ExpectReordering.c \ ExplicitDiscard.c \ HeaderCompressionInfo.c \ HeaderCompressionInfoList.c \ HeaderCompressionInfo-r4.c \ HeaderCompressionInfoList-r4.c \ LogicalChannelIdentity.c \ LosslessSRNS-RelocSupport.c \ MAC-d-HFN-initial-value.c \ MAC-LogicalChannelPriority.c \ MaxDAT.c \ MaxDAT-Retransmissions.c \ MaxMRW.c \ MaxPDCP-SN-WindowSize.c \ MaxRST.c \ NoExplicitDiscard.c \ PDCP-Info.c \ PDCP-Info-r4.c \ PDCP-InfoReconfig.c \ PDCP-InfoReconfig-r4.c \ PDCP-PDU-Header.c \ PDCP-ROHC-TargetMode.c \ PDCP-SN-Info.c \ Poll-PDU.c \ Poll-SDU.c \ PollingInfo.c \ PollWindow.c \ PredefinedConfigIdentity.c \ PredefinedConfigValueTag.c \ PredefinedRB-Configuration.c \ PreDefRadioConfiguration.c \ PredefinedConfigStatusList.c \ PredefinedConfigStatusInfo.c \ PredefinedConfigStatusListComp.c \ PredefinedConfigSetsWithDifferentValueTag.c \ PredefinedConfigSetWithDifferentValueTag.c \ PredefinedConfigValueTagList.c \ PredefinedConfigStatusListVarSz.c \ RAB-Info.c \ RAB-Info-r6-ext.c \ RAB-Info-r6.c \ RAB-InformationList.c \ RAB-InformationList-r6.c \ RAB-InformationReconfigList.c \ RAB-InformationReconfig.c \ RAB-Info-Post.c \ RAB-InformationSetup.c \ RAB-InformationSetup-r4.c \ RAB-InformationSetup-r5.c \ RAB-InformationSetup-r6-ext.c \ RAB-InformationSetup-r6.c \ RAB-InformationSetupList.c \ RAB-InformationSetupList-r4.c \ RAB-InformationSetupList-r5.c \ RAB-InformationSetupList-r6.c \ RAB-InformationSetupList-r6-ext.c \ RB-ActivationTimeInfo.c \ RB-ActivationTimeInfoList.c \ RB-COUNT-C-Information.c \ RB-COUNT-C-InformationList.c \ RB-COUNT-C-MSB-Information.c \ RB-COUNT-C-MSB-InformationList.c \ RB-Identity.c \ RB-IdentityList.c \ RB-InformationAffected.c \ RB-InformationAffected-r5.c \ RB-InformationAffected-r6.c \ RB-InformationAffectedList.c \ RB-InformationAffectedList-r5.c \ RB-InformationAffectedList-r6.c \ RB-InformationChanged-r6.c \ RB-InformationChangedList-r6.c \ RB-InformationReconfig.c \ RB-InformationReconfig-r4.c \ RB-InformationReconfig-r5.c \ RB-InformationReconfig-r6.c \ RB-InformationReconfigList.c \ RB-InformationReconfigList-r4.c \ RB-InformationReconfigList-r5.c \ RB-InformationReconfigList-r6.c \ RB-InformationReleaseList.c \ RB-InformationSetup.c \ RB-InformationSetup-r4.c \ RB-InformationSetup-r5.c \ RB-InformationSetup-r6.c \ RB-InformationSetupList.c \ RB-InformationSetupList-r4.c \ RB-InformationSetupList-r5.c \ RB-InformationSetupList-r6.c \ RB-MappingInfo.c \ RB-MappingInfo-r5.c \ RB-MappingInfo-r6.c \ RB-MappingOption.c \ RB-MappingOption-r5.c \ RB-MappingOption-r6.c \ RB-PDCPContextRelocation.c \ RB-PDCPContextRelocationList.c \ RB-StopContinue.c \ RB-WithPDCP-Info.c \ RB-WithPDCP-InfoList.c \ ReceivingWindowSize.c \ RFC2507-Info.c \ RFC3095-Info-r4.c \ RLC-Info.c \ RLC-Info-r5.c \ RLC-Info-r6.c \ RLC-Info-MCCH-r6.c \ RLC-Info-MSCH-r6.c \ RLC-Info-MTCH-r6.c \ RLC-InfoChoice.c \ RLC-InfoChoice-r5.c \ RLC-InfoChoice-r6.c \ RLC-PDU-Size.c \ RLC-PDU-SizeList.c \ RLC-SequenceNumber.c \ RLC-SizeInfo.c \ RLC-SizeExplicitList.c \ ROHC-Profile-r4.c \ ROHC-ProfileList-r4.c \ ROHC-PacketSize-r4.c \ ROHC-PacketSizeList-r4.c \ SRB-InformationSetup.c \ SRB-InformationSetup-r5.c \ SRB-InformationSetup-r6.c \ SRB-InformationSetupList.c \ SRB-InformationSetupList-r5.c \ SRB-InformationSetupList-r6.c \ SRB-InformationSetupList2.c \ SRB-InformationSetupList2-r6.c \ TimerDAR-r6.c \ TimerDiscard.c \ TimerEPC.c \ TimerMRW.c \ TimerOSD-r6.c \ TimerPoll.c \ TimerPollPeriodic.c \ TimerPollProhibit.c \ TimerRST.c \ TimerStatusPeriodic.c \ TimerStatusProhibit.c \ TransmissionRLC-Discard.c \ TransmissionWindowSize.c \ UL-AM-RLC-Mode.c \ UL-CounterSynchronisationInfo.c \ UL-LogicalChannelMapping.c \ UL-LogicalChannelMapping-r6.c \ UL-LogicalChannelMappingList.c \ UL-LogicalChannelMappingList-r6.c \ UL-LogicalChannelMappings.c \ UL-LogicalChannelMappings-r6.c \ UL-RFC3095-r4.c \ UL-RLC-Mode.c \ UL-TM-RLC-Mode.c \ UL-UM-RLC-Mode.c \ UL-TransportChannelType.c \ UM-RLC-DuplAvoid-Reord-Info-r6.c \ UM-RLC-OutOSeqDelivery-Info-r6.c \ WindowSizeDAR-r6.c \ WindowSizeOSD-r6.c \ AddOrReconfMAC-dFlow.c \ AllowedTFC-List.c \ AllowedTFI-List.c \ BitModeRLC-SizeInfo.c \ BLER-QualityValue.c \ ChannelCodingType.c \ CodingRate.c \ CommonDynamicTF-Info.c \ CommonDynamicTF-Info-DynamicTTI.c \ CommonDynamicTF-InfoList.c \ CommonDynamicTF-InfoList-DynamicTTI.c \ CommonTransChTFS.c \ CommonTransChTFS-LCR.c \ CPCH-SetID.c \ CRC-Size.c \ DedicatedDynamicTF-Info.c \ DedicatedDynamicTF-Info-DynamicTTI.c \ DedicatedDynamicTF-InfoList.c \ DedicatedDynamicTF-InfoList-DynamicTTI.c \ DedicatedTransChTFS.c \ DL-AddReconfTransChInfo2List.c \ DL-AddReconfTransChInfoList.c \ DL-AddReconfTransChInfoList-r4.c \ DL-AddReconfTransChInfoList-r5.c \ DL-AddReconfTransChInformation.c \ DL-AddReconfTransChInformation-r4.c \ DL-AddReconfTransChInformation-r5.c \ DL-AddReconfTransChInformation2.c \ DL-CommonTransChInfo.c \ DL-CommonTransChInfo-r4.c \ DL-DeletedTransChInfoList.c \ DL-DeletedTransChInfoList-r5.c \ DL-TransportChannelIdentity.c \ DL-TransportChannelIdentity-r5.c \ DL-TrCH-Type.c \ DL-TrCH-TypeId1-r5.c \ DL-TrCH-TypeId2-r5.c \ DRAC-ClassIdentity.c \ DRAC-StaticInformation.c \ DRAC-StaticInformationList.c \ E-DCH-AddReconf-MAC-d-Flow.c \ E-DCH-AddReconf-MAC-d-FlowList.c \ E-DCH-MAC-d-FlowIdentity.c \ E-DCH-MAC-d-FlowMaxRetrans.c \ E-DCH-MAC-d-FlowMultiplexingList.c \ E-DCH-MAC-d-FlowPowerOffset.c \ E-DCH-TTI.c \ ExplicitTFCS-Configuration.c \ GainFactor.c \ GainFactorInformation.c \ HSDSCH-Info.c \ HARQ-Info.c \ HARQMemorySize.c \ IndividualDL-CCTrCH-Info.c \ IndividualDL-CCTrCH-InfoList.c \ IndividualUL-CCTrCH-Info.c \ IndividualUL-CCTrCH-InfoList.c \ LogicalChannelByRB.c \ LogicalChannelList.c \ MAC-d-FlowIdentityDCHandHSDSCH.c \ MAC-d-FlowIdentity.c \ MAC-d-PDU-SizeInfo-List.c \ MAC-d-PDUsizeInfo.c \ MAC-hs-AddReconfQueue-List.c \ MAC-hs-AddReconfQueue.c \ MAC-hs-DelQueue-List.c \ MAC-hs-DelQueue.c \ MAC-hs-WindowSize.c \ NumberOfTbSizeAndTTIList.c \ MessType.c \ Non-allowedTFC-List.c \ NumberOfTransportBlocks.c \ OctetModeRLC-SizeInfoType1.c \ OctetModeRLC-SizeInfoType2.c \ PowerOffsetInfoShort.c \ PowerOffsetInformation.c \ PowerOffsetPp-m.c \ PreDefTransChConfiguration.c \ QualityTarget.c \ RateMatchingAttribute.c \ ReferenceTFC-ID.c \ RestrictedTrChInfo.c \ RestrictedTrChInfoList.c \ SemistaticTF-Information.c \ SignalledGainFactors.c \ SplitTFCI-Signalling.c \ SplitType.c \ T1-ReleaseTimer.c \ TFC-Subset.c \ TFC-SubsetList.c \ TFC-Value.c \ TFCI-Field2-Information.c \ TFCI-Range.c \ TFCI-RangeList.c \ TFCS.c \ TFCS-Identity.c \ TFCS-IdentityPlain.c \ TFCS-InfoForDSCH.c \ TFCS-ReconfAdd.c \ TFCS-Removal.c \ TFCS-RemovalList.c \ TimeDurationBeforeRetry.c \ TM-SignallingInfo.c \ TransmissionTimeInterval.c \ TransmissionTimeValidity.c \ TransportChannelIdentity.c \ TransportChannelIdentityDCHandDSCH.c \ TransportFormatSet.c \ TransportFormatSet-LCR.c \ UL-AddReconfTransChInfoList.c \ UL-AddReconfTransChInfoList-r6.c \ UL-AddReconfTransChInformation.c \ UL-AddReconfTransChInformation-r6.c \ UL-CommonTransChInfo.c \ UL-CommonTransChInfo-r4.c \ UL-ControlledTrChList.c \ UL-DeletedTransChInfoList.c \ UL-DeletedTransChInfoList-r6.c \ UL-TransportChannelIdentity.c \ UL-TransportChannelIdentity-r6.c \ UL-TrCH-Type.c \ USCH-TransportChannelsInfo.c \ ACK-NACK-repetitionFactor.c \ AC-To-ASC-Mapping.c \ AC-To-ASC-MappingTable.c \ AccessServiceClass-FDD.c \ AccessServiceClass-TDD.c \ AccessServiceClass-TDD-r7.c \ AccessServiceClass-TDD-LCR-r4.c \ AdditionalPRACH-TF-and-TFCS-CCCH-IEs.c \ AdditionalPRACH-TF-and-TFCS-CCCH.c \ AdditionalPRACH-TF-and-TFCS-CCCH-List.c \ AICH-Info.c \ AICH-PowerOffset.c \ AICH-TransmissionTiming.c \ AllocationPeriodInfo.c \ Alpha.c \ AP-AICH-ChannelisationCode.c \ AP-PreambleScramblingCode.c \ AP-Signature.c \ AP-Signature-VCAM.c \ AP-Subchannel.c \ ASCSetting-FDD.c \ ASCSetting-TDD.c \ ASCSetting-TDD-r7.c \ ASCSetting-TDD-LCR-r4.c \ AvailableAP-Signature-VCAMList.c \ AvailableAP-SignatureList.c \ AvailableAP-SubchannelList.c \ AvailableMinimumSF-ListVCAM.c \ AvailableMinimumSF-VCAM.c \ AvailableSignatures.c \ AvailableSubChannelNumbers.c \ BEACON-PL-Est.c \ BurstType.c \ Bler-Target.c \ CCTrCH-PowerControlInfo.c \ CCTrCH-PowerControlInfo-r4.c \ CCTrCH-PowerControlInfo-r5.c \ CCTrCH-PowerControlInfo-r7.c \ CD-AccessSlotSubchannel.c \ CD-AccessSlotSubchannelList.c \ CD-CA-ICH-ChannelisationCode.c \ CD-PreambleScramblingCode.c \ CD-SignatureCode.c \ CD-SignatureCodeList.c \ CellAndChannelIdentity.c \ CellParametersID.c \ Cfntargetsfnframeoffset.c \ ChannelAssignmentActive.c \ ChannelisationCode256.c \ ChannelReqParamsForUCSM.c \ ClosedLoopTimingAdjMode.c \ CodeNumberDSCH.c \ CodeRange.c \ CodeWordSet.c \ CommonTimeslotInfo.c \ CommonTimeslotInfoSCCPCH.c \ ConstantValue.c \ ConstantValueTdd.c \ CPCH-PersistenceLevels.c \ CPCH-PersistenceLevelsList.c \ CPCH-SetInfo.c \ CPCH-SetInfoList.c \ CPCH-StatusIndicationMode.c \ CQI-RepetitionFactor.c \ CSICH-PowerOffset.c \ DefaultDPCH-OffsetValueFDD.c \ DefaultDPCH-OffsetValueTDD.c \ DeltaPp-m.c \ DeltaCQI.c \ DeltaNACK.c \ DeltaACK.c \ DeltaSIR.c \ DHS-Sync.c \ DL-CCTrCh.c \ DL-CCTrCh-r4.c \ DL-CCTrCh-r7.c \ DL-CCTrChList.c \ DL-CCTrChList-r7.c \ DL-CCTrChList-r4.c \ DL-CCTrChListToRemove.c \ DL-CCTrChTPCList.c \ DL-ChannelisationCode.c \ DL-ChannelisationCodeList.c \ DL-CommonInformation.c \ DL-CommonInformation-r4.c \ DL-CommonInformation-r5.c \ DL-CommonInformation-r6.c \ DL-CommonInformation-r7.c \ DL-CommonInformationPost.c \ DL-CommonInformationPredef.c \ DL-CompressedModeMethod.c \ DL-DPCH-InfoCommon.c \ DL-DPCH-InfoCommon-r4.c \ DL-DPCH-InfoCommon-r6.c \ DL-DPCH-InfoCommonPost.c \ DL-DPCH-InfoCommonPredef.c \ DL-DPCH-InfoPerRL.c \ DL-DPCH-InfoPerRL-r4.c \ DL-DPCH-InfoPerRL-r5.c \ DL-DPCH-InfoPerRL-r6.c \ DL-DPCH-InfoPerRL-r7.c \ DL-FDPCH-InfoPerRL-r6.c \ DL-DPCH-InfoPerRL-PostFDD.c \ DL-DPCH-InfoPerRL-PostTDD.c \ DL-DPCH-InfoPerRL-PostTDD-LCR-r4.c \ DL-DPCH-PowerControlInfo.c \ DL-FDPCH-InfoCommon-r6.c \ DL-FrameType.c \ DL-HSPDSCH-Information.c \ DL-HSPDSCH-Information-r6.c \ DL-HSPDSCH-Information-r7.c \ DL-HSPDSCH-TS-Configuration.c \ DL-HSPDSCH-TS-Configuration-VHCR.c \ DL-InformationPerRL.c \ DL-InformationPerRL-r4.c \ DL-InformationPerRL-r5.c \ DL-InformationPerRL-r5bis.c \ DL-InformationPerRL-r6.c \ DL-InformationPerRL-r7.c \ DL-InformationPerRL-List.c \ DL-InformationPerRL-List-r4.c \ DL-InformationPerRL-List-r5.c \ DL-InformationPerRL-List-r6.c \ DL-InformationPerRL-List-r5bis.c \ DL-InformationPerRL-List-r7.c \ DL-InformationPerRL-ListPostFDD.c \ DL-InformationPerRL-PostFDD.c \ DL-InformationPerRL-PostTDD.c \ DL-InformationPerRL-PostTDD-LCR-r4.c \ DL-PDSCH-Information.c \ Dl-rate-matching-restriction.c \ DL-TPC-PowerOffsetPerRL.c \ DL-TPC-PowerOffsetPerRL-List.c \ DL-TS-ChannelisationCode.c \ DL-TS-ChannelisationCode-VHCR.c \ DL-TS-ChannelisationCodesShort.c \ DL-TS-ChannelisationCodesShort-VHCR.c \ DownlinkAdditionalTimeslots.c \ DownlinkAdditionalTimeslots-VHCR.c \ DownlinkAdditionalTimeslots-LCR-r4.c \ DownlinkTimeslotsCodes.c \ DownlinkTimeslotsCodes-VHCR.c \ DownlinkTimeslotsCodes-LCR-r4.c \ DPC-Mode.c \ DPCCH-PowerOffset.c \ DPCCH-PowerOffset2.c \ DPCH-CompressedModeInfo.c \ DPCH-CompressedModeStatusInfo.c \ DPCH-FrameOffset.c \ DSCH-Mapping.c \ DSCH-MappingList.c \ DSCH-RadioLinkIdentifier.c \ DSCH-TransportChannelsInfo.c \ DurationTimeInfo.c \ DynamicPersistenceLevel.c \ DynamicPersistenceLevelList.c \ DynamicPersistenceLevelTF-List.c \ DynamicTFInformationCCCH.c \ E-AGCH-ChannelisationCode.c \ E-AGCH-Information.c \ E-DCH-MinimumSet-E-TFCI.c \ E-DCH-ReconfigurationInfo.c \ E-DCH-RL-InfoNewServingCell.c \ E-DCH-RL-InfoOtherCell.c \ E-DPCCH-Info.c \ E-DPCCH-DPCCH-PowerOffset.c \ E-DPDCH-Info.c \ E-DPDCH-PeriodicyOfSchedInfo.c \ E-DPDCH-PL-NonMax.c \ E-DPDCH-Reference-E-TFCI.c \ E-DPDCH-Reference-E-TFCIList.c \ E-DPDCH-SchedulingInfoConfiguration.c \ E-DPDCH-SchedulingTransmConfiguration.c \ E-DPDCH-MaxChannelisationCodes.c \ E-HICH-ChannelisationCode.c \ E-HICH-Information.c \ E-HICH-RGCH-SignatureSequence.c \ E-RGCH-CombinationIndex.c \ E-RGCH-Information.c \ E-TFCI-TableIndex.c \ EXT-UL-TimingAdvance.c \ FACH-PCH-Information.c \ FACH-PCH-InformationList.c \ Feedback-cycle.c \ FPACH-Info-r4.c \ FrequencyInfo.c \ FrequencyInfoFDD.c \ FrequencyInfoTDD.c \ HappyBit-DelayCondition.c \ HARQ-Preamble-Mode.c \ HS-ChannelisationCode-LCR.c \ HS-PDSCH-Midamble-Configuration-TDD128.c \ HS-SCCH-Info.c \ HS-SCCH-Info-r6.c \ HS-SCCH-Info-r7.c \ HS-SCCH-Codes.c \ HS-SCCH-TDD128.c \ HS-SICH-Configuration-TDD128.c \ HS-SCCH-TDD384.c \ HS-SCCH-TDD384-r6.c \ HS-SCCH-TDD768.c \ HS-SICH-Configuration-TDD384.c \ HS-SICH-Configuration-TDD768.c \ HS-SICH-Power-Control-Info-TDD384.c \ HS-SICH-Power-Control-Info-TDD768.c \ IndividualTimeslotInfo.c \ IndividualTimeslotInfo-VHCR.c \ IndividualTimeslotInfo-LCR-r4.c \ IndividualTimeslotInfo-LCR-r4-ext.c \ IndividualTS-Interference.c \ IndividualTS-InterferenceList.c \ ITP.c \ NidentifyAbort.c \ MaxAllowedUL-TX-Power.c \ MaxAvailablePCPCH-Number.c \ MaxPowerIncrease-r4.c \ MaxTFCI-Field2Value.c \ Measurement-Feedback-Info.c \ MidambleConfigurationBurstType1and3.c \ MidambleConfigurationBurstType2.c \ MidambleConfigurationBurstType2-VHCR.c \ MidambleShiftAndBurstType.c \ MidambleShiftAndBurstType-VHCR.c \ MidambleShiftAndBurstType-DL.c \ MidambleShiftAndBurstType-DL-VHCR.c \ MidambleShiftAndBurstType-LCR-r4.c \ MidambleShiftLong.c \ MidambleShiftShort.c \ MidambleShiftShort-VHCR.c \ MinimumSpreadingFactor.c \ MultiCodeInfo.c \ N-EOT.c \ N-GAP.c \ N-PCH.c \ N-StartMessage.c \ NB01.c \ NF-Max.c \ NumberOfDPDCH.c \ NumberOfFBI-Bits.c \ OpenLoopPowerControl-TDD.c \ OpenLoopPowerControl-IPDL-TDD-r4.c \ PagingIndicatorLength.c \ PC-Preamble.c \ PCP-Length.c \ PCPCH-ChannelInfo.c \ PCPCH-ChannelInfoList.c \ PCPICH-UsageForChannelEst.c \ PDSCH-CapacityAllocationInfo.c \ PDSCH-CapacityAllocationInfo-r4.c \ PDSCH-CapacityAllocationInfo-r7.c \ PDSCH-CodeInfo.c \ PDSCH-CodeInfoList.c \ PDSCH-CodeMap.c \ PDSCH-CodeMapList.c \ PDSCH-CodeMapping.c \ PDSCH-Identity.c \ PDSCH-Info.c \ PDSCH-Info-r4.c \ PDSCH-Info-r7.c \ PDSCH-Info-LCR-r4.c \ PDSCH-PowerControlInfo.c \ PDSCH-SHO-DCH-Info.c \ PDSCH-SysInfo.c \ PDSCH-SysInfo-r7.c \ PDSCH-SysInfo-HCR-r5.c \ PDSCH-SysInfo-LCR-r4.c \ PDSCH-SysInfoList.c \ PDSCH-SysInfoList-r7.c \ PDSCH-SysInfoList-HCR-r5.c \ PDSCH-SysInfoList-LCR-r4.c \ PDSCH-SysInfoList-SFN.c \ PDSCH-SysInfoList-SFN-HCR-r5.c \ PDSCH-SysInfoList-SFN-LCR-r4.c \ PersistenceScalingFactor.c \ PersistenceScalingFactorList.c \ PI-CountPerFrame.c \ PichChannelisationCodeList-LCR-r4.c \ PICH-Info.c \ PICH-Info-r7.c \ PICH-Info-LCR-r4.c \ PICH-PowerOffset.c \ PilotBits128.c \ PilotBits256.c \ MeasurementPowerOffset.c \ PLCCH-Info.c \ PositionFixedOrFlexible.c \ PowerControlAlgorithm.c \ PowerOffsetPilot-pdpdch.c \ PowerOffsetTPC-pdpdch.c \ PowerRampStep.c \ PRACH-ChanCodes-LCR-r4.c \ PRACH-Definition-LCR-r4.c \ PRACH-Midamble.c \ PRACH-Partitioning.c \ PRACH-Partitioning-r7.c \ PRACH-Partitioning-LCR-r4.c \ PRACH-PowerOffset.c \ PRACH-RACH-Info.c \ PRACH-RACH-Info-r7.c \ PRACH-RACH-Info-LCR-r4.c \ PRACH-SystemInformation.c \ PRACH-SystemInformation-r7.c \ PRACH-SystemInformation-LCR-r4.c \ PRACH-SystemInformationList.c \ PRACH-SystemInformationList-r7.c \ PRACH-SystemInformationList-LCR-r4.c \ PreambleRetransMax.c \ PreambleScramblingCodeWordNumber.c \ PreDefPhyChConfiguration.c \ PrimaryCCPCH-Info.c \ PrimaryCCPCH-Info-r4.c \ PrimaryCCPCH-Info-r7.c \ PrimaryCCPCH-Info-LCR-r4.c \ PrimaryCCPCH-Info-LCR-r4-ext.c \ PrimaryCCPCH-InfoPost.c \ PrimaryCCPCH-InfoPostTDD-LCR-r4.c \ PrimaryCCPCH-TX-Power.c \ PrimaryCPICH-Info.c \ PrimaryCPICH-TX-Power.c \ PrimaryScramblingCode.c \ PuncturingLimit.c \ PUSCH-CapacityAllocationInfo.c \ PUSCH-CapacityAllocationInfo-r4.c \ PUSCH-CapacityAllocationInfo-r7.c \ PUSCH-Identity.c \ PUSCH-Info.c \ PUSCH-Info-r4.c \ PUSCH-Info-VHCR.c \ PUSCH-Info-LCR-r4.c \ PUSCH-PowerControlInfo-r4.c \ PUSCH-PowerControlInfo-r7.c \ PUSCH-SysInfo.c \ PUSCH-SysInfo-VHCR.c \ PUSCH-SysInfo-HCR-r5.c \ PUSCH-SysInfo-LCR-r4.c \ PUSCH-SysInfoList.c \ PUSCH-SysInfoList-HCR-r5.c \ PUSCH-SysInfoList-LCR-r4.c \ PUSCH-SysInfoList-SFN.c \ PUSCH-SysInfoList-SFN-HCR-r5.c \ PUSCH-SysInfoList-SFN-LCR-r4.c \ PUSCH-SysInfoList-SFN-VHCR.c \ RACH-TransmissionParameters.c \ ReducedScramblingCodeNumber.c \ RepetitionPeriodAndLength.c \ RepetitionPeriodLengthAndOffset.c \ ReplacedPDSCH-CodeInfo.c \ ReplacedPDSCH-CodeInfoList.c \ RepPerLengthOffset-PICH.c \ RepPerLengthOffset-MICH.c \ RestrictedTrCH.c \ RestrictedTrCH-InfoList.c \ RL-AdditionInformation.c \ RL-AdditionInformation-r6.c \ RL-AdditionInformationList.c \ RL-AdditionInformationList-r6.c \ RL-IdentifierList.c \ RL-RemovalInformationList.c \ RPP.c \ S-Field.c \ SCCPCH-ChannelisationCode.c \ SCCPCH-ChannelisationCode-VHCR.c \ SCCPCH-ChannelisationCodeList.c \ SCCPCH-ChannelisationCodeList-VHCR.c \ SCCPCH-InfoForFACH.c \ SCCPCH-InfoForFACH-r4.c \ SCCPCH-SystemInformation.c \ SCCPCH-SystemInformation-LCR-r4-ext.c \ SCCPCH-SystemInformation-r7.c \ SCCPCH-SystemInformationList.c \ SCCPCH-SystemInformationList-r7.c \ SCCPCH-SystemInformationList-LCR-r4-ext.c \ SCCPCH-SystemInformation-MBMS-r6.c \ SCCPCH-SystemInformation-MBMS-r7.c \ ScramblingCodeChange.c \ ScramblingCodeType.c \ SecondaryCCPCH-Info.c \ SecondaryCCPCH-Info-r4.c \ SecondaryCCPCH-Info-r7.c \ SecondaryCCPCH-Info-LCR-r4-ext.c \ SecondaryCCPCHInfo-MBMS-r6.c \ SecondaryCCPCHInfo-MBMS-r7.c \ SecondaryCPICH-Info.c \ SecondaryScramblingCode.c \ SecondInterleavingMode.c \ SF256-AndCodeNumber.c \ SF512-AndCodeNumber.c \ SF512-AndPilot.c \ SF-PDSCH.c \ SF-PRACH.c \ SFN-TimeInfo.c \ SpecialBurstScheduling.c \ SpreadingFactor.c \ SRB-delay.c \ SSDT-CellIdentity.c \ SSDT-Information.c \ SSDT-Information-r4.c \ SSDT-UL.c \ SynchronisationParameters-r4.c \ SYNC-UL-Procedure-r4.c \ SYNC-UL-Info-r4.c \ TDD-FPACH-CCode16-r4.c \ TDD-UL-Interference.c \ TDD-PICH-CCode.c \ TDD768-PICH-CCode.c \ TDD-PRACH-CCode8.c \ TDD-PRACH-CCode16.c \ TDD-PRACH-CCode-LCR-r4.c \ TDD-PRACH-CCodeList.c \ TDD768-PRACH-CCode8.c \ TDD768-PRACH-CCode16.c \ TDD768-PRACH-CCode32.c \ TDD768-PRACH-CCodeList.c \ TFC-ControlDuration.c \ TFCI-Coding.c \ TGCFN.c \ TGD.c \ TGL.c \ TGMP.c \ TGP-Sequence.c \ TGPS-Reconfiguration-CFN.c \ TGP-SequenceList.c \ TGP-SequenceShort.c \ TGPL.c \ TGPRC.c \ TGPS-ConfigurationParams.c \ TGPSI.c \ TGSN.c \ TimeInfo.c \ TimeslotList.c \ TimeslotList-r4.c \ TimeslotNumber.c \ TimeslotNumber-LCR-r4.c \ TimeslotNumber-PRACH-LCR-r4.c \ TimeslotSync2.c \ TimingOffset.c \ TimingMaintainedSynchInd.c \ TPC-CombinationIndex.c \ TPC-CommandTargetRate.c \ TPC-StepSizeFDD.c \ TPC-StepSizeTDD.c \ TreconfirmAbort.c \ TX-DiversityMode.c \ UARFCN.c \ UCSM-Info.c \ UL-CCTrCH.c \ UL-CCTrCH-r4.c \ UL-CCTrCH-r7.c \ UL-CCTrCHList.c \ UL-CCTrCHList-r4.c \ UL-CCTrCHList-r7.c \ UL-CCTrCHListToRemove.c \ UL-CCTrChTPCList.c \ UL-ChannelRequirement.c \ UL-ChannelRequirement-r4.c \ UL-ChannelRequirement-r5.c \ UL-ChannelRequirementWithCPCH-SetID.c \ UL-ChannelRequirementWithCPCH-SetID-r4.c \ UL-ChannelRequirementWithCPCH-SetID-r5.c \ UL-CompressedModeMethod.c \ UL-DL-Mode.c \ UL-DPCCH-SlotFormat.c \ UL-DPCH-Info.c \ UL-DPCH-Info-r4.c \ UL-DPCH-Info-r5.c \ UL-DPCH-Info-r6.c \ UL-DPCH-Info-r7.c \ UL-DPCH-InfoPostFDD.c \ UL-DPCH-InfoPostTDD.c \ UL-DPCH-InfoPostTDD-LCR-r4.c \ UL-DPCH-InfoPredef.c \ UL-DPCH-PowerControlInfo.c \ UL-DPCH-PowerControlInfo-r4.c \ UL-DPCH-PowerControlInfo-r5.c \ UL-DPCH-PowerControlInfo-r6.c \ UL-DPCH-PowerControlInfo-r7.c \ UL-DPCH-PowerControlInfoPostFDD.c \ UL-DPCH-PowerControlInfoPostTDD.c \ UL-DPCH-PowerControlInfoPostTDD-LCR-r4.c \ UL-DPCH-PowerControlInfoPredef.c \ UL-EDCH-Information-r6.c \ UL-Interference.c \ UL-ScramblingCode.c \ UL-SynchronisationParameters-r4.c \ UL-TargetSIR.c \ UL-TimingAdvance.c \ UL-TimingAdvance-VHCR.c \ UL-TimingAdvanceControl.c \ UL-TimingAdvanceControl-r4.c \ UL-TimingAdvanceControl-r7.c \ UL-TimingAdvanceControl-LCR-r4.c \ UL-TS-ChannelisationCode.c \ UL-TS-ChannelisationCodeList.c \ UL-TS-ChannelisationCodeList-r7.c \ UL-TS-ChannelisationCode-VHCR.c \ UL-TS-ChannelisationCodeList-VHCR.c \ UplinkAdditionalTimeslots.c \ UplinkAdditionalTimeslots-LCR-r4.c \ UplinkAdditionalTimeslots-LCR-r7.c \ UplinkTimeslotsCodes.c \ UplinkTimeslotsCodes-VHCR.c \ UplinkTimeslotsCodes-LCR-r4.c \ UplinkTimeslotsCodes-LCR-r7.c \ Wi-LCR.c \ AcquisitionSatInfo.c \ AcquisitionSatInfoList.c \ AdditionalMeasurementID-List.c \ AlmanacSatInfo.c \ AlmanacSatInfoList.c \ AverageRLC-BufferPayload.c \ AzimuthAndElevation.c \ BadSatList.c \ Frequency-Band.c \ BCCH-ARFCN.c \ BLER-MeasurementResults.c \ BLER-MeasurementResultsList.c \ BLER-TransChIdList.c \ BSIC-VerificationRequired.c \ BSICReported.c \ BurstModeParameters.c \ CellDCH-ReportCriteria.c \ CellDCH-ReportCriteria-LCR-r4.c \ CellIndividualOffset.c \ CellInfo.c \ CellInfo-r4.c \ CellInfoSI-RSCP.c \ CellInfoSI-RSCP-LCR-r4.c \ CellInfoSI-ECN0.c \ CellInfoSI-ECN0-LCR-r4.c \ CellInfoSI-HCS-RSCP.c \ CellInfoSI-HCS-RSCP-LCR-r4.c \ CellInfoSI-HCS-ECN0.c \ CellInfoSI-HCS-ECN0-LCR-r4.c \ CellMeasuredResults.c \ CellMeasurementEventResults.c \ CellMeasurementEventResults-LCR-r4.c \ CellReportingQuantities.c \ CellSelectReselectInfoSIB-11-12.c \ CellSelectReselectInfoSIB-11-12-RSCP.c \ CellSelectReselectInfoSIB-11-12-ECN0.c \ CellSelectReselectInfoSIB-11-12-HCS-RSCP.c \ CellSelectReselectInfoSIB-11-12-HCS-ECN0.c \ CellSelectReselectInfo-v590ext.c \ CellSelectReselectInfoPCHFACH-v5b0ext.c \ CellSelectReselectInfoTreselectionScaling-v5c0ext.c \ CellsForInterFreqMeasList.c \ CellsForInterRATMeasList.c \ CellsForIntraFreqMeasList.c \ CellSynchronisationInfo.c \ CellToReport.c \ CellToReportList.c \ CodePhaseSearchWindow.c \ CountC-SFN-Frame-difference.c \ CPICH-Ec-N0.c \ CPICH-RSCP.c \ DeltaPRC.c \ DeltaQrxlevmin.c \ DeltaRSCP.c \ DeltaRSCPPerCell.c \ DeltaRRC.c \ DGPS-CorrectionSatInfo.c \ DGPS-CorrectionSatInfoList.c \ DiffCorrectionStatus.c \ DL-TransportChannelBLER.c \ DopplerUncertainty.c \ EllipsoidPoint.c \ EllipsoidPointAltitude.c \ EllipsoidPointAltitudeEllipsoide.c \ EllipsoidPointUncertCircle.c \ EllipsoidPointUncertEllipse.c \ EnvironmentCharacterisation.c \ Event1a.c \ Event1a-r4.c \ Event1a-LCR-r4.c \ Event1b.c \ Event1b-r4.c \ Event1b-LCR-r4.c \ Event1c.c \ Event1d.c \ Event1e.c \ Event1e-r6.c \ Event1f.c \ Event1f-r6.c \ Event1j-r6.c \ Event2a.c \ Event2a-r6.c \ Event2b.c \ Event2b-r6.c \ Event2c.c \ Event2c-r6.c \ Event2d.c \ Event2d-r6.c \ Event2e.c \ Event2e-r6.c \ Event2f.c \ Event2f-r6.c \ Event3a.c \ Event3b.c \ Event3c.c \ Event3d.c \ EventIDInterFreq.c \ EventIDInterRAT.c \ EventIDIntraFreq.c \ EventResults.c \ ExtraDopplerInfo.c \ FACH-MeasurementOccasionInfo.c \ FACH-MeasurementOccasionInfo-LCR-r4-ext.c \ FilterCoefficient.c \ FineSFN-SFN.c \ ForbiddenAffectCell.c \ ForbiddenAffectCell-r4.c \ ForbiddenAffectCell-LCR-r4.c \ ForbiddenAffectCellList.c \ ForbiddenAffectCellList-r4.c \ ForbiddenAffectCellList-LCR-r4.c \ FreqQualityEstimateQuantity-FDD.c \ FreqQualityEstimateQuantity-TDD.c \ GPS-MeasurementParam.c \ GPS-MeasurementParamList.c \ GSM-CarrierRSSI.c \ GSM-MeasuredResults.c \ GSM-MeasuredResultsList.c \ GPS-TOW-1msec.c \ GPS-TOW-Assist.c \ GPS-TOW-AssistList.c \ HCS-CellReselectInformation-RSCP.c \ HCS-CellReselectInformation-ECN0.c \ HCS-NeighbouringCellInformation-RSCP.c \ HCS-NeighbouringCellInformation-ECN0.c \ HCS-PRIO.c \ HCS-ServingCellInformation.c \ HorizontalVelocity.c \ HorizontalWithVerticalVelocity.c \ HorizontalVelocityWithUncertainty.c \ HorizontalWithVerticalVelocityAndUncertainty.c \ Hysteresis.c \ HysteresisInterFreq.c \ InterFreqCell.c \ InterFreqCell-LCR-r4.c \ InterFreqCellID.c \ InterFreqCellInfoList.c \ InterFreqCellInfoList-r4.c \ InterFreqCellInfoSI-List-RSCP.c \ InterFreqCellInfoSI-List-ECN0.c \ InterFreqCellInfoSI-List-HCS-RSCP.c \ InterFreqCellInfoSI-List-HCS-ECN0.c \ InterFreqCellInfoSI-List-RSCP-LCR.c \ InterFreqCellInfoSI-List-ECN0-LCR.c \ InterFreqCellInfoSI-List-HCS-RSCP-LCR.c \ InterFreqCellInfoSI-List-HCS-ECN0-LCR.c \ InterFreqCellList.c \ InterFreqCellList-LCR-r4-ext.c \ InterFreqCellMeasuredResultsList.c \ InterFreqEvent.c \ InterFreqEvent-r6.c \ InterFreqEventList.c \ InterFreqEventList-r6.c \ InterFrequencyMeasuredResultsList-v590ext.c \ Inter-FreqEventCriteria-v590ext.c \ Inter-FreqEventCriteriaList-v590ext.c \ Intra-FreqEventCriteriaList-v590ext.c \ IntraFrequencyMeasuredResultsList-v590ext.c \ IntraFreqReportingCriteria-1b-r5.c \ PeriodicReportingInfo-1b.c \ InterFreqEventResults.c \ InterFreqEventResults-LCR-r4-ext.c \ InterFreqMeasQuantity.c \ InterFreqMeasuredResults.c \ InterFreqMeasuredResultsList.c \ InterFreqMeasurementSysInfo-RSCP.c \ InterFreqMeasurementSysInfo-ECN0.c \ InterFreqMeasurementSysInfo-HCS-RSCP.c \ InterFreqMeasurementSysInfo-HCS-ECN0.c \ InterFreqMeasurementSysInfo-RSCP-LCR-r4.c \ InterFreqMeasurementSysInfo-ECN0-LCR-r4.c \ InterFreqMeasurementSysInfo-HCS-RSCP-LCR-r4.c \ InterFreqMeasurementSysInfo-HCS-ECN0-LCR-r4.c \ InterFreqRACHRepCellsList.c \ InterFreqRACHReportingInfo.c \ InterFreqReportCriteria.c \ InterFreqReportCriteria-r4.c \ InterFreqReportCriteria-r6.c \ InterFreqReportingCriteria.c \ InterFreqReportingCriteria-r6.c \ InterFreqReportingQuantity.c \ InterFreqRepQuantityRACH-FDD.c \ InterFreqRepQuantityRACH-TDD.c \ InterFreqRepQuantityRACH-TDDList.c \ InterFrequencyMeasurement.c \ InterFrequencyMeasurement-r4.c \ InterFrequencyMeasurement-r6.c \ InterRAT-TargetCellDescription.c \ InterRATCellID.c \ InterRATCellInfoIndication.c \ InterRATCellInfoList.c \ InterRATCellInfoList-B.c \ InterRATCellInfoList-r4.c \ InterRATCellInfoList-r6.c \ InterRATCellIndividualOffset.c \ InterRATEvent.c \ InterRATEventList.c \ InterRATEventResults.c \ InterRATInfo.c \ InterRATInfo-r6.c \ InterRATMeasQuantity.c \ InterRATMeasuredResults.c \ InterRATMeasuredResultsList.c \ InterRATMeasurement.c \ InterRATMeasurement-r4.c \ InterRATMeasurement-r6.c \ InterRATMeasurementSysInfo.c \ InterRATMeasurementSysInfo-B.c \ InterRATReportCriteria.c \ InterRATReportingCriteria.c \ InterRATReportingQuantity.c \ IntraFreqCellID.c \ IntraFreqCellInfoList.c \ IntraFreqCellInfoList-r4.c \ IntraFreqCellInfoSI-List-RSCP.c \ IntraFreqCellInfoSI-List-ECN0.c \ IntraFreqCellInfoSI-List-HCS-RSCP.c \ IntraFreqCellInfoSI-List-HCS-ECN0.c \ IntraFreqCellInfoSI-List-RSCP-LCR-r4.c \ IntraFreqCellInfoSI-List-ECN0-LCR-r4.c \ IntraFreqCellInfoSI-List-HCS-RSCP-LCR-r4.c \ IntraFreqCellInfoSI-List-HCS-ECN0-LCR-r4.c \ IntraFreqEvent.c \ IntraFreqEvent-r4.c \ IntraFreqEvent-LCR-r4.c \ IntraFreqEvent-r6.c \ IntraFreqEvent-1d-r5.c \ IntraFreqEventCriteria.c \ IntraFreqEventCriteria-r4.c \ IntraFreqEventCriteria-LCR-r4.c \ IntraFreqEventCriteria-r6.c \ IntraFreqEventCriteriaList.c \ IntraFreqEventCriteriaList-r4.c \ IntraFreqEventCriteriaList-LCR-r4.c \ IntraFreqEventCriteriaList-r6.c \ IntraFreqEventResults.c \ IntraFreqMeasQuantity.c \ IntraFreqMeasQuantity-FDD.c \ IntraFreqMeasQuantity-TDD.c \ IntraFreqMeasQuantity-TDDList.c \ IntraFreqMeasuredResultsList.c \ IntraFreqMeasurementSysInfo-RSCP.c \ IntraFreqMeasurementSysInfo-ECN0.c \ IntraFreqMeasurementSysInfo-HCS-RSCP.c \ IntraFreqMeasurementSysInfo-HCS-ECN0.c \ IntraFreqMeasurementSysInfo-RSCP-LCR-r4.c \ IntraFreqMeasurementSysInfo-ECN0-LCR-r4.c \ IntraFreqMeasurementSysInfo-HCS-RSCP-LCR-r4.c \ IntraFreqMeasurementSysInfo-HCS-ECN0-LCR-r4.c \ IntraFreqReportCriteria.c \ IntraFreqReportCriteria-r4.c \ IntraFreqReportCriteria-r6.c \ IntraFreqReportingCriteria.c \ IntraFreqReportingCriteria-r4.c \ IntraFreqReportingCriteria-LCR-r4.c \ IntraFreqReportingCriteria-r6.c \ IntraFreqReportingQuantity.c \ IntraFreqReportingQuantityForRACH.c \ IntraFreqRepQuantityRACH-FDD.c \ IntraFreqRepQuantityRACH-TDD.c \ IntraFreqRepQuantityRACH-TDDList.c \ IntraFrequencyMeasurement.c \ IntraFrequencyMeasurement-r4.c \ IntraFrequencyMeasurement-r6.c \ IODE.c \ IP-Length.c \ IP-PCCPCH-r4.c \ IP-Spacing.c \ IP-Spacing-TDD.c \ IS-2000SpecificMeasInfo.c \ MaxNumberOfReportingCellsType1.c \ MaxNumberOfReportingCellsType2.c \ MaxNumberOfReportingCellsType3.c \ MaxReportedCellsOnRACH.c \ MaxReportedCellsOnRACHinterFreq.c \ MeasuredResults.c \ MeasuredResults-v390ext.c \ MeasuredResults-v590ext.c \ MeasuredResults-v7xyext.c \ MeasuredResults-LCR-r4.c \ MeasuredResultsList.c \ MeasuredResultsList-LCR-r4-ext.c \ MeasuredResultsOnRACH.c \ MeasuredResultsOnRACHinterFreq.c \ MeasurementCommand.c \ MeasurementCommand-r4.c \ MeasurementCommand-r6.c \ MeasurementControlSysInfo.c \ MeasurementControlSysInfo-LCR-r4-ext.c \ MeasurementIdentity.c \ MeasurementQuantityGSM.c \ MeasurementReportingMode.c \ MeasurementType.c \ MeasurementType-r4.c \ MeasurementType-r6.c \ MeasurementValidity.c \ MonitoredCellRACH-List.c \ MonitoredCellRACH-Result.c \ MultipathIndicator.c \ N-CR-T-CRMaxHyst.c \ NavigationModelSatInfo.c \ NavigationModelSatInfoList.c \ EphemerisParameter.c \ NC-Mode.c \ Neighbour.c \ Neighbour-v390ext.c \ NeighbourList.c \ NeighbourList-v390ext.c \ NeighbourQuality.c \ NewInterFreqCell.c \ NewInterFreqCell-r4.c \ NewInterFreqCellList.c \ NewInterFreqCellList-r4.c \ NewInterFreqCellSI-RSCP.c \ NewInterFreqCellSI-ECN0.c \ NewInterFreqCellSI-HCS-RSCP.c \ NewInterFreqCellSI-HCS-ECN0.c \ NewInterFreqCellSI-RSCP-LCR-r4.c \ NewInterFreqCellSI-ECN0-LCR-r4.c \ NewInterFreqCellSI-HCS-RSCP-LCR-r4.c \ NewInterFreqCellSI-HCS-ECN0-LCR-r4.c \ NewInterFreqCellSI-List-ECN0.c \ NewInterFreqCellSI-List-HCS-RSCP.c \ NewInterFreqCellSI-List-HCS-ECN0.c \ NewInterFreqCellSI-List-RSCP.c \ NewInterFreqCellSI-List-ECN0-LCR-r4.c \ NewInterFreqCellSI-List-HCS-RSCP-LCR-r4.c \ NewInterFreqCellSI-List-HCS-ECN0-LCR-r4.c \ NewInterFreqCellSI-List-RSCP-LCR-r4.c \ NewInterRATCell.c \ NewInterRATCell-B.c \ NewInterRATCellList.c \ NewInterRATCellList-B.c \ NewIntraFreqCell.c \ NewIntraFreqCell-r4.c \ NewIntraFreqCellList.c \ NewIntraFreqCellList-r4.c \ NewIntraFreqCellSI-RSCP.c \ NewIntraFreqCellSI-ECN0.c \ NewIntraFreqCellSI-HCS-RSCP.c \ NewIntraFreqCellSI-HCS-ECN0.c \ NewIntraFreqCellSI-RSCP-LCR-r4.c \ NewIntraFreqCellSI-ECN0-LCR-r4.c \ NewIntraFreqCellSI-HCS-RSCP-LCR-r4.c \ NewIntraFreqCellSI-HCS-ECN0-LCR-r4.c \ NewIntraFreqCellSI-List-RSCP.c \ NewIntraFreqCellSI-List-ECN0.c \ NewIntraFreqCellSI-List-HCS-RSCP.c \ NewIntraFreqCellSI-List-HCS-ECN0.c \ NewIntraFreqCellSI-List-RSCP-LCR-r4.c \ NewIntraFreqCellSI-List-ECN0-LCR-r4.c \ NewIntraFreqCellSI-List-HCS-RSCP-LCR-r4.c \ NewIntraFreqCellSI-List-HCS-ECN0-LCR-r4.c \ NonUsedFreqParameter.c \ NonUsedFreqParameter-r6.c \ NonUsedFreqParameterList.c \ NonUsedFreqParameterList-r6.c \ NonUsedFreqWList-r6.c \ ObservedTimeDifferenceToGSM.c \ OTDOA-SearchWindowSize.c \ Pathloss.c \ PenaltyTime-RSCP.c \ PenaltyTime-ECN0.c \ PendingTimeAfterTrigger.c \ PeriodicalOrEventTrigger.c \ PeriodicalReportingCriteria.c \ PeriodicalWithReportingCellStatus.c \ PLMNIdentitiesOfNeighbourCells.c \ PLMNsOfInterFreqCellsList.c \ PLMNsOfIntraFreqCellsList.c \ PLMNsOfInterRATCellsList.c \ PositionEstimate.c \ PositioningMethod.c \ PRC.c \ PrimaryCCPCH-RSCP.c \ Q-HCS.c \ Q-OffsetS-N.c \ Q-QualMin.c \ Q-RxlevMin.c \ QualityEventResults.c \ QualityMeasuredResults.c \ QualityMeasurement.c \ QualityReportCriteria.c \ QualityReportingCriteria.c \ QualityReportingCriteriaSingle.c \ QualityReportingQuantity.c \ RAT-Type.c \ ReferenceCellPosition.c \ ReferenceLocation.c \ ReferenceTimeDifferenceToCell.c \ RemovedInterFreqCellList.c \ RemovedInterRATCellList.c \ RemovedIntraFreqCellList.c \ ReplacementActivationThreshold.c \ ReportDeactivationThreshold.c \ ReportingAmount.c \ ReportingCellStatus.c \ ReportingCellStatusOpt.c \ ReportingInfoForCellDCH.c \ ReportingInfoForCellDCH-LCR-r4.c \ ReportingInterval.c \ ReportingIntervalLong.c \ ReportingRange.c \ RL-AdditionInfoList.c \ RL-InformationLists.c \ RLC-BuffersPayload.c \ RRC.c \ SatData.c \ SatDataList.c \ SatelliteStatus.c \ SatID.c \ SFN-Offset-Validity.c \ SFN-SFN-Drift.c \ SFN-SFN-ObsTimeDifference.c \ SFN-SFN-ObsTimeDifference1.c \ SFN-SFN-ObsTimeDifference2.c \ SFN-SFN-OTD-Type.c \ SFN-SFN-RelTimeDifference1.c \ SFN-TOW-Uncertainty.c \ SIR.c \ SIR-MeasurementList.c \ SIR-MeasurementResults.c \ SIR-TFCS.c \ SIR-TFCS-List.c \ SIR-TimeslotList.c \ SubFrame1Reserved.c \ T-ADVinfo.c \ T-CRMax.c \ T-CRMaxHyst.c \ TemporaryOffset1.c \ TemporaryOffset2.c \ TemporaryOffsetList.c \ Threshold.c \ Threshold-r6.c \ ThreholdNonUsedFrequency-deltaList.c \ ThresholdPositionChange.c \ ThresholdSFN-GPS-TOW.c \ ThresholdSFN-SFN-Change.c \ ThresholdUsedFrequency.c \ ThresholdUsedFrequency-r6.c \ TimeInterval.c \ TimeslotInfo.c \ TimeslotInfo-LCR-r4.c \ TimeslotInfoList.c \ TimeslotInfoList-LCR-r4.c \ TimeslotInfoList-r4.c \ TimeslotISCP.c \ TimeslotISCP-List.c \ TimeslotListWithISCP.c \ TimeslotWithISCP.c \ TimeToTrigger.c \ TrafficVolumeEventParam.c \ TrafficVolumeEventResults.c \ TrafficVolumeEventType.c \ TrafficVolumeMeasQuantity.c \ TrafficVolumeMeasSysInfo.c \ TrafficVolumeMeasuredResults.c \ TrafficVolumeMeasuredResultsList.c \ TrafficVolumeMeasurement.c \ TrafficVolumeMeasurementObjectList.c \ TrafficVolumeReportCriteria.c \ TrafficVolumeReportCriteriaSysInfo.c \ TrafficVolumeReportingCriteria.c \ TrafficVolumeReportingQuantity.c \ TrafficVolumeThreshold.c \ TransChCriteria.c \ TransChCriteriaList.c \ TransferMode.c \ TransmittedPowerThreshold.c \ TriggeringCondition1.c \ TriggeringCondition2.c \ TX-InterruptionAfterTrigger.c \ UDRE.c \ UE-6AB-Event.c \ UE-6FG-Event.c \ UE-AutonomousUpdateMode.c \ UE-InternalEventParam.c \ UE-InternalEventParamList.c \ UE-InternalEventResults.c \ UE-InternalMeasQuantity.c \ UE-InternalMeasuredResults.c \ UE-InternalMeasuredResults-r7.c \ UE-InternalMeasuredResults-LCR-r4.c \ UE-InternalMeasurement.c \ UE-InternalMeasurement-r4.c \ UE-InternalMeasurementSysInfo.c \ UE-InternalReportCriteria.c \ UE-InternalReportingCriteria.c \ UE-InternalReportingQuantity.c \ UE-InternalReportingQuantity-r4.c \ UE-MeasurementQuantity.c \ UE-RX-TX-ReportEntry.c \ UE-RX-TX-ReportEntryList.c \ UE-RX-TX-TimeDifferenceType1.c \ UE-RX-TX-TimeDifferenceType2.c \ UE-RX-TX-TimeDifferenceType2Info.c \ UE-RX-TX-TimeDifferenceThreshold.c \ UE-TransmittedPower.c \ UE-TransmittedPowerTDD-List.c \ UL-TrCH-Identity.c \ UE-Positioning-Accuracy.c \ UE-Positioning-CipherParameters.c \ UE-Positioning-Error.c \ UE-Positioning-ErrorCause.c \ UE-Positioning-EventParam.c \ UE-Positioning-EventParamList.c \ UE-Positioning-EventSpecificInfo.c \ UE-Positioning-GPS-AcquisitionAssistance.c \ UE-Positioning-GPS-AdditionalAssistanceDataRequest.c \ UE-Positioning-GPS-Almanac.c \ UE-Positioning-GPS-AssistanceData.c \ UE-Positioning-GPS-DGPS-Corrections.c \ UE-Positioning-GPS-IonosphericModel.c \ UE-Positioning-GPS-MeasurementResults.c \ UE-Positioning-GPS-NavigationModel.c \ UE-Positioning-GPS-NavModelAddDataReq.c \ UE-Positioning-GPS-ReferenceCellInfo.c \ UE-Positioning-GPS-ReferenceTime.c \ UE-Positioning-GPS-UTC-Model.c \ UE-Positioning-IPDL-Parameters.c \ UE-Positioning-IPDL-Parameters-r4.c \ UE-Positioning-IPDL-Parameters-TDD-r4-ext.c \ UE-Positioning-MeasuredResults.c \ UE-Positioning-MeasuredResults-v390ext.c \ UE-Positioning-Measurement.c \ UE-Positioning-Measurement-v390ext.c \ UE-Positioning-Measurement-r4.c \ UE-Positioning-Measurement-v7xyext.c \ UE-Positioning-MeasurementEventResults.c \ UE-Positioning-MeasurementInterval.c \ UE-Positioning-MethodType.c \ UE-Positioning-OTDOA-AssistanceData.c \ UE-Positioning-OTDOA-AssistanceData-r4.c \ UE-Positioning-OTDOA-AssistanceData-r4ext.c \ UE-Positioning-OTDOA-AssistanceData-UEB.c \ UE-Positioning-IPDL-Parameters-TDDList-r4-ext.c \ UE-Positioning-OTDOA-Measurement.c \ UE-Positioning-OTDOA-Measurement-v390ext.c \ UE-Positioning-OTDOA-NeighbourCellInfo.c \ UE-Positioning-OTDOA-NeighbourCellInfo-r4.c \ UE-Positioning-OTDOA-NeighbourCellInfo-UEB.c \ UE-Positioning-OTDOA-NeighbourCellList.c \ UE-Positioning-OTDOA-NeighbourCellList-r4.c \ UE-Positioning-OTDOA-NeighbourCellList-UEB.c \ UE-Positioning-OTDOA-Quality.c \ UE-Positioning-OTDOA-ReferenceCellInfo.c \ UE-Positioning-OTDOA-ReferenceCellInfo-r4.c \ UE-Positioning-OTDOA-ReferenceCellInfo-UEB.c \ UE-Positioning-PositionEstimateInfo.c \ UE-Positioning-ReportCriteria.c \ UE-Positioning-ReportingQuantity.c \ UE-Positioning-ReportingQuantity-v390ext.c \ UE-Positioning-ReportingQuantity-r4.c \ UE-Positioning-ReportingQuantity-v7xyext.c \ UE-Positioning-ResponseTime.c \ UTRA-CarrierRSSI.c \ UTRAN-GPS-DriftRate.c \ UTRAN-GPSReferenceTime.c \ UTRAN-GPSReferenceTimeResult.c \ VarianceOfRLC-BufferPayload.c \ VelocityEstimate.c \ W.c \ BCC.c \ BCCH-ModificationInfo.c \ BCCH-ModificationTime.c \ BSIC.c \ CBS-DRX-Level1Information.c \ CBS-DRX-Level1Information-extension-r6.c \ CDMA2000-Message.c \ CDMA2000-MessageList.c \ CDMA2000-UMTS-Frequency-List.c \ CellValueTag.c \ ExpirationTimeFactor.c \ FDD-UMTS-Frequency-List.c \ FrequencyInfoCDMA2000.c \ GERAN-SystemInfoBlock.c \ GERAN-SystemInformation.c \ GSM-BA-Range.c \ GSM-BA-Range-List.c \ GSM-Classmark2.c \ GSM-Classmark3.c \ GSM-MessageList.c \ GSM-MS-RadioAccessCapability.c \ GsmSecurityCapability.c \ GSM-TargetCellInfoList.c \ GSM-TargetCellInfo.c \ IdentificationOfReceivedMessage.c \ InterRAT-ChangeFailureCause.c \ GERANIu-MessageList.c \ GERANIu-RadioAccessCapability.c \ InterRAT-UE-RadioAccessCapability.c \ InterRAT-UE-RadioAccessCapabilityList.c \ InterRAT-UE-RadioAccessCapability-v590ext.c \ InterRAT-UE-RadioAccessCapability-v690ext.c \ InterRAT-UE-SecurityCapability.c \ InterRAT-UE-SecurityCapList.c \ InterRAT-HO-FailureCause.c \ MasterInformationBlock.c \ MasterInformationBlock-v690ext.c \ MIB-ValueTag.c \ NCC.c \ PLMN-ValueTag.c \ PredefinedConfigIdentityAndValueTag.c \ ProtocolErrorInformation.c \ ReceivedMessageType.c \ Rplmn-Information.c \ Rplmn-Information-r4.c \ SchedulingInformation.c \ SchedulingInformationSIB.c \ SchedulingInformationSIBSb.c \ SegCount.c \ SegmentIndex.c \ SFN-Prime.c \ SIB-Data-fixed.c \ SIB-Data-variable.c \ SIBOccurIdentity.c \ SIBOccurrenceIdentityAndValueTag.c \ SIBOccurValueTag.c \ SIB-ReferenceList.c \ SIBSb-ReferenceList.c \ SIB-ReferenceListFACH.c \ SIB-Type.c \ SIB-TypeAndTag.c \ SIBSb-TypeAndTag.c \ SibOFF.c \ SibOFF-List.c \ SysInfoType1.c \ SysInfoType1-v3a0ext-IEs.c \ SysInfoType2.c \ SysInfoType3.c \ SysInfoType3-v4b0ext-IEs.c \ SysInfoType3-v590ext.c \ SysInfoType3-v5c0ext-IEs.c \ SysInfoType3-v670ext.c \ SysInfoType4.c \ SysInfoType4-v4b0ext-IEs.c \ SysInfoType4-v590ext.c \ SysInfoType4-v5b0ext-IEs.c \ SysInfoType4-v5c0ext-IEs.c \ SysInfoType5.c \ SysInfoType5-v4b0ext-IEs.c \ SysInfoType5-v590ext-IEs.c \ SysInfoType5-v650ext-IEs.c \ SysInfoType5-v680ext-IEs.c \ SysInfoType5-v690ext-IEs.c \ SysInfoType5-v7xyext-IEs.c \ SysInfoType5bis.c \ SysInfoType6.c \ SysInfoType6-v4b0ext-IEs.c \ SysInfoType6-v590ext-IEs.c \ SysInfoType6-v650ext-IEs.c \ SysInfoType6-v690ext-IEs.c \ SysInfoType6-v7xyext-IEs.c \ SysInfoType7.c \ SysInfoType8.c \ SysInfoType9.c \ SysInfoType10.c \ SysInfoType11.c \ SysInfoType11-v4b0ext-IEs.c \ SysInfoType11-v590ext-IEs.c \ SysInfoType11-v690ext-IEs.c \ SysInfoType12.c \ SysInfoType12-v4b0ext-IEs.c \ SysInfoType12-v590ext-IEs.c \ SysInfoType12-v690ext-IEs.c \ SysInfoType13.c \ SysInfoType13-v3a0ext-IEs.c \ SysInfoType13-v4b0ext-IEs.c \ SysInfoType13-v7xyext-IEs.c \ SysInfoType13-1.c \ SysInfoType13-2.c \ SysInfoType13-3.c \ SysInfoType13-4.c \ SysInfoType14.c \ SysInfoType15.c \ SysInfoType15-v4b0ext-IEs.c \ SysInfoType15-1.c \ SysInfoType15-2.c \ SysInfoType15-3.c \ SysInfoType15-4.c \ SysInfoType15-4-v3a0ext.c \ SysInfoType15-4-v4b0ext.c \ SysInfoType15-5.c \ SysInfoType15-5-v3a0ext.c \ SysInfoType16.c \ SysInfoType17.c \ SysInfoType17-v4b0ext-IEs.c \ SysInfoType17-v590ext-IEs.c \ SysInfoType17-v7xyext-IEs.c \ SysInfoType18.c \ SysInfoTypeSB1.c \ SysInfoTypeSB2.c \ TDD-UMTS-Frequency-List.c \ ANSI-41-GlobalServiceRedirectInfo.c \ ANSI-41-PrivateNeighbourListInfo.c \ ANSI-41-RAND-Information.c \ ANSI-41-UserZoneID-Information.c \ ANSI-41-NAS-Parameter.c \ Min-P-REV.c \ NAS-SystemInformationANSI-41.c \ NID.c \ P-REV.c \ SID.c \ MBMS-AccessProbabilityFactor.c \ MBMS-CellGroupIdentity-r6.c \ MBMS-CommonCCTrChIdentity.c \ MBMS-CommonPhyChIdentity.c \ MBMS-CommonRBIdentity.c \ MBMS-CommonRBInformation-r6.c \ MBMS-CommonRBInformationList-r6.c \ MBMS-CommonTrChIdentity.c \ MBMS-ConnectedModeCountingScope.c \ MBMS-CurrentCell-SCCPCH-r6.c \ MBMS-CurrentCell-SCCPCHList-r6.c \ MBMS-FACHCarryingMTCH-List.c \ MBMS-JoinedInformation-r6.c \ MBMS-L1CombiningSchedule-32.c \ MBMS-L1CombiningSchedule-64.c \ MBMS-L1CombiningSchedule-128.c \ MBMS-L1CombiningSchedule-256.c \ MBMS-L1CombiningSchedule-512.c \ MBMS-L1CombiningSchedule-1024.c \ MBMS-L1CombiningSchedule.c \ MBMS-L1CombiningTransmTimeDiff.c \ MBMS-L23Configuration.c \ MBMS-LogicalChIdentity.c \ MBMS-MCCH-ConfigurationInfo-r6.c \ MBMS-MICHConfigurationInfo-r6.c \ MBMS-MICHConfigurationInfo-r7.c \ MBMS-MICHNotificationIndLength.c \ MBMS-MICHPowerOffset.c \ MBMS-ModifedService-r6.c \ MBMS-ModifedServiceList-r6.c \ MBMS-MSCH-ConfigurationInfo-r6.c \ MBMS-MSCHSchedulingInfo.c \ MBMS-NeighbouringCellSCCPCH-r6.c \ MBMS-NeighbouringCellSCCPCHList-r6.c \ MBMS-NI-CountPerFrame.c \ MBMS-NumberOfNeighbourCells-r6.c \ MBMS-PFLIndex.c \ MBMS-PFLInfo.c \ MBMS-PhyChInformation-r6.c \ MBMS-PhyChInformationList-r6.c \ MBMS-PL-ServiceRestrictInfo-r6.c \ MBMS-PreferredFreqRequest-r6.c \ MBMS-PreferredFrequencyInfo-r6.c \ MBMS-PreferredFrequencyList-r6.c \ MBMS-PTMActivationTime-r6.c \ MBMS-PTM-RBInformation-C.c \ MBMS-PTM-RBInformation-CList.c \ MBMS-PTM-RBInformation-N.c \ MBMS-PTM-RBInformation-NList.c \ MBMS-Qoffset.c \ MBMS-RequiredUEAction-Mod.c \ MBMS-RequiredUEAction-UMod.c \ MBMS-SCCPCHIdentity.c \ MBMS-SCCPCHPwrOffsetDiff.c \ MBMS-ServiceAccessInfo-r6.c \ MBMS-ServiceAccessInfoList-r6.c \ MBMS-ServiceIdentity-r6.c \ MBMS-ServiceSchedulingInfo-r6.c \ MBMS-ServiceSchedulingInfoList-r6.c \ MBMS-ServiceTransmInfo.c \ MBMS-ServiceTransmInfoList.c \ MBMS-SessionIdentity.c \ MBMS-ShortTransmissionID.c \ MBMS-SIBType5-SCCPCH-r6.c \ MBMS-SIBType5-SCCPCHList-r6.c \ MBMS-SoftComb-TimingOffset.c \ MBMS-TCTF-Presence.c \ MBMS-TimersAndCounters-r6.c \ MBMS-TransmissionIdentity.c \ MBMS-TranspChInfoForCCTrCh-r6.c \ MBMS-TranspChInfoForEachCCTrCh-r6.c \ MBMS-TranspChInfoForEachTrCh-r6.c \ MBMS-TranspChInfoForTrCh-r6.c \ MBMS-TrCHInformation-Curr.c \ MBMS-TrCHInformation-CurrList.c \ MBMS-TrCHInformation-Neighb.c \ MBMS-TrCHInformation-NeighbList.c \ MBMS-TrCHInformation-SIB5.c \ MBMS-TrCHInformation-SIB5List.c \ MBMS-UnmodifiedService-r6.c \ MBMS-UnmodifiedServiceList-r6.c \ ToTargetRNC-Container.c \ TargetRNC-ToSourceRNC-Container.c \ InterRATHandoverInfoWithInterRATCapabilities-r3.c \ InterRATHandoverInfoWithInterRATCapabilities-r3-IEs.c \ InterRATHandoverInfoWithInterRATCapabilities-v390ext-IEs.c \ InterRATHandoverInfoWithInterRATCapabilities-v690ext-IEs.c \ RFC3095-ContextInfo-r5.c \ RFC3095-ContextInfoList-r5.c \ SRNC-RelocationInfo-r3.c \ SRNC-RelocationInfo-r3-IEs.c \ SRNC-RelocationInfo-v380ext-IEs.c \ SRNC-RelocationInfo-v390ext-IEs.c \ SRNC-RelocationInfo-v3a0ext-IEs.c \ SRNC-RelocationInfo-v3b0ext-IEs.c \ SRNC-RelocationInfo-v3c0ext-IEs.c \ SRNC-RelocationInfo-v3d0ext-IEs.c \ SRNC-RelocationInfo-v3g0ext-IEs.c \ SRNC-RelocationInfo-v3h0ext-IEs.c \ SRNC-RelocationInfo-v4d0ext-IEs.c \ TPC-CombinationInfoList.c \ STARTList2.c \ SRNC-RelocationInfo-v4b0ext-IEs.c \ SRNC-RelocationInfo-v590ext-IEs.c \ SRNC-RelocationInfo-v5a0ext-IEs.c \ SRNC-RelocationInfo-v5b0ext-IEs.c \ SRNC-RelocationInfo-v5c0ext-IEs.c \ SRNC-RelocationInfo-v7xyext-IEs.c \ CipheringInfoPerRB-List-v3a0ext.c \ CipheringStatusList.c \ CipheringStatusCNdomain.c \ CodeChangeStatusList.c \ CodeChangeStatus.c \ StoredCompressedModeInfo.c \ StoredTGP-SequenceList.c \ StoredTGP-Sequence.c \ SRNC-RelocationInfo-r4-IEs.c \ SRNC-RelocationInfo-r5-IEs.c \ SRNC-RelocationInfo-v690ext-IEs.c \ SRNC-RelocationInfo-r6-IEs.c \ CalculationTimeForCiphering.c \ CipheringInfoPerRB.c \ CipheringInfoPerRB-r4.c \ CipheringInfoPerRB-List.c \ CipheringInfoPerRB-List-r4.c \ CipheringStatus.c \ CipheringStatusList-r4.c \ CipheringStatusCNdomain-r4.c \ CN-DomainInformation-v390ext.c \ CN-DomainInformationList-v390ext.c \ CompressedModeMeasCapability-r4.c \ COUNT-C-List.c \ COUNT-CSingle.c \ DL-PhysChCapabilityFDD-r4.c \ DL-PhysChCapabilityFDD-r5.c \ DL-PhysChCapabilityTDD-r5.c \ DL-PhysChCapabilityTDD-LCR-r5.c \ DL-RFC3095-Context.c \ ImplementationSpecificParams.c \ IntegrityProtectionStatus.c \ InterRAT-UE-RadioAccessCapabilityList-r5.c \ IntraFreqReportingCriteria-r6-ext.c \ MaxHcContextSpace-r5.c \ MeasurementCapability-r4.c \ MeasurementCommandWithType.c \ MeasurementCommandWithType-r4.c \ MeasurementCommandWithType-r6.c \ OngoingMeasRep.c \ OngoingMeasRep-r4.c \ OngoingMeasRep-r5.c \ OngoingMeasRep-r6.c \ OngoingMeasRepList.c \ OngoingMeasRepList-r4.c \ OngoingMeasRepList-r5.c \ OngoingMeasRepList-r6.c \ PDCP-Capability-r4.c \ PDCP-Capability-r5.c \ PDCP-Capability-r6.c \ PhysicalChannelCapability-r4.c \ PhysicalChannelCapability-r5.c \ RF-Capability-r4.c \ RFC3095-ContextInfo.c \ RFC3095-Context-List.c \ RLC-Capability-r5.c \ SRB-SpecificIntegrityProtInfo.c \ SRB-SpecificIntegrityProtInfoList.c \ StateOfRRC.c \ StateOfRRC-Procedure.c \ TotalRLC-AM-BufferSize-r5.c \ TPC-Combination-Info.c \ UE-MultiModeRAT-Capability-r5.c \ UE-Positioning-Capability-r4.c \ UE-Positioning-LastKnownPos.c \ UE-RadioAccessCapability-r4.c \ UE-RadioAccessCapability-r5.c \ UE-RadioAccessCapability-r6.c \ UE-RadioAccessCapability-r7.c \ UL-RFC3095-Context.c ASN_MODULE_HEADERS= \ DL-DCCH-Message.h \ DL-DCCH-MessageType.h \ UL-DCCH-Message.h \ UL-DCCH-MessageType.h \ DL-CCCH-Message.h \ DL-CCCH-MessageType.h \ UL-CCCH-Message.h \ UL-CCCH-MessageType.h \ PCCH-Message.h \ PCCH-MessageType.h \ DL-SHCCH-Message.h \ DL-SHCCH-MessageType.h \ UL-SHCCH-Message.h \ UL-SHCCH-MessageType.h \ BCCH-FACH-Message.h \ BCCH-FACH-MessageType.h \ BCCH-BCH-Message.h \ MCCH-Message.h \ MCCH-MessageType.h \ MSCH-Message.h \ MSCH-MessageType.h \ ActiveSetUpdate.h \ ActiveSetUpdate-r3-IEs.h \ ActiveSetUpdate-v4b0ext-IEs.h \ ActiveSetUpdate-v590ext-IEs.h \ ActiveSetUpdate-v690ext-IEs.h \ ActiveSetUpdate-r6-IEs.h \ ActiveSetUpdateComplete.h \ ActiveSetUpdateFailure.h \ AssistanceDataDelivery.h \ AssistanceDataDelivery-r3-IEs.h \ AssistanceDataDelivery-v3a0ext.h \ AssistanceDataDelivery-v4b0ext-IEs.h \ CellChangeOrderFromUTRAN.h \ CellChangeOrderFromUTRAN-r3-IEs.h \ CellChangeOrderFromUTRAN-v590ext-IEs.h \ CellChangeOrderFromUTRANFailure.h \ CellChangeOrderFromUTRANFailure-r3-IEs.h \ CellUpdate.h \ CellUpdate-v590ext.h \ CellUpdate-v690ext-IEs.h \ CellUpdate-v7xyext-IEs.h \ CellUpdateConfirm.h \ CellUpdateConfirm-r3-IEs.h \ CellUpdateConfirm-v3a0ext.h \ CellUpdateConfirm-v4b0ext-IEs.h \ CellUpdateConfirm-v590ext-IEs.h \ CellUpdateConfirm-v5d0ext-IEs.h \ CellUpdateConfirm-r4-IEs.h \ CellUpdateConfirm-r5-IEs.h \ CellUpdateConfirm-r6-IEs.h \ CellUpdateConfirm-v690ext-IEs.h \ CellUpdateConfirm-r7-IEs.h \ CellUpdateConfirm-CCCH.h \ CounterCheck.h \ CounterCheck-r3-IEs.h \ CounterCheckResponse.h \ DownlinkDirectTransfer.h \ DownlinkDirectTransfer-r3-IEs.h \ HandoverToUTRANCommand.h \ HandoverToUTRANCommand-r3-IEs.h \ HandoverToUTRANCommand-r4-IEs.h \ HandoverToUTRANCommand-r5-IEs.h \ HandoverToUTRANCommand-r6-IEs.h \ HandoverToUTRANCommand-r7-IEs.h \ HandoverToUTRANComplete.h \ InitialDirectTransfer.h \ InitialDirectTransfer-v3a0ext.h \ InitialDirectTransfer-v590ext.h \ InitialDirectTransfer-v690ext-IEs.h \ HandoverFromUTRANCommand-GSM.h \ HandoverFromUTRANCommand-GSM-r3-IEs.h \ HandoverFromUTRANCommand-GSM-r6-IEs.h \ HandoverFromUTRANCommand-GSM-v690ext-IEs.h \ HandoverFromUTRANCommand-GERANIu.h \ HandoverFromUTRANCommand-GERANIu-r5-IEs.h \ HandoverFromUTRANCommand-CDMA2000.h \ HandoverFromUTRANCommand-CDMA2000-r3-IEs.h \ HandoverFromUTRANFailure.h \ HandoverFromUtranFailure-v590ext-IEs.h \ InterRATHandoverInfo.h \ InterRATHandoverInfo-v390ext-IEs.h \ InterRATHandoverInfo-v3a0ext-IEs.h \ InterRATHandoverInfo-v3d0ext-IEs.h \ InterRATHandoverInfo-v3g0ext-IEs.h \ InterRATHandoverInfo-r3-add-ext-IEs.h \ InterRATHandoverInfo-v4b0ext-IEs.h \ InterRATHandoverInfo-v4d0ext-IEs.h \ InterRATHandoverInfo-v590ext-IEs.h \ InterRATHandoverInfo-v690ext1-IEs.h \ InterRATHandoverInfo-v690ext-IEs.h \ InterRATHandoverInfo-v7xyext-IEs.h \ MeasurementControl.h \ MeasurementControl-r3-IEs.h \ MeasurementControl-v390ext.h \ MeasurementControl-v3a0ext.h \ MeasurementControl-r4-IEs.h \ MeasurementControl-v590ext-IEs.h \ MeasurementControl-v5b0ext-IEs.h \ MeasurementControl-r6-IEs.h \ MeasurementControl-v6a0ext-IEs.h \ MeasurementControl-v7xyext-IEs.h \ MeasurementControlFailure.h \ MeasurementControlFailure-v590ext-IEs.h \ MeasurementReport.h \ MeasurementReport-v390ext.h \ MeasurementReport-v4b0ext-IEs.h \ MeasurementReport-v590ext-IEs.h \ MeasurementReport-v5b0ext-IEs.h \ MeasurementReport-v690ext-IEs.h \ MeasurementReport-v7xyext-IEs.h \ PagingType1.h \ PagingType1-v590ext-IEs.h \ PagingType2.h \ PhysicalChannelReconfiguration.h \ PhysicalChannelReconfiguration-r3-IEs.h \ PhysicalChannelReconfiguration-v3a0ext.h \ PhysicalChannelReconfiguration-v4b0ext-IEs.h \ PhysicalChannelReconfiguration-v590ext-IEs.h \ PhysicalChannelReconfiguration-r4-IEs.h \ PhysicalChannelReconfiguration-r5-IEs.h \ PhysicalChannelReconfiguration-r6-IEs.h \ PhysicalChannelReconfiguration-v690ext-IEs.h \ PhysicalChannelReconfiguration-r7-IEs.h \ PhysicalChannelReconfigurationComplete.h \ PhysicalChannelReconfigurationComplete-v7xyext-IEs.h \ PhysicalChannelReconfigurationFailure.h \ PhysicalSharedChannelAllocation.h \ PhysicalSharedChannelAllocation-r3-IEs.h \ PhysicalSharedChannelAllocation-r4-IEs.h \ PhysicalSharedChannelAllocation-v690ext-IEs.h \ PhysicalSharedChannelAllocation-v7xyext-IEs.h \ PUSCHCapacityRequest.h \ PUSCHCapacityRequest-v590ext.h \ RadioBearerReconfiguration.h \ RadioBearerReconfiguration-r3-IEs.h \ RadioBearerReconfiguration-v3a0ext.h \ RadioBearerReconfiguration-v4b0ext-IEs.h \ RadioBearerReconfiguration-v590ext-IEs.h \ RadioBearerReconfiguration-v5d0ext-IEs.h \ RadioBearerReconfiguration-r4-IEs.h \ RadioBearerReconfiguration-r5-IEs.h \ RadioBearerReconfiguration-r6-IEs.h \ RadioBearerReconfiguration-v690ext-IEs.h \ RadioBearerReconfiguration-r7-IEs.h \ RadioBearerReconfigurationComplete.h \ RadioBearerReconfigurationComplete-v7xyext-IEs.h \ RadioBearerReconfigurationFailure.h \ RadioBearerRelease.h \ RadioBearerRelease-r3-IEs.h \ RadioBearerRelease-v3a0ext.h \ RadioBearerRelease-v4b0ext-IEs.h \ RadioBearerRelease-v590ext-IEs.h \ RadioBearerRelease-r4-IEs.h \ RadioBearerRelease-r5-IEs.h \ RadioBearerRelease-v690ext-IEs.h \ RadioBearerRelease-r6-IEs.h \ RadioBearerRelease-r7-IEs.h \ RadioBearerReleaseComplete.h \ RadioBearerReleaseComplete-v7xyext-IEs.h \ RadioBearerReleaseFailure.h \ RadioBearerSetup.h \ RadioBearerSetup-r3-IEs.h \ RadioBearerSetup-v3a0ext.h \ RadioBearerSetup-v4b0ext-IEs.h \ RadioBearerSetup-v590ext-IEs.h \ RadioBearerSetup-v5d0ext-IEs.h \ RadioBearerSetup-r4-IEs.h \ RadioBearerSetup-r5-IEs.h \ RadioBearerSetup-v690ext-IEs.h \ RadioBearerSetup-r6-IEs.h \ RadioBearerSetup-r7-IEs.h \ RadioBearerSetupComplete.h \ RadioBearerSetupComplete-v7xyext-IEs.h \ RadioBearerSetupFailure.h \ RRCConnectionReject.h \ RRCConnectionReject-r3-IEs.h \ RRCConnectionReject-v690ext-IEs.h \ RRCConnectionRelease.h \ RRCConnectionRelease-r3-IEs.h \ RRCConnectionRelease-r4-IEs.h \ RRCConnectionRelease-v690ext-IEs.h \ RRCConnectionRelease-CCCH.h \ RRCConnectionRelease-CCCH-r3-IEs.h \ RRCConnectionRelease-CCCH-r4-IEs.h \ RRCConnectionRelease-CCCH-r5-IEs.h \ RRCConnectionRelease-CCCH-v690ext-IEs.h \ RRCConnectionReleaseComplete.h \ RRCConnectionRequest.h \ RRCConnectionRequest-v3d0ext-IEs.h \ RRCConnectionRequest-v4b0ext-IEs.h \ RRCConnectionRequest-v590ext-IEs.h \ RRCConnectionRequest-v690ext-IEs.h \ RRCConnectionSetup.h \ RRCConnectionSetup-r3-IEs.h \ RRCConnectionSetup-v4b0ext-IEs.h \ RRCConnectionSetup-v590ext-IEs.h \ RRCConnectionSetup-r4-IEs.h \ RRCConnectionSetup-r5-IEs.h \ RRCConnectionSetup-v690ext-IEs.h \ RRCConnectionSetup-r6-IEs.h \ RRCConnectionSetup-r7-IEs.h \ RRCConnectionSetup-v7xyext-IEs.h \ RRCConnectionSetupComplete.h \ RRCConnectionSetupComplete-v370ext.h \ RRCConnectionSetupComplete-v380ext-IEs.h \ RRCConnectionSetupComplete-v3a0ext-IEs.h \ RRCConnectionSetupComplete-v3g0ext-IEs.h \ RRCConnectionSetupComplete-r3-add-ext-IEs.h \ RRCConnectionSetupComplete-v4b0ext-IEs.h \ RRCConnectionSetupComplete-v590ext-IEs.h \ RRCConnectionSetupComplete-v5c0ext-IEs.h \ RRCConnectionSetupComplete-v650ext-IEs.h \ RRCConnectionSetupComplete-v680ext-IEs.h \ RRCConnectionSetupComplete-v690ext-IEs.h \ RRCConnectionSetupComplete-v7xyext-IEs.h \ RRC-FailureInfo.h \ RRC-FailureInfo-r3-IEs.h \ RRCStatus.h \ SecurityModeCommand.h \ SecurityModeCommand-r3-IEs.h \ SecurityModeComplete.h \ SecurityModeFailure.h \ SignallingConnectionRelease.h \ SignallingConnectionRelease-r3-IEs.h \ SignallingConnectionReleaseIndication.h \ SystemInformation-BCH.h \ SystemInformation-FACH.h \ FirstSegment.h \ FirstSegmentShort.h \ SubsequentSegment.h \ LastSegment.h \ LastSegmentShort.h \ CompleteSIB-List.h \ CompleteSIB.h \ CompleteSIBshort.h \ SystemInformationChangeIndication.h \ TransportChannelReconfiguration.h \ TransportChannelReconfiguration-r3-IEs.h \ TransportChannelReconfiguration-v3a0ext.h \ TransportChannelReconfiguration-v4b0ext-IEs.h \ TransportChannelReconfiguration-v590ext-IEs.h \ TransportChannelReconfiguration-r4-IEs.h \ TransportChannelReconfiguration-r5-IEs.h \ TransportChannelReconfiguration-v690ext-IEs.h \ TransportChannelReconfiguration-r6-IEs.h \ TransportChannelReconfiguration-r7-IEs.h \ TransportChannelReconfigurationComplete.h \ TransportChannelReconfigurationComplete-v7xyext-IEs.h \ TransportChannelReconfigurationFailure.h \ TransportFormatCombinationControl.h \ TransportFormatCombinationControlFailure.h \ UECapabilityEnquiry.h \ UECapabilityEnquiry-r3-IEs.h \ UECapabilityEnquiry-v4b0ext-IEs.h \ UECapabilityEnquiry-v590ext-IEs.h \ UECapabilityEnquiry-v7xyext-IEs.h \ UECapabilityInformation.h \ UECapabilityInformation-v370ext.h \ UECapabilityInformation-v380ext-IEs.h \ UECapabilityInformation-v3a0ext-IEs.h \ UECapabilityInformation-r3-add-ext-IEs.h \ UECapabilityInformation-v4b0ext.h \ UECapabilityInformation-v590ext.h \ UECapabilityInformation-v5c0ext.h \ UECapabilityInformation-v650ext-IEs.h \ UECapabilityInformation-v680ext-IEs.h \ UECapabilityInformation-v690ext-IEs.h \ UECapabilityInformation-v7xyext-IEs.h \ UECapabilityInformationConfirm.h \ UECapabilityInformationConfirm-r3-IEs.h \ UplinkDirectTransfer.h \ UplinkDirectTransfer-v690ext-IEs.h \ UplinkPhysicalChannelControl.h \ UplinkPhysicalChannelControl-r3-IEs.h \ UplinkPhysicalChannelControl-v4b0ext-IEs.h \ UplinkPhysicalChannelControl-r4-IEs.h \ UplinkPhysicalChannelControl-r5-IEs.h \ UplinkPhysicalChannelControl-v690ext-IEs.h \ UplinkPhysicalChannelControl-v6a0ext-IEs.h \ UplinkPhysicalChannelControl-r7-IEs.h \ URAUpdate.h \ URAUpdateConfirm.h \ URAUpdateConfirm-r3-IEs.h \ URAUpdateConfirm-r5-IEs.h \ URAUpdateConfirm-v690ext-IEs.h \ URAUpdateConfirm-CCCH.h \ URAUpdateConfirm-CCCH-r3-IEs.h \ UTRANMobilityInformation.h \ UTRANMobilityInformation-r3-IEs.h \ UTRANMobilityInformation-v3a0ext-IEs.h \ UTRANMobilityInformation-r5-IEs.h \ UtranMobilityInformation-v690ext-IEs.h \ UTRANMobilityInformationConfirm.h \ UTRANMobilityInformationFailure.h \ MBMSAccessInformation.h \ MBMSCommonPTMRBInformation.h \ MBMSCurrentCellPTMRBInformation.h \ MBMSGeneralInformation.h \ MBMSGeneralInformation-v7xyext-IEs.h \ MBMSModificationRequest.h \ MBMSModifiedServicesInformation.h \ MBMSNeighbouringCellPTMRBInformation.h \ MBMSSchedulingInformation.h \ MBMSUnmodifiedServicesInformation.h \ Ansi-41-IDNNS.h \ CN-DomainIdentity.h \ CN-DomainInformation.h \ CN-DomainInformationFull.h \ CN-DomainInformationList.h \ CN-DomainInformationListFull.h \ CN-DomainSysInfo.h \ CN-DomainSysInfoList.h \ CN-InformationInfo.h \ CN-InformationInfo-r6.h \ CN-InformationInfoFull.h \ Digit.h \ Gsm-map-IDNNS.h \ IMEI.h \ IMEI-Digit.h \ IMSI-GSM-MAP.h \ IntraDomainNasNodeSelector.h \ LAI.h \ MCC.h \ MNC.h \ MultiplePLMN-List-r6.h \ NAS-Message.h \ NAS-Synchronisation-Indicator.h \ NAS-SystemInformationGSM-MAP.h \ P-TMSI-GSM-MAP.h \ PagingRecordTypeID.h \ PLMN-Identity.h \ PLMN-IdentityWithOptionalMCC-r6.h \ PLMN-Type.h \ RAB-Identity.h \ RAI.h \ RoutingAreaCode.h \ RoutingParameter.h \ TMSI-GSM-MAP.h \ AccessClassBarred.h \ AccessClassBarredList.h \ AllowedIndicator.h \ CellAccessRestriction.h \ CellBarred.h \ CellIdentity.h \ CellIdentity-PerRL-List.h \ CellSelectReselectInfoSIB-3-4.h \ DomainSpecificAccessRestrictionForSharedNetwork-v670ext.h \ DomainSpecificAccessRestrictionList-v670ext.h \ DomainSpecificAccessRestrictionParam-v670ext.h \ DomainSpecificAccessRestriction-v670ext.h \ MapParameter.h \ Mapping.h \ Mapping-LCR-r4.h \ MappingFunctionParameter.h \ MappingFunctionParameterList.h \ MappingFunctionType.h \ MappingInfo.h \ Q-Hyst-S.h \ Q-Hyst-S-Fine.h \ RAT.h \ RAT-FDD-Info.h \ RAT-FDD-InfoList.h \ RAT-Identifier.h \ RAT-TDD-Info.h \ RAT-TDD-InfoList.h \ ReservedIndicator.h \ S-SearchQual.h \ S-SearchRXLEV.h \ SpeedDependentScalingFactor.h \ T-Barred.h \ T-Reselection-S.h \ T-Reselection-S-Fine.h \ TreselectionScalingFactor.h \ UpperLimit.h \ URA-Identity.h \ URA-IdentityList.h \ AccessStratumReleaseIndicator.h \ ActivationTime.h \ BackoffControlParams.h \ C-RNTI.h \ CapabilityUpdateRequirement.h \ CapabilityUpdateRequirement-r4-ext.h \ CapabilityUpdateRequirement-r4.h \ CapabilityUpdateRequirement-r7-ext.h \ CellUpdateCause.h \ CellUpdateCause-ext.h \ ChipRateCapability.h \ ChipRateCapability-r7.h \ CipheringAlgorithm.h \ CipheringModeCommand.h \ CipheringModeInfo.h \ CN-DRX-CycleLengthCoefficient.h \ CN-PagedUE-Identity.h \ CompressedModeMeasCapability.h \ CompressedModeMeasCapability-LCR-r4.h \ CompressedModeMeasCapabFDDList.h \ CompressedModeMeasCapabFDDList2.h \ CompressedModeMeasCapabFDDList-ext.h \ CompressedModeMeasCapabFDD.h \ CompressedModeMeasCapabFDD2.h \ CompressedModeMeasCapabFDD-ext.h \ CompressedModeMeasCapabTDDList.h \ CompressedModeMeasCapabTDD.h \ CompressedModeMeasCapabGSMList.h \ CompressedModeMeasCapabGSM.h \ CompressedModeMeasCapabMC.h \ CPCH-Parameters.h \ DL-CapabilityWithSimultaneousHS-DSCHConfig.h \ DL-DPCCH-BER.h \ DL-PhysChCapabilityFDD.h \ DL-PhysChCapabilityFDD-v380ext.h \ SupportOfDedicatedPilotsForChEstimation.h \ DL-PhysChCapabilityTDD.h \ DL-PhysChCapabilityTDD-LCR-r4.h \ DL-PhysChCapabilityTDD-768.h \ DL-TransChCapability.h \ DRAC-SysInfo.h \ DRAC-SysInfoList.h \ DSCH-RNTI.h \ DelayRestrictionFlag.h \ E-RNTI.h \ ESN-DS-41.h \ EstablishmentCause.h \ FailureCauseWithProtErr.h \ FailureCauseWithProtErrTrId.h \ GroupIdentityWithReleaseInformation.h \ GroupReleaseInformation.h \ GSM-Measurements.h \ H-RNTI.h \ HSDSCH-physical-layer-category.h \ UESpecificBehaviourInformation1idle.h \ UESpecificBehaviourInformation1interRAT.h \ IMSI-and-ESN-DS-41.h \ IMSI-DS-41.h \ InitialPriorityDelayList.h \ InitialUE-Identity.h \ IntegrityCheckInfo.h \ IntegrityProtActivationInfo.h \ IntegrityProtectionAlgorithm.h \ IntegrityProtectionModeCommand.h \ IntegrityProtectionModeInfo.h \ IntegrityProtInitNumber.h \ MaxHcContextSpace.h \ MaxHcContextSpace-r5-ext.h \ MaxROHC-ContextSessions-r4.h \ MaximumAM-EntityNumberRLC-Cap.h \ MaximumBitRate.h \ MaximumRLC-WindowSize.h \ MaxNoDPDCH-BitsTransmitted.h \ MaxNoBits.h \ MaxNoPhysChBitsReceived.h \ MaxNoSCCPCH-RL.h \ MaxNumberOfTF.h \ MaxNumberOfTFC-DL.h \ MaxNumberOfTFC-UL.h \ MaxPhysChPerFrame.h \ MaxPhysChPerFrame-768.h \ MaxPhysChPerSubFrame-r4.h \ MaxPhysChPerTimeslot.h \ MaxPhysChPerTS.h \ MaxPhysChPerTS-768.h \ MaxSimultaneousCCTrCH-Count.h \ MaxSimultaneousTransChsDL.h \ MaxSimultaneousTransChsUL.h \ MaxTransportBlocksDL.h \ MaxTransportBlocksUL.h \ MaxTS-PerFrame.h \ MaxTS-PerSubFrame-r4.h \ MeasurementCapability.h \ MeasurementCapabilityExt.h \ MeasurementCapabilityExt2.h \ MeasurementCapability-r4-ext.h \ MessageAuthenticationCode.h \ MinimumSF-DL.h \ MinimumSF-DL-768.h \ MinimumSF-UL.h \ MultiModeCapability.h \ MultiRAT-Capability.h \ MultiModeRAT-Capability-v590ext.h \ MultiModeRAT-Capability-v680ext.h \ N-300.h \ N-301.h \ N-302.h \ N-304.h \ N-308.h \ N-310.h \ N-312.h \ N-312ext.h \ N-312-r5.h \ N-313.h \ N-315.h \ N-315ext.h \ N-315-r5.h \ N-AccessFails.h \ N-AP-RetransMax.h \ NetworkAssistedGPS-Supported.h \ NF-BO-AllBusy.h \ NF-BO-NoAICH.h \ NF-BO-Mismatch.h \ NS-BO-Busy.h \ NS-IP.h \ P-TMSI-and-RAI-GSM-MAP.h \ PagingCause.h \ PagingRecord.h \ PagingRecord2-r5.h \ PagingRecordList.h \ PagingRecord2List-r5.h \ PDCP-Capability.h \ PDCP-Capability-r4-ext.h \ PDCP-Capability-r5-ext.h \ PDCP-Capability-r5-ext2.h \ PhysicalChannelCapability.h \ PhysicalChannelCapability-r7.h \ PhysicalChannelCapability-LCR-r4.h \ PhysicalChannelCapability-hspdsch-r5.h \ PNBSCH-Allocation-r4.h \ ProtocolErrorCause.h \ ProtocolErrorIndicator.h \ ProtocolErrorIndicatorWithMoreInfo.h \ ProtocolErrorMoreInformation.h \ RadioFrequencyBandFDD.h \ RadioFrequencyBandFDD2.h \ RadioFrequencyBandTDDList.h \ RadioFrequencyBandTDD.h \ RadioFrequencyBandGSM.h \ Rb-timer-indicator.h \ Re-EstablishmentTimer.h \ RedirectionInfo.h \ RedirectionInfo-r6.h \ RejectionCause.h \ ReleaseCause.h \ RF-Capability.h \ RF-Capability-r4-ext.h \ RF-Capability-r7.h \ RLC-Capability.h \ RLC-Capability-r5-ext.h \ RRC-ConnectionReleaseInformation.h \ RRC-MessageSequenceNumber.h \ RRC-MessageSequenceNumberList.h \ RRC-StateIndicator.h \ RRC-TransactionIdentifier.h \ S-RNTI.h \ S-RNTI-2.h \ SecurityCapability.h \ Serving-HSDSCH-CellInformation.h \ SimultaneousSCCPCH-DPCH-Reception.h \ SRNC-Identity.h \ START-Value.h \ STARTList.h \ STARTSingle.h \ CapabilityUpdateRequirement-r5.h \ SystemSpecificCapUpdateReq.h \ SystemSpecificCapUpdateReq-v590ext.h \ SystemSpecificCapUpdateReq-r5.h \ SystemSpecificCapUpdateReqList.h \ SystemSpecificCapUpdateReqList-r5.h \ T-300.h \ T-301.h \ T-302.h \ T-304.h \ T-305.h \ T-307.h \ T-308.h \ T-309.h \ T-310.h \ T-311.h \ T-312.h \ T-313.h \ T-314.h \ T-315.h \ T-316.h \ T-317.h \ T-318.h \ T-CPCH.h \ TMSI-and-LAI-GSM-MAP.h \ TMSI-DS-41.h \ TotalRLC-AM-BufferSize.h \ TotalRLC-AM-BufferSize-r5-ext.h \ TransmissionProbability.h \ TransportChannelCapability.h \ TurboSupport.h \ TxRxFrequencySeparation.h \ U-RNTI.h \ U-RNTI-Group.h \ U-RNTI-Short.h \ UE-CapabilityContainer-IEs.h \ UE-ConnTimersAndConstants.h \ UE-ConnTimersAndConstants-v3a0ext.h \ UE-ConnTimersAndConstants-r5.h \ UE-IdleTimersAndConstants.h \ UE-IdleTimersAndConstants-v3a0ext.h \ UE-MultiModeRAT-Capability.h \ UE-PowerClass.h \ UE-PowerClassExt.h \ UE-RadioAccessCapability.h \ UE-RadioAccessCapabilityInfo.h \ UE-RadioAccessCapability-v370ext.h \ UE-RadioAccessCapability-v380ext.h \ UE-RadioAccessCapability-v3a0ext.h \ UE-RadioAccessCapability-v3g0ext.h \ UE-RadioAccessCapability-v650ext.h \ UE-RadioAccessCapability-v690ext.h \ UE-RadioAccessCapability-v7xyext.h \ UE-RadioAccessCapabBandFDDList2.h \ UE-RadioAccessCapabBandFDD2.h \ UE-PositioningCapabilityExt-v380.h \ UE-PositioningCapabilityExt-v3a0.h \ UE-PositioningCapabilityExt-v3g0.h \ UE-RadioAccessCapabBandFDDList.h \ UE-RadioAccessCapabBandFDDList-ext.h \ UE-RadioAccessCapabBandFDD.h \ UE-RadioAccessCapabBandFDD-ext.h \ UE-RadioAccessCapability-v4b0ext.h \ UE-RadioAccessCapabilityComp.h \ UE-RadioAccessCapabilityComp-ext.h \ UE-RadioAccessCapabilityComp-r7.h \ UE-RadioAccessCapabilityComp2.h \ RF-CapabilityComp.h \ RF-CapabilityComp-r7.h \ RF-CapabBandFDDComp.h \ RF-CapabBandListFDDComp.h \ RF-CapabBandListFDDComp-ext.h \ UE-RadioAccessCapability-v590ext.h \ UE-RadioAccessCapability-v5c0ext.h \ UE-RadioAccessCapability-v680ext.h \ UL-PhysChCapabilityFDD.h \ UL-PhysChCapabilityFDD-r6.h \ UL-PhysChCapabilityTDD.h \ UL-PhysChCapabilityTDD-LCR-r4.h \ PhysicalChannelCapability-edch-r6.h \ UL-TransChCapability.h \ UE-Positioning-Capability.h \ UE-SecurityInformation.h \ UE-SecurityInformation2.h \ URA-UpdateCause.h \ UTRAN-DRX-CycleLengthCoefficient.h \ WaitTime.h \ AlgorithmSpecificInfo.h \ AlgorithmSpecificInfo-r4.h \ CID-InclusionInfo-r4.h \ COUNT-C.h \ COUNT-C-MSB.h \ DefaultConfigIdentity.h \ DefaultConfigIdentity-r4.h \ DefaultConfigIdentity-r5.h \ DefaultConfigIdentity-r6.h \ DefaultConfigMode.h \ DDI.h \ DL-AM-RLC-Mode.h \ DL-AM-RLC-Mode-r5.h \ DL-CounterSynchronisationInfo.h \ DL-CounterSynchronisationInfo-r5.h \ DL-LogicalChannelMapping.h \ DL-LogicalChannelMapping-r5.h \ DL-LogicalChannelMappingList.h \ DL-LogicalChannelMappingList-r5.h \ DL-Reception-Window-Size-r6.h \ DL-RFC3095-r4.h \ DL-RLC-Mode.h \ DL-RLC-Mode-r5.h \ DL-RLC-Mode-r6.h \ DL-RLC-StatusInfo.h \ DL-TM-RLC-Mode.h \ DL-TransportChannelType.h \ DL-TransportChannelType-r5.h \ DL-UM-RLC-LI-size.h \ DL-UM-RLC-Mode-r5.h \ DL-UM-RLC-Mode-r6.h \ ExpectReordering.h \ ExplicitDiscard.h \ HeaderCompressionInfo.h \ HeaderCompressionInfoList.h \ HeaderCompressionInfo-r4.h \ HeaderCompressionInfoList-r4.h \ LogicalChannelIdentity.h \ LosslessSRNS-RelocSupport.h \ MAC-d-HFN-initial-value.h \ MAC-LogicalChannelPriority.h \ MaxDAT.h \ MaxDAT-Retransmissions.h \ MaxMRW.h \ MaxPDCP-SN-WindowSize.h \ MaxRST.h \ NoExplicitDiscard.h \ PDCP-Info.h \ PDCP-Info-r4.h \ PDCP-InfoReconfig.h \ PDCP-InfoReconfig-r4.h \ PDCP-PDU-Header.h \ PDCP-ROHC-TargetMode.h \ PDCP-SN-Info.h \ Poll-PDU.h \ Poll-SDU.h \ PollingInfo.h \ PollWindow.h \ PredefinedConfigIdentity.h \ PredefinedConfigValueTag.h \ PredefinedRB-Configuration.h \ PreDefRadioConfiguration.h \ PredefinedConfigStatusList.h \ PredefinedConfigStatusInfo.h \ PredefinedConfigStatusListComp.h \ PredefinedConfigSetsWithDifferentValueTag.h \ PredefinedConfigSetWithDifferentValueTag.h \ PredefinedConfigValueTagList.h \ PredefinedConfigStatusListVarSz.h \ RAB-Info.h \ RAB-Info-r6-ext.h \ RAB-Info-r6.h \ RAB-InformationList.h \ RAB-InformationList-r6.h \ RAB-InformationReconfigList.h \ RAB-InformationReconfig.h \ RAB-Info-Post.h \ RAB-InformationSetup.h \ RAB-InformationSetup-r4.h \ RAB-InformationSetup-r5.h \ RAB-InformationSetup-r6-ext.h \ RAB-InformationSetup-r6.h \ RAB-InformationSetupList.h \ RAB-InformationSetupList-r4.h \ RAB-InformationSetupList-r5.h \ RAB-InformationSetupList-r6.h \ RAB-InformationSetupList-r6-ext.h \ RB-ActivationTimeInfo.h \ RB-ActivationTimeInfoList.h \ RB-COUNT-C-Information.h \ RB-COUNT-C-InformationList.h \ RB-COUNT-C-MSB-Information.h \ RB-COUNT-C-MSB-InformationList.h \ RB-Identity.h \ RB-IdentityList.h \ RB-InformationAffected.h \ RB-InformationAffected-r5.h \ RB-InformationAffected-r6.h \ RB-InformationAffectedList.h \ RB-InformationAffectedList-r5.h \ RB-InformationAffectedList-r6.h \ RB-InformationChanged-r6.h \ RB-InformationChangedList-r6.h \ RB-InformationReconfig.h \ RB-InformationReconfig-r4.h \ RB-InformationReconfig-r5.h \ RB-InformationReconfig-r6.h \ RB-InformationReconfigList.h \ RB-InformationReconfigList-r4.h \ RB-InformationReconfigList-r5.h \ RB-InformationReconfigList-r6.h \ RB-InformationReleaseList.h \ RB-InformationSetup.h \ RB-InformationSetup-r4.h \ RB-InformationSetup-r5.h \ RB-InformationSetup-r6.h \ RB-InformationSetupList.h \ RB-InformationSetupList-r4.h \ RB-InformationSetupList-r5.h \ RB-InformationSetupList-r6.h \ RB-MappingInfo.h \ RB-MappingInfo-r5.h \ RB-MappingInfo-r6.h \ RB-MappingOption.h \ RB-MappingOption-r5.h \ RB-MappingOption-r6.h \ RB-PDCPContextRelocation.h \ RB-PDCPContextRelocationList.h \ RB-StopContinue.h \ RB-WithPDCP-Info.h \ RB-WithPDCP-InfoList.h \ ReceivingWindowSize.h \ RFC2507-Info.h \ RFC3095-Info-r4.h \ RLC-Info.h \ RLC-Info-r5.h \ RLC-Info-r6.h \ RLC-Info-MCCH-r6.h \ RLC-Info-MSCH-r6.h \ RLC-Info-MTCH-r6.h \ RLC-InfoChoice.h \ RLC-InfoChoice-r5.h \ RLC-InfoChoice-r6.h \ RLC-PDU-Size.h \ RLC-PDU-SizeList.h \ RLC-SequenceNumber.h \ RLC-SizeInfo.h \ RLC-SizeExplicitList.h \ ROHC-Profile-r4.h \ ROHC-ProfileList-r4.h \ ROHC-PacketSize-r4.h \ ROHC-PacketSizeList-r4.h \ SRB-InformationSetup.h \ SRB-InformationSetup-r5.h \ SRB-InformationSetup-r6.h \ SRB-InformationSetupList.h \ SRB-InformationSetupList-r5.h \ SRB-InformationSetupList-r6.h \ SRB-InformationSetupList2.h \ SRB-InformationSetupList2-r6.h \ TimerDAR-r6.h \ TimerDiscard.h \ TimerEPC.h \ TimerMRW.h \ TimerOSD-r6.h \ TimerPoll.h \ TimerPollPeriodic.h \ TimerPollProhibit.h \ TimerRST.h \ TimerStatusPeriodic.h \ TimerStatusProhibit.h \ TransmissionRLC-Discard.h \ TransmissionWindowSize.h \ UL-AM-RLC-Mode.h \ UL-CounterSynchronisationInfo.h \ UL-LogicalChannelMapping.h \ UL-LogicalChannelMapping-r6.h \ UL-LogicalChannelMappingList.h \ UL-LogicalChannelMappingList-r6.h \ UL-LogicalChannelMappings.h \ UL-LogicalChannelMappings-r6.h \ UL-RFC3095-r4.h \ UL-RLC-Mode.h \ UL-TM-RLC-Mode.h \ UL-UM-RLC-Mode.h \ UL-TransportChannelType.h \ UM-RLC-DuplAvoid-Reord-Info-r6.h \ UM-RLC-OutOSeqDelivery-Info-r6.h \ WindowSizeDAR-r6.h \ WindowSizeOSD-r6.h \ AddOrReconfMAC-dFlow.h \ AllowedTFC-List.h \ AllowedTFI-List.h \ BitModeRLC-SizeInfo.h \ BLER-QualityValue.h \ ChannelCodingType.h \ CodingRate.h \ CommonDynamicTF-Info.h \ CommonDynamicTF-Info-DynamicTTI.h \ CommonDynamicTF-InfoList.h \ CommonDynamicTF-InfoList-DynamicTTI.h \ CommonTransChTFS.h \ CommonTransChTFS-LCR.h \ CPCH-SetID.h \ CRC-Size.h \ DedicatedDynamicTF-Info.h \ DedicatedDynamicTF-Info-DynamicTTI.h \ DedicatedDynamicTF-InfoList.h \ DedicatedDynamicTF-InfoList-DynamicTTI.h \ DedicatedTransChTFS.h \ DL-AddReconfTransChInfo2List.h \ DL-AddReconfTransChInfoList.h \ DL-AddReconfTransChInfoList-r4.h \ DL-AddReconfTransChInfoList-r5.h \ DL-AddReconfTransChInformation.h \ DL-AddReconfTransChInformation-r4.h \ DL-AddReconfTransChInformation-r5.h \ DL-AddReconfTransChInformation2.h \ DL-CommonTransChInfo.h \ DL-CommonTransChInfo-r4.h \ DL-DeletedTransChInfoList.h \ DL-DeletedTransChInfoList-r5.h \ DL-TransportChannelIdentity.h \ DL-TransportChannelIdentity-r5.h \ DL-TrCH-Type.h \ DL-TrCH-TypeId1-r5.h \ DL-TrCH-TypeId2-r5.h \ DRAC-ClassIdentity.h \ DRAC-StaticInformation.h \ DRAC-StaticInformationList.h \ E-DCH-AddReconf-MAC-d-Flow.h \ E-DCH-AddReconf-MAC-d-FlowList.h \ E-DCH-MAC-d-FlowIdentity.h \ E-DCH-MAC-d-FlowMaxRetrans.h \ E-DCH-MAC-d-FlowMultiplexingList.h \ E-DCH-MAC-d-FlowPowerOffset.h \ E-DCH-TTI.h \ ExplicitTFCS-Configuration.h \ GainFactor.h \ GainFactorInformation.h \ HSDSCH-Info.h \ HARQ-Info.h \ HARQMemorySize.h \ IndividualDL-CCTrCH-Info.h \ IndividualDL-CCTrCH-InfoList.h \ IndividualUL-CCTrCH-Info.h \ IndividualUL-CCTrCH-InfoList.h \ LogicalChannelByRB.h \ LogicalChannelList.h \ MAC-d-FlowIdentityDCHandHSDSCH.h \ MAC-d-FlowIdentity.h \ MAC-d-PDU-SizeInfo-List.h \ MAC-d-PDUsizeInfo.h \ MAC-hs-AddReconfQueue-List.h \ MAC-hs-AddReconfQueue.h \ MAC-hs-DelQueue-List.h \ MAC-hs-DelQueue.h \ MAC-hs-WindowSize.h \ NumberOfTbSizeAndTTIList.h \ MessType.h \ Non-allowedTFC-List.h \ NumberOfTransportBlocks.h \ OctetModeRLC-SizeInfoType1.h \ OctetModeRLC-SizeInfoType2.h \ PowerOffsetInfoShort.h \ PowerOffsetInformation.h \ PowerOffsetPp-m.h \ PreDefTransChConfiguration.h \ QualityTarget.h \ RateMatchingAttribute.h \ ReferenceTFC-ID.h \ RestrictedTrChInfo.h \ RestrictedTrChInfoList.h \ SemistaticTF-Information.h \ SignalledGainFactors.h \ SplitTFCI-Signalling.h \ SplitType.h \ T1-ReleaseTimer.h \ TFC-Subset.h \ TFC-SubsetList.h \ TFC-Value.h \ TFCI-Field2-Information.h \ TFCI-Range.h \ TFCI-RangeList.h \ TFCS.h \ TFCS-Identity.h \ TFCS-IdentityPlain.h \ TFCS-InfoForDSCH.h \ TFCS-ReconfAdd.h \ TFCS-Removal.h \ TFCS-RemovalList.h \ TimeDurationBeforeRetry.h \ TM-SignallingInfo.h \ TransmissionTimeInterval.h \ TransmissionTimeValidity.h \ TransportChannelIdentity.h \ TransportChannelIdentityDCHandDSCH.h \ TransportFormatSet.h \ TransportFormatSet-LCR.h \ UL-AddReconfTransChInfoList.h \ UL-AddReconfTransChInfoList-r6.h \ UL-AddReconfTransChInformation.h \ UL-AddReconfTransChInformation-r6.h \ UL-CommonTransChInfo.h \ UL-CommonTransChInfo-r4.h \ UL-ControlledTrChList.h \ UL-DeletedTransChInfoList.h \ UL-DeletedTransChInfoList-r6.h \ UL-TransportChannelIdentity.h \ UL-TransportChannelIdentity-r6.h \ UL-TrCH-Type.h \ USCH-TransportChannelsInfo.h \ ACK-NACK-repetitionFactor.h \ AC-To-ASC-Mapping.h \ AC-To-ASC-MappingTable.h \ AccessServiceClass-FDD.h \ AccessServiceClass-TDD.h \ AccessServiceClass-TDD-r7.h \ AccessServiceClass-TDD-LCR-r4.h \ AdditionalPRACH-TF-and-TFCS-CCCH-IEs.h \ AdditionalPRACH-TF-and-TFCS-CCCH.h \ AdditionalPRACH-TF-and-TFCS-CCCH-List.h \ AICH-Info.h \ AICH-PowerOffset.h \ AICH-TransmissionTiming.h \ AllocationPeriodInfo.h \ Alpha.h \ AP-AICH-ChannelisationCode.h \ AP-PreambleScramblingCode.h \ AP-Signature.h \ AP-Signature-VCAM.h \ AP-Subchannel.h \ ASCSetting-FDD.h \ ASCSetting-TDD.h \ ASCSetting-TDD-r7.h \ ASCSetting-TDD-LCR-r4.h \ AvailableAP-Signature-VCAMList.h \ AvailableAP-SignatureList.h \ AvailableAP-SubchannelList.h \ AvailableMinimumSF-ListVCAM.h \ AvailableMinimumSF-VCAM.h \ AvailableSignatures.h \ AvailableSubChannelNumbers.h \ BEACON-PL-Est.h \ BurstType.h \ Bler-Target.h \ CCTrCH-PowerControlInfo.h \ CCTrCH-PowerControlInfo-r4.h \ CCTrCH-PowerControlInfo-r5.h \ CCTrCH-PowerControlInfo-r7.h \ CD-AccessSlotSubchannel.h \ CD-AccessSlotSubchannelList.h \ CD-CA-ICH-ChannelisationCode.h \ CD-PreambleScramblingCode.h \ CD-SignatureCode.h \ CD-SignatureCodeList.h \ CellAndChannelIdentity.h \ CellParametersID.h \ Cfntargetsfnframeoffset.h \ ChannelAssignmentActive.h \ ChannelisationCode256.h \ ChannelReqParamsForUCSM.h \ ClosedLoopTimingAdjMode.h \ CodeNumberDSCH.h \ CodeRange.h \ CodeWordSet.h \ CommonTimeslotInfo.h \ CommonTimeslotInfoSCCPCH.h \ ConstantValue.h \ ConstantValueTdd.h \ CPCH-PersistenceLevels.h \ CPCH-PersistenceLevelsList.h \ CPCH-SetInfo.h \ CPCH-SetInfoList.h \ CPCH-StatusIndicationMode.h \ CQI-RepetitionFactor.h \ CSICH-PowerOffset.h \ DefaultDPCH-OffsetValueFDD.h \ DefaultDPCH-OffsetValueTDD.h \ DeltaPp-m.h \ DeltaCQI.h \ DeltaNACK.h \ DeltaACK.h \ DeltaSIR.h \ DHS-Sync.h \ DL-CCTrCh.h \ DL-CCTrCh-r4.h \ DL-CCTrCh-r7.h \ DL-CCTrChList.h \ DL-CCTrChList-r7.h \ DL-CCTrChList-r4.h \ DL-CCTrChListToRemove.h \ DL-CCTrChTPCList.h \ DL-ChannelisationCode.h \ DL-ChannelisationCodeList.h \ DL-CommonInformation.h \ DL-CommonInformation-r4.h \ DL-CommonInformation-r5.h \ DL-CommonInformation-r6.h \ DL-CommonInformation-r7.h \ DL-CommonInformationPost.h \ DL-CommonInformationPredef.h \ DL-CompressedModeMethod.h \ DL-DPCH-InfoCommon.h \ DL-DPCH-InfoCommon-r4.h \ DL-DPCH-InfoCommon-r6.h \ DL-DPCH-InfoCommonPost.h \ DL-DPCH-InfoCommonPredef.h \ DL-DPCH-InfoPerRL.h \ DL-DPCH-InfoPerRL-r4.h \ DL-DPCH-InfoPerRL-r5.h \ DL-DPCH-InfoPerRL-r6.h \ DL-DPCH-InfoPerRL-r7.h \ DL-FDPCH-InfoPerRL-r6.h \ DL-DPCH-InfoPerRL-PostFDD.h \ DL-DPCH-InfoPerRL-PostTDD.h \ DL-DPCH-InfoPerRL-PostTDD-LCR-r4.h \ DL-DPCH-PowerControlInfo.h \ DL-FDPCH-InfoCommon-r6.h \ DL-FrameType.h \ DL-HSPDSCH-Information.h \ DL-HSPDSCH-Information-r6.h \ DL-HSPDSCH-Information-r7.h \ DL-HSPDSCH-TS-Configuration.h \ DL-HSPDSCH-TS-Configuration-VHCR.h \ DL-InformationPerRL.h \ DL-InformationPerRL-r4.h \ DL-InformationPerRL-r5.h \ DL-InformationPerRL-r5bis.h \ DL-InformationPerRL-r6.h \ DL-InformationPerRL-r7.h \ DL-InformationPerRL-List.h \ DL-InformationPerRL-List-r4.h \ DL-InformationPerRL-List-r5.h \ DL-InformationPerRL-List-r6.h \ DL-InformationPerRL-List-r5bis.h \ DL-InformationPerRL-List-r7.h \ DL-InformationPerRL-ListPostFDD.h \ DL-InformationPerRL-PostFDD.h \ DL-InformationPerRL-PostTDD.h \ DL-InformationPerRL-PostTDD-LCR-r4.h \ DL-PDSCH-Information.h \ Dl-rate-matching-restriction.h \ DL-TPC-PowerOffsetPerRL.h \ DL-TPC-PowerOffsetPerRL-List.h \ DL-TS-ChannelisationCode.h \ DL-TS-ChannelisationCode-VHCR.h \ DL-TS-ChannelisationCodesShort.h \ DL-TS-ChannelisationCodesShort-VHCR.h \ DownlinkAdditionalTimeslots.h \ DownlinkAdditionalTimeslots-VHCR.h \ DownlinkAdditionalTimeslots-LCR-r4.h \ DownlinkTimeslotsCodes.h \ DownlinkTimeslotsCodes-VHCR.h \ DownlinkTimeslotsCodes-LCR-r4.h \ DPC-Mode.h \ DPCCH-PowerOffset.h \ DPCCH-PowerOffset2.h \ DPCH-CompressedModeInfo.h \ DPCH-CompressedModeStatusInfo.h \ DPCH-FrameOffset.h \ DSCH-Mapping.h \ DSCH-MappingList.h \ DSCH-RadioLinkIdentifier.h \ DSCH-TransportChannelsInfo.h \ DurationTimeInfo.h \ DynamicPersistenceLevel.h \ DynamicPersistenceLevelList.h \ DynamicPersistenceLevelTF-List.h \ DynamicTFInformationCCCH.h \ E-AGCH-ChannelisationCode.h \ E-AGCH-Information.h \ E-DCH-MinimumSet-E-TFCI.h \ E-DCH-ReconfigurationInfo.h \ E-DCH-RL-InfoNewServingCell.h \ E-DCH-RL-InfoOtherCell.h \ E-DPCCH-Info.h \ E-DPCCH-DPCCH-PowerOffset.h \ E-DPDCH-Info.h \ E-DPDCH-PeriodicyOfSchedInfo.h \ E-DPDCH-PL-NonMax.h \ E-DPDCH-Reference-E-TFCI.h \ E-DPDCH-Reference-E-TFCIList.h \ E-DPDCH-SchedulingInfoConfiguration.h \ E-DPDCH-SchedulingTransmConfiguration.h \ E-DPDCH-MaxChannelisationCodes.h \ E-HICH-ChannelisationCode.h \ E-HICH-Information.h \ E-HICH-RGCH-SignatureSequence.h \ E-RGCH-CombinationIndex.h \ E-RGCH-Information.h \ E-TFCI-TableIndex.h \ EXT-UL-TimingAdvance.h \ FACH-PCH-Information.h \ FACH-PCH-InformationList.h \ Feedback-cycle.h \ FPACH-Info-r4.h \ FrequencyInfo.h \ FrequencyInfoFDD.h \ FrequencyInfoTDD.h \ HappyBit-DelayCondition.h \ HARQ-Preamble-Mode.h \ HS-ChannelisationCode-LCR.h \ HS-PDSCH-Midamble-Configuration-TDD128.h \ HS-SCCH-Info.h \ HS-SCCH-Info-r6.h \ HS-SCCH-Info-r7.h \ HS-SCCH-Codes.h \ HS-SCCH-TDD128.h \ HS-SICH-Configuration-TDD128.h \ HS-SCCH-TDD384.h \ HS-SCCH-TDD384-r6.h \ HS-SCCH-TDD768.h \ HS-SICH-Configuration-TDD384.h \ HS-SICH-Configuration-TDD768.h \ HS-SICH-Power-Control-Info-TDD384.h \ HS-SICH-Power-Control-Info-TDD768.h \ IndividualTimeslotInfo.h \ IndividualTimeslotInfo-VHCR.h \ IndividualTimeslotInfo-LCR-r4.h \ IndividualTimeslotInfo-LCR-r4-ext.h \ IndividualTS-Interference.h \ IndividualTS-InterferenceList.h \ ITP.h \ NidentifyAbort.h \ MaxAllowedUL-TX-Power.h \ MaxAvailablePCPCH-Number.h \ MaxPowerIncrease-r4.h \ MaxTFCI-Field2Value.h \ Measurement-Feedback-Info.h \ MidambleConfigurationBurstType1and3.h \ MidambleConfigurationBurstType2.h \ MidambleConfigurationBurstType2-VHCR.h \ MidambleShiftAndBurstType.h \ MidambleShiftAndBurstType-VHCR.h \ MidambleShiftAndBurstType-DL.h \ MidambleShiftAndBurstType-DL-VHCR.h \ MidambleShiftAndBurstType-LCR-r4.h \ MidambleShiftLong.h \ MidambleShiftShort.h \ MidambleShiftShort-VHCR.h \ MinimumSpreadingFactor.h \ MultiCodeInfo.h \ N-EOT.h \ N-GAP.h \ N-PCH.h \ N-StartMessage.h \ NB01.h \ NF-Max.h \ NumberOfDPDCH.h \ NumberOfFBI-Bits.h \ OpenLoopPowerControl-TDD.h \ OpenLoopPowerControl-IPDL-TDD-r4.h \ PagingIndicatorLength.h \ PC-Preamble.h \ PCP-Length.h \ PCPCH-ChannelInfo.h \ PCPCH-ChannelInfoList.h \ PCPICH-UsageForChannelEst.h \ PDSCH-CapacityAllocationInfo.h \ PDSCH-CapacityAllocationInfo-r4.h \ PDSCH-CapacityAllocationInfo-r7.h \ PDSCH-CodeInfo.h \ PDSCH-CodeInfoList.h \ PDSCH-CodeMap.h \ PDSCH-CodeMapList.h \ PDSCH-CodeMapping.h \ PDSCH-Identity.h \ PDSCH-Info.h \ PDSCH-Info-r4.h \ PDSCH-Info-r7.h \ PDSCH-Info-LCR-r4.h \ PDSCH-PowerControlInfo.h \ PDSCH-SHO-DCH-Info.h \ PDSCH-SysInfo.h \ PDSCH-SysInfo-r7.h \ PDSCH-SysInfo-HCR-r5.h \ PDSCH-SysInfo-LCR-r4.h \ PDSCH-SysInfoList.h \ PDSCH-SysInfoList-r7.h \ PDSCH-SysInfoList-HCR-r5.h \ PDSCH-SysInfoList-LCR-r4.h \ PDSCH-SysInfoList-SFN.h \ PDSCH-SysInfoList-SFN-HCR-r5.h \ PDSCH-SysInfoList-SFN-LCR-r4.h \ PersistenceScalingFactor.h \ PersistenceScalingFactorList.h \ PI-CountPerFrame.h \ PichChannelisationCodeList-LCR-r4.h \ PICH-Info.h \ PICH-Info-r7.h \ PICH-Info-LCR-r4.h \ PICH-PowerOffset.h \ PilotBits128.h \ PilotBits256.h \ MeasurementPowerOffset.h \ PLCCH-Info.h \ PositionFixedOrFlexible.h \ PowerControlAlgorithm.h \ PowerOffsetPilot-pdpdch.h \ PowerOffsetTPC-pdpdch.h \ PowerRampStep.h \ PRACH-ChanCodes-LCR-r4.h \ PRACH-Definition-LCR-r4.h \ PRACH-Midamble.h \ PRACH-Partitioning.h \ PRACH-Partitioning-r7.h \ PRACH-Partitioning-LCR-r4.h \ PRACH-PowerOffset.h \ PRACH-RACH-Info.h \ PRACH-RACH-Info-r7.h \ PRACH-RACH-Info-LCR-r4.h \ PRACH-SystemInformation.h \ PRACH-SystemInformation-r7.h \ PRACH-SystemInformation-LCR-r4.h \ PRACH-SystemInformationList.h \ PRACH-SystemInformationList-r7.h \ PRACH-SystemInformationList-LCR-r4.h \ PreambleRetransMax.h \ PreambleScramblingCodeWordNumber.h \ PreDefPhyChConfiguration.h \ PrimaryCCPCH-Info.h \ PrimaryCCPCH-Info-r4.h \ PrimaryCCPCH-Info-r7.h \ PrimaryCCPCH-Info-LCR-r4.h \ PrimaryCCPCH-Info-LCR-r4-ext.h \ PrimaryCCPCH-InfoPost.h \ PrimaryCCPCH-InfoPostTDD-LCR-r4.h \ PrimaryCCPCH-TX-Power.h \ PrimaryCPICH-Info.h \ PrimaryCPICH-TX-Power.h \ PrimaryScramblingCode.h \ PuncturingLimit.h \ PUSCH-CapacityAllocationInfo.h \ PUSCH-CapacityAllocationInfo-r4.h \ PUSCH-CapacityAllocationInfo-r7.h \ PUSCH-Identity.h \ PUSCH-Info.h \ PUSCH-Info-r4.h \ PUSCH-Info-VHCR.h \ PUSCH-Info-LCR-r4.h \ PUSCH-PowerControlInfo-r4.h \ PUSCH-PowerControlInfo-r7.h \ PUSCH-SysInfo.h \ PUSCH-SysInfo-VHCR.h \ PUSCH-SysInfo-HCR-r5.h \ PUSCH-SysInfo-LCR-r4.h \ PUSCH-SysInfoList.h \ PUSCH-SysInfoList-HCR-r5.h \ PUSCH-SysInfoList-LCR-r4.h \ PUSCH-SysInfoList-SFN.h \ PUSCH-SysInfoList-SFN-HCR-r5.h \ PUSCH-SysInfoList-SFN-LCR-r4.h \ PUSCH-SysInfoList-SFN-VHCR.h \ RACH-TransmissionParameters.h \ ReducedScramblingCodeNumber.h \ RepetitionPeriodAndLength.h \ RepetitionPeriodLengthAndOffset.h \ ReplacedPDSCH-CodeInfo.h \ ReplacedPDSCH-CodeInfoList.h \ RepPerLengthOffset-PICH.h \ RepPerLengthOffset-MICH.h \ RestrictedTrCH.h \ RestrictedTrCH-InfoList.h \ RL-AdditionInformation.h \ RL-AdditionInformation-r6.h \ RL-AdditionInformationList.h \ RL-AdditionInformationList-r6.h \ RL-IdentifierList.h \ RL-RemovalInformationList.h \ RPP.h \ S-Field.h \ SCCPCH-ChannelisationCode.h \ SCCPCH-ChannelisationCode-VHCR.h \ SCCPCH-ChannelisationCodeList.h \ SCCPCH-ChannelisationCodeList-VHCR.h \ SCCPCH-InfoForFACH.h \ SCCPCH-InfoForFACH-r4.h \ SCCPCH-SystemInformation.h \ SCCPCH-SystemInformation-LCR-r4-ext.h \ SCCPCH-SystemInformation-r7.h \ SCCPCH-SystemInformationList.h \ SCCPCH-SystemInformationList-r7.h \ SCCPCH-SystemInformationList-LCR-r4-ext.h \ SCCPCH-SystemInformation-MBMS-r6.h \ SCCPCH-SystemInformation-MBMS-r7.h \ ScramblingCodeChange.h \ ScramblingCodeType.h \ SecondaryCCPCH-Info.h \ SecondaryCCPCH-Info-r4.h \ SecondaryCCPCH-Info-r7.h \ SecondaryCCPCH-Info-LCR-r4-ext.h \ SecondaryCCPCHInfo-MBMS-r6.h \ SecondaryCCPCHInfo-MBMS-r7.h \ SecondaryCPICH-Info.h \ SecondaryScramblingCode.h \ SecondInterleavingMode.h \ SF256-AndCodeNumber.h \ SF512-AndCodeNumber.h \ SF512-AndPilot.h \ SF-PDSCH.h \ SF-PRACH.h \ SFN-TimeInfo.h \ SpecialBurstScheduling.h \ SpreadingFactor.h \ SRB-delay.h \ SSDT-CellIdentity.h \ SSDT-Information.h \ SSDT-Information-r4.h \ SSDT-UL.h \ SynchronisationParameters-r4.h \ SYNC-UL-Procedure-r4.h \ SYNC-UL-Info-r4.h \ TDD-FPACH-CCode16-r4.h \ TDD-UL-Interference.h \ TDD-PICH-CCode.h \ TDD768-PICH-CCode.h \ TDD-PRACH-CCode8.h \ TDD-PRACH-CCode16.h \ TDD-PRACH-CCode-LCR-r4.h \ TDD-PRACH-CCodeList.h \ TDD768-PRACH-CCode8.h \ TDD768-PRACH-CCode16.h \ TDD768-PRACH-CCode32.h \ TDD768-PRACH-CCodeList.h \ TFC-ControlDuration.h \ TFCI-Coding.h \ TGCFN.h \ TGD.h \ TGL.h \ TGMP.h \ TGP-Sequence.h \ TGPS-Reconfiguration-CFN.h \ TGP-SequenceList.h \ TGP-SequenceShort.h \ TGPL.h \ TGPRC.h \ TGPS-ConfigurationParams.h \ TGPSI.h \ TGSN.h \ TimeInfo.h \ TimeslotList.h \ TimeslotList-r4.h \ TimeslotNumber.h \ TimeslotNumber-LCR-r4.h \ TimeslotNumber-PRACH-LCR-r4.h \ TimeslotSync2.h \ TimingOffset.h \ TimingMaintainedSynchInd.h \ TPC-CombinationIndex.h \ TPC-CommandTargetRate.h \ TPC-StepSizeFDD.h \ TPC-StepSizeTDD.h \ TreconfirmAbort.h \ TX-DiversityMode.h \ UARFCN.h \ UCSM-Info.h \ UL-CCTrCH.h \ UL-CCTrCH-r4.h \ UL-CCTrCH-r7.h \ UL-CCTrCHList.h \ UL-CCTrCHList-r4.h \ UL-CCTrCHList-r7.h \ UL-CCTrCHListToRemove.h \ UL-CCTrChTPCList.h \ UL-ChannelRequirement.h \ UL-ChannelRequirement-r4.h \ UL-ChannelRequirement-r5.h \ UL-ChannelRequirementWithCPCH-SetID.h \ UL-ChannelRequirementWithCPCH-SetID-r4.h \ UL-ChannelRequirementWithCPCH-SetID-r5.h \ UL-CompressedModeMethod.h \ UL-DL-Mode.h \ UL-DPCCH-SlotFormat.h \ UL-DPCH-Info.h \ UL-DPCH-Info-r4.h \ UL-DPCH-Info-r5.h \ UL-DPCH-Info-r6.h \ UL-DPCH-Info-r7.h \ UL-DPCH-InfoPostFDD.h \ UL-DPCH-InfoPostTDD.h \ UL-DPCH-InfoPostTDD-LCR-r4.h \ UL-DPCH-InfoPredef.h \ UL-DPCH-PowerControlInfo.h \ UL-DPCH-PowerControlInfo-r4.h \ UL-DPCH-PowerControlInfo-r5.h \ UL-DPCH-PowerControlInfo-r6.h \ UL-DPCH-PowerControlInfo-r7.h \ UL-DPCH-PowerControlInfoPostFDD.h \ UL-DPCH-PowerControlInfoPostTDD.h \ UL-DPCH-PowerControlInfoPostTDD-LCR-r4.h \ UL-DPCH-PowerControlInfoPredef.h \ UL-EDCH-Information-r6.h \ UL-Interference.h \ UL-ScramblingCode.h \ UL-SynchronisationParameters-r4.h \ UL-TargetSIR.h \ UL-TimingAdvance.h \ UL-TimingAdvance-VHCR.h \ UL-TimingAdvanceControl.h \ UL-TimingAdvanceControl-r4.h \ UL-TimingAdvanceControl-r7.h \ UL-TimingAdvanceControl-LCR-r4.h \ UL-TS-ChannelisationCode.h \ UL-TS-ChannelisationCodeList.h \ UL-TS-ChannelisationCodeList-r7.h \ UL-TS-ChannelisationCode-VHCR.h \ UL-TS-ChannelisationCodeList-VHCR.h \ UplinkAdditionalTimeslots.h \ UplinkAdditionalTimeslots-LCR-r4.h \ UplinkAdditionalTimeslots-LCR-r7.h \ UplinkTimeslotsCodes.h \ UplinkTimeslotsCodes-VHCR.h \ UplinkTimeslotsCodes-LCR-r4.h \ UplinkTimeslotsCodes-LCR-r7.h \ Wi-LCR.h \ AcquisitionSatInfo.h \ AcquisitionSatInfoList.h \ AdditionalMeasurementID-List.h \ AlmanacSatInfo.h \ AlmanacSatInfoList.h \ AverageRLC-BufferPayload.h \ AzimuthAndElevation.h \ BadSatList.h \ Frequency-Band.h \ BCCH-ARFCN.h \ BLER-MeasurementResults.h \ BLER-MeasurementResultsList.h \ BLER-TransChIdList.h \ BSIC-VerificationRequired.h \ BSICReported.h \ BurstModeParameters.h \ CellDCH-ReportCriteria.h \ CellDCH-ReportCriteria-LCR-r4.h \ CellIndividualOffset.h \ CellInfo.h \ CellInfo-r4.h \ CellInfoSI-RSCP.h \ CellInfoSI-RSCP-LCR-r4.h \ CellInfoSI-ECN0.h \ CellInfoSI-ECN0-LCR-r4.h \ CellInfoSI-HCS-RSCP.h \ CellInfoSI-HCS-RSCP-LCR-r4.h \ CellInfoSI-HCS-ECN0.h \ CellInfoSI-HCS-ECN0-LCR-r4.h \ CellMeasuredResults.h \ CellMeasurementEventResults.h \ CellMeasurementEventResults-LCR-r4.h \ CellReportingQuantities.h \ CellSelectReselectInfoSIB-11-12.h \ CellSelectReselectInfoSIB-11-12-RSCP.h \ CellSelectReselectInfoSIB-11-12-ECN0.h \ CellSelectReselectInfoSIB-11-12-HCS-RSCP.h \ CellSelectReselectInfoSIB-11-12-HCS-ECN0.h \ CellSelectReselectInfo-v590ext.h \ CellSelectReselectInfoPCHFACH-v5b0ext.h \ CellSelectReselectInfoTreselectionScaling-v5c0ext.h \ CellsForInterFreqMeasList.h \ CellsForInterRATMeasList.h \ CellsForIntraFreqMeasList.h \ CellSynchronisationInfo.h \ CellToReport.h \ CellToReportList.h \ CodePhaseSearchWindow.h \ CountC-SFN-Frame-difference.h \ CPICH-Ec-N0.h \ CPICH-RSCP.h \ DeltaPRC.h \ DeltaQrxlevmin.h \ DeltaRSCP.h \ DeltaRSCPPerCell.h \ DeltaRRC.h \ DGPS-CorrectionSatInfo.h \ DGPS-CorrectionSatInfoList.h \ DiffCorrectionStatus.h \ DL-TransportChannelBLER.h \ DopplerUncertainty.h \ EllipsoidPoint.h \ EllipsoidPointAltitude.h \ EllipsoidPointAltitudeEllipsoide.h \ EllipsoidPointUncertCircle.h \ EllipsoidPointUncertEllipse.h \ EnvironmentCharacterisation.h \ Event1a.h \ Event1a-r4.h \ Event1a-LCR-r4.h \ Event1b.h \ Event1b-r4.h \ Event1b-LCR-r4.h \ Event1c.h \ Event1d.h \ Event1e.h \ Event1e-r6.h \ Event1f.h \ Event1f-r6.h \ Event1j-r6.h \ Event2a.h \ Event2a-r6.h \ Event2b.h \ Event2b-r6.h \ Event2c.h \ Event2c-r6.h \ Event2d.h \ Event2d-r6.h \ Event2e.h \ Event2e-r6.h \ Event2f.h \ Event2f-r6.h \ Event3a.h \ Event3b.h \ Event3c.h \ Event3d.h \ EventIDInterFreq.h \ EventIDInterRAT.h \ EventIDIntraFreq.h \ EventResults.h \ ExtraDopplerInfo.h \ FACH-MeasurementOccasionInfo.h \ FACH-MeasurementOccasionInfo-LCR-r4-ext.h \ FilterCoefficient.h \ FineSFN-SFN.h \ ForbiddenAffectCell.h \ ForbiddenAffectCell-r4.h \ ForbiddenAffectCell-LCR-r4.h \ ForbiddenAffectCellList.h \ ForbiddenAffectCellList-r4.h \ ForbiddenAffectCellList-LCR-r4.h \ FreqQualityEstimateQuantity-FDD.h \ FreqQualityEstimateQuantity-TDD.h \ GPS-MeasurementParam.h \ GPS-MeasurementParamList.h \ GSM-CarrierRSSI.h \ GSM-MeasuredResults.h \ GSM-MeasuredResultsList.h \ GPS-TOW-1msec.h \ GPS-TOW-Assist.h \ GPS-TOW-AssistList.h \ HCS-CellReselectInformation-RSCP.h \ HCS-CellReselectInformation-ECN0.h \ HCS-NeighbouringCellInformation-RSCP.h \ HCS-NeighbouringCellInformation-ECN0.h \ HCS-PRIO.h \ HCS-ServingCellInformation.h \ HorizontalVelocity.h \ HorizontalWithVerticalVelocity.h \ HorizontalVelocityWithUncertainty.h \ HorizontalWithVerticalVelocityAndUncertainty.h \ Hysteresis.h \ HysteresisInterFreq.h \ InterFreqCell.h \ InterFreqCell-LCR-r4.h \ InterFreqCellID.h \ InterFreqCellInfoList.h \ InterFreqCellInfoList-r4.h \ InterFreqCellInfoSI-List-RSCP.h \ InterFreqCellInfoSI-List-ECN0.h \ InterFreqCellInfoSI-List-HCS-RSCP.h \ InterFreqCellInfoSI-List-HCS-ECN0.h \ InterFreqCellInfoSI-List-RSCP-LCR.h \ InterFreqCellInfoSI-List-ECN0-LCR.h \ InterFreqCellInfoSI-List-HCS-RSCP-LCR.h \ InterFreqCellInfoSI-List-HCS-ECN0-LCR.h \ InterFreqCellList.h \ InterFreqCellList-LCR-r4-ext.h \ InterFreqCellMeasuredResultsList.h \ InterFreqEvent.h \ InterFreqEvent-r6.h \ InterFreqEventList.h \ InterFreqEventList-r6.h \ InterFrequencyMeasuredResultsList-v590ext.h \ Inter-FreqEventCriteria-v590ext.h \ Inter-FreqEventCriteriaList-v590ext.h \ Intra-FreqEventCriteriaList-v590ext.h \ IntraFrequencyMeasuredResultsList-v590ext.h \ IntraFreqReportingCriteria-1b-r5.h \ PeriodicReportingInfo-1b.h \ InterFreqEventResults.h \ InterFreqEventResults-LCR-r4-ext.h \ InterFreqMeasQuantity.h \ InterFreqMeasuredResults.h \ InterFreqMeasuredResultsList.h \ InterFreqMeasurementSysInfo-RSCP.h \ InterFreqMeasurementSysInfo-ECN0.h \ InterFreqMeasurementSysInfo-HCS-RSCP.h \ InterFreqMeasurementSysInfo-HCS-ECN0.h \ InterFreqMeasurementSysInfo-RSCP-LCR-r4.h \ InterFreqMeasurementSysInfo-ECN0-LCR-r4.h \ InterFreqMeasurementSysInfo-HCS-RSCP-LCR-r4.h \ InterFreqMeasurementSysInfo-HCS-ECN0-LCR-r4.h \ InterFreqRACHRepCellsList.h \ InterFreqRACHReportingInfo.h \ InterFreqReportCriteria.h \ InterFreqReportCriteria-r4.h \ InterFreqReportCriteria-r6.h \ InterFreqReportingCriteria.h \ InterFreqReportingCriteria-r6.h \ InterFreqReportingQuantity.h \ InterFreqRepQuantityRACH-FDD.h \ InterFreqRepQuantityRACH-TDD.h \ InterFreqRepQuantityRACH-TDDList.h \ InterFrequencyMeasurement.h \ InterFrequencyMeasurement-r4.h \ InterFrequencyMeasurement-r6.h \ InterRAT-TargetCellDescription.h \ InterRATCellID.h \ InterRATCellInfoIndication.h \ InterRATCellInfoList.h \ InterRATCellInfoList-B.h \ InterRATCellInfoList-r4.h \ InterRATCellInfoList-r6.h \ InterRATCellIndividualOffset.h \ InterRATEvent.h \ InterRATEventList.h \ InterRATEventResults.h \ InterRATInfo.h \ InterRATInfo-r6.h \ InterRATMeasQuantity.h \ InterRATMeasuredResults.h \ InterRATMeasuredResultsList.h \ InterRATMeasurement.h \ InterRATMeasurement-r4.h \ InterRATMeasurement-r6.h \ InterRATMeasurementSysInfo.h \ InterRATMeasurementSysInfo-B.h \ InterRATReportCriteria.h \ InterRATReportingCriteria.h \ InterRATReportingQuantity.h \ IntraFreqCellID.h \ IntraFreqCellInfoList.h \ IntraFreqCellInfoList-r4.h \ IntraFreqCellInfoSI-List-RSCP.h \ IntraFreqCellInfoSI-List-ECN0.h \ IntraFreqCellInfoSI-List-HCS-RSCP.h \ IntraFreqCellInfoSI-List-HCS-ECN0.h \ IntraFreqCellInfoSI-List-RSCP-LCR-r4.h \ IntraFreqCellInfoSI-List-ECN0-LCR-r4.h \ IntraFreqCellInfoSI-List-HCS-RSCP-LCR-r4.h \ IntraFreqCellInfoSI-List-HCS-ECN0-LCR-r4.h \ IntraFreqEvent.h \ IntraFreqEvent-r4.h \ IntraFreqEvent-LCR-r4.h \ IntraFreqEvent-r6.h \ IntraFreqEvent-1d-r5.h \ IntraFreqEventCriteria.h \ IntraFreqEventCriteria-r4.h \ IntraFreqEventCriteria-LCR-r4.h \ IntraFreqEventCriteria-r6.h \ IntraFreqEventCriteriaList.h \ IntraFreqEventCriteriaList-r4.h \ IntraFreqEventCriteriaList-LCR-r4.h \ IntraFreqEventCriteriaList-r6.h \ IntraFreqEventResults.h \ IntraFreqMeasQuantity.h \ IntraFreqMeasQuantity-FDD.h \ IntraFreqMeasQuantity-TDD.h \ IntraFreqMeasQuantity-TDDList.h \ IntraFreqMeasuredResultsList.h \ IntraFreqMeasurementSysInfo-RSCP.h \ IntraFreqMeasurementSysInfo-ECN0.h \ IntraFreqMeasurementSysInfo-HCS-RSCP.h \ IntraFreqMeasurementSysInfo-HCS-ECN0.h \ IntraFreqMeasurementSysInfo-RSCP-LCR-r4.h \ IntraFreqMeasurementSysInfo-ECN0-LCR-r4.h \ IntraFreqMeasurementSysInfo-HCS-RSCP-LCR-r4.h \ IntraFreqMeasurementSysInfo-HCS-ECN0-LCR-r4.h \ IntraFreqReportCriteria.h \ IntraFreqReportCriteria-r4.h \ IntraFreqReportCriteria-r6.h \ IntraFreqReportingCriteria.h \ IntraFreqReportingCriteria-r4.h \ IntraFreqReportingCriteria-LCR-r4.h \ IntraFreqReportingCriteria-r6.h \ IntraFreqReportingQuantity.h \ IntraFreqReportingQuantityForRACH.h \ IntraFreqRepQuantityRACH-FDD.h \ IntraFreqRepQuantityRACH-TDD.h \ IntraFreqRepQuantityRACH-TDDList.h \ IntraFrequencyMeasurement.h \ IntraFrequencyMeasurement-r4.h \ IntraFrequencyMeasurement-r6.h \ IODE.h \ IP-Length.h \ IP-PCCPCH-r4.h \ IP-Spacing.h \ IP-Spacing-TDD.h \ IS-2000SpecificMeasInfo.h \ MaxNumberOfReportingCellsType1.h \ MaxNumberOfReportingCellsType2.h \ MaxNumberOfReportingCellsType3.h \ MaxReportedCellsOnRACH.h \ MaxReportedCellsOnRACHinterFreq.h \ MeasuredResults.h \ MeasuredResults-v390ext.h \ MeasuredResults-v590ext.h \ MeasuredResults-v7xyext.h \ MeasuredResults-LCR-r4.h \ MeasuredResultsList.h \ MeasuredResultsList-LCR-r4-ext.h \ MeasuredResultsOnRACH.h \ MeasuredResultsOnRACHinterFreq.h \ MeasurementCommand.h \ MeasurementCommand-r4.h \ MeasurementCommand-r6.h \ MeasurementControlSysInfo.h \ MeasurementControlSysInfo-LCR-r4-ext.h \ MeasurementIdentity.h \ MeasurementQuantityGSM.h \ MeasurementReportingMode.h \ MeasurementType.h \ MeasurementType-r4.h \ MeasurementType-r6.h \ MeasurementValidity.h \ MonitoredCellRACH-List.h \ MonitoredCellRACH-Result.h \ MultipathIndicator.h \ N-CR-T-CRMaxHyst.h \ NavigationModelSatInfo.h \ NavigationModelSatInfoList.h \ EphemerisParameter.h \ NC-Mode.h \ Neighbour.h \ Neighbour-v390ext.h \ NeighbourList.h \ NeighbourList-v390ext.h \ NeighbourQuality.h \ NewInterFreqCell.h \ NewInterFreqCell-r4.h \ NewInterFreqCellList.h \ NewInterFreqCellList-r4.h \ NewInterFreqCellSI-RSCP.h \ NewInterFreqCellSI-ECN0.h \ NewInterFreqCellSI-HCS-RSCP.h \ NewInterFreqCellSI-HCS-ECN0.h \ NewInterFreqCellSI-RSCP-LCR-r4.h \ NewInterFreqCellSI-ECN0-LCR-r4.h \ NewInterFreqCellSI-HCS-RSCP-LCR-r4.h \ NewInterFreqCellSI-HCS-ECN0-LCR-r4.h \ NewInterFreqCellSI-List-ECN0.h \ NewInterFreqCellSI-List-HCS-RSCP.h \ NewInterFreqCellSI-List-HCS-ECN0.h \ NewInterFreqCellSI-List-RSCP.h \ NewInterFreqCellSI-List-ECN0-LCR-r4.h \ NewInterFreqCellSI-List-HCS-RSCP-LCR-r4.h \ NewInterFreqCellSI-List-HCS-ECN0-LCR-r4.h \ NewInterFreqCellSI-List-RSCP-LCR-r4.h \ NewInterRATCell.h \ NewInterRATCell-B.h \ NewInterRATCellList.h \ NewInterRATCellList-B.h \ NewIntraFreqCell.h \ NewIntraFreqCell-r4.h \ NewIntraFreqCellList.h \ NewIntraFreqCellList-r4.h \ NewIntraFreqCellSI-RSCP.h \ NewIntraFreqCellSI-ECN0.h \ NewIntraFreqCellSI-HCS-RSCP.h \ NewIntraFreqCellSI-HCS-ECN0.h \ NewIntraFreqCellSI-RSCP-LCR-r4.h \ NewIntraFreqCellSI-ECN0-LCR-r4.h \ NewIntraFreqCellSI-HCS-RSCP-LCR-r4.h \ NewIntraFreqCellSI-HCS-ECN0-LCR-r4.h \ NewIntraFreqCellSI-List-RSCP.h \ NewIntraFreqCellSI-List-ECN0.h \ NewIntraFreqCellSI-List-HCS-RSCP.h \ NewIntraFreqCellSI-List-HCS-ECN0.h \ NewIntraFreqCellSI-List-RSCP-LCR-r4.h \ NewIntraFreqCellSI-List-ECN0-LCR-r4.h \ NewIntraFreqCellSI-List-HCS-RSCP-LCR-r4.h \ NewIntraFreqCellSI-List-HCS-ECN0-LCR-r4.h \ NonUsedFreqParameter.h \ NonUsedFreqParameter-r6.h \ NonUsedFreqParameterList.h \ NonUsedFreqParameterList-r6.h \ NonUsedFreqWList-r6.h \ ObservedTimeDifferenceToGSM.h \ OTDOA-SearchWindowSize.h \ Pathloss.h \ PenaltyTime-RSCP.h \ PenaltyTime-ECN0.h \ PendingTimeAfterTrigger.h \ PeriodicalOrEventTrigger.h \ PeriodicalReportingCriteria.h \ PeriodicalWithReportingCellStatus.h \ PLMNIdentitiesOfNeighbourCells.h \ PLMNsOfInterFreqCellsList.h \ PLMNsOfIntraFreqCellsList.h \ PLMNsOfInterRATCellsList.h \ PositionEstimate.h \ PositioningMethod.h \ PRC.h \ PrimaryCCPCH-RSCP.h \ Q-HCS.h \ Q-OffsetS-N.h \ Q-QualMin.h \ Q-RxlevMin.h \ QualityEventResults.h \ QualityMeasuredResults.h \ QualityMeasurement.h \ QualityReportCriteria.h \ QualityReportingCriteria.h \ QualityReportingCriteriaSingle.h \ QualityReportingQuantity.h \ RAT-Type.h \ ReferenceCellPosition.h \ ReferenceLocation.h \ ReferenceTimeDifferenceToCell.h \ RemovedInterFreqCellList.h \ RemovedInterRATCellList.h \ RemovedIntraFreqCellList.h \ ReplacementActivationThreshold.h \ ReportDeactivationThreshold.h \ ReportingAmount.h \ ReportingCellStatus.h \ ReportingCellStatusOpt.h \ ReportingInfoForCellDCH.h \ ReportingInfoForCellDCH-LCR-r4.h \ ReportingInterval.h \ ReportingIntervalLong.h \ ReportingRange.h \ RL-AdditionInfoList.h \ RL-InformationLists.h \ RLC-BuffersPayload.h \ RRC.h \ SatData.h \ SatDataList.h \ SatelliteStatus.h \ SatID.h \ SFN-Offset-Validity.h \ SFN-SFN-Drift.h \ SFN-SFN-ObsTimeDifference.h \ SFN-SFN-ObsTimeDifference1.h \ SFN-SFN-ObsTimeDifference2.h \ SFN-SFN-OTD-Type.h \ SFN-SFN-RelTimeDifference1.h \ SFN-TOW-Uncertainty.h \ SIR.h \ SIR-MeasurementList.h \ SIR-MeasurementResults.h \ SIR-TFCS.h \ SIR-TFCS-List.h \ SIR-TimeslotList.h \ SubFrame1Reserved.h \ T-ADVinfo.h \ T-CRMax.h \ T-CRMaxHyst.h \ TemporaryOffset1.h \ TemporaryOffset2.h \ TemporaryOffsetList.h \ Threshold.h \ Threshold-r6.h \ ThreholdNonUsedFrequency-deltaList.h \ ThresholdPositionChange.h \ ThresholdSFN-GPS-TOW.h \ ThresholdSFN-SFN-Change.h \ ThresholdUsedFrequency.h \ ThresholdUsedFrequency-r6.h \ TimeInterval.h \ TimeslotInfo.h \ TimeslotInfo-LCR-r4.h \ TimeslotInfoList.h \ TimeslotInfoList-LCR-r4.h \ TimeslotInfoList-r4.h \ TimeslotISCP.h \ TimeslotISCP-List.h \ TimeslotListWithISCP.h \ TimeslotWithISCP.h \ TimeToTrigger.h \ TrafficVolumeEventParam.h \ TrafficVolumeEventResults.h \ TrafficVolumeEventType.h \ TrafficVolumeMeasQuantity.h \ TrafficVolumeMeasSysInfo.h \ TrafficVolumeMeasuredResults.h \ TrafficVolumeMeasuredResultsList.h \ TrafficVolumeMeasurement.h \ TrafficVolumeMeasurementObjectList.h \ TrafficVolumeReportCriteria.h \ TrafficVolumeReportCriteriaSysInfo.h \ TrafficVolumeReportingCriteria.h \ TrafficVolumeReportingQuantity.h \ TrafficVolumeThreshold.h \ TransChCriteria.h \ TransChCriteriaList.h \ TransferMode.h \ TransmittedPowerThreshold.h \ TriggeringCondition1.h \ TriggeringCondition2.h \ TX-InterruptionAfterTrigger.h \ UDRE.h \ UE-6AB-Event.h \ UE-6FG-Event.h \ UE-AutonomousUpdateMode.h \ UE-InternalEventParam.h \ UE-InternalEventParamList.h \ UE-InternalEventResults.h \ UE-InternalMeasQuantity.h \ UE-InternalMeasuredResults.h \ UE-InternalMeasuredResults-r7.h \ UE-InternalMeasuredResults-LCR-r4.h \ UE-InternalMeasurement.h \ UE-InternalMeasurement-r4.h \ UE-InternalMeasurementSysInfo.h \ UE-InternalReportCriteria.h \ UE-InternalReportingCriteria.h \ UE-InternalReportingQuantity.h \ UE-InternalReportingQuantity-r4.h \ UE-MeasurementQuantity.h \ UE-RX-TX-ReportEntry.h \ UE-RX-TX-ReportEntryList.h \ UE-RX-TX-TimeDifferenceType1.h \ UE-RX-TX-TimeDifferenceType2.h \ UE-RX-TX-TimeDifferenceType2Info.h \ UE-RX-TX-TimeDifferenceThreshold.h \ UE-TransmittedPower.h \ UE-TransmittedPowerTDD-List.h \ UL-TrCH-Identity.h \ UE-Positioning-Accuracy.h \ UE-Positioning-CipherParameters.h \ UE-Positioning-Error.h \ UE-Positioning-ErrorCause.h \ UE-Positioning-EventParam.h \ UE-Positioning-EventParamList.h \ UE-Positioning-EventSpecificInfo.h \ UE-Positioning-GPS-AcquisitionAssistance.h \ UE-Positioning-GPS-AdditionalAssistanceDataRequest.h \ UE-Positioning-GPS-Almanac.h \ UE-Positioning-GPS-AssistanceData.h \ UE-Positioning-GPS-DGPS-Corrections.h \ UE-Positioning-GPS-IonosphericModel.h \ UE-Positioning-GPS-MeasurementResults.h \ UE-Positioning-GPS-NavigationModel.h \ UE-Positioning-GPS-NavModelAddDataReq.h \ UE-Positioning-GPS-ReferenceCellInfo.h \ UE-Positioning-GPS-ReferenceTime.h \ UE-Positioning-GPS-UTC-Model.h \ UE-Positioning-IPDL-Parameters.h \ UE-Positioning-IPDL-Parameters-r4.h \ UE-Positioning-IPDL-Parameters-TDD-r4-ext.h \ UE-Positioning-MeasuredResults.h \ UE-Positioning-MeasuredResults-v390ext.h \ UE-Positioning-Measurement.h \ UE-Positioning-Measurement-v390ext.h \ UE-Positioning-Measurement-r4.h \ UE-Positioning-Measurement-v7xyext.h \ UE-Positioning-MeasurementEventResults.h \ UE-Positioning-MeasurementInterval.h \ UE-Positioning-MethodType.h \ UE-Positioning-OTDOA-AssistanceData.h \ UE-Positioning-OTDOA-AssistanceData-r4.h \ UE-Positioning-OTDOA-AssistanceData-r4ext.h \ UE-Positioning-OTDOA-AssistanceData-UEB.h \ UE-Positioning-IPDL-Parameters-TDDList-r4-ext.h \ UE-Positioning-OTDOA-Measurement.h \ UE-Positioning-OTDOA-Measurement-v390ext.h \ UE-Positioning-OTDOA-NeighbourCellInfo.h \ UE-Positioning-OTDOA-NeighbourCellInfo-r4.h \ UE-Positioning-OTDOA-NeighbourCellInfo-UEB.h \ UE-Positioning-OTDOA-NeighbourCellList.h \ UE-Positioning-OTDOA-NeighbourCellList-r4.h \ UE-Positioning-OTDOA-NeighbourCellList-UEB.h \ UE-Positioning-OTDOA-Quality.h \ UE-Positioning-OTDOA-ReferenceCellInfo.h \ UE-Positioning-OTDOA-ReferenceCellInfo-r4.h \ UE-Positioning-OTDOA-ReferenceCellInfo-UEB.h \ UE-Positioning-PositionEstimateInfo.h \ UE-Positioning-ReportCriteria.h \ UE-Positioning-ReportingQuantity.h \ UE-Positioning-ReportingQuantity-v390ext.h \ UE-Positioning-ReportingQuantity-r4.h \ UE-Positioning-ReportingQuantity-v7xyext.h \ UE-Positioning-ResponseTime.h \ UTRA-CarrierRSSI.h \ UTRAN-GPS-DriftRate.h \ UTRAN-GPSReferenceTime.h \ UTRAN-GPSReferenceTimeResult.h \ VarianceOfRLC-BufferPayload.h \ VelocityEstimate.h \ W.h \ BCC.h \ BCCH-ModificationInfo.h \ BCCH-ModificationTime.h \ BSIC.h \ CBS-DRX-Level1Information.h \ CBS-DRX-Level1Information-extension-r6.h \ CDMA2000-Message.h \ CDMA2000-MessageList.h \ CDMA2000-UMTS-Frequency-List.h \ CellValueTag.h \ ExpirationTimeFactor.h \ FDD-UMTS-Frequency-List.h \ FrequencyInfoCDMA2000.h \ GERAN-SystemInfoBlock.h \ GERAN-SystemInformation.h \ GSM-BA-Range.h \ GSM-BA-Range-List.h \ GSM-Classmark2.h \ GSM-Classmark3.h \ GSM-MessageList.h \ GSM-MS-RadioAccessCapability.h \ GsmSecurityCapability.h \ GSM-TargetCellInfoList.h \ GSM-TargetCellInfo.h \ IdentificationOfReceivedMessage.h \ InterRAT-ChangeFailureCause.h \ GERANIu-MessageList.h \ GERANIu-RadioAccessCapability.h \ InterRAT-UE-RadioAccessCapability.h \ InterRAT-UE-RadioAccessCapabilityList.h \ InterRAT-UE-RadioAccessCapability-v590ext.h \ InterRAT-UE-RadioAccessCapability-v690ext.h \ InterRAT-UE-SecurityCapability.h \ InterRAT-UE-SecurityCapList.h \ InterRAT-HO-FailureCause.h \ MasterInformationBlock.h \ MasterInformationBlock-v690ext.h \ MIB-ValueTag.h \ NCC.h \ PLMN-ValueTag.h \ PredefinedConfigIdentityAndValueTag.h \ ProtocolErrorInformation.h \ ReceivedMessageType.h \ Rplmn-Information.h \ Rplmn-Information-r4.h \ SchedulingInformation.h \ SchedulingInformationSIB.h \ SchedulingInformationSIBSb.h \ SegCount.h \ SegmentIndex.h \ SFN-Prime.h \ SIB-Data-fixed.h \ SIB-Data-variable.h \ SIBOccurIdentity.h \ SIBOccurrenceIdentityAndValueTag.h \ SIBOccurValueTag.h \ SIB-ReferenceList.h \ SIBSb-ReferenceList.h \ SIB-ReferenceListFACH.h \ SIB-Type.h \ SIB-TypeAndTag.h \ SIBSb-TypeAndTag.h \ SibOFF.h \ SibOFF-List.h \ SysInfoType1.h \ SysInfoType1-v3a0ext-IEs.h \ SysInfoType2.h \ SysInfoType3.h \ SysInfoType3-v4b0ext-IEs.h \ SysInfoType3-v590ext.h \ SysInfoType3-v5c0ext-IEs.h \ SysInfoType3-v670ext.h \ SysInfoType4.h \ SysInfoType4-v4b0ext-IEs.h \ SysInfoType4-v590ext.h \ SysInfoType4-v5b0ext-IEs.h \ SysInfoType4-v5c0ext-IEs.h \ SysInfoType5.h \ SysInfoType5-v4b0ext-IEs.h \ SysInfoType5-v590ext-IEs.h \ SysInfoType5-v650ext-IEs.h \ SysInfoType5-v680ext-IEs.h \ SysInfoType5-v690ext-IEs.h \ SysInfoType5-v7xyext-IEs.h \ SysInfoType5bis.h \ SysInfoType6.h \ SysInfoType6-v4b0ext-IEs.h \ SysInfoType6-v590ext-IEs.h \ SysInfoType6-v650ext-IEs.h \ SysInfoType6-v690ext-IEs.h \ SysInfoType6-v7xyext-IEs.h \ SysInfoType7.h \ SysInfoType8.h \ SysInfoType9.h \ SysInfoType10.h \ SysInfoType11.h \ SysInfoType11-v4b0ext-IEs.h \ SysInfoType11-v590ext-IEs.h \ SysInfoType11-v690ext-IEs.h \ SysInfoType12.h \ SysInfoType12-v4b0ext-IEs.h \ SysInfoType12-v590ext-IEs.h \ SysInfoType12-v690ext-IEs.h \ SysInfoType13.h \ SysInfoType13-v3a0ext-IEs.h \ SysInfoType13-v4b0ext-IEs.h \ SysInfoType13-v7xyext-IEs.h \ SysInfoType13-1.h \ SysInfoType13-2.h \ SysInfoType13-3.h \ SysInfoType13-4.h \ SysInfoType14.h \ SysInfoType15.h \ SysInfoType15-v4b0ext-IEs.h \ SysInfoType15-1.h \ SysInfoType15-2.h \ SysInfoType15-3.h \ SysInfoType15-4.h \ SysInfoType15-4-v3a0ext.h \ SysInfoType15-4-v4b0ext.h \ SysInfoType15-5.h \ SysInfoType15-5-v3a0ext.h \ SysInfoType16.h \ SysInfoType17.h \ SysInfoType17-v4b0ext-IEs.h \ SysInfoType17-v590ext-IEs.h \ SysInfoType17-v7xyext-IEs.h \ SysInfoType18.h \ SysInfoTypeSB1.h \ SysInfoTypeSB2.h \ TDD-UMTS-Frequency-List.h \ ANSI-41-GlobalServiceRedirectInfo.h \ ANSI-41-PrivateNeighbourListInfo.h \ ANSI-41-RAND-Information.h \ ANSI-41-UserZoneID-Information.h \ ANSI-41-NAS-Parameter.h \ Min-P-REV.h \ NAS-SystemInformationANSI-41.h \ NID.h \ P-REV.h \ SID.h \ MBMS-AccessProbabilityFactor.h \ MBMS-CellGroupIdentity-r6.h \ MBMS-CommonCCTrChIdentity.h \ MBMS-CommonPhyChIdentity.h \ MBMS-CommonRBIdentity.h \ MBMS-CommonRBInformation-r6.h \ MBMS-CommonRBInformationList-r6.h \ MBMS-CommonTrChIdentity.h \ MBMS-ConnectedModeCountingScope.h \ MBMS-CurrentCell-SCCPCH-r6.h \ MBMS-CurrentCell-SCCPCHList-r6.h \ MBMS-FACHCarryingMTCH-List.h \ MBMS-JoinedInformation-r6.h \ MBMS-L1CombiningSchedule-32.h \ MBMS-L1CombiningSchedule-64.h \ MBMS-L1CombiningSchedule-128.h \ MBMS-L1CombiningSchedule-256.h \ MBMS-L1CombiningSchedule-512.h \ MBMS-L1CombiningSchedule-1024.h \ MBMS-L1CombiningSchedule.h \ MBMS-L1CombiningTransmTimeDiff.h \ MBMS-L23Configuration.h \ MBMS-LogicalChIdentity.h \ MBMS-MCCH-ConfigurationInfo-r6.h \ MBMS-MICHConfigurationInfo-r6.h \ MBMS-MICHConfigurationInfo-r7.h \ MBMS-MICHNotificationIndLength.h \ MBMS-MICHPowerOffset.h \ MBMS-ModifedService-r6.h \ MBMS-ModifedServiceList-r6.h \ MBMS-MSCH-ConfigurationInfo-r6.h \ MBMS-MSCHSchedulingInfo.h \ MBMS-NeighbouringCellSCCPCH-r6.h \ MBMS-NeighbouringCellSCCPCHList-r6.h \ MBMS-NI-CountPerFrame.h \ MBMS-NumberOfNeighbourCells-r6.h \ MBMS-PFLIndex.h \ MBMS-PFLInfo.h \ MBMS-PhyChInformation-r6.h \ MBMS-PhyChInformationList-r6.h \ MBMS-PL-ServiceRestrictInfo-r6.h \ MBMS-PreferredFreqRequest-r6.h \ MBMS-PreferredFrequencyInfo-r6.h \ MBMS-PreferredFrequencyList-r6.h \ MBMS-PTMActivationTime-r6.h \ MBMS-PTM-RBInformation-C.h \ MBMS-PTM-RBInformation-CList.h \ MBMS-PTM-RBInformation-N.h \ MBMS-PTM-RBInformation-NList.h \ MBMS-Qoffset.h \ MBMS-RequiredUEAction-Mod.h \ MBMS-RequiredUEAction-UMod.h \ MBMS-SCCPCHIdentity.h \ MBMS-SCCPCHPwrOffsetDiff.h \ MBMS-ServiceAccessInfo-r6.h \ MBMS-ServiceAccessInfoList-r6.h \ MBMS-ServiceIdentity-r6.h \ MBMS-ServiceSchedulingInfo-r6.h \ MBMS-ServiceSchedulingInfoList-r6.h \ MBMS-ServiceTransmInfo.h \ MBMS-ServiceTransmInfoList.h \ MBMS-SessionIdentity.h \ MBMS-ShortTransmissionID.h \ MBMS-SIBType5-SCCPCH-r6.h \ MBMS-SIBType5-SCCPCHList-r6.h \ MBMS-SoftComb-TimingOffset.h \ MBMS-TCTF-Presence.h \ MBMS-TimersAndCounters-r6.h \ MBMS-TransmissionIdentity.h \ MBMS-TranspChInfoForCCTrCh-r6.h \ MBMS-TranspChInfoForEachCCTrCh-r6.h \ MBMS-TranspChInfoForEachTrCh-r6.h \ MBMS-TranspChInfoForTrCh-r6.h \ MBMS-TrCHInformation-Curr.h \ MBMS-TrCHInformation-CurrList.h \ MBMS-TrCHInformation-Neighb.h \ MBMS-TrCHInformation-NeighbList.h \ MBMS-TrCHInformation-SIB5.h \ MBMS-TrCHInformation-SIB5List.h \ MBMS-UnmodifiedService-r6.h \ MBMS-UnmodifiedServiceList-r6.h \ ToTargetRNC-Container.h \ TargetRNC-ToSourceRNC-Container.h \ InterRATHandoverInfoWithInterRATCapabilities-r3.h \ InterRATHandoverInfoWithInterRATCapabilities-r3-IEs.h \ InterRATHandoverInfoWithInterRATCapabilities-v390ext-IEs.h \ InterRATHandoverInfoWithInterRATCapabilities-v690ext-IEs.h \ RFC3095-ContextInfo-r5.h \ RFC3095-ContextInfoList-r5.h \ SRNC-RelocationInfo-r3.h \ SRNC-RelocationInfo-r3-IEs.h \ SRNC-RelocationInfo-v380ext-IEs.h \ SRNC-RelocationInfo-v390ext-IEs.h \ SRNC-RelocationInfo-v3a0ext-IEs.h \ SRNC-RelocationInfo-v3b0ext-IEs.h \ SRNC-RelocationInfo-v3c0ext-IEs.h \ SRNC-RelocationInfo-v3d0ext-IEs.h \ SRNC-RelocationInfo-v3g0ext-IEs.h \ SRNC-RelocationInfo-v3h0ext-IEs.h \ SRNC-RelocationInfo-v4d0ext-IEs.h \ TPC-CombinationInfoList.h \ STARTList2.h \ SRNC-RelocationInfo-v4b0ext-IEs.h \ SRNC-RelocationInfo-v590ext-IEs.h \ SRNC-RelocationInfo-v5a0ext-IEs.h \ SRNC-RelocationInfo-v5b0ext-IEs.h \ SRNC-RelocationInfo-v5c0ext-IEs.h \ SRNC-RelocationInfo-v7xyext-IEs.h \ CipheringInfoPerRB-List-v3a0ext.h \ CipheringStatusList.h \ CipheringStatusCNdomain.h \ CodeChangeStatusList.h \ CodeChangeStatus.h \ StoredCompressedModeInfo.h \ StoredTGP-SequenceList.h \ StoredTGP-Sequence.h \ SRNC-RelocationInfo-r4-IEs.h \ SRNC-RelocationInfo-r5-IEs.h \ SRNC-RelocationInfo-v690ext-IEs.h \ SRNC-RelocationInfo-r6-IEs.h \ CalculationTimeForCiphering.h \ CipheringInfoPerRB.h \ CipheringInfoPerRB-r4.h \ CipheringInfoPerRB-List.h \ CipheringInfoPerRB-List-r4.h \ CipheringStatus.h \ CipheringStatusList-r4.h \ CipheringStatusCNdomain-r4.h \ CN-DomainInformation-v390ext.h \ CN-DomainInformationList-v390ext.h \ CompressedModeMeasCapability-r4.h \ COUNT-C-List.h \ COUNT-CSingle.h \ DL-PhysChCapabilityFDD-r4.h \ DL-PhysChCapabilityFDD-r5.h \ DL-PhysChCapabilityTDD-r5.h \ DL-PhysChCapabilityTDD-LCR-r5.h \ DL-RFC3095-Context.h \ ImplementationSpecificParams.h \ IntegrityProtectionStatus.h \ InterRAT-UE-RadioAccessCapabilityList-r5.h \ IntraFreqReportingCriteria-r6-ext.h \ MaxHcContextSpace-r5.h \ MeasurementCapability-r4.h \ MeasurementCommandWithType.h \ MeasurementCommandWithType-r4.h \ MeasurementCommandWithType-r6.h \ OngoingMeasRep.h \ OngoingMeasRep-r4.h \ OngoingMeasRep-r5.h \ OngoingMeasRep-r6.h \ OngoingMeasRepList.h \ OngoingMeasRepList-r4.h \ OngoingMeasRepList-r5.h \ OngoingMeasRepList-r6.h \ PDCP-Capability-r4.h \ PDCP-Capability-r5.h \ PDCP-Capability-r6.h \ PhysicalChannelCapability-r4.h \ PhysicalChannelCapability-r5.h \ RF-Capability-r4.h \ RFC3095-ContextInfo.h \ RFC3095-Context-List.h \ RLC-Capability-r5.h \ SRB-SpecificIntegrityProtInfo.h \ SRB-SpecificIntegrityProtInfoList.h \ StateOfRRC.h \ StateOfRRC-Procedure.h \ TotalRLC-AM-BufferSize-r5.h \ TPC-Combination-Info.h \ UE-MultiModeRAT-Capability-r5.h \ UE-Positioning-Capability-r4.h \ UE-Positioning-LastKnownPos.h \ UE-RadioAccessCapability-r4.h \ UE-RadioAccessCapability-r5.h \ UE-RadioAccessCapability-r6.h \ UE-RadioAccessCapability-r7.h \ UL-RFC3095-Context.h ASN_MODULE_HEADERS+=BOOLEAN.h ASN_MODULE_SOURCES+=BOOLEAN.c ASN_MODULE_HEADERS+=ENUMERATED.h ASN_MODULE_SOURCES+=ENUMERATED.c ASN_MODULE_HEADERS+=INTEGER.h ASN_MODULE_HEADERS+=NativeEnumerated.h ASN_MODULE_SOURCES+=INTEGER.c ASN_MODULE_HEADERS+=NULL.h ASN_MODULE_SOURCES+=NULL.c ASN_MODULE_SOURCES+=NativeEnumerated.c ASN_MODULE_HEADERS+=NativeInteger.h ASN_MODULE_SOURCES+=NativeInteger.c ASN_MODULE_HEADERS+=asn_SEQUENCE_OF.h ASN_MODULE_SOURCES+=asn_SEQUENCE_OF.c ASN_MODULE_HEADERS+=asn_SET_OF.h ASN_MODULE_SOURCES+=asn_SET_OF.c ASN_MODULE_HEADERS+=constr_CHOICE.h ASN_MODULE_SOURCES+=constr_CHOICE.c ASN_MODULE_HEADERS+=constr_SEQUENCE.h ASN_MODULE_SOURCES+=constr_SEQUENCE.c ASN_MODULE_HEADERS+=constr_SEQUENCE_OF.h ASN_MODULE_SOURCES+=constr_SEQUENCE_OF.c ASN_MODULE_HEADERS+=constr_SET_OF.h ASN_MODULE_SOURCES+=constr_SET_OF.c ASN_MODULE_HEADERS+=asn_application.h ASN_MODULE_HEADERS+=asn_system.h ASN_MODULE_HEADERS+=asn_codecs.h ASN_MODULE_HEADERS+=asn_internal.h ASN_MODULE_HEADERS+=OCTET_STRING.h ASN_MODULE_SOURCES+=OCTET_STRING.c ASN_MODULE_HEADERS+=BIT_STRING.h ASN_MODULE_SOURCES+=BIT_STRING.c ASN_MODULE_SOURCES+=asn_codecs_prim.c ASN_MODULE_HEADERS+=asn_codecs_prim.h ASN_MODULE_HEADERS+=ber_tlv_length.h ASN_MODULE_SOURCES+=ber_tlv_length.c ASN_MODULE_HEADERS+=ber_tlv_tag.h ASN_MODULE_SOURCES+=ber_tlv_tag.c ASN_MODULE_HEADERS+=ber_decoder.h ASN_MODULE_SOURCES+=ber_decoder.c ASN_MODULE_HEADERS+=der_encoder.h ASN_MODULE_SOURCES+=der_encoder.c ASN_MODULE_HEADERS+=constr_TYPE.h ASN_MODULE_SOURCES+=constr_TYPE.c ASN_MODULE_HEADERS+=constraints.h ASN_MODULE_SOURCES+=constraints.c ASN_MODULE_HEADERS+=xer_support.h ASN_MODULE_SOURCES+=xer_support.c ASN_MODULE_HEADERS+=xer_decoder.h ASN_MODULE_SOURCES+=xer_decoder.c ASN_MODULE_HEADERS+=xer_encoder.h ASN_MODULE_SOURCES+=xer_encoder.c ASN_MODULE_HEADERS+=per_support.h ASN_MODULE_SOURCES+=per_support.c ASN_MODULE_HEADERS+=per_decoder.h ASN_MODULE_SOURCES+=per_decoder.c ASN_MODULE_HEADERS+=per_encoder.h ASN_MODULE_SOURCES+=per_encoder.c ASN_MODULE_HEADERS+=per_opentype.h ASN_MODULE_SOURCES+=per_opentype.c ASN_CONVERTER_SOURCES+=converter-sample.c ASN_CONVERTER_SOURCES+=pdu_collection.c lib_LTLIBRARIES=libsomething.la libsomething_la_SOURCES=$(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS) # This file may be used as an input for make(3) # Remove the lines below to convert it into a pure .am file TARGET = rrc-dump CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -DPDU=DL_DCCH_Message -DASN_PDU_COLLECTION -I. OBJS=${ASN_MODULE_SOURCES:.c=.o} ${ASN_CONVERTER_SOURCES:.c=.o} all: DL-DCCH-Message.c $(TARGET) $(TARGET): ${OBJS} $(CC) $(CFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS) .SUFFIXES: .SUFFIXES: .c .o .c.o: $(CC) $(CFLAGS) -o $@ -c $< clean: rm -f $(TARGET) rm -f $(OBJS) regen: regenerate-from-asn1-source regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons -pdu=DL-DCCH-Message -pdu=auto -fcompound-names -gen-PER ../rrc.asn1 DL-DCCH-Message.c: ../sample.makefile.regen ../rrc.asn1 make regen-makefile @touch DL-DCCH-Message.c make regen-makefile: ASN1CMDOPTS="-pdu=auto -fcompound-names -gen-PER" \ ASN1MODULES="../rrc.asn1" \ ASN1PDU=DL-DCCH-Message \ PROGNAME=rrc-dump \ ../sample.makefile.regen check: ${TARGET} check-ber check-xer check-per @echo ================ @echo All tests passed @echo ================ check-ber: @if test -f sample-DL-DCCH-Message-1.[db]er ; then \ for f in sample-DL-DCCH-Message-*.[db]er; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into XER and back ($$b)..."; \ ./${TARGET} -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iber -onull $$f || exit 5; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iber -onull $$f || exit 6; \ done; done; fi check-xer: @if test -f sample-DL-DCCH-Message-1.xer ; then \ for f in sample-DL-DCCH-Message-*.xer; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER and back ($$b)..."; \ ./${TARGET} -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ diff $$f ./.tmp.2.$$$$ || exit 4; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -ixer -onull $$f || exit 5; \ ./${TARGET} -J0.001 -n 1000 -b $$b -ixer -onull $$f || exit 6; \ done; done; fi check-per: @if test -f sample-DL-DCCH-Message-1-nopad.per ; then \ for f in sample-DL-DCCH-Message-[1-9]-nopad.per; do \ for b in 1 17 33 980 8192; do \ echo "Recoding non-padded $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ ./${TARGET} -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \ diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \ rm -f ./.tmp.[123].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 6; \ ./${TARGET} -J0.001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 7; \ done; done; fi @if test -f sample-DL-DCCH-Message-1.per ; then \ for f in sample-*-[1-9].per; do \ pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z-]+)-[0-9].*/\1/"`; \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -p $$pdu -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \ ./${TARGET} -b $$b -p $$pdu -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \ ./${TARGET} -b $$b -p $$pdu -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \ diff $$f ./.tmp.1.$$$$ || exit 6; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iper -onull $$f || exit 7; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iper -onull $$f || exit 8; \ done; done; fi distclean: clean rm -f $(ASN_MODULE_SOURCES) rm -f $(ASN_MODULE_HEADERS) rm -f $(ASN_CONVERTER_SOURCES) $(ASN_CONVERTER_HEADERS) rm -f Makefile.am.sample asn1c-0.9.24+dfsg/examples/sample.source.LDAP3/0000755000000000000000000000000012223077270017432 5ustar rootrootasn1c-0.9.24+dfsg/examples/sample.source.LDAP3/README0000644000000000000000000000105611456135550020317 0ustar rootroot GENERAL INFORMATION =================== The LDAPv3 (Lightweight Directory Access Protocol) PDU decoder. Invoking `make` will compile the ASN.1 specifications from the rfc4211.txt in the above directory. This LDAP decoder has been successfully tested against the PROTOS c06-ldapv3 security test suite: http://www.ee.oulu.fi/research/ouspg/protos/testing/c06/ldapv3/index.html ldap3dump USAGE ============== ./ldap3dump LDAPMessage.ber # Print as XML (BASIC-XER) The full list of recognized command line options may be obtained with > ./ldap3dump -h asn1c-0.9.24+dfsg/examples/sample.source.LDAP3/sample-LDAPMessage-1.ber0000644000000000000000000000004211456135550023565 0ustar rootroot0 ` uid=a,dc=com€passwordasn1c-0.9.24+dfsg/examples/sample.source.LDAP3/config.h0000644000000000000000000000031011472004363021040 0ustar rootroot extern int opt_debug; #define ASN_DEBUG(fmt, args...) do { \ if(opt_debug < 2) break; \ fprintf(stderr, fmt, ##args); \ fprintf(stderr, " (%s:%d)\n", \ __FILE__, __LINE__); \ } while(0) asn1c-0.9.24+dfsg/examples/sample.source.LDAP3/Makefile0000644000000000000000000001773411723307713021110 0ustar rootrootASN_MODULE_SOURCES= \ LDAPMessage.c \ MessageID.c \ LDAPString.c \ LDAPOID.c \ LDAPDN.c \ RelativeLDAPDN.c \ AttributeDescription.c \ AttributeValue.c \ AttributeValueAssertion.c \ AssertionValue.c \ PartialAttribute.c \ Attribute.c \ MatchingRuleId.c \ LDAPResult.c \ Referral.c \ URI.c \ Controls.c \ Control.c \ BindRequest.c \ AuthenticationChoice.c \ SaslCredentials.c \ BindResponse.c \ UnbindRequest.c \ SearchRequest.c \ AttributeSelection.c \ Filter.c \ SubstringFilter.c \ MatchingRuleAssertion.c \ SearchResultEntry.c \ PartialAttributeList.c \ SearchResultReference.c \ SearchResultDone.c \ ModifyRequest.c \ ModifyResponse.c \ AddRequest.c \ AttributeList.c \ AddResponse.c \ DelRequest.c \ DelResponse.c \ ModifyDNRequest.c \ ModifyDNResponse.c \ CompareRequest.c \ CompareResponse.c \ AbandonRequest.c \ ExtendedRequest.c \ ExtendedResponse.c \ IntermediateResponse.c ASN_MODULE_HEADERS= \ LDAPMessage.h \ MessageID.h \ LDAPString.h \ LDAPOID.h \ LDAPDN.h \ RelativeLDAPDN.h \ AttributeDescription.h \ AttributeValue.h \ AttributeValueAssertion.h \ AssertionValue.h \ PartialAttribute.h \ Attribute.h \ MatchingRuleId.h \ LDAPResult.h \ Referral.h \ URI.h \ Controls.h \ Control.h \ BindRequest.h \ AuthenticationChoice.h \ SaslCredentials.h \ BindResponse.h \ UnbindRequest.h \ SearchRequest.h \ AttributeSelection.h \ Filter.h \ SubstringFilter.h \ MatchingRuleAssertion.h \ SearchResultEntry.h \ PartialAttributeList.h \ SearchResultReference.h \ SearchResultDone.h \ ModifyRequest.h \ ModifyResponse.h \ AddRequest.h \ AttributeList.h \ AddResponse.h \ DelRequest.h \ DelResponse.h \ ModifyDNRequest.h \ ModifyDNResponse.h \ CompareRequest.h \ CompareResponse.h \ AbandonRequest.h \ ExtendedRequest.h \ ExtendedResponse.h \ IntermediateResponse.h ASN_MODULE_HEADERS+=BOOLEAN.h ASN_MODULE_SOURCES+=BOOLEAN.c ASN_MODULE_HEADERS+=ENUMERATED.h ASN_MODULE_SOURCES+=ENUMERATED.c ASN_MODULE_HEADERS+=INTEGER.h ASN_MODULE_HEADERS+=NativeEnumerated.h ASN_MODULE_SOURCES+=INTEGER.c ASN_MODULE_HEADERS+=NULL.h ASN_MODULE_SOURCES+=NULL.c ASN_MODULE_SOURCES+=NativeEnumerated.c ASN_MODULE_HEADERS+=NativeInteger.h ASN_MODULE_SOURCES+=NativeInteger.c ASN_MODULE_HEADERS+=asn_SEQUENCE_OF.h ASN_MODULE_SOURCES+=asn_SEQUENCE_OF.c ASN_MODULE_HEADERS+=asn_SET_OF.h ASN_MODULE_SOURCES+=asn_SET_OF.c ASN_MODULE_HEADERS+=constr_CHOICE.h ASN_MODULE_SOURCES+=constr_CHOICE.c ASN_MODULE_HEADERS+=constr_SEQUENCE.h ASN_MODULE_SOURCES+=constr_SEQUENCE.c ASN_MODULE_HEADERS+=constr_SEQUENCE_OF.h ASN_MODULE_SOURCES+=constr_SEQUENCE_OF.c ASN_MODULE_HEADERS+=constr_SET_OF.h ASN_MODULE_SOURCES+=constr_SET_OF.c ASN_MODULE_HEADERS+=asn_application.h ASN_MODULE_HEADERS+=asn_system.h ASN_MODULE_HEADERS+=asn_codecs.h ASN_MODULE_HEADERS+=asn_internal.h ASN_MODULE_HEADERS+=OCTET_STRING.h ASN_MODULE_SOURCES+=OCTET_STRING.c ASN_MODULE_HEADERS+=BIT_STRING.h ASN_MODULE_SOURCES+=BIT_STRING.c ASN_MODULE_SOURCES+=asn_codecs_prim.c ASN_MODULE_HEADERS+=asn_codecs_prim.h ASN_MODULE_HEADERS+=ber_tlv_length.h ASN_MODULE_SOURCES+=ber_tlv_length.c ASN_MODULE_HEADERS+=ber_tlv_tag.h ASN_MODULE_SOURCES+=ber_tlv_tag.c ASN_MODULE_HEADERS+=ber_decoder.h ASN_MODULE_SOURCES+=ber_decoder.c ASN_MODULE_HEADERS+=der_encoder.h ASN_MODULE_SOURCES+=der_encoder.c ASN_MODULE_HEADERS+=constr_TYPE.h ASN_MODULE_SOURCES+=constr_TYPE.c ASN_MODULE_HEADERS+=constraints.h ASN_MODULE_SOURCES+=constraints.c ASN_MODULE_HEADERS+=xer_support.h ASN_MODULE_SOURCES+=xer_support.c ASN_MODULE_HEADERS+=xer_decoder.h ASN_MODULE_SOURCES+=xer_decoder.c ASN_MODULE_HEADERS+=xer_encoder.h ASN_MODULE_SOURCES+=xer_encoder.c ASN_MODULE_HEADERS+=per_support.h ASN_MODULE_SOURCES+=per_support.c ASN_MODULE_HEADERS+=per_decoder.h ASN_MODULE_SOURCES+=per_decoder.c ASN_MODULE_HEADERS+=per_encoder.h ASN_MODULE_SOURCES+=per_encoder.c ASN_MODULE_HEADERS+=per_opentype.h ASN_MODULE_SOURCES+=per_opentype.c ASN_CONVERTER_SOURCES+=converter-sample.c lib_LTLIBRARIES=libsomething.la libsomething_la_SOURCES=$(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS) # This file may be used as an input for make(3) # Remove the lines below to convert it into a pure .am file TARGET = ldap3dump CFLAGS += -DASN_CONVERTER_TITLE="Lightweight Directory Access Protocol V3 decoder" -DHAVE_CONFIG_H -DJUNKTEST -DPDU=LDAPMessage -I. OBJS=${ASN_MODULE_SOURCES:.c=.o} ${ASN_CONVERTER_SOURCES:.c=.o} all: LDAPMessage.c $(TARGET) $(TARGET): ${OBJS} $(CC) $(CFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS) .SUFFIXES: .SUFFIXES: .c .o .c.o: $(CC) $(CFLAGS) -o $@ -c $< clean: rm -f $(TARGET) rm -f $(OBJS) regen: regenerate-from-asn1-source regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons -pdu=LDAPMessage -fcompound-names ../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1 LDAPMessage.c: ../sample.makefile.regen ../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1 make regen-makefile @touch LDAPMessage.c make regen-makefile: TITLE="Lightweight Directory Access Protocol V3 decoder" \ ASN1CMDOPTS="-fcompound-names" \ ASN1MODULES="../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1" \ ASN1PDU=LDAPMessage \ PROGNAME=ldap3dump \ ../sample.makefile.regen check: ${TARGET} check-ber check-xer check-per @echo ================ @echo All tests passed @echo ================ check-ber: @if test -f sample-LDAPMessage-1.[db]er ; then \ for f in sample-LDAPMessage-*.[db]er; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into XER and back ($$b)..."; \ ./${TARGET} -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iber -onull $$f || exit 5; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iber -onull $$f || exit 6; \ done; done; fi check-xer: @if test -f sample-LDAPMessage-1.xer ; then \ for f in sample-LDAPMessage-*.xer; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER and back ($$b)..."; \ ./${TARGET} -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ diff $$f ./.tmp.2.$$$$ || exit 4; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -ixer -onull $$f || exit 5; \ ./${TARGET} -J0.001 -n 1000 -b $$b -ixer -onull $$f || exit 6; \ done; done; fi check-per: @if test -f sample-LDAPMessage-1-nopad.per ; then \ for f in sample-LDAPMessage-[1-9]-nopad.per; do \ for b in 1 17 33 980 8192; do \ echo "Recoding non-padded $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ ./${TARGET} -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \ diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \ rm -f ./.tmp.[123].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 6; \ ./${TARGET} -J0.001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 7; \ done; done; fi @if test -f sample-LDAPMessage-1.per ; then \ for f in sample-*-[1-9].per; do \ pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z-]+)-[0-9].*/\1/"`; \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -p $$pdu -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \ ./${TARGET} -b $$b -p $$pdu -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \ ./${TARGET} -b $$b -p $$pdu -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \ diff $$f ./.tmp.1.$$$$ || exit 6; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iper -onull $$f || exit 7; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iper -onull $$f || exit 8; \ done; done; fi distclean: clean rm -f $(ASN_MODULE_SOURCES) rm -f $(ASN_MODULE_HEADERS) rm -f $(ASN_CONVERTER_SOURCES) $(ASN_CONVERTER_HEADERS) rm -f Makefile.am.sample asn1c-0.9.24+dfsg/examples/sample.source.PKIX1/0000755000000000000000000000000012223077270017463 5ustar rootrootasn1c-0.9.24+dfsg/examples/sample.source.PKIX1/README0000644000000000000000000000160611456135550020351 0ustar rootroot GENERAL INFORMATION =================== The X.509 (PKIX1) certificate decoder. Invoking `make` will compile the ASN.1 specifications from the rfc3280.txt in the above directory. x509dump USAGE ============== To use the x509dump, you'll have to prepare an X.509 certificate in DER encoding. The typical X.509 certificate will have a PEM format (DER encoded data wrapped in base64, wrapped in PEM "BEGIN" and "END" sections). The openssl x509 utility may be used to convert between PEM and DER. EXAMPLE: Convert 'certificate.pem' into 'certificate.der': openssl x509 -inform PEM -in certificate.pem \ -outform DER -out certificate.der After convertsion, the x509dump utility may be used to dump the contents of the DER-encoded X.509 certificate: ./x509dump certificate.der # Print as XML (BASIC-XER) The full list of recognized command line options may be obtained with > ./x509dump -h asn1c-0.9.24+dfsg/examples/sample.source.PKIX1/sample-Certificate-1.der0000644000000000000000000000215011456135550024017 0ustar rootroot0‚d0‚L D¾ ‹P$´Ó60KÀ3w0  *†H†÷ 0£1 0 UUS1 0 UUT10USalt Lake City10U The USERTRUST Network1!0U http://www.usertrust.com1+0)U"UTN-USERFirst-Network Applications0 990709184839Z 190709185749Z0£1 0 UUS1 0 UUT10USalt Lake City10U The USERTRUST Network1!0U http://www.usertrust.com1+0)U"UTN-USERFirst-Network Applications0‚"0  *†H†÷ ‚0‚ ‚³û‘¡ä6U…¬4[ šX²øµwƒ®2±v’hì#JÉv?㜶7y¹«i%¶gä°saJè~ÍÓ/dã¦| ú€£ G‰OQq/îü?ù¸€‡‰“% šC‚i$v(Y5¡Àƒd ,ÓI¤…´ÀaQøh‘€Ë¥Õî;:ô„^`Y§Œ4rî¸xÅÑ;Jo~e'¹¤UŹoC¤Å,™ÀR¤xL³@˜kCưz{õk"?Ëïÿ¨Ð:KvžÒÑÆ.ãÛW2¢¸o膦?p«åp’«D@Pûœ£bäln ÈÞâ€Búé/èÎ2|·£5<ݞî—¥£‘0Ž0 UÆ0Uÿ0ÿ0Uú†ÉÛàºéxõK¨ÖßðÓáj<0OUH0F0D B @†>http://crl.usertrust.com/UTN-USERFirst-NetworkApplications.crl0  *†H†÷ ‚¤ó%ÌÑÔ‘ƒ"ÐÌ2«›–N4‘T %4a_*ዪÿ}dQÏ ÿ¼}Ø!jxË/QoøB3½ëµ{”Ãé -ßÑ)þ?»¨E*ÑnU$â»û1?¾è¼ì@+øÔV8äÊD‚µa !geöð ç4ø¥Âœ£\@…“•ÞOÔ'©¶¥üÍs1?¸e'ÏÔSð¬nŸO §„)ÄZ½dWr­;Ï7¦˜Æ­´Ü£Õ)¤–šgJŒ`Eñ#š°œhµ˜PÓïŽ.’e±H>!¾0* µ £k?®Wõ–|ßoÝ‚0,e@JÍh¹rìqvìTŽ… jú¦8¬Ä„asn1c-0.9.24+dfsg/examples/sample.source.PKIX1/config.h0000644000000000000000000000031011472004363021071 0ustar rootroot extern int opt_debug; #define ASN_DEBUG(fmt, args...) do { \ if(opt_debug < 2) break; \ fprintf(stderr, fmt, ##args); \ fprintf(stderr, " (%s:%d)\n", \ __FILE__, __LINE__); \ } while(0) asn1c-0.9.24+dfsg/examples/sample.source.PKIX1/Makefile0000644000000000000000000003064311723307766021143 0ustar rootrootASN_MODULE_SOURCES= \ Attribute.c \ AttributeType.c \ AttributeValue.c \ AttributeTypeAndValue.c \ X520name.c \ X520CommonName.c \ X520LocalityName.c \ X520StateOrProvinceName.c \ X520OrganizationName.c \ X520OrganizationalUnitName.c \ X520Title.c \ X520dnQualifier.c \ X520countryName.c \ X520SerialNumber.c \ X520Pseudonym.c \ DomainComponent.c \ EmailAddress.c \ Name.c \ RDNSequence.c \ DistinguishedName.c \ RelativeDistinguishedName.c \ DirectoryString.c \ Certificate.c \ TBSCertificate.c \ Version.c \ CertificateSerialNumber.c \ Validity.c \ Time.c \ UniqueIdentifier.c \ SubjectPublicKeyInfo.c \ Extensions.c \ Extension.c \ CertificateList.c \ TBSCertList.c \ AlgorithmIdentifier.c \ ORAddress.c \ BuiltInStandardAttributes.c \ CountryName.c \ AdministrationDomainName.c \ NetworkAddress.c \ X121Address.c \ TerminalIdentifier.c \ PrivateDomainName.c \ OrganizationName.c \ NumericUserIdentifier.c \ PersonalName.c \ OrganizationalUnitNames.c \ OrganizationalUnitName.c \ BuiltInDomainDefinedAttributes.c \ BuiltInDomainDefinedAttribute.c \ ExtensionAttributes.c \ ExtensionAttribute.c \ CommonName.c \ TeletexCommonName.c \ TeletexOrganizationName.c \ TeletexPersonalName.c \ TeletexOrganizationalUnitNames.c \ TeletexOrganizationalUnitName.c \ PDSName.c \ PhysicalDeliveryCountryName.c \ PostalCode.c \ PhysicalDeliveryOfficeName.c \ PhysicalDeliveryOfficeNumber.c \ ExtensionORAddressComponents.c \ PhysicalDeliveryPersonalName.c \ PhysicalDeliveryOrganizationName.c \ ExtensionPhysicalDeliveryAddressComponents.c \ UnformattedPostalAddress.c \ StreetAddress.c \ PostOfficeBoxAddress.c \ PosteRestanteAddress.c \ UniquePostalName.c \ LocalPostalAttributes.c \ PDSParameter.c \ ExtendedNetworkAddress.c \ PresentationAddress.c \ TerminalType.c \ TeletexDomainDefinedAttributes.c \ TeletexDomainDefinedAttribute.c \ AuthorityKeyIdentifier.c \ KeyIdentifier.c \ SubjectKeyIdentifier.c \ KeyUsage.c \ PrivateKeyUsagePeriod.c \ CertificatePolicies.c \ PolicyInformation.c \ CertPolicyId.c \ PolicyQualifierInfo.c \ PolicyQualifierId.c \ CPSuri.c \ UserNotice.c \ NoticeReference.c \ DisplayText.c \ PolicyMappings.c \ SubjectAltName.c \ GeneralNames.c \ GeneralName.c \ AnotherName.c \ EDIPartyName.c \ IssuerAltName.c \ SubjectDirectoryAttributes.c \ BasicConstraints.c \ NameConstraints.c \ GeneralSubtrees.c \ GeneralSubtree.c \ BaseDistance.c \ PolicyConstraints.c \ SkipCerts.c \ CRLDistributionPoints.c \ DistributionPoint.c \ DistributionPointName.c \ ReasonFlags.c \ ExtKeyUsageSyntax.c \ KeyPurposeId.c \ InhibitAnyPolicy.c \ FreshestCRL.c \ AuthorityInfoAccessSyntax.c \ AccessDescription.c \ SubjectInfoAccessSyntax.c \ CRLNumber.c \ IssuingDistributionPoint.c \ BaseCRLNumber.c \ CRLReason.c \ CertificateIssuer.c \ HoldInstructionCode.c \ InvalidityDate.c ASN_MODULE_HEADERS= \ Attribute.h \ AttributeType.h \ AttributeValue.h \ AttributeTypeAndValue.h \ X520name.h \ X520CommonName.h \ X520LocalityName.h \ X520StateOrProvinceName.h \ X520OrganizationName.h \ X520OrganizationalUnitName.h \ X520Title.h \ X520dnQualifier.h \ X520countryName.h \ X520SerialNumber.h \ X520Pseudonym.h \ DomainComponent.h \ EmailAddress.h \ Name.h \ RDNSequence.h \ DistinguishedName.h \ RelativeDistinguishedName.h \ DirectoryString.h \ Certificate.h \ TBSCertificate.h \ Version.h \ CertificateSerialNumber.h \ Validity.h \ Time.h \ UniqueIdentifier.h \ SubjectPublicKeyInfo.h \ Extensions.h \ Extension.h \ CertificateList.h \ TBSCertList.h \ AlgorithmIdentifier.h \ ORAddress.h \ BuiltInStandardAttributes.h \ CountryName.h \ AdministrationDomainName.h \ NetworkAddress.h \ X121Address.h \ TerminalIdentifier.h \ PrivateDomainName.h \ OrganizationName.h \ NumericUserIdentifier.h \ PersonalName.h \ OrganizationalUnitNames.h \ OrganizationalUnitName.h \ BuiltInDomainDefinedAttributes.h \ BuiltInDomainDefinedAttribute.h \ ExtensionAttributes.h \ ExtensionAttribute.h \ CommonName.h \ TeletexCommonName.h \ TeletexOrganizationName.h \ TeletexPersonalName.h \ TeletexOrganizationalUnitNames.h \ TeletexOrganizationalUnitName.h \ PDSName.h \ PhysicalDeliveryCountryName.h \ PostalCode.h \ PhysicalDeliveryOfficeName.h \ PhysicalDeliveryOfficeNumber.h \ ExtensionORAddressComponents.h \ PhysicalDeliveryPersonalName.h \ PhysicalDeliveryOrganizationName.h \ ExtensionPhysicalDeliveryAddressComponents.h \ UnformattedPostalAddress.h \ StreetAddress.h \ PostOfficeBoxAddress.h \ PosteRestanteAddress.h \ UniquePostalName.h \ LocalPostalAttributes.h \ PDSParameter.h \ ExtendedNetworkAddress.h \ PresentationAddress.h \ TerminalType.h \ TeletexDomainDefinedAttributes.h \ TeletexDomainDefinedAttribute.h \ AuthorityKeyIdentifier.h \ KeyIdentifier.h \ SubjectKeyIdentifier.h \ KeyUsage.h \ PrivateKeyUsagePeriod.h \ CertificatePolicies.h \ PolicyInformation.h \ CertPolicyId.h \ PolicyQualifierInfo.h \ PolicyQualifierId.h \ CPSuri.h \ UserNotice.h \ NoticeReference.h \ DisplayText.h \ PolicyMappings.h \ SubjectAltName.h \ GeneralNames.h \ GeneralName.h \ AnotherName.h \ EDIPartyName.h \ IssuerAltName.h \ SubjectDirectoryAttributes.h \ BasicConstraints.h \ NameConstraints.h \ GeneralSubtrees.h \ GeneralSubtree.h \ BaseDistance.h \ PolicyConstraints.h \ SkipCerts.h \ CRLDistributionPoints.h \ DistributionPoint.h \ DistributionPointName.h \ ReasonFlags.h \ ExtKeyUsageSyntax.h \ KeyPurposeId.h \ InhibitAnyPolicy.h \ FreshestCRL.h \ AuthorityInfoAccessSyntax.h \ AccessDescription.h \ SubjectInfoAccessSyntax.h \ CRLNumber.h \ IssuingDistributionPoint.h \ BaseCRLNumber.h \ CRLReason.h \ CertificateIssuer.h \ HoldInstructionCode.h \ InvalidityDate.h ASN_MODULE_HEADERS+=ANY.h ASN_MODULE_SOURCES+=ANY.c ASN_MODULE_HEADERS+=BMPString.h ASN_MODULE_SOURCES+=BMPString.c ASN_MODULE_HEADERS+=UTF8String.h ASN_MODULE_HEADERS+=BOOLEAN.h ASN_MODULE_SOURCES+=BOOLEAN.c ASN_MODULE_HEADERS+=ENUMERATED.h ASN_MODULE_SOURCES+=ENUMERATED.c ASN_MODULE_HEADERS+=INTEGER.h ASN_MODULE_HEADERS+=NativeEnumerated.h ASN_MODULE_HEADERS+=GeneralizedTime.h ASN_MODULE_SOURCES+=GeneralizedTime.c ASN_MODULE_HEADERS+=IA5String.h ASN_MODULE_SOURCES+=IA5String.c ASN_MODULE_SOURCES+=INTEGER.c ASN_MODULE_SOURCES+=NativeEnumerated.c ASN_MODULE_HEADERS+=NativeInteger.h ASN_MODULE_SOURCES+=NativeInteger.c ASN_MODULE_HEADERS+=NumericString.h ASN_MODULE_SOURCES+=NumericString.c ASN_MODULE_HEADERS+=OBJECT_IDENTIFIER.h ASN_MODULE_SOURCES+=OBJECT_IDENTIFIER.c ASN_MODULE_HEADERS+=PrintableString.h ASN_MODULE_SOURCES+=PrintableString.c ASN_MODULE_HEADERS+=TeletexString.h ASN_MODULE_SOURCES+=TeletexString.c ASN_MODULE_HEADERS+=UTCTime.h ASN_MODULE_SOURCES+=UTCTime.c ASN_MODULE_SOURCES+=UTF8String.c ASN_MODULE_HEADERS+=UniversalString.h ASN_MODULE_SOURCES+=UniversalString.c ASN_MODULE_HEADERS+=VisibleString.h ASN_MODULE_SOURCES+=VisibleString.c ASN_MODULE_HEADERS+=asn_SEQUENCE_OF.h ASN_MODULE_SOURCES+=asn_SEQUENCE_OF.c ASN_MODULE_HEADERS+=asn_SET_OF.h ASN_MODULE_SOURCES+=asn_SET_OF.c ASN_MODULE_HEADERS+=constr_CHOICE.h ASN_MODULE_SOURCES+=constr_CHOICE.c ASN_MODULE_HEADERS+=constr_SEQUENCE.h ASN_MODULE_SOURCES+=constr_SEQUENCE.c ASN_MODULE_HEADERS+=constr_SEQUENCE_OF.h ASN_MODULE_SOURCES+=constr_SEQUENCE_OF.c ASN_MODULE_HEADERS+=constr_SET_OF.h ASN_MODULE_HEADERS+=constr_SET.h ASN_MODULE_SOURCES+=constr_SET.c ASN_MODULE_SOURCES+=constr_SET_OF.c ASN_MODULE_HEADERS+=asn_application.h ASN_MODULE_HEADERS+=asn_system.h ASN_MODULE_HEADERS+=asn_codecs.h ASN_MODULE_HEADERS+=asn_internal.h ASN_MODULE_HEADERS+=OCTET_STRING.h ASN_MODULE_SOURCES+=OCTET_STRING.c ASN_MODULE_HEADERS+=BIT_STRING.h ASN_MODULE_SOURCES+=BIT_STRING.c ASN_MODULE_SOURCES+=asn_codecs_prim.c ASN_MODULE_HEADERS+=asn_codecs_prim.h ASN_MODULE_HEADERS+=ber_tlv_length.h ASN_MODULE_SOURCES+=ber_tlv_length.c ASN_MODULE_HEADERS+=ber_tlv_tag.h ASN_MODULE_SOURCES+=ber_tlv_tag.c ASN_MODULE_HEADERS+=ber_decoder.h ASN_MODULE_SOURCES+=ber_decoder.c ASN_MODULE_HEADERS+=der_encoder.h ASN_MODULE_SOURCES+=der_encoder.c ASN_MODULE_HEADERS+=constr_TYPE.h ASN_MODULE_SOURCES+=constr_TYPE.c ASN_MODULE_HEADERS+=constraints.h ASN_MODULE_SOURCES+=constraints.c ASN_MODULE_HEADERS+=xer_support.h ASN_MODULE_SOURCES+=xer_support.c ASN_MODULE_HEADERS+=xer_decoder.h ASN_MODULE_SOURCES+=xer_decoder.c ASN_MODULE_HEADERS+=xer_encoder.h ASN_MODULE_SOURCES+=xer_encoder.c ASN_MODULE_HEADERS+=per_support.h ASN_MODULE_SOURCES+=per_support.c ASN_MODULE_HEADERS+=per_decoder.h ASN_MODULE_SOURCES+=per_decoder.c ASN_MODULE_HEADERS+=per_encoder.h ASN_MODULE_SOURCES+=per_encoder.c ASN_MODULE_HEADERS+=per_opentype.h ASN_MODULE_SOURCES+=per_opentype.c ASN_CONVERTER_SOURCES+=converter-sample.c lib_LTLIBRARIES=libsomething.la libsomething_la_SOURCES=$(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS) # This file may be used as an input for make(3) # Remove the lines below to convert it into a pure .am file TARGET = x509dump CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -DPDU=Certificate -I. OBJS=${ASN_MODULE_SOURCES:.c=.o} ${ASN_CONVERTER_SOURCES:.c=.o} all: Certificate.c $(TARGET) $(TARGET): ${OBJS} $(CC) $(CFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS) .SUFFIXES: .SUFFIXES: .c .o .c.o: $(CC) $(CFLAGS) -o $@ -c $< clean: rm -f $(TARGET) rm -f $(OBJS) regen: regenerate-from-asn1-source regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons -pdu=Certificate ../rfc3280-PKIX1Explicit88.asn1 ../rfc3280-PKIX1Implicit88.asn1 Certificate.c: ../sample.makefile.regen ../rfc3280-*.asn1 make regen-makefile @touch Certificate.c make regen-makefile: ASN1CMDOPTS="" \ ASN1MODULES="../rfc3280-*.asn1" \ ASN1PDU=Certificate \ PROGNAME=x509dump \ ../sample.makefile.regen check: ${TARGET} check-ber check-xer check-per @echo ================ @echo All tests passed @echo ================ check-ber: @if test -f sample-Certificate-1.[db]er ; then \ for f in sample-Certificate-*.[db]er; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into XER and back ($$b)..."; \ ./${TARGET} -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iber -onull $$f || exit 5; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iber -onull $$f || exit 6; \ done; done; fi check-xer: @if test -f sample-Certificate-1.xer ; then \ for f in sample-Certificate-*.xer; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER and back ($$b)..."; \ ./${TARGET} -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ diff $$f ./.tmp.2.$$$$ || exit 4; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -ixer -onull $$f || exit 5; \ ./${TARGET} -J0.001 -n 1000 -b $$b -ixer -onull $$f || exit 6; \ done; done; fi check-per: @if test -f sample-Certificate-1-nopad.per ; then \ for f in sample-Certificate-[1-9]-nopad.per; do \ for b in 1 17 33 980 8192; do \ echo "Recoding non-padded $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ ./${TARGET} -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \ diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \ rm -f ./.tmp.[123].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 6; \ ./${TARGET} -J0.001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 7; \ done; done; fi @if test -f sample-Certificate-1.per ; then \ for f in sample-*-[1-9].per; do \ pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z-]+)-[0-9].*/\1/"`; \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -p $$pdu -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \ ./${TARGET} -b $$b -p $$pdu -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \ ./${TARGET} -b $$b -p $$pdu -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \ diff $$f ./.tmp.1.$$$$ || exit 6; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iper -onull $$f || exit 7; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iper -onull $$f || exit 8; \ done; done; fi distclean: clean rm -f $(ASN_MODULE_SOURCES) rm -f $(ASN_MODULE_HEADERS) rm -f $(ASN_CONVERTER_SOURCES) $(ASN_CONVERTER_HEADERS) rm -f Makefile.am.sample asn1c-0.9.24+dfsg/examples/sample.source.MHEG5/0000755000000000000000000000000012223077270017434 5ustar rootrootasn1c-0.9.24+dfsg/examples/sample.source.MHEG5/README0000644000000000000000000000200711456135550020316 0ustar rootroot GENERAL INFORMATION =================== The ISO MHEG-5 (Multimedia Hypermedia Experts Group, Multimedia Presentations) decoder. Invoking `make` will first attempt compile the ASN.1 specifications from the ../ISO13522-MHEG-5.asn file. THERE IS NO ISO13522-MHEG-5.asn FILE THERE YET! OBTAINING THE MHEG-5 SPECIFICATION ================================== Due to licensing restrictions, asn1c can not include the MHEG-5 ASN.1 module in its distribution. To obtain the MHEG-5 ASN.1 specification, you should go to http://www.itu.int/ITU-T/asn1/database/itu-t/t/t172 and select the latest "Text" version of the corresponding ASN.1 module. After obtaining the ISO13522-MHEG-5.asn, type `make` in the directory containing this README file. mheg5dump USAGE =============== The mheg5dump utility may be used to dump the contents of the BER-encoded MHEG-5 data record file: ./mheg5dump mhegscene.ber # Print MHEG-5 stream as XML (BASIC-XER) The full list of recognized command line options may be obtained with ./mheg5dump -h asn1c-0.9.24+dfsg/examples/sample.source.MHEG5/sample-InterchangedObject-1.xer0000644000000000000000000001015511456135550025320 0ustar rootroot smth 0 14 ldskfjlsfd 22 3 39 42 0 45 xxx 113 a 5 103 31 3 100 100 asn1c-0.9.24+dfsg/examples/sample.source.MHEG5/config.h0000644000000000000000000000031011472004363021042 0ustar rootroot extern int opt_debug; #define ASN_DEBUG(fmt, args...) do { \ if(opt_debug < 2) break; \ fprintf(stderr, fmt, ##args); \ fprintf(stderr, " (%s:%d)\n", \ __FILE__, __LINE__); \ } while(0) asn1c-0.9.24+dfsg/examples/sample.source.MHEG5/Makefile0000644000000000000000000003206411456135550021104 0ustar rootrootASN_MODULE_SOURCES= \ InterchangedObject.c \ RootClass.c \ GroupClass.c \ StandardIdentifier.c \ GroupItem.c \ ApplicationClass.c \ DefaultAttribute.c \ FontBody.c \ SceneClass.c \ SceneCoordinateSystem.c \ AspectRatio.c \ NextScene.c \ IngredientClass.c \ ContentBody.c \ ReferencedContent.c \ LinkClass.c \ LinkCondition.c \ EventType.c \ EventData.c \ ProgramClass.c \ ResidentProgramClass.c \ RemoteProgramClass.c \ InterchangedProgramClass.c \ PaletteClass.c \ FontClass.c \ CursorShapeClass.c \ VariableClass.c \ OriginalValue.c \ BooleanVariableClass.c \ IntegerVariableClass.c \ OctetStringVariableClass.c \ ObjectRefVariableClass.c \ ContentRefVariableClass.c \ PresentableClass.c \ TokenManagerClass.c \ Movement.c \ TokenGroupClass.c \ TokenGroupItem.c \ ActionSlot.c \ ListGroupClass.c \ VisibleClass.c \ OriginalBoxSize.c \ BitmapClass.c \ LineArtClass.c \ RectangleClass.c \ DynamicLineArtClass.c \ TextClass.c \ Justification.c \ LineOrientation.c \ StartCorner.c \ StreamClass.c \ StreamComponent.c \ Storage.c \ AudioClass.c \ VideoClass.c \ Termination.c \ RTGraphicsClass.c \ InteractibleClass.c \ SliderClass.c \ Orientation.c \ SliderStyle.c \ EntryFieldClass.c \ InputType.c \ HyperTextClass.c \ ButtonClass.c \ HotspotClass.c \ PushButtonClass.c \ SwitchButtonClass.c \ ButtonStyle.c \ ActionClass.c \ ElementaryAction.c \ Add.c \ AddItem.c \ Append.c \ Call.c \ CallActionSlot.c \ Clone.c \ CloseConnection.c \ DelItem.c \ DeselectItem.c \ Divide.c \ DrawArc.c \ DrawLine.c \ DrawOval.c \ DrawPolygon.c \ DrawPolyline.c \ DrawRectangle.c \ DrawSector.c \ Fork.c \ GetAvailabilityStatus.c \ GetBoxSize.c \ GetCellItem.c \ GetCursorPosition.c \ GetEngineSupport.c \ GetEntryPoint.c \ GetFillColour.c \ GetFirstItem.c \ GetHighlightStatus.c \ GetInteractionStatus.c \ GetItemStatus.c \ GetLabel.c \ GetLastAnchorFired.c \ GetLineColour.c \ GetLineStyle.c \ GetLineWidth.c \ GetListItem.c \ GetListSize.c \ GetOverwriteMode.c \ GetPortion.c \ GetPosition.c \ GetRunningStatus.c \ GetSelectionStatus.c \ GetSliderValue.c \ GetTextContent.c \ GetTextData.c \ GetTokenPosition.c \ GetVolume.c \ Modulo.c \ Move.c \ MoveTo.c \ Multiply.c \ OpenConnection.c \ PutBefore.c \ PutBehind.c \ ReadPersistent.c \ ScaleBitmap.c \ ScaleVideo.c \ ScrollItems.c \ SelectItem.c \ SendEvent.c \ SetBoxSize.c \ SetCachePriority.c \ SetCounterEndPosition.c \ SetCounterPosition.c \ SetCounterTrigger.c \ SetCursorPosition.c \ SetCursorShape.c \ SetData.c \ SetEntryPoint.c \ SetFillColour.c \ SetFirstItem.c \ SetFontRef.c \ SetHighlightStatus.c \ SetInteractionStatus.c \ SetLabel.c \ SetLineColour.c \ SetLineStyle.c \ SetLineWidth.c \ SetOverwriteMode.c \ SetPaletteRef.c \ SetPortion.c \ SetPosition.c \ SetSliderValue.c \ SetSpeed.c \ SetTimer.c \ NewTimer.c \ SetTransparency.c \ SetVariable.c \ SetVolume.c \ Step.c \ StorePersistent.c \ Subtract.c \ TestVariable.c \ ToggleItem.c \ TransitionTo.c \ ConnectionTagOrNull.c \ ComparisonValue.c \ EmulatedEventData.c \ NewColour.c \ NewContent.c \ NewFont.c \ NewReferencedContent.c \ NewContentSize.c \ NewVariableValue.c \ Parameter.c \ Point.c \ Rational.c \ ObjectReference.c \ ExternalReference.c \ IndirectReference.c \ ContentReference.c \ GenericObjectReference.c \ GenericContentReference.c \ GenericInteger.c \ GenericBoolean.c \ GenericOctetString.c \ Colour.c \ XYPosition.c \ OctetString.c ASN_MODULE_HEADERS= \ InterchangedObject.h \ RootClass.h \ GroupClass.h \ StandardIdentifier.h \ GroupItem.h \ ApplicationClass.h \ DefaultAttribute.h \ FontBody.h \ SceneClass.h \ SceneCoordinateSystem.h \ AspectRatio.h \ NextScene.h \ IngredientClass.h \ ContentBody.h \ ReferencedContent.h \ LinkClass.h \ LinkCondition.h \ EventType.h \ EventData.h \ ProgramClass.h \ ResidentProgramClass.h \ RemoteProgramClass.h \ InterchangedProgramClass.h \ PaletteClass.h \ FontClass.h \ CursorShapeClass.h \ VariableClass.h \ OriginalValue.h \ BooleanVariableClass.h \ IntegerVariableClass.h \ OctetStringVariableClass.h \ ObjectRefVariableClass.h \ ContentRefVariableClass.h \ PresentableClass.h \ TokenManagerClass.h \ Movement.h \ TokenGroupClass.h \ TokenGroupItem.h \ ActionSlot.h \ ListGroupClass.h \ VisibleClass.h \ OriginalBoxSize.h \ BitmapClass.h \ LineArtClass.h \ RectangleClass.h \ DynamicLineArtClass.h \ TextClass.h \ Justification.h \ LineOrientation.h \ StartCorner.h \ StreamClass.h \ StreamComponent.h \ Storage.h \ AudioClass.h \ VideoClass.h \ Termination.h \ RTGraphicsClass.h \ InteractibleClass.h \ SliderClass.h \ Orientation.h \ SliderStyle.h \ EntryFieldClass.h \ InputType.h \ HyperTextClass.h \ ButtonClass.h \ HotspotClass.h \ PushButtonClass.h \ SwitchButtonClass.h \ ButtonStyle.h \ ActionClass.h \ ElementaryAction.h \ Add.h \ AddItem.h \ Append.h \ Call.h \ CallActionSlot.h \ Clone.h \ CloseConnection.h \ DelItem.h \ DeselectItem.h \ Divide.h \ DrawArc.h \ DrawLine.h \ DrawOval.h \ DrawPolygon.h \ DrawPolyline.h \ DrawRectangle.h \ DrawSector.h \ Fork.h \ GetAvailabilityStatus.h \ GetBoxSize.h \ GetCellItem.h \ GetCursorPosition.h \ GetEngineSupport.h \ GetEntryPoint.h \ GetFillColour.h \ GetFirstItem.h \ GetHighlightStatus.h \ GetInteractionStatus.h \ GetItemStatus.h \ GetLabel.h \ GetLastAnchorFired.h \ GetLineColour.h \ GetLineStyle.h \ GetLineWidth.h \ GetListItem.h \ GetListSize.h \ GetOverwriteMode.h \ GetPortion.h \ GetPosition.h \ GetRunningStatus.h \ GetSelectionStatus.h \ GetSliderValue.h \ GetTextContent.h \ GetTextData.h \ GetTokenPosition.h \ GetVolume.h \ Modulo.h \ Move.h \ MoveTo.h \ Multiply.h \ OpenConnection.h \ PutBefore.h \ PutBehind.h \ ReadPersistent.h \ ScaleBitmap.h \ ScaleVideo.h \ ScrollItems.h \ SelectItem.h \ SendEvent.h \ SetBoxSize.h \ SetCachePriority.h \ SetCounterEndPosition.h \ SetCounterPosition.h \ SetCounterTrigger.h \ SetCursorPosition.h \ SetCursorShape.h \ SetData.h \ SetEntryPoint.h \ SetFillColour.h \ SetFirstItem.h \ SetFontRef.h \ SetHighlightStatus.h \ SetInteractionStatus.h \ SetLabel.h \ SetLineColour.h \ SetLineStyle.h \ SetLineWidth.h \ SetOverwriteMode.h \ SetPaletteRef.h \ SetPortion.h \ SetPosition.h \ SetSliderValue.h \ SetSpeed.h \ SetTimer.h \ NewTimer.h \ SetTransparency.h \ SetVariable.h \ SetVolume.h \ Step.h \ StorePersistent.h \ Subtract.h \ TestVariable.h \ ToggleItem.h \ TransitionTo.h \ ConnectionTagOrNull.h \ ComparisonValue.h \ EmulatedEventData.h \ NewColour.h \ NewContent.h \ NewFont.h \ NewReferencedContent.h \ NewContentSize.h \ NewVariableValue.h \ Parameter.h \ Point.h \ Rational.h \ ObjectReference.h \ ExternalReference.h \ IndirectReference.h \ ContentReference.h \ GenericObjectReference.h \ GenericContentReference.h \ GenericInteger.h \ GenericBoolean.h \ GenericOctetString.h \ Colour.h \ XYPosition.h \ OctetString.h ASN_MODULE_HEADERS+=ANY.h ASN_MODULE_SOURCES+=ANY.c ASN_MODULE_HEADERS+=BOOLEAN.h ASN_MODULE_SOURCES+=BOOLEAN.c ASN_MODULE_HEADERS+=ENUMERATED.h ASN_MODULE_SOURCES+=ENUMERATED.c ASN_MODULE_HEADERS+=INTEGER.h ASN_MODULE_HEADERS+=NativeEnumerated.h ASN_MODULE_HEADERS+=IA5String.h ASN_MODULE_SOURCES+=IA5String.c ASN_MODULE_SOURCES+=INTEGER.c ASN_MODULE_HEADERS+=NULL.h ASN_MODULE_SOURCES+=NULL.c ASN_MODULE_SOURCES+=NativeEnumerated.c ASN_MODULE_HEADERS+=NativeInteger.h ASN_MODULE_SOURCES+=NativeInteger.c ASN_MODULE_HEADERS+=asn_SEQUENCE_OF.h ASN_MODULE_SOURCES+=asn_SEQUENCE_OF.c ASN_MODULE_HEADERS+=asn_SET_OF.h ASN_MODULE_SOURCES+=asn_SET_OF.c ASN_MODULE_HEADERS+=constr_CHOICE.h ASN_MODULE_SOURCES+=constr_CHOICE.c ASN_MODULE_HEADERS+=constr_SEQUENCE.h ASN_MODULE_SOURCES+=constr_SEQUENCE.c ASN_MODULE_HEADERS+=constr_SEQUENCE_OF.h ASN_MODULE_SOURCES+=constr_SEQUENCE_OF.c ASN_MODULE_HEADERS+=constr_SET_OF.h ASN_MODULE_HEADERS+=constr_SET.h ASN_MODULE_SOURCES+=constr_SET.c ASN_MODULE_SOURCES+=constr_SET_OF.c ASN_MODULE_HEADERS+=asn_application.h ASN_MODULE_HEADERS+=asn_system.h ASN_MODULE_HEADERS+=asn_codecs.h ASN_MODULE_HEADERS+=asn_internal.h ASN_MODULE_HEADERS+=OCTET_STRING.h ASN_MODULE_SOURCES+=OCTET_STRING.c ASN_MODULE_HEADERS+=BIT_STRING.h ASN_MODULE_SOURCES+=BIT_STRING.c ASN_MODULE_SOURCES+=asn_codecs_prim.c ASN_MODULE_HEADERS+=asn_codecs_prim.h ASN_MODULE_HEADERS+=ber_tlv_length.h ASN_MODULE_SOURCES+=ber_tlv_length.c ASN_MODULE_HEADERS+=ber_tlv_tag.h ASN_MODULE_SOURCES+=ber_tlv_tag.c ASN_MODULE_HEADERS+=ber_decoder.h ASN_MODULE_SOURCES+=ber_decoder.c ASN_MODULE_HEADERS+=der_encoder.h ASN_MODULE_SOURCES+=der_encoder.c ASN_MODULE_HEADERS+=constr_TYPE.h ASN_MODULE_SOURCES+=constr_TYPE.c ASN_MODULE_HEADERS+=constraints.h ASN_MODULE_SOURCES+=constraints.c ASN_MODULE_HEADERS+=xer_support.h ASN_MODULE_SOURCES+=xer_support.c ASN_MODULE_HEADERS+=xer_decoder.h ASN_MODULE_SOURCES+=xer_decoder.c ASN_MODULE_HEADERS+=xer_encoder.h ASN_MODULE_SOURCES+=xer_encoder.c ASN_MODULE_HEADERS+=per_support.h ASN_MODULE_SOURCES+=per_support.c ASN_MODULE_HEADERS+=per_decoder.h ASN_MODULE_SOURCES+=per_decoder.c ASN_MODULE_HEADERS+=per_encoder.h ASN_MODULE_SOURCES+=per_encoder.c ASN_CONVERTER_SOURCES+=converter-sample.c lib_LTLIBRARIES=libsomething.la libsomething_la_SOURCES=$(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS) # This file may be used as an input for make(3) # Remove the lines below to convert it into a pure .am file TARGET = mheg5dump CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -DPDU=InterchangedObject -I. OBJS=${ASN_MODULE_SOURCES:.c=.o} ${ASN_CONVERTER_SOURCES:.c=.o} all: InterchangedObject.c $(TARGET) $(TARGET): ${OBJS} $(CC) $(CFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS) .SUFFIXES: .SUFFIXES: .c .o .c.o: $(CC) $(CFLAGS) -o $@ -c $< clean: rm -f $(TARGET) rm -f $(OBJS) regen: regenerate-from-asn1-source regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons -pdu=InterchangedObject -fcompound-names ../ISO13522-MHEG-5.asn InterchangedObject.c: ../sample.makefile.regen ../ISO13522-MHEG-5.asn make regen-makefile @touch InterchangedObject.c make regen-makefile: ASN1CMDOPTS="-fcompound-names" \ ASN1MODULES="../ISO13522-MHEG-5.asn" \ ASN1PDU=InterchangedObject \ PROGNAME=mheg5dump \ ../sample.makefile.regen check: ${TARGET} check-ber check-xer check-per @echo ================ @echo All tests passed @echo ================ check-ber: @if test -f sample-InterchangedObject-1.[db]er ; then \ for f in sample-InterchangedObject-*.[db]er; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into XER and back ($$b)..."; \ ./${TARGET} -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iber -onull $$f || exit 2; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iber -onull $$f || exit 2; \ done; done; fi check-xer: @if test -f sample-InterchangedObject-1.xer ; then \ for f in sample-InterchangedObject-*.xer; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER and back ($$b)..."; \ ./${TARGET} -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ diff $$f ./.tmp.2.$$$$ || exit 2; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -ixer -onull $$f || exit 2; \ ./${TARGET} -J0.001 -n 1000 -b $$b -ixer -onull $$f || exit 2; \ done; done; fi check-per: @if test -f sample-InterchangedObject-1.per ; then \ for f in sample-InterchangedObject-[1-9].per; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ ./${TARGET} -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 2; \ diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 2; \ rm -f ./.tmp.[123].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iper -onull $$f || exit 2; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iper -onull $$f || exit 2; \ done; done; fi @if test -f sample-InterchangedObject-1-padded.per ; then \ for f in sample-*-[1-9]-padded.per; do \ pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z-]+)-[0-9].*/\1/"`; \ for b in 1 17 33 980 8192; do \ echo "Recoding byte-padded $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -per-padded -p $$pdu -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -p $$pdu -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \ ./${TARGET} -b $$b -p $$pdu -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 2; \ diff $$f ./.tmp.1.$$$$ || exit 2; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -per-padded -iper -onull $$f || exit 2; \ ./${TARGET} -J0.001 -n 1000 -b $$b -per-padded -iper -onull $$f || exit 2; \ done; done; fi distclean: clean rm -f $(ASN_MODULE_SOURCES) rm -f $(ASN_MODULE_HEADERS) rm -f $(ASN_CONVERTER_SOURCES) $(ASN_CONVERTER_HEADERS) rm -f Makefile.am.sample asn1c-0.9.24+dfsg/examples/sample.source.TAP3/0000755000000000000000000000000012021012775017331 5ustar rootrootasn1c-0.9.24+dfsg/examples/sample.source.TAP3/RadioChannelRequested.c0000644000000000000000000000767511723307653023737 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "RadioChannelRequested.h" int RadioChannelRequested_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void RadioChannelRequested_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void RadioChannelRequested_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { RadioChannelRequested_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int RadioChannelRequested_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { RadioChannelRequested_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t RadioChannelRequested_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { RadioChannelRequested_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t RadioChannelRequested_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { RadioChannelRequested_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t RadioChannelRequested_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { RadioChannelRequested_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t RadioChannelRequested_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { RadioChannelRequested_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_RadioChannelRequested_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (179 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_RadioChannelRequested = { "RadioChannelRequested", "RadioChannelRequested", RadioChannelRequested_free, RadioChannelRequested_print, RadioChannelRequested_constraint, RadioChannelRequested_decode_ber, RadioChannelRequested_encode_der, RadioChannelRequested_decode_xer, RadioChannelRequested_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_RadioChannelRequested_tags_1, sizeof(asn_DEF_RadioChannelRequested_tags_1) /sizeof(asn_DEF_RadioChannelRequested_tags_1[0]) - 1, /* 1 */ asn_DEF_RadioChannelRequested_tags_1, /* Same as above */ sizeof(asn_DEF_RadioChannelRequested_tags_1) /sizeof(asn_DEF_RadioChannelRequested_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GSMQoSRequested.c0000644000000000000000000000762111723307653022450 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "GSMQoSRequested.h" int GSMQoSRequested_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_GSMQoSInformation.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using GSMQoSInformation, * so here we adjust the DEF accordingly. */ static void GSMQoSRequested_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_GSMQoSInformation.free_struct; td->print_struct = asn_DEF_GSMQoSInformation.print_struct; td->ber_decoder = asn_DEF_GSMQoSInformation.ber_decoder; td->der_encoder = asn_DEF_GSMQoSInformation.der_encoder; td->xer_decoder = asn_DEF_GSMQoSInformation.xer_decoder; td->xer_encoder = asn_DEF_GSMQoSInformation.xer_encoder; td->uper_decoder = asn_DEF_GSMQoSInformation.uper_decoder; td->uper_encoder = asn_DEF_GSMQoSInformation.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_GSMQoSInformation.per_constraints; td->elements = asn_DEF_GSMQoSInformation.elements; td->elements_count = asn_DEF_GSMQoSInformation.elements_count; td->specifics = asn_DEF_GSMQoSInformation.specifics; } void GSMQoSRequested_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { GSMQoSRequested_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int GSMQoSRequested_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { GSMQoSRequested_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t GSMQoSRequested_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { GSMQoSRequested_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t GSMQoSRequested_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { GSMQoSRequested_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t GSMQoSRequested_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { GSMQoSRequested_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t GSMQoSRequested_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { GSMQoSRequested_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_GSMQoSRequested_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (272 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_GSMQoSRequested = { "GSMQoSRequested", "GSMQoSRequested", GSMQoSRequested_free, GSMQoSRequested_print, GSMQoSRequested_constraint, GSMQoSRequested_decode_ber, GSMQoSRequested_encode_der, GSMQoSRequested_decode_xer, GSMQoSRequested_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_GSMQoSRequested_tags_1, sizeof(asn_DEF_GSMQoSRequested_tags_1) /sizeof(asn_DEF_GSMQoSRequested_tags_1[0]) - 1, /* 1 */ asn_DEF_GSMQoSRequested_tags_1, /* Same as above */ sizeof(asn_DEF_GSMQoSRequested_tags_1) /sizeof(asn_DEF_GSMQoSRequested_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelInitiatedCFIndicator.c0000644000000000000000000001007411723307653024433 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CamelInitiatedCFIndicator.h" int CamelInitiatedCFIndicator_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CamelInitiatedCFIndicator_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CamelInitiatedCFIndicator_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CamelInitiatedCFIndicator_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CamelInitiatedCFIndicator_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CamelInitiatedCFIndicator_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CamelInitiatedCFIndicator_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CamelInitiatedCFIndicator_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CamelInitiatedCFIndicator_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CamelInitiatedCFIndicator_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CamelInitiatedCFIndicator_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CamelInitiatedCFIndicator_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CamelInitiatedCFIndicator_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CamelInitiatedCFIndicator_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_CamelInitiatedCFIndicator_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (52 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CamelInitiatedCFIndicator = { "CamelInitiatedCFIndicator", "CamelInitiatedCFIndicator", CamelInitiatedCFIndicator_free, CamelInitiatedCFIndicator_print, CamelInitiatedCFIndicator_constraint, CamelInitiatedCFIndicator_decode_ber, CamelInitiatedCFIndicator_encode_der, CamelInitiatedCFIndicator_decode_xer, CamelInitiatedCFIndicator_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CamelInitiatedCFIndicator_tags_1, sizeof(asn_DEF_CamelInitiatedCFIndicator_tags_1) /sizeof(asn_DEF_CamelInitiatedCFIndicator_tags_1[0]) - 1, /* 1 */ asn_DEF_CamelInitiatedCFIndicator_tags_1, /* Same as above */ sizeof(asn_DEF_CamelInitiatedCFIndicator_tags_1) /sizeof(asn_DEF_CamelInitiatedCFIndicator_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSMaxBitRateUplink.c0000644000000000000000000000770311723307653023324 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSMaxBitRateUplink.h" int QoSMaxBitRateUplink_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_OCTET_STRING.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ static void QoSMaxBitRateUplink_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_OCTET_STRING.free_struct; td->print_struct = asn_DEF_OCTET_STRING.print_struct; td->ber_decoder = asn_DEF_OCTET_STRING.ber_decoder; td->der_encoder = asn_DEF_OCTET_STRING.der_encoder; td->xer_decoder = asn_DEF_OCTET_STRING.xer_decoder; td->xer_encoder = asn_DEF_OCTET_STRING.xer_encoder; td->uper_decoder = asn_DEF_OCTET_STRING.uper_decoder; td->uper_encoder = asn_DEF_OCTET_STRING.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_OCTET_STRING.per_constraints; td->elements = asn_DEF_OCTET_STRING.elements; td->elements_count = asn_DEF_OCTET_STRING.elements_count; td->specifics = asn_DEF_OCTET_STRING.specifics; } void QoSMaxBitRateUplink_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSMaxBitRateUplink_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSMaxBitRateUplink_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSMaxBitRateUplink_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSMaxBitRateUplink_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSMaxBitRateUplink_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSMaxBitRateUplink_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSMaxBitRateUplink_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSMaxBitRateUplink_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSMaxBitRateUplink_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSMaxBitRateUplink_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSMaxBitRateUplink_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSMaxBitRateUplink_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (264 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSMaxBitRateUplink = { "QoSMaxBitRateUplink", "QoSMaxBitRateUplink", QoSMaxBitRateUplink_free, QoSMaxBitRateUplink_print, QoSMaxBitRateUplink_constraint, QoSMaxBitRateUplink_decode_ber, QoSMaxBitRateUplink_encode_der, QoSMaxBitRateUplink_decode_xer, QoSMaxBitRateUplink_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSMaxBitRateUplink_tags_1, sizeof(asn_DEF_QoSMaxBitRateUplink_tags_1) /sizeof(asn_DEF_QoSMaxBitRateUplink_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSMaxBitRateUplink_tags_1, /* Same as above */ sizeof(asn_DEF_QoSMaxBitRateUplink_tags_1) /sizeof(asn_DEF_QoSMaxBitRateUplink_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GSMQoSUsed.c0000644000000000000000000000736111723307653021410 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "GSMQoSUsed.h" int GSMQoSUsed_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_GSMQoSInformation.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using GSMQoSInformation, * so here we adjust the DEF accordingly. */ static void GSMQoSUsed_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_GSMQoSInformation.free_struct; td->print_struct = asn_DEF_GSMQoSInformation.print_struct; td->ber_decoder = asn_DEF_GSMQoSInformation.ber_decoder; td->der_encoder = asn_DEF_GSMQoSInformation.der_encoder; td->xer_decoder = asn_DEF_GSMQoSInformation.xer_decoder; td->xer_encoder = asn_DEF_GSMQoSInformation.xer_encoder; td->uper_decoder = asn_DEF_GSMQoSInformation.uper_decoder; td->uper_encoder = asn_DEF_GSMQoSInformation.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_GSMQoSInformation.per_constraints; td->elements = asn_DEF_GSMQoSInformation.elements; td->elements_count = asn_DEF_GSMQoSInformation.elements_count; td->specifics = asn_DEF_GSMQoSInformation.specifics; } void GSMQoSUsed_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { GSMQoSUsed_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int GSMQoSUsed_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { GSMQoSUsed_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t GSMQoSUsed_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { GSMQoSUsed_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t GSMQoSUsed_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { GSMQoSUsed_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t GSMQoSUsed_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { GSMQoSUsed_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t GSMQoSUsed_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { GSMQoSUsed_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_GSMQoSUsed_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (273 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_GSMQoSUsed = { "GSMQoSUsed", "GSMQoSUsed", GSMQoSUsed_free, GSMQoSUsed_print, GSMQoSUsed_constraint, GSMQoSUsed_decode_ber, GSMQoSUsed_encode_der, GSMQoSUsed_decode_xer, GSMQoSUsed_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_GSMQoSUsed_tags_1, sizeof(asn_DEF_GSMQoSUsed_tags_1) /sizeof(asn_DEF_GSMQoSUsed_tags_1[0]) - 1, /* 1 */ asn_DEF_GSMQoSUsed_tags_1, /* Same as above */ sizeof(asn_DEF_GSMQoSUsed_tags_1) /sizeof(asn_DEF_GSMQoSUsed_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/NumberOfChannels.c0000644000000000000000000000743511723307653022711 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "NumberOfChannels.h" int NumberOfChannels_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NumberOfChannels_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NumberOfChannels_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NumberOfChannels_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NumberOfChannels_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NumberOfChannels_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NumberOfChannels_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NumberOfChannels_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NumberOfChannels_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NumberOfChannels_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NumberOfChannels_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NumberOfChannels_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NumberOfChannels_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NumberOfChannels_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_NumberOfChannels_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (161 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NumberOfChannels = { "NumberOfChannels", "NumberOfChannels", NumberOfChannels_free, NumberOfChannels_print, NumberOfChannels_constraint, NumberOfChannels_decode_ber, NumberOfChannels_encode_der, NumberOfChannels_decode_xer, NumberOfChannels_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NumberOfChannels_tags_1, sizeof(asn_DEF_NumberOfChannels_tags_1) /sizeof(asn_DEF_NumberOfChannels_tags_1[0]) - 1, /* 1 */ asn_DEF_NumberOfChannels_tags_1, /* Same as above */ sizeof(asn_DEF_NumberOfChannels_tags_1) /sizeof(asn_DEF_NumberOfChannels_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/VasInformation.c0000644000000000000000000000477411723307653022462 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "VasInformation.h" static asn_TYPE_member_t asn_MBR_VasInformation_1[] = { { ATF_POINTER, 3, offsetof(struct VasInformation, vasCode), (ASN_TAG_CLASS_APPLICATION | (237 << 2)), 0, &asn_DEF_VasCode, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "vasCode" }, { ATF_POINTER, 2, offsetof(struct VasInformation, vasShortDesc), (ASN_TAG_CLASS_APPLICATION | (240 << 2)), 0, &asn_DEF_VasShortDescription, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "vasShortDesc" }, { ATF_POINTER, 1, offsetof(struct VasInformation, vasDesc), (ASN_TAG_CLASS_APPLICATION | (239 << 2)), 0, &asn_DEF_VasDescription, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "vasDesc" }, }; static ber_tlv_tag_t asn_DEF_VasInformation_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (238 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_VasInformation_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (237 << 2)), 0, 0, 0 }, /* vasCode at 1497 */ { (ASN_TAG_CLASS_APPLICATION | (239 << 2)), 2, 0, 0 }, /* vasDesc at 1499 */ { (ASN_TAG_CLASS_APPLICATION | (240 << 2)), 1, 0, 0 } /* vasShortDesc at 1498 */ }; static asn_SEQUENCE_specifics_t asn_SPC_VasInformation_specs_1 = { sizeof(struct VasInformation), offsetof(struct VasInformation, _asn_ctx), asn_MAP_VasInformation_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_VasInformation = { "VasInformation", "VasInformation", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_VasInformation_tags_1, sizeof(asn_DEF_VasInformation_tags_1) /sizeof(asn_DEF_VasInformation_tags_1[0]) - 1, /* 1 */ asn_DEF_VasInformation_tags_1, /* Same as above */ sizeof(asn_DEF_VasInformation_tags_1) /sizeof(asn_DEF_VasInformation_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_VasInformation_1, 3, /* Elements count */ &asn_SPC_VasInformation_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelModification.c0000644000000000000000000000747411723307653023072 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CamelModification.h" int CamelModification_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CamelModification_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CamelModification_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CamelModification_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CamelModification_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CamelModification_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CamelModification_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CamelModification_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CamelModification_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CamelModification_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CamelModification_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CamelModification_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CamelModification_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CamelModification_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_CamelModification_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (53 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CamelModification = { "CamelModification", "CamelModification", CamelModification_free, CamelModification_print, CamelModification_constraint, CamelModification_decode_ber, CamelModification_encode_der, CamelModification_decode_xer, CamelModification_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CamelModification_tags_1, sizeof(asn_DEF_CamelModification_tags_1) /sizeof(asn_DEF_CamelModification_tags_1[0]) - 1, /* 1 */ asn_DEF_CamelModification_tags_1, /* Same as above */ sizeof(asn_DEF_CamelModification_tags_1) /sizeof(asn_DEF_CamelModification_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CalledCountryCode.c0000644000000000000000000000756511723307653023067 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CalledCountryCode.h" int CalledCountryCode_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void CalledCountryCode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void CalledCountryCode_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CalledCountryCode_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CalledCountryCode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CalledCountryCode_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CalledCountryCode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CalledCountryCode_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CalledCountryCode_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CalledCountryCode_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CalledCountryCode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CalledCountryCode_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CalledCountryCode_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CalledCountryCode_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_CalledCountryCode_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (257 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CalledCountryCode = { "CalledCountryCode", "CalledCountryCode", CalledCountryCode_free, CalledCountryCode_print, CalledCountryCode_constraint, CalledCountryCode_decode_ber, CalledCountryCode_encode_der, CalledCountryCode_decode_xer, CalledCountryCode_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CalledCountryCode_tags_1, sizeof(asn_DEF_CalledCountryCode_tags_1) /sizeof(asn_DEF_CalledCountryCode_tags_1[0]) - 1, /* 1 */ asn_DEF_CalledCountryCode_tags_1, /* Same as above */ sizeof(asn_DEF_CalledCountryCode_tags_1) /sizeof(asn_DEF_CalledCountryCode_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSMaxBitRateUplink.h0000644000000000000000000000166311723307653023330 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSMaxBitRateUplink_H_ #define _QoSMaxBitRateUplink_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSMaxBitRateUplink */ typedef OCTET_STRING_t QoSMaxBitRateUplink_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSMaxBitRateUplink; asn_struct_free_f QoSMaxBitRateUplink_free; asn_struct_print_f QoSMaxBitRateUplink_print; asn_constr_check_f QoSMaxBitRateUplink_constraint; ber_type_decoder_f QoSMaxBitRateUplink_decode_ber; der_type_encoder_f QoSMaxBitRateUplink_encode_der; xer_type_decoder_f QoSMaxBitRateUplink_decode_xer; xer_type_encoder_f QoSMaxBitRateUplink_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSMaxBitRateUplink_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelCallReferenceNumber.c0000644000000000000000000001007011723307653024312 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CamelCallReferenceNumber.h" int CamelCallReferenceNumber_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_HexString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using HexString, * so here we adjust the DEF accordingly. */ static void CamelCallReferenceNumber_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_HexString.free_struct; td->print_struct = asn_DEF_HexString.print_struct; td->ber_decoder = asn_DEF_HexString.ber_decoder; td->der_encoder = asn_DEF_HexString.der_encoder; td->xer_decoder = asn_DEF_HexString.xer_decoder; td->xer_encoder = asn_DEF_HexString.xer_encoder; td->uper_decoder = asn_DEF_HexString.uper_decoder; td->uper_encoder = asn_DEF_HexString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_HexString.per_constraints; td->elements = asn_DEF_HexString.elements; td->elements_count = asn_DEF_HexString.elements_count; td->specifics = asn_DEF_HexString.specifics; } void CamelCallReferenceNumber_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CamelCallReferenceNumber_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CamelCallReferenceNumber_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CamelCallReferenceNumber_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CamelCallReferenceNumber_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CamelCallReferenceNumber_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CamelCallReferenceNumber_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CamelCallReferenceNumber_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CamelCallReferenceNumber_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CamelCallReferenceNumber_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CamelCallReferenceNumber_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CamelCallReferenceNumber_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_CamelCallReferenceNumber_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (50 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CamelCallReferenceNumber = { "CamelCallReferenceNumber", "CamelCallReferenceNumber", CamelCallReferenceNumber_free, CamelCallReferenceNumber_print, CamelCallReferenceNumber_constraint, CamelCallReferenceNumber_decode_ber, CamelCallReferenceNumber_encode_der, CamelCallReferenceNumber_decode_xer, CamelCallReferenceNumber_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CamelCallReferenceNumber_tags_1, sizeof(asn_DEF_CamelCallReferenceNumber_tags_1) /sizeof(asn_DEF_CamelCallReferenceNumber_tags_1[0]) - 1, /* 1 */ asn_DEF_CamelCallReferenceNumber_tags_1, /* Same as above */ sizeof(asn_DEF_CamelCallReferenceNumber_tags_1) /sizeof(asn_DEF_CamelCallReferenceNumber_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/HSCSDInformation.c0000644000000000000000000000450111723307653022561 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "HSCSDInformation.h" static asn_TYPE_member_t asn_MBR_HSCSDInformation_1[] = { { ATF_POINTER, 2, offsetof(struct HSCSDInformation, basicHSCSDParameters), (ASN_TAG_CLASS_APPLICATION | (35 << 2)), 0, &asn_DEF_BasicHSCSDParameters, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "basicHSCSDParameters" }, { ATF_POINTER, 1, offsetof(struct HSCSDInformation, hSCSDParameterModificationList), (ASN_TAG_CLASS_APPLICATION | (140 << 2)), 0, &asn_DEF_HSCSDParameterModificationList, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "hSCSDParameterModificationList" }, }; static ber_tlv_tag_t asn_DEF_HSCSDInformation_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (124 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_HSCSDInformation_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (35 << 2)), 0, 0, 0 }, /* basicHSCSDParameters at 841 */ { (ASN_TAG_CLASS_APPLICATION | (140 << 2)), 1, 0, 0 } /* hSCSDParameterModificationList at 842 */ }; static asn_SEQUENCE_specifics_t asn_SPC_HSCSDInformation_specs_1 = { sizeof(struct HSCSDInformation), offsetof(struct HSCSDInformation, _asn_ctx), asn_MAP_HSCSDInformation_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_HSCSDInformation = { "HSCSDInformation", "HSCSDInformation", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_HSCSDInformation_tags_1, sizeof(asn_DEF_HSCSDInformation_tags_1) /sizeof(asn_DEF_HSCSDInformation_tags_1[0]) - 1, /* 1 */ asn_DEF_HSCSDInformation_tags_1, /* Same as above */ sizeof(asn_DEF_HSCSDInformation_tags_1) /sizeof(asn_DEF_HSCSDInformation_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_HSCSDInformation_1, 2, /* Elements count */ &asn_SPC_HSCSDInformation_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/TotalChargeValueList.c0000644000000000000000000000317711723307653023545 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "TotalChargeValueList.h" static asn_TYPE_member_t asn_MBR_TotalChargeValueList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (222 << 2)), 0, &asn_DEF_TotalChargeValue, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_TotalChargeValueList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (224 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_TotalChargeValueList_specs_1 = { sizeof(struct TotalChargeValueList), offsetof(struct TotalChargeValueList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_TotalChargeValueList = { "TotalChargeValueList", "TotalChargeValueList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TotalChargeValueList_tags_1, sizeof(asn_DEF_TotalChargeValueList_tags_1) /sizeof(asn_DEF_TotalChargeValueList_tags_1[0]) - 1, /* 1 */ asn_DEF_TotalChargeValueList_tags_1, /* Same as above */ sizeof(asn_DEF_TotalChargeValueList_tags_1) /sizeof(asn_DEF_TotalChargeValueList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_TotalChargeValueList_1, 1, /* Single element */ &asn_SPC_TotalChargeValueList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/IPTextV6Address.c0000644000000000000000000000746511723307653022422 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "IPTextV6Address.h" int IPTextV6Address_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void IPTextV6Address_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void IPTextV6Address_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { IPTextV6Address_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int IPTextV6Address_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { IPTextV6Address_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t IPTextV6Address_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { IPTextV6Address_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t IPTextV6Address_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { IPTextV6Address_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t IPTextV6Address_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { IPTextV6Address_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t IPTextV6Address_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { IPTextV6Address_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_IPTextV6Address_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (132 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_IPTextV6Address = { "IPTextV6Address", "IPTextV6Address", IPTextV6Address_free, IPTextV6Address_print, IPTextV6Address_constraint, IPTextV6Address_decode_ber, IPTextV6Address_encode_der, IPTextV6Address_decode_xer, IPTextV6Address_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_IPTextV6Address_tags_1, sizeof(asn_DEF_IPTextV6Address_tags_1) /sizeof(asn_DEF_IPTextV6Address_tags_1[0]) - 1, /* 1 */ asn_DEF_IPTextV6Address_tags_1, /* Same as above */ sizeof(asn_DEF_IPTextV6Address_tags_1) /sizeof(asn_DEF_IPTextV6Address_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/IPTextV4Address.h0000644000000000000000000000157511723307653022421 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _IPTextV4Address_H_ #define _IPTextV4Address_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* IPTextV4Address */ typedef AsciiString_t IPTextV4Address_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_IPTextV4Address; asn_struct_free_f IPTextV4Address_free; asn_struct_print_f IPTextV4Address_print; asn_constr_check_f IPTextV4Address_constraint; ber_type_decoder_f IPTextV4Address_decode_ber; der_type_encoder_f IPTextV4Address_encode_der; xer_type_decoder_f IPTextV4Address_decode_xer; xer_type_encoder_f IPTextV4Address_encode_xer; #ifdef __cplusplus } #endif #endif /* _IPTextV4Address_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSMeanThroughput.c0000644000000000000000000000747511723307653023121 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSMeanThroughput.h" int QoSMeanThroughput_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void QoSMeanThroughput_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void QoSMeanThroughput_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSMeanThroughput_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSMeanThroughput_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSMeanThroughput_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSMeanThroughput_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSMeanThroughput_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSMeanThroughput_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSMeanThroughput_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSMeanThroughput_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSMeanThroughput_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSMeanThroughput_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSMeanThroughput_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSMeanThroughput_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (173 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSMeanThroughput = { "QoSMeanThroughput", "QoSMeanThroughput", QoSMeanThroughput_free, QoSMeanThroughput_print, QoSMeanThroughput_constraint, QoSMeanThroughput_decode_ber, QoSMeanThroughput_encode_der, QoSMeanThroughput_decode_xer, QoSMeanThroughput_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSMeanThroughput_tags_1, sizeof(asn_DEF_QoSMeanThroughput_tags_1) /sizeof(asn_DEF_QoSMeanThroughput_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSMeanThroughput_tags_1, /* Same as above */ sizeof(asn_DEF_QoSMeanThroughput_tags_1) /sizeof(asn_DEF_QoSMeanThroughput_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSAllocRetenPriority.h0000644000000000000000000000170311723307653023732 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSAllocRetenPriority_H_ #define _QoSAllocRetenPriority_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSAllocRetenPriority */ typedef INTEGER_t QoSAllocRetenPriority_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSAllocRetenPriority; asn_struct_free_f QoSAllocRetenPriority_free; asn_struct_print_f QoSAllocRetenPriority_print; asn_constr_check_f QoSAllocRetenPriority_constraint; ber_type_decoder_f QoSAllocRetenPriority_decode_ber; der_type_encoder_f QoSAllocRetenPriority_encode_der; xer_type_decoder_f QoSAllocRetenPriority_decode_xer; xer_type_encoder_f QoSAllocRetenPriority_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSAllocRetenPriority_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/README0000644000000000000000000000245411466227205020226 0ustar rootroot GENERAL INFORMATION =================== The GSM TAP3 (Transferred Account Procedure, Version 3) decoder. Invoking `make` will compile the ASN.1 specifications from the ../tap3.asn1 file. THERE IS NO tap3.asn1 FILE THERE YET! OBTAINING THE TAP3 SPECIFICATION ================================ Due to licensing restrictions, asn1c can not include the TAP3 ASN.1 module in its distribution. To obtain the TAP3 ASN.1 specification, you should go to http://www.gsmworld.com/using/billing/tap3_legal.html and agree with their licensing terms by clicking the "I ACCEPT" button. A .ZIP file with several Microsoft Word .DOC files will download shortly. You should extract the TAP-0311 ASN.1 module from one of these .DOC files and save it as the ../tap3.asn1 file. The ../tap3.asn1 file should start with the following line "TAP-0311 DEFINITIONS IMPLICIT TAGS ::=" and end with the "END" token. Be careful not to copy any non-ASN.1 preambles from that .DOC file. After obtaining the tap3.asn1, type `make` in the directory containing this README file. tap3dump USAGE ============== The tap3dump utility may be used to dump the contents of the BER-encoded TAP3 data record file: ./tap3dump tapfile.ber # Print as XML (BASIC-XER) The full list of recognized command line options may be obtained with > ./tap3dump -h asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSTrafficClass.c0000644000000000000000000000737511723307653022512 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSTrafficClass.h" int QoSTrafficClass_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void QoSTrafficClass_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void QoSTrafficClass_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSTrafficClass_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSTrafficClass_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSTrafficClass_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSTrafficClass_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSTrafficClass_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSTrafficClass_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSTrafficClass_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSTrafficClass_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSTrafficClass_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSTrafficClass_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSTrafficClass_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSTrafficClass_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (268 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSTrafficClass = { "QoSTrafficClass", "QoSTrafficClass", QoSTrafficClass_free, QoSTrafficClass_print, QoSTrafficClass_constraint, QoSTrafficClass_decode_ber, QoSTrafficClass_encode_der, QoSTrafficClass_decode_xer, QoSTrafficClass_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSTrafficClass_tags_1, sizeof(asn_DEF_QoSTrafficClass_tags_1) /sizeof(asn_DEF_QoSTrafficClass_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSTrafficClass_tags_1, /* Same as above */ sizeof(asn_DEF_QoSTrafficClass_tags_1) /sizeof(asn_DEF_QoSTrafficClass_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DualBearerServiceCode.h0000644000000000000000000000170711723307653023643 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _DualBearerServiceCode_H_ #define _DualBearerServiceCode_H_ #include /* Including external dependencies */ #include "HexString.h" #ifdef __cplusplus extern "C" { #endif /* DualBearerServiceCode */ typedef HexString_t DualBearerServiceCode_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_DualBearerServiceCode; asn_struct_free_f DualBearerServiceCode_free; asn_struct_print_f DualBearerServiceCode_print; asn_constr_check_f DualBearerServiceCode_constraint; ber_type_decoder_f DualBearerServiceCode_decode_ber; der_type_encoder_f DualBearerServiceCode_encode_der; xer_type_decoder_f DualBearerServiceCode_decode_xer; xer_type_encoder_f DualBearerServiceCode_encode_xer; #ifdef __cplusplus } #endif #endif /* _DualBearerServiceCode_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/SpeechVersionRequested.c0000644000000000000000000001006111723307653024144 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "SpeechVersionRequested.h" int SpeechVersionRequested_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_SpeechVersion.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using SpeechVersion, * so here we adjust the DEF accordingly. */ static void SpeechVersionRequested_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_SpeechVersion.free_struct; td->print_struct = asn_DEF_SpeechVersion.print_struct; td->ber_decoder = asn_DEF_SpeechVersion.ber_decoder; td->der_encoder = asn_DEF_SpeechVersion.der_encoder; td->xer_decoder = asn_DEF_SpeechVersion.xer_decoder; td->xer_encoder = asn_DEF_SpeechVersion.xer_encoder; td->uper_decoder = asn_DEF_SpeechVersion.uper_decoder; td->uper_encoder = asn_DEF_SpeechVersion.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_SpeechVersion.per_constraints; td->elements = asn_DEF_SpeechVersion.elements; td->elements_count = asn_DEF_SpeechVersion.elements_count; td->specifics = asn_DEF_SpeechVersion.specifics; } void SpeechVersionRequested_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { SpeechVersionRequested_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int SpeechVersionRequested_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { SpeechVersionRequested_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t SpeechVersionRequested_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { SpeechVersionRequested_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t SpeechVersionRequested_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { SpeechVersionRequested_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t SpeechVersionRequested_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { SpeechVersionRequested_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t SpeechVersionRequested_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { SpeechVersionRequested_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_SpeechVersionRequested_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (202 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_SpeechVersionRequested = { "SpeechVersionRequested", "SpeechVersionRequested", SpeechVersionRequested_free, SpeechVersionRequested_print, SpeechVersionRequested_constraint, SpeechVersionRequested_decode_ber, SpeechVersionRequested_encode_der, SpeechVersionRequested_decode_xer, SpeechVersionRequested_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SpeechVersionRequested_tags_1, sizeof(asn_DEF_SpeechVersionRequested_tags_1) /sizeof(asn_DEF_SpeechVersionRequested_tags_1[0]) - 1, /* 1 */ asn_DEF_SpeechVersionRequested_tags_1, /* Same as above */ sizeof(asn_DEF_SpeechVersionRequested_tags_1) /sizeof(asn_DEF_SpeechVersionRequested_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DataVolumeReference.h0000644000000000000000000000165111723307653023377 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _DataVolumeReference_H_ #define _DataVolumeReference_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* DataVolumeReference */ typedef INTEGER_t DataVolumeReference_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_DataVolumeReference; asn_struct_free_f DataVolumeReference_free; asn_struct_print_f DataVolumeReference_print; asn_constr_check_f DataVolumeReference_constraint; ber_type_decoder_f DataVolumeReference_decode_ber; der_type_encoder_f DataVolumeReference_encode_der; xer_type_decoder_f DataVolumeReference_decode_xer; xer_type_encoder_f DataVolumeReference_encode_xer; #ifdef __cplusplus } #endif #endif /* _DataVolumeReference_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSPeakThroughput.h0000644000000000000000000000161711723307653023116 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSPeakThroughput_H_ #define _QoSPeakThroughput_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSPeakThroughput */ typedef INTEGER_t QoSPeakThroughput_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSPeakThroughput; asn_struct_free_f QoSPeakThroughput_free; asn_struct_print_f QoSPeakThroughput_print; asn_constr_check_f QoSPeakThroughput_constraint; ber_type_decoder_f QoSPeakThroughput_decode_ber; der_type_encoder_f QoSPeakThroughput_encode_der; xer_type_decoder_f QoSPeakThroughput_decode_xer; xer_type_encoder_f QoSPeakThroughput_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSPeakThroughput_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GsnAddress.h0000644000000000000000000000147011723307653021553 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _GsnAddress_H_ #define _GsnAddress_H_ #include /* Including external dependencies */ #include "IpAddress.h" #ifdef __cplusplus extern "C" { #endif /* GsnAddress */ typedef IpAddress_t GsnAddress_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_GsnAddress; asn_struct_free_f GsnAddress_free; asn_struct_print_f GsnAddress_print; asn_constr_check_f GsnAddress_constraint; ber_type_decoder_f GsnAddress_decode_ber; der_type_encoder_f GsnAddress_encode_der; xer_type_decoder_f GsnAddress_decode_xer; xer_type_encoder_f GsnAddress_encode_xer; #ifdef __cplusplus } #endif #endif /* _GsnAddress_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DualTeleServiceCode.c0000644000000000000000000000763111723307653023331 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "DualTeleServiceCode.h" int DualTeleServiceCode_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_HexString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using HexString, * so here we adjust the DEF accordingly. */ static void DualTeleServiceCode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_HexString.free_struct; td->print_struct = asn_DEF_HexString.print_struct; td->ber_decoder = asn_DEF_HexString.ber_decoder; td->der_encoder = asn_DEF_HexString.der_encoder; td->xer_decoder = asn_DEF_HexString.xer_decoder; td->xer_encoder = asn_DEF_HexString.xer_encoder; td->uper_decoder = asn_DEF_HexString.uper_decoder; td->uper_encoder = asn_DEF_HexString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_HexString.per_constraints; td->elements = asn_DEF_HexString.elements; td->elements_count = asn_DEF_HexString.elements_count; td->specifics = asn_DEF_HexString.specifics; } void DualTeleServiceCode_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { DualTeleServiceCode_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int DualTeleServiceCode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { DualTeleServiceCode_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t DualTeleServiceCode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { DualTeleServiceCode_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t DualTeleServiceCode_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { DualTeleServiceCode_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t DualTeleServiceCode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { DualTeleServiceCode_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t DualTeleServiceCode_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { DualTeleServiceCode_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_DualTeleServiceCode_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (100 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_DualTeleServiceCode = { "DualTeleServiceCode", "DualTeleServiceCode", DualTeleServiceCode_free, DualTeleServiceCode_print, DualTeleServiceCode_constraint, DualTeleServiceCode_decode_ber, DualTeleServiceCode_encode_der, DualTeleServiceCode_decode_xer, DualTeleServiceCode_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_DualTeleServiceCode_tags_1, sizeof(asn_DEF_DualTeleServiceCode_tags_1) /sizeof(asn_DEF_DualTeleServiceCode_tags_1[0]) - 1, /* 1 */ asn_DEF_DualTeleServiceCode_tags_1, /* Same as above */ sizeof(asn_DEF_DualTeleServiceCode_tags_1) /sizeof(asn_DEF_DualTeleServiceCode_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DayCategory.h0000644000000000000000000000151111723307653021725 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _DayCategory_H_ #define _DayCategory_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* DayCategory */ typedef AsciiString_t DayCategory_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_DayCategory; asn_struct_free_f DayCategory_free; asn_struct_print_f DayCategory_print; asn_constr_check_f DayCategory_constraint; ber_type_decoder_f DayCategory_decode_ber; der_type_encoder_f DayCategory_encode_der; xer_type_decoder_f DayCategory_decode_xer; xer_type_encoder_f DayCategory_encode_xer; #ifdef __cplusplus } #endif #endif /* _DayCategory_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ChargingCharacteristics.c0000644000000000000000000001010311723307653024260 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "ChargingCharacteristics.h" int ChargingCharacteristics_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_OCTET_STRING.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ static void ChargingCharacteristics_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_OCTET_STRING.free_struct; td->print_struct = asn_DEF_OCTET_STRING.print_struct; td->ber_decoder = asn_DEF_OCTET_STRING.ber_decoder; td->der_encoder = asn_DEF_OCTET_STRING.der_encoder; td->xer_decoder = asn_DEF_OCTET_STRING.xer_decoder; td->xer_encoder = asn_DEF_OCTET_STRING.xer_encoder; td->uper_decoder = asn_DEF_OCTET_STRING.uper_decoder; td->uper_encoder = asn_DEF_OCTET_STRING.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_OCTET_STRING.per_constraints; td->elements = asn_DEF_OCTET_STRING.elements; td->elements_count = asn_DEF_OCTET_STRING.elements_count; td->specifics = asn_DEF_OCTET_STRING.specifics; } void ChargingCharacteristics_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { ChargingCharacteristics_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int ChargingCharacteristics_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { ChargingCharacteristics_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t ChargingCharacteristics_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { ChargingCharacteristics_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t ChargingCharacteristics_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { ChargingCharacteristics_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t ChargingCharacteristics_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { ChargingCharacteristics_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t ChargingCharacteristics_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { ChargingCharacteristics_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_ChargingCharacteristics_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (263 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_ChargingCharacteristics = { "ChargingCharacteristics", "ChargingCharacteristics", ChargingCharacteristics_free, ChargingCharacteristics_print, ChargingCharacteristics_constraint, ChargingCharacteristics_decode_ber, ChargingCharacteristics_encode_der, ChargingCharacteristics_decode_xer, ChargingCharacteristics_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ChargingCharacteristics_tags_1, sizeof(asn_DEF_ChargingCharacteristics_tags_1) /sizeof(asn_DEF_ChargingCharacteristics_tags_1[0]) - 1, /* 1 */ asn_DEF_ChargingCharacteristics_tags_1, /* Same as above */ sizeof(asn_DEF_ChargingCharacteristics_tags_1) /sizeof(asn_DEF_ChargingCharacteristics_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/UMTSQoSInformation.c0000644000000000000000000000747011723307653023140 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "UMTSQoSInformation.h" static asn_TYPE_member_t asn_MBR_UMTSQoSInformation_1[] = { { ATF_POINTER, 6, offsetof(struct UMTSQoSInformation, trafficClass), (ASN_TAG_CLASS_APPLICATION | (268 << 2)), 0, &asn_DEF_QoSTrafficClass, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "trafficClass" }, { ATF_POINTER, 5, offsetof(struct UMTSQoSInformation, maxBitRateUplink), (ASN_TAG_CLASS_APPLICATION | (264 << 2)), 0, &asn_DEF_QoSMaxBitRateUplink, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "maxBitRateUplink" }, { ATF_POINTER, 4, offsetof(struct UMTSQoSInformation, maxBitRateDownlink), (ASN_TAG_CLASS_APPLICATION | (274 << 2)), 0, &asn_DEF_QoSMaxBitRateDownlink, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "maxBitRateDownlink" }, { ATF_POINTER, 3, offsetof(struct UMTSQoSInformation, qoSGuaranteedBitRateDownlink), (ASN_TAG_CLASS_APPLICATION | (283 << 2)), 0, &asn_DEF_QoSGuaranteedBitRateDownlink, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "qoSGuaranteedBitRateDownlink" }, { ATF_POINTER, 2, offsetof(struct UMTSQoSInformation, qoSGuaranteedBitRateUplink), (ASN_TAG_CLASS_APPLICATION | (284 << 2)), 0, &asn_DEF_QoSGuaranteedBitRateUplink, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "qoSGuaranteedBitRateUplink" }, { ATF_POINTER, 1, offsetof(struct UMTSQoSInformation, allocRetenPriority), (ASN_TAG_CLASS_APPLICATION | (275 << 2)), 0, &asn_DEF_QoSAllocRetenPriority, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "allocRetenPriority" }, }; static ber_tlv_tag_t asn_DEF_UMTSQoSInformation_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_UMTSQoSInformation_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (264 << 2)), 1, 0, 0 }, /* maxBitRateUplink at 1457 */ { (ASN_TAG_CLASS_APPLICATION | (268 << 2)), 0, 0, 0 }, /* trafficClass at 1456 */ { (ASN_TAG_CLASS_APPLICATION | (274 << 2)), 2, 0, 0 }, /* maxBitRateDownlink at 1458 */ { (ASN_TAG_CLASS_APPLICATION | (275 << 2)), 5, 0, 0 }, /* allocRetenPriority at 1461 */ { (ASN_TAG_CLASS_APPLICATION | (283 << 2)), 3, 0, 0 }, /* qoSGuaranteedBitRateDownlink at 1459 */ { (ASN_TAG_CLASS_APPLICATION | (284 << 2)), 4, 0, 0 } /* qoSGuaranteedBitRateUplink at 1460 */ }; static asn_SEQUENCE_specifics_t asn_SPC_UMTSQoSInformation_specs_1 = { sizeof(struct UMTSQoSInformation), offsetof(struct UMTSQoSInformation, _asn_ctx), asn_MAP_UMTSQoSInformation_tag2el_1, 6, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_UMTSQoSInformation = { "UMTSQoSInformation", "UMTSQoSInformation", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_UMTSQoSInformation_tags_1, sizeof(asn_DEF_UMTSQoSInformation_tags_1) /sizeof(asn_DEF_UMTSQoSInformation_tags_1[0]), /* 1 */ asn_DEF_UMTSQoSInformation_tags_1, /* Same as above */ sizeof(asn_DEF_UMTSQoSInformation_tags_1) /sizeof(asn_DEF_UMTSQoSInformation_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_UMTSQoSInformation_1, 6, /* Elements count */ &asn_SPC_UMTSQoSInformation_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CalledNumAnalysisCode.c0000644000000000000000000000767611723307653023672 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CalledNumAnalysisCode.h" int CalledNumAnalysisCode_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Code.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Code, * so here we adjust the DEF accordingly. */ static void CalledNumAnalysisCode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Code.free_struct; td->print_struct = asn_DEF_Code.print_struct; td->ber_decoder = asn_DEF_Code.ber_decoder; td->der_encoder = asn_DEF_Code.der_encoder; td->xer_decoder = asn_DEF_Code.xer_decoder; td->xer_encoder = asn_DEF_Code.xer_encoder; td->uper_decoder = asn_DEF_Code.uper_decoder; td->uper_encoder = asn_DEF_Code.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Code.per_constraints; td->elements = asn_DEF_Code.elements; td->elements_count = asn_DEF_Code.elements_count; td->specifics = asn_DEF_Code.specifics; } void CalledNumAnalysisCode_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CalledNumAnalysisCode_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CalledNumAnalysisCode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CalledNumAnalysisCode_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CalledNumAnalysisCode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CalledNumAnalysisCode_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CalledNumAnalysisCode_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CalledNumAnalysisCode_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CalledNumAnalysisCode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CalledNumAnalysisCode_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CalledNumAnalysisCode_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CalledNumAnalysisCode_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_CalledNumAnalysisCode_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (247 << 2)), (ASN_TAG_CLASS_APPLICATION | (243 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CalledNumAnalysisCode = { "CalledNumAnalysisCode", "CalledNumAnalysisCode", CalledNumAnalysisCode_free, CalledNumAnalysisCode_print, CalledNumAnalysisCode_constraint, CalledNumAnalysisCode_decode_ber, CalledNumAnalysisCode_encode_der, CalledNumAnalysisCode_decode_xer, CalledNumAnalysisCode_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CalledNumAnalysisCode_tags_1, sizeof(asn_DEF_CalledNumAnalysisCode_tags_1) /sizeof(asn_DEF_CalledNumAnalysisCode_tags_1[0]) - 2, /* 1 */ asn_DEF_CalledNumAnalysisCode_tags_1, /* Same as above */ sizeof(asn_DEF_CalledNumAnalysisCode_tags_1) /sizeof(asn_DEF_CalledNumAnalysisCode_tags_1[0]), /* 3 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/IpAddress.h0000644000000000000000000000174311723307653021377 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _IpAddress_H_ #define _IpAddress_H_ #include /* Including external dependencies */ #include "IPTextV4Address.h" #include "IPTextV6Address.h" #include #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum IpAddress_PR { IpAddress_PR_NOTHING, /* No components present */ IpAddress_PR_iPTextV4Address, IpAddress_PR_iPTextV6Address } IpAddress_PR; /* IpAddress */ typedef struct IpAddress { IpAddress_PR present; union IpAddress_u { IPTextV4Address_t iPTextV4Address; IPTextV6Address_t iPTextV6Address; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } IpAddress_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_IpAddress; #ifdef __cplusplus } #endif #endif /* _IpAddress_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GprsServiceUsageList.h0000644000000000000000000000160511723307653023573 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _GprsServiceUsageList_H_ #define _GprsServiceUsageList_H_ #include /* Including external dependencies */ #include #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct GprsServiceUsage; /* GprsServiceUsageList */ typedef struct GprsServiceUsageList { A_SEQUENCE_OF(struct GprsServiceUsage) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } GprsServiceUsageList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_GprsServiceUsageList; #ifdef __cplusplus } #endif /* Referred external types */ #include "GprsServiceUsage.h" #endif /* _GprsServiceUsageList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ValueAddedServiceUsed.c0000644000000000000000000000530011723307653023645 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "ValueAddedServiceUsed.h" static asn_TYPE_member_t asn_MBR_ValueAddedServiceUsed_1[] = { { ATF_POINTER, 3, offsetof(struct ValueAddedServiceUsed, vasCode), (ASN_TAG_CLASS_APPLICATION | (237 << 2)), 0, &asn_DEF_VasCode, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "vasCode" }, { ATF_POINTER, 2, offsetof(struct ValueAddedServiceUsed, chargingTimeStamp), (ASN_TAG_CLASS_APPLICATION | (74 << 2)), 0, &asn_DEF_ChargingTimeStamp, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "chargingTimeStamp" }, { ATF_POINTER, 1, offsetof(struct ValueAddedServiceUsed, chargeInformation), (ASN_TAG_CLASS_APPLICATION | (69 << 2)), 0, &asn_DEF_ChargeInformation, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "chargeInformation" }, }; static ber_tlv_tag_t asn_DEF_ValueAddedServiceUsed_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (236 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ValueAddedServiceUsed_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (69 << 2)), 2, 0, 0 }, /* chargeInformation at 1486 */ { (ASN_TAG_CLASS_APPLICATION | (74 << 2)), 1, 0, 0 }, /* chargingTimeStamp at 1485 */ { (ASN_TAG_CLASS_APPLICATION | (237 << 2)), 0, 0, 0 } /* vasCode at 1484 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ValueAddedServiceUsed_specs_1 = { sizeof(struct ValueAddedServiceUsed), offsetof(struct ValueAddedServiceUsed, _asn_ctx), asn_MAP_ValueAddedServiceUsed_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_ValueAddedServiceUsed = { "ValueAddedServiceUsed", "ValueAddedServiceUsed", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ValueAddedServiceUsed_tags_1, sizeof(asn_DEF_ValueAddedServiceUsed_tags_1) /sizeof(asn_DEF_ValueAddedServiceUsed_tags_1[0]) - 1, /* 1 */ asn_DEF_ValueAddedServiceUsed_tags_1, /* Same as above */ sizeof(asn_DEF_ValueAddedServiceUsed_tags_1) /sizeof(asn_DEF_ValueAddedServiceUsed_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_ValueAddedServiceUsed_1, 3, /* Elements count */ &asn_SPC_ValueAddedServiceUsed_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSPrecedence.h0000644000000000000000000000153311723307653022176 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSPrecedence_H_ #define _QoSPrecedence_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSPrecedence */ typedef INTEGER_t QoSPrecedence_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSPrecedence; asn_struct_free_f QoSPrecedence_free; asn_struct_print_f QoSPrecedence_print; asn_constr_check_f QoSPrecedence_constraint; ber_type_decoder_f QoSPrecedence_decode_ber; der_type_encoder_f QoSPrecedence_encode_der; xer_type_decoder_f QoSPrecedence_decode_xer; xer_type_encoder_f QoSPrecedence_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSPrecedence_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/UMTSQoSUsed.h0000644000000000000000000000152711723307653021555 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _UMTSQoSUsed_H_ #define _UMTSQoSUsed_H_ #include /* Including external dependencies */ #include "UMTSQoSInformation.h" #ifdef __cplusplus extern "C" { #endif /* UMTSQoSUsed */ typedef UMTSQoSInformation_t UMTSQoSUsed_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_UMTSQoSUsed; asn_struct_free_f UMTSQoSUsed_free; asn_struct_print_f UMTSQoSUsed_print; asn_constr_check_f UMTSQoSUsed_constraint; ber_type_decoder_f UMTSQoSUsed_decode_ber; der_type_encoder_f UMTSQoSUsed_encode_der; xer_type_decoder_f UMTSQoSUsed_decode_xer; xer_type_encoder_f UMTSQoSUsed_encode_xer; #ifdef __cplusplus } #endif #endif /* _UMTSQoSUsed_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DualServiceCode.h0000644000000000000000000000213711723307653022520 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _DualServiceCode_H_ #define _DualServiceCode_H_ #include /* Including external dependencies */ #include "DualTeleServiceCode.h" #include "DualBearerServiceCode.h" #include #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum DualServiceCode_PR { DualServiceCode_PR_NOTHING, /* No components present */ DualServiceCode_PR_dualTeleServiceCode, DualServiceCode_PR_dualBearerServiceCode } DualServiceCode_PR; /* DualServiceCode */ typedef struct DualServiceCode { DualServiceCode_PR present; union DualServiceCode_u { DualTeleServiceCode_t dualTeleServiceCode; DualBearerServiceCode_t dualBearerServiceCode; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } DualServiceCode_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_DualServiceCode; #ifdef __cplusplus } #endif #endif /* _DualServiceCode_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/RemotePdpAddressList.h0000644000000000000000000000147611723307653023565 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _RemotePdpAddressList_H_ #define _RemotePdpAddressList_H_ #include /* Including external dependencies */ #include "PacketDataProtocolAddress.h" #include #include #ifdef __cplusplus extern "C" { #endif /* RemotePdpAddressList */ typedef struct RemotePdpAddressList { A_SEQUENCE_OF(PacketDataProtocolAddress_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } RemotePdpAddressList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_RemotePdpAddressList; #ifdef __cplusplus } #endif #endif /* _RemotePdpAddressList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/Latitude.h0000644000000000000000000000143211723307653021267 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _Latitude_H_ #define _Latitude_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* Latitude */ typedef INTEGER_t Latitude_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_Latitude; asn_struct_free_f Latitude_free; asn_struct_print_f Latitude_print; asn_constr_check_f Latitude_constraint; ber_type_decoder_f Latitude_decode_ber; der_type_encoder_f Latitude_encode_der; xer_type_decoder_f Latitude_decode_xer; xer_type_encoder_f Latitude_encode_xer; #ifdef __cplusplus } #endif #endif /* _Latitude_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/RadioChannelUsed.c0000644000000000000000000000743511723307653022670 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "RadioChannelUsed.h" int RadioChannelUsed_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void RadioChannelUsed_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void RadioChannelUsed_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { RadioChannelUsed_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int RadioChannelUsed_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { RadioChannelUsed_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t RadioChannelUsed_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { RadioChannelUsed_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t RadioChannelUsed_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { RadioChannelUsed_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t RadioChannelUsed_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { RadioChannelUsed_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t RadioChannelUsed_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { RadioChannelUsed_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_RadioChannelUsed_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (180 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_RadioChannelUsed = { "RadioChannelUsed", "RadioChannelUsed", RadioChannelUsed_free, RadioChannelUsed_print, RadioChannelUsed_constraint, RadioChannelUsed_decode_ber, RadioChannelUsed_encode_der, RadioChannelUsed_decode_xer, RadioChannelUsed_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_RadioChannelUsed_tags_1, sizeof(asn_DEF_RadioChannelUsed_tags_1) /sizeof(asn_DEF_RadioChannelUsed_tags_1[0]) - 1, /* 1 */ asn_DEF_RadioChannelUsed_tags_1, /* Same as above */ sizeof(asn_DEF_RadioChannelUsed_tags_1) /sizeof(asn_DEF_RadioChannelUsed_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/VasCode.c0000644000000000000000000000677611723307653021053 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "VasCode.h" int VasCode_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Code.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Code, * so here we adjust the DEF accordingly. */ static void VasCode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Code.free_struct; td->print_struct = asn_DEF_Code.print_struct; td->ber_decoder = asn_DEF_Code.ber_decoder; td->der_encoder = asn_DEF_Code.der_encoder; td->xer_decoder = asn_DEF_Code.xer_decoder; td->xer_encoder = asn_DEF_Code.xer_encoder; td->uper_decoder = asn_DEF_Code.uper_decoder; td->uper_encoder = asn_DEF_Code.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Code.per_constraints; td->elements = asn_DEF_Code.elements; td->elements_count = asn_DEF_Code.elements_count; td->specifics = asn_DEF_Code.specifics; } void VasCode_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { VasCode_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int VasCode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { VasCode_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t VasCode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { VasCode_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t VasCode_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { VasCode_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t VasCode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { VasCode_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t VasCode_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { VasCode_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_VasCode_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (237 << 2)), (ASN_TAG_CLASS_APPLICATION | (243 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_VasCode = { "VasCode", "VasCode", VasCode_free, VasCode_print, VasCode_constraint, VasCode_decode_ber, VasCode_encode_der, VasCode_decode_xer, VasCode_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_VasCode_tags_1, sizeof(asn_DEF_VasCode_tags_1) /sizeof(asn_DEF_VasCode_tags_1[0]) - 2, /* 1 */ asn_DEF_VasCode_tags_1, /* Same as above */ sizeof(asn_DEF_VasCode_tags_1) /sizeof(asn_DEF_VasCode_tags_1[0]), /* 3 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/RadioChannelUsed.h0000644000000000000000000000160211723307653022663 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _RadioChannelUsed_H_ #define _RadioChannelUsed_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* RadioChannelUsed */ typedef INTEGER_t RadioChannelUsed_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_RadioChannelUsed; asn_struct_free_f RadioChannelUsed_free; asn_struct_print_f RadioChannelUsed_print; asn_constr_check_f RadioChannelUsed_constraint; ber_type_decoder_f RadioChannelUsed_decode_ber; der_type_encoder_f RadioChannelUsed_encode_der; xer_type_decoder_f RadioChannelUsed_decode_xer; xer_type_encoder_f RadioChannelUsed_encode_xer; #ifdef __cplusplus } #endif #endif /* _RadioChannelUsed_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CalledNumAnalysisCode.h0000644000000000000000000000167511723307653023670 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CalledNumAnalysisCode_H_ #define _CalledNumAnalysisCode_H_ #include /* Including external dependencies */ #include "Code.h" #ifdef __cplusplus extern "C" { #endif /* CalledNumAnalysisCode */ typedef Code_t CalledNumAnalysisCode_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CalledNumAnalysisCode; asn_struct_free_f CalledNumAnalysisCode_free; asn_struct_print_f CalledNumAnalysisCode_print; asn_constr_check_f CalledNumAnalysisCode_constraint; ber_type_decoder_f CalledNumAnalysisCode_decode_ber; der_type_encoder_f CalledNumAnalysisCode_encode_der; xer_type_decoder_f CalledNumAnalysisCode_decode_xer; xer_type_encoder_f CalledNumAnalysisCode_encode_xer; #ifdef __cplusplus } #endif #endif /* _CalledNumAnalysisCode_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelServerAddress.c0000644000000000000000000001005711723307653023230 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CamelServerAddress.h" int CamelServerAddress_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AddressStringDigits.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AddressStringDigits, * so here we adjust the DEF accordingly. */ static void CamelServerAddress_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AddressStringDigits.free_struct; td->print_struct = asn_DEF_AddressStringDigits.print_struct; td->ber_decoder = asn_DEF_AddressStringDigits.ber_decoder; td->der_encoder = asn_DEF_AddressStringDigits.der_encoder; td->xer_decoder = asn_DEF_AddressStringDigits.xer_decoder; td->xer_encoder = asn_DEF_AddressStringDigits.xer_encoder; td->uper_decoder = asn_DEF_AddressStringDigits.uper_decoder; td->uper_encoder = asn_DEF_AddressStringDigits.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AddressStringDigits.per_constraints; td->elements = asn_DEF_AddressStringDigits.elements; td->elements_count = asn_DEF_AddressStringDigits.elements_count; td->specifics = asn_DEF_AddressStringDigits.specifics; } void CamelServerAddress_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CamelServerAddress_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CamelServerAddress_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CamelServerAddress_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CamelServerAddress_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CamelServerAddress_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CamelServerAddress_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CamelServerAddress_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CamelServerAddress_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CamelServerAddress_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CamelServerAddress_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CamelServerAddress_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_CamelServerAddress_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (399 << 2)), (ASN_TAG_CLASS_APPLICATION | (33 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CamelServerAddress = { "CamelServerAddress", "CamelServerAddress", CamelServerAddress_free, CamelServerAddress_print, CamelServerAddress_constraint, CamelServerAddress_decode_ber, CamelServerAddress_encode_der, CamelServerAddress_decode_xer, CamelServerAddress_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CamelServerAddress_tags_1, sizeof(asn_DEF_CamelServerAddress_tags_1) /sizeof(asn_DEF_CamelServerAddress_tags_1[0]) - 2, /* 1 */ asn_DEF_CamelServerAddress_tags_1, /* Same as above */ sizeof(asn_DEF_CamelServerAddress_tags_1) /sizeof(asn_DEF_CamelServerAddress_tags_1[0]), /* 3 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/SpeechVersion.h0000644000000000000000000000153311723307653022273 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _SpeechVersion_H_ #define _SpeechVersion_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* SpeechVersion */ typedef INTEGER_t SpeechVersion_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_SpeechVersion; asn_struct_free_f SpeechVersion_free; asn_struct_print_f SpeechVersion_print; asn_constr_check_f SpeechVersion_constraint; ber_type_decoder_f SpeechVersion_decode_ber; der_type_encoder_f SpeechVersion_encode_der; xer_type_decoder_f SpeechVersion_decode_xer; xer_type_encoder_f SpeechVersion_encode_xer; #ifdef __cplusplus } #endif #endif /* _SpeechVersion_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ChannelCodingAcceptableList.c0000644000000000000000000000336111723307653025006 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "ChannelCodingAcceptableList.h" static asn_TYPE_member_t asn_MBR_ChannelCodingAcceptableList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (60 << 2)), 0, &asn_DEF_ChannelCoding, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_ChannelCodingAcceptableList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (61 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_ChannelCodingAcceptableList_specs_1 = { sizeof(struct ChannelCodingAcceptableList), offsetof(struct ChannelCodingAcceptableList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_ChannelCodingAcceptableList = { "ChannelCodingAcceptableList", "ChannelCodingAcceptableList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ChannelCodingAcceptableList_tags_1, sizeof(asn_DEF_ChannelCodingAcceptableList_tags_1) /sizeof(asn_DEF_ChannelCodingAcceptableList_tags_1[0]) - 1, /* 1 */ asn_DEF_ChannelCodingAcceptableList_tags_1, /* Same as above */ sizeof(asn_DEF_ChannelCodingAcceptableList_tags_1) /sizeof(asn_DEF_ChannelCodingAcceptableList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_ChannelCodingAcceptableList_1, 1, /* Single element */ &asn_SPC_ChannelCodingAcceptableList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/RemotePdpAddressList.c0000644000000000000000000000321011723307653023544 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "RemotePdpAddressList.h" static asn_TYPE_member_t asn_MBR_RemotePdpAddressList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (165 << 2)), 0, &asn_DEF_PacketDataProtocolAddress, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_RemotePdpAddressList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (190 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_RemotePdpAddressList_specs_1 = { sizeof(struct RemotePdpAddressList), offsetof(struct RemotePdpAddressList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_RemotePdpAddressList = { "RemotePdpAddressList", "RemotePdpAddressList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_RemotePdpAddressList_tags_1, sizeof(asn_DEF_RemotePdpAddressList_tags_1) /sizeof(asn_DEF_RemotePdpAddressList_tags_1[0]) - 1, /* 1 */ asn_DEF_RemotePdpAddressList_tags_1, /* Same as above */ sizeof(asn_DEF_RemotePdpAddressList_tags_1) /sizeof(asn_DEF_RemotePdpAddressList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_RemotePdpAddressList_1, 1, /* Single element */ &asn_SPC_RemotePdpAddressList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/Latitude.c0000644000000000000000000000703511723307653021267 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "Latitude.h" int Latitude_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void Latitude_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void Latitude_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Latitude_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Latitude_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Latitude_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Latitude_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Latitude_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Latitude_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Latitude_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Latitude_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Latitude_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Latitude_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Latitude_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_Latitude_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (134 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Latitude = { "Latitude", "Latitude", Latitude_free, Latitude_print, Latitude_constraint, Latitude_decode_ber, Latitude_encode_der, Latitude_decode_xer, Latitude_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Latitude_tags_1, sizeof(asn_DEF_Latitude_tags_1) /sizeof(asn_DEF_Latitude_tags_1[0]) - 1, /* 1 */ asn_DEF_Latitude_tags_1, /* Same as above */ sizeof(asn_DEF_Latitude_tags_1) /sizeof(asn_DEF_Latitude_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/MscId.c0000644000000000000000000000676511723307653020524 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "MscId.h" int MscId_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void MscId_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void MscId_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { MscId_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int MscId_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { MscId_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t MscId_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { MscId_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t MscId_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { MscId_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t MscId_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { MscId_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t MscId_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { MscId_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_MscId_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (151 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_MscId = { "MscId", "MscId", MscId_free, MscId_print, MscId_constraint, MscId_decode_ber, MscId_encode_der, MscId_decode_xer, MscId_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_MscId_tags_1, sizeof(asn_DEF_MscId_tags_1) /sizeof(asn_DEF_MscId_tags_1[0]) - 1, /* 1 */ asn_DEF_MscId_tags_1, /* Same as above */ sizeof(asn_DEF_MscId_tags_1) /sizeof(asn_DEF_MscId_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/FraudMonitorIndicator.h0000644000000000000000000000171311723307653023764 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _FraudMonitorIndicator_H_ #define _FraudMonitorIndicator_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* FraudMonitorIndicator */ typedef AsciiString_t FraudMonitorIndicator_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_FraudMonitorIndicator; asn_struct_free_f FraudMonitorIndicator_free; asn_struct_print_f FraudMonitorIndicator_print; asn_constr_check_f FraudMonitorIndicator_constraint; ber_type_decoder_f FraudMonitorIndicator_decode_ber; der_type_encoder_f FraudMonitorIndicator_encode_der; xer_type_decoder_f FraudMonitorIndicator_decode_xer; xer_type_encoder_f FraudMonitorIndicator_encode_xer; #ifdef __cplusplus } #endif #endif /* _FraudMonitorIndicator_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/VasDescription.h0000644000000000000000000000156011723307653022453 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _VasDescription_H_ #define _VasDescription_H_ #include /* Including external dependencies */ #include "Description.h" #ifdef __cplusplus extern "C" { #endif /* VasDescription */ typedef Description_t VasDescription_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_VasDescription; asn_struct_free_f VasDescription_free; asn_struct_print_f VasDescription_print; asn_constr_check_f VasDescription_constraint; ber_type_decoder_f VasDescription_decode_ber; der_type_encoder_f VasDescription_encode_der; xer_type_decoder_f VasDescription_decode_xer; xer_type_encoder_f VasDescription_encode_xer; #ifdef __cplusplus } #endif #endif /* _VasDescription_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSPrecedence.c0000644000000000000000000000727511723307653022202 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSPrecedence.h" int QoSPrecedence_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void QoSPrecedence_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void QoSPrecedence_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSPrecedence_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSPrecedence_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSPrecedence_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSPrecedence_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSPrecedence_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSPrecedence_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSPrecedence_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSPrecedence_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSPrecedence_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSPrecedence_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSPrecedence_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSPrecedence_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (175 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSPrecedence = { "QoSPrecedence", "QoSPrecedence", QoSPrecedence_free, QoSPrecedence_print, QoSPrecedence_constraint, QoSPrecedence_decode_ber, QoSPrecedence_encode_der, QoSPrecedence_decode_xer, QoSPrecedence_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSPrecedence_tags_1, sizeof(asn_DEF_QoSPrecedence_tags_1) /sizeof(asn_DEF_QoSPrecedence_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSPrecedence_tags_1, /* Same as above */ sizeof(asn_DEF_QoSPrecedence_tags_1) /sizeof(asn_DEF_QoSPrecedence_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GSMQoSInformation.h0000644000000000000000000000204411723307653022773 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _GSMQoSInformation_H_ #define _GSMQoSInformation_H_ #include /* Including external dependencies */ #include "QoSDelay.h" #include "QoSMeanThroughput.h" #include "QoSPeakThroughput.h" #include "QoSPrecedence.h" #include "QoSReliability.h" #include #ifdef __cplusplus extern "C" { #endif /* GSMQoSInformation */ typedef struct GSMQoSInformation { QoSDelay_t *delay /* OPTIONAL */; QoSMeanThroughput_t *meanThroughput /* OPTIONAL */; QoSPeakThroughput_t *peakThroughput /* OPTIONAL */; QoSPrecedence_t *precedence /* OPTIONAL */; QoSReliability_t *reliability /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } GSMQoSInformation_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_GSMQoSInformation; #ifdef __cplusplus } #endif #endif /* _GSMQoSInformation_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CalledNumAnalysisList.h0000644000000000000000000000161711723307653023725 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CalledNumAnalysisList_H_ #define _CalledNumAnalysisList_H_ #include /* Including external dependencies */ #include #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct CalledNumAnalysis; /* CalledNumAnalysisList */ typedef struct CalledNumAnalysisList { A_SEQUENCE_OF(struct CalledNumAnalysis) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } CalledNumAnalysisList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CalledNumAnalysisList; #ifdef __cplusplus } #endif /* Referred external types */ #include "CalledNumAnalysis.h" #endif /* _CalledNumAnalysisList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSGuaranteedBitRateDownlink.h0000644000000000000000000000205011723307653025174 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSGuaranteedBitRateDownlink_H_ #define _QoSGuaranteedBitRateDownlink_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSGuaranteedBitRateDownlink */ typedef OCTET_STRING_t QoSGuaranteedBitRateDownlink_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSGuaranteedBitRateDownlink; asn_struct_free_f QoSGuaranteedBitRateDownlink_free; asn_struct_print_f QoSGuaranteedBitRateDownlink_print; asn_constr_check_f QoSGuaranteedBitRateDownlink_constraint; ber_type_decoder_f QoSGuaranteedBitRateDownlink_decode_ber; der_type_encoder_f QoSGuaranteedBitRateDownlink_encode_der; xer_type_decoder_f QoSGuaranteedBitRateDownlink_decode_xer; xer_type_encoder_f QoSGuaranteedBitRateDownlink_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSGuaranteedBitRateDownlink_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/NonChargedParty.h0000644000000000000000000000153711723307653022552 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _NonChargedParty_H_ #define _NonChargedParty_H_ #include /* Including external dependencies */ #include "AddressStringDigits.h" #include "CalledNumAnalysisCode.h" #include #ifdef __cplusplus extern "C" { #endif /* NonChargedParty */ typedef struct NonChargedParty { AddressStringDigits_t *nonChargedNumber /* OPTIONAL */; CalledNumAnalysisCode_t *calledNumAnalysisCode /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } NonChargedParty_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_NonChargedParty; #ifdef __cplusplus } #endif #endif /* _NonChargedParty_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSTrafficClass.h0000644000000000000000000000156511723307653022512 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSTrafficClass_H_ #define _QoSTrafficClass_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSTrafficClass */ typedef INTEGER_t QoSTrafficClass_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSTrafficClass; asn_struct_free_f QoSTrafficClass_free; asn_struct_print_f QoSTrafficClass_print; asn_constr_check_f QoSTrafficClass_constraint; ber_type_decoder_f QoSTrafficClass_decode_ber; der_type_encoder_f QoSTrafficClass_encode_der; xer_type_decoder_f QoSTrafficClass_decode_xer; xer_type_encoder_f QoSTrafficClass_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSTrafficClass_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelCallReference.h0000644000000000000000000000156211723307653023154 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CamelCallReference_H_ #define _CamelCallReference_H_ #include /* Including external dependencies */ #include "AddressStringDigits.h" #include "CamelCallReferenceNumber.h" #include #ifdef __cplusplus extern "C" { #endif /* CamelCallReference */ typedef struct CamelCallReference { AddressStringDigits_t *mscAddress /* OPTIONAL */; CamelCallReferenceNumber_t *callReferenceNumber /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } CamelCallReference_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CamelCallReference; #ifdef __cplusplus } #endif #endif /* _CamelCallReference_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ScuVasChargeableSubscriber.c0000644000000000000000000000425311723307653024701 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "ScuVasChargeableSubscriber.h" static asn_TYPE_member_t asn_MBR_ScuVasChargeableSubscriber_1[] = { { ATF_NOFLAGS, 0, offsetof(struct ScuVasChargeableSubscriber, choice.gsmChargeableSubscriber), (ASN_TAG_CLASS_APPLICATION | (286 << 2)), 0, &asn_DEF_GsmChargeableSubscriber, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "gsmChargeableSubscriber" }, { ATF_NOFLAGS, 0, offsetof(struct ScuVasChargeableSubscriber, choice.minChargeableSubscriber), (ASN_TAG_CLASS_APPLICATION | (254 << 2)), 0, &asn_DEF_MinChargeableSubscriber, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "minChargeableSubscriber" }, }; static asn_TYPE_tag2member_t asn_MAP_ScuVasChargeableSubscriber_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (254 << 2)), 1, 0, 0 }, /* minChargeableSubscriber at 1211 */ { (ASN_TAG_CLASS_APPLICATION | (286 << 2)), 0, 0, 0 } /* gsmChargeableSubscriber at 1209 */ }; static asn_CHOICE_specifics_t asn_SPC_ScuVasChargeableSubscriber_specs_1 = { sizeof(struct ScuVasChargeableSubscriber), offsetof(struct ScuVasChargeableSubscriber, _asn_ctx), offsetof(struct ScuVasChargeableSubscriber, present), sizeof(((struct ScuVasChargeableSubscriber *)0)->present), asn_MAP_ScuVasChargeableSubscriber_tag2el_1, 2, /* Count of tags in the map */ 0, -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_ScuVasChargeableSubscriber = { "ScuVasChargeableSubscriber", "ScuVasChargeableSubscriber", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_ScuVasChargeableSubscriber_1, 2, /* Elements count */ &asn_SPC_ScuVasChargeableSubscriber_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/EquipmentInformation.h0000644000000000000000000000167411723307653023701 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _EquipmentInformation_H_ #define _EquipmentInformation_H_ #include /* Including external dependencies */ #include "MobileStationClassMark.h" #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct ImeiOrEsn; /* EquipmentInformation */ typedef struct EquipmentInformation { MobileStationClassMark_t *mobileStationClassMark /* OPTIONAL */; struct ImeiOrEsn *imeiOrEsn /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } EquipmentInformation_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_EquipmentInformation; #ifdef __cplusplus } #endif /* Referred external types */ #include "ImeiOrEsn.h" #endif /* _EquipmentInformation_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSMeanThroughput.h0000644000000000000000000000161711723307653023116 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSMeanThroughput_H_ #define _QoSMeanThroughput_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSMeanThroughput */ typedef INTEGER_t QoSMeanThroughput_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSMeanThroughput; asn_struct_free_f QoSMeanThroughput_free; asn_struct_print_f QoSMeanThroughput_print; asn_constr_check_f QoSMeanThroughput_constraint; ber_type_decoder_f QoSMeanThroughput_decode_ber; der_type_encoder_f QoSMeanThroughput_encode_der; xer_type_decoder_f QoSMeanThroughput_decode_xer; xer_type_encoder_f QoSMeanThroughput_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSMeanThroughput_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GmlcAddress.c0000644000000000000000000000726511723307653021711 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "GmlcAddress.h" int GmlcAddress_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void GmlcAddress_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void GmlcAddress_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { GmlcAddress_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int GmlcAddress_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { GmlcAddress_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t GmlcAddress_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { GmlcAddress_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t GmlcAddress_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { GmlcAddress_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t GmlcAddress_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { GmlcAddress_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t GmlcAddress_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { GmlcAddress_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_GmlcAddress_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (296 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_GmlcAddress = { "GmlcAddress", "GmlcAddress", GmlcAddress_free, GmlcAddress_print, GmlcAddress_constraint, GmlcAddress_decode_ber, GmlcAddress_encode_der, GmlcAddress_decode_xer, GmlcAddress_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_GmlcAddress_tags_1, sizeof(asn_DEF_GmlcAddress_tags_1) /sizeof(asn_DEF_GmlcAddress_tags_1[0]) - 1, /* 1 */ asn_DEF_GmlcAddress_tags_1, /* Same as above */ sizeof(asn_DEF_GmlcAddress_tags_1) /sizeof(asn_DEF_GmlcAddress_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/PdpType.c0000644000000000000000000000677511723307653021113 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "PdpType.h" int PdpType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void PdpType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void PdpType_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { PdpType_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int PdpType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { PdpType_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t PdpType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { PdpType_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t PdpType_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { PdpType_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t PdpType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { PdpType_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t PdpType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { PdpType_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_PdpType_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (168 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_PdpType = { "PdpType", "PdpType", PdpType_free, PdpType_print, PdpType_constraint, PdpType_decode_ber, PdpType_encode_der, PdpType_decode_xer, PdpType_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_PdpType_tags_1, sizeof(asn_DEF_PdpType_tags_1) /sizeof(asn_DEF_PdpType_tags_1[0]) - 1, /* 1 */ asn_DEF_PdpType_tags_1, /* Same as above */ sizeof(asn_DEF_PdpType_tags_1) /sizeof(asn_DEF_PdpType_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/HSCSDParameterModificationList.c0000644000000000000000000000346311723307653025404 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "HSCSDParameterModificationList.h" static asn_TYPE_member_t asn_MBR_HSCSDParameterModificationList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (125 << 2)), 0, &asn_DEF_HSCSDParameterModification, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_HSCSDParameterModificationList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (140 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_HSCSDParameterModificationList_specs_1 = { sizeof(struct HSCSDParameterModificationList), offsetof(struct HSCSDParameterModificationList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_HSCSDParameterModificationList = { "HSCSDParameterModificationList", "HSCSDParameterModificationList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_HSCSDParameterModificationList_tags_1, sizeof(asn_DEF_HSCSDParameterModificationList_tags_1) /sizeof(asn_DEF_HSCSDParameterModificationList_tags_1[0]) - 1, /* 1 */ asn_DEF_HSCSDParameterModificationList_tags_1, /* Same as above */ sizeof(asn_DEF_HSCSDParameterModificationList_tags_1) /sizeof(asn_DEF_HSCSDParameterModificationList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_HSCSDParameterModificationList_1, 1, /* Single element */ &asn_SPC_HSCSDParameterModificationList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CalledNumAnalysisList.c0000644000000000000000000000322111723307653023711 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CalledNumAnalysisList.h" static asn_TYPE_member_t asn_MBR_CalledNumAnalysisList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (246 << 2)), 0, &asn_DEF_CalledNumAnalysis, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_CalledNumAnalysisList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (249 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_CalledNumAnalysisList_specs_1 = { sizeof(struct CalledNumAnalysisList), offsetof(struct CalledNumAnalysisList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_CalledNumAnalysisList = { "CalledNumAnalysisList", "CalledNumAnalysisList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CalledNumAnalysisList_tags_1, sizeof(asn_DEF_CalledNumAnalysisList_tags_1) /sizeof(asn_DEF_CalledNumAnalysisList_tags_1[0]) - 1, /* 1 */ asn_DEF_CalledNumAnalysisList_tags_1, /* Same as above */ sizeof(asn_DEF_CalledNumAnalysisList_tags_1) /sizeof(asn_DEF_CalledNumAnalysisList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_CalledNumAnalysisList_1, 1, /* Single element */ &asn_SPC_CalledNumAnalysisList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/TimeBand.c0000644000000000000000000000712511723307653021177 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "TimeBand.h" int TimeBand_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void TimeBand_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void TimeBand_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { TimeBand_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int TimeBand_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { TimeBand_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t TimeBand_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { TimeBand_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t TimeBand_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { TimeBand_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t TimeBand_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { TimeBand_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t TimeBand_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { TimeBand_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_TimeBand_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (220 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_TimeBand = { "TimeBand", "TimeBand", TimeBand_free, TimeBand_print, TimeBand_constraint, TimeBand_decode_ber, TimeBand_encode_der, TimeBand_decode_xer, TimeBand_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TimeBand_tags_1, sizeof(asn_DEF_TimeBand_tags_1) /sizeof(asn_DEF_TimeBand_tags_1[0]) - 1, /* 1 */ asn_DEF_TimeBand_tags_1, /* Same as above */ sizeof(asn_DEF_TimeBand_tags_1) /sizeof(asn_DEF_TimeBand_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DualBearerServiceCode.c0000644000000000000000000000773011723307653023640 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "DualBearerServiceCode.h" int DualBearerServiceCode_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_HexString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using HexString, * so here we adjust the DEF accordingly. */ static void DualBearerServiceCode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_HexString.free_struct; td->print_struct = asn_DEF_HexString.print_struct; td->ber_decoder = asn_DEF_HexString.ber_decoder; td->der_encoder = asn_DEF_HexString.der_encoder; td->xer_decoder = asn_DEF_HexString.xer_decoder; td->xer_encoder = asn_DEF_HexString.xer_encoder; td->uper_decoder = asn_DEF_HexString.uper_decoder; td->uper_encoder = asn_DEF_HexString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_HexString.per_constraints; td->elements = asn_DEF_HexString.elements; td->elements_count = asn_DEF_HexString.elements_count; td->specifics = asn_DEF_HexString.specifics; } void DualBearerServiceCode_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { DualBearerServiceCode_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int DualBearerServiceCode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { DualBearerServiceCode_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t DualBearerServiceCode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { DualBearerServiceCode_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t DualBearerServiceCode_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { DualBearerServiceCode_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t DualBearerServiceCode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { DualBearerServiceCode_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t DualBearerServiceCode_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { DualBearerServiceCode_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_DualBearerServiceCode_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (99 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_DualBearerServiceCode = { "DualBearerServiceCode", "DualBearerServiceCode", DualBearerServiceCode_free, DualBearerServiceCode_print, DualBearerServiceCode_constraint, DualBearerServiceCode_decode_ber, DualBearerServiceCode_encode_der, DualBearerServiceCode_decode_xer, DualBearerServiceCode_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_DualBearerServiceCode_tags_1, sizeof(asn_DEF_DualBearerServiceCode_tags_1) /sizeof(asn_DEF_DualBearerServiceCode_tags_1[0]) - 1, /* 1 */ asn_DEF_DualBearerServiceCode_tags_1, /* Same as above */ sizeof(asn_DEF_DualBearerServiceCode_tags_1) /sizeof(asn_DEF_DualBearerServiceCode_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/UMTSQoSRequested.h0000644000000000000000000000163011723307653022611 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _UMTSQoSRequested_H_ #define _UMTSQoSRequested_H_ #include /* Including external dependencies */ #include "UMTSQoSInformation.h" #ifdef __cplusplus extern "C" { #endif /* UMTSQoSRequested */ typedef UMTSQoSInformation_t UMTSQoSRequested_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_UMTSQoSRequested; asn_struct_free_f UMTSQoSRequested_free; asn_struct_print_f UMTSQoSRequested_print; asn_constr_check_f UMTSQoSRequested_constraint; ber_type_decoder_f UMTSQoSRequested_decode_ber; der_type_encoder_f UMTSQoSRequested_encode_der; xer_type_decoder_f UMTSQoSRequested_decode_xer; xer_type_encoder_f UMTSQoSRequested_encode_xer; #ifdef __cplusplus } #endif #endif /* _UMTSQoSRequested_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/sample-DataInterChange-1.ber0000644000000000000000000000056411466227205024436 0ustar rootroota‚pdy_DWERFD_6XLKJE_m31707lP20050405090547_g+0200cP20050405090547_g+0200kP20050405090547_g+0200_I_= e!_EURPj_i__hÅë_tfEji_h_g+0200<+7 _8_:7 _8_:7 _8Ž_:cNj" _8_-Jw”_ ±_;j" _8_-J¯ _ ¶_;$}nnno9eP20050404162453_g+0200P20050405090059_g+0200asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSUsed.h0000644000000000000000000000164311723307653021043 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSUsed_H_ #define _QoSUsed_H_ #include /* Including external dependencies */ #include "GSMQoSUsed.h" #include "UMTSQoSUsed.h" #include #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum QoSUsed_PR { QoSUsed_PR_NOTHING, /* No components present */ QoSUsed_PR_gsmQoSUsed, QoSUsed_PR_umtsQoSUsed } QoSUsed_PR; /* QoSUsed */ typedef struct QoSUsed { QoSUsed_PR present; union QoSUsed_u { GSMQoSUsed_t gsmQoSUsed; UMTSQoSUsed_t umtsQoSUsed; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } QoSUsed_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSUsed; #ifdef __cplusplus } #endif #endif /* _QoSUsed_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/IacList.h0000644000000000000000000000126711723307653021052 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _IacList_H_ #define _IacList_H_ #include /* Including external dependencies */ #include "Iac.h" #include #include #ifdef __cplusplus extern "C" { #endif /* IacList */ typedef struct IacList { A_SEQUENCE_OF(Iac_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } IacList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_IacList; #ifdef __cplusplus } #endif #endif /* _IacList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/FraudMonitorIndicator.c0000644000000000000000000000776511723307653023774 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "FraudMonitorIndicator.h" int FraudMonitorIndicator_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void FraudMonitorIndicator_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void FraudMonitorIndicator_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { FraudMonitorIndicator_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int FraudMonitorIndicator_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { FraudMonitorIndicator_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t FraudMonitorIndicator_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { FraudMonitorIndicator_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t FraudMonitorIndicator_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { FraudMonitorIndicator_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t FraudMonitorIndicator_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { FraudMonitorIndicator_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t FraudMonitorIndicator_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { FraudMonitorIndicator_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_FraudMonitorIndicator_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (112 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_FraudMonitorIndicator = { "FraudMonitorIndicator", "FraudMonitorIndicator", FraudMonitorIndicator_free, FraudMonitorIndicator_print, FraudMonitorIndicator_constraint, FraudMonitorIndicator_decode_ber, FraudMonitorIndicator_encode_der, FraudMonitorIndicator_decode_xer, FraudMonitorIndicator_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_FraudMonitorIndicator_tags_1, sizeof(asn_DEF_FraudMonitorIndicator_tags_1) /sizeof(asn_DEF_FraudMonitorIndicator_tags_1[0]) - 1, /* 1 */ asn_DEF_FraudMonitorIndicator_tags_1, /* Same as above */ sizeof(asn_DEF_FraudMonitorIndicator_tags_1) /sizeof(asn_DEF_FraudMonitorIndicator_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/Longitude.c0000644000000000000000000000707511723307653021452 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "Longitude.h" int Longitude_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void Longitude_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void Longitude_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Longitude_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Longitude_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Longitude_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Longitude_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Longitude_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Longitude_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Longitude_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Longitude_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Longitude_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Longitude_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Longitude_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_Longitude_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (139 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Longitude = { "Longitude", "Longitude", Longitude_free, Longitude_print, Longitude_constraint, Longitude_decode_ber, Longitude_encode_der, Longitude_decode_xer, Longitude_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Longitude_tags_1, sizeof(asn_DEF_Longitude_tags_1) /sizeof(asn_DEF_Longitude_tags_1[0]) - 1, /* 1 */ asn_DEF_Longitude_tags_1, /* Same as above */ sizeof(asn_DEF_Longitude_tags_1) /sizeof(asn_DEF_Longitude_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/EquipmentInformation.c0000644000000000000000000000461211723307653023667 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "EquipmentInformation.h" static asn_TYPE_member_t asn_MBR_EquipmentInformation_1[] = { { ATF_POINTER, 2, offsetof(struct EquipmentInformation, mobileStationClassMark), (ASN_TAG_CLASS_APPLICATION | (148 << 2)), 0, &asn_DEF_MobileStationClassMark, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "mobileStationClassMark" }, { ATF_POINTER, 1, offsetof(struct EquipmentInformation, imeiOrEsn), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_ImeiOrEsn, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "imeiOrEsn" }, }; static ber_tlv_tag_t asn_DEF_EquipmentInformation_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (102 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EquipmentInformation_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (103 << 2)), 1, 0, 0 }, /* esn at 868 */ { (ASN_TAG_CLASS_APPLICATION | (128 << 2)), 1, 0, 0 }, /* imei at 866 */ { (ASN_TAG_CLASS_APPLICATION | (148 << 2)), 0, 0, 0 } /* mobileStationClassMark at 706 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EquipmentInformation_specs_1 = { sizeof(struct EquipmentInformation), offsetof(struct EquipmentInformation, _asn_ctx), asn_MAP_EquipmentInformation_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_EquipmentInformation = { "EquipmentInformation", "EquipmentInformation", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_EquipmentInformation_tags_1, sizeof(asn_DEF_EquipmentInformation_tags_1) /sizeof(asn_DEF_EquipmentInformation_tags_1[0]) - 1, /* 1 */ asn_DEF_EquipmentInformation_tags_1, /* Same as above */ sizeof(asn_DEF_EquipmentInformation_tags_1) /sizeof(asn_DEF_EquipmentInformation_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_EquipmentInformation_1, 2, /* Elements count */ &asn_SPC_EquipmentInformation_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/VasDescription.c0000644000000000000000000000742511723307653022454 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "VasDescription.h" int VasDescription_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Description.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Description, * so here we adjust the DEF accordingly. */ static void VasDescription_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Description.free_struct; td->print_struct = asn_DEF_Description.print_struct; td->ber_decoder = asn_DEF_Description.ber_decoder; td->der_encoder = asn_DEF_Description.der_encoder; td->xer_decoder = asn_DEF_Description.xer_decoder; td->xer_encoder = asn_DEF_Description.xer_encoder; td->uper_decoder = asn_DEF_Description.uper_decoder; td->uper_encoder = asn_DEF_Description.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Description.per_constraints; td->elements = asn_DEF_Description.elements; td->elements_count = asn_DEF_Description.elements_count; td->specifics = asn_DEF_Description.specifics; } void VasDescription_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { VasDescription_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int VasDescription_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { VasDescription_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t VasDescription_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { VasDescription_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t VasDescription_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { VasDescription_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t VasDescription_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { VasDescription_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t VasDescription_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { VasDescription_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_VasDescription_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (239 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_VasDescription = { "VasDescription", "VasDescription", VasDescription_free, VasDescription_print, VasDescription_constraint, VasDescription_decode_ber, VasDescription_encode_der, VasDescription_decode_xer, VasDescription_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_VasDescription_tags_1, sizeof(asn_DEF_VasDescription_tags_1) /sizeof(asn_DEF_VasDescription_tags_1[0]) - 1, /* 1 */ asn_DEF_VasDescription_tags_1, /* Same as above */ sizeof(asn_DEF_VasDescription_tags_1) /sizeof(asn_DEF_VasDescription_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ModificationTimestamp.h0000644000000000000000000000170511723307653024010 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _ModificationTimestamp_H_ #define _ModificationTimestamp_H_ #include /* Including external dependencies */ #include "DateTime.h" #ifdef __cplusplus extern "C" { #endif /* ModificationTimestamp */ typedef DateTime_t ModificationTimestamp_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_ModificationTimestamp; asn_struct_free_f ModificationTimestamp_free; asn_struct_print_f ModificationTimestamp_print; asn_constr_check_f ModificationTimestamp_constraint; ber_type_decoder_f ModificationTimestamp_decode_ber; der_type_encoder_f ModificationTimestamp_encode_der; xer_type_decoder_f ModificationTimestamp_decode_xer; xer_type_encoder_f ModificationTimestamp_encode_xer; #ifdef __cplusplus } #endif #endif /* _ModificationTimestamp_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/VasShortDescription.h0000644000000000000000000000166111723307653023475 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _VasShortDescription_H_ #define _VasShortDescription_H_ #include /* Including external dependencies */ #include "Description.h" #ifdef __cplusplus extern "C" { #endif /* VasShortDescription */ typedef Description_t VasShortDescription_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_VasShortDescription; asn_struct_free_f VasShortDescription_free; asn_struct_print_f VasShortDescription_print; asn_constr_check_f VasShortDescription_constraint; ber_type_decoder_f VasShortDescription_decode_ber; der_type_encoder_f VasShortDescription_encode_der; xer_type_decoder_f VasShortDescription_decode_xer; xer_type_encoder_f VasShortDescription_encode_xer; #ifdef __cplusplus } #endif #endif /* _VasShortDescription_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ValueAddedServiceUsedList.c0000644000000000000000000000333111723307653024503 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "ValueAddedServiceUsedList.h" static asn_TYPE_member_t asn_MBR_ValueAddedServiceUsedList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (236 << 2)), 0, &asn_DEF_ValueAddedServiceUsed, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_ValueAddedServiceUsedList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (235 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_ValueAddedServiceUsedList_specs_1 = { sizeof(struct ValueAddedServiceUsedList), offsetof(struct ValueAddedServiceUsedList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_ValueAddedServiceUsedList = { "ValueAddedServiceUsedList", "ValueAddedServiceUsedList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ValueAddedServiceUsedList_tags_1, sizeof(asn_DEF_ValueAddedServiceUsedList_tags_1) /sizeof(asn_DEF_ValueAddedServiceUsedList_tags_1[0]) - 1, /* 1 */ asn_DEF_ValueAddedServiceUsedList_tags_1, /* Same as above */ sizeof(asn_DEF_ValueAddedServiceUsedList_tags_1) /sizeof(asn_DEF_ValueAddedServiceUsedList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_ValueAddedServiceUsedList_1, 1, /* Single element */ &asn_SPC_ValueAddedServiceUsedList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ValueAddedServiceUsedList.h0000644000000000000000000000166711723307653024522 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _ValueAddedServiceUsedList_H_ #define _ValueAddedServiceUsedList_H_ #include /* Including external dependencies */ #include #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct ValueAddedServiceUsed; /* ValueAddedServiceUsedList */ typedef struct ValueAddedServiceUsedList { A_SEQUENCE_OF(struct ValueAddedServiceUsed) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ValueAddedServiceUsedList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_ValueAddedServiceUsedList; #ifdef __cplusplus } #endif /* Referred external types */ #include "ValueAddedServiceUsed.h" #endif /* _ValueAddedServiceUsedList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/AiurRequested.h0000644000000000000000000000153311723307653022300 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _AiurRequested_H_ #define _AiurRequested_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* AiurRequested */ typedef INTEGER_t AiurRequested_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_AiurRequested; asn_struct_free_f AiurRequested_free; asn_struct_print_f AiurRequested_print; asn_constr_check_f AiurRequested_constraint; ber_type_decoder_f AiurRequested_decode_ber; der_type_encoder_f AiurRequested_encode_der; xer_type_decoder_f AiurRequested_decode_xer; xer_type_encoder_f AiurRequested_encode_xer; #ifdef __cplusplus } #endif #endif /* _AiurRequested_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelServerAddress.h0000644000000000000000000000166411723307653023241 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CamelServerAddress_H_ #define _CamelServerAddress_H_ #include /* Including external dependencies */ #include "AddressStringDigits.h" #ifdef __cplusplus extern "C" { #endif /* CamelServerAddress */ typedef AddressStringDigits_t CamelServerAddress_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CamelServerAddress; asn_struct_free_f CamelServerAddress_free; asn_struct_print_f CamelServerAddress_print; asn_constr_check_f CamelServerAddress_constraint; ber_type_decoder_f CamelServerAddress_decode_ber; der_type_encoder_f CamelServerAddress_encode_der; xer_type_decoder_f CamelServerAddress_decode_xer; xer_type_encoder_f CamelServerAddress_encode_xer; #ifdef __cplusplus } #endif #endif /* _CamelServerAddress_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSGuaranteedBitRateUplink.c0000644000000000000000000001024311723307653024647 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSGuaranteedBitRateUplink.h" int QoSGuaranteedBitRateUplink_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_OCTET_STRING.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ static void QoSGuaranteedBitRateUplink_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_OCTET_STRING.free_struct; td->print_struct = asn_DEF_OCTET_STRING.print_struct; td->ber_decoder = asn_DEF_OCTET_STRING.ber_decoder; td->der_encoder = asn_DEF_OCTET_STRING.der_encoder; td->xer_decoder = asn_DEF_OCTET_STRING.xer_decoder; td->xer_encoder = asn_DEF_OCTET_STRING.xer_encoder; td->uper_decoder = asn_DEF_OCTET_STRING.uper_decoder; td->uper_encoder = asn_DEF_OCTET_STRING.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_OCTET_STRING.per_constraints; td->elements = asn_DEF_OCTET_STRING.elements; td->elements_count = asn_DEF_OCTET_STRING.elements_count; td->specifics = asn_DEF_OCTET_STRING.specifics; } void QoSGuaranteedBitRateUplink_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSGuaranteedBitRateUplink_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSGuaranteedBitRateUplink_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSGuaranteedBitRateUplink_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSGuaranteedBitRateUplink_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSGuaranteedBitRateUplink_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSGuaranteedBitRateUplink_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSGuaranteedBitRateUplink_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSGuaranteedBitRateUplink_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSGuaranteedBitRateUplink_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSGuaranteedBitRateUplink_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSGuaranteedBitRateUplink_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSGuaranteedBitRateUplink_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (284 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSGuaranteedBitRateUplink = { "QoSGuaranteedBitRateUplink", "QoSGuaranteedBitRateUplink", QoSGuaranteedBitRateUplink_free, QoSGuaranteedBitRateUplink_print, QoSGuaranteedBitRateUplink_constraint, QoSGuaranteedBitRateUplink_decode_ber, QoSGuaranteedBitRateUplink_encode_der, QoSGuaranteedBitRateUplink_decode_xer, QoSGuaranteedBitRateUplink_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSGuaranteedBitRateUplink_tags_1, sizeof(asn_DEF_QoSGuaranteedBitRateUplink_tags_1) /sizeof(asn_DEF_QoSGuaranteedBitRateUplink_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSGuaranteedBitRateUplink_tags_1, /* Same as above */ sizeof(asn_DEF_QoSGuaranteedBitRateUplink_tags_1) /sizeof(asn_DEF_QoSGuaranteedBitRateUplink_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ChargingCharacteristics.h0000644000000000000000000000174711723307653024303 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _ChargingCharacteristics_H_ #define _ChargingCharacteristics_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* ChargingCharacteristics */ typedef OCTET_STRING_t ChargingCharacteristics_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_ChargingCharacteristics; asn_struct_free_f ChargingCharacteristics_free; asn_struct_print_f ChargingCharacteristics_print; asn_constr_check_f ChargingCharacteristics_constraint; ber_type_decoder_f ChargingCharacteristics_decode_ber; der_type_encoder_f ChargingCharacteristics_encode_der; xer_type_decoder_f ChargingCharacteristics_decode_xer; xer_type_encoder_f ChargingCharacteristics_encode_xer; #ifdef __cplusplus } #endif #endif /* _ChargingCharacteristics_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GSMQoSInformation.c0000644000000000000000000000634711723307653023000 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "GSMQoSInformation.h" static asn_TYPE_member_t asn_MBR_GSMQoSInformation_1[] = { { ATF_POINTER, 5, offsetof(struct GSMQoSInformation, delay), (ASN_TAG_CLASS_APPLICATION | (171 << 2)), 0, &asn_DEF_QoSDelay, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "delay" }, { ATF_POINTER, 4, offsetof(struct GSMQoSInformation, meanThroughput), (ASN_TAG_CLASS_APPLICATION | (173 << 2)), 0, &asn_DEF_QoSMeanThroughput, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "meanThroughput" }, { ATF_POINTER, 3, offsetof(struct GSMQoSInformation, peakThroughput), (ASN_TAG_CLASS_APPLICATION | (174 << 2)), 0, &asn_DEF_QoSPeakThroughput, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "peakThroughput" }, { ATF_POINTER, 2, offsetof(struct GSMQoSInformation, precedence), (ASN_TAG_CLASS_APPLICATION | (175 << 2)), 0, &asn_DEF_QoSPrecedence, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "precedence" }, { ATF_POINTER, 1, offsetof(struct GSMQoSInformation, reliability), (ASN_TAG_CLASS_APPLICATION | (176 << 2)), 0, &asn_DEF_QoSReliability, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "reliability" }, }; static ber_tlv_tag_t asn_DEF_GSMQoSInformation_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GSMQoSInformation_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (171 << 2)), 0, 0, 0 }, /* delay at 810 */ { (ASN_TAG_CLASS_APPLICATION | (173 << 2)), 1, 0, 0 }, /* meanThroughput at 811 */ { (ASN_TAG_CLASS_APPLICATION | (174 << 2)), 2, 0, 0 }, /* peakThroughput at 812 */ { (ASN_TAG_CLASS_APPLICATION | (175 << 2)), 3, 0, 0 }, /* precedence at 813 */ { (ASN_TAG_CLASS_APPLICATION | (176 << 2)), 4, 0, 0 } /* reliability at 814 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GSMQoSInformation_specs_1 = { sizeof(struct GSMQoSInformation), offsetof(struct GSMQoSInformation, _asn_ctx), asn_MAP_GSMQoSInformation_tag2el_1, 5, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_GSMQoSInformation = { "GSMQoSInformation", "GSMQoSInformation", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_GSMQoSInformation_tags_1, sizeof(asn_DEF_GSMQoSInformation_tags_1) /sizeof(asn_DEF_GSMQoSInformation_tags_1[0]), /* 1 */ asn_DEF_GSMQoSInformation_tags_1, /* Same as above */ sizeof(asn_DEF_GSMQoSInformation_tags_1) /sizeof(asn_DEF_GSMQoSInformation_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_GSMQoSInformation_1, 5, /* Elements count */ &asn_SPC_GSMQoSInformation_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/NumberOfChannelsUsed.h0000644000000000000000000000166611723307653023537 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _NumberOfChannelsUsed_H_ #define _NumberOfChannelsUsed_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* NumberOfChannelsUsed */ typedef INTEGER_t NumberOfChannelsUsed_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_NumberOfChannelsUsed; asn_struct_free_f NumberOfChannelsUsed_free; asn_struct_print_f NumberOfChannelsUsed_print; asn_constr_check_f NumberOfChannelsUsed_constraint; ber_type_decoder_f NumberOfChannelsUsed_decode_ber; der_type_encoder_f NumberOfChannelsUsed_encode_der; xer_type_decoder_f NumberOfChannelsUsed_decode_xer; xer_type_encoder_f NumberOfChannelsUsed_encode_xer; #ifdef __cplusplus } #endif #endif /* _NumberOfChannelsUsed_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSReliability.h0000644000000000000000000000155011723307653022411 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSReliability_H_ #define _QoSReliability_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSReliability */ typedef INTEGER_t QoSReliability_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSReliability; asn_struct_free_f QoSReliability_free; asn_struct_print_f QoSReliability_print; asn_constr_check_f QoSReliability_constraint; ber_type_decoder_f QoSReliability_decode_ber; der_type_encoder_f QoSReliability_encode_der; xer_type_decoder_f QoSReliability_decode_xer; xer_type_encoder_f QoSReliability_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSReliability_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ValueAddedServiceUsed.h0000644000000000000000000000203211723307653023651 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _ValueAddedServiceUsed_H_ #define _ValueAddedServiceUsed_H_ #include /* Including external dependencies */ #include "VasCode.h" #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct DateTime; struct ChargeInformation; /* ValueAddedServiceUsed */ typedef struct ValueAddedServiceUsed { VasCode_t *vasCode /* OPTIONAL */; struct DateTime *chargingTimeStamp /* OPTIONAL */; struct ChargeInformation *chargeInformation /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ValueAddedServiceUsed_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_ValueAddedServiceUsed; #ifdef __cplusplus } #endif /* Referred external types */ #include "ChargingTimeStamp.h" #include "ChargeInformation.h" #endif /* _ValueAddedServiceUsed_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelModificationList.h0000644000000000000000000000146511723307653023725 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CamelModificationList_H_ #define _CamelModificationList_H_ #include /* Including external dependencies */ #include "CamelModification.h" #include #include #ifdef __cplusplus extern "C" { #endif /* CamelModificationList */ typedef struct CamelModificationList { A_SEQUENCE_OF(CamelModification_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } CamelModificationList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CamelModificationList; #ifdef __cplusplus } #endif #endif /* _CamelModificationList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/config.h0000644000000000000000000000031011472004363020744 0ustar rootroot extern int opt_debug; #define ASN_DEBUG(fmt, args...) do { \ if(opt_debug < 2) break; \ fprintf(stderr, fmt, ##args); \ fprintf(stderr, " (%s:%d)\n", \ __FILE__, __LINE__); \ } while(0) asn1c-0.9.24+dfsg/examples/sample.source.TAP3/TypeOfControllingNode.h0000644000000000000000000000170311723307653023744 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _TypeOfControllingNode_H_ #define _TypeOfControllingNode_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* TypeOfControllingNode */ typedef INTEGER_t TypeOfControllingNode_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_TypeOfControllingNode; asn_struct_free_f TypeOfControllingNode_free; asn_struct_print_f TypeOfControllingNode_print; asn_constr_check_f TypeOfControllingNode_constraint; ber_type_decoder_f TypeOfControllingNode_decode_ber; der_type_encoder_f TypeOfControllingNode_encode_der; xer_type_decoder_f TypeOfControllingNode_decode_xer; xer_type_encoder_f TypeOfControllingNode_encode_xer; #ifdef __cplusplus } #endif #endif /* _TypeOfControllingNode_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/SpeechVersion.c0000644000000000000000000000721611723307653022272 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "SpeechVersion.h" int SpeechVersion_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void SpeechVersion_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void SpeechVersion_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { SpeechVersion_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int SpeechVersion_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { SpeechVersion_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t SpeechVersion_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { SpeechVersion_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t SpeechVersion_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { SpeechVersion_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t SpeechVersion_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { SpeechVersion_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t SpeechVersion_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { SpeechVersion_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_SpeechVersion_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_SpeechVersion = { "SpeechVersion", "SpeechVersion", SpeechVersion_free, SpeechVersion_print, SpeechVersion_constraint, SpeechVersion_decode_ber, SpeechVersion_encode_der, SpeechVersion_decode_xer, SpeechVersion_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SpeechVersion_tags_1, sizeof(asn_DEF_SpeechVersion_tags_1) /sizeof(asn_DEF_SpeechVersion_tags_1[0]), /* 1 */ asn_DEF_SpeechVersion_tags_1, /* Same as above */ sizeof(asn_DEF_SpeechVersion_tags_1) /sizeof(asn_DEF_SpeechVersion_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelCallReferenceNumber.h0000644000000000000000000000175611723307653024332 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CamelCallReferenceNumber_H_ #define _CamelCallReferenceNumber_H_ #include /* Including external dependencies */ #include "HexString.h" #ifdef __cplusplus extern "C" { #endif /* CamelCallReferenceNumber */ typedef HexString_t CamelCallReferenceNumber_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CamelCallReferenceNumber; asn_struct_free_f CamelCallReferenceNumber_free; asn_struct_print_f CamelCallReferenceNumber_print; asn_constr_check_f CamelCallReferenceNumber_constraint; ber_type_decoder_f CamelCallReferenceNumber_decode_ber; der_type_encoder_f CamelCallReferenceNumber_encode_der; xer_type_decoder_f CamelCallReferenceNumber_decode_xer; xer_type_encoder_f CamelCallReferenceNumber_encode_xer; #ifdef __cplusplus } #endif #endif /* _CamelCallReferenceNumber_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/UMTSQoSRequested.c0000644000000000000000000000767711723307653022625 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "UMTSQoSRequested.h" int UMTSQoSRequested_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_UMTSQoSInformation.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using UMTSQoSInformation, * so here we adjust the DEF accordingly. */ static void UMTSQoSRequested_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_UMTSQoSInformation.free_struct; td->print_struct = asn_DEF_UMTSQoSInformation.print_struct; td->ber_decoder = asn_DEF_UMTSQoSInformation.ber_decoder; td->der_encoder = asn_DEF_UMTSQoSInformation.der_encoder; td->xer_decoder = asn_DEF_UMTSQoSInformation.xer_decoder; td->xer_encoder = asn_DEF_UMTSQoSInformation.xer_encoder; td->uper_decoder = asn_DEF_UMTSQoSInformation.uper_decoder; td->uper_encoder = asn_DEF_UMTSQoSInformation.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_UMTSQoSInformation.per_constraints; td->elements = asn_DEF_UMTSQoSInformation.elements; td->elements_count = asn_DEF_UMTSQoSInformation.elements_count; td->specifics = asn_DEF_UMTSQoSInformation.specifics; } void UMTSQoSRequested_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { UMTSQoSRequested_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int UMTSQoSRequested_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { UMTSQoSRequested_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t UMTSQoSRequested_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { UMTSQoSRequested_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t UMTSQoSRequested_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { UMTSQoSRequested_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t UMTSQoSRequested_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { UMTSQoSRequested_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t UMTSQoSRequested_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { UMTSQoSRequested_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_UMTSQoSRequested_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (270 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_UMTSQoSRequested = { "UMTSQoSRequested", "UMTSQoSRequested", UMTSQoSRequested_free, UMTSQoSRequested_print, UMTSQoSRequested_constraint, UMTSQoSRequested_decode_ber, UMTSQoSRequested_encode_der, UMTSQoSRequested_decode_xer, UMTSQoSRequested_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_UMTSQoSRequested_tags_1, sizeof(asn_DEF_UMTSQoSRequested_tags_1) /sizeof(asn_DEF_UMTSQoSRequested_tags_1[0]) - 1, /* 1 */ asn_DEF_UMTSQoSRequested_tags_1, /* Same as above */ sizeof(asn_DEF_UMTSQoSRequested_tags_1) /sizeof(asn_DEF_UMTSQoSRequested_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/InitiatingParty.c0000644000000000000000000000737511723307653022642 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "InitiatingParty.h" int InitiatingParty_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void InitiatingParty_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void InitiatingParty_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { InitiatingParty_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int InitiatingParty_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { InitiatingParty_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t InitiatingParty_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { InitiatingParty_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t InitiatingParty_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { InitiatingParty_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t InitiatingParty_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { InitiatingParty_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t InitiatingParty_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { InitiatingParty_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_InitiatingParty_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (130 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_InitiatingParty = { "InitiatingParty", "InitiatingParty", InitiatingParty_free, InitiatingParty_print, InitiatingParty_constraint, InitiatingParty_decode_ber, InitiatingParty_encode_der, InitiatingParty_decode_xer, InitiatingParty_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_InitiatingParty_tags_1, sizeof(asn_DEF_InitiatingParty_tags_1) /sizeof(asn_DEF_InitiatingParty_tags_1[0]) - 1, /* 1 */ asn_DEF_InitiatingParty_tags_1, /* Same as above */ sizeof(asn_DEF_InitiatingParty_tags_1) /sizeof(asn_DEF_InitiatingParty_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DualServiceCode.c0000644000000000000000000000373711723307653022522 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "DualServiceCode.h" static asn_TYPE_member_t asn_MBR_DualServiceCode_1[] = { { ATF_NOFLAGS, 0, offsetof(struct DualServiceCode, choice.dualTeleServiceCode), (ASN_TAG_CLASS_APPLICATION | (100 << 2)), 0, &asn_DEF_DualTeleServiceCode, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "dualTeleServiceCode" }, { ATF_NOFLAGS, 0, offsetof(struct DualServiceCode, choice.dualBearerServiceCode), (ASN_TAG_CLASS_APPLICATION | (99 << 2)), 0, &asn_DEF_DualBearerServiceCode, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "dualBearerServiceCode" }, }; static asn_TYPE_tag2member_t asn_MAP_DualServiceCode_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (99 << 2)), 1, 0, 0 }, /* dualBearerServiceCode at 694 */ { (ASN_TAG_CLASS_APPLICATION | (100 << 2)), 0, 0, 0 } /* dualTeleServiceCode at 692 */ }; static asn_CHOICE_specifics_t asn_SPC_DualServiceCode_specs_1 = { sizeof(struct DualServiceCode), offsetof(struct DualServiceCode, _asn_ctx), offsetof(struct DualServiceCode, present), sizeof(((struct DualServiceCode *)0)->present), asn_MAP_DualServiceCode_tag2el_1, 2, /* Count of tags in the map */ 0, -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_DualServiceCode = { "DualServiceCode", "DualServiceCode", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_DualServiceCode_1, 2, /* Elements count */ &asn_SPC_DualServiceCode_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CalledCountryCode.h0000644000000000000000000000162711723307653023065 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CalledCountryCode_H_ #define _CalledCountryCode_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* CalledCountryCode */ typedef AsciiString_t CalledCountryCode_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CalledCountryCode; asn_struct_free_f CalledCountryCode_free; asn_struct_print_f CalledCountryCode_print; asn_constr_check_f CalledCountryCode_constraint; ber_type_decoder_f CalledCountryCode_decode_ber; der_type_encoder_f CalledCountryCode_encode_der; xer_type_decoder_f CalledCountryCode_decode_xer; xer_type_encoder_f CalledCountryCode_encode_xer; #ifdef __cplusplus } #endif #endif /* _CalledCountryCode_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CountryCode.c0000644000000000000000000000730211723307653021747 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CountryCode.h" int CountryCode_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NumberString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using NumberString, * so here we adjust the DEF accordingly. */ static void CountryCode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NumberString.free_struct; td->print_struct = asn_DEF_NumberString.print_struct; td->ber_decoder = asn_DEF_NumberString.ber_decoder; td->der_encoder = asn_DEF_NumberString.der_encoder; td->xer_decoder = asn_DEF_NumberString.xer_decoder; td->xer_encoder = asn_DEF_NumberString.xer_encoder; td->uper_decoder = asn_DEF_NumberString.uper_decoder; td->uper_encoder = asn_DEF_NumberString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NumberString.per_constraints; td->elements = asn_DEF_NumberString.elements; td->elements_count = asn_DEF_NumberString.elements_count; td->specifics = asn_DEF_NumberString.specifics; } void CountryCode_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CountryCode_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CountryCode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CountryCode_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CountryCode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CountryCode_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CountryCode_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CountryCode_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CountryCode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CountryCode_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CountryCode_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CountryCode_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_CountryCode_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (77 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CountryCode = { "CountryCode", "CountryCode", CountryCode_free, CountryCode_print, CountryCode_constraint, CountryCode_decode_ber, CountryCode_encode_der, CountryCode_decode_xer, CountryCode_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CountryCode_tags_1, sizeof(asn_DEF_CountryCode_tags_1) /sizeof(asn_DEF_CountryCode_tags_1[0]) - 1, /* 1 */ asn_DEF_CountryCode_tags_1, /* Same as above */ sizeof(asn_DEF_CountryCode_tags_1) /sizeof(asn_DEF_CountryCode_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ChannelCoding.c0000644000000000000000000000727411723307653022215 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "ChannelCoding.h" int ChannelCoding_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void ChannelCoding_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void ChannelCoding_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { ChannelCoding_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int ChannelCoding_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { ChannelCoding_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t ChannelCoding_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { ChannelCoding_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t ChannelCoding_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { ChannelCoding_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t ChannelCoding_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { ChannelCoding_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t ChannelCoding_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { ChannelCoding_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_ChannelCoding_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (60 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_ChannelCoding = { "ChannelCoding", "ChannelCoding", ChannelCoding_free, ChannelCoding_print, ChannelCoding_constraint, ChannelCoding_decode_ber, ChannelCoding_encode_der, ChannelCoding_decode_xer, ChannelCoding_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ChannelCoding_tags_1, sizeof(asn_DEF_ChannelCoding_tags_1) /sizeof(asn_DEF_ChannelCoding_tags_1[0]) - 1, /* 1 */ asn_DEF_ChannelCoding_tags_1, /* Same as above */ sizeof(asn_DEF_ChannelCoding_tags_1) /sizeof(asn_DEF_ChannelCoding_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DataVolumeReference.c0000644000000000000000000000757411723307653023404 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "DataVolumeReference.h" int DataVolumeReference_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void DataVolumeReference_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void DataVolumeReference_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { DataVolumeReference_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int DataVolumeReference_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { DataVolumeReference_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t DataVolumeReference_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { DataVolumeReference_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t DataVolumeReference_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { DataVolumeReference_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t DataVolumeReference_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { DataVolumeReference_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t DataVolumeReference_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { DataVolumeReference_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_DataVolumeReference_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (82 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_DataVolumeReference = { "DataVolumeReference", "DataVolumeReference", DataVolumeReference_free, DataVolumeReference_print, DataVolumeReference_constraint, DataVolumeReference_decode_ber, DataVolumeReference_encode_der, DataVolumeReference_decode_xer, DataVolumeReference_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_DataVolumeReference_tags_1, sizeof(asn_DEF_DataVolumeReference_tags_1) /sizeof(asn_DEF_DataVolumeReference_tags_1[0]) - 1, /* 1 */ asn_DEF_DataVolumeReference_tags_1, /* Same as above */ sizeof(asn_DEF_DataVolumeReference_tags_1) /sizeof(asn_DEF_DataVolumeReference_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/BasicHSCSDParameters.h0000644000000000000000000000224411723307653023350 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _BasicHSCSDParameters_H_ #define _BasicHSCSDParameters_H_ #include /* Including external dependencies */ #include "NumberOfChannels.h" #include "ChannelCoding.h" #include "NumberOfChannelsUsed.h" #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct ChannelCodingAcceptableList; /* BasicHSCSDParameters */ typedef struct BasicHSCSDParameters { NumberOfChannels_t *maxNumberOfChannels /* OPTIONAL */; struct ChannelCodingAcceptableList *channelCodingAcceptableList /* OPTIONAL */; ChannelCoding_t *channelCodingUsed /* OPTIONAL */; NumberOfChannelsUsed_t *numberOfChannelsUsed /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } BasicHSCSDParameters_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_BasicHSCSDParameters; #ifdef __cplusplus } #endif /* Referred external types */ #include "ChannelCodingAcceptableList.h" #endif /* _BasicHSCSDParameters_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DayCategorySubtype.h0000644000000000000000000000164411723307653023310 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _DayCategorySubtype_H_ #define _DayCategorySubtype_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* DayCategorySubtype */ typedef AsciiString_t DayCategorySubtype_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_DayCategorySubtype; asn_struct_free_f DayCategorySubtype_free; asn_struct_print_f DayCategorySubtype_print; asn_constr_check_f DayCategorySubtype_constraint; ber_type_decoder_f DayCategorySubtype_decode_ber; der_type_encoder_f DayCategorySubtype_encode_der; xer_type_decoder_f DayCategorySubtype_decode_xer; xer_type_encoder_f DayCategorySubtype_encode_xer; #ifdef __cplusplus } #endif #endif /* _DayCategorySubtype_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/TimeBandSubtype.h0000644000000000000000000000157511723307653022563 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _TimeBandSubtype_H_ #define _TimeBandSubtype_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* TimeBandSubtype */ typedef AsciiString_t TimeBandSubtype_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_TimeBandSubtype; asn_struct_free_f TimeBandSubtype_free; asn_struct_print_f TimeBandSubtype_print; asn_constr_check_f TimeBandSubtype_constraint; ber_type_decoder_f TimeBandSubtype_decode_ber; der_type_encoder_f TimeBandSubtype_encode_der; xer_type_decoder_f TimeBandSubtype_decode_xer; xer_type_encoder_f TimeBandSubtype_encode_xer; #ifdef __cplusplus } #endif #endif /* _TimeBandSubtype_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/TimeBand.h0000644000000000000000000000144211723307653021200 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _TimeBand_H_ #define _TimeBand_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* TimeBand */ typedef AsciiString_t TimeBand_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_TimeBand; asn_struct_free_f TimeBand_free; asn_struct_print_f TimeBand_print; asn_constr_check_f TimeBand_constraint; ber_type_decoder_f TimeBand_decode_ber; der_type_encoder_f TimeBand_encode_der; xer_type_decoder_f TimeBand_decode_xer; xer_type_encoder_f TimeBand_encode_xer; #ifdef __cplusplus } #endif #endif /* _TimeBand_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/Description.h0000644000000000000000000000151111723307653021775 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _Description_H_ #define _Description_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* Description */ typedef AsciiString_t Description_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_Description; asn_struct_free_f Description_free; asn_struct_print_f Description_print; asn_constr_check_f Description_constraint; ber_type_decoder_f Description_decode_ber; der_type_encoder_f Description_encode_der; xer_type_decoder_f Description_decode_xer; xer_type_encoder_f Description_encode_xer; #ifdef __cplusplus } #endif #endif /* _Description_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSDelay.c0000644000000000000000000000703511723307653021175 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSDelay.h" int QoSDelay_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void QoSDelay_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void QoSDelay_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSDelay_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSDelay_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSDelay_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSDelay_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSDelay_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSDelay_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSDelay_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSDelay_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSDelay_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSDelay_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSDelay_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSDelay_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (171 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSDelay = { "QoSDelay", "QoSDelay", QoSDelay_free, QoSDelay_print, QoSDelay_constraint, QoSDelay_decode_ber, QoSDelay_encode_der, QoSDelay_decode_xer, QoSDelay_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSDelay_tags_1, sizeof(asn_DEF_QoSDelay_tags_1) /sizeof(asn_DEF_QoSDelay_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSDelay_tags_1, /* Same as above */ sizeof(asn_DEF_QoSDelay_tags_1) /sizeof(asn_DEF_QoSDelay_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/MobileStationClassMark.c0000644000000000000000000000773511723307653024075 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "MobileStationClassMark.h" int MobileStationClassMark_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void MobileStationClassMark_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void MobileStationClassMark_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { MobileStationClassMark_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int MobileStationClassMark_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { MobileStationClassMark_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t MobileStationClassMark_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { MobileStationClassMark_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t MobileStationClassMark_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { MobileStationClassMark_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t MobileStationClassMark_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { MobileStationClassMark_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t MobileStationClassMark_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { MobileStationClassMark_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_MobileStationClassMark_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (148 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_MobileStationClassMark = { "MobileStationClassMark", "MobileStationClassMark", MobileStationClassMark_free, MobileStationClassMark_print, MobileStationClassMark_constraint, MobileStationClassMark_decode_ber, MobileStationClassMark_encode_der, MobileStationClassMark_decode_xer, MobileStationClassMark_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_MobileStationClassMark_tags_1, sizeof(asn_DEF_MobileStationClassMark_tags_1) /sizeof(asn_DEF_MobileStationClassMark_tags_1[0]) - 1, /* 1 */ asn_DEF_MobileStationClassMark_tags_1, /* Same as above */ sizeof(asn_DEF_MobileStationClassMark_tags_1) /sizeof(asn_DEF_MobileStationClassMark_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/NumberOfChannelsUsed.c0000644000000000000000000000763511723307653023534 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "NumberOfChannelsUsed.h" int NumberOfChannelsUsed_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NumberOfChannelsUsed_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NumberOfChannelsUsed_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NumberOfChannelsUsed_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NumberOfChannelsUsed_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NumberOfChannelsUsed_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NumberOfChannelsUsed_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NumberOfChannelsUsed_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NumberOfChannelsUsed_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NumberOfChannelsUsed_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NumberOfChannelsUsed_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NumberOfChannelsUsed_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NumberOfChannelsUsed_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NumberOfChannelsUsed_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_NumberOfChannelsUsed_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (252 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NumberOfChannelsUsed = { "NumberOfChannelsUsed", "NumberOfChannelsUsed", NumberOfChannelsUsed_free, NumberOfChannelsUsed_print, NumberOfChannelsUsed_constraint, NumberOfChannelsUsed_decode_ber, NumberOfChannelsUsed_encode_der, NumberOfChannelsUsed_decode_xer, NumberOfChannelsUsed_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NumberOfChannelsUsed_tags_1, sizeof(asn_DEF_NumberOfChannelsUsed_tags_1) /sizeof(asn_DEF_NumberOfChannelsUsed_tags_1[0]) - 1, /* 1 */ asn_DEF_NumberOfChannelsUsed_tags_1, /* Same as above */ sizeof(asn_DEF_NumberOfChannelsUsed_tags_1) /sizeof(asn_DEF_NumberOfChannelsUsed_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/VasShortDescription.c0000644000000000000000000000766511723307653023502 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "VasShortDescription.h" int VasShortDescription_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Description.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Description, * so here we adjust the DEF accordingly. */ static void VasShortDescription_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Description.free_struct; td->print_struct = asn_DEF_Description.print_struct; td->ber_decoder = asn_DEF_Description.ber_decoder; td->der_encoder = asn_DEF_Description.der_encoder; td->xer_decoder = asn_DEF_Description.xer_decoder; td->xer_encoder = asn_DEF_Description.xer_encoder; td->uper_decoder = asn_DEF_Description.uper_decoder; td->uper_encoder = asn_DEF_Description.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Description.per_constraints; td->elements = asn_DEF_Description.elements; td->elements_count = asn_DEF_Description.elements_count; td->specifics = asn_DEF_Description.specifics; } void VasShortDescription_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { VasShortDescription_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int VasShortDescription_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { VasShortDescription_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t VasShortDescription_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { VasShortDescription_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t VasShortDescription_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { VasShortDescription_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t VasShortDescription_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { VasShortDescription_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t VasShortDescription_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { VasShortDescription_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_VasShortDescription_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (240 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_VasShortDescription = { "VasShortDescription", "VasShortDescription", VasShortDescription_free, VasShortDescription_print, VasShortDescription_constraint, VasShortDescription_decode_ber, VasShortDescription_encode_der, VasShortDescription_decode_xer, VasShortDescription_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_VasShortDescription_tags_1, sizeof(asn_DEF_VasShortDescription_tags_1) /sizeof(asn_DEF_VasShortDescription_tags_1[0]) - 1, /* 1 */ asn_DEF_VasShortDescription_tags_1, /* Same as above */ sizeof(asn_DEF_VasShortDescription_tags_1) /sizeof(asn_DEF_VasShortDescription_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/InitiatingParty.h0000644000000000000000000000156511723307653022642 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _InitiatingParty_H_ #define _InitiatingParty_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* InitiatingParty */ typedef INTEGER_t InitiatingParty_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_InitiatingParty; asn_struct_free_f InitiatingParty_free; asn_struct_print_f InitiatingParty_print; asn_constr_check_f InitiatingParty_constraint; ber_type_decoder_f InitiatingParty_decode_ber; der_type_encoder_f InitiatingParty_encode_der; xer_type_decoder_f InitiatingParty_decode_xer; xer_type_encoder_f InitiatingParty_encode_xer; #ifdef __cplusplus } #endif #endif /* _InitiatingParty_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/SpeechVersionRequested.h0000644000000000000000000000173411723307653024160 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _SpeechVersionRequested_H_ #define _SpeechVersionRequested_H_ #include /* Including external dependencies */ #include "SpeechVersion.h" #ifdef __cplusplus extern "C" { #endif /* SpeechVersionRequested */ typedef SpeechVersion_t SpeechVersionRequested_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_SpeechVersionRequested; asn_struct_free_f SpeechVersionRequested_free; asn_struct_print_f SpeechVersionRequested_print; asn_constr_check_f SpeechVersionRequested_constraint; ber_type_decoder_f SpeechVersionRequested_decode_ber; der_type_encoder_f SpeechVersionRequested_encode_der; xer_type_decoder_f SpeechVersionRequested_decode_xer; xer_type_encoder_f SpeechVersionRequested_encode_xer; #ifdef __cplusplus } #endif #endif /* _SpeechVersionRequested_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/UMTSQoSInformation.h0000644000000000000000000000241111723307653023133 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _UMTSQoSInformation_H_ #define _UMTSQoSInformation_H_ #include /* Including external dependencies */ #include "QoSTrafficClass.h" #include "QoSMaxBitRateUplink.h" #include "QoSMaxBitRateDownlink.h" #include "QoSGuaranteedBitRateDownlink.h" #include "QoSGuaranteedBitRateUplink.h" #include "QoSAllocRetenPriority.h" #include #ifdef __cplusplus extern "C" { #endif /* UMTSQoSInformation */ typedef struct UMTSQoSInformation { QoSTrafficClass_t *trafficClass /* OPTIONAL */; QoSMaxBitRateUplink_t *maxBitRateUplink /* OPTIONAL */; QoSMaxBitRateDownlink_t *maxBitRateDownlink /* OPTIONAL */; QoSGuaranteedBitRateDownlink_t *qoSGuaranteedBitRateDownlink /* OPTIONAL */; QoSGuaranteedBitRateUplink_t *qoSGuaranteedBitRateUplink /* OPTIONAL */; QoSAllocRetenPriority_t *allocRetenPriority /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } UMTSQoSInformation_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_UMTSQoSInformation; #ifdef __cplusplus } #endif #endif /* _UMTSQoSInformation_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/SupplServiceUsedList.c0000644000000000000000000000317711723307653023620 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "SupplServiceUsedList.h" static asn_TYPE_member_t asn_MBR_SupplServiceUsedList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (206 << 2)), 0, &asn_DEF_SupplServiceUsed, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_SupplServiceUsedList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (207 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_SupplServiceUsedList_specs_1 = { sizeof(struct SupplServiceUsedList), offsetof(struct SupplServiceUsedList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_SupplServiceUsedList = { "SupplServiceUsedList", "SupplServiceUsedList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SupplServiceUsedList_tags_1, sizeof(asn_DEF_SupplServiceUsedList_tags_1) /sizeof(asn_DEF_SupplServiceUsedList_tags_1[0]) - 1, /* 1 */ asn_DEF_SupplServiceUsedList_tags_1, /* Same as above */ sizeof(asn_DEF_SupplServiceUsedList_tags_1) /sizeof(asn_DEF_SupplServiceUsedList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_SupplServiceUsedList_1, 1, /* Single element */ &asn_SPC_SupplServiceUsedList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/MultiRateIndicator.c0000644000000000000000000000753511723307653023264 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "MultiRateIndicator.h" int MultiRateIndicator_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void MultiRateIndicator_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void MultiRateIndicator_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { MultiRateIndicator_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int MultiRateIndicator_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { MultiRateIndicator_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t MultiRateIndicator_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { MultiRateIndicator_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t MultiRateIndicator_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { MultiRateIndicator_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t MultiRateIndicator_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { MultiRateIndicator_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t MultiRateIndicator_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { MultiRateIndicator_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_MultiRateIndicator_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (154 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_MultiRateIndicator = { "MultiRateIndicator", "MultiRateIndicator", MultiRateIndicator_free, MultiRateIndicator_print, MultiRateIndicator_constraint, MultiRateIndicator_decode_ber, MultiRateIndicator_encode_der, MultiRateIndicator_decode_xer, MultiRateIndicator_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_MultiRateIndicator_tags_1, sizeof(asn_DEF_MultiRateIndicator_tags_1) /sizeof(asn_DEF_MultiRateIndicator_tags_1[0]) - 1, /* 1 */ asn_DEF_MultiRateIndicator_tags_1, /* Same as above */ sizeof(asn_DEF_MultiRateIndicator_tags_1) /sizeof(asn_DEF_MultiRateIndicator_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/TotalChargeValue.h0000644000000000000000000000161511723307653022711 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _TotalChargeValue_H_ #define _TotalChargeValue_H_ #include /* Including external dependencies */ #include "ChargeType.h" #include "AbsoluteAmount.h" #include "TotalChargeRefund.h" #include #ifdef __cplusplus extern "C" { #endif /* TotalChargeValue */ typedef struct TotalChargeValue { ChargeType_t *chargeType /* OPTIONAL */; AbsoluteAmount_t *totalCharge /* OPTIONAL */; TotalChargeRefund_t *totalChargeRefund /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } TotalChargeValue_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_TotalChargeValue; #ifdef __cplusplus } #endif #endif /* _TotalChargeValue_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DayCategory.c0000644000000000000000000000726411723307653021733 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "DayCategory.h" int DayCategory_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void DayCategory_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void DayCategory_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { DayCategory_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int DayCategory_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { DayCategory_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t DayCategory_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { DayCategory_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t DayCategory_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { DayCategory_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t DayCategory_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { DayCategory_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t DayCategory_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { DayCategory_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_DayCategory_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (85 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_DayCategory = { "DayCategory", "DayCategory", DayCategory_free, DayCategory_print, DayCategory_constraint, DayCategory_decode_ber, DayCategory_encode_der, DayCategory_decode_xer, DayCategory_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_DayCategory_tags_1, sizeof(asn_DEF_DayCategory_tags_1) /sizeof(asn_DEF_DayCategory_tags_1[0]) - 1, /* 1 */ asn_DEF_DayCategory_tags_1, /* Same as above */ sizeof(asn_DEF_DayCategory_tags_1) /sizeof(asn_DEF_DayCategory_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/TotalChargeValue.c0000644000000000000000000000511311723307653022701 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "TotalChargeValue.h" static asn_TYPE_member_t asn_MBR_TotalChargeValue_1[] = { { ATF_POINTER, 3, offsetof(struct TotalChargeValue, chargeType), (ASN_TAG_CLASS_APPLICATION | (71 << 2)), 0, &asn_DEF_ChargeType, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "chargeType" }, { ATF_POINTER, 2, offsetof(struct TotalChargeValue, totalCharge), (ASN_TAG_CLASS_APPLICATION | (241 << 2)), 0, &asn_DEF_AbsoluteAmount, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "totalCharge" }, { ATF_POINTER, 1, offsetof(struct TotalChargeValue, totalChargeRefund), (ASN_TAG_CLASS_APPLICATION | (355 << 2)), 0, &asn_DEF_TotalChargeRefund, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "totalChargeRefund" }, }; static ber_tlv_tag_t asn_DEF_TotalChargeValue_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (222 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_TotalChargeValue_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (71 << 2)), 0, 0, 0 }, /* chargeType at 1334 */ { (ASN_TAG_CLASS_APPLICATION | (241 << 2)), 1, 0, 0 }, /* totalCharge at 1335 */ { (ASN_TAG_CLASS_APPLICATION | (355 << 2)), 2, 0, 0 } /* totalChargeRefund at 1336 */ }; static asn_SEQUENCE_specifics_t asn_SPC_TotalChargeValue_specs_1 = { sizeof(struct TotalChargeValue), offsetof(struct TotalChargeValue, _asn_ctx), asn_MAP_TotalChargeValue_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_TotalChargeValue = { "TotalChargeValue", "TotalChargeValue", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TotalChargeValue_tags_1, sizeof(asn_DEF_TotalChargeValue_tags_1) /sizeof(asn_DEF_TotalChargeValue_tags_1[0]) - 1, /* 1 */ asn_DEF_TotalChargeValue_tags_1, /* Same as above */ sizeof(asn_DEF_TotalChargeValue_tags_1) /sizeof(asn_DEF_TotalChargeValue_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_TotalChargeValue_1, 3, /* Elements count */ &asn_SPC_TotalChargeValue_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSDelay.h0000644000000000000000000000143211723307653021175 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSDelay_H_ #define _QoSDelay_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSDelay */ typedef INTEGER_t QoSDelay_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSDelay; asn_struct_free_f QoSDelay_free; asn_struct_print_f QoSDelay_print; asn_constr_check_f QoSDelay_constraint; ber_type_decoder_f QoSDelay_decode_ber; der_type_encoder_f QoSDelay_encode_der; xer_type_decoder_f QoSDelay_decode_xer; xer_type_encoder_f QoSDelay_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSDelay_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CountryCodeList.c0000644000000000000000000000304311723307653022601 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CountryCodeList.h" static asn_TYPE_member_t asn_MBR_CountryCodeList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (77 << 2)), 0, &asn_DEF_CountryCode, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_CountryCodeList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (78 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_CountryCodeList_specs_1 = { sizeof(struct CountryCodeList), offsetof(struct CountryCodeList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_CountryCodeList = { "CountryCodeList", "CountryCodeList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CountryCodeList_tags_1, sizeof(asn_DEF_CountryCodeList_tags_1) /sizeof(asn_DEF_CountryCodeList_tags_1[0]) - 1, /* 1 */ asn_DEF_CountryCodeList_tags_1, /* Same as above */ sizeof(asn_DEF_CountryCodeList_tags_1) /sizeof(asn_DEF_CountryCodeList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_CountryCodeList_1, 1, /* Single element */ &asn_SPC_CountryCodeList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/HSCSDParameterModification.c0000644000000000000000000000770311723307653024551 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "HSCSDParameterModification.h" static asn_TYPE_member_t asn_MBR_HSCSDParameterModification_1[] = { { ATF_POINTER, 6, offsetof(struct HSCSDParameterModification, aiur), (ASN_TAG_CLASS_APPLICATION | (34 << 2)), 0, &asn_DEF_AiurRequested, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "aiur" }, { ATF_POINTER, 5, offsetof(struct HSCSDParameterModification, maxNumberOfChannels), (ASN_TAG_CLASS_APPLICATION | (161 << 2)), 0, &asn_DEF_NumberOfChannels, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "maxNumberOfChannels" }, { ATF_POINTER, 4, offsetof(struct HSCSDParameterModification, channelCodingUsed), (ASN_TAG_CLASS_APPLICATION | (60 << 2)), 0, &asn_DEF_ChannelCoding, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "channelCodingUsed" }, { ATF_POINTER, 3, offsetof(struct HSCSDParameterModification, numberOfChannelsUsed), (ASN_TAG_CLASS_APPLICATION | (252 << 2)), 0, &asn_DEF_NumberOfChannelsUsed, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "numberOfChannelsUsed" }, { ATF_POINTER, 2, offsetof(struct HSCSDParameterModification, initiatingParty), (ASN_TAG_CLASS_APPLICATION | (130 << 2)), 0, &asn_DEF_InitiatingParty, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "initiatingParty" }, { ATF_POINTER, 1, offsetof(struct HSCSDParameterModification, modificationTimestamp), (ASN_TAG_CLASS_APPLICATION | (150 << 2)), 0, &asn_DEF_ModificationTimestamp, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "modificationTimestamp" }, }; static ber_tlv_tag_t asn_DEF_HSCSDParameterModification_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (125 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_HSCSDParameterModification_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (34 << 2)), 0, 0, 0 }, /* aiur at 848 */ { (ASN_TAG_CLASS_APPLICATION | (60 << 2)), 2, 0, 0 }, /* channelCodingUsed at 850 */ { (ASN_TAG_CLASS_APPLICATION | (130 << 2)), 4, 0, 0 }, /* initiatingParty at 852 */ { (ASN_TAG_CLASS_APPLICATION | (150 << 2)), 5, 0, 0 }, /* modificationTimestamp at 853 */ { (ASN_TAG_CLASS_APPLICATION | (161 << 2)), 1, 0, 0 }, /* maxNumberOfChannels at 849 */ { (ASN_TAG_CLASS_APPLICATION | (252 << 2)), 3, 0, 0 } /* numberOfChannelsUsed at 851 */ }; static asn_SEQUENCE_specifics_t asn_SPC_HSCSDParameterModification_specs_1 = { sizeof(struct HSCSDParameterModification), offsetof(struct HSCSDParameterModification, _asn_ctx), asn_MAP_HSCSDParameterModification_tag2el_1, 6, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_HSCSDParameterModification = { "HSCSDParameterModification", "HSCSDParameterModification", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_HSCSDParameterModification_tags_1, sizeof(asn_DEF_HSCSDParameterModification_tags_1) /sizeof(asn_DEF_HSCSDParameterModification_tags_1[0]) - 1, /* 1 */ asn_DEF_HSCSDParameterModification_tags_1, /* Same as above */ sizeof(asn_DEF_HSCSDParameterModification_tags_1) /sizeof(asn_DEF_HSCSDParameterModification_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_HSCSDParameterModification_1, 6, /* Elements count */ &asn_SPC_HSCSDParameterModification_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSMaxBitRateDownlink.c0000644000000000000000000001000311723307653023632 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSMaxBitRateDownlink.h" int QoSMaxBitRateDownlink_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_OCTET_STRING.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ static void QoSMaxBitRateDownlink_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_OCTET_STRING.free_struct; td->print_struct = asn_DEF_OCTET_STRING.print_struct; td->ber_decoder = asn_DEF_OCTET_STRING.ber_decoder; td->der_encoder = asn_DEF_OCTET_STRING.der_encoder; td->xer_decoder = asn_DEF_OCTET_STRING.xer_decoder; td->xer_encoder = asn_DEF_OCTET_STRING.xer_encoder; td->uper_decoder = asn_DEF_OCTET_STRING.uper_decoder; td->uper_encoder = asn_DEF_OCTET_STRING.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_OCTET_STRING.per_constraints; td->elements = asn_DEF_OCTET_STRING.elements; td->elements_count = asn_DEF_OCTET_STRING.elements_count; td->specifics = asn_DEF_OCTET_STRING.specifics; } void QoSMaxBitRateDownlink_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSMaxBitRateDownlink_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSMaxBitRateDownlink_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSMaxBitRateDownlink_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSMaxBitRateDownlink_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSMaxBitRateDownlink_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSMaxBitRateDownlink_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSMaxBitRateDownlink_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSMaxBitRateDownlink_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSMaxBitRateDownlink_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSMaxBitRateDownlink_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSMaxBitRateDownlink_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSMaxBitRateDownlink_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (274 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSMaxBitRateDownlink = { "QoSMaxBitRateDownlink", "QoSMaxBitRateDownlink", QoSMaxBitRateDownlink_free, QoSMaxBitRateDownlink_print, QoSMaxBitRateDownlink_constraint, QoSMaxBitRateDownlink_decode_ber, QoSMaxBitRateDownlink_encode_der, QoSMaxBitRateDownlink_decode_xer, QoSMaxBitRateDownlink_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSMaxBitRateDownlink_tags_1, sizeof(asn_DEF_QoSMaxBitRateDownlink_tags_1) /sizeof(asn_DEF_QoSMaxBitRateDownlink_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSMaxBitRateDownlink_tags_1, /* Same as above */ sizeof(asn_DEF_QoSMaxBitRateDownlink_tags_1) /sizeof(asn_DEF_QoSMaxBitRateDownlink_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/UMTSQoSUsed.c0000644000000000000000000000743711723307653021556 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "UMTSQoSUsed.h" int UMTSQoSUsed_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_UMTSQoSInformation.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using UMTSQoSInformation, * so here we adjust the DEF accordingly. */ static void UMTSQoSUsed_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_UMTSQoSInformation.free_struct; td->print_struct = asn_DEF_UMTSQoSInformation.print_struct; td->ber_decoder = asn_DEF_UMTSQoSInformation.ber_decoder; td->der_encoder = asn_DEF_UMTSQoSInformation.der_encoder; td->xer_decoder = asn_DEF_UMTSQoSInformation.xer_decoder; td->xer_encoder = asn_DEF_UMTSQoSInformation.xer_encoder; td->uper_decoder = asn_DEF_UMTSQoSInformation.uper_decoder; td->uper_encoder = asn_DEF_UMTSQoSInformation.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_UMTSQoSInformation.per_constraints; td->elements = asn_DEF_UMTSQoSInformation.elements; td->elements_count = asn_DEF_UMTSQoSInformation.elements_count; td->specifics = asn_DEF_UMTSQoSInformation.specifics; } void UMTSQoSUsed_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { UMTSQoSUsed_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int UMTSQoSUsed_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { UMTSQoSUsed_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t UMTSQoSUsed_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { UMTSQoSUsed_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t UMTSQoSUsed_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { UMTSQoSUsed_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t UMTSQoSUsed_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { UMTSQoSUsed_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t UMTSQoSUsed_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { UMTSQoSUsed_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_UMTSQoSUsed_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (271 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_UMTSQoSUsed = { "UMTSQoSUsed", "UMTSQoSUsed", UMTSQoSUsed_free, UMTSQoSUsed_print, UMTSQoSUsed_constraint, UMTSQoSUsed_decode_ber, UMTSQoSUsed_encode_der, UMTSQoSUsed_decode_xer, UMTSQoSUsed_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_UMTSQoSUsed_tags_1, sizeof(asn_DEF_UMTSQoSUsed_tags_1) /sizeof(asn_DEF_UMTSQoSUsed_tags_1[0]) - 1, /* 1 */ asn_DEF_UMTSQoSUsed_tags_1, /* Same as above */ sizeof(asn_DEF_UMTSQoSUsed_tags_1) /sizeof(asn_DEF_UMTSQoSUsed_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelModificationList.c0000644000000000000000000000321711723307653023715 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CamelModificationList.h" static asn_TYPE_member_t asn_MBR_CamelModificationList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (53 << 2)), 0, &asn_DEF_CamelModification, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_CamelModificationList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (54 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_CamelModificationList_specs_1 = { sizeof(struct CamelModificationList), offsetof(struct CamelModificationList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_CamelModificationList = { "CamelModificationList", "CamelModificationList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CamelModificationList_tags_1, sizeof(asn_DEF_CamelModificationList_tags_1) /sizeof(asn_DEF_CamelModificationList_tags_1[0]) - 1, /* 1 */ asn_DEF_CamelModificationList_tags_1, /* Same as above */ sizeof(asn_DEF_CamelModificationList_tags_1) /sizeof(asn_DEF_CamelModificationList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_CamelModificationList_1, 1, /* Single element */ &asn_SPC_CamelModificationList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/Iac.h0000644000000000000000000000134311723307653020211 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _Iac_H_ #define _Iac_H_ #include /* Including external dependencies */ #include "NumberString.h" #ifdef __cplusplus extern "C" { #endif /* Iac */ typedef NumberString_t Iac_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_Iac; asn_struct_free_f Iac_free; asn_struct_print_f Iac_print; asn_constr_check_f Iac_constraint; ber_type_decoder_f Iac_decode_ber; der_type_encoder_f Iac_encode_der; xer_type_decoder_f Iac_decode_xer; xer_type_encoder_f Iac_encode_xer; #ifdef __cplusplus } #endif #endif /* _Iac_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/TypeOfControllingNode.c0000644000000000000000000000767511723307653023755 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "TypeOfControllingNode.h" int TypeOfControllingNode_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void TypeOfControllingNode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void TypeOfControllingNode_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { TypeOfControllingNode_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int TypeOfControllingNode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { TypeOfControllingNode_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t TypeOfControllingNode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { TypeOfControllingNode_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t TypeOfControllingNode_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { TypeOfControllingNode_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t TypeOfControllingNode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { TypeOfControllingNode_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t TypeOfControllingNode_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { TypeOfControllingNode_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_TypeOfControllingNode_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (229 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_TypeOfControllingNode = { "TypeOfControllingNode", "TypeOfControllingNode", TypeOfControllingNode_free, TypeOfControllingNode_print, TypeOfControllingNode_constraint, TypeOfControllingNode_decode_ber, TypeOfControllingNode_encode_der, TypeOfControllingNode_decode_xer, TypeOfControllingNode_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TypeOfControllingNode_tags_1, sizeof(asn_DEF_TypeOfControllingNode_tags_1) /sizeof(asn_DEF_TypeOfControllingNode_tags_1[0]) - 1, /* 1 */ asn_DEF_TypeOfControllingNode_tags_1, /* Same as above */ sizeof(asn_DEF_TypeOfControllingNode_tags_1) /sizeof(asn_DEF_TypeOfControllingNode_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/VasInfoList.h0000644000000000000000000000150011723307653021711 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _VasInfoList_H_ #define _VasInfoList_H_ #include /* Including external dependencies */ #include #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct VasInformation; /* VasInfoList */ typedef struct VasInfoList { A_SEQUENCE_OF(struct VasInformation) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } VasInfoList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_VasInfoList; #ifdef __cplusplus } #endif /* Referred external types */ #include "VasInformation.h" #endif /* _VasInfoList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CountryCodeList.h0000644000000000000000000000137711723307653022616 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CountryCodeList_H_ #define _CountryCodeList_H_ #include /* Including external dependencies */ #include "CountryCode.h" #include #include #ifdef __cplusplus extern "C" { #endif /* CountryCodeList */ typedef struct CountryCodeList { A_SEQUENCE_OF(CountryCode_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } CountryCodeList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CountryCodeList; #ifdef __cplusplus } #endif #endif /* _CountryCodeList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/BasicHSCSDParameters.c0000644000000000000000000000617711723307653023354 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "BasicHSCSDParameters.h" static asn_TYPE_member_t asn_MBR_BasicHSCSDParameters_1[] = { { ATF_POINTER, 4, offsetof(struct BasicHSCSDParameters, maxNumberOfChannels), (ASN_TAG_CLASS_APPLICATION | (161 << 2)), 0, &asn_DEF_NumberOfChannels, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "maxNumberOfChannels" }, { ATF_POINTER, 3, offsetof(struct BasicHSCSDParameters, channelCodingAcceptableList), (ASN_TAG_CLASS_APPLICATION | (61 << 2)), 0, &asn_DEF_ChannelCodingAcceptableList, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "channelCodingAcceptableList" }, { ATF_POINTER, 2, offsetof(struct BasicHSCSDParameters, channelCodingUsed), (ASN_TAG_CLASS_APPLICATION | (60 << 2)), 0, &asn_DEF_ChannelCoding, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "channelCodingUsed" }, { ATF_POINTER, 1, offsetof(struct BasicHSCSDParameters, numberOfChannelsUsed), (ASN_TAG_CLASS_APPLICATION | (252 << 2)), 0, &asn_DEF_NumberOfChannelsUsed, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "numberOfChannelsUsed" }, }; static ber_tlv_tag_t asn_DEF_BasicHSCSDParameters_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (35 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_BasicHSCSDParameters_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (60 << 2)), 2, 0, 0 }, /* channelCodingUsed at 286 */ { (ASN_TAG_CLASS_APPLICATION | (61 << 2)), 1, 0, 0 }, /* channelCodingAcceptableList at 285 */ { (ASN_TAG_CLASS_APPLICATION | (161 << 2)), 0, 0, 0 }, /* maxNumberOfChannels at 284 */ { (ASN_TAG_CLASS_APPLICATION | (252 << 2)), 3, 0, 0 } /* numberOfChannelsUsed at 287 */ }; static asn_SEQUENCE_specifics_t asn_SPC_BasicHSCSDParameters_specs_1 = { sizeof(struct BasicHSCSDParameters), offsetof(struct BasicHSCSDParameters, _asn_ctx), asn_MAP_BasicHSCSDParameters_tag2el_1, 4, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_BasicHSCSDParameters = { "BasicHSCSDParameters", "BasicHSCSDParameters", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_BasicHSCSDParameters_tags_1, sizeof(asn_DEF_BasicHSCSDParameters_tags_1) /sizeof(asn_DEF_BasicHSCSDParameters_tags_1[0]) - 1, /* 1 */ asn_DEF_BasicHSCSDParameters_tags_1, /* Same as above */ sizeof(asn_DEF_BasicHSCSDParameters_tags_1) /sizeof(asn_DEF_BasicHSCSDParameters_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_BasicHSCSDParameters_1, 4, /* Elements count */ &asn_SPC_BasicHSCSDParameters_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/Iac.c0000644000000000000000000000670311723307653020211 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "Iac.h" int Iac_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NumberString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using NumberString, * so here we adjust the DEF accordingly. */ static void Iac_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NumberString.free_struct; td->print_struct = asn_DEF_NumberString.print_struct; td->ber_decoder = asn_DEF_NumberString.ber_decoder; td->der_encoder = asn_DEF_NumberString.der_encoder; td->xer_decoder = asn_DEF_NumberString.xer_decoder; td->xer_encoder = asn_DEF_NumberString.xer_encoder; td->uper_decoder = asn_DEF_NumberString.uper_decoder; td->uper_encoder = asn_DEF_NumberString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NumberString.per_constraints; td->elements = asn_DEF_NumberString.elements; td->elements_count = asn_DEF_NumberString.elements_count; td->specifics = asn_DEF_NumberString.specifics; } void Iac_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Iac_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Iac_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Iac_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Iac_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Iac_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Iac_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Iac_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Iac_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Iac_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Iac_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Iac_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_Iac_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (126 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Iac = { "Iac", "Iac", Iac_free, Iac_print, Iac_constraint, Iac_decode_ber, Iac_encode_der, Iac_decode_xer, Iac_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Iac_tags_1, sizeof(asn_DEF_Iac_tags_1) /sizeof(asn_DEF_Iac_tags_1[0]) - 1, /* 1 */ asn_DEF_Iac_tags_1, /* Same as above */ sizeof(asn_DEF_Iac_tags_1) /sizeof(asn_DEF_Iac_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/IPTextV6Address.h0000644000000000000000000000157511723307653022423 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _IPTextV6Address_H_ #define _IPTextV6Address_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* IPTextV6Address */ typedef AsciiString_t IPTextV6Address_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_IPTextV6Address; asn_struct_free_f IPTextV6Address_free; asn_struct_print_f IPTextV6Address_print; asn_constr_check_f IPTextV6Address_constraint; ber_type_decoder_f IPTextV6Address_decode_ber; der_type_encoder_f IPTextV6Address_encode_der; xer_type_decoder_f IPTextV6Address_decode_xer; xer_type_encoder_f IPTextV6Address_encode_xer; #ifdef __cplusplus } #endif #endif /* _IPTextV6Address_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/Longitude.h0000644000000000000000000000144711723307653021454 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _Longitude_H_ #define _Longitude_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* Longitude */ typedef INTEGER_t Longitude_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_Longitude; asn_struct_free_f Longitude_free; asn_struct_print_f Longitude_print; asn_constr_check_f Longitude_constraint; ber_type_decoder_f Longitude_decode_ber; der_type_encoder_f Longitude_encode_der; xer_type_decoder_f Longitude_decode_xer; xer_type_encoder_f Longitude_encode_xer; #ifdef __cplusplus } #endif #endif /* _Longitude_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelModification.h0000644000000000000000000000161711723307653023070 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CamelModification_H_ #define _CamelModification_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* CamelModification */ typedef INTEGER_t CamelModification_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CamelModification; asn_struct_free_f CamelModification_free; asn_struct_print_f CamelModification_print; asn_constr_check_f CamelModification_constraint; ber_type_decoder_f CamelModification_decode_ber; der_type_encoder_f CamelModification_encode_der; xer_type_decoder_f CamelModification_decode_xer; xer_type_encoder_f CamelModification_encode_xer; #ifdef __cplusplus } #endif #endif /* _CamelModification_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSUsed.c0000644000000000000000000000342711723307653021040 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSUsed.h" static asn_TYPE_member_t asn_MBR_QoSUsed_1[] = { { ATF_NOFLAGS, 0, offsetof(struct QoSUsed, choice.gsmQoSUsed), (ASN_TAG_CLASS_APPLICATION | (273 << 2)), 0, &asn_DEF_GSMQoSUsed, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "gsmQoSUsed" }, { ATF_NOFLAGS, 0, offsetof(struct QoSUsed, choice.umtsQoSUsed), (ASN_TAG_CLASS_APPLICATION | (271 << 2)), 0, &asn_DEF_UMTSQoSUsed, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "umtsQoSUsed" }, }; static asn_TYPE_tag2member_t asn_MAP_QoSUsed_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (271 << 2)), 1, 0, 0 }, /* umtsQoSUsed at 1138 */ { (ASN_TAG_CLASS_APPLICATION | (273 << 2)), 0, 0, 0 } /* gsmQoSUsed at 1136 */ }; static asn_CHOICE_specifics_t asn_SPC_QoSUsed_specs_1 = { sizeof(struct QoSUsed), offsetof(struct QoSUsed, _asn_ctx), offsetof(struct QoSUsed, present), sizeof(((struct QoSUsed *)0)->present), asn_MAP_QoSUsed_tag2el_1, 2, /* Count of tags in the map */ 0, -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_QoSUsed = { "QoSUsed", "QoSUsed", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_QoSUsed_1, 2, /* Elements count */ &asn_SPC_QoSUsed_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSRequested.h0000644000000000000000000000202111723307653022073 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSRequested_H_ #define _QoSRequested_H_ #include /* Including external dependencies */ #include "GSMQoSRequested.h" #include "UMTSQoSRequested.h" #include #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum QoSRequested_PR { QoSRequested_PR_NOTHING, /* No components present */ QoSRequested_PR_gsmQoSRequested, QoSRequested_PR_umtsQoSRequested } QoSRequested_PR; /* QoSRequested */ typedef struct QoSRequested { QoSRequested_PR present; union QoSRequested_u { GSMQoSRequested_t gsmQoSRequested; UMTSQoSRequested_t umtsQoSRequested; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } QoSRequested_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSRequested; #ifdef __cplusplus } #endif #endif /* _QoSRequested_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/SpeechVersionUsed.c0000644000000000000000000000762111723307653023113 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "SpeechVersionUsed.h" int SpeechVersionUsed_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_SpeechVersion.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using SpeechVersion, * so here we adjust the DEF accordingly. */ static void SpeechVersionUsed_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_SpeechVersion.free_struct; td->print_struct = asn_DEF_SpeechVersion.print_struct; td->ber_decoder = asn_DEF_SpeechVersion.ber_decoder; td->der_encoder = asn_DEF_SpeechVersion.der_encoder; td->xer_decoder = asn_DEF_SpeechVersion.xer_decoder; td->xer_encoder = asn_DEF_SpeechVersion.xer_encoder; td->uper_decoder = asn_DEF_SpeechVersion.uper_decoder; td->uper_encoder = asn_DEF_SpeechVersion.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_SpeechVersion.per_constraints; td->elements = asn_DEF_SpeechVersion.elements; td->elements_count = asn_DEF_SpeechVersion.elements_count; td->specifics = asn_DEF_SpeechVersion.specifics; } void SpeechVersionUsed_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { SpeechVersionUsed_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int SpeechVersionUsed_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { SpeechVersionUsed_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t SpeechVersionUsed_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { SpeechVersionUsed_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t SpeechVersionUsed_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { SpeechVersionUsed_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t SpeechVersionUsed_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { SpeechVersionUsed_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t SpeechVersionUsed_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { SpeechVersionUsed_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_SpeechVersionUsed_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (203 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_SpeechVersionUsed = { "SpeechVersionUsed", "SpeechVersionUsed", SpeechVersionUsed_free, SpeechVersionUsed_print, SpeechVersionUsed_constraint, SpeechVersionUsed_decode_ber, SpeechVersionUsed_encode_der, SpeechVersionUsed_decode_xer, SpeechVersionUsed_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SpeechVersionUsed_tags_1, sizeof(asn_DEF_SpeechVersionUsed_tags_1) /sizeof(asn_DEF_SpeechVersionUsed_tags_1[0]) - 1, /* 1 */ asn_DEF_SpeechVersionUsed_tags_1, /* Same as above */ sizeof(asn_DEF_SpeechVersionUsed_tags_1) /sizeof(asn_DEF_SpeechVersionUsed_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DualTeleServiceCode.h0000644000000000000000000000165511723307653023336 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _DualTeleServiceCode_H_ #define _DualTeleServiceCode_H_ #include /* Including external dependencies */ #include "HexString.h" #ifdef __cplusplus extern "C" { #endif /* DualTeleServiceCode */ typedef HexString_t DualTeleServiceCode_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_DualTeleServiceCode; asn_struct_free_f DualTeleServiceCode_free; asn_struct_print_f DualTeleServiceCode_print; asn_constr_check_f DualTeleServiceCode_constraint; ber_type_decoder_f DualTeleServiceCode_decode_ber; der_type_encoder_f DualTeleServiceCode_encode_der; xer_type_decoder_f DualTeleServiceCode_decode_xer; xer_type_encoder_f DualTeleServiceCode_encode_xer; #ifdef __cplusplus } #endif #endif /* _DualTeleServiceCode_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ModificationTimestamp.c0000644000000000000000000000777511723307653024020 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "ModificationTimestamp.h" int ModificationTimestamp_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_DateTime.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using DateTime, * so here we adjust the DEF accordingly. */ static void ModificationTimestamp_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_DateTime.free_struct; td->print_struct = asn_DEF_DateTime.print_struct; td->ber_decoder = asn_DEF_DateTime.ber_decoder; td->der_encoder = asn_DEF_DateTime.der_encoder; td->xer_decoder = asn_DEF_DateTime.xer_decoder; td->xer_encoder = asn_DEF_DateTime.xer_encoder; td->uper_decoder = asn_DEF_DateTime.uper_decoder; td->uper_encoder = asn_DEF_DateTime.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_DateTime.per_constraints; td->elements = asn_DEF_DateTime.elements; td->elements_count = asn_DEF_DateTime.elements_count; td->specifics = asn_DEF_DateTime.specifics; } void ModificationTimestamp_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { ModificationTimestamp_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int ModificationTimestamp_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { ModificationTimestamp_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t ModificationTimestamp_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { ModificationTimestamp_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t ModificationTimestamp_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { ModificationTimestamp_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t ModificationTimestamp_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { ModificationTimestamp_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t ModificationTimestamp_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { ModificationTimestamp_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_ModificationTimestamp_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (150 << 2)), (ASN_TAG_CLASS_APPLICATION | (83 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_ModificationTimestamp = { "ModificationTimestamp", "ModificationTimestamp", ModificationTimestamp_free, ModificationTimestamp_print, ModificationTimestamp_constraint, ModificationTimestamp_decode_ber, ModificationTimestamp_encode_der, ModificationTimestamp_decode_xer, ModificationTimestamp_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ModificationTimestamp_tags_1, sizeof(asn_DEF_ModificationTimestamp_tags_1) /sizeof(asn_DEF_ModificationTimestamp_tags_1[0]) - 2, /* 1 */ asn_DEF_ModificationTimestamp_tags_1, /* Same as above */ sizeof(asn_DEF_ModificationTimestamp_tags_1) /sizeof(asn_DEF_ModificationTimestamp_tags_1[0]), /* 3 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/HSCSDParameterModification.h0000644000000000000000000000245711723307653024557 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _HSCSDParameterModification_H_ #define _HSCSDParameterModification_H_ #include /* Including external dependencies */ #include "AiurRequested.h" #include "NumberOfChannels.h" #include "ChannelCoding.h" #include "NumberOfChannelsUsed.h" #include "InitiatingParty.h" #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct DateTime; /* HSCSDParameterModification */ typedef struct HSCSDParameterModification { AiurRequested_t *aiur /* OPTIONAL */; NumberOfChannels_t *maxNumberOfChannels /* OPTIONAL */; ChannelCoding_t *channelCodingUsed /* OPTIONAL */; NumberOfChannelsUsed_t *numberOfChannelsUsed /* OPTIONAL */; InitiatingParty_t *initiatingParty /* OPTIONAL */; struct DateTime *modificationTimestamp /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } HSCSDParameterModification_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_HSCSDParameterModification; #ifdef __cplusplus } #endif /* Referred external types */ #include "ModificationTimestamp.h" #endif /* _HSCSDParameterModification_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/TotalChargeValueList.h0000644000000000000000000000160511723307653023544 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _TotalChargeValueList_H_ #define _TotalChargeValueList_H_ #include /* Including external dependencies */ #include #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct TotalChargeValue; /* TotalChargeValueList */ typedef struct TotalChargeValueList { A_SEQUENCE_OF(struct TotalChargeValue) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } TotalChargeValueList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_TotalChargeValueList; #ifdef __cplusplus } #endif /* Referred external types */ #include "TotalChargeValue.h" #endif /* _TotalChargeValueList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/HSCSDParameterModificationList.h0000644000000000000000000000175111723307653025407 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _HSCSDParameterModificationList_H_ #define _HSCSDParameterModificationList_H_ #include /* Including external dependencies */ #include #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct HSCSDParameterModification; /* HSCSDParameterModificationList */ typedef struct HSCSDParameterModificationList { A_SEQUENCE_OF(struct HSCSDParameterModification) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } HSCSDParameterModificationList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_HSCSDParameterModificationList; #ifdef __cplusplus } #endif /* Referred external types */ #include "HSCSDParameterModification.h" #endif /* _HSCSDParameterModificationList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GSMQoSUsed.h0000644000000000000000000000151011723307653021403 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _GSMQoSUsed_H_ #define _GSMQoSUsed_H_ #include /* Including external dependencies */ #include "GSMQoSInformation.h" #ifdef __cplusplus extern "C" { #endif /* GSMQoSUsed */ typedef GSMQoSInformation_t GSMQoSUsed_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_GSMQoSUsed; asn_struct_free_f GSMQoSUsed_free; asn_struct_print_f GSMQoSUsed_print; asn_constr_check_f GSMQoSUsed_constraint; ber_type_decoder_f GSMQoSUsed_decode_ber; der_type_encoder_f GSMQoSUsed_encode_der; xer_type_decoder_f GSMQoSUsed_decode_xer; xer_type_encoder_f GSMQoSUsed_encode_xer; #ifdef __cplusplus } #endif #endif /* _GSMQoSUsed_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/VasInformation.h0000644000000000000000000000156111723307653022456 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _VasInformation_H_ #define _VasInformation_H_ #include /* Including external dependencies */ #include "VasCode.h" #include "VasShortDescription.h" #include "VasDescription.h" #include #ifdef __cplusplus extern "C" { #endif /* VasInformation */ typedef struct VasInformation { VasCode_t *vasCode /* OPTIONAL */; VasShortDescription_t *vasShortDesc /* OPTIONAL */; VasDescription_t *vasDesc /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } VasInformation_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_VasInformation; #ifdef __cplusplus } #endif #endif /* _VasInformation_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ChannelCoding.h0000644000000000000000000000153311723307653022212 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _ChannelCoding_H_ #define _ChannelCoding_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* ChannelCoding */ typedef INTEGER_t ChannelCoding_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_ChannelCoding; asn_struct_free_f ChannelCoding_free; asn_struct_print_f ChannelCoding_print; asn_constr_check_f ChannelCoding_constraint; ber_type_decoder_f ChannelCoding_decode_ber; der_type_encoder_f ChannelCoding_encode_der; xer_type_decoder_f ChannelCoding_decode_xer; xer_type_encoder_f ChannelCoding_encode_xer; #ifdef __cplusplus } #endif #endif /* _ChannelCoding_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/Description.c0000644000000000000000000000720611723307653021777 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "Description.h" int Description_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void Description_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void Description_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Description_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Description_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Description_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Description_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Description_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Description_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Description_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Description_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Description_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Description_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Description_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_Description_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Description = { "Description", "Description", Description_free, Description_print, Description_constraint, Description_decode_ber, Description_encode_der, Description_decode_xer, Description_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Description_tags_1, sizeof(asn_DEF_Description_tags_1) /sizeof(asn_DEF_Description_tags_1[0]), /* 1 */ asn_DEF_Description_tags_1, /* Same as above */ sizeof(asn_DEF_Description_tags_1) /sizeof(asn_DEF_Description_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/NetworkType.h0000644000000000000000000000150111723307653022004 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _NetworkType_H_ #define _NetworkType_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* NetworkType */ typedef INTEGER_t NetworkType_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_NetworkType; asn_struct_free_f NetworkType_free; asn_struct_print_f NetworkType_print; asn_constr_check_f NetworkType_constraint; ber_type_decoder_f NetworkType_decode_ber; der_type_encoder_f NetworkType_encode_der; xer_type_decoder_f NetworkType_decode_xer; xer_type_encoder_f NetworkType_encode_xer; #ifdef __cplusplus } #endif #endif /* _NetworkType_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CalledNumAnalysis.h0000644000000000000000000000201411723307653023061 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CalledNumAnalysis_H_ #define _CalledNumAnalysis_H_ #include /* Including external dependencies */ #include "CalledNumAnalysisCode.h" #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct CountryCodeList; struct IacList; /* CalledNumAnalysis */ typedef struct CalledNumAnalysis { CalledNumAnalysisCode_t *calledNumAnalysisCode /* OPTIONAL */; struct CountryCodeList *countryCodeTable /* OPTIONAL */; struct IacList *iacTable /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } CalledNumAnalysis_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CalledNumAnalysis; #ifdef __cplusplus } #endif /* Referred external types */ #include "CountryCodeList.h" #include "IacList.h" #endif /* _CalledNumAnalysis_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSGuaranteedBitRateUplink.h0000644000000000000000000000201611723307653024653 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSGuaranteedBitRateUplink_H_ #define _QoSGuaranteedBitRateUplink_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSGuaranteedBitRateUplink */ typedef OCTET_STRING_t QoSGuaranteedBitRateUplink_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSGuaranteedBitRateUplink; asn_struct_free_f QoSGuaranteedBitRateUplink_free; asn_struct_print_f QoSGuaranteedBitRateUplink_print; asn_constr_check_f QoSGuaranteedBitRateUplink_constraint; ber_type_decoder_f QoSGuaranteedBitRateUplink_decode_ber; der_type_encoder_f QoSGuaranteedBitRateUplink_encode_der; xer_type_decoder_f QoSGuaranteedBitRateUplink_decode_xer; xer_type_encoder_f QoSGuaranteedBitRateUplink_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSGuaranteedBitRateUplink_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/IPTextV4Address.c0000644000000000000000000000746511723307653022420 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "IPTextV4Address.h" int IPTextV4Address_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void IPTextV4Address_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void IPTextV4Address_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { IPTextV4Address_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int IPTextV4Address_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { IPTextV4Address_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t IPTextV4Address_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { IPTextV4Address_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t IPTextV4Address_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { IPTextV4Address_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t IPTextV4Address_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { IPTextV4Address_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t IPTextV4Address_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { IPTextV4Address_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_IPTextV4Address_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (131 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_IPTextV4Address = { "IPTextV4Address", "IPTextV4Address", IPTextV4Address_free, IPTextV4Address_print, IPTextV4Address_constraint, IPTextV4Address_decode_ber, IPTextV4Address_encode_der, IPTextV4Address_decode_xer, IPTextV4Address_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_IPTextV4Address_tags_1, sizeof(asn_DEF_IPTextV4Address_tags_1) /sizeof(asn_DEF_IPTextV4Address_tags_1[0]) - 1, /* 1 */ asn_DEF_IPTextV4Address_tags_1, /* Same as above */ sizeof(asn_DEF_IPTextV4Address_tags_1) /sizeof(asn_DEF_IPTextV4Address_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/SpeechVersionUsed.h0000644000000000000000000000163311723307653023115 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _SpeechVersionUsed_H_ #define _SpeechVersionUsed_H_ #include /* Including external dependencies */ #include "SpeechVersion.h" #ifdef __cplusplus extern "C" { #endif /* SpeechVersionUsed */ typedef SpeechVersion_t SpeechVersionUsed_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_SpeechVersionUsed; asn_struct_free_f SpeechVersionUsed_free; asn_struct_print_f SpeechVersionUsed_print; asn_constr_check_f SpeechVersionUsed_constraint; ber_type_decoder_f SpeechVersionUsed_decode_ber; der_type_encoder_f SpeechVersionUsed_encode_der; xer_type_decoder_f SpeechVersionUsed_decode_xer; xer_type_encoder_f SpeechVersionUsed_encode_xer; #ifdef __cplusplus } #endif #endif /* _SpeechVersionUsed_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/AiurRequested.c0000644000000000000000000000727411723307653022303 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "AiurRequested.h" int AiurRequested_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void AiurRequested_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void AiurRequested_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { AiurRequested_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int AiurRequested_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { AiurRequested_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t AiurRequested_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { AiurRequested_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t AiurRequested_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { AiurRequested_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t AiurRequested_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { AiurRequested_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t AiurRequested_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { AiurRequested_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_AiurRequested_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (34 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_AiurRequested = { "AiurRequested", "AiurRequested", AiurRequested_free, AiurRequested_print, AiurRequested_constraint, AiurRequested_decode_ber, AiurRequested_encode_der, AiurRequested_decode_xer, AiurRequested_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_AiurRequested_tags_1, sizeof(asn_DEF_AiurRequested_tags_1) /sizeof(asn_DEF_AiurRequested_tags_1[0]) - 1, /* 1 */ asn_DEF_AiurRequested_tags_1, /* Same as above */ sizeof(asn_DEF_AiurRequested_tags_1) /sizeof(asn_DEF_AiurRequested_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CalledNumAnalysis.c0000644000000000000000000000516511723307653023066 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CalledNumAnalysis.h" static asn_TYPE_member_t asn_MBR_CalledNumAnalysis_1[] = { { ATF_POINTER, 3, offsetof(struct CalledNumAnalysis, calledNumAnalysisCode), (ASN_TAG_CLASS_APPLICATION | (247 << 2)), 0, &asn_DEF_CalledNumAnalysisCode, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "calledNumAnalysisCode" }, { ATF_POINTER, 2, offsetof(struct CalledNumAnalysis, countryCodeTable), (ASN_TAG_CLASS_APPLICATION | (78 << 2)), 0, &asn_DEF_CountryCodeList, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "countryCodeTable" }, { ATF_POINTER, 1, offsetof(struct CalledNumAnalysis, iacTable), (ASN_TAG_CLASS_APPLICATION | (127 << 2)), 0, &asn_DEF_IacList, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "iacTable" }, }; static ber_tlv_tag_t asn_DEF_CalledNumAnalysis_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (246 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_CalledNumAnalysis_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (78 << 2)), 1, 0, 0 }, /* countryCodeTable at 329 */ { (ASN_TAG_CLASS_APPLICATION | (127 << 2)), 2, 0, 0 }, /* iacTable at 330 */ { (ASN_TAG_CLASS_APPLICATION | (247 << 2)), 0, 0, 0 } /* calledNumAnalysisCode at 328 */ }; static asn_SEQUENCE_specifics_t asn_SPC_CalledNumAnalysis_specs_1 = { sizeof(struct CalledNumAnalysis), offsetof(struct CalledNumAnalysis, _asn_ctx), asn_MAP_CalledNumAnalysis_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_CalledNumAnalysis = { "CalledNumAnalysis", "CalledNumAnalysis", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CalledNumAnalysis_tags_1, sizeof(asn_DEF_CalledNumAnalysis_tags_1) /sizeof(asn_DEF_CalledNumAnalysis_tags_1[0]) - 1, /* 1 */ asn_DEF_CalledNumAnalysis_tags_1, /* Same as above */ sizeof(asn_DEF_CalledNumAnalysis_tags_1) /sizeof(asn_DEF_CalledNumAnalysis_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_CalledNumAnalysis_1, 3, /* Elements count */ &asn_SPC_CalledNumAnalysis_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/SupplServiceUsedList.h0000644000000000000000000000160511723307653023617 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _SupplServiceUsedList_H_ #define _SupplServiceUsedList_H_ #include /* Including external dependencies */ #include #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct SupplServiceUsed; /* SupplServiceUsedList */ typedef struct SupplServiceUsedList { A_SEQUENCE_OF(struct SupplServiceUsed) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SupplServiceUsedList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_SupplServiceUsedList; #ifdef __cplusplus } #endif /* Referred external types */ #include "SupplServiceUsed.h" #endif /* _SupplServiceUsedList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelInitiatedCFIndicator.h0000644000000000000000000000176711723307653024451 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CamelInitiatedCFIndicator_H_ #define _CamelInitiatedCFIndicator_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* CamelInitiatedCFIndicator */ typedef INTEGER_t CamelInitiatedCFIndicator_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CamelInitiatedCFIndicator; asn_struct_free_f CamelInitiatedCFIndicator_free; asn_struct_print_f CamelInitiatedCFIndicator_print; asn_constr_check_f CamelInitiatedCFIndicator_constraint; ber_type_decoder_f CamelInitiatedCFIndicator_decode_ber; der_type_encoder_f CamelInitiatedCFIndicator_encode_der; xer_type_decoder_f CamelInitiatedCFIndicator_decode_xer; xer_type_encoder_f CamelInitiatedCFIndicator_encode_xer; #ifdef __cplusplus } #endif #endif /* _CamelInitiatedCFIndicator_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/MscId.h0000644000000000000000000000137311723307653020517 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _MscId_H_ #define _MscId_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* MscId */ typedef AsciiString_t MscId_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_MscId; asn_struct_free_f MscId_free; asn_struct_print_f MscId_print; asn_constr_check_f MscId_constraint; ber_type_decoder_f MscId_decode_ber; der_type_encoder_f MscId_encode_der; xer_type_decoder_f MscId_decode_xer; xer_type_encoder_f MscId_encode_xer; #ifdef __cplusplus } #endif #endif /* _MscId_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/MultiRateIndicator.h0000644000000000000000000000163411723307653023263 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _MultiRateIndicator_H_ #define _MultiRateIndicator_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* MultiRateIndicator */ typedef INTEGER_t MultiRateIndicator_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_MultiRateIndicator; asn_struct_free_f MultiRateIndicator_free; asn_struct_print_f MultiRateIndicator_print; asn_constr_check_f MultiRateIndicator_constraint; ber_type_decoder_f MultiRateIndicator_decode_ber; der_type_encoder_f MultiRateIndicator_encode_der; xer_type_decoder_f MultiRateIndicator_decode_xer; xer_type_encoder_f MultiRateIndicator_encode_xer; #ifdef __cplusplus } #endif #endif /* _MultiRateIndicator_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSAllocRetenPriority.c0000644000000000000000000000767511723307653023743 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSAllocRetenPriority.h" int QoSAllocRetenPriority_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void QoSAllocRetenPriority_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void QoSAllocRetenPriority_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSAllocRetenPriority_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSAllocRetenPriority_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSAllocRetenPriority_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSAllocRetenPriority_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSAllocRetenPriority_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSAllocRetenPriority_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSAllocRetenPriority_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSAllocRetenPriority_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSAllocRetenPriority_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSAllocRetenPriority_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSAllocRetenPriority_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSAllocRetenPriority_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (275 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSAllocRetenPriority = { "QoSAllocRetenPriority", "QoSAllocRetenPriority", QoSAllocRetenPriority_free, QoSAllocRetenPriority_print, QoSAllocRetenPriority_constraint, QoSAllocRetenPriority_decode_ber, QoSAllocRetenPriority_encode_der, QoSAllocRetenPriority_decode_xer, QoSAllocRetenPriority_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSAllocRetenPriority_tags_1, sizeof(asn_DEF_QoSAllocRetenPriority_tags_1) /sizeof(asn_DEF_QoSAllocRetenPriority_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSAllocRetenPriority_tags_1, /* Same as above */ sizeof(asn_DEF_QoSAllocRetenPriority_tags_1) /sizeof(asn_DEF_QoSAllocRetenPriority_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/IpAddress.c0000644000000000000000000000353111723307653021367 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "IpAddress.h" static asn_TYPE_member_t asn_MBR_IpAddress_1[] = { { ATF_NOFLAGS, 0, offsetof(struct IpAddress, choice.iPTextV4Address), (ASN_TAG_CLASS_APPLICATION | (131 << 2)), 0, &asn_DEF_IPTextV4Address, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "iPTextV4Address" }, { ATF_NOFLAGS, 0, offsetof(struct IpAddress, choice.iPTextV6Address), (ASN_TAG_CLASS_APPLICATION | (132 << 2)), 0, &asn_DEF_IPTextV6Address, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "iPTextV6Address" }, }; static asn_TYPE_tag2member_t asn_MAP_IpAddress_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (131 << 2)), 0, 0, 0 }, /* iPTextV4Address at 888 */ { (ASN_TAG_CLASS_APPLICATION | (132 << 2)), 1, 0, 0 } /* iPTextV6Address at 890 */ }; static asn_CHOICE_specifics_t asn_SPC_IpAddress_specs_1 = { sizeof(struct IpAddress), offsetof(struct IpAddress, _asn_ctx), offsetof(struct IpAddress, present), sizeof(((struct IpAddress *)0)->present), asn_MAP_IpAddress_tag2el_1, 2, /* Count of tags in the map */ 0, -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_IpAddress = { "IpAddress", "IpAddress", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_IpAddress_1, 2, /* Elements count */ &asn_SPC_IpAddress_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/RadioChannelRequested.h0000644000000000000000000000170311723307653023726 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _RadioChannelRequested_H_ #define _RadioChannelRequested_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* RadioChannelRequested */ typedef INTEGER_t RadioChannelRequested_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_RadioChannelRequested; asn_struct_free_f RadioChannelRequested_free; asn_struct_print_f RadioChannelRequested_print; asn_constr_check_f RadioChannelRequested_constraint; ber_type_decoder_f RadioChannelRequested_decode_ber; der_type_encoder_f RadioChannelRequested_encode_der; xer_type_decoder_f RadioChannelRequested_decode_xer; xer_type_encoder_f RadioChannelRequested_encode_xer; #ifdef __cplusplus } #endif #endif /* _RadioChannelRequested_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/VasCode.h0000644000000000000000000000140711723307653021042 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _VasCode_H_ #define _VasCode_H_ #include /* Including external dependencies */ #include "Code.h" #ifdef __cplusplus extern "C" { #endif /* VasCode */ typedef Code_t VasCode_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_VasCode; asn_struct_free_f VasCode_free; asn_struct_print_f VasCode_print; asn_constr_check_f VasCode_constraint; ber_type_decoder_f VasCode_decode_ber; der_type_encoder_f VasCode_encode_der; xer_type_decoder_f VasCode_decode_xer; xer_type_encoder_f VasCode_encode_xer; #ifdef __cplusplus } #endif #endif /* _VasCode_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/PdpType.h0000644000000000000000000000141511723307653021102 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _PdpType_H_ #define _PdpType_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* PdpType */ typedef INTEGER_t PdpType_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_PdpType; asn_struct_free_f PdpType_free; asn_struct_print_f PdpType_print; asn_constr_check_f PdpType_constraint; ber_type_decoder_f PdpType_decode_ber; der_type_encoder_f PdpType_encode_der; xer_type_decoder_f PdpType_decode_xer; xer_type_encoder_f PdpType_encode_xer; #ifdef __cplusplus } #endif #endif /* _PdpType_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSPeakThroughput.c0000644000000000000000000000747511723307653023121 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSPeakThroughput.h" int QoSPeakThroughput_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void QoSPeakThroughput_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void QoSPeakThroughput_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSPeakThroughput_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSPeakThroughput_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSPeakThroughput_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSPeakThroughput_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSPeakThroughput_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSPeakThroughput_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSPeakThroughput_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSPeakThroughput_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSPeakThroughput_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSPeakThroughput_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSPeakThroughput_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSPeakThroughput_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (174 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSPeakThroughput = { "QoSPeakThroughput", "QoSPeakThroughput", QoSPeakThroughput_free, QoSPeakThroughput_print, QoSPeakThroughput_constraint, QoSPeakThroughput_decode_ber, QoSPeakThroughput_encode_der, QoSPeakThroughput_decode_xer, QoSPeakThroughput_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSPeakThroughput_tags_1, sizeof(asn_DEF_QoSPeakThroughput_tags_1) /sizeof(asn_DEF_QoSPeakThroughput_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSPeakThroughput_tags_1, /* Same as above */ sizeof(asn_DEF_QoSPeakThroughput_tags_1) /sizeof(asn_DEF_QoSPeakThroughput_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GmlcAddress.h0000644000000000000000000000151111723307653021702 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _GmlcAddress_H_ #define _GmlcAddress_H_ #include /* Including external dependencies */ #include "AsciiString.h" #ifdef __cplusplus extern "C" { #endif /* GmlcAddress */ typedef AsciiString_t GmlcAddress_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_GmlcAddress; asn_struct_free_f GmlcAddress_free; asn_struct_print_f GmlcAddress_print; asn_constr_check_f GmlcAddress_constraint; ber_type_decoder_f GmlcAddress_decode_ber; der_type_encoder_f GmlcAddress_encode_der; xer_type_decoder_f GmlcAddress_decode_xer; xer_type_encoder_f GmlcAddress_encode_xer; #ifdef __cplusplus } #endif #endif /* _GmlcAddress_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSMaxBitRateDownlink.h0000644000000000000000000000171511723307653023651 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _QoSMaxBitRateDownlink_H_ #define _QoSMaxBitRateDownlink_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* QoSMaxBitRateDownlink */ typedef OCTET_STRING_t QoSMaxBitRateDownlink_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_QoSMaxBitRateDownlink; asn_struct_free_f QoSMaxBitRateDownlink_free; asn_struct_print_f QoSMaxBitRateDownlink_print; asn_constr_check_f QoSMaxBitRateDownlink_constraint; ber_type_decoder_f QoSMaxBitRateDownlink_decode_ber; der_type_encoder_f QoSMaxBitRateDownlink_encode_der; xer_type_decoder_f QoSMaxBitRateDownlink_decode_xer; xer_type_encoder_f QoSMaxBitRateDownlink_encode_xer; #ifdef __cplusplus } #endif #endif /* _QoSMaxBitRateDownlink_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/TimeBandSubtype.c0000644000000000000000000000746511723307653022562 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "TimeBandSubtype.h" int TimeBandSubtype_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void TimeBandSubtype_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void TimeBandSubtype_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { TimeBandSubtype_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int TimeBandSubtype_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { TimeBandSubtype_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t TimeBandSubtype_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { TimeBandSubtype_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t TimeBandSubtype_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { TimeBandSubtype_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t TimeBandSubtype_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { TimeBandSubtype_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t TimeBandSubtype_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { TimeBandSubtype_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_TimeBandSubtype_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (221 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_TimeBandSubtype = { "TimeBandSubtype", "TimeBandSubtype", TimeBandSubtype_free, TimeBandSubtype_print, TimeBandSubtype_constraint, TimeBandSubtype_decode_ber, TimeBandSubtype_encode_der, TimeBandSubtype_decode_xer, TimeBandSubtype_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TimeBandSubtype_tags_1, sizeof(asn_DEF_TimeBandSubtype_tags_1) /sizeof(asn_DEF_TimeBandSubtype_tags_1[0]) - 1, /* 1 */ asn_DEF_TimeBandSubtype_tags_1, /* Same as above */ sizeof(asn_DEF_TimeBandSubtype_tags_1) /sizeof(asn_DEF_TimeBandSubtype_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ValueAddedService.c0000644000000000000000000001040411723307653023025 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "ValueAddedService.h" static asn_TYPE_member_t asn_MBR_ValueAddedService_1[] = { { ATF_POINTER, 7, offsetof(struct ValueAddedService, fraudMonitorIndicator), (ASN_TAG_CLASS_APPLICATION | (112 << 2)), 0, &asn_DEF_FraudMonitorIndicator, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "fraudMonitorIndicator" }, { ATF_POINTER, 6, offsetof(struct ValueAddedService, chargeableSubscriber), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_ScuVasChargeableSubscriber, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "chargeableSubscriber" }, { ATF_POINTER, 5, offsetof(struct ValueAddedService, rapFileSequenceNumber), (ASN_TAG_CLASS_APPLICATION | (181 << 2)), 0, &asn_DEF_RapFileSequenceNumber, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "rapFileSequenceNumber" }, { ATF_POINTER, 4, offsetof(struct ValueAddedService, networkType), (ASN_TAG_CLASS_APPLICATION | (157 << 2)), 0, &asn_DEF_NetworkType, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "networkType" }, { ATF_POINTER, 3, offsetof(struct ValueAddedService, servingNetwork), (ASN_TAG_CLASS_APPLICATION | (195 << 2)), 0, &asn_DEF_ServingNetwork, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "servingNetwork" }, { ATF_POINTER, 2, offsetof(struct ValueAddedService, valueAddedServiceUsed), (ASN_TAG_CLASS_APPLICATION | (236 << 2)), 0, &asn_DEF_ValueAddedServiceUsed, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "valueAddedServiceUsed" }, { ATF_POINTER, 1, offsetof(struct ValueAddedService, operatorSpecInformation), (ASN_TAG_CLASS_APPLICATION | (162 << 2)), 0, &asn_DEF_OperatorSpecInfoList, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "operatorSpecInformation" }, }; static ber_tlv_tag_t asn_DEF_ValueAddedService_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (13 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ValueAddedService_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (112 << 2)), 0, 0, 0 }, /* fraudMonitorIndicator at 195 */ { (ASN_TAG_CLASS_APPLICATION | (157 << 2)), 3, 0, 0 }, /* networkType at 198 */ { (ASN_TAG_CLASS_APPLICATION | (162 << 2)), 6, 0, 0 }, /* operatorSpecInformation at 201 */ { (ASN_TAG_CLASS_APPLICATION | (181 << 2)), 2, 0, 0 }, /* rapFileSequenceNumber at 197 */ { (ASN_TAG_CLASS_APPLICATION | (195 << 2)), 4, 0, 0 }, /* servingNetwork at 199 */ { (ASN_TAG_CLASS_APPLICATION | (236 << 2)), 5, 0, 0 }, /* valueAddedServiceUsed at 200 */ { (ASN_TAG_CLASS_APPLICATION | (254 << 2)), 1, 0, 0 }, /* minChargeableSubscriber at 1211 */ { (ASN_TAG_CLASS_APPLICATION | (286 << 2)), 1, 0, 0 } /* gsmChargeableSubscriber at 1209 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ValueAddedService_specs_1 = { sizeof(struct ValueAddedService), offsetof(struct ValueAddedService, _asn_ctx), asn_MAP_ValueAddedService_tag2el_1, 8, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_ValueAddedService = { "ValueAddedService", "ValueAddedService", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ValueAddedService_tags_1, sizeof(asn_DEF_ValueAddedService_tags_1) /sizeof(asn_DEF_ValueAddedService_tags_1[0]) - 1, /* 1 */ asn_DEF_ValueAddedService_tags_1, /* Same as above */ sizeof(asn_DEF_ValueAddedService_tags_1) /sizeof(asn_DEF_ValueAddedService_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_ValueAddedService_1, 7, /* Elements count */ &asn_SPC_ValueAddedService_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSRequested.c0000644000000000000000000000361711723307653022102 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSRequested.h" static asn_TYPE_member_t asn_MBR_QoSRequested_1[] = { { ATF_NOFLAGS, 0, offsetof(struct QoSRequested, choice.gsmQoSRequested), (ASN_TAG_CLASS_APPLICATION | (272 << 2)), 0, &asn_DEF_GSMQoSRequested, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "gsmQoSRequested" }, { ATF_NOFLAGS, 0, offsetof(struct QoSRequested, choice.umtsQoSRequested), (ASN_TAG_CLASS_APPLICATION | (270 << 2)), 0, &asn_DEF_UMTSQoSRequested, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "umtsQoSRequested" }, }; static asn_TYPE_tag2member_t asn_MAP_QoSRequested_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (270 << 2)), 1, 0, 0 }, /* umtsQoSRequested at 1130 */ { (ASN_TAG_CLASS_APPLICATION | (272 << 2)), 0, 0, 0 } /* gsmQoSRequested at 1128 */ }; static asn_CHOICE_specifics_t asn_SPC_QoSRequested_specs_1 = { sizeof(struct QoSRequested), offsetof(struct QoSRequested, _asn_ctx), offsetof(struct QoSRequested, present), sizeof(((struct QoSRequested *)0)->present), asn_MAP_QoSRequested_tag2el_1, 2, /* Count of tags in the map */ 0, -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_QoSRequested = { "QoSRequested", "QoSRequested", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_QoSRequested_1, 2, /* Elements count */ &asn_SPC_QoSRequested_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/Makefile0000644000000000000000000004737511725344140021015 0ustar rootrootASN_MODULE_SOURCES= \ DataInterChange.c \ TransferBatch.c \ Notification.c \ CallEventDetailList.c \ CallEventDetail.c \ BatchControlInfo.c \ AccountingInfo.c \ NetworkInfo.c \ MessageDescriptionInfoList.c \ MobileOriginatedCall.c \ MobileTerminatedCall.c \ SupplServiceEvent.c \ ServiceCentreUsage.c \ GprsCall.c \ ContentTransaction.c \ LocationService.c \ AuditControlInfo.c \ AccessPointNameNI.c \ AccessPointNameOI.c \ ActualDeliveryTimeStamp.c \ AddressStringDigits.c \ AdvisedCharge.c \ AdvisedChargeCurrency.c \ AdvisedChargeInformation.c \ AgeOfLocation.c \ BasicService.c \ BasicServiceCode.c \ BasicServiceCodeList.c \ BasicServiceUsed.c \ BasicServiceUsedList.c \ BearerServiceCode.c \ CalledNumber.c \ CalledPlace.c \ CalledRegion.c \ CallEventDetailsCount.c \ CallEventStartTimeStamp.c \ CallingNumber.c \ CallOriginator.c \ CallReference.c \ CallTypeGroup.c \ CallTypeLevel1.c \ CallTypeLevel2.c \ CallTypeLevel3.c \ CamelDestinationNumber.c \ CamelInvocationFee.c \ CamelServiceKey.c \ CamelServiceLevel.c \ CamelServiceUsed.c \ CauseForTerm.c \ CellId.c \ Charge.c \ ChargeableSubscriber.c \ ChargeableUnits.c \ ChargeDetail.c \ ChargeDetailList.c \ ChargeDetailTimeStamp.c \ ChargedItem.c \ ChargedPartyEquipment.c \ ChargedPartyHomeIdentification.c \ ChargedPartyHomeIdList.c \ ChargedPartyIdentification.c \ ChargedPartyIdentifier.c \ ChargedPartyIdList.c \ ChargedPartyIdType.c \ ChargedPartyInformation.c \ ChargedPartyLocation.c \ ChargedPartyLocationList.c \ ChargedPartyStatus.c \ ChargedUnits.c \ ChargeInformation.c \ ChargeInformationList.c \ ChargeRefundIndicator.c \ ChargeType.c \ ChargingId.c \ ChargingPoint.c \ ChargingTimeStamp.c \ ClirIndicator.c \ Commission.c \ CompletionTimeStamp.c \ ContentChargingPoint.c \ ContentProvider.c \ ContentProviderIdentifier.c \ ContentProviderIdList.c \ ContentProviderIdType.c \ ContentProviderName.c \ ContentServiceUsed.c \ ContentServiceUsedList.c \ ContentTransactionBasicInfo.c \ ContentTransactionCode.c \ ContentTransactionType.c \ CseInformation.c \ CurrencyConversion.c \ CurrencyConversionList.c \ CustomerIdentifier.c \ CustomerIdType.c \ DataVolume.c \ DataVolumeIncoming.c \ DataVolumeOutgoing.c \ DateTime.c \ DateTimeLong.c \ DefaultCallHandlingIndicator.c \ DepositTimeStamp.c \ Destination.c \ DestinationNetwork.c \ DialledDigits.c \ Discount.c \ DiscountableAmount.c \ DiscountApplied.c \ DiscountCode.c \ DiscountInformation.c \ Discounting.c \ DiscountingList.c \ DiscountRate.c \ DiscountValue.c \ DistanceChargeBandCode.c \ EarliestCallTimeStamp.c \ EquipmentId.c \ EquipmentIdType.c \ Esn.c \ ExchangeRate.c \ ExchangeRateCode.c \ FileAvailableTimeStamp.c \ FileCreationTimeStamp.c \ FileSequenceNumber.c \ FileTypeIndicator.c \ FixedDiscountValue.c \ Fnur.c \ GeographicalLocation.c \ GprsBasicCallInformation.c \ GprsChargeableSubscriber.c \ GprsDestination.c \ GprsLocationInformation.c \ GprsNetworkLocation.c \ GprsServiceUsed.c \ GsmChargeableSubscriber.c \ GuaranteedBitRate.c \ HomeBid.c \ HomeIdentifier.c \ HomeIdType.c \ HomeLocationDescription.c \ HomeLocationInformation.c \ HorizontalAccuracyDelivered.c \ HorizontalAccuracyRequested.c \ HSCSDIndicator.c \ Imei.c \ ImeiOrEsn.c \ Imsi.c \ IMSSignallingContext.c \ InternetServiceProvider.c \ InternetServiceProviderIdList.c \ IspIdentifier.c \ IspIdType.c \ ISPList.c \ NetworkIdType.c \ NetworkIdentifier.c \ Network.c \ NetworkList.c \ LatestCallTimeStamp.c \ LCSQosDelivered.c \ LCSQosRequested.c \ LCSRequestTimestamp.c \ LCSSPIdentification.c \ LCSSPIdentificationList.c \ LCSSPInformation.c \ LCSTransactionStatus.c \ LocalCurrency.c \ LocalTimeStamp.c \ LocationArea.c \ LocationDescription.c \ LocationIdentifier.c \ LocationIdType.c \ LocationInformation.c \ LocationServiceUsage.c \ MaximumBitRate.c \ Mdn.c \ MessageDescription.c \ MessageDescriptionCode.c \ MessageDescriptionInformation.c \ MessageStatus.c \ MessageType.c \ Min.c \ MinChargeableSubscriber.c \ MoBasicCallInformation.c \ Msisdn.c \ MtBasicCallInformation.c \ NetworkAccessIdentifier.c \ NetworkId.c \ NetworkInitPDPContext.c \ NetworkLocation.c \ NonChargedNumber.c \ NumberOfDecimalPlaces.c \ ObjectType.c \ OperatorSpecInfoList.c \ OperatorSpecInformation.c \ OrderPlacedTimeStamp.c \ OriginatingNetwork.c \ PacketDataProtocolAddress.c \ PaidIndicator.c \ PartialTypeIndicator.c \ PaymentMethod.c \ PdpAddress.c \ PDPContextStartTimestamp.c \ PlmnId.c \ PositioningMethod.c \ PriorityCode.c \ RapFileSequenceNumber.c \ RecEntityCode.c \ RecEntityCodeList.c \ RecEntityId.c \ RecEntityInfoList.c \ RecEntityInformation.c \ RecEntityType.c \ Recipient.c \ ReleaseVersionNumber.c \ RequestedDeliveryTimeStamp.c \ ResponseTime.c \ ResponseTimeCategory.c \ ScuBasicInformation.c \ ScuChargeType.c \ ScuTimeStamps.c \ ScuChargeableSubscriber.c \ Sender.c \ ServingBid.c \ ServingLocationDescription.c \ ServingNetwork.c \ ServingPartiesInformation.c \ SimChargeableSubscriber.c \ SimToolkitIndicator.c \ SMSDestinationNumber.c \ SMSOriginator.c \ SpecificationVersionNumber.c \ SsParameters.c \ SupplServiceActionCode.c \ SupplServiceCode.c \ SupplServiceUsed.c \ TapCurrency.c \ TapDecimalPlaces.c \ TaxableAmount.c \ Taxation.c \ TaxationList.c \ TaxCode.c \ TaxInformation.c \ TaxInformationList.c \ TaxRate.c \ TaxType.c \ TaxValue.c \ TeleServiceCode.c \ ThirdPartyInformation.c \ ThirdPartyNumber.c \ ThreeGcamelDestination.c \ TotalAdvisedCharge.c \ TotalAdvisedChargeRefund.c \ TotalAdvisedChargeValue.c \ TotalAdvisedChargeValueList.c \ TotalCallEventDuration.c \ TotalCharge.c \ TotalChargeRefund.c \ TotalCommission.c \ TotalCommissionRefund.c \ TotalDataVolume.c \ TotalDiscountRefund.c \ TotalDiscountValue.c \ TotalTaxRefund.c \ TotalTaxValue.c \ TotalTransactionDuration.c \ TrackedCustomerEquipment.c \ TrackedCustomerHomeId.c \ TrackedCustomerHomeIdList.c \ TrackedCustomerIdentification.c \ TrackedCustomerIdList.c \ TrackedCustomerInformation.c \ TrackedCustomerLocation.c \ TrackedCustomerLocList.c \ TrackingCustomerEquipment.c \ TrackingCustomerHomeId.c \ TrackingCustomerHomeIdList.c \ TrackingCustomerIdentification.c \ TrackingCustomerIdList.c \ TrackingCustomerInformation.c \ TrackingCustomerLocation.c \ TrackingCustomerLocList.c \ TrackingFrequency.c \ TrackingPeriod.c \ TransactionAuthCode.c \ TransactionDescriptionSupp.c \ TransactionDetailDescription.c \ TransactionIdentifier.c \ TransactionShortDescription.c \ TransactionStatus.c \ TransferCutOffTimeStamp.c \ TransparencyIndicator.c \ UserProtocolIndicator.c \ UtcTimeOffset.c \ UtcTimeOffsetCode.c \ UtcTimeOffsetInfo.c \ UtcTimeOffsetInfoList.c \ VerticalAccuracyDelivered.c \ VerticalAccuracyRequested.c \ AbsoluteAmount.c \ Bid.c \ Code.c \ AsciiString.c \ BCDString.c \ Currency.c \ HexString.c \ NumberString.c \ PercentageRate.c ASN_MODULE_HEADERS= \ DataInterChange.h \ TransferBatch.h \ Notification.h \ CallEventDetailList.h \ CallEventDetail.h \ BatchControlInfo.h \ AccountingInfo.h \ NetworkInfo.h \ MessageDescriptionInfoList.h \ MobileOriginatedCall.h \ MobileTerminatedCall.h \ SupplServiceEvent.h \ ServiceCentreUsage.h \ GprsCall.h \ ContentTransaction.h \ LocationService.h \ AuditControlInfo.h \ AccessPointNameNI.h \ AccessPointNameOI.h \ ActualDeliveryTimeStamp.h \ AddressStringDigits.h \ AdvisedCharge.h \ AdvisedChargeCurrency.h \ AdvisedChargeInformation.h \ AgeOfLocation.h \ BasicService.h \ BasicServiceCode.h \ BasicServiceCodeList.h \ BasicServiceUsed.h \ BasicServiceUsedList.h \ BearerServiceCode.h \ CalledNumber.h \ CalledPlace.h \ CalledRegion.h \ CallEventDetailsCount.h \ CallEventStartTimeStamp.h \ CallingNumber.h \ CallOriginator.h \ CallReference.h \ CallTypeGroup.h \ CallTypeLevel1.h \ CallTypeLevel2.h \ CallTypeLevel3.h \ CamelDestinationNumber.h \ CamelInvocationFee.h \ CamelServiceKey.h \ CamelServiceLevel.h \ CamelServiceUsed.h \ CauseForTerm.h \ CellId.h \ Charge.h \ ChargeableSubscriber.h \ ChargeableUnits.h \ ChargeDetail.h \ ChargeDetailList.h \ ChargeDetailTimeStamp.h \ ChargedItem.h \ ChargedPartyEquipment.h \ ChargedPartyHomeIdentification.h \ ChargedPartyHomeIdList.h \ ChargedPartyIdentification.h \ ChargedPartyIdentifier.h \ ChargedPartyIdList.h \ ChargedPartyIdType.h \ ChargedPartyInformation.h \ ChargedPartyLocation.h \ ChargedPartyLocationList.h \ ChargedPartyStatus.h \ ChargedUnits.h \ ChargeInformation.h \ ChargeInformationList.h \ ChargeRefundIndicator.h \ ChargeType.h \ ChargingId.h \ ChargingPoint.h \ ChargingTimeStamp.h \ ClirIndicator.h \ Commission.h \ CompletionTimeStamp.h \ ContentChargingPoint.h \ ContentProvider.h \ ContentProviderIdentifier.h \ ContentProviderIdList.h \ ContentProviderIdType.h \ ContentProviderName.h \ ContentServiceUsed.h \ ContentServiceUsedList.h \ ContentTransactionBasicInfo.h \ ContentTransactionCode.h \ ContentTransactionType.h \ CseInformation.h \ CurrencyConversion.h \ CurrencyConversionList.h \ CustomerIdentifier.h \ CustomerIdType.h \ DataVolume.h \ DataVolumeIncoming.h \ DataVolumeOutgoing.h \ DateTime.h \ DateTimeLong.h \ DefaultCallHandlingIndicator.h \ DepositTimeStamp.h \ Destination.h \ DestinationNetwork.h \ DialledDigits.h \ Discount.h \ DiscountableAmount.h \ DiscountApplied.h \ DiscountCode.h \ DiscountInformation.h \ Discounting.h \ DiscountingList.h \ DiscountRate.h \ DiscountValue.h \ DistanceChargeBandCode.h \ EarliestCallTimeStamp.h \ EquipmentId.h \ EquipmentIdType.h \ Esn.h \ ExchangeRate.h \ ExchangeRateCode.h \ FileAvailableTimeStamp.h \ FileCreationTimeStamp.h \ FileSequenceNumber.h \ FileTypeIndicator.h \ FixedDiscountValue.h \ Fnur.h \ GeographicalLocation.h \ GprsBasicCallInformation.h \ GprsChargeableSubscriber.h \ GprsDestination.h \ GprsLocationInformation.h \ GprsNetworkLocation.h \ GprsServiceUsed.h \ GsmChargeableSubscriber.h \ GuaranteedBitRate.h \ HomeBid.h \ HomeIdentifier.h \ HomeIdType.h \ HomeLocationDescription.h \ HomeLocationInformation.h \ HorizontalAccuracyDelivered.h \ HorizontalAccuracyRequested.h \ HSCSDIndicator.h \ Imei.h \ ImeiOrEsn.h \ Imsi.h \ IMSSignallingContext.h \ InternetServiceProvider.h \ InternetServiceProviderIdList.h \ IspIdentifier.h \ IspIdType.h \ ISPList.h \ NetworkIdType.h \ NetworkIdentifier.h \ Network.h \ NetworkList.h \ LatestCallTimeStamp.h \ LCSQosDelivered.h \ LCSQosRequested.h \ LCSRequestTimestamp.h \ LCSSPIdentification.h \ LCSSPIdentificationList.h \ LCSSPInformation.h \ LCSTransactionStatus.h \ LocalCurrency.h \ LocalTimeStamp.h \ LocationArea.h \ LocationDescription.h \ LocationIdentifier.h \ LocationIdType.h \ LocationInformation.h \ LocationServiceUsage.h \ MaximumBitRate.h \ Mdn.h \ MessageDescription.h \ MessageDescriptionCode.h \ MessageDescriptionInformation.h \ MessageStatus.h \ MessageType.h \ Min.h \ MinChargeableSubscriber.h \ MoBasicCallInformation.h \ Msisdn.h \ MtBasicCallInformation.h \ NetworkAccessIdentifier.h \ NetworkId.h \ NetworkInitPDPContext.h \ NetworkLocation.h \ NonChargedNumber.h \ NumberOfDecimalPlaces.h \ ObjectType.h \ OperatorSpecInfoList.h \ OperatorSpecInformation.h \ OrderPlacedTimeStamp.h \ OriginatingNetwork.h \ PacketDataProtocolAddress.h \ PaidIndicator.h \ PartialTypeIndicator.h \ PaymentMethod.h \ PdpAddress.h \ PDPContextStartTimestamp.h \ PlmnId.h \ PositioningMethod.h \ PriorityCode.h \ RapFileSequenceNumber.h \ RecEntityCode.h \ RecEntityCodeList.h \ RecEntityId.h \ RecEntityInfoList.h \ RecEntityInformation.h \ RecEntityType.h \ Recipient.h \ ReleaseVersionNumber.h \ RequestedDeliveryTimeStamp.h \ ResponseTime.h \ ResponseTimeCategory.h \ ScuBasicInformation.h \ ScuChargeType.h \ ScuTimeStamps.h \ ScuChargeableSubscriber.h \ Sender.h \ ServingBid.h \ ServingLocationDescription.h \ ServingNetwork.h \ ServingPartiesInformation.h \ SimChargeableSubscriber.h \ SimToolkitIndicator.h \ SMSDestinationNumber.h \ SMSOriginator.h \ SpecificationVersionNumber.h \ SsParameters.h \ SupplServiceActionCode.h \ SupplServiceCode.h \ SupplServiceUsed.h \ TapCurrency.h \ TapDecimalPlaces.h \ TaxableAmount.h \ Taxation.h \ TaxationList.h \ TaxCode.h \ TaxInformation.h \ TaxInformationList.h \ TaxRate.h \ TaxType.h \ TaxValue.h \ TeleServiceCode.h \ ThirdPartyInformation.h \ ThirdPartyNumber.h \ ThreeGcamelDestination.h \ TotalAdvisedCharge.h \ TotalAdvisedChargeRefund.h \ TotalAdvisedChargeValue.h \ TotalAdvisedChargeValueList.h \ TotalCallEventDuration.h \ TotalCharge.h \ TotalChargeRefund.h \ TotalCommission.h \ TotalCommissionRefund.h \ TotalDataVolume.h \ TotalDiscountRefund.h \ TotalDiscountValue.h \ TotalTaxRefund.h \ TotalTaxValue.h \ TotalTransactionDuration.h \ TrackedCustomerEquipment.h \ TrackedCustomerHomeId.h \ TrackedCustomerHomeIdList.h \ TrackedCustomerIdentification.h \ TrackedCustomerIdList.h \ TrackedCustomerInformation.h \ TrackedCustomerLocation.h \ TrackedCustomerLocList.h \ TrackingCustomerEquipment.h \ TrackingCustomerHomeId.h \ TrackingCustomerHomeIdList.h \ TrackingCustomerIdentification.h \ TrackingCustomerIdList.h \ TrackingCustomerInformation.h \ TrackingCustomerLocation.h \ TrackingCustomerLocList.h \ TrackingFrequency.h \ TrackingPeriod.h \ TransactionAuthCode.h \ TransactionDescriptionSupp.h \ TransactionDetailDescription.h \ TransactionIdentifier.h \ TransactionShortDescription.h \ TransactionStatus.h \ TransferCutOffTimeStamp.h \ TransparencyIndicator.h \ UserProtocolIndicator.h \ UtcTimeOffset.h \ UtcTimeOffsetCode.h \ UtcTimeOffsetInfo.h \ UtcTimeOffsetInfoList.h \ VerticalAccuracyDelivered.h \ VerticalAccuracyRequested.h \ AbsoluteAmount.h \ Bid.h \ Code.h \ AsciiString.h \ BCDString.h \ Currency.h \ HexString.h \ NumberString.h \ PercentageRate.h ASN_MODULE_HEADERS+=INTEGER.h ASN_MODULE_HEADERS+=NativeEnumerated.h ASN_MODULE_HEADERS+=IA5String.h ASN_MODULE_SOURCES+=IA5String.c ASN_MODULE_SOURCES+=INTEGER.c ASN_MODULE_SOURCES+=NativeEnumerated.c ASN_MODULE_HEADERS+=NativeInteger.h ASN_MODULE_SOURCES+=NativeInteger.c ASN_MODULE_HEADERS+=asn_SEQUENCE_OF.h ASN_MODULE_SOURCES+=asn_SEQUENCE_OF.c ASN_MODULE_HEADERS+=asn_SET_OF.h ASN_MODULE_SOURCES+=asn_SET_OF.c ASN_MODULE_HEADERS+=constr_CHOICE.h ASN_MODULE_SOURCES+=constr_CHOICE.c ASN_MODULE_HEADERS+=constr_SEQUENCE.h ASN_MODULE_SOURCES+=constr_SEQUENCE.c ASN_MODULE_HEADERS+=constr_SEQUENCE_OF.h ASN_MODULE_SOURCES+=constr_SEQUENCE_OF.c ASN_MODULE_HEADERS+=constr_SET_OF.h ASN_MODULE_SOURCES+=constr_SET_OF.c ASN_MODULE_HEADERS+=asn_application.h ASN_MODULE_HEADERS+=asn_system.h ASN_MODULE_HEADERS+=asn_codecs.h ASN_MODULE_HEADERS+=asn_internal.h ASN_MODULE_HEADERS+=OCTET_STRING.h ASN_MODULE_SOURCES+=OCTET_STRING.c ASN_MODULE_HEADERS+=BIT_STRING.h ASN_MODULE_SOURCES+=BIT_STRING.c ASN_MODULE_SOURCES+=asn_codecs_prim.c ASN_MODULE_HEADERS+=asn_codecs_prim.h ASN_MODULE_HEADERS+=ber_tlv_length.h ASN_MODULE_SOURCES+=ber_tlv_length.c ASN_MODULE_HEADERS+=ber_tlv_tag.h ASN_MODULE_SOURCES+=ber_tlv_tag.c ASN_MODULE_HEADERS+=ber_decoder.h ASN_MODULE_SOURCES+=ber_decoder.c ASN_MODULE_HEADERS+=der_encoder.h ASN_MODULE_SOURCES+=der_encoder.c ASN_MODULE_HEADERS+=constr_TYPE.h ASN_MODULE_SOURCES+=constr_TYPE.c ASN_MODULE_HEADERS+=constraints.h ASN_MODULE_SOURCES+=constraints.c ASN_MODULE_HEADERS+=xer_support.h ASN_MODULE_SOURCES+=xer_support.c ASN_MODULE_HEADERS+=xer_decoder.h ASN_MODULE_SOURCES+=xer_decoder.c ASN_MODULE_HEADERS+=xer_encoder.h ASN_MODULE_SOURCES+=xer_encoder.c ASN_MODULE_HEADERS+=per_support.h ASN_MODULE_SOURCES+=per_support.c ASN_MODULE_HEADERS+=per_decoder.h ASN_MODULE_SOURCES+=per_decoder.c ASN_MODULE_HEADERS+=per_encoder.h ASN_MODULE_SOURCES+=per_encoder.c ASN_MODULE_HEADERS+=per_opentype.h ASN_MODULE_SOURCES+=per_opentype.c ASN_CONVERTER_SOURCES+=converter-sample.c lib_LTLIBRARIES=libsomething.la libsomething_la_SOURCES=$(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS) # This file may be used as an input for make(3) # Remove the lines below to convert it into a pure .am file TARGET = tap3dump CFLAGS += -DASN_CONVERTER_TITLE="GSM TAP3 (Transferred Account Procedure, Version 3) decoder" -DHAVE_CONFIG_H -DJUNKTEST -DPDU=DataInterChange -I. OBJS=${ASN_MODULE_SOURCES:.c=.o} ${ASN_CONVERTER_SOURCES:.c=.o} all: DataInterChange.c $(TARGET) $(TARGET): ${OBJS} $(CC) $(CFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS) .SUFFIXES: .SUFFIXES: .c .o .c.o: $(CC) $(CFLAGS) -o $@ -c $< clean: rm -f $(TARGET) rm -f $(OBJS) regen: regenerate-from-asn1-source regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons -pdu=DataInterChange ../tap3.asn1 DataInterChange.c: ../sample.makefile.regen ../tap3.asn1 make regen-makefile @touch DataInterChange.c make regen-makefile: TITLE="GSM TAP3 (Transferred Account Procedure, Version 3) decoder" \ ASN1CMDOPTS="" \ ASN1MODULES="../tap3.asn1" \ ASN1PDU=DataInterChange \ PROGNAME=tap3dump \ ../sample.makefile.regen check: ${TARGET} check-ber check-xer check-per @echo ================ @echo All tests passed @echo ================ check-ber: @if test -f sample-DataInterChange-1.[db]er ; then \ for f in sample-DataInterChange-*.[db]er; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into XER and back ($$b)..."; \ ./${TARGET} -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iber -onull $$f || exit 5; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iber -onull $$f || exit 6; \ done; done; fi check-xer: @if test -f sample-DataInterChange-1.xer ; then \ for f in sample-DataInterChange-*.xer; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER and back ($$b)..."; \ ./${TARGET} -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ diff $$f ./.tmp.2.$$$$ || exit 4; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -ixer -onull $$f || exit 5; \ ./${TARGET} -J0.001 -n 1000 -b $$b -ixer -onull $$f || exit 6; \ done; done; fi check-per: @if test -f sample-DataInterChange-1-nopad.per ; then \ for f in sample-DataInterChange-[1-9]-nopad.per; do \ for b in 1 17 33 980 8192; do \ echo "Recoding non-padded $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ ./${TARGET} -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \ diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \ rm -f ./.tmp.[123].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 6; \ ./${TARGET} -J0.001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 7; \ done; done; fi @if test -f sample-DataInterChange-1.per ; then \ for f in sample-*-[1-9].per; do \ pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z-]+)-[0-9].*/\1/"`; \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -p $$pdu -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \ ./${TARGET} -b $$b -p $$pdu -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \ ./${TARGET} -b $$b -p $$pdu -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \ diff $$f ./.tmp.1.$$$$ || exit 6; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iper -onull $$f || exit 7; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iper -onull $$f || exit 8; \ done; done; fi distclean: clean rm -f $(ASN_MODULE_SOURCES) rm -f $(ASN_MODULE_HEADERS) rm -f $(ASN_CONVERTER_SOURCES) $(ASN_CONVERTER_HEADERS) rm -f Makefile.am.sample asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ValueAddedService.h0000644000000000000000000000274311723307653023041 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _ValueAddedService_H_ #define _ValueAddedService_H_ #include /* Including external dependencies */ #include "FraudMonitorIndicator.h" #include "RapFileSequenceNumber.h" #include "NetworkType.h" #include "ServingNetwork.h" #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct ScuVasChargeableSubscriber; struct ValueAddedServiceUsed; struct OperatorSpecInfoList; /* ValueAddedService */ typedef struct ValueAddedService { FraudMonitorIndicator_t *fraudMonitorIndicator /* OPTIONAL */; struct ScuVasChargeableSubscriber *chargeableSubscriber /* OPTIONAL */; RapFileSequenceNumber_t *rapFileSequenceNumber /* OPTIONAL */; NetworkType_t *networkType /* OPTIONAL */; ServingNetwork_t *servingNetwork /* OPTIONAL */; struct ValueAddedServiceUsed *valueAddedServiceUsed /* OPTIONAL */; struct OperatorSpecInfoList *operatorSpecInformation /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ValueAddedService_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_ValueAddedService; #ifdef __cplusplus } #endif /* Referred external types */ #include "ScuVasChargeableSubscriber.h" #include "ValueAddedServiceUsed.h" #include "OperatorSpecInfoList.h" #endif /* _ValueAddedService_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/NetworkType.c0000644000000000000000000000717511723307653022014 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "NetworkType.h" int NetworkType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NetworkType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NetworkType_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NetworkType_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NetworkType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NetworkType_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NetworkType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NetworkType_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NetworkType_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NetworkType_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NetworkType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NetworkType_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NetworkType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NetworkType_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_NetworkType_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (157 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NetworkType = { "NetworkType", "NetworkType", NetworkType_free, NetworkType_print, NetworkType_constraint, NetworkType_decode_ber, NetworkType_encode_der, NetworkType_decode_xer, NetworkType_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NetworkType_tags_1, sizeof(asn_DEF_NetworkType_tags_1) /sizeof(asn_DEF_NetworkType_tags_1[0]) - 1, /* 1 */ asn_DEF_NetworkType_tags_1, /* Same as above */ sizeof(asn_DEF_NetworkType_tags_1) /sizeof(asn_DEF_NetworkType_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ChannelCodingAcceptableList.h0000644000000000000000000000152711723307653025015 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _ChannelCodingAcceptableList_H_ #define _ChannelCodingAcceptableList_H_ #include /* Including external dependencies */ #include "ChannelCoding.h" #include #include #ifdef __cplusplus extern "C" { #endif /* ChannelCodingAcceptableList */ typedef struct ChannelCodingAcceptableList { A_SEQUENCE_OF(ChannelCoding_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ChannelCodingAcceptableList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_ChannelCodingAcceptableList; #ifdef __cplusplus } #endif #endif /* _ChannelCodingAcceptableList_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/MobileStationClassMark.h0000644000000000000000000000172011723307653024066 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _MobileStationClassMark_H_ #define _MobileStationClassMark_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* MobileStationClassMark */ typedef INTEGER_t MobileStationClassMark_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_MobileStationClassMark; asn_struct_free_f MobileStationClassMark_free; asn_struct_print_f MobileStationClassMark_print; asn_constr_check_f MobileStationClassMark_constraint; ber_type_decoder_f MobileStationClassMark_decode_ber; der_type_encoder_f MobileStationClassMark_encode_der; xer_type_decoder_f MobileStationClassMark_decode_xer; xer_type_encoder_f MobileStationClassMark_encode_xer; #ifdef __cplusplus } #endif #endif /* _MobileStationClassMark_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/NumberOfChannels.h0000644000000000000000000000160211723307653022704 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _NumberOfChannels_H_ #define _NumberOfChannels_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* NumberOfChannels */ typedef INTEGER_t NumberOfChannels_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_NumberOfChannels; asn_struct_free_f NumberOfChannels_free; asn_struct_print_f NumberOfChannels_print; asn_constr_check_f NumberOfChannels_constraint; ber_type_decoder_f NumberOfChannels_decode_ber; der_type_encoder_f NumberOfChannels_encode_der; xer_type_decoder_f NumberOfChannels_decode_xer; xer_type_encoder_f NumberOfChannels_encode_xer; #ifdef __cplusplus } #endif #endif /* _NumberOfChannels_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GprsServiceUsageList.c0000644000000000000000000000317711723307653023574 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "GprsServiceUsageList.h" static asn_TYPE_member_t asn_MBR_GprsServiceUsageList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (119 << 2)), 0, &asn_DEF_GprsServiceUsage, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_GprsServiceUsageList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (120 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_GprsServiceUsageList_specs_1 = { sizeof(struct GprsServiceUsageList), offsetof(struct GprsServiceUsageList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_GprsServiceUsageList = { "GprsServiceUsageList", "GprsServiceUsageList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_GprsServiceUsageList_tags_1, sizeof(asn_DEF_GprsServiceUsageList_tags_1) /sizeof(asn_DEF_GprsServiceUsageList_tags_1[0]) - 1, /* 1 */ asn_DEF_GprsServiceUsageList_tags_1, /* Same as above */ sizeof(asn_DEF_GprsServiceUsageList_tags_1) /sizeof(asn_DEF_GprsServiceUsageList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_GprsServiceUsageList_1, 1, /* Single element */ &asn_SPC_GprsServiceUsageList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CamelCallReference.c0000644000000000000000000000444211723307653023147 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "CamelCallReference.h" static asn_TYPE_member_t asn_MBR_CamelCallReference_1[] = { { ATF_POINTER, 2, offsetof(struct CamelCallReference, mscAddress), (ASN_TAG_CLASS_APPLICATION | (33 << 2)), 0, &asn_DEF_AddressStringDigits, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "mscAddress" }, { ATF_POINTER, 1, offsetof(struct CamelCallReference, callReferenceNumber), (ASN_TAG_CLASS_APPLICATION | (50 << 2)), 0, &asn_DEF_CamelCallReferenceNumber, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "callReferenceNumber" }, }; static ber_tlv_tag_t asn_DEF_CamelCallReference_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (49 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_CamelCallReference_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (33 << 2)), 0, 0, 0 }, /* mscAddress at 369 */ { (ASN_TAG_CLASS_APPLICATION | (50 << 2)), 1, 0, 0 } /* callReferenceNumber at 370 */ }; static asn_SEQUENCE_specifics_t asn_SPC_CamelCallReference_specs_1 = { sizeof(struct CamelCallReference), offsetof(struct CamelCallReference, _asn_ctx), asn_MAP_CamelCallReference_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_CamelCallReference = { "CamelCallReference", "CamelCallReference", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CamelCallReference_tags_1, sizeof(asn_DEF_CamelCallReference_tags_1) /sizeof(asn_DEF_CamelCallReference_tags_1[0]) - 1, /* 1 */ asn_DEF_CamelCallReference_tags_1, /* Same as above */ sizeof(asn_DEF_CamelCallReference_tags_1) /sizeof(asn_DEF_CamelCallReference_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_CamelCallReference_1, 2, /* Elements count */ &asn_SPC_CamelCallReference_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/HSCSDInformation.h0000644000000000000000000000202011723307653022560 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _HSCSDInformation_H_ #define _HSCSDInformation_H_ #include /* Including external dependencies */ #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct BasicHSCSDParameters; struct HSCSDParameterModificationList; /* HSCSDInformation */ typedef struct HSCSDInformation { struct BasicHSCSDParameters *basicHSCSDParameters /* OPTIONAL */; struct HSCSDParameterModificationList *hSCSDParameterModificationList /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } HSCSDInformation_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_HSCSDInformation; #ifdef __cplusplus } #endif /* Referred external types */ #include "BasicHSCSDParameters.h" #include "HSCSDParameterModificationList.h" #endif /* _HSCSDInformation_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/ScuVasChargeableSubscriber.h0000644000000000000000000000242111723307653024701 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _ScuVasChargeableSubscriber_H_ #define _ScuVasChargeableSubscriber_H_ #include /* Including external dependencies */ #include "GsmChargeableSubscriber.h" #include "MinChargeableSubscriber.h" #include #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum ScuVasChargeableSubscriber_PR { ScuVasChargeableSubscriber_PR_NOTHING, /* No components present */ ScuVasChargeableSubscriber_PR_gsmChargeableSubscriber, ScuVasChargeableSubscriber_PR_minChargeableSubscriber } ScuVasChargeableSubscriber_PR; /* ScuVasChargeableSubscriber */ typedef struct ScuVasChargeableSubscriber { ScuVasChargeableSubscriber_PR present; union ScuVasChargeableSubscriber_u { GsmChargeableSubscriber_t gsmChargeableSubscriber; MinChargeableSubscriber_t minChargeableSubscriber; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ScuVasChargeableSubscriber_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_ScuVasChargeableSubscriber; #ifdef __cplusplus } #endif #endif /* _ScuVasChargeableSubscriber_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GprsServiceUsage.h0000644000000000000000000000225511723307653022741 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _GprsServiceUsage_H_ #define _GprsServiceUsage_H_ #include /* Including external dependencies */ #include "DataVolumeIncoming.h" #include "DataVolumeOutgoing.h" #include #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct DateTime; struct QoSRequested; struct QoSUsed; /* GprsServiceUsage */ typedef struct GprsServiceUsage { struct DateTime *gprsUsageTimeStamp /* OPTIONAL */; struct QoSRequested *qosRequested /* OPTIONAL */; struct QoSUsed *qosUsed /* OPTIONAL */; DataVolumeIncoming_t *dataVolumeIncoming /* OPTIONAL */; DataVolumeOutgoing_t *dataVolumeOutgoing /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } GprsServiceUsage_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_GprsServiceUsage; #ifdef __cplusplus } #endif /* Referred external types */ #include "ChargingTimeStamp.h" #include "QoSRequested.h" #include "QoSUsed.h" #endif /* _GprsServiceUsage_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSReliability.c0000644000000000000000000000733511723307653022413 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSReliability.h" int QoSReliability_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void QoSReliability_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void QoSReliability_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSReliability_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSReliability_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSReliability_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSReliability_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSReliability_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSReliability_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSReliability_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSReliability_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSReliability_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSReliability_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSReliability_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSReliability_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (176 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSReliability = { "QoSReliability", "QoSReliability", QoSReliability_free, QoSReliability_print, QoSReliability_constraint, QoSReliability_decode_ber, QoSReliability_encode_der, QoSReliability_decode_xer, QoSReliability_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSReliability_tags_1, sizeof(asn_DEF_QoSReliability_tags_1) /sizeof(asn_DEF_QoSReliability_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSReliability_tags_1, /* Same as above */ sizeof(asn_DEF_QoSReliability_tags_1) /sizeof(asn_DEF_QoSReliability_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/DayCategorySubtype.c0000644000000000000000000000762411723307653023307 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "DayCategorySubtype.h" int DayCategorySubtype_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_AsciiString.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using AsciiString, * so here we adjust the DEF accordingly. */ static void DayCategorySubtype_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_AsciiString.free_struct; td->print_struct = asn_DEF_AsciiString.print_struct; td->ber_decoder = asn_DEF_AsciiString.ber_decoder; td->der_encoder = asn_DEF_AsciiString.der_encoder; td->xer_decoder = asn_DEF_AsciiString.xer_decoder; td->xer_encoder = asn_DEF_AsciiString.xer_encoder; td->uper_decoder = asn_DEF_AsciiString.uper_decoder; td->uper_encoder = asn_DEF_AsciiString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_AsciiString.per_constraints; td->elements = asn_DEF_AsciiString.elements; td->elements_count = asn_DEF_AsciiString.elements_count; td->specifics = asn_DEF_AsciiString.specifics; } void DayCategorySubtype_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { DayCategorySubtype_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int DayCategorySubtype_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { DayCategorySubtype_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t DayCategorySubtype_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { DayCategorySubtype_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t DayCategorySubtype_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { DayCategorySubtype_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t DayCategorySubtype_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { DayCategorySubtype_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t DayCategorySubtype_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { DayCategorySubtype_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_DayCategorySubtype_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (86 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_DayCategorySubtype = { "DayCategorySubtype", "DayCategorySubtype", DayCategorySubtype_free, DayCategorySubtype_print, DayCategorySubtype_constraint, DayCategorySubtype_decode_ber, DayCategorySubtype_encode_der, DayCategorySubtype_decode_xer, DayCategorySubtype_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_DayCategorySubtype_tags_1, sizeof(asn_DEF_DayCategorySubtype_tags_1) /sizeof(asn_DEF_DayCategorySubtype_tags_1[0]) - 1, /* 1 */ asn_DEF_DayCategorySubtype_tags_1, /* Same as above */ sizeof(asn_DEF_DayCategorySubtype_tags_1) /sizeof(asn_DEF_DayCategorySubtype_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GsnAddress.c0000644000000000000000000000655211723307653021554 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "GsnAddress.h" int GsnAddress_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_IpAddress.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using IpAddress, * so here we adjust the DEF accordingly. */ static void GsnAddress_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_IpAddress.free_struct; td->print_struct = asn_DEF_IpAddress.print_struct; td->ber_decoder = asn_DEF_IpAddress.ber_decoder; td->der_encoder = asn_DEF_IpAddress.der_encoder; td->xer_decoder = asn_DEF_IpAddress.xer_decoder; td->xer_encoder = asn_DEF_IpAddress.xer_encoder; td->uper_decoder = asn_DEF_IpAddress.uper_decoder; td->uper_encoder = asn_DEF_IpAddress.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_IpAddress.per_constraints; td->elements = asn_DEF_IpAddress.elements; td->elements_count = asn_DEF_IpAddress.elements_count; td->specifics = asn_DEF_IpAddress.specifics; } void GsnAddress_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { GsnAddress_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int GsnAddress_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { GsnAddress_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t GsnAddress_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { GsnAddress_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t GsnAddress_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { GsnAddress_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t GsnAddress_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { GsnAddress_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t GsnAddress_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { GsnAddress_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_TYPE_descriptor_t asn_DEF_GsnAddress = { "GsnAddress", "GsnAddress", GsnAddress_free, GsnAddress_print, GsnAddress_constraint, GsnAddress_decode_ber, GsnAddress_encode_der, GsnAddress_decode_xer, GsnAddress_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GSMQoSRequested.h0000644000000000000000000000161111723307653022446 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _GSMQoSRequested_H_ #define _GSMQoSRequested_H_ #include /* Including external dependencies */ #include "GSMQoSInformation.h" #ifdef __cplusplus extern "C" { #endif /* GSMQoSRequested */ typedef GSMQoSInformation_t GSMQoSRequested_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_GSMQoSRequested; asn_struct_free_f GSMQoSRequested_free; asn_struct_print_f GSMQoSRequested_print; asn_constr_check_f GSMQoSRequested_constraint; ber_type_decoder_f GSMQoSRequested_decode_ber; der_type_encoder_f GSMQoSRequested_encode_der; xer_type_decoder_f GSMQoSRequested_decode_xer; xer_type_encoder_f GSMQoSRequested_encode_xer; #ifdef __cplusplus } #endif #endif /* _GSMQoSRequested_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/GprsServiceUsage.c0000644000000000000000000000673711723307653022745 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "GprsServiceUsage.h" static asn_TYPE_member_t asn_MBR_GprsServiceUsage_1[] = { { ATF_POINTER, 5, offsetof(struct GprsServiceUsage, gprsUsageTimeStamp), (ASN_TAG_CLASS_APPLICATION | (74 << 2)), 0, &asn_DEF_ChargingTimeStamp, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "gprsUsageTimeStamp" }, { ATF_POINTER, 4, offsetof(struct GprsServiceUsage, qosRequested), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_QoSRequested, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "qosRequested" }, { ATF_POINTER, 3, offsetof(struct GprsServiceUsage, qosUsed), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_QoSUsed, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "qosUsed" }, { ATF_POINTER, 2, offsetof(struct GprsServiceUsage, dataVolumeIncoming), (ASN_TAG_CLASS_APPLICATION | (250 << 2)), 0, &asn_DEF_DataVolumeIncoming, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "dataVolumeIncoming" }, { ATF_POINTER, 1, offsetof(struct GprsServiceUsage, dataVolumeOutgoing), (ASN_TAG_CLASS_APPLICATION | (251 << 2)), 0, &asn_DEF_DataVolumeOutgoing, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "dataVolumeOutgoing" }, }; static ber_tlv_tag_t asn_DEF_GprsServiceUsage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (119 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GprsServiceUsage_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (74 << 2)), 0, 0, 0 }, /* gprsUsageTimeStamp at 786 */ { (ASN_TAG_CLASS_APPLICATION | (250 << 2)), 3, 0, 0 }, /* dataVolumeIncoming at 789 */ { (ASN_TAG_CLASS_APPLICATION | (251 << 2)), 4, 0, 0 }, /* dataVolumeOutgoing at 790 */ { (ASN_TAG_CLASS_APPLICATION | (270 << 2)), 1, 0, 0 }, /* umtsQoSRequested at 1130 */ { (ASN_TAG_CLASS_APPLICATION | (271 << 2)), 2, 0, 0 }, /* umtsQoSUsed at 1138 */ { (ASN_TAG_CLASS_APPLICATION | (272 << 2)), 1, 0, 0 }, /* gsmQoSRequested at 1128 */ { (ASN_TAG_CLASS_APPLICATION | (273 << 2)), 2, 0, 0 } /* gsmQoSUsed at 1136 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GprsServiceUsage_specs_1 = { sizeof(struct GprsServiceUsage), offsetof(struct GprsServiceUsage, _asn_ctx), asn_MAP_GprsServiceUsage_tag2el_1, 7, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_GprsServiceUsage = { "GprsServiceUsage", "GprsServiceUsage", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_GprsServiceUsage_tags_1, sizeof(asn_DEF_GprsServiceUsage_tags_1) /sizeof(asn_DEF_GprsServiceUsage_tags_1[0]) - 1, /* 1 */ asn_DEF_GprsServiceUsage_tags_1, /* Same as above */ sizeof(asn_DEF_GprsServiceUsage_tags_1) /sizeof(asn_DEF_GprsServiceUsage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_GprsServiceUsage_1, 5, /* Elements count */ &asn_SPC_GprsServiceUsage_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/QoSGuaranteedBitRateDownlink.c0000644000000000000000000001034311723307653025173 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "QoSGuaranteedBitRateDownlink.h" int QoSGuaranteedBitRateDownlink_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_OCTET_STRING.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ static void QoSGuaranteedBitRateDownlink_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_OCTET_STRING.free_struct; td->print_struct = asn_DEF_OCTET_STRING.print_struct; td->ber_decoder = asn_DEF_OCTET_STRING.ber_decoder; td->der_encoder = asn_DEF_OCTET_STRING.der_encoder; td->xer_decoder = asn_DEF_OCTET_STRING.xer_decoder; td->xer_encoder = asn_DEF_OCTET_STRING.xer_encoder; td->uper_decoder = asn_DEF_OCTET_STRING.uper_decoder; td->uper_encoder = asn_DEF_OCTET_STRING.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_OCTET_STRING.per_constraints; td->elements = asn_DEF_OCTET_STRING.elements; td->elements_count = asn_DEF_OCTET_STRING.elements_count; td->specifics = asn_DEF_OCTET_STRING.specifics; } void QoSGuaranteedBitRateDownlink_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { QoSGuaranteedBitRateDownlink_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int QoSGuaranteedBitRateDownlink_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { QoSGuaranteedBitRateDownlink_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t QoSGuaranteedBitRateDownlink_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { QoSGuaranteedBitRateDownlink_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t QoSGuaranteedBitRateDownlink_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { QoSGuaranteedBitRateDownlink_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t QoSGuaranteedBitRateDownlink_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { QoSGuaranteedBitRateDownlink_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t QoSGuaranteedBitRateDownlink_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { QoSGuaranteedBitRateDownlink_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static ber_tlv_tag_t asn_DEF_QoSGuaranteedBitRateDownlink_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (283 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_QoSGuaranteedBitRateDownlink = { "QoSGuaranteedBitRateDownlink", "QoSGuaranteedBitRateDownlink", QoSGuaranteedBitRateDownlink_free, QoSGuaranteedBitRateDownlink_print, QoSGuaranteedBitRateDownlink_constraint, QoSGuaranteedBitRateDownlink_decode_ber, QoSGuaranteedBitRateDownlink_encode_der, QoSGuaranteedBitRateDownlink_decode_xer, QoSGuaranteedBitRateDownlink_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_QoSGuaranteedBitRateDownlink_tags_1, sizeof(asn_DEF_QoSGuaranteedBitRateDownlink_tags_1) /sizeof(asn_DEF_QoSGuaranteedBitRateDownlink_tags_1[0]) - 1, /* 1 */ asn_DEF_QoSGuaranteedBitRateDownlink_tags_1, /* Same as above */ sizeof(asn_DEF_QoSGuaranteedBitRateDownlink_tags_1) /sizeof(asn_DEF_QoSGuaranteedBitRateDownlink_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/NonChargedParty.c0000644000000000000000000000437511723307653022550 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "NonChargedParty.h" static asn_TYPE_member_t asn_MBR_NonChargedParty_1[] = { { ATF_POINTER, 2, offsetof(struct NonChargedParty, nonChargedNumber), (ASN_TAG_CLASS_APPLICATION | (33 << 2)), 0, &asn_DEF_AddressStringDigits, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "nonChargedNumber" }, { ATF_POINTER, 1, offsetof(struct NonChargedParty, calledNumAnalysisCode), (ASN_TAG_CLASS_APPLICATION | (247 << 2)), 0, &asn_DEF_CalledNumAnalysisCode, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "calledNumAnalysisCode" }, }; static ber_tlv_tag_t asn_DEF_NonChargedParty_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (158 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_NonChargedParty_tag2el_1[] = { { (ASN_TAG_CLASS_APPLICATION | (33 << 2)), 0, 0, 0 }, /* nonChargedNumber at 1066 */ { (ASN_TAG_CLASS_APPLICATION | (247 << 2)), 1, 0, 0 } /* calledNumAnalysisCode at 1067 */ }; static asn_SEQUENCE_specifics_t asn_SPC_NonChargedParty_specs_1 = { sizeof(struct NonChargedParty), offsetof(struct NonChargedParty, _asn_ctx), asn_MAP_NonChargedParty_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_NonChargedParty = { "NonChargedParty", "NonChargedParty", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NonChargedParty_tags_1, sizeof(asn_DEF_NonChargedParty_tags_1) /sizeof(asn_DEF_NonChargedParty_tags_1[0]) - 1, /* 1 */ asn_DEF_NonChargedParty_tags_1, /* Same as above */ sizeof(asn_DEF_NonChargedParty_tags_1) /sizeof(asn_DEF_NonChargedParty_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_NonChargedParty_1, 2, /* Elements count */ &asn_SPC_NonChargedParty_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/CountryCode.h0000644000000000000000000000151311723307653021752 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #ifndef _CountryCode_H_ #define _CountryCode_H_ #include /* Including external dependencies */ #include "NumberString.h" #ifdef __cplusplus extern "C" { #endif /* CountryCode */ typedef NumberString_t CountryCode_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CountryCode; asn_struct_free_f CountryCode_free; asn_struct_print_f CountryCode_print; asn_constr_check_f CountryCode_constraint; ber_type_decoder_f CountryCode_decode_ber; der_type_encoder_f CountryCode_encode_der; xer_type_decoder_f CountryCode_decode_xer; xer_type_encoder_f CountryCode_encode_xer; #ifdef __cplusplus } #endif #endif /* _CountryCode_H_ */ #include asn1c-0.9.24+dfsg/examples/sample.source.TAP3/VasInfoList.c0000644000000000000000000000274211723307653021715 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "VasInfoList.h" static asn_TYPE_member_t asn_MBR_VasInfoList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (238 << 2)), 0, &asn_DEF_VasInformation, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_VasInfoList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (7 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_VasInfoList_specs_1 = { sizeof(struct VasInfoList), offsetof(struct VasInfoList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_VasInfoList = { "VasInfoList", "VasInfoList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_VasInfoList_tags_1, sizeof(asn_DEF_VasInfoList_tags_1) /sizeof(asn_DEF_VasInfoList_tags_1[0]) - 1, /* 1 */ asn_DEF_VasInfoList_tags_1, /* Same as above */ sizeof(asn_DEF_VasInfoList_tags_1) /sizeof(asn_DEF_VasInfoList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_VasInfoList_1, 1, /* Single element */ &asn_SPC_VasInfoList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.source.TAP3/IacList.c0000644000000000000000000000262511723307653021044 0ustar rootroot/* * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) * From ASN.1 module "TAP-0310" * found in "../tap3.asn1" * `asn1c -S ../../skeletons` */ #include "IacList.h" static asn_TYPE_member_t asn_MBR_IacList_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_APPLICATION | (126 << 2)), 0, &asn_DEF_Iac, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_IacList_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (127 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_IacList_specs_1 = { sizeof(struct IacList), offsetof(struct IacList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_IacList = { "IacList", "IacList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_IacList_tags_1, sizeof(asn_DEF_IacList_tags_1) /sizeof(asn_DEF_IacList_tags_1[0]) - 1, /* 1 */ asn_DEF_IacList_tags_1, /* Same as above */ sizeof(asn_DEF_IacList_tags_1) /sizeof(asn_DEF_IacList_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_IacList_1, 1, /* Single element */ &asn_SPC_IacList_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/examples/sample.makefile.regen0000755000000000000000000001250611456135550020141 0ustar rootroot#!/bin/sh # # This script attempts to compile the given ASN.1 specification and then # transforms the resulting Makefile.am.sample tailored to that specification # into a customized Makefile. # # The information which is necessary for this script is passed from the # Makefile which is going to be replaced with an updated Makefile. # This is called "boot-strapping" and is frequently the source of inside jokes. # # $Id$ # if test -z "$ASN1PDU" \ -o -z "$ASN1MODULES" \ -o -z "$PROGNAME" \ ; then echo "ASN1CMDOPTS=\"$ASN1CMDOPTS\"" echo "ASN1MODULES=\"$ASN1MODULES\"" echo "ASN1PDU=\"$ASN1PDU\"" echo "PROGNAME=\"$PROGNAME\"" echo "ASN1PDU, ASN1MODULES, and PROGNAME are mandatory" exit fi CMDOPTS="-pdu=${ASN1PDU} ${ASN1CMDOPTS} ${ASN1MODULES}" if test -x ../../asn1c/asn1c ; then echo "Compiling ${ASN1MODULES} using local compiler" ../../asn1c/asn1c -S ../../skeletons ${CMDOPTS} || exit $? else echo "Compiling ${ASN1MODULES} using system compiler" asn1c ${CMDOPTS} || exit $? fi if test ! -f Makefile.am.sample ; then echo "Makefile.am.sample is missing" exit 1 fi EXTRA_CFLAGS="-DJUNKTEST" test -f config.h && EXTRA_CFLAGS="-DHAVE_CONFIG_H ${EXTRA_CFLAGS}" test -n "$TITLE" && EXTRA_CFLAGS="-DASN_CONVERTER_TITLE=\"$TITLE\" ${EXTRA_CFLAGS}" set -x cat Makefile.am.sample \ | sed -e "s/^CFLAGS += /CFLAGS += ${EXTRA_CFLAGS} /" \ | sed -e "s/^all: /all: ${ASN1PDU}.c /" \ | sed -e "s/progname/${PROGNAME}/" \ > Makefile.$$ set +x ( echo echo "${ASN1PDU}.c: $0 ${ASN1MODULES}" echo " make regen-makefile" echo " @touch ${ASN1PDU}.c" echo " make" echo echo "regen-makefile:" test -n "$TITLE" && echo " TITLE=\"$TITLE\" \\" echo " ASN1CMDOPTS=\"${ASN1CMDOPTS}\" \\" echo " ASN1MODULES=\"${ASN1MODULES}\" \\" echo " ASN1PDU=${ASN1PDU} \\" echo " PROGNAME=${PROGNAME} \\" echo " $0" echo echo 'check: ${TARGET} check-ber check-xer check-per' echo ' @echo ================' echo ' @echo All tests passed' echo ' @echo ================' echo echo 'check-ber:' echo " @if test -f sample-${ASN1PDU}-1.[db]er ; then \\" echo " for f in sample-${ASN1PDU}-*.[db]er; do \\" echo ' for b in 1 17 33 980 8192; do \' echo ' echo "Recoding $$f into XER and back ($$b)..."; \' echo ' ./${TARGET} -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \' echo ' ./${TARGET} -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \' echo ' diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \' echo ' rm -f ./.tmp.[12].$$$$; \' echo ' echo "Test junking $$f (please wait)..."; \' echo ' ./${TARGET} -J0.0001 -n 1000 -b $$b -iber -onull $$f || exit 5; \' echo ' ./${TARGET} -J0.001 -n 1000 -b $$b -iber -onull $$f || exit 6; \' echo ' done; done; fi' echo echo 'check-xer:' echo " @if test -f sample-${ASN1PDU}-1.xer ; then \\" echo " for f in sample-${ASN1PDU}-*.xer; do \\" echo ' for b in 1 17 33 980 8192; do \' echo ' echo "Recoding $$f into DER and back ($$b)..."; \' echo ' ./${TARGET} -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \' echo ' ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \' echo ' diff $$f ./.tmp.2.$$$$ || exit 4; \' echo ' rm -f ./.tmp.[12].$$$$; \' echo ' echo "Test junking $$f (please wait)..."; \' echo ' ./${TARGET} -J0.0001 -n 1000 -b $$b -ixer -onull $$f || exit 5; \' echo ' ./${TARGET} -J0.001 -n 1000 -b $$b -ixer -onull $$f || exit 6; \' echo ' done; done; fi' echo echo 'check-per:' echo " @if test -f sample-${ASN1PDU}-1-nopad.per ; then \\" echo " for f in sample-${ASN1PDU}-[1-9]-nopad.per; do \\" echo ' for b in 1 17 33 980 8192; do \' echo ' echo "Recoding non-padded $$f into DER into XER and back ($$b)..."; \' echo ' ./${TARGET} -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \' echo ' ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \' echo ' ./${TARGET} -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \' echo ' diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \' echo ' rm -f ./.tmp.[123].$$$$; \' echo ' echo "Test junking $$f (please wait)..."; \' echo ' ./${TARGET} -J0.0001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 6; \' echo ' ./${TARGET} -J0.001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 7; \' echo ' done; done; fi' echo " @if test -f sample-${ASN1PDU}-1.per ; then \\" echo " for f in sample-*-[1-9].per; do \\" echo ' pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z-]+)-[0-9].*/\1/"`; \' echo ' for b in 1 17 33 980 8192; do \' echo ' echo "Recoding $$f into DER into XER and back ($$b)..."; \' echo ' ./${TARGET} -b $$b -p $$pdu -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \' echo ' ./${TARGET} -b $$b -p $$pdu -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \' echo ' ./${TARGET} -b $$b -p $$pdu -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \' echo ' diff $$f ./.tmp.1.$$$$ || exit 6; \' echo ' rm -f ./.tmp.[12].$$$$; \' echo ' echo "Test junking $$f (please wait)..."; \' echo ' ./${TARGET} -J0.0001 -n 1000 -b $$b -iper -onull $$f || exit 7; \' echo ' ./${TARGET} -J0.001 -n 1000 -b $$b -iper -onull $$f || exit 8; \' echo ' done; done; fi' echo echo "distclean: clean" echo ' rm -f $(ASN_MODULE_SOURCES)' echo ' rm -f $(ASN_MODULE_HEADERS)' echo ' rm -f $(ASN_CONVERTER_SOURCES) $(ASN_CONVERTER_HEADERS)' echo " rm -f Makefile.am.sample" ) >> Makefile.$$ set -x mv Makefile.$$ Makefile || exit $? rm Makefile.am.sample || exit $? set +x echo echo "Makefile generation finished" asn1c-0.9.24+dfsg/examples/sample.source.MEGACO/0000755000000000000000000000000012223077270017562 5ustar rootrootasn1c-0.9.24+dfsg/examples/sample.source.MEGACO/README0000644000000000000000000000060511456135550020446 0ustar rootroot GENERAL INFORMATION =================== The MEGACO (Media Gateway Control Protocol) PDU decoder. Invoking `make` will compile the ASN.1 specifications from the rfc3525.txt in the above directory. megaco-dump USAGE ================= ./megaco-dump MegacoMessage.ber # Print as XML (BASIC-XER) The full list of recognized command line options may be obtained with > ./megaco-dump -h asn1c-0.9.24+dfsg/examples/sample.source.MEGACO/config.h0000644000000000000000000000031011472004363021170 0ustar rootroot extern int opt_debug; #define ASN_DEBUG(fmt, args...) do { \ if(opt_debug < 2) break; \ fprintf(stderr, fmt, ##args); \ fprintf(stderr, " (%s:%d)\n", \ __FILE__, __LINE__); \ } while(0) asn1c-0.9.24+dfsg/examples/sample.source.MEGACO/Makefile0000644000000000000000000002444211723310017021221 0ustar rootrootASN_MODULE_SOURCES= \ MegacoMessage.c \ AuthenticationHeader.c \ SecurityParmIndex.c \ SequenceNum.c \ AuthData.c \ Message.c \ MId.c \ DomainName.c \ IP4Address.c \ IP6Address.c \ PathName.c \ Transaction.c \ TransactionId.c \ TransactionRequest.c \ TransactionPending.c \ TransactionReply.c \ TransactionResponseAck.c \ TransactionAck.c \ ErrorDescriptor.c \ ErrorCode.c \ ErrorText.c \ ContextID.c \ ActionRequest.c \ ActionReply.c \ ContextRequest.c \ ContextAttrAuditRequest.c \ CommandRequest.c \ Command.c \ CommandReply.c \ TopologyRequest.c \ AmmRequest.c \ AmmDescriptor.c \ AmmsReply.c \ SubtractRequest.c \ AuditRequest.c \ AuditReply.c \ AuditResult.c \ TerminationAudit.c \ AuditReturnParameter.c \ AuditDescriptor.c \ NotifyRequest.c \ NotifyReply.c \ ObservedEventsDescriptor.c \ ObservedEvent.c \ EventName.c \ EventParameter.c \ ServiceChangeRequest.c \ ServiceChangeReply.c \ ServiceChangeResult.c \ WildcardField.c \ TerminationID.c \ TerminationIDList.c \ MediaDescriptor.c \ StreamDescriptor.c \ StreamParms.c \ LocalControlDescriptor.c \ StreamMode.c \ PropertyParm.c \ Name.c \ PkgdName.c \ Relation.c \ LocalRemoteDescriptor.c \ PropertyGroup.c \ TerminationStateDescriptor.c \ EventBufferControl.c \ ServiceState.c \ MuxDescriptor.c \ MuxType.c \ StreamID.c \ EventsDescriptor.c \ RequestedEvent.c \ RequestedActions.c \ EventDM.c \ SecondEventsDescriptor.c \ SecondRequestedEvent.c \ SecondRequestedActions.c \ EventBufferDescriptor.c \ EventSpec.c \ SignalsDescriptor.c \ SignalRequest.c \ SeqSigList.c \ Signal.c \ SignalType.c \ SignalName.c \ NotifyCompletion.c \ SigParameter.c \ RequestID.c \ ModemDescriptor.c \ ModemType.c \ DigitMapDescriptor.c \ DigitMapName.c \ DigitMapValue.c \ ServiceChangeParm.c \ ServiceChangeAddress.c \ ServiceChangeResParm.c \ ServiceChangeMethod.c \ ServiceChangeProfile.c \ PackagesDescriptor.c \ PackagesItem.c \ StatisticsDescriptor.c \ StatisticsParameter.c \ NonStandardData.c \ NonStandardIdentifier.c \ H221NonStandard.c \ TimeNotation.c \ Value.c ASN_MODULE_HEADERS= \ MegacoMessage.h \ AuthenticationHeader.h \ SecurityParmIndex.h \ SequenceNum.h \ AuthData.h \ Message.h \ MId.h \ DomainName.h \ IP4Address.h \ IP6Address.h \ PathName.h \ Transaction.h \ TransactionId.h \ TransactionRequest.h \ TransactionPending.h \ TransactionReply.h \ TransactionResponseAck.h \ TransactionAck.h \ ErrorDescriptor.h \ ErrorCode.h \ ErrorText.h \ ContextID.h \ ActionRequest.h \ ActionReply.h \ ContextRequest.h \ ContextAttrAuditRequest.h \ CommandRequest.h \ Command.h \ CommandReply.h \ TopologyRequest.h \ AmmRequest.h \ AmmDescriptor.h \ AmmsReply.h \ SubtractRequest.h \ AuditRequest.h \ AuditReply.h \ AuditResult.h \ TerminationAudit.h \ AuditReturnParameter.h \ AuditDescriptor.h \ NotifyRequest.h \ NotifyReply.h \ ObservedEventsDescriptor.h \ ObservedEvent.h \ EventName.h \ EventParameter.h \ ServiceChangeRequest.h \ ServiceChangeReply.h \ ServiceChangeResult.h \ WildcardField.h \ TerminationID.h \ TerminationIDList.h \ MediaDescriptor.h \ StreamDescriptor.h \ StreamParms.h \ LocalControlDescriptor.h \ StreamMode.h \ PropertyParm.h \ Name.h \ PkgdName.h \ Relation.h \ LocalRemoteDescriptor.h \ PropertyGroup.h \ TerminationStateDescriptor.h \ EventBufferControl.h \ ServiceState.h \ MuxDescriptor.h \ MuxType.h \ StreamID.h \ EventsDescriptor.h \ RequestedEvent.h \ RequestedActions.h \ EventDM.h \ SecondEventsDescriptor.h \ SecondRequestedEvent.h \ SecondRequestedActions.h \ EventBufferDescriptor.h \ EventSpec.h \ SignalsDescriptor.h \ SignalRequest.h \ SeqSigList.h \ Signal.h \ SignalType.h \ SignalName.h \ NotifyCompletion.h \ SigParameter.h \ RequestID.h \ ModemDescriptor.h \ ModemType.h \ DigitMapDescriptor.h \ DigitMapName.h \ DigitMapValue.h \ ServiceChangeParm.h \ ServiceChangeAddress.h \ ServiceChangeResParm.h \ ServiceChangeMethod.h \ ServiceChangeProfile.h \ PackagesDescriptor.h \ PackagesItem.h \ StatisticsDescriptor.h \ StatisticsParameter.h \ NonStandardData.h \ NonStandardIdentifier.h \ H221NonStandard.h \ TimeNotation.h \ Value.h ASN_MODULE_HEADERS+=BOOLEAN.h ASN_MODULE_SOURCES+=BOOLEAN.c ASN_MODULE_HEADERS+=ENUMERATED.h ASN_MODULE_SOURCES+=ENUMERATED.c ASN_MODULE_HEADERS+=INTEGER.h ASN_MODULE_HEADERS+=NativeEnumerated.h ASN_MODULE_HEADERS+=IA5String.h ASN_MODULE_SOURCES+=IA5String.c ASN_MODULE_SOURCES+=INTEGER.c ASN_MODULE_HEADERS+=NULL.h ASN_MODULE_SOURCES+=NULL.c ASN_MODULE_SOURCES+=NativeEnumerated.c ASN_MODULE_HEADERS+=NativeInteger.h ASN_MODULE_SOURCES+=NativeInteger.c ASN_MODULE_HEADERS+=OBJECT_IDENTIFIER.h ASN_MODULE_SOURCES+=OBJECT_IDENTIFIER.c ASN_MODULE_HEADERS+=asn_SEQUENCE_OF.h ASN_MODULE_SOURCES+=asn_SEQUENCE_OF.c ASN_MODULE_HEADERS+=asn_SET_OF.h ASN_MODULE_SOURCES+=asn_SET_OF.c ASN_MODULE_HEADERS+=constr_CHOICE.h ASN_MODULE_SOURCES+=constr_CHOICE.c ASN_MODULE_HEADERS+=constr_SEQUENCE.h ASN_MODULE_SOURCES+=constr_SEQUENCE.c ASN_MODULE_HEADERS+=constr_SEQUENCE_OF.h ASN_MODULE_SOURCES+=constr_SEQUENCE_OF.c ASN_MODULE_HEADERS+=constr_SET_OF.h ASN_MODULE_SOURCES+=constr_SET_OF.c ASN_MODULE_HEADERS+=asn_application.h ASN_MODULE_HEADERS+=asn_system.h ASN_MODULE_HEADERS+=asn_codecs.h ASN_MODULE_HEADERS+=asn_internal.h ASN_MODULE_HEADERS+=OCTET_STRING.h ASN_MODULE_SOURCES+=OCTET_STRING.c ASN_MODULE_HEADERS+=BIT_STRING.h ASN_MODULE_SOURCES+=BIT_STRING.c ASN_MODULE_SOURCES+=asn_codecs_prim.c ASN_MODULE_HEADERS+=asn_codecs_prim.h ASN_MODULE_HEADERS+=ber_tlv_length.h ASN_MODULE_SOURCES+=ber_tlv_length.c ASN_MODULE_HEADERS+=ber_tlv_tag.h ASN_MODULE_SOURCES+=ber_tlv_tag.c ASN_MODULE_HEADERS+=ber_decoder.h ASN_MODULE_SOURCES+=ber_decoder.c ASN_MODULE_HEADERS+=der_encoder.h ASN_MODULE_SOURCES+=der_encoder.c ASN_MODULE_HEADERS+=constr_TYPE.h ASN_MODULE_SOURCES+=constr_TYPE.c ASN_MODULE_HEADERS+=constraints.h ASN_MODULE_SOURCES+=constraints.c ASN_MODULE_HEADERS+=xer_support.h ASN_MODULE_SOURCES+=xer_support.c ASN_MODULE_HEADERS+=xer_decoder.h ASN_MODULE_SOURCES+=xer_decoder.c ASN_MODULE_HEADERS+=xer_encoder.h ASN_MODULE_SOURCES+=xer_encoder.c ASN_MODULE_HEADERS+=per_support.h ASN_MODULE_SOURCES+=per_support.c ASN_MODULE_HEADERS+=per_decoder.h ASN_MODULE_SOURCES+=per_decoder.c ASN_MODULE_HEADERS+=per_encoder.h ASN_MODULE_SOURCES+=per_encoder.c ASN_MODULE_HEADERS+=per_opentype.h ASN_MODULE_SOURCES+=per_opentype.c ASN_CONVERTER_SOURCES+=converter-sample.c lib_LTLIBRARIES=libsomething.la libsomething_la_SOURCES=$(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS) # This file may be used as an input for make(3) # Remove the lines below to convert it into a pure .am file TARGET = megaco-dump CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -DPDU=MegacoMessage -I. OBJS=${ASN_MODULE_SOURCES:.c=.o} ${ASN_CONVERTER_SOURCES:.c=.o} all: MegacoMessage.c $(TARGET) $(TARGET): ${OBJS} $(CC) $(CFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS) .SUFFIXES: .SUFFIXES: .c .o .c.o: $(CC) $(CFLAGS) -o $@ -c $< clean: rm -f $(TARGET) rm -f $(OBJS) regen: regenerate-from-asn1-source regenerate-from-asn1-source: ../../asn1c/asn1c -S ../../skeletons -pdu=MegacoMessage -fcompound-names ../rfc3525-MEDIA-GATEWAY-CONTROL.asn1 MegacoMessage.c: ../sample.makefile.regen ../rfc3525-MEDIA-GATEWAY-CONTROL.asn1 make regen-makefile @touch MegacoMessage.c make regen-makefile: ASN1CMDOPTS="-fcompound-names" \ ASN1MODULES="../rfc3525-MEDIA-GATEWAY-CONTROL.asn1" \ ASN1PDU=MegacoMessage \ PROGNAME=megaco-dump \ ../sample.makefile.regen check: ${TARGET} check-ber check-xer check-per @echo ================ @echo All tests passed @echo ================ check-ber: @if test -f sample-MegacoMessage-1.[db]er ; then \ for f in sample-MegacoMessage-*.[db]er; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into XER and back ($$b)..."; \ ./${TARGET} -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iber -onull $$f || exit 5; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iber -onull $$f || exit 6; \ done; done; fi check-xer: @if test -f sample-MegacoMessage-1.xer ; then \ for f in sample-MegacoMessage-*.xer; do \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER and back ($$b)..."; \ ./${TARGET} -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ diff $$f ./.tmp.2.$$$$ || exit 4; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -ixer -onull $$f || exit 5; \ ./${TARGET} -J0.001 -n 1000 -b $$b -ixer -onull $$f || exit 6; \ done; done; fi check-per: @if test -f sample-MegacoMessage-1-nopad.per ; then \ for f in sample-MegacoMessage-[1-9]-nopad.per; do \ for b in 1 17 33 980 8192; do \ echo "Recoding non-padded $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ ./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ ./${TARGET} -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \ diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \ rm -f ./.tmp.[123].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 6; \ ./${TARGET} -J0.001 -n 1000 -b $$b -per-nopad -iper -onull $$f || exit 7; \ done; done; fi @if test -f sample-MegacoMessage-1.per ; then \ for f in sample-*-[1-9].per; do \ pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z-]+)-[0-9].*/\1/"`; \ for b in 1 17 33 980 8192; do \ echo "Recoding $$f into DER into XER and back ($$b)..."; \ ./${TARGET} -b $$b -p $$pdu -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \ ./${TARGET} -b $$b -p $$pdu -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \ ./${TARGET} -b $$b -p $$pdu -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \ diff $$f ./.tmp.1.$$$$ || exit 6; \ rm -f ./.tmp.[12].$$$$; \ echo "Test junking $$f (please wait)..."; \ ./${TARGET} -J0.0001 -n 1000 -b $$b -iper -onull $$f || exit 7; \ ./${TARGET} -J0.001 -n 1000 -b $$b -iper -onull $$f || exit 8; \ done; done; fi distclean: clean rm -f $(ASN_MODULE_SOURCES) rm -f $(ASN_MODULE_HEADERS) rm -f $(ASN_CONVERTER_SOURCES) $(ASN_CONVERTER_HEADERS) rm -f Makefile.am.sample asn1c-0.9.24+dfsg/examples/Makefile.in0000644000000000000000000003244212121076150016113 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = examples DIST_COMMON = README $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(bindir)" SCRIPTS = $(dist_bin_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ dist_bin_SCRIPTS = crfc2asn1.pl clyx2asn1.pl ASN1_SOURCE_1 = rfc3280.txt ASN1_FILES_1 = \ rfc3280-PKIX1Explicit88.asn1 \ rfc3280-PKIX1Implicit88.asn1 ASN1_SOURCE_2 = rfc3525.txt ASN1_FILES_2 = \ rfc3525-MEDIA-GATEWAY-CONTROL.asn1 ASN1_SOURCE_3 = rfc4511.txt ASN1_FILES_3 = \ rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1 EXTRA_DIST = $(srcdir)/rfc*.txt \ $(srcdir)/sample.source.LDAP3 \ $(srcdir)/sample.source.MEGACO \ $(srcdir)/sample.source.MHEG5 \ $(srcdir)/sample.source.RRC \ $(srcdir)/sample.source.TAP3 \ $(srcdir)/sample.source.PKIX1 \ $(srcdir)/sample.makefile.regen CLEANFILES = $(ASN1_FILES_1) $(ASN1_FILES_2) $(ASN1_FILES_3) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-dist_binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-dist_binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_binSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local dist-hook distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_binSCRIPTS install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-dist_binSCRIPTS all: $(ASN1_FILES_1) $(ASN1_FILES_2) $(ASN1_FILES_3) $(ASN1_FILES_1): crfc2asn1.pl $(ASN1_SOURCE_1) ./crfc2asn1.pl $(ASN1_SOURCE_1) $(ASN1_FILES_2): crfc2asn1.pl $(ASN1_SOURCE_2) ./crfc2asn1.pl $(ASN1_SOURCE_2) $(ASN1_FILES_3): crfc2asn1.pl $(ASN1_SOURCE_3) ./crfc2asn1.pl $(ASN1_SOURCE_3) dist-hook: rm -f `find $(distdir) -name "*.core" -or -name ".tmp.*"` rm -f `find $(distdir) -name "*.[ch].??????"` clean-local: for dir in sample.source.*; do (cd $$dir && make distclean); done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/examples/clyx2asn1.pl0000755000000000000000000000171611461150505016235 0ustar rootroot#!/usr/bin/env perl # # $Id$ # $Author$ # # Simple tool to extract known ASN.1 modules from the stream of LyX data. # if($#ARGV == -1) { print STDERR "Extract known modules from LyX data\n"; print STDERR "Usage: cat *.lyx | $0 ...\n"; exit 64; } # Convert arguments into a hash for quicker search. for(my $i; $i <= $#ARGV; $i++) { $modules{$ARGV[$i]} = $ARGV[$i].".asn1"; } # Process incoming stream in search for ASN.1 modules. while() { chop; if($inmodule) { next if(/^$/); if(/^\\layout /) { print O "\n"; next; } if(/^\\begin_inset Quotes/) { print O '"'; next; } next if(/^\\/); print O; if(/^END$/) { $inmodule = 0; print O "\n"; } } else { /^([A-Za-z0-9-]+)(\s*{.*)?$/; next unless $modules{$1}; open(O, '> '.$modules{$1}); print O; $inmodule = 1; delete $modules{$1}; } } # Make sure noone's missing. die "Modules not found: " . join(", ", keys %modules) . "\n" if keys %modules; asn1c-0.9.24+dfsg/examples/Makefile.am0000644000000000000000000000224611461231136016104 0ustar rootroot dist_bin_SCRIPTS = crfc2asn1.pl clyx2asn1.pl ASN1_SOURCE_1 = rfc3280.txt ASN1_FILES_1 = \ rfc3280-PKIX1Explicit88.asn1 \ rfc3280-PKIX1Implicit88.asn1 ASN1_SOURCE_2 = rfc3525.txt ASN1_FILES_2 = \ rfc3525-MEDIA-GATEWAY-CONTROL.asn1 ASN1_SOURCE_3 = rfc4511.txt ASN1_FILES_3 = \ rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1 all: $(ASN1_FILES_1) $(ASN1_FILES_2) $(ASN1_FILES_3) $(ASN1_FILES_1): crfc2asn1.pl $(ASN1_SOURCE_1) ./crfc2asn1.pl $(ASN1_SOURCE_1) $(ASN1_FILES_2): crfc2asn1.pl $(ASN1_SOURCE_2) ./crfc2asn1.pl $(ASN1_SOURCE_2) $(ASN1_FILES_3): crfc2asn1.pl $(ASN1_SOURCE_3) ./crfc2asn1.pl $(ASN1_SOURCE_3) EXTRA_DIST = $(srcdir)/rfc*.txt \ $(srcdir)/sample.source.LDAP3 \ $(srcdir)/sample.source.MEGACO \ $(srcdir)/sample.source.MHEG5 \ $(srcdir)/sample.source.RRC \ $(srcdir)/sample.source.TAP3 \ $(srcdir)/sample.source.PKIX1 \ $(srcdir)/sample.makefile.regen dist-hook: rm -f `find $(distdir) -name "*.core" -or -name ".tmp.*"` rm -f `find $(distdir) -name "*.[ch].??????"` CLEANFILES = $(ASN1_FILES_1) $(ASN1_FILES_2) $(ASN1_FILES_3) clean-local: for dir in sample.source.*; do (cd $$dir && make distclean); done asn1c-0.9.24+dfsg/config.guess0000755000000000000000000012626012015121740014550 0ustar rootroot#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: asn1c-0.9.24+dfsg/mkinstalldirs0000755000000000000000000000664712015121740015044 0ustar rootroot#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2006-05-11.19 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: asn1c-0.9.24+dfsg/asn1c.spec.in0000644000000000000000000000233011456135547014527 0ustar rootroot# # $Id$ # Name: @PACKAGE@ Version: @VERSION@ Release: 2 Copyright: Lev Walkin Source: %{name}-%{version}.tar.gz Url: http://asn1c.sourceforge.net/ BuildRoot: /var/tmp/%{name}-root Group: Development/Languages Summary: The ASN.1 to C compiler %description The asn1c compiler turns ASN.1 specifications into C language source files containing the BER/CER/DER/PER/XER encoders and decoders for the given abstract notation. %prep %setup -q %build ./configure %{_make} DESTDIR=$RPM_BUILD_ROOT %install rm -rf $RPM_BUILD_ROOT %{__make} install-exec DESTDIR=$RPM_BUILD_ROOT (cd skeletons && %{__make} install-data DESTDIR=$RPM_BUILD_ROOT) (cd asn1c && %{__make} install-man DESTDIR=$RPM_BUILD_ROOT) %clean rm -rf $RPM_BUILD_ROOT %files %doc README FAQ COPYING ChangeLog BUGS TODO %doc doc/asn1c-usage.pdf doc/asn1c-usage.html %attr(755,root,root) %{_bindir} %attr(644,root,root) %{_datadir}/asn1c %{_mandir}/man1 %changelog * Sun Sep 18 2006 Lev Walkin - Added PER support into description * Sun Sep 26 2004 Lev Walkin - All manuals are now getting installed, including new ones: unber.1 and enber.1 * Tue Sep 18 2004 Lev Walkin - First version of asn1c.spec asn1c-0.9.24+dfsg/ltconfig0000755000000000000000000027541011456135550014001 0ustar rootroot#! /bin/sh # ltconfig - Create a system-specific libtool. # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A lot of this script is taken from autoconf-2.10. # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} echo=echo if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec "$SHELL" "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`} case X$UNAME in *-DOS) PATH_SEPARATOR=';' ;; *) PATH_SEPARATOR=':' ;; esac fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then break fi done fi if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf "%s\n"' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # Cool, printf works : elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # The name of this program. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool VERSION=1.3.4-freebsd-ports TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)" ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." # Global variables: default_ofile=libtool can_build_shared=yes enable_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). enable_static=yes enable_fast_install=yes install_ltlibs=yes release_suffix=yes enable_dlopen=unknown enable_win32_dll=no ltmain= silent= srcdir= ac_config_guess= ac_config_sub= host= nonopt= ofile="$default_ofile" verify_host=yes with_gcc=no with_gnu_ld=no need_locks=yes ac_ext=c objext=o libext=a exeext= cache_file= old_AR="$AR" old_CC="$CC" old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" old_LDFLAGS="$LDFLAGS" old_LD="$LD" old_LN_S="$LN_S" old_LIBS="$LIBS" old_NM="$NM" old_RANLIB="$RANLIB" old_DLLTOOL="$DLLTOOL" old_OBJDUMP="$OBJDUMP" old_AS="$AS" # Parse the command line options. args= prev= for option do case "$option" in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then eval "$prev=\$option" prev= continue fi case "$option" in --help) cat <&2 echo "$help" 1>&2 exit 1 ;; *) if test -z "$ltmain"; then ltmain="$option" elif test -z "$host"; then # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then # echo "$progname: warning \`$option' is not a valid host type" 1>&2 # fi host="$option" else echo "$progname: too many arguments" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac done if test -z "$ltmain"; then echo "$progname: you must specify a LTMAIN file" 1>&2 echo "$help" 1>&2 exit 1 fi if test ! -f "$ltmain"; then echo "$progname: \`$ltmain' does not exist" 1>&2 echo "$help" 1>&2 exit 1 fi # Quote any args containing shell metacharacters. ltconfig_args= for arg do case "$arg" in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ltconfig_args="$ltconfig_args '$arg'" ;; *) ltconfig_args="$ltconfig_args $arg" ;; esac done # A relevant subset of AC_INIT. # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 5 compiler messages saved in config.log # 6 checking for... messages and results if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>>./config.log # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi if test -n "$cache_file" && test -r "$cache_file"; then echo "loading cache $cache_file within ltconfig" . $cache_file fi if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi if test -z "$srcdir"; then # Assume the source directory is the same one as the path to LTMAIN. srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` test "$srcdir" = "$ltmain" && srcdir=. fi trap "$rm conftest*; exit 1" 1 2 15 if test "$verify_host" = yes; then # Check for config.guess and config.sub. ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/config.guess; then ac_aux_dir=$ac_dir break fi done if test -z "$ac_aux_dir"; then echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 echo "$help" 1>&2 exit 1 fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub # Make sure we can run config.sub. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : else echo "$progname: cannot run $ac_config_sub" 1>&2 echo "$help" 1>&2 exit 1 fi echo $ac_n "checking host system type""... $ac_c" 1>&6 host_alias=$host case "$host_alias" in "") if host_alias=`$SHELL $ac_config_guess`; then : else echo "$progname: cannot guess host type; you must specify one" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac host=`$SHELL $ac_config_sub $host_alias` echo "$ac_t$host" 1>&6 # Make sure the host verified. test -z "$host" && exit 1 elif test -z "$host"; then echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 echo "$help" 1>&2 exit 1 else host_alias=$host fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case "$host_os" in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR cru $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= # Set a sane default for `AR'. test -z "$AR" && AR=ar # Set a sane default for `OBJDUMP'. test -z "$OBJDUMP" && OBJDUMP=objdump # If RANLIB is not set, then run the test. if test "${RANLIB+set}" != "set"; then result=no echo $ac_n "checking for ranlib... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then RANLIB="ranlib" result="ranlib" break fi done IFS="$save_ifs" echo "$ac_t$result" 1>&6 fi if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$AS" && AS=as # Check to see if we are using GCC. if test "$with_gcc" != yes || test -z "$CC"; then # If CC is not set, then try to find GCC or a usable CC. if test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then CC="gcc" break fi done IFS="$save_ifs" if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi fi # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". if test -z "$CC"; then echo $ac_n "checking for cc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" cc_rejected=no for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/cc || test -f $dir/cc$ac_exeext; then if test "$dir/cc" = "/usr/ucb/cc"; then cc_rejected=yes continue fi CC="cc" break fi done IFS="$save_ifs" if test $cc_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same name, so the bogon will be chosen # first if we set CC to just the name; use the full file name. shift set dummy "$dir/cc" "$@" shift CC="$@" fi fi if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$CC"; then echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 exit 1 fi fi # Now see if the compiler is really GCC. with_gcc=no echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 echo "$progname:581: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c echo "$ac_t$with_gcc" 1>&6 fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo $ac_n "checking for object suffix... $ac_c" 1>&6 $rm conftest* echo 'int i = 1;' > conftest.c echo "$progname:603: checking for object suffix" >& 5 if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c) ;; *) objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* echo "$ac_t$objext" 1>&6 echo $ac_n "checking for executable suffix... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_exeext="no" $rm conftest* echo 'main () { return 0; }' > conftest.c echo "$progname:629: checking for executable suffix" >& 5 if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c | *.err | *.$objext ) ;; *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* fi if test "X$ac_cv_exeext" = Xno; then exeext="" else exeext="$ac_cv_exeext" fi echo "$ac_t$ac_cv_exeext" 1>&6 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 pic_flag= special_shlib_compile_flags= wl= link_static_flag= no_builtin_flag= if test "$with_gcc" = yes; then wl='-Wl,' link_static_flag='-static' case "$host_os" in beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. link_static_flag="$link_static_flag ${wl}-lC" ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. pic_flag='-m68020 -resident32 -malways-restore-a4' ;; sysv4*MP*) if test -d /usr/nec; then pic_flag=-Kconform_pic fi ;; *) pic_flag='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in aix3* | aix4*) # All AIX code is PIC. link_static_flag='-bnso -bI:/lib/syscalls.exp' ;; hpux9* | hpux10* | hpux11*) # Is there a better link_static_flag that works with the bundled CC? wl='-Wl,' link_static_flag="${wl}-a ${wl}archive" pic_flag='+Z' ;; irix5* | irix6*) wl='-Wl,' link_static_flag='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' ;; sco3.2v5*) pic_flag='-Kpic' link_static_flag='-dn' special_shlib_compile_flags='-belf' ;; solaris*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; sunos4*) pic_flag='-PIC' link_static_flag='-Bstatic' wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; uts4*) pic_flag='-pic' link_static_flag='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then pic_flag='-Kconform_pic' link_static_flag='-Bstatic' fi ;; *) can_build_shared=no ;; esac fi if test -n "$pic_flag"; then echo "$ac_t$pic_flag" 1>&6 # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 case "$host_os" in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then they # create non-PIC objects. So, if there were any warnings, we assume that # PIC is not supported. if test -s conftest.err; then echo "$ac_t"no 1>&6 can_build_shared=no pic_flag= else echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" fi ;; *) echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" ;; esac else # Append any errors to the config.log. cat conftest.err 1>&5 can_build_shared=no pic_flag= echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else echo "$ac_t"none 1>&6 fi # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 $rm -r conftest 2>/dev/null mkdir conftest cd conftest $rm conftest* echo "int some_variable = 0;" > conftest.c mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.o" echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then echo "$ac_t"no 1>&6 compiler_c_o=no else echo "$ac_t"yes 1>&6 compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 compiler_c_o=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_o_lo=no else echo "$ac_t"yes 1>&6 compiler_o_lo=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_o_lo=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$ac_t$hard_links" 1>&6 $rm conftest* if test "$hard_links" = no; then echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 need_locks=warn fi else need_locks=no fi if test "$with_gcc" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_rtti_exceptions=no else echo "$ac_t"yes 1>&6 compiler_rtti_exceptions=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_rtti_exceptions=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # Check for any special shared library compilation flags. if test -n "$special_shlib_compile_flags"; then echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : else echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 can_build_shared=no fi fi echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then echo "$ac_t$link_static_flag" 1>&6 else echo "$ac_t"none 1>&6 link_static_flag= fi LDFLAGS="$save_LDFLAGS" $rm conftest* if test -z "$LN_S"; then # Check to see if we can use ln -s, or we need hard links. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 $rm conftest.dat if ln -s X conftest.dat 2>/dev/null; then $rm conftest.dat LN_S="ln -sf" else LN_S=ln fi if test "$LN_S" = "ln -sf"; then echo "$ac_t"yes 1>&6 else echo "$ac_t"no 1>&6 fi fi # Make sure LD is an absolute path. if test -z "$LD"; then ac_prog=ld if test "$with_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 echo "$progname:991: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we are not using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld... $ac_c" 1>&6 echo "$progname:1015: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "$progname:1018: checking for non-GNU ld" >&5 fi if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" fi if test -n "$LD"; then echo "$ac_t$LD" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$LD"; then echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 exit 1 fi fi # Check to see if it really is or is not GNU ld. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then with_gnu_ld=yes else with_gnu_ld=no fi echo "$ac_t$with_gnu_ld" 1>&6 # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. case "$host_os" in cygwin* | mingw*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$with_gcc" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case "$host_os" in aix3* | aix4*) # On AIX, the GNU linker is very broken ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; for symbol in `cat $export_symbols`; do echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; _lt_hint=`expr 1 + \$_lt_hint`; done~ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' # can we support soname and/or expsyms with a.out? -oliva fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $compile_rpath $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $compile_rpath $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case "$host_os" in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$with_gcc" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4*) hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' hardcode_libdir_separator=':' if test "$with_gcc" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi allow_undefined_flag=' ${wl}-berok' archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' case "$host_os" in aix4.[01]|aix4.[01].*) # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on always_export_symbols=yes ;; esac ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs' fix_srcfile_path='`cygpath -w $srcfile`' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case "$host_os" in hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$with_gcc" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF fi hardcode_libdir_flag_spec='${wl}-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; osf3*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # As osf3* with the addition of the -msym flag if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case "$host_os" in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; unixware7*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$ac_t$ld_shlibs" 1>&6 test "$ld_shlibs" = no && can_build_shared=no if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 case "$NM" in [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -B" break elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -p" break else NM=${NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$NM" && NM=nm ;; esac echo "$ac_t$NM" 1>&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case "$host_os" in aix*) symcode='[BCDT]' ;; cygwin* | mingw*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no $rm conftest* cat > conftest.c <&5 if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.c #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' cat <> conftest.c #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c cat <<\EOF >> conftest.c {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$objext conftstm.$objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi LIBS="$save_LIBS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else global_symbol_pipe= fi done if test "$pipe_works" = yes; then echo "${ac_t}ok" 1>&6 else echo "${ac_t}failed" 1>&6 fi if test -z "$global_symbol_pipe"; then global_symbol_to_cdecl= fi # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$ac_t$hardcode_action" 1>&6 reload_flag= reload_cmds='$LD$reload_flag -o $output$reload_objs' echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 # PORTME Some linkers may need a different reload flag. reload_flag='-r' echo "$ac_t$reload_flag" 1>&6 test -n "$reload_flag" && reload_flag=" $reload_flag" # PORTME Fill in your ld.so characteristics library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib" file_magic_cmd= file_magic_test_file= deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [regex]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 case "$host_os" in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4*) version_type=linux # AIX has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. # We preserve .a as extension for shared libraries though AIX4.2 # and later linker supports .so library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' shlibpath_var=LIBPATH deplibs_check_method=pass_all ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH deplibs_check_method=pass_all lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw*) version_type=windows need_version=no need_lib_prefix=no if test "$with_gcc" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' file_magic_cmd='${OBJDUMP} -f' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case "$version_type" in freebsd-elf*) deplibs_check_method='file_magic (ELF [0-9][0-9]*-bit [LM]SB shared object|current ar archive)' ;; freebsd-*) deplibs_check_method='file_magic FreeBSD.* shared library' ;; esac file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so.*` if test "$release_suffix" = all; then library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}.so' fi need_version=no need_lib_prefix=no finish_cmds='/usr/bin/env OBJFORMAT="'"$objformat"'" /sbin/ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH case "$host_os" in freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so.$major' library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' case "$host_os" in irix5*) libsuff= shlibsuff= # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case "$LD" in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib${libsuff}/libc.so*` deplibs_check_method='pass_all' ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' else # Only the GNU ld.so supports shared libraries on MkLinux. case "$host_cpu" in powerpc*) dynamic_linker=no ;; *) dynamic_linker='Linux ld.so' ;; esac fi ;; netbsd*) version_type=sunos if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so deplibs_check_method='pass_all' sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" file_magic_cmd=/usr/bin/file file_magic_test_file=/lib/libc.so ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in ncr) deplibs_check_method='pass_all' ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$ac_t$dynamic_linker" 1>&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in # configure.in, otherwise build static only libraries. case "$host_os" in cygwin* | mingw* | os2*) if test x$can_build_shared = xyes; then test x$enable_win32_dll = xno && can_build_shared=no echo "checking if package supports dlls... $can_build_shared" 1>&6 fi ;; esac if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then case "$deplibs_check_method" in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$ac_t$enable_shared" 1>&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "checking whether to build static libraries... $enable_static" 1>&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi echo $ac_n "checking for objdir... $ac_c" 1>&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$ac_t$objdir" 1>&6 if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo "$progname:2212: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 echo "$progname:2252: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else dlopen(); #endif ; return 0; } EOF if { (eval echo $progname:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_dlopen=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 echo "$progname:2299: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 echo "$progname:2339: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else shl_load(); #endif ; return 0; } EOF if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_shl_load=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo "$progname:2387: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 fi fi fi fi fi fi if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes fi case "$lt_cv_dlopen" in dlopen) for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "$progname:2452: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF ac_try="$ac_compile >/dev/null 2>conftest.out" { (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi done if test "x$ac_cv_header_dlfcn_h" = xyes; then CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" fi eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2490: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self_static=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self_static=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 fi ;; esac case "$lt_cv_dlopen_self" in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case "$lt_cv_dlopen_self_static" in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Copy echo and quote the copy, instead of the original, because it is # used later. ltecho="$echo" if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then ltecho="$CONFIG_SHELL \$0 --fallback-echo" fi LTSHELL="$SHELL" LTCONFIG_VERSION="$VERSION" # Only quote variables if we're using ltmain.sh. case "$ltmain" in *.sh) # Now quote all the things that may contain metacharacters. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case "$ltecho" in *'\$0 --fallback-echo"') ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac trap "$rm \"$ofile\"; exit 1" 1 2 15 echo "creating $ofile" $rm "$ofile" cat < "$ofile" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF cfgfile="$ofile" ;; *) # Double-quote the variables that need it (for aesthetics). for var in old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do eval "$var=\\\"\$var\\\"" done # Just create a config file. cfgfile="$ofile.cfg" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 echo "creating $cfgfile" $rm "$cfgfile" cat < "$cfgfile" # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) EOF ;; esac cat <> "$cfgfile" # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ # LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ # NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ # DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for # debugging $progname, is in ./config.log if it exists. # The version of $progname that generated this script. LTCONFIG_VERSION=$LTCONFIG_VERSION # Shell to use when invoking shell scripts. SHELL=$LTSHELL # Whether to waste disk space. install_ltlibs=$install_ltlibs # What to do with -release. # yes - only for shared archive # no - ingnore # all - for all archives release_suffix=$release_suffix # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$ltecho # The archiver. AR=$AR # The default C compiler. CC=$CC # The linker used to build libraries. LD=$LD # Whether we need hard or soft links. LN_S=$LN_S # A BSD-compatible nm program. NM=$NM # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$reload_flag reload_cmds=$reload_cmds # How to pass a linker flag through the compiler. wl=$wl # Object file suffix (normally "o"). objext="$objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$pic_flag # Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$compiler_o_lo # Must we lock files when doing compilation ? need_locks=$need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$library_names_spec # The coded name of the library, if different from the real name. soname_spec=$soname_spec # Commands used to build and install an old-style archive. RANLIB=$RANLIB old_archive_cmds=$old_archive_cmds old_postinstall_cmds=$old_postinstall_cmds old_postuninstall_cmds=$old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$old_archive_from_new_cmds # Commands used to build and install a shared archive. archive_cmds=$archive_cmds archive_expsym_cmds=$archive_expsym_cmds postinstall_cmds=$postinstall_cmds postuninstall_cmds=$postuninstall_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Compile-time system search path for libraries sys_lib_search_path_spec=$sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$exclude_expsyms # Symbols that must always be exported. include_expsyms=$include_expsyms EOF case "$ltmain" in *.sh) echo '### END LIBTOOL CONFIG' >> "$ofile" echo >> "$ofile" case "$host_os" in aix3*) cat <<\EOF >> "$ofile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # Append the ltmain.sh script. sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? chmod +x "$ofile" ;; *) # Compile the libtool program. echo "FIXME: would compile $ltmain" ;; esac test -n "$cache_file" || exit 0 # AC_CACHE_SAVE trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: asn1c-0.9.24+dfsg/BUGS0000644000000000000000000000273511461150505012720 0ustar rootroot 0. ASN.1 grammar parser is written mostly with respect to constructing a tree, so a tree destruction is not fully supported and certain memory leaks are known. Not a huge problem for run-once programs like a compiler. NOTE: This statement does not apply to the target code _produced_ by the compiler. 1. For purposes of compilation, INTEGER type is modelled using a large static type (asn_integer_t), but defined as any positive or negative value by ASN.1. Not a problem as most specifications use very small values anyway. NOTE: This statement does not apply to the target code _produced_ by the compiler. 2. A MACRO facility is part of obsolete ASN.1 standard, and is not supported. 3. Multiple tags applied at the same level are not supported: BadTags ::= [0] EXPLICIT [2] IMPLICIT OtherType The same thing could be achieved by using the indirection: GoodTags ::= [0] EXPLICIT OtherTypePtr OtherTypePtr ::= [2] IMPLICIT OtherType 4. Mixed definite/indefinite length in a _single_ BER tags sequence is not supported. Should not be a problem in the real world. Please note that it is still possible, for example, to encode a wrapper structure using definite length, and encode its substructure member using indefinite length. The BER decoder is perfectly capable of decoding such sequences. 5. Encoding or decoding of structures with combined length greater than 16MB is not tested. 6. XER codec does not support integer (INTEGER, ENUMERATED) values outside the signed long range. asn1c-0.9.24+dfsg/MANIFEST0000644000000000000000000000013112015121740013345 0ustar rootrootlibasn1compiler libasn1parser libasn1print libasn1fix skeletons examples tests asn1c doc asn1c-0.9.24+dfsg/FAQ0000644000000000000000000000232311456135547012575 0ustar rootroot 1.Q: Is it possible to build the asn1c compiler on Win32? 1.A: At this point, the asn1c source code is tied to GCC-specific extensions in several key places. The CYGWIN environment with gcc compiler may be what are you looking for. Please also consider using the Online ASN.1 compiler at http://lionet.info/asn1c which generates platform-independent code. 2.Q: How to build a simplest BER (XER) encoder or decoder? 2.A: Please check the "Quick Start Guide" on ./doc/asn1c-quick.pdf Please check the "Examples" section of ./doc/asn1c-usage.pdf Also, try the following to build the X.509v3 parser: cd ./examples/sample.source.PKIX1 make ./x509dump -h 3.Q: Your compiler supplies a der_encode() procedure. How do I encode BER? 3.A: The DER (and CER) are stricter subsets of a more generic BER encoding method. If you encode data with DER or CER, all BER-conformant decoders will easily understand that. Hence, to encode data in the BER format, simply use the DER encoder, der_encode(). See also: ISO/IEC 8825-1 / X.690: "ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)" -- Lev Walkin vlm@lionet.info asn1c-0.9.24+dfsg/AUTHORS0000644000000000000000000000003511505405150013272 0ustar rootrootLev Walkin asn1c-0.9.24+dfsg/TODO0000644000000000000000000000050211461150505012713 0ustar rootroot1. MAJOR: 1.1 Support for Information Object Classes. Status: Support for parsing IOCs is mostly present. Support for slicing the IOCs to produce "views" is not yet designed. 2. MEDIUM: 2.1 Support for EXTERNAL, EMBEDDED-PDV and CHARACTER STRING types. Requires something from 1.2 (Information Object Classes). asn1c-0.9.24+dfsg/tests/0000755000000000000000000000000012223077270013374 5ustar rootrootasn1c-0.9.24+dfsg/tests/37-indirect-choice-OK.asn1.-EF0000644000000000000000000000114011461146446020316 0ustar rootrootModuleTestIndirectChoiceFine { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 37 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= CHOICE { t-a INTEGER, t-b OCTET STRING, t-c [1] EXPLICIT Choice1, t-d [3] IMPLICIT Choice2 } Choice1 ::= CHOICE { c-a OCTET STRING, c-b INTEGER } Choice2 ::= [2] EXPLICIT CHOICE { c-a OCTET STRING, c-b INTEGER, c-d [3] EXPLICIT Choice1, c-e [4] EXPLICIT Choice1 } Choice3 ::= [3] EXPLICIT Choice2 Choice4 ::= [4] IMPLICIT Choice2 Choice5 ::= Choice2 Choice6 ::= Choice1 END asn1c-0.9.24+dfsg/tests/04-enum-SE.asn10000644000000000000000000000060211461147103015644 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .4 ModuleTestEnum2 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 4 } DEFINITIONS ::= BEGIN enum1 Enum1 ::= blue Enum1 ::= ENUMERATED { red, green, ..., blue(1) -- collides with green -- } END asn1c-0.9.24+dfsg/tests/07-int-OK.asn10000644000000000000000000000077211461147103015507 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .7 ModuleTestInt1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 7 } DEFINITIONS ::= BEGIN int123456 INTEGER ::= 123456 Interval ::= INTEGER (1..int123456) SameInterval INTEGER ::= { 1 | 2 | 3 | 4 | 5 | 6 } Reason ::= INTEGER { no-reason(0), negative-reason(-10), some-large-value(1324324) } END asn1c-0.9.24+dfsg/tests/03-enum-OK.asn1.-EF0000644000000000000000000000107512015121740016213 0ustar rootrootModuleTestEnum1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 3 } DEFINITIONS ::= BEGIN Enum1 ::= ENUMERATED { red(0), green(1), blue(4), alpha(5), ... } Enum2 ::= ENUMERATED { red(0), green(1), blue(45), orange(23), alpha(46), ..., beta(12), gamma(103) } Enum3 ::= ENUMERATED { a(0), b(3), ..., c(1) } Enum4 ::= ENUMERATED { a(0), b(1), ..., c(3), d(4) } Enum5 ::= ENUMERATED { a(0), z(25), ..., d(26) } END asn1c-0.9.24+dfsg/tests/32-sequence-of-OK.asn10000644000000000000000000000124511461150505017121 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .32 ModuleTestSequenceSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 32 } DEFINITIONS IMPLICIT TAGS ::= BEGIN Programming ::= SEQUENCE SIZE(1..maxSize) OF [0] IMPLICIT Fault Fault ::= SET OF Error Error ::= SEQUENCE { ... } maxSize INTEGER ::= 10 SeqWithMandatory ::= SEQUENCE { someString UTF8String, seqOfMan [0] EXPLICIT SEQUENCE OF Error } SeqWithOptional ::= SEQUENCE { someString UTF8String, seqOfOpt [0] EXPLICIT SEQUENCE OF Error OPTIONAL } END asn1c-0.9.24+dfsg/tests/104-param-1-OK.asn1.-P0000644000000000000000000001337311461146446016516 0ustar rootroot /*** <<< INCLUDES [Collection] >>> ***/ #include #include #include #include /*** <<< TYPE-DECLS [Collection] >>> ***/ typedef struct Collection_16P0 { A_SET_OF(REAL_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Collection_16P0_t; typedef struct Collection_16P1 { A_SET_OF(IA5String_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Collection_16P1_t; /*** <<< FUNC-DECLS [Collection] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Collection_16P0; extern asn_TYPE_descriptor_t asn_DEF_Collection_16P1; /*** <<< STAT-DEFS [Collection] >>> ***/ static asn_TYPE_member_t asn_MBR_Collection_16P0_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), .tag_mode = 0, .type = &asn_DEF_REAL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_Collection_16P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_Collection_16P0_specs_1 = { sizeof(struct Collection_16P0), offsetof(struct Collection_16P0, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_Collection_16P0 = { "Collection", "Collection", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Collection_16P0_tags_1, sizeof(asn_DEF_Collection_16P0_tags_1) /sizeof(asn_DEF_Collection_16P0_tags_1[0]), /* 1 */ asn_DEF_Collection_16P0_tags_1, /* Same as above */ sizeof(asn_DEF_Collection_16P0_tags_1) /sizeof(asn_DEF_Collection_16P0_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Collection_16P0_1, 1, /* Single element */ &asn_SPC_Collection_16P0_specs_1 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Collection_16P1_3[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), .tag_mode = 0, .type = &asn_DEF_IA5String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_Collection_16P1_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_Collection_16P1_specs_3 = { sizeof(struct Collection_16P1), offsetof(struct Collection_16P1, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_Collection_16P1 = { "Collection", "Collection", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Collection_16P1_tags_3, sizeof(asn_DEF_Collection_16P1_tags_3) /sizeof(asn_DEF_Collection_16P1_tags_3[0]), /* 1 */ asn_DEF_Collection_16P1_tags_3, /* Same as above */ sizeof(asn_DEF_Collection_16P1_tags_3) /sizeof(asn_DEF_Collection_16P1_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Collection_16P1_3, 1, /* Single element */ &asn_SPC_Collection_16P1_specs_3 /* Additional specs */ }; /*** <<< INCLUDES [Bunch] >>> ***/ #include "Collection.h" #include /*** <<< TYPE-DECLS [Bunch] >>> ***/ typedef struct Bunch { Collection_16P0_t field_REAL; Collection_16P1_t field_IA5String; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Bunch_t; /*** <<< FUNC-DECLS [Bunch] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Bunch; /*** <<< STAT-DEFS [Bunch] >>> ***/ static asn_TYPE_member_t asn_MBR_Bunch_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Bunch, field_REAL), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_Collection_16P0, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "field-REAL" }, { ATF_NOFLAGS, 0, offsetof(struct Bunch, field_IA5String), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_Collection_16P1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "field-IA5String" }, }; static ber_tlv_tag_t asn_DEF_Bunch_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Bunch_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* field-REAL at 17 */ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, -1, 0 } /* field-IA5String at 18 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Bunch_specs_1 = { sizeof(struct Bunch), offsetof(struct Bunch, _asn_ctx), asn_MAP_Bunch_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Bunch = { "Bunch", "Bunch", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Bunch_tags_1, sizeof(asn_DEF_Bunch_tags_1) /sizeof(asn_DEF_Bunch_tags_1[0]), /* 1 */ asn_DEF_Bunch_tags_1, /* Same as above */ sizeof(asn_DEF_Bunch_tags_1) /sizeof(asn_DEF_Bunch_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Bunch_1, 2, /* Elements count */ &asn_SPC_Bunch_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/116-bit-string-SE.asn10000644000000000000000000000052311461147103017050 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .116 ModuleBitStringSameValues { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 116 } DEFINITIONS ::= BEGIN T ::= BIT STRING { one(1), another(1) } END asn1c-0.9.24+dfsg/tests/119-per-strings-OK.asn1.-Pgen-PER0000644000000000000000000013744211461146446020665 0ustar rootroot /*** <<< INCLUDES [PDU] >>> ***/ #include #include #include #include #include #include #include #include #include #include #include #include /*** <<< FWD-DECLS [PDU] >>> ***/ struct PDU; /*** <<< TYPE-DECLS [PDU] >>> ***/ typedef struct PDU { struct many { A_SEQUENCE_OF(struct PDU) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } *many; IA5String_t *ia5 /* OPTIONAL */; IA5String_t *ia5_c /* OPTIONAL */; IA5String_t *ia5_ce /* OPTIONAL */; IA5String_t *ia5_ir /* OPTIONAL */; VisibleString_t *vs /* OPTIONAL */; VisibleString_t *vs_c /* OPTIONAL */; VisibleString_t *vs_ce /* OPTIONAL */; VisibleString_t *vs_ir /* OPTIONAL */; PrintableString_t *pr /* OPTIONAL */; PrintableString_t *pr_c /* OPTIONAL */; PrintableString_t *pr_ir /* OPTIONAL */; NumericString_t *ns /* OPTIONAL */; NumericString_t *ns_c /* OPTIONAL */; NumericString_t *ns_ce /* OPTIONAL */; NumericString_t *ns_ir /* OPTIONAL */; UTF8String_t *ut_c /* OPTIONAL */; UTF8String_t *ut_ce /* OPTIONAL */; UTF8String_t *ut_ir /* OPTIONAL */; BMPString_t *bm /* OPTIONAL */; BMPString_t *bm_c /* OPTIONAL */; BMPString_t *bm_cs /* OPTIONAL */; BMPString_t *bm_ce /* OPTIONAL */; BMPString_t *bm_ir /* OPTIONAL */; UniversalString_t *us /* OPTIONAL */; UniversalString_t *us_c /* OPTIONAL */; UniversalString_t *us_cs /* OPTIONAL */; UniversalString_t *us_ce /* OPTIONAL */; UniversalString_t *us_ir /* OPTIONAL */; REAL_t *real /* OPTIONAL */; OBJECT_IDENTIFIER_t *oid /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } PDU_t; /*** <<< FUNC-DECLS [PDU] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_PDU; /*** <<< POST-INCLUDE [PDU] >>> ***/ #include "PDU.h" /*** <<< CTABLES [PDU] >>> ***/ static int check_permitted_alphabet_5(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 90)) return -1; } return 0; } static int check_permitted_alphabet_6(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 90)) return -1; } return 0; } static int permitted_alphabet_table_7[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* AB */ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, /* XYZ */ }; static int permitted_alphabet_code2value_7[5] = { 65,66,88,89,90,}; static int check_permitted_alphabet_7(const void *sptr) { int *table = permitted_alphabet_table_7; /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } static int check_permitted_alphabet_9(const void *sptr) { /* The underlying type is VisibleString */ const VisibleString_t *st = (const VisibleString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 90)) return -1; } return 0; } static int check_permitted_alphabet_10(const void *sptr) { /* The underlying type is VisibleString */ const VisibleString_t *st = (const VisibleString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 90)) return -1; } return 0; } static int permitted_alphabet_table_11[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* AB */ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, /* XYZ */ }; static int permitted_alphabet_code2value_11[5] = { 65,66,88,89,90,}; static int check_permitted_alphabet_11(const void *sptr) { int *table = permitted_alphabet_table_11; /* The underlying type is VisibleString */ const VisibleString_t *st = (const VisibleString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } static int check_permitted_alphabet_13(const void *sptr) { /* The underlying type is PrintableString */ const PrintableString_t *st = (const PrintableString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 90)) return -1; } return 0; } static int permitted_alphabet_table_14[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* AB */ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, /* XYZ */ }; static int permitted_alphabet_code2value_14[5] = { 65,66,88,89,90,}; static int check_permitted_alphabet_14(const void *sptr) { int *table = permitted_alphabet_table_14; /* The underlying type is PrintableString */ const PrintableString_t *st = (const PrintableString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } static int check_permitted_alphabet_16(const void *sptr) { /* The underlying type is NumericString */ const NumericString_t *st = (const NumericString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 53 && cv <= 57)) return -1; } return 0; } static int check_permitted_alphabet_17(const void *sptr) { /* The underlying type is NumericString */ const NumericString_t *st = (const NumericString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 53 && cv <= 57)) return -1; } return 0; } static int permitted_alphabet_table_18[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, /* 1 9 */ }; static int permitted_alphabet_code2value_18[2] = { 49,57,}; static int check_permitted_alphabet_18(const void *sptr) { int *table = permitted_alphabet_table_18; /* The underlying type is NumericString */ const NumericString_t *st = (const NumericString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } static int permitted_alphabet_table_21[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, /* Z */ }; static int check_permitted_alphabet_21(const void *sptr) { int *table = permitted_alphabet_table_21; /* The underlying type is UTF8String */ const UTF8String_t *st = (const UTF8String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(cv >= 0x80) return -1; if(!table[cv]) return -1; } return 0; } static int check_permitted_alphabet_23(const void *sptr) { /* The underlying type is BMPString */ const BMPString_t *st = (const BMPString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; if(st->size % 2) return -1; /* (size%2)! */ for(; ch < end; ch += 2) { uint16_t cv = (ch[0] << 8) | ch[1]; if(!(cv >= 65 && cv <= 90)) return -1; } return 0; } static int check_permitted_alphabet_24(const void *sptr) { /* The underlying type is BMPString */ const BMPString_t *st = (const BMPString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; if(st->size % 2) return -1; /* (size%2)! */ for(; ch < end; ch += 2) { uint16_t cv = (ch[0] << 8) | ch[1]; if(!(cv <= 65533)) return -1; } return 0; } static int check_permitted_alphabet_25(const void *sptr) { /* The underlying type is BMPString */ const BMPString_t *st = (const BMPString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; if(st->size % 2) return -1; /* (size%2)! */ for(; ch < end; ch += 2) { uint16_t cv = (ch[0] << 8) | ch[1]; if(!(cv >= 65 && cv <= 90)) return -1; } return 0; } static int permitted_alphabet_table_26[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* AB */ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, /* XYZ */ }; static int permitted_alphabet_code2value_26[5] = { 65,66,88,89,90,}; static int check_permitted_alphabet_26(const void *sptr) { int *table = permitted_alphabet_table_26; /* The underlying type is BMPString */ const BMPString_t *st = (const BMPString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; if(st->size % 2) return -1; /* (size%2)! */ for(; ch < end; ch += 2) { uint16_t cv = (ch[0] << 8) | ch[1]; if(cv > 255) return -1; if(!table[cv]) return -1; } return 0; } static int check_permitted_alphabet_28(const void *sptr) { /* The underlying type is UniversalString */ const UniversalString_t *st = (const UniversalString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; if(st->size % 4) return -1; /* (size%4)! */ for(; ch < end; ch += 4) { uint32_t cv = (ch[0] << 24) | (ch[1] << 16) | (ch[2] << 8) | ch[3]; if(!(cv >= 65 && cv <= 90)) return -1; } return 0; } static int check_permitted_alphabet_29(const void *sptr) { /* The underlying type is UniversalString */ const UniversalString_t *st = (const UniversalString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; if(st->size % 4) return -1; /* (size%4)! */ for(; ch < end; ch += 4) { uint32_t cv = (ch[0] << 24) | (ch[1] << 16) | (ch[2] << 8) | ch[3]; if(!(1 /* Constraint matches natural range of cv */)) return -1; } return 0; } static int check_permitted_alphabet_30(const void *sptr) { /* The underlying type is UniversalString */ const UniversalString_t *st = (const UniversalString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; if(st->size % 4) return -1; /* (size%4)! */ for(; ch < end; ch += 4) { uint32_t cv = (ch[0] << 24) | (ch[1] << 16) | (ch[2] << 8) | ch[3]; if(!(cv >= 65 && cv <= 90)) return -1; } return 0; } static int permitted_alphabet_table_31[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* AB */ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, /* XYZ */ }; static int permitted_alphabet_code2value_31[5] = { 65,66,88,89,90,}; static int check_permitted_alphabet_31(const void *sptr) { int *table = permitted_alphabet_table_31; /* The underlying type is UniversalString */ const UniversalString_t *st = (const UniversalString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; if(st->size % 4) return -1; /* (size%4)! */ for(; ch < end; ch += 4) { uint32_t cv = (ch[0] << 24) | (ch[1] << 16) | (ch[2] << 8) | ch[3]; if(cv > 255) return -1; if(!table[cv]) return -1; } return 0; } /*** <<< CODE [PDU] >>> ***/ static int memb_ia5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_5(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_ia5_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_6(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_ia5_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_7(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int asn_PER_MAP_ia5_ir_7_v2c(unsigned int value) { if(value >= sizeof(permitted_alphabet_table_7)/sizeof(permitted_alphabet_table_7[0])) return -1; return permitted_alphabet_table_7[value] - 1; } static int asn_PER_MAP_ia5_ir_7_c2v(unsigned int code) { if(code >= sizeof(permitted_alphabet_code2value_7)/sizeof(permitted_alphabet_code2value_7[0])) return -1; return permitted_alphabet_code2value_7[code]; } static int memb_vs_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const VisibleString_t *st = (const VisibleString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_9(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_vs_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const VisibleString_t *st = (const VisibleString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_10(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_vs_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const VisibleString_t *st = (const VisibleString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_11(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int asn_PER_MAP_vs_ir_11_v2c(unsigned int value) { if(value >= sizeof(permitted_alphabet_table_11)/sizeof(permitted_alphabet_table_11[0])) return -1; return permitted_alphabet_table_11[value] - 1; } static int asn_PER_MAP_vs_ir_11_c2v(unsigned int code) { if(code >= sizeof(permitted_alphabet_code2value_11)/sizeof(permitted_alphabet_code2value_11[0])) return -1; return permitted_alphabet_code2value_11[code]; } static int memb_pr_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PrintableString_t *st = (const PrintableString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_13(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_pr_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PrintableString_t *st = (const PrintableString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_14(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int asn_PER_MAP_pr_ir_14_v2c(unsigned int value) { if(value >= sizeof(permitted_alphabet_table_14)/sizeof(permitted_alphabet_table_14[0])) return -1; return permitted_alphabet_table_14[value] - 1; } static int asn_PER_MAP_pr_ir_14_c2v(unsigned int code) { if(code >= sizeof(permitted_alphabet_code2value_14)/sizeof(permitted_alphabet_code2value_14[0])) return -1; return permitted_alphabet_code2value_14[code]; } static int memb_ns_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const NumericString_t *st = (const NumericString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_16(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_ns_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const NumericString_t *st = (const NumericString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_17(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_ns_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const NumericString_t *st = (const NumericString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_18(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int asn_PER_MAP_ns_ir_18_v2c(unsigned int value) { if(value >= sizeof(permitted_alphabet_table_18)/sizeof(permitted_alphabet_table_18[0])) return -1; return permitted_alphabet_table_18[value] - 1; } static int asn_PER_MAP_ns_ir_18_c2v(unsigned int code) { if(code >= sizeof(permitted_alphabet_code2value_18)/sizeof(permitted_alphabet_code2value_18[0])) return -1; return permitted_alphabet_code2value_18[code]; } static int memb_ut_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, "%s: UTF-8: broken encoding (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((size == 6)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_ut_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, "%s: UTF-8: broken encoding (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((size == 6)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_ut_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_21(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_bm_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const BMPString_t *st = (const BMPString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_23(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_bm_cs_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const BMPString_t *st = (const BMPString_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size >> 1; /* 2 byte per character */ if((size == 6) && !check_permitted_alphabet_24(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_bm_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const BMPString_t *st = (const BMPString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_25(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_bm_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const BMPString_t *st = (const BMPString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_26(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int asn_PER_MAP_bm_ir_26_v2c(unsigned int value) { if(value >= sizeof(permitted_alphabet_table_26)/sizeof(permitted_alphabet_table_26[0])) return -1; return permitted_alphabet_table_26[value] - 1; } static int asn_PER_MAP_bm_ir_26_c2v(unsigned int code) { if(code >= sizeof(permitted_alphabet_code2value_26)/sizeof(permitted_alphabet_code2value_26[0])) return -1; return permitted_alphabet_code2value_26[code]; } static int memb_us_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UniversalString_t *st = (const UniversalString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_28(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_us_cs_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UniversalString_t *st = (const UniversalString_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size >> 2; /* 4 byte per character */ if((size == 6) && !check_permitted_alphabet_29(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_us_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UniversalString_t *st = (const UniversalString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_30(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_us_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UniversalString_t *st = (const UniversalString_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_31(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int asn_PER_MAP_us_ir_31_v2c(unsigned int value) { if(value >= sizeof(permitted_alphabet_table_31)/sizeof(permitted_alphabet_table_31[0])) return -1; return permitted_alphabet_table_31[value] - 1; } static int asn_PER_MAP_us_ir_31_c2v(unsigned int code) { if(code >= sizeof(permitted_alphabet_code2value_31)/sizeof(permitted_alphabet_code2value_31[0])) return -1; return permitted_alphabet_code2value_31[code]; } /*** <<< CTDEFS [PDU] >>> ***/ static asn_per_constraints_t asn_PER_memb_ia5_c_constr_5 = { { APC_CONSTRAINED, 5, 5, 65, 90 } /* (65..90) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_ia5_ce_constr_6 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_ia5_ir_constr_7 = { { APC_CONSTRAINED, 3, 3, 65, 90 } /* (65..90) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, asn_PER_MAP_ia5_ir_7_v2c, /* Value to PER code map */ asn_PER_MAP_ia5_ir_7_c2v /* PER code to value map */ }; static asn_per_constraints_t asn_PER_memb_vs_c_constr_9 = { { APC_CONSTRAINED, 5, 5, 65, 90 } /* (65..90) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_vs_ce_constr_10 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_vs_ir_constr_11 = { { APC_CONSTRAINED, 3, 3, 65, 90 } /* (65..90) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, asn_PER_MAP_vs_ir_11_v2c, /* Value to PER code map */ asn_PER_MAP_vs_ir_11_c2v /* PER code to value map */ }; static asn_per_constraints_t asn_PER_memb_pr_c_constr_13 = { { APC_CONSTRAINED, 5, 5, 65, 90 } /* (65..90) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_pr_ir_constr_14 = { { APC_CONSTRAINED, 3, 3, 65, 90 } /* (65..90) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, asn_PER_MAP_pr_ir_14_v2c, /* Value to PER code map */ asn_PER_MAP_pr_ir_14_c2v /* PER code to value map */ }; static asn_per_constraints_t asn_PER_memb_ns_c_constr_16 = { { APC_CONSTRAINED, 3, 3, 53, 57 } /* (53..57) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_ns_ce_constr_17 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_ns_ir_constr_18 = { { APC_CONSTRAINED, 1, 1, 49, 57 } /* (49..57) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, asn_PER_MAP_ns_ir_18_v2c, /* Value to PER code map */ asn_PER_MAP_ns_ir_18_c2v /* PER code to value map */ }; static asn_per_constraints_t asn_PER_memb_ut_c_constr_19 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_ut_ce_constr_20 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_ut_ir_constr_21 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_bm_c_constr_23 = { { APC_CONSTRAINED, 5, 5, 65, 90 } /* (65..90) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_bm_cs_constr_24 = { { APC_CONSTRAINED, 16, 16, 0, 65533 } /* (0..65533) */, { APC_CONSTRAINED, 0, 0, 6, 6 } /* (SIZE(6..6)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_bm_ce_constr_25 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_bm_ir_constr_26 = { { APC_CONSTRAINED, 3, 3, 65, 90 } /* (65..90) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, asn_PER_MAP_bm_ir_26_v2c, /* Value to PER code map */ asn_PER_MAP_bm_ir_26_c2v /* PER code to value map */ }; static asn_per_constraints_t asn_PER_memb_us_c_constr_28 = { { APC_CONSTRAINED, 5, 5, 65, 90 } /* (65..90) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_us_cs_constr_29 = { { APC_CONSTRAINED, 32, 32, 0, 2147483647 } /* (0..4294967295) */, { APC_CONSTRAINED, 0, 0, 6, 6 } /* (SIZE(6..6)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_us_ce_constr_30 = { { APC_CONSTRAINED, 32, 32, 0, 2147483647 } /* special case 1 */ , { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; static asn_per_constraints_t asn_PER_memb_us_ir_constr_31 = { { APC_CONSTRAINED, 3, 3, 65, 90 } /* (65..90) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, asn_PER_MAP_us_ir_31_v2c, /* Value to PER code map */ asn_PER_MAP_us_ir_31_c2v /* PER code to value map */ }; /*** <<< STAT-DEFS [PDU] >>> ***/ static asn_TYPE_member_t asn_MBR_many_2[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_PDU, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_many_tags_2[] = { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_many_specs_2 = { sizeof(struct many), offsetof(struct many, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_many_2 = { "many", "many", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, SEQUENCE_OF_decode_uper, SEQUENCE_OF_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_many_tags_2, sizeof(asn_DEF_many_tags_2) /sizeof(asn_DEF_many_tags_2[0]) - 1, /* 1 */ asn_DEF_many_tags_2, /* Same as above */ sizeof(asn_DEF_many_tags_2) /sizeof(asn_DEF_many_tags_2[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_many_2, 1, /* Single element */ &asn_SPC_many_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_PDU_1[] = { { ATF_POINTER, 31, offsetof(struct PDU, many), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = 0, .type = &asn_DEF_many_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "many" }, { ATF_POINTER, 30, offsetof(struct PDU, ia5), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_IA5String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "ia5" }, { ATF_POINTER, 29, offsetof(struct PDU, ia5_c), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_IA5String, .memb_constraints = memb_ia5_c_constraint_1, .per_constraints = &asn_PER_memb_ia5_c_constr_5, .default_value = 0, .name = "ia5-c" }, { ATF_POINTER, 28, offsetof(struct PDU, ia5_ce), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_IA5String, .memb_constraints = memb_ia5_ce_constraint_1, .per_constraints = &asn_PER_memb_ia5_ce_constr_6, .default_value = 0, .name = "ia5-ce" }, { ATF_POINTER, 27, offsetof(struct PDU, ia5_ir), .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_IA5String, .memb_constraints = memb_ia5_ir_constraint_1, .per_constraints = &asn_PER_memb_ia5_ir_constr_7, .default_value = 0, .name = "ia5-ir" }, { ATF_POINTER, 26, offsetof(struct PDU, vs), .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "vs" }, { ATF_POINTER, 25, offsetof(struct PDU, vs_c), .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = memb_vs_c_constraint_1, .per_constraints = &asn_PER_memb_vs_c_constr_9, .default_value = 0, .name = "vs-c" }, { ATF_POINTER, 24, offsetof(struct PDU, vs_ce), .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = memb_vs_ce_constraint_1, .per_constraints = &asn_PER_memb_vs_ce_constr_10, .default_value = 0, .name = "vs-ce" }, { ATF_POINTER, 23, offsetof(struct PDU, vs_ir), .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = memb_vs_ir_constraint_1, .per_constraints = &asn_PER_memb_vs_ir_constr_11, .default_value = 0, .name = "vs-ir" }, { ATF_POINTER, 22, offsetof(struct PDU, pr), .tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_PrintableString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "pr" }, { ATF_POINTER, 21, offsetof(struct PDU, pr_c), .tag = (ASN_TAG_CLASS_CONTEXT | (10 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_PrintableString, .memb_constraints = memb_pr_c_constraint_1, .per_constraints = &asn_PER_memb_pr_c_constr_13, .default_value = 0, .name = "pr-c" }, { ATF_POINTER, 20, offsetof(struct PDU, pr_ir), .tag = (ASN_TAG_CLASS_CONTEXT | (11 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_PrintableString, .memb_constraints = memb_pr_ir_constraint_1, .per_constraints = &asn_PER_memb_pr_ir_constr_14, .default_value = 0, .name = "pr-ir" }, { ATF_POINTER, 19, offsetof(struct PDU, ns), .tag = (ASN_TAG_CLASS_CONTEXT | (12 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NumericString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "ns" }, { ATF_POINTER, 18, offsetof(struct PDU, ns_c), .tag = (ASN_TAG_CLASS_CONTEXT | (13 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NumericString, .memb_constraints = memb_ns_c_constraint_1, .per_constraints = &asn_PER_memb_ns_c_constr_16, .default_value = 0, .name = "ns-c" }, { ATF_POINTER, 17, offsetof(struct PDU, ns_ce), .tag = (ASN_TAG_CLASS_CONTEXT | (14 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NumericString, .memb_constraints = memb_ns_ce_constraint_1, .per_constraints = &asn_PER_memb_ns_ce_constr_17, .default_value = 0, .name = "ns-ce" }, { ATF_POINTER, 16, offsetof(struct PDU, ns_ir), .tag = (ASN_TAG_CLASS_CONTEXT | (15 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NumericString, .memb_constraints = memb_ns_ir_constraint_1, .per_constraints = &asn_PER_memb_ns_ir_constr_18, .default_value = 0, .name = "ns-ir" }, { ATF_POINTER, 15, offsetof(struct PDU, ut_c), .tag = (ASN_TAG_CLASS_CONTEXT | (16 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UTF8String, .memb_constraints = memb_ut_c_constraint_1, .per_constraints = &asn_PER_memb_ut_c_constr_19, .default_value = 0, .name = "ut-c" }, { ATF_POINTER, 14, offsetof(struct PDU, ut_ce), .tag = (ASN_TAG_CLASS_CONTEXT | (17 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UTF8String, .memb_constraints = memb_ut_ce_constraint_1, .per_constraints = &asn_PER_memb_ut_ce_constr_20, .default_value = 0, .name = "ut-ce" }, { ATF_POINTER, 13, offsetof(struct PDU, ut_ir), .tag = (ASN_TAG_CLASS_CONTEXT | (18 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UTF8String, .memb_constraints = memb_ut_ir_constraint_1, .per_constraints = &asn_PER_memb_ut_ir_constr_21, .default_value = 0, .name = "ut-ir" }, { ATF_POINTER, 12, offsetof(struct PDU, bm), .tag = (ASN_TAG_CLASS_CONTEXT | (19 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_BMPString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "bm" }, { ATF_POINTER, 11, offsetof(struct PDU, bm_c), .tag = (ASN_TAG_CLASS_CONTEXT | (20 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_BMPString, .memb_constraints = memb_bm_c_constraint_1, .per_constraints = &asn_PER_memb_bm_c_constr_23, .default_value = 0, .name = "bm-c" }, { ATF_POINTER, 10, offsetof(struct PDU, bm_cs), .tag = (ASN_TAG_CLASS_CONTEXT | (21 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_BMPString, .memb_constraints = memb_bm_cs_constraint_1, .per_constraints = &asn_PER_memb_bm_cs_constr_24, .default_value = 0, .name = "bm-cs" }, { ATF_POINTER, 9, offsetof(struct PDU, bm_ce), .tag = (ASN_TAG_CLASS_CONTEXT | (22 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_BMPString, .memb_constraints = memb_bm_ce_constraint_1, .per_constraints = &asn_PER_memb_bm_ce_constr_25, .default_value = 0, .name = "bm-ce" }, { ATF_POINTER, 8, offsetof(struct PDU, bm_ir), .tag = (ASN_TAG_CLASS_CONTEXT | (23 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_BMPString, .memb_constraints = memb_bm_ir_constraint_1, .per_constraints = &asn_PER_memb_bm_ir_constr_26, .default_value = 0, .name = "bm-ir" }, { ATF_POINTER, 7, offsetof(struct PDU, us), .tag = (ASN_TAG_CLASS_CONTEXT | (24 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UniversalString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "us" }, { ATF_POINTER, 6, offsetof(struct PDU, us_c), .tag = (ASN_TAG_CLASS_CONTEXT | (25 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UniversalString, .memb_constraints = memb_us_c_constraint_1, .per_constraints = &asn_PER_memb_us_c_constr_28, .default_value = 0, .name = "us-c" }, { ATF_POINTER, 5, offsetof(struct PDU, us_cs), .tag = (ASN_TAG_CLASS_CONTEXT | (26 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UniversalString, .memb_constraints = memb_us_cs_constraint_1, .per_constraints = &asn_PER_memb_us_cs_constr_29, .default_value = 0, .name = "us-cs" }, { ATF_POINTER, 4, offsetof(struct PDU, us_ce), .tag = (ASN_TAG_CLASS_CONTEXT | (27 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UniversalString, .memb_constraints = memb_us_ce_constraint_1, .per_constraints = &asn_PER_memb_us_ce_constr_30, .default_value = 0, .name = "us-ce" }, { ATF_POINTER, 3, offsetof(struct PDU, us_ir), .tag = (ASN_TAG_CLASS_CONTEXT | (28 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UniversalString, .memb_constraints = memb_us_ir_constraint_1, .per_constraints = &asn_PER_memb_us_ir_constr_31, .default_value = 0, .name = "us-ir" }, { ATF_POINTER, 2, offsetof(struct PDU, real), .tag = (ASN_TAG_CLASS_CONTEXT | (29 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_REAL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "real" }, { ATF_POINTER, 1, offsetof(struct PDU, oid), .tag = (ASN_TAG_CLASS_CONTEXT | (30 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_OBJECT_IDENTIFIER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "oid" }, }; static int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }; static ber_tlv_tag_t asn_DEF_PDU_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* many at 15 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ia5 at 16 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ia5-c at 17 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ia5-ce at 18 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* ia5-ir at 19 */ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* vs at 20 */ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* vs-c at 21 */ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* vs-ce at 22 */ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* vs-ir at 23 */ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* pr at 24 */ { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 10, 0, 0 }, /* pr-c at 25 */ { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 11, 0, 0 }, /* pr-ir at 26 */ { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 12, 0, 0 }, /* ns at 27 */ { (ASN_TAG_CLASS_CONTEXT | (13 << 2)), 13, 0, 0 }, /* ns-c at 28 */ { (ASN_TAG_CLASS_CONTEXT | (14 << 2)), 14, 0, 0 }, /* ns-ce at 29 */ { (ASN_TAG_CLASS_CONTEXT | (15 << 2)), 15, 0, 0 }, /* ns-ir at 30 */ { (ASN_TAG_CLASS_CONTEXT | (16 << 2)), 16, 0, 0 }, /* ut-c at 31 */ { (ASN_TAG_CLASS_CONTEXT | (17 << 2)), 17, 0, 0 }, /* ut-ce at 32 */ { (ASN_TAG_CLASS_CONTEXT | (18 << 2)), 18, 0, 0 }, /* ut-ir at 33 */ { (ASN_TAG_CLASS_CONTEXT | (19 << 2)), 19, 0, 0 }, /* bm at 34 */ { (ASN_TAG_CLASS_CONTEXT | (20 << 2)), 20, 0, 0 }, /* bm-c at 35 */ { (ASN_TAG_CLASS_CONTEXT | (21 << 2)), 21, 0, 0 }, /* bm-cs at 36 */ { (ASN_TAG_CLASS_CONTEXT | (22 << 2)), 22, 0, 0 }, /* bm-ce at 37 */ { (ASN_TAG_CLASS_CONTEXT | (23 << 2)), 23, 0, 0 }, /* bm-ir at 38 */ { (ASN_TAG_CLASS_CONTEXT | (24 << 2)), 24, 0, 0 }, /* us at 39 */ { (ASN_TAG_CLASS_CONTEXT | (25 << 2)), 25, 0, 0 }, /* us-c at 40 */ { (ASN_TAG_CLASS_CONTEXT | (26 << 2)), 26, 0, 0 }, /* us-cs at 41 */ { (ASN_TAG_CLASS_CONTEXT | (27 << 2)), 27, 0, 0 }, /* us-ce at 42 */ { (ASN_TAG_CLASS_CONTEXT | (28 << 2)), 28, 0, 0 }, /* us-ir at 43 */ { (ASN_TAG_CLASS_CONTEXT | (29 << 2)), 29, 0, 0 }, /* real at 44 */ { (ASN_TAG_CLASS_CONTEXT | (30 << 2)), 30, 0, 0 } /* oid at 45 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PDU_specs_1 = { sizeof(struct PDU), offsetof(struct PDU, _asn_ctx), asn_MAP_PDU_tag2el_1, 31, /* Count of tags in the map */ asn_MAP_PDU_oms_1, /* Optional members */ 31, 0, /* Root/Additions */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_PDU = { "PDU", "PDU", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_PDU_tags_1, sizeof(asn_DEF_PDU_tags_1) /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */ asn_DEF_PDU_tags_1, /* Same as above */ sizeof(asn_DEF_PDU_tags_1) /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_PDU_1, 31, /* Elements count */ &asn_SPC_PDU_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/70-xer-test-OK.asn1.-EF0000644000000000000000000000430011461146446017036 0ustar rootrootModuleTestXERDecoding { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 70 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN PDU ::= CHOICE { sequence [0] IMPLICIT Sequence, set [1] IMPLICIT Set, sequenceOf [2] IMPLICIT SequenceOf, extensibleSet [3] IMPLICIT ExtensibleSet, extensibleSequence [4] IMPLICIT ExtensibleSequence, extensibleSequence2 [5] IMPLICIT ExtensibleSequence2, setOfNULL [6] IMPLICIT SetOfNULL, setOfREAL [7] IMPLICIT SetOfREAL, setOfEnums [8] IMPLICIT SetOfEnums, namedSetOfNULL [9] IMPLICIT NamedSetOfNULL, namedSetOfREAL [10] IMPLICIT NamedSetOfREAL, namedSetOfEnums [11] IMPLICIT NamedSetOfEnums, seqOfZuka [12] IMPLICIT SeqOfZuka, setOfChoice [13] IMPLICIT SetOfChoice, namedSetOfChoice [14] IMPLICIT NamedSetOfChoice, ... } Sequence ::= SEQUENCE { integer [0] IMPLICIT INTEGER, sequence [1] IMPLICIT Sequence OPTIONAL, bits [2] IMPLICIT BIT STRING OPTIONAL, string [3] IMPLICIT UTF8String } Set ::= SET { roid [0] IMPLICIT RELATIVE-OID, opaque [1] IMPLICIT OCTET STRING OPTIONAL } ExtensibleSet ::= SET { string [0] IMPLICIT UTF8String OPTIONAL, ..., enum [1] IMPLICIT ENUMERATED { b(0), a(1) } } ExtensibleSequence ::= SEQUENCE { string [0] IMPLICIT UTF8String OPTIONAL, ..., integer [1] IMPLICIT INTEGER OPTIONAL, gtime [2] IMPLICIT GeneralizedTime } ExtensibleSequence2 ::= SEQUENCE { string [0] IMPLICIT UTF8String OPTIONAL, ..., integer [1] IMPLICIT INTEGER OPTIONAL } SetOfNULL ::= SET OF NULL SetOfREAL ::= SET OF REAL SetOfEnums ::= SET OF ENUMERATED { one(0), oneMore(1) } NamedSetOfNULL ::= SET OF y NULL NamedSetOfREAL ::= SET OF name REAL NamedSetOfEnums ::= SET OF name ENUMERATED { one(0), oneMore(1) } SequenceOf ::= SEQUENCE OF id INTEGER { one(1), two(2) } SeqOfZuka ::= SEQUENCE OF zuka NULL SetOfChoice ::= SET OF SimpleChoice NamedSetOfChoice ::= SET OF whatever SimpleChoice SimpleChoice ::= CHOICE { a [0] IMPLICIT NULL, b [1] IMPLICIT INTEGER } END asn1c-0.9.24+dfsg/tests/42-real-life-OK.asn1.-EF0000644000000000000000000000155011461146446017126 0ustar rootrootModuleLAPStorage { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 42 } DEFINITIONS EXTENSIBILITY IMPLIED ::= BEGIN LogLine ::= SEQUENCE { line-digest IA5String, varsets SEQUENCE SIZE(1..MAX) OF VariablePartSet, ... } VariablePartSet ::= SEQUENCE { vparts SEQUENCE SIZE(0..MAX) OF VariablePart, resolution ActionItem, ... } VariablePart ::= CHOICE { vset SET SIZE(1..MAX) OF VisibleString, vrange SEQUENCE { from VisibleString, to VisibleString, ... }, ... } ActionItem ::= SEQUENCE { accept-as ENUMERATED { unknown(0), safe(1), unsafe(2), ... }, notify SEQUENCE { critical BOOLEAN, email SET OF VisibleString, ... } OPTIONAL, ... } END asn1c-0.9.24+dfsg/tests/73-circular-OK.asn10000644000000000000000000000123511461147103016517 0ustar rootroot -- OK: Everything is Fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .73 ModuleTestCircularReferences { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 73 } DEFINITIONS ::= BEGIN Type ::= SEQUENCE { data SEQUENCE OF EpytRef } EpytRef ::= Epyt Epyt ::= SEQUENCE { stype SET OF Type, type Type OPTIONAL, ypet Ypet OPTIONAL } Ypet ::= SET { epyt Epyt, plain INTEGER DEFAULT 7, senums SET OF EnumType, patest1 [1] IA5String (FROM("A".."Z")), patest2 [2] IA5String (FROM("a".."z")) } EnumType ::= ENUMERATED { one, two } END asn1c-0.9.24+dfsg/tests/117-real-constraint-OK.asn1.-EF0000644000000000000000000000026411461146446020457 0ustar rootrootModuleRealConstraint { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 117 } DEFINITIONS ::= BEGIN R ::= REAL (0..3.141593) END asn1c-0.9.24+dfsg/tests/43-recursion-OK.asn1.-P0000644000000000000000000004257411461146446017220 0ustar rootroot /*** <<< INCLUDES [Test-structure-1] >>> ***/ #include #include #include #include #include #include /*** <<< FWD-DECLS [Test-structure-1] >>> ***/ struct Test_structure_1; /*** <<< TYPE-DECLS [Test-structure-1] >>> ***/ typedef struct Test_structure_1 { struct t_member1 { A_SET_OF(struct Test_structure_1) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } t_member1; struct t_member2 { A_SEQUENCE_OF(struct Test_structure_1) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } t_member2; struct Test_structure_1 *t_member3 /* OPTIONAL */; INTEGER_t t_member4; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Test_structure_1_t; /*** <<< FUNC-DECLS [Test-structure-1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Test_structure_1; /*** <<< POST-INCLUDE [Test-structure-1] >>> ***/ #include "Test-structure-1.h" /*** <<< STAT-DEFS [Test-structure-1] >>> ***/ static asn_TYPE_member_t asn_MBR_t_member1_2[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Test_structure_1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_t_member1_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_t_member1_specs_2 = { sizeof(struct t_member1), offsetof(struct t_member1, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_t_member1_2 = { "t-member1", "t-member1", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_t_member1_tags_2, sizeof(asn_DEF_t_member1_tags_2) /sizeof(asn_DEF_t_member1_tags_2[0]), /* 1 */ asn_DEF_t_member1_tags_2, /* Same as above */ sizeof(asn_DEF_t_member1_tags_2) /sizeof(asn_DEF_t_member1_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_t_member1_2, 1, /* Single element */ &asn_SPC_t_member1_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_t_member2_4[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Test_structure_1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_t_member2_tags_4[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_t_member2_specs_4 = { sizeof(struct t_member2), offsetof(struct t_member2, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_t_member2_4 = { "t-member2", "t-member2", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_t_member2_tags_4, sizeof(asn_DEF_t_member2_tags_4) /sizeof(asn_DEF_t_member2_tags_4[0]), /* 1 */ asn_DEF_t_member2_tags_4, /* Same as above */ sizeof(asn_DEF_t_member2_tags_4) /sizeof(asn_DEF_t_member2_tags_4[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_t_member2_4, 1, /* Single element */ &asn_SPC_t_member2_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Test_structure_1_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member1), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_t_member1_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "t-member1" }, { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member2), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_t_member2_4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "t-member2" }, { ATF_POINTER, 1, offsetof(struct Test_structure_1, t_member3), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Test_structure_1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "t-member3" }, { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member4), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "t-member4" }, }; static ber_tlv_tag_t asn_DEF_Test_structure_1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Test_structure_1_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, 0, 0 }, /* t-member4 at 19 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 1 }, /* t-member2 at 16 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 0 }, /* t-member3 at 17 */ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* t-member1 at 15 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Test_structure_1_specs_1 = { sizeof(struct Test_structure_1), offsetof(struct Test_structure_1, _asn_ctx), asn_MAP_Test_structure_1_tag2el_1, 4, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Test_structure_1 = { "Test-structure-1", "Test-structure-1", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Test_structure_1_tags_1, sizeof(asn_DEF_Test_structure_1_tags_1) /sizeof(asn_DEF_Test_structure_1_tags_1[0]), /* 1 */ asn_DEF_Test_structure_1_tags_1, /* Same as above */ sizeof(asn_DEF_Test_structure_1_tags_1) /sizeof(asn_DEF_Test_structure_1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Test_structure_1_1, 4, /* Elements count */ &asn_SPC_Test_structure_1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice-1] >>> ***/ #include #include #include #include /*** <<< DEPS [Choice-1] >>> ***/ typedef enum Choice_1_PR { Choice_1_PR_NOTHING, /* No components present */ Choice_1_PR_and, Choice_1_PR_or, Choice_1_PR_not, Choice_1_PR_other } Choice_1_PR; /*** <<< FWD-DECLS [Choice-1] >>> ***/ struct Choice_1; /*** <<< TYPE-DECLS [Choice-1] >>> ***/ typedef struct Choice_1 { Choice_1_PR present; union Choice_1_u { struct Choice_1 *and; struct or { A_SET_OF(struct Choice_1) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } or; struct Choice_1 *not; INTEGER_t other; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice_1_t; /*** <<< FUNC-DECLS [Choice-1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice_1; /*** <<< POST-INCLUDE [Choice-1] >>> ***/ #include "Choice-1.h" /*** <<< STAT-DEFS [Choice-1] >>> ***/ static asn_TYPE_member_t asn_MBR_or_3[] = { { ATF_POINTER, 0, 0, .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_Choice_1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_or_tags_3[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_or_specs_3 = { sizeof(struct or), offsetof(struct or, _asn_ctx), 2, /* XER encoding is XMLValueList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_or_3 = { "or", "or", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_or_tags_3, sizeof(asn_DEF_or_tags_3) /sizeof(asn_DEF_or_tags_3[0]) - 1, /* 1 */ asn_DEF_or_tags_3, /* Same as above */ sizeof(asn_DEF_or_tags_3) /sizeof(asn_DEF_or_tags_3[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_or_3, 1, /* Single element */ &asn_SPC_or_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Choice_1_1[] = { { ATF_POINTER, 0, offsetof(struct Choice_1, choice.and), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice_1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "and" }, { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.or), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_or_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "or" }, { ATF_POINTER, 0, offsetof(struct Choice_1, choice.not), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice_1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "not" }, { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.other), .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "other" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice_1_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* and at 22 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* or at 23 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* not at 24 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 3, 0, 0 } /* other at 26 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice_1_specs_1 = { sizeof(struct Choice_1), offsetof(struct Choice_1, _asn_ctx), offsetof(struct Choice_1, present), sizeof(((struct Choice_1 *)0)->present), asn_MAP_Choice_1_tag2el_1, 4, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice_1 = { "Choice-1", "Choice-1", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice_1_1, 4, /* Elements count */ &asn_SPC_Choice_1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Test-structure-2] >>> ***/ #include /*** <<< DEPS [Test-structure-2] >>> ***/ /* * Method of determining the components presence */ typedef enum Test_structure_2_PR { Test_structure_2_PR_m1, /* Member m1 is present */ } Test_structure_2_PR; /*** <<< FWD-DECLS [Test-structure-2] >>> ***/ struct Test_structure_3; /*** <<< TYPE-DECLS [Test-structure-2] >>> ***/ typedef struct Test_structure_2 { struct Test_structure_3 *m1 /* OPTIONAL */; /* Presence bitmask: ASN_SET_ISPRESENT(pTest_structure_2, Test_structure_2_PR_x) */ unsigned int _presence_map [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Test_structure_2_t; /*** <<< FUNC-DECLS [Test-structure-2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Test_structure_2; /*** <<< POST-INCLUDE [Test-structure-2] >>> ***/ #include "Test-structure-3.h" /*** <<< STAT-DEFS [Test-structure-2] >>> ***/ static asn_TYPE_member_t asn_MBR_Test_structure_2_1[] = { { ATF_POINTER, 1, offsetof(struct Test_structure_2, m1), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_Test_structure_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m1" }, }; static ber_tlv_tag_t asn_DEF_Test_structure_2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Test_structure_2_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* m1 at 28 */ }; static uint8_t asn_MAP_Test_structure_2_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { (0 << 7) }; static asn_SET_specifics_t asn_SPC_Test_structure_2_specs_1 = { sizeof(struct Test_structure_2), offsetof(struct Test_structure_2, _asn_ctx), offsetof(struct Test_structure_2, _presence_map), asn_MAP_Test_structure_2_tag2el_1, 1, /* Count of tags in the map */ asn_MAP_Test_structure_2_tag2el_1, /* Same as above */ 1, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_Test_structure_2_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_Test_structure_2 = { "Test-structure-2", "Test-structure-2", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Test_structure_2_tags_1, sizeof(asn_DEF_Test_structure_2_tags_1) /sizeof(asn_DEF_Test_structure_2_tags_1[0]), /* 1 */ asn_DEF_Test_structure_2_tags_1, /* Same as above */ sizeof(asn_DEF_Test_structure_2_tags_1) /sizeof(asn_DEF_Test_structure_2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Test_structure_2_1, 1, /* Elements count */ &asn_SPC_Test_structure_2_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Test-structure-3] >>> ***/ #include /*** <<< DEPS [Test-structure-3] >>> ***/ /* * Method of determining the components presence */ typedef enum Test_structure_3_PR { Test_structure_3_PR_m1, /* Member m1 is present */ } Test_structure_3_PR; /*** <<< FWD-DECLS [Test-structure-3] >>> ***/ struct Test_structure_2; /*** <<< TYPE-DECLS [Test-structure-3] >>> ***/ typedef struct Test_structure_3 { struct Test_structure_2 *m1 /* OPTIONAL */; /* Presence bitmask: ASN_SET_ISPRESENT(pTest_structure_3, Test_structure_3_PR_x) */ unsigned int _presence_map [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Test_structure_3_t; /*** <<< FUNC-DECLS [Test-structure-3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Test_structure_3; /*** <<< POST-INCLUDE [Test-structure-3] >>> ***/ #include "Test-structure-2.h" /*** <<< STAT-DEFS [Test-structure-3] >>> ***/ static asn_TYPE_member_t asn_MBR_Test_structure_3_1[] = { { ATF_POINTER, 1, offsetof(struct Test_structure_3, m1), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_Test_structure_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m1" }, }; static ber_tlv_tag_t asn_DEF_Test_structure_3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Test_structure_3_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* m1 at 29 */ }; static uint8_t asn_MAP_Test_structure_3_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { (0 << 7) }; static asn_SET_specifics_t asn_SPC_Test_structure_3_specs_1 = { sizeof(struct Test_structure_3), offsetof(struct Test_structure_3, _asn_ctx), offsetof(struct Test_structure_3, _presence_map), asn_MAP_Test_structure_3_tag2el_1, 1, /* Count of tags in the map */ asn_MAP_Test_structure_3_tag2el_1, /* Same as above */ 1, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_Test_structure_3_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_Test_structure_3 = { "Test-structure-3", "Test-structure-3", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Test_structure_3_tags_1, sizeof(asn_DEF_Test_structure_3_tags_1) /sizeof(asn_DEF_Test_structure_3_tags_1[0]), /* 1 */ asn_DEF_Test_structure_3_tags_1, /* Same as above */ sizeof(asn_DEF_Test_structure_3_tags_1) /sizeof(asn_DEF_Test_structure_3_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Test_structure_3_1, 1, /* Elements count */ &asn_SPC_Test_structure_3_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/31-set-of-OK.asn1.-EF0000644000000000000000000000105211461146446016456 0ustar rootrootModuleTestSetOfSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 31 } DEFINITIONS IMPLICIT TAGS ::= BEGIN Forest ::= SET OF Tree Tree ::= SEQUENCE { height INTEGER, width INTEGER } Stuff ::= SET { trees [1] IMPLICIT SET OF Forest OPTIONAL, anything [2] IMPLICIT SET OF SEQUENCE { cup-of-coffee BIT STRING, ... } OPTIONAL, ..., other CHOICE { a [0] IMPLICIT INTEGER, b [3] IMPLICIT INTEGER } } END asn1c-0.9.24+dfsg/tests/92-circular-loops-OK.asn1.-P0000644000000000000000000013734311461146446020150 0ustar rootroot /*** <<< INCLUDES [Everything] >>> ***/ #include "Set.h" #include "Alpha.h" #include "Beta.h" #include "Gamma.h" #include "OneTwo.h" #include "TwoThree.h" #include "ThreeOne.h" #include /*** <<< FWD-DECLS [Everything] >>> ***/ struct Choice1; struct Choice2; struct Choice3; /*** <<< TYPE-DECLS [Everything] >>> ***/ typedef struct Everything { struct Choice1 *ch1; struct Choice2 *ch2; struct Choice3 *ch3; Set_t set; Alpha_t a; Beta_t b; Gamma_t g; OneTwo_t ot; TwoThree_t tt; ThreeOne_t to; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Everything_t; /*** <<< FUNC-DECLS [Everything] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Everything; /*** <<< POST-INCLUDE [Everything] >>> ***/ #include "Choice1.h" #include "Choice2.h" #include "Choice3.h" /*** <<< STAT-DEFS [Everything] >>> ***/ static asn_TYPE_member_t asn_MBR_Everything_1[] = { { ATF_POINTER, 0, offsetof(struct Everything, ch1), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ch1" }, { ATF_POINTER, 0, offsetof(struct Everything, ch2), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ch2" }, { ATF_POINTER, 0, offsetof(struct Everything, ch3), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ch3" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, set), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, a), .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Alpha, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, b), .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Beta, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, g), .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Gamma, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "g" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, ot), .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_OneTwo, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ot" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, tt), .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_TwoThree, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "tt" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, to), .tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_ThreeOne, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "to" }, }; static ber_tlv_tag_t asn_DEF_Everything_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Everything_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ch1 at 15 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ch2 at 16 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ch3 at 17 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* set at 18 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* a at 19 */ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* b at 20 */ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* g at 21 */ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* ot at 22 */ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* tt at 23 */ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 } /* to at 25 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Everything_specs_1 = { sizeof(struct Everything), offsetof(struct Everything, _asn_ctx), asn_MAP_Everything_tag2el_1, 10, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Everything = { "Everything", "Everything", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Everything_tags_1, sizeof(asn_DEF_Everything_tags_1) /sizeof(asn_DEF_Everything_tags_1[0]), /* 1 */ asn_DEF_Everything_tags_1, /* Same as above */ sizeof(asn_DEF_Everything_tags_1) /sizeof(asn_DEF_Everything_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Everything_1, 10, /* Elements count */ &asn_SPC_Everything_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice1] >>> ***/ #include /*** <<< DEPS [Choice1] >>> ***/ typedef enum Choice1_PR { Choice1_PR_NOTHING, /* No components present */ Choice1_PR_something, /* Extensions may appear below */ Choice1_PR_some2 } Choice1_PR; /*** <<< FWD-DECLS [Choice1] >>> ***/ struct Everything; /*** <<< TYPE-DECLS [Choice1] >>> ***/ typedef struct Choice1 { Choice1_PR present; union Choice1_u { struct Everything *something; /* * This type is extensible, * possible extensions are below. */ struct Everything *some2; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice1_t; /*** <<< FUNC-DECLS [Choice1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice1; /*** <<< POST-INCLUDE [Choice1] >>> ***/ #include "Everything.h" /*** <<< STAT-DEFS [Choice1] >>> ***/ static asn_TYPE_member_t asn_MBR_Choice1_1[] = { { ATF_POINTER, 0, offsetof(struct Choice1, choice.something), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Everything, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "something" }, { ATF_POINTER, 0, offsetof(struct Choice1, choice.some2), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Everything, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "some2" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice1_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* something at 29 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* some2 at 32 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice1_specs_1 = { sizeof(struct Choice1), offsetof(struct Choice1, _asn_ctx), offsetof(struct Choice1, present), sizeof(((struct Choice1 *)0)->present), asn_MAP_Choice1_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = 1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice1 = { "Choice1", "Choice1", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice1_1, 2, /* Elements count */ &asn_SPC_Choice1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice2] >>> ***/ #include "TypeRef.h" #include /*** <<< DEPS [Choice2] >>> ***/ typedef enum Choice2_PR { Choice2_PR_NOTHING, /* No components present */ Choice2_PR_typeref, /* Extensions may appear below */ Choice2_PR_some3 } Choice2_PR; /*** <<< FWD-DECLS [Choice2] >>> ***/ struct Everything; /*** <<< TYPE-DECLS [Choice2] >>> ***/ typedef struct Choice2 { Choice2_PR present; union Choice2_u { TypeRef_t typeref; /* * This type is extensible, * possible extensions are below. */ struct Everything *some3; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice2_t; /*** <<< FUNC-DECLS [Choice2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice2; /*** <<< POST-INCLUDE [Choice2] >>> ***/ #include "Everything.h" /*** <<< STAT-DEFS [Choice2] >>> ***/ static asn_TYPE_member_t asn_MBR_Choice2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.typeref), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_TypeRef, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "typeref" }, { ATF_POINTER, 0, offsetof(struct Choice2, choice.some3), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Everything, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "some3" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* typeref at 35 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* some3 at 38 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = { sizeof(struct Choice2), offsetof(struct Choice2, _asn_ctx), offsetof(struct Choice2, present), sizeof(((struct Choice2 *)0)->present), asn_MAP_Choice2_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = 1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice2 = { "Choice2", "Choice2", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice2_1, 2, /* Elements count */ &asn_SPC_Choice2_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice3] >>> ***/ #include #include #include #include /*** <<< DEPS [Choice3] >>> ***/ typedef enum Choice3_PR { Choice3_PR_NOTHING, /* No components present */ Choice3_PR_a, Choice3_PR_b, Choice3_PR_c } Choice3_PR; /*** <<< FWD-DECLS [Choice3] >>> ***/ struct Everything; struct Choice3; /*** <<< TYPE-DECLS [Choice3] >>> ***/ typedef struct Choice3 { Choice3_PR present; union Choice3_u { struct a { struct Everything *aa; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } a; struct Everything *b; struct c { A_SEQUENCE_OF(struct Choice3) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } c; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice3_t; /*** <<< FUNC-DECLS [Choice3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice3; /*** <<< POST-INCLUDE [Choice3] >>> ***/ #include "Everything.h" #include "Choice3.h" /*** <<< STAT-DEFS [Choice3] >>> ***/ static asn_TYPE_member_t asn_MBR_a_2[] = { { ATF_POINTER, 0, offsetof(struct a, aa), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Everything, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "aa" }, }; static ber_tlv_tag_t asn_DEF_a_tags_2[] = { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_a_tag2el_2[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* aa at 43 */ }; static asn_SEQUENCE_specifics_t asn_SPC_a_specs_2 = { sizeof(struct a), offsetof(struct a, _asn_ctx), asn_MAP_a_tag2el_2, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_a_2 = { "a", "a", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_a_tags_2, sizeof(asn_DEF_a_tags_2) /sizeof(asn_DEF_a_tags_2[0]) - 1, /* 1 */ asn_DEF_a_tags_2, /* Same as above */ sizeof(asn_DEF_a_tags_2) /sizeof(asn_DEF_a_tags_2[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_a_2, 1, /* Elements count */ &asn_SPC_a_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_c_5[] = { { ATF_POINTER, 0, 0, .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_Choice3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_c_tags_5[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_c_specs_5 = { sizeof(struct c), offsetof(struct c, _asn_ctx), 2, /* XER encoding is XMLValueList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_c_5 = { "c", "c", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_c_tags_5, sizeof(asn_DEF_c_tags_5) /sizeof(asn_DEF_c_tags_5[0]) - 1, /* 1 */ asn_DEF_c_tags_5, /* Same as above */ sizeof(asn_DEF_c_tags_5) /sizeof(asn_DEF_c_tags_5[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_c_5, 1, /* Single element */ &asn_SPC_c_specs_5 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Choice3_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Choice3, choice.a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = 0, .type = &asn_DEF_a_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_POINTER, 0, offsetof(struct Choice3, choice.b), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Everything, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, { ATF_NOFLAGS, 0, offsetof(struct Choice3, choice.c), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_c_5, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice3_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 43 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* b at 44 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* c at 46 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice3_specs_1 = { sizeof(struct Choice3), offsetof(struct Choice3, _asn_ctx), offsetof(struct Choice3, present), sizeof(((struct Choice3 *)0)->present), asn_MAP_Choice3_tag2el_1, 3, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice3 = { "Choice3", "Choice3", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice3_1, 3, /* Elements count */ &asn_SPC_Choice3_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Set] >>> ***/ #include #include #include #include /*** <<< FWD-DECLS [Set] >>> ***/ struct Set; struct Sequence; /*** <<< TYPE-DECLS [Set] >>> ***/ typedef struct Set { A_SET_OF(struct Member { INTEGER_t Int; struct Set *set; struct Sequence *seq; struct Set *set2 /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */ struct Set *set3; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Set_t; /*** <<< FUNC-DECLS [Set] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Set; /*** <<< POST-INCLUDE [Set] >>> ***/ #include "Set.h" #include "Sequence.h" /*** <<< STAT-DEFS [Set] >>> ***/ static asn_TYPE_member_t asn_MBR_Member_2[] = { { ATF_NOFLAGS, 0, offsetof(struct Member, Int), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "int" }, { ATF_POINTER, 0, offsetof(struct Member, set), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set" }, { ATF_POINTER, 0, offsetof(struct Member, seq), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "seq" }, { ATF_POINTER, 2, offsetof(struct Member, set2), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set2" }, { ATF_POINTER, 1, offsetof(struct Member, set3), .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set3" }, }; static ber_tlv_tag_t asn_DEF_Member_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Member_tag2el_2[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* int at 49 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* set at 50 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* seq at 51 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* set2 at 52 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* set3 at 55 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_2 = { sizeof(struct Member), offsetof(struct Member, _asn_ctx), asn_MAP_Member_tag2el_2, 5, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 3, /* Start extensions */ 6 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_Member_2 = { "SEQUENCE", "SEQUENCE", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Member_tags_2, sizeof(asn_DEF_Member_tags_2) /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */ asn_DEF_Member_tags_2, /* Same as above */ sizeof(asn_DEF_Member_tags_2) /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Member_2, 5, /* Elements count */ &asn_SPC_Member_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Set_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Member_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_Set_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_Set_specs_1 = { sizeof(struct Set), offsetof(struct Set, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_Set = { "Set", "Set", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Set_tags_1, sizeof(asn_DEF_Set_tags_1) /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */ asn_DEF_Set_tags_1, /* Same as above */ sizeof(asn_DEF_Set_tags_1) /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Set_1, 1, /* Single element */ &asn_SPC_Set_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Sequence] >>> ***/ #include #include /*** <<< FWD-DECLS [Sequence] >>> ***/ struct Sequence; struct Set; /*** <<< TYPE-DECLS [Sequence] >>> ***/ typedef struct Sequence { INTEGER_t a; struct Sequence *seq /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */ INTEGER_t *b; struct Set *set /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Sequence_t; /*** <<< FUNC-DECLS [Sequence] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Sequence; /*** <<< POST-INCLUDE [Sequence] >>> ***/ #include "Sequence.h" #include "Set.h" /*** <<< STAT-DEFS [Sequence] >>> ***/ static asn_TYPE_member_t asn_MBR_Sequence_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Sequence, a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_POINTER, 3, offsetof(struct Sequence, seq), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "seq" }, { ATF_POINTER, 2, offsetof(struct Sequence, b), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, { ATF_POINTER, 1, offsetof(struct Sequence, set), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set" }, }; static ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 58 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* seq at 59 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* b at 61 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* set at 62 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = { sizeof(struct Sequence), offsetof(struct Sequence, _asn_ctx), asn_MAP_Sequence_tag2el_1, 4, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 1, /* Start extensions */ 5 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Sequence = { "Sequence", "Sequence", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Sequence_tags_1, sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ asn_DEF_Sequence_tags_1, /* Same as above */ sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Sequence_1, 4, /* Elements count */ &asn_SPC_Sequence_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [TypeRef] >>> ***/ #include "Sequence.h" /*** <<< TYPE-DECLS [TypeRef] >>> ***/ typedef Sequence_t TypeRef_t; /*** <<< FUNC-DECLS [TypeRef] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_TypeRef; asn_struct_free_f TypeRef_free; asn_struct_print_f TypeRef_print; asn_constr_check_f TypeRef_constraint; ber_type_decoder_f TypeRef_decode_ber; der_type_encoder_f TypeRef_encode_der; xer_type_decoder_f TypeRef_decode_xer; xer_type_encoder_f TypeRef_encode_xer; /*** <<< CODE [TypeRef] >>> ***/ int TypeRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Sequence.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Sequence, * so here we adjust the DEF accordingly. */ static void TypeRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Sequence.free_struct; td->print_struct = asn_DEF_Sequence.print_struct; td->ber_decoder = asn_DEF_Sequence.ber_decoder; td->der_encoder = asn_DEF_Sequence.der_encoder; td->xer_decoder = asn_DEF_Sequence.xer_decoder; td->xer_encoder = asn_DEF_Sequence.xer_encoder; td->uper_decoder = asn_DEF_Sequence.uper_decoder; td->uper_encoder = asn_DEF_Sequence.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Sequence.per_constraints; td->elements = asn_DEF_Sequence.elements; td->elements_count = asn_DEF_Sequence.elements_count; td->specifics = asn_DEF_Sequence.specifics; } void TypeRef_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { TypeRef_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int TypeRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { TypeRef_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t TypeRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { TypeRef_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t TypeRef_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { TypeRef_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t TypeRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { TypeRef_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t TypeRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { TypeRef_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [TypeRef] >>> ***/ static ber_tlv_tag_t asn_DEF_TypeRef_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_TypeRef = { "TypeRef", "TypeRef", TypeRef_free, TypeRef_print, TypeRef_constraint, TypeRef_decode_ber, TypeRef_encode_der, TypeRef_decode_xer, TypeRef_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TypeRef_tags_1, sizeof(asn_DEF_TypeRef_tags_1) /sizeof(asn_DEF_TypeRef_tags_1[0]), /* 1 */ asn_DEF_TypeRef_tags_1, /* Same as above */ sizeof(asn_DEF_TypeRef_tags_1) /sizeof(asn_DEF_TypeRef_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [Alpha] >>> ***/ #include /*** <<< FWD-DECLS [Alpha] >>> ***/ struct Beta; /*** <<< TYPE-DECLS [Alpha] >>> ***/ typedef struct Alpha { struct Beta *a; struct b { struct Beta *b /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } b; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Alpha_t; /*** <<< FUNC-DECLS [Alpha] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Alpha; /*** <<< POST-INCLUDE [Alpha] >>> ***/ #include "Beta.h" /*** <<< STAT-DEFS [Alpha] >>> ***/ static asn_TYPE_member_t asn_MBR_b_3[] = { { ATF_POINTER, 1, offsetof(struct b, b), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Beta, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_b_tags_3[] = { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_b_tag2el_3[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* b at 70 */ }; static asn_SEQUENCE_specifics_t asn_SPC_b_specs_3 = { sizeof(struct b), offsetof(struct b, _asn_ctx), asn_MAP_b_tag2el_3, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_b_3 = { "b", "b", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_b_tags_3, sizeof(asn_DEF_b_tags_3) /sizeof(asn_DEF_b_tags_3[0]) - 1, /* 1 */ asn_DEF_b_tags_3, /* Same as above */ sizeof(asn_DEF_b_tags_3) /sizeof(asn_DEF_b_tags_3[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_b_3, 1, /* Elements count */ &asn_SPC_b_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Alpha_1[] = { { ATF_POINTER, 0, offsetof(struct Alpha, a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Beta, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct Alpha, b), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_b_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_Alpha_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Alpha_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 68 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* b at 70 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Alpha_specs_1 = { sizeof(struct Alpha), offsetof(struct Alpha, _asn_ctx), asn_MAP_Alpha_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Alpha = { "Alpha", "Alpha", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Alpha_tags_1, sizeof(asn_DEF_Alpha_tags_1) /sizeof(asn_DEF_Alpha_tags_1[0]), /* 1 */ asn_DEF_Alpha_tags_1, /* Same as above */ sizeof(asn_DEF_Alpha_tags_1) /sizeof(asn_DEF_Alpha_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Alpha_1, 2, /* Elements count */ &asn_SPC_Alpha_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Beta] >>> ***/ #include /*** <<< FWD-DECLS [Beta] >>> ***/ struct Alpha; struct Gamma; /*** <<< TYPE-DECLS [Beta] >>> ***/ typedef struct Beta { struct Alpha *b /* OPTIONAL */; struct Gamma *g /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Beta_t; /*** <<< FUNC-DECLS [Beta] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Beta; /*** <<< POST-INCLUDE [Beta] >>> ***/ #include "Alpha.h" #include "Gamma.h" /*** <<< STAT-DEFS [Beta] >>> ***/ static asn_TYPE_member_t asn_MBR_Beta_1[] = { { ATF_POINTER, 2, offsetof(struct Beta, b), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Alpha, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, { ATF_POINTER, 1, offsetof(struct Beta, g), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Gamma, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "g" }, }; static ber_tlv_tag_t asn_DEF_Beta_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Beta_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* b at 75 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* g at 76 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Beta_specs_1 = { sizeof(struct Beta), offsetof(struct Beta, _asn_ctx), asn_MAP_Beta_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Beta = { "Beta", "Beta", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Beta_tags_1, sizeof(asn_DEF_Beta_tags_1) /sizeof(asn_DEF_Beta_tags_1[0]), /* 1 */ asn_DEF_Beta_tags_1, /* Same as above */ sizeof(asn_DEF_Beta_tags_1) /sizeof(asn_DEF_Beta_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Beta_1, 2, /* Elements count */ &asn_SPC_Beta_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Gamma] >>> ***/ #include /*** <<< FWD-DECLS [Gamma] >>> ***/ struct TwoThree; struct Alpha; struct Beta; /*** <<< TYPE-DECLS [Gamma] >>> ***/ typedef struct Gamma { struct TwoThree *o; struct Alpha *a; struct Beta *b; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Gamma_t; /*** <<< FUNC-DECLS [Gamma] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Gamma; /*** <<< POST-INCLUDE [Gamma] >>> ***/ #include "TwoThree.h" #include "Alpha.h" #include "Beta.h" /*** <<< STAT-DEFS [Gamma] >>> ***/ static asn_TYPE_member_t asn_MBR_Gamma_1[] = { { ATF_POINTER, 0, offsetof(struct Gamma, o), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_TwoThree, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "o" }, { ATF_POINTER, 0, offsetof(struct Gamma, a), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Alpha, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_POINTER, 0, offsetof(struct Gamma, b), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Beta, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_Gamma_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Gamma_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* o at 80 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* a at 81 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* b at 83 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Gamma_specs_1 = { sizeof(struct Gamma), offsetof(struct Gamma, _asn_ctx), asn_MAP_Gamma_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Gamma = { "Gamma", "Gamma", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Gamma_tags_1, sizeof(asn_DEF_Gamma_tags_1) /sizeof(asn_DEF_Gamma_tags_1[0]), /* 1 */ asn_DEF_Gamma_tags_1, /* Same as above */ sizeof(asn_DEF_Gamma_tags_1) /sizeof(asn_DEF_Gamma_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Gamma_1, 3, /* Elements count */ &asn_SPC_Gamma_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [OneTwo] >>> ***/ #include /*** <<< DEPS [OneTwo] >>> ***/ /* * Method of determining the components presence */ typedef enum OneTwo_PR { OneTwo_PR_m12, /* Member m12 is present */ } OneTwo_PR; /*** <<< FWD-DECLS [OneTwo] >>> ***/ struct TwoThree; /*** <<< TYPE-DECLS [OneTwo] >>> ***/ typedef struct OneTwo { struct TwoThree *m12; /* Presence bitmask: ASN_SET_ISPRESENT(pOneTwo, OneTwo_PR_x) */ unsigned int _presence_map [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } OneTwo_t; /*** <<< FUNC-DECLS [OneTwo] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OneTwo; /*** <<< POST-INCLUDE [OneTwo] >>> ***/ #include "TwoThree.h" /*** <<< STAT-DEFS [OneTwo] >>> ***/ static asn_TYPE_member_t asn_MBR_OneTwo_1[] = { { ATF_POINTER, 0, offsetof(struct OneTwo, m12), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_TwoThree, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m12" }, }; static ber_tlv_tag_t asn_DEF_OneTwo_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_OneTwo_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* m12 at 86 */ }; static uint8_t asn_MAP_OneTwo_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) }; static asn_SET_specifics_t asn_SPC_OneTwo_specs_1 = { sizeof(struct OneTwo), offsetof(struct OneTwo, _asn_ctx), offsetof(struct OneTwo, _presence_map), asn_MAP_OneTwo_tag2el_1, 1, /* Count of tags in the map */ asn_MAP_OneTwo_tag2el_1, /* Same as above */ 1, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_OneTwo_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_OneTwo = { "OneTwo", "OneTwo", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OneTwo_tags_1, sizeof(asn_DEF_OneTwo_tags_1) /sizeof(asn_DEF_OneTwo_tags_1[0]), /* 1 */ asn_DEF_OneTwo_tags_1, /* Same as above */ sizeof(asn_DEF_OneTwo_tags_1) /sizeof(asn_DEF_OneTwo_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_OneTwo_1, 1, /* Elements count */ &asn_SPC_OneTwo_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [TwoThree] >>> ***/ #include /*** <<< DEPS [TwoThree] >>> ***/ /* * Method of determining the components presence */ typedef enum TwoThree_PR { TwoThree_PR_m23, /* Member m23 is present */ } TwoThree_PR; /*** <<< FWD-DECLS [TwoThree] >>> ***/ struct ThreeOne; /*** <<< TYPE-DECLS [TwoThree] >>> ***/ typedef struct TwoThree { struct ThreeOne *m23; /* Presence bitmask: ASN_SET_ISPRESENT(pTwoThree, TwoThree_PR_x) */ unsigned int _presence_map [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } TwoThree_t; /*** <<< FUNC-DECLS [TwoThree] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_TwoThree; /*** <<< POST-INCLUDE [TwoThree] >>> ***/ #include "ThreeOne.h" /*** <<< STAT-DEFS [TwoThree] >>> ***/ static asn_TYPE_member_t asn_MBR_TwoThree_1[] = { { ATF_POINTER, 0, offsetof(struct TwoThree, m23), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_ThreeOne, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m23" }, }; static ber_tlv_tag_t asn_DEF_TwoThree_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_TwoThree_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* m23 at 87 */ }; static uint8_t asn_MAP_TwoThree_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) }; static asn_SET_specifics_t asn_SPC_TwoThree_specs_1 = { sizeof(struct TwoThree), offsetof(struct TwoThree, _asn_ctx), offsetof(struct TwoThree, _presence_map), asn_MAP_TwoThree_tag2el_1, 1, /* Count of tags in the map */ asn_MAP_TwoThree_tag2el_1, /* Same as above */ 1, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_TwoThree_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_TwoThree = { "TwoThree", "TwoThree", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TwoThree_tags_1, sizeof(asn_DEF_TwoThree_tags_1) /sizeof(asn_DEF_TwoThree_tags_1[0]), /* 1 */ asn_DEF_TwoThree_tags_1, /* Same as above */ sizeof(asn_DEF_TwoThree_tags_1) /sizeof(asn_DEF_TwoThree_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_TwoThree_1, 1, /* Elements count */ &asn_SPC_TwoThree_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [ThreeOne] >>> ***/ #include /*** <<< DEPS [ThreeOne] >>> ***/ /* * Method of determining the components presence */ typedef enum ThreeOne_PR { ThreeOne_PR_m31, /* Member m31 is present */ ThreeOne_PR_g, /* Member g is present */ } ThreeOne_PR; /*** <<< FWD-DECLS [ThreeOne] >>> ***/ struct OneTwo; struct Gamma; /*** <<< TYPE-DECLS [ThreeOne] >>> ***/ typedef struct ThreeOne { struct OneTwo *m31; struct Gamma *g; /* Presence bitmask: ASN_SET_ISPRESENT(pThreeOne, ThreeOne_PR_x) */ unsigned int _presence_map [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ThreeOne_t; /*** <<< FUNC-DECLS [ThreeOne] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_ThreeOne; /*** <<< POST-INCLUDE [ThreeOne] >>> ***/ #include "OneTwo.h" #include "Gamma.h" /*** <<< STAT-DEFS [ThreeOne] >>> ***/ static asn_TYPE_member_t asn_MBR_ThreeOne_1[] = { { ATF_POINTER, 0, offsetof(struct ThreeOne, m31), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_OneTwo, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m31" }, { ATF_POINTER, 0, offsetof(struct ThreeOne, g), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Gamma, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "g" }, }; static ber_tlv_tag_t asn_DEF_ThreeOne_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ThreeOne_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* m31 at 88 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* g at 88 */ }; static uint8_t asn_MAP_ThreeOne_mmap_1[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) | (1 << 6) }; static asn_SET_specifics_t asn_SPC_ThreeOne_specs_1 = { sizeof(struct ThreeOne), offsetof(struct ThreeOne, _asn_ctx), offsetof(struct ThreeOne, _presence_map), asn_MAP_ThreeOne_tag2el_1, 2, /* Count of tags in the map */ asn_MAP_ThreeOne_tag2el_1, /* Same as above */ 2, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_ThreeOne_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_ThreeOne = { "ThreeOne", "ThreeOne", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ThreeOne_tags_1, sizeof(asn_DEF_ThreeOne_tags_1) /sizeof(asn_DEF_ThreeOne_tags_1[0]), /* 1 */ asn_DEF_ThreeOne_tags_1, /* Same as above */ sizeof(asn_DEF_ThreeOne_tags_1) /sizeof(asn_DEF_ThreeOne_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ThreeOne_1, 2, /* Elements count */ &asn_SPC_ThreeOne_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/16-constraint-OK.asn10000644000000000000000000000161211461150505017073 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .16 1 -- .16 2 ModuleTestConstraint1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 16 1 } DEFINITIONS ::= BEGIN IMPORTS Type1 FROM ModuleTestConstraint2; -- external reference Type0 ::= IA5String (Type6) Type6 ::= IA5String (Type1) END ModuleTestConstraint2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 16 2 } DEFINITIONS ::= BEGIN EXPORTS Type1; -- external reference Type1 ::= IA5String (SIZE(1..ten,...))(FROM("a".."z"|"#",...)) Type2 ::= IA5String (SIZE (MIN..4)|FROM ("abc")) Type3 ::= BMPString (SIZE(1)) Type4 ::= INTEGER (1..MAX) Type5 ::= BOOLEAN (TRUE|FALSE) ten INTEGER ::= 10 v1 Type1 ::= "#value wi th ""double quotes""" END asn1c-0.9.24+dfsg/tests/21-tags-OK.asn1.-EF0000644000000000000000000000075511461146446016227 0ustar rootrootModuleTestTags1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 21 1 } DEFINITIONS EXPLICIT TAGS ::= BEGIN T1 ::= CHOICE { first [0] EXPLICIT INTEGER, second [1] EXPLICIT INTEGER } END ModuleTestTags2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 21 2 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T2 ::= SEQUENCE { one [0] EXPLICIT T1, two [1] IMPLICIT IA5String } END asn1c-0.9.24+dfsg/tests/46-redefine-OK.asn1.-PR0000644000000000000000000002407111461146446017105 0ustar rootroot /*** <<< INCLUDES [PrimitiveType] >>> ***/ #include /*** <<< TYPE-DECLS [PrimitiveType] >>> ***/ typedef OCTET_STRING_t PrimitiveType_t; /*** <<< FUNC-DECLS [PrimitiveType] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_PrimitiveType; asn_struct_free_f PrimitiveType_free; asn_struct_print_f PrimitiveType_print; asn_constr_check_f PrimitiveType_constraint; ber_type_decoder_f PrimitiveType_decode_ber; der_type_encoder_f PrimitiveType_encode_der; xer_type_decoder_f PrimitiveType_decode_xer; xer_type_encoder_f PrimitiveType_encode_xer; /*** <<< CODE [PrimitiveType] >>> ***/ int PrimitiveType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_OCTET_STRING.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ static void PrimitiveType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_OCTET_STRING.free_struct; td->print_struct = asn_DEF_OCTET_STRING.print_struct; td->ber_decoder = asn_DEF_OCTET_STRING.ber_decoder; td->der_encoder = asn_DEF_OCTET_STRING.der_encoder; td->xer_decoder = asn_DEF_OCTET_STRING.xer_decoder; td->xer_encoder = asn_DEF_OCTET_STRING.xer_encoder; td->uper_decoder = asn_DEF_OCTET_STRING.uper_decoder; td->uper_encoder = asn_DEF_OCTET_STRING.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_OCTET_STRING.per_constraints; td->elements = asn_DEF_OCTET_STRING.elements; td->elements_count = asn_DEF_OCTET_STRING.elements_count; td->specifics = asn_DEF_OCTET_STRING.specifics; } void PrimitiveType_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { PrimitiveType_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int PrimitiveType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { PrimitiveType_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t PrimitiveType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { PrimitiveType_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t PrimitiveType_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { PrimitiveType_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t PrimitiveType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { PrimitiveType_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t PrimitiveType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { PrimitiveType_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [PrimitiveType] >>> ***/ static ber_tlv_tag_t asn_DEF_PrimitiveType_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_PrimitiveType = { "PrimitiveType", "PrimitiveType", PrimitiveType_free, PrimitiveType_print, PrimitiveType_constraint, PrimitiveType_decode_ber, PrimitiveType_encode_der, PrimitiveType_decode_xer, PrimitiveType_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_PrimitiveType_tags_1, sizeof(asn_DEF_PrimitiveType_tags_1) /sizeof(asn_DEF_PrimitiveType_tags_1[0]), /* 1 */ asn_DEF_PrimitiveType_tags_1, /* Same as above */ sizeof(asn_DEF_PrimitiveType_tags_1) /sizeof(asn_DEF_PrimitiveType_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [ConstructedType] >>> ***/ #include "PrimitiveType.h" #include /*** <<< TYPE-DECLS [ConstructedType] >>> ***/ typedef struct ConstructedType { PrimitiveType_t field; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ConstructedType_t; /*** <<< FUNC-DECLS [ConstructedType] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_ConstructedType; /*** <<< STAT-DEFS [ConstructedType] >>> ***/ static asn_TYPE_member_t asn_MBR_ConstructedType_1[] = { { ATF_NOFLAGS, 0, offsetof(struct ConstructedType, field), .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_PrimitiveType, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "field" }, }; static ber_tlv_tag_t asn_DEF_ConstructedType_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ConstructedType_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 0, 0, 0 } /* field at 18 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ConstructedType_specs_1 = { sizeof(struct ConstructedType), offsetof(struct ConstructedType, _asn_ctx), asn_MAP_ConstructedType_tag2el_1, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_ConstructedType = { "ConstructedType", "ConstructedType", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ConstructedType_tags_1, sizeof(asn_DEF_ConstructedType_tags_1) /sizeof(asn_DEF_ConstructedType_tags_1[0]), /* 1 */ asn_DEF_ConstructedType_tags_1, /* Same as above */ sizeof(asn_DEF_ConstructedType_tags_1) /sizeof(asn_DEF_ConstructedType_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ConstructedType_1, 1, /* Elements count */ &asn_SPC_ConstructedType_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [T] >>> ***/ #include "ConstructedType.h" /*** <<< TYPE-DECLS [T] >>> ***/ typedef ConstructedType_t T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; asn_struct_free_f T_free; asn_struct_print_f T_print; asn_constr_check_f T_constraint; ber_type_decoder_f T_decode_ber; der_type_encoder_f T_encode_der; xer_type_decoder_f T_decode_xer; xer_type_encoder_f T_encode_xer; /*** <<< CODE [T] >>> ***/ int T_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ConstructedType.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ConstructedType, * so here we adjust the DEF accordingly. */ static void T_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ConstructedType.free_struct; td->print_struct = asn_DEF_ConstructedType.print_struct; td->ber_decoder = asn_DEF_ConstructedType.ber_decoder; td->der_encoder = asn_DEF_ConstructedType.der_encoder; td->xer_decoder = asn_DEF_ConstructedType.xer_decoder; td->xer_encoder = asn_DEF_ConstructedType.xer_encoder; td->uper_decoder = asn_DEF_ConstructedType.uper_decoder; td->uper_encoder = asn_DEF_ConstructedType.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ConstructedType.per_constraints; td->elements = asn_DEF_ConstructedType.elements; td->elements_count = asn_DEF_ConstructedType.elements_count; td->specifics = asn_DEF_ConstructedType.specifics; } void T_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T] >>> ***/ static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", T_free, T_print, T_constraint, T_decode_ber, T_encode_der, T_decode_xer, T_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]) - 1, /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/82-with-comps-OK.asn1.-EF0000644000000000000000000000055711461146446017372 0ustar rootrootModuleTestWithComponents { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 82 } DEFINITIONS ::= BEGIN BunchOfStrings ::= SEQUENCE OF VisibleString Address ::= BunchOfStrings (SIZE(1..6))(WITH COMPONENT (SIZE(1..32))) Type ::= SEQUENCE { one INTEGER DEFAULT 1 } (WITH COMPONENTS { ..., one (1) PRESENT }) END asn1c-0.9.24+dfsg/tests/81-type-default-OK.asn10000644000000000000000000000060211461147103017312 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .81 ModuleTestTypeDefault1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 81 } DEFINITIONS ::= BEGIN Type ::= SEQUENCE { other SEQUENCE { member-1 INTEGER } DEFAULT { member-1 5 } } END asn1c-0.9.24+dfsg/tests/README0000644000000000000000000000146711461150505014260 0ustar rootroot This is a collection of various little ASN.1 modules, used independently by several different testing engines below the main tree (i.e. libasn1fix) for stressing various aspects of compiler operation. The files follow certain naming conventions: Source file: --{OK|SE|NP}.asn1 Regenerator test file: --{OK|SE|NP}.asn1.[] Where is arbitrary number (digits) is arbitrary string, without dots OK file syntax and semantics are absolutely correct SE file semantics is wrong SW file semantics is suspicious (warning) NP file syntax is incorrect, file not parseable command-line flags for compiler Example: 07-int-OK.asn1 # Correct ASN.1 file 07-int-OK.asn1.-EF # Test of file regeneration with -E -F flags. asn1c-0.9.24+dfsg/tests/08-int-SE.asn10000644000000000000000000000056311461150505015504 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .8 ModuleTestInt2 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 8 } DEFINITIONS ::= BEGIN Reason ::= INTEGER { value1(0), value1(2) -- identifiers must be distinct -- } END asn1c-0.9.24+dfsg/tests/84-param-tags-OK.asn1.-EF0000644000000000000000000000131411461146446017326 0ustar rootrootModuleTestParameterizationTags1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 84 1 } DEFINITIONS ::= BEGIN TestType{Parameter} ::= SEQUENCE { common Parameter DEFAULT 0 } TestChoice ::= CHOICE { type1 TestType{ INTEGER (1..10)}, type2 [0] IMPLICIT TestType{ BOOLEAN} } END ModuleTestParameterizationTagsAuto2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 84 2 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN AutoType{Parameter} ::= SEQUENCE { common Parameter (0) } AutoChoice ::= CHOICE { type1 [0] IMPLICIT AutoType{ INTEGER (0..1)}, type2 [1] IMPLICIT AutoType{ BOOLEAN} } END asn1c-0.9.24+dfsg/tests/17-tags-OK.asn10000644000000000000000000000067111461147103015652 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .17 ModuleTestTags { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 17 } DEFINITIONS ::= BEGIN T3 ::= [3] IMPLICIT T2 T1 ::= [1] INTEGER T2 ::= [2] EXPLICIT T1 T4 ::= [APPLICATION 1] SET { t1 [4] IMPLICIT T1, t2 [5] T2, t3 [6] T3 } END asn1c-0.9.24+dfsg/tests/110-param-3-OK.asn10000644000000000000000000000075111461147103016225 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .110 ModuleParameterization3 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 110 } DEFINITIONS ::= BEGIN Flag{Color} ::= SEQUENCE { field Color DEFAULT blue } IntegerColorFlag ::= Flag{INTEGER{ red(0), green(1), blue(5) }} EnumeratedColorFlag ::= Flag{ENUMERATED{ red(3), green, blue }} END asn1c-0.9.24+dfsg/tests/92-circular-loops-OK.asn10000644000000000000000000000264111461147103017654 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .92 ModuleCircularReferences { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 92 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN Everything ::= SEQUENCE { ch1 Choice1, ch2 Choice2, ch3 Choice3, set Set, a Alpha, b Beta, g Gamma, ot OneTwo, tt TwoThree, to ThreeOne } -- This type refers to the type directly containing itself. Choice1 ::= CHOICE { something Everything, ..., some2 Everything } Choice2 ::= CHOICE { typeref TypeRef, ..., some3 Everything } Choice3 ::= CHOICE { a SEQUENCE { aa Everything }, b Everything, c SEQUENCE OF Choice3 } Set ::= SET OF SEQUENCE { int INTEGER, set Set, seq Sequence, set2 Set OPTIONAL, ..., set3 Set } Sequence ::= SEQUENCE { a INTEGER, seq Sequence OPTIONAL, ..., b INTEGER, set Set OPTIONAL } TypeRef ::= Sequence Alpha ::= SEQUENCE { a Beta, b SEQUENCE { b Beta OPTIONAL } } Beta ::= SEQUENCE { b Alpha OPTIONAL, g Gamma OPTIONAL } Gamma ::= SEQUENCE { o TwoThree, a Alpha, -- expected inline b Beta -- expected inline } -- This is a true superdependency. OneTwo ::= SET { m12 TwoThree } TwoThree ::= SET { m23 ThreeOne } ThreeOne ::= SET { m31 OneTwo, g Gamma } END asn1c-0.9.24+dfsg/tests/129-enum-SE.asn10000644000000000000000000000050712015121740015733 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .129 ModuleTestEnum1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 129 } DEFINITIONS ::= BEGIN A ::= ENUMERATED {a, b, ..., c, d(2)} END asn1c-0.9.24+dfsg/tests/126-per-extensions-OK.asn1.-Pgen-PER0000644000000000000000000002253311461146446021363 0ustar rootroot /*** <<< INCLUDES [PDU] >>> ***/ #include #include "Singleton.h" #include /*** <<< FWD-DECLS [PDU] >>> ***/ struct PDU_2; struct Singleton; /*** <<< TYPE-DECLS [PDU] >>> ***/ typedef struct PDU { /* * This type is extensible, * possible extensions are below. */ IA5String_t *str_o /* OPTIONAL */; IA5String_t *str_m; struct Singleton *singl; struct PDU_2 *pdu_2 /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } PDU_t; /*** <<< FUNC-DECLS [PDU] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_PDU; /*** <<< POST-INCLUDE [PDU] >>> ***/ #include "PDU-2.h" /*** <<< STAT-DEFS [PDU] >>> ***/ static asn_TYPE_member_t asn_MBR_PDU_1[] = { { ATF_POINTER, 4, offsetof(struct PDU, str_o), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_IA5String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "str-o" }, { ATF_POINTER, 3, offsetof(struct PDU, str_m), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_IA5String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "str-m" }, { ATF_POINTER, 2, offsetof(struct PDU, singl), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Singleton, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "singl" }, { ATF_POINTER, 1, offsetof(struct PDU, pdu_2), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_PDU_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "pdu-2" }, }; static int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3 }; static ber_tlv_tag_t asn_DEF_PDU_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* str-o at 16 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* str-m at 17 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* singl at 18 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* pdu-2 at 19 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PDU_specs_1 = { sizeof(struct PDU), offsetof(struct PDU, _asn_ctx), asn_MAP_PDU_tag2el_1, 4, /* Count of tags in the map */ asn_MAP_PDU_oms_1, /* Optional members */ 0, 4, /* Root/Additions */ -1, /* Start extensions */ 5 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_PDU = { "PDU", "PDU", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_PDU_tags_1, sizeof(asn_DEF_PDU_tags_1) /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */ asn_DEF_PDU_tags_1, /* Same as above */ sizeof(asn_DEF_PDU_tags_1) /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_PDU_1, 4, /* Elements count */ &asn_SPC_PDU_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Singleton] >>> ***/ #include #include /*** <<< TYPE-DECLS [Singleton] >>> ***/ typedef struct Singleton { IA5String_t *opt_z /* DEFAULT z */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Singleton_t; /*** <<< FUNC-DECLS [Singleton] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Singleton; /*** <<< STAT-DEFS [Singleton] >>> ***/ static int asn_DFL_2_set(int set_value, void **sptr) { static uint8_t defv[] = "z"; IA5String_t *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { uint8_t *ptr = MALLOC(sizeof(defv)); if(!ptr) return -1; memcpy(ptr, &defv, sizeof(defv)); FREEMEM(st->buf); st->buf = ptr; st->size = sizeof(defv) - 1; return 0; } else { if(st->size != (sizeof(defv) - 1) || memcmp(st->buf, &defv, sizeof(defv) - 1)) return 0; return 1; } } static asn_TYPE_member_t asn_MBR_Singleton_1[] = { { ATF_POINTER, 1, offsetof(struct Singleton, opt_z), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_IA5String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = asn_DFL_2_set, /* DEFAULT "z" */ .name = "opt-z" }, }; static int asn_MAP_Singleton_oms_1[] = { 0 }; static ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z at 23 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = { sizeof(struct Singleton), offsetof(struct Singleton, _asn_ctx), asn_MAP_Singleton_tag2el_1, 1, /* Count of tags in the map */ asn_MAP_Singleton_oms_1, /* Optional members */ 1, 0, /* Root/Additions */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Singleton = { "Singleton", "Singleton", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Singleton_tags_1, sizeof(asn_DEF_Singleton_tags_1) /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */ asn_DEF_Singleton_tags_1, /* Same as above */ sizeof(asn_DEF_Singleton_tags_1) /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Singleton_1, 1, /* Elements count */ &asn_SPC_Singleton_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [PDU-2] >>> ***/ #include #include /*** <<< DEPS [PDU-2] >>> ***/ typedef enum PDU_2_PR { PDU_2_PR_NOTHING, /* No components present */ PDU_2_PR_main, /* Extensions may appear below */ PDU_2_PR_ext1, PDU_2_PR_ext0 } PDU_2_PR; /*** <<< TYPE-DECLS [PDU-2] >>> ***/ typedef struct PDU_2 { PDU_2_PR present; union PDU_2_u { INTEGER_t main; /* * This type is extensible, * possible extensions are below. */ INTEGER_t ext1; INTEGER_t ext0; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } PDU_2_t; /*** <<< FUNC-DECLS [PDU-2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_PDU_2; /*** <<< CTDEFS [PDU-2] >>> ***/ static asn_per_constraints_t asn_PER_type_PDU_2_constr_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [PDU-2] >>> ***/ static asn_TYPE_member_t asn_MBR_PDU_2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "main" }, { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "ext1" }, { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "ext0" }, }; static int asn_MAP_PDU_2_cmap_1[] = { 0, 2, 1 }; static asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 at 31 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 at 29 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main at 27 */ }; static asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = { sizeof(struct PDU_2), offsetof(struct PDU_2, _asn_ctx), offsetof(struct PDU_2, present), sizeof(((struct PDU_2 *)0)->present), asn_MAP_PDU_2_tag2el_1, 3, /* Count of tags in the map */ .canonical_order = asn_MAP_PDU_2_cmap_1, /* Canonically sorted */ .ext_start = 1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_PDU_2 = { "PDU-2", "PDU-2", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, CHOICE_decode_uper, CHOICE_encode_uper, CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ &asn_PER_type_PDU_2_constr_1, asn_MBR_PDU_2_1, 3, /* Elements count */ &asn_SPC_PDU_2_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/22-tags-OK.asn1.-P0000644000000000000000000001140711461146446016131 0ustar rootroot /*** <<< INCLUDES [T1] >>> ***/ #include #include #include #include #include /*** <<< DEPS [T1] >>> ***/ typedef enum b_PR { b_PR_NOTHING, /* No components present */ b_PR_i, b_PR_n } b_PR; /*** <<< TYPE-DECLS [T1] >>> ***/ typedef struct T1 { INTEGER_t a; struct b { b_PR present; union T1__b_u { INTEGER_t i; IA5String_t n; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } b; UTF8String_t c; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T1_t; /*** <<< FUNC-DECLS [T1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T1; /*** <<< STAT-DEFS [T1] >>> ***/ static asn_TYPE_member_t asn_MBR_b_3[] = { { ATF_NOFLAGS, 0, offsetof(struct b, choice.i), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "i" }, { ATF_NOFLAGS, 0, offsetof(struct b, choice.n), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_IA5String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "n" }, }; static asn_TYPE_tag2member_t asn_MAP_b_tag2el_3[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* i at 17 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* n at 18 */ }; static asn_CHOICE_specifics_t asn_SPC_b_specs_3 = { sizeof(struct b), offsetof(struct b, _asn_ctx), offsetof(struct b, present), sizeof(((struct b *)0)->present), asn_MAP_b_tag2el_3, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_b_3 = { "b", "b", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_b_3, 2, /* Elements count */ &asn_SPC_b_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_T1_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T1, a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct T1, b), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_b_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, { ATF_NOFLAGS, 0, offsetof(struct T1, c), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UTF8String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c" }, }; static ber_tlv_tag_t asn_DEF_T1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T1_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 15 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* b at 17 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* c at 20 */ }; static asn_SEQUENCE_specifics_t asn_SPC_T1_specs_1 = { sizeof(struct T1), offsetof(struct T1, _asn_ctx), asn_MAP_T1_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_T1 = { "T1", "T1", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T1_tags_1, sizeof(asn_DEF_T1_tags_1) /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */ asn_DEF_T1_tags_1, /* Same as above */ sizeof(asn_DEF_T1_tags_1) /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T1_1, 3, /* Elements count */ &asn_SPC_T1_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/112-param-class-OK.asn1.-EF0000644000000000000000000000075511461146446017555 0ustar rootrootModuleParameterizationClass { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 112 } DEFINITIONS ::= BEGIN PCLASS{Type, INTEGER:value, INTEGER:ValueSet} ::= CLASS { &valueField1 Type, &valueField2 INTEGER DEFAULT value, &valueField3 INTEGER (ValueSet), &ValueSetField INTEGER DEFAULT {ValueSet} } WITH SYNTAX { &valueField1, &valueField2, &valueField3, &ValueSetField } SCLASS ::= PCLASS{ REAL, 111, {1 | 2 | 3}} END asn1c-0.9.24+dfsg/tests/77-str-default-OK.asn10000644000000000000000000000110011461147103017140 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .77 ModuleTestStringDefault1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 77 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN Type ::= SEQUENCE { cntry PRString DEFAULT country1, cntry1 PrintableString DEFAULT country1, cntry2 UniversalString DEFAULT country2, ... } country1 PrintableString ::= "Rwanda" country2 PRString ::= "United Kingdom" PRString ::= PrintableString END asn1c-0.9.24+dfsg/tests/27-set-SE.asn10000644000000000000000000000066611461147103015512 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .27 ModuleTestSetTagsDistinct { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 27 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= SET { a INTEGER, b CHOICE { -- Could we lookup tag past CHOICE?.. c INTEGER -- Tags must be distinct here. } } END asn1c-0.9.24+dfsg/tests/91-cond-int-blessSize-OK.asn1.-Pfbless-SIZE0000644000000000000000000005273711461146446022637 0ustar rootroot /*** <<< INCLUDES [OK-Integer1] >>> ***/ #include /*** <<< TYPE-DECLS [OK-Integer1] >>> ***/ typedef long OK_Integer1_t; /*** <<< FUNC-DECLS [OK-Integer1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_Integer1; asn_struct_free_f OK_Integer1_free; asn_struct_print_f OK_Integer1_print; asn_constr_check_f OK_Integer1_constraint; ber_type_decoder_f OK_Integer1_decode_ber; der_type_encoder_f OK_Integer1_encode_der; xer_type_decoder_f OK_Integer1_decode_xer; xer_type_encoder_f OK_Integer1_encode_xer; /*** <<< CODE [OK-Integer1] >>> ***/ int OK_Integer1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_Integer1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_Integer1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_Integer1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_Integer1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_Integer1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_Integer1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_Integer1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_Integer1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_Integer1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_Integer1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-Integer1] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_Integer1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_Integer1 = { "OK-Integer1", "OK-Integer1", OK_Integer1_free, OK_Integer1_print, OK_Integer1_constraint, OK_Integer1_decode_ber, OK_Integer1_encode_der, OK_Integer1_decode_xer, OK_Integer1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_Integer1_tags_1, sizeof(asn_DEF_OK_Integer1_tags_1) /sizeof(asn_DEF_OK_Integer1_tags_1[0]), /* 1 */ asn_DEF_OK_Integer1_tags_1, /* Same as above */ sizeof(asn_DEF_OK_Integer1_tags_1) /sizeof(asn_DEF_OK_Integer1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-Integer2] >>> ***/ #include /*** <<< TYPE-DECLS [OK-Integer2] >>> ***/ typedef long OK_Integer2_t; /*** <<< FUNC-DECLS [OK-Integer2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_Integer2; asn_struct_free_f OK_Integer2_free; asn_struct_print_f OK_Integer2_print; asn_constr_check_f OK_Integer2_constraint; ber_type_decoder_f OK_Integer2_decode_ber; der_type_encoder_f OK_Integer2_encode_der; xer_type_decoder_f OK_Integer2_decode_xer; xer_type_encoder_f OK_Integer2_encode_xer; /*** <<< CODE [OK-Integer2] >>> ***/ int OK_Integer2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_Integer2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_Integer2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_Integer2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_Integer2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_Integer2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_Integer2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_Integer2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_Integer2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_Integer2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_Integer2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-Integer2] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_Integer2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_Integer2 = { "OK-Integer2", "OK-Integer2", OK_Integer2_free, OK_Integer2_print, OK_Integer2_constraint, OK_Integer2_decode_ber, OK_Integer2_encode_der, OK_Integer2_decode_xer, OK_Integer2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_Integer2_tags_1, sizeof(asn_DEF_OK_Integer2_tags_1) /sizeof(asn_DEF_OK_Integer2_tags_1[0]), /* 1 */ asn_DEF_OK_Integer2_tags_1, /* Same as above */ sizeof(asn_DEF_OK_Integer2_tags_1) /sizeof(asn_DEF_OK_Integer2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-Integer3] >>> ***/ #include /*** <<< TYPE-DECLS [OK-Integer3] >>> ***/ typedef long OK_Integer3_t; /*** <<< FUNC-DECLS [OK-Integer3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_Integer3; asn_struct_free_f OK_Integer3_free; asn_struct_print_f OK_Integer3_print; asn_constr_check_f OK_Integer3_constraint; ber_type_decoder_f OK_Integer3_decode_ber; der_type_encoder_f OK_Integer3_encode_der; xer_type_decoder_f OK_Integer3_decode_xer; xer_type_encoder_f OK_Integer3_encode_xer; /*** <<< CODE [OK-Integer3] >>> ***/ int OK_Integer3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_Integer3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_Integer3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_Integer3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_Integer3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_Integer3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_Integer3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_Integer3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_Integer3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_Integer3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_Integer3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-Integer3] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_Integer3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_Integer3 = { "OK-Integer3", "OK-Integer3", OK_Integer3_free, OK_Integer3_print, OK_Integer3_constraint, OK_Integer3_decode_ber, OK_Integer3_encode_der, OK_Integer3_decode_xer, OK_Integer3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_Integer3_tags_1, sizeof(asn_DEF_OK_Integer3_tags_1) /sizeof(asn_DEF_OK_Integer3_tags_1[0]), /* 1 */ asn_DEF_OK_Integer3_tags_1, /* Same as above */ sizeof(asn_DEF_OK_Integer3_tags_1) /sizeof(asn_DEF_OK_Integer3_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-Integer4] >>> ***/ #include /*** <<< TYPE-DECLS [OK-Integer4] >>> ***/ typedef long OK_Integer4_t; /*** <<< FUNC-DECLS [OK-Integer4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_Integer4; asn_struct_free_f OK_Integer4_free; asn_struct_print_f OK_Integer4_print; asn_constr_check_f OK_Integer4_constraint; ber_type_decoder_f OK_Integer4_decode_ber; der_type_encoder_f OK_Integer4_encode_der; xer_type_decoder_f OK_Integer4_decode_xer; xer_type_encoder_f OK_Integer4_encode_xer; /*** <<< CODE [OK-Integer4] >>> ***/ int OK_Integer4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_Integer4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_Integer4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_Integer4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_Integer4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_Integer4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_Integer4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_Integer4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_Integer4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_Integer4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_Integer4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_Integer4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-Integer4] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_Integer4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_Integer4 = { "OK-Integer4", "OK-Integer4", OK_Integer4_free, OK_Integer4_print, OK_Integer4_constraint, OK_Integer4_decode_ber, OK_Integer4_encode_der, OK_Integer4_decode_xer, OK_Integer4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_Integer4_tags_1, sizeof(asn_DEF_OK_Integer4_tags_1) /sizeof(asn_DEF_OK_Integer4_tags_1[0]), /* 1 */ asn_DEF_OK_Integer4_tags_1, /* Same as above */ sizeof(asn_DEF_OK_Integer4_tags_1) /sizeof(asn_DEF_OK_Integer4_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-Integer5] >>> ***/ #include /*** <<< TYPE-DECLS [NO-Integer5] >>> ***/ typedef INTEGER_t NO_Integer5_t; /*** <<< FUNC-DECLS [NO-Integer5] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_Integer5; asn_struct_free_f NO_Integer5_free; asn_struct_print_f NO_Integer5_print; asn_constr_check_f NO_Integer5_constraint; ber_type_decoder_f NO_Integer5_decode_ber; der_type_encoder_f NO_Integer5_encode_der; xer_type_decoder_f NO_Integer5_decode_xer; xer_type_encoder_f NO_Integer5_encode_xer; /*** <<< CODE [NO-Integer5] >>> ***/ int NO_Integer5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_Integer5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_Integer5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_Integer5_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_Integer5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_Integer5_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_Integer5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_Integer5_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_Integer5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_Integer5_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_Integer5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_Integer5_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_Integer5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_Integer5_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-Integer5] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_Integer5_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_Integer5 = { "NO-Integer5", "NO-Integer5", NO_Integer5_free, NO_Integer5_print, NO_Integer5_constraint, NO_Integer5_decode_ber, NO_Integer5_encode_der, NO_Integer5_decode_xer, NO_Integer5_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_Integer5_tags_1, sizeof(asn_DEF_NO_Integer5_tags_1) /sizeof(asn_DEF_NO_Integer5_tags_1[0]), /* 1 */ asn_DEF_NO_Integer5_tags_1, /* Same as above */ sizeof(asn_DEF_NO_Integer5_tags_1) /sizeof(asn_DEF_NO_Integer5_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/30-set-OK.asn10000644000000000000000000000060611461150505015500 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .30 ModuleTestSetSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 30 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= SET { i [APPLICATION 3] INTEGER, s IA5String, ..., b [2] BOOLEAN } END asn1c-0.9.24+dfsg/tests/64-oid-constr-OK.asn10000644000000000000000000000061311461147103016773 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .64 ModuleTestOIDConstraint { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 64 } DEFINITIONS ::= BEGIN void OBJECT IDENTIFIER ::= { v 1 3 6 1 4 1 9363 1 5 1 64 1 1 } Id ::= OBJECT IDENTIFIER (void) END asn1c-0.9.24+dfsg/tests/123-valueassignment-OK.asn10000644000000000000000000000055111461147103020174 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .123 ModuleValueAssignmentConstrained { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 123 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN zzz OCTET STRING (SIZE(1)) ::= '1'H END asn1c-0.9.24+dfsg/tests/66-ref-simple-OK.asn10000644000000000000000000000062711461147103016764 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .66 ModuleTestReferenceToNamedSimpleType { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 66 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= SET OF named SimpleType SimpleType ::= ENUMERATED { one, two, three } END asn1c-0.9.24+dfsg/tests/79-constrained-by-OK.asn10000644000000000000000000000057111461147103017644 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .79 ModuleTestConstrainedBy { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 79 } DEFINITIONS ::= BEGIN Type ::= SEQUENCE { int INTEGER, ... } (CONSTRAINED BY { -- nothing -- }) END asn1c-0.9.24+dfsg/tests/65-multi-tag-OK.asn10000644000000000000000000000113211461147103016613 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .65 ModuleTestMultipleTags { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 65 } DEFINITIONS ::= BEGIN T1 ::= [2] EXPLICIT T2 T2 ::= [3] EXPLICIT T3 T3 ::= [4] IMPLICIT T4 T4 ::= [5] EXPLICIT T5 T5 ::= [6] IMPLICIT T6 T6 ::= REAL T ::= [0] IMPLICIT Ts Ts ::= [123] IMPLICIT SEQUENCE { m1 [1] IMPLICIT T2, -- [1][4][6] m2 [2] EXPLICIT T3 OPTIONAL, -- [2][4][6] m3 [3] IMPLICIT T3 -- [3][6] } END asn1c-0.9.24+dfsg/tests/54-constraint-SE.asn10000644000000000000000000000065711461147103017103 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .54 ModuleInvalidConstraintApplicability1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 54 } DEFINITIONS ::= BEGIN StrFine ::= NumericString (FROM(" ".."9")) -- That's fine StrBad ::= NumericString (FROM("0".."9" | "#")) -- That's bad END asn1c-0.9.24+dfsg/tests/04-enum-SE.asn1.-E0000644000000000000000000000035411461146446016121 0ustar rootrootModuleTestEnum2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 4 } DEFINITIONS ::= BEGIN enum1 Enum1 ::= blue Enum1 ::= ENUMERATED { red, green, ..., blue(1) } END asn1c-0.9.24+dfsg/tests/43-recursion-OK.asn10000644000000000000000000000131011461150505016713 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .43 ModuleRecursion { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 43 } DEFINITIONS ::= BEGIN Test-structure-1 ::= SEQUENCE { t-member1 SET OF Test-structure-1, t-member2 SEQUENCE OF Test-structure-1, t-member3 Test-structure-1 OPTIONAL, t-member4 INTEGER } Choice-1 ::= CHOICE { and [1] Choice-1, or [2] IMPLICIT SET OF Choice-1, not [3] Choice-1, other [4] INTEGER } Test-structure-2 ::= SET { m1 Test-structure-3 OPTIONAL } Test-structure-3 ::= SET { m1 Test-structure-2 OPTIONAL } END asn1c-0.9.24+dfsg/tests/117-real-constraint-OK.asn10000644000000000000000000000050511461147103020076 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .117 ModuleRealConstraint { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 117 } DEFINITIONS ::= BEGIN R ::= REAL (0..3.14159265) END asn1c-0.9.24+dfsg/tests/71-duplicate-types-SE.asn10000644000000000000000000000103411461147103020020 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .71 1 -- .71 2 ModuleDuplicateTypes1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 71 1 } DEFINITIONS ::= BEGIN Type ::= INTEGER -- Original type. END ModuleDuplicateTypes2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 71 2 } DEFINITIONS ::= BEGIN Type ::= INTEGER -- A duplicate type. END asn1c-0.9.24+dfsg/tests/86-atags-OK.asn1.-EF0000644000000000000000000000067111461146446016400 0ustar rootrootModuleAutoTags { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 86 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN A ::= SEQUENCE { a [0] IMPLICIT INTEGER } B ::= SEQUENCE { a [0] IMPLICIT INTEGER } C ::= SEQUENCE { a [0] IMPLICIT INTEGER } D ::= SEQUENCE { a [0] EXPLICIT INTEGER } E ::= SEQUENCE { a [0] EXPLICIT CHOICE { b [0] IMPLICIT INTEGER } } END asn1c-0.9.24+dfsg/tests/72-same-names-OK.asn1.-P0000644000000000000000000005332311461146446017231 0ustar rootroot /*** <<< INCLUDES [Type] >>> ***/ #include #include "Type1.h" #include "Type2.h" #include #include /*** <<< TYPE-DECLS [Type] >>> ***/ typedef struct Type { A_SET_OF(struct Member { Type1_t t1; Type2_t t2; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Type_t; /*** <<< FUNC-DECLS [Type] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Type; /*** <<< STAT-DEFS [Type] >>> ***/ static asn_TYPE_member_t asn_MBR_Member_2[] = { { ATF_NOFLAGS, 0, offsetof(struct Member, t1), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Type1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "t1" }, { ATF_NOFLAGS, 0, offsetof(struct Member, t2), .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_Type2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "t2" }, }; static ber_tlv_tag_t asn_DEF_Member_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Member_tag2el_2[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* t1 at 21 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 }, /* one-name at 37 */ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* two-name at 43 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_2 = { sizeof(struct Member), offsetof(struct Member, _asn_ctx), asn_MAP_Member_tag2el_2, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_Member_2 = { "SEQUENCE", "SEQUENCE", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Member_tags_2, sizeof(asn_DEF_Member_tags_2) /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */ asn_DEF_Member_tags_2, /* Same as above */ sizeof(asn_DEF_Member_tags_2) /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Member_2, 2, /* Elements count */ &asn_SPC_Member_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Type_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Member_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_Type_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_Type_specs_1 = { sizeof(struct Type), offsetof(struct Type, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_Type = { "Type", "Type", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Type_tags_1, sizeof(asn_DEF_Type_tags_1) /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */ asn_DEF_Type_tags_1, /* Same as above */ sizeof(asn_DEF_Type_tags_1) /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Type_1, 1, /* Single element */ &asn_SPC_Type_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Type1] >>> ***/ #include #include #include /*** <<< DEPS [Type1] >>> ***/ typedef enum one_name_PR { one_name_PR_NOTHING, /* No components present */ one_name_PR_another_name } one_name_PR; /*** <<< TYPE-DECLS [Type1] >>> ***/ typedef struct Type1 { struct one_name { one_name_PR present; union Type1__one_name_u { struct another_name { INTEGER_t a; INTEGER_t b; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } another_name; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } one_name; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Type1_t; /*** <<< FUNC-DECLS [Type1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Type1; /*** <<< STAT-DEFS [Type1] >>> ***/ static asn_TYPE_member_t asn_MBR_another_name_3[] = { { ATF_NOFLAGS, 0, offsetof(struct another_name, a), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct another_name, b), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_another_name_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_3[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* a at 27 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* b at 27 */ }; static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_3 = { sizeof(struct another_name), offsetof(struct another_name, _asn_ctx), asn_MAP_another_name_tag2el_3, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_another_name_3 = { "another-name", "another-name", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_another_name_tags_3, sizeof(asn_DEF_another_name_tags_3) /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */ asn_DEF_another_name_tags_3, /* Same as above */ sizeof(asn_DEF_another_name_tags_3) /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_another_name_3, 2, /* Elements count */ &asn_SPC_another_name_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_one_name_2[] = { { ATF_NOFLAGS, 0, offsetof(struct one_name, choice.another_name), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_another_name_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "another-name" }, }; static asn_TYPE_tag2member_t asn_MAP_one_name_tag2el_2[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name at 27 */ }; static asn_CHOICE_specifics_t asn_SPC_one_name_specs_2 = { sizeof(struct one_name), offsetof(struct one_name, _asn_ctx), offsetof(struct one_name, present), sizeof(((struct one_name *)0)->present), asn_MAP_one_name_tag2el_2, 1, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_one_name_2 = { "one-name", "one-name", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_one_name_2, 1, /* Elements count */ &asn_SPC_one_name_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Type1_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Type1, one_name), .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_one_name_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "one-name" }, }; static ber_tlv_tag_t asn_DEF_Type1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Type1_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name at 27 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Type1_specs_1 = { sizeof(struct Type1), offsetof(struct Type1, _asn_ctx), asn_MAP_Type1_tag2el_1, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Type1 = { "Type1", "Type1", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Type1_tags_1, sizeof(asn_DEF_Type1_tags_1) /sizeof(asn_DEF_Type1_tags_1[0]), /* 1 */ asn_DEF_Type1_tags_1, /* Same as above */ sizeof(asn_DEF_Type1_tags_1) /sizeof(asn_DEF_Type1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Type1_1, 1, /* Elements count */ &asn_SPC_Type1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Type2] >>> ***/ #include #include #include #include #include /*** <<< DEPS [Type2] >>> ***/ typedef enum Type2_PR { Type2_PR_NOTHING, /* No components present */ Type2_PR_one_name, Type2_PR_two_name } Type2_PR; typedef enum a { a_one = 0 } e_a; /* * Method of determining the components presence */ typedef enum two_name_PR { two_name_PR_another_name, /* Member another_name is present */ } two_name_PR; typedef enum a { a_one = 0 } e_a; /*** <<< TYPE-DECLS [Type2] >>> ***/ typedef struct Type2 { Type2_PR present; union Type2_u { struct one_name { struct another_name { BIT_STRING_t a; INTEGER_t b; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } another_name; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } one_name; struct two_name { struct another_name { BIT_STRING_t a; INTEGER_t b; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } another_name; /* Presence bitmask: ASN_SET_ISPRESENT(ptwo_name, two_name_PR_x) */ unsigned int _presence_map [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } two_name; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Type2_t; /*** <<< FUNC-DECLS [Type2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Type2; /*** <<< CODE [Type2] >>> ***/ static int memb_a_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(st->size > 0) { /* Size in bits */ size = 8 * st->size - (st->bits_unused & 0x07); } else { size = 0; } if((size == 2)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_a_constraint_8(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(st->size > 0) { /* Size in bits */ size = 8 * st->size - (st->bits_unused & 0x07); } else { size = 0; } if((size == 2)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [Type2] >>> ***/ static asn_TYPE_member_t asn_MBR_another_name_3[] = { { ATF_NOFLAGS, 0, offsetof(struct another_name, a), .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), .tag_mode = 0, .type = &asn_DEF_BIT_STRING, .memb_constraints = memb_a_constraint_3, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct another_name, b), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_another_name_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_3[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* b at 36 */ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* a at 34 */ }; static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_3 = { sizeof(struct another_name), offsetof(struct another_name, _asn_ctx), asn_MAP_another_name_tag2el_3, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_another_name_3 = { "another-name", "another-name", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_another_name_tags_3, sizeof(asn_DEF_another_name_tags_3) /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */ asn_DEF_another_name_tags_3, /* Same as above */ sizeof(asn_DEF_another_name_tags_3) /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_another_name_3, 2, /* Elements count */ &asn_SPC_another_name_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_one_name_2[] = { { ATF_NOFLAGS, 0, offsetof(struct one_name, another_name), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_another_name_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "another-name" }, }; static ber_tlv_tag_t asn_DEF_one_name_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_one_name_tag2el_2[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name at 34 */ }; static asn_SEQUENCE_specifics_t asn_SPC_one_name_specs_2 = { sizeof(struct one_name), offsetof(struct one_name, _asn_ctx), asn_MAP_one_name_tag2el_2, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_one_name_2 = { "one-name", "one-name", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_one_name_tags_2, sizeof(asn_DEF_one_name_tags_2) /sizeof(asn_DEF_one_name_tags_2[0]), /* 1 */ asn_DEF_one_name_tags_2, /* Same as above */ sizeof(asn_DEF_one_name_tags_2) /sizeof(asn_DEF_one_name_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_one_name_2, 1, /* Elements count */ &asn_SPC_one_name_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_another_name_8[] = { { ATF_NOFLAGS, 0, offsetof(struct another_name, a), .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), .tag_mode = 0, .type = &asn_DEF_BIT_STRING, .memb_constraints = memb_a_constraint_8, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct another_name, b), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_another_name_tags_8[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_8[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* b at 42 */ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* a at 40 */ }; static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_8 = { sizeof(struct another_name), offsetof(struct another_name, _asn_ctx), asn_MAP_another_name_tag2el_8, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_another_name_8 = { "another-name", "another-name", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_another_name_tags_8, sizeof(asn_DEF_another_name_tags_8) /sizeof(asn_DEF_another_name_tags_8[0]), /* 1 */ asn_DEF_another_name_tags_8, /* Same as above */ sizeof(asn_DEF_another_name_tags_8) /sizeof(asn_DEF_another_name_tags_8[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_another_name_8, 2, /* Elements count */ &asn_SPC_another_name_specs_8 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_two_name_7[] = { { ATF_NOFLAGS, 0, offsetof(struct two_name, another_name), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_another_name_8, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "another-name" }, }; static ber_tlv_tag_t asn_DEF_two_name_tags_7[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_two_name_tag2el_7[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name at 40 */ }; static uint8_t asn_MAP_two_name_mmap_7[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) }; static asn_SET_specifics_t asn_SPC_two_name_specs_7 = { sizeof(struct two_name), offsetof(struct two_name, _asn_ctx), offsetof(struct two_name, _presence_map), asn_MAP_two_name_tag2el_7, 1, /* Count of tags in the map */ asn_MAP_two_name_tag2el_7, /* Same as above */ 1, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_two_name_mmap_7 /* Mandatory elements map */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_two_name_7 = { "two-name", "two-name", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_two_name_tags_7, sizeof(asn_DEF_two_name_tags_7) /sizeof(asn_DEF_two_name_tags_7[0]), /* 1 */ asn_DEF_two_name_tags_7, /* Same as above */ sizeof(asn_DEF_two_name_tags_7) /sizeof(asn_DEF_two_name_tags_7[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_two_name_7, 1, /* Elements count */ &asn_SPC_two_name_specs_7 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Type2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Type2, choice.one_name), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_one_name_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "one-name" }, { ATF_NOFLAGS, 0, offsetof(struct Type2, choice.two_name), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_two_name_7, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "two-name" }, }; static asn_TYPE_tag2member_t asn_MAP_Type2_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* one-name at 37 */ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* two-name at 43 */ }; static asn_CHOICE_specifics_t asn_SPC_Type2_specs_1 = { sizeof(struct Type2), offsetof(struct Type2, _asn_ctx), offsetof(struct Type2, present), sizeof(((struct Type2 *)0)->present), asn_MAP_Type2_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Type2 = { "Type2", "Type2", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Type2_1, 2, /* Elements count */ &asn_SPC_Type2_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/125-bitstring-constraint-OK.asn10000644000000000000000000000061011461147103021154 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .125 ModuleBitStringConstraint { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 125 } DEFINITIONS ::= BEGIN T ::= BIT STRING { flag1(0), flag2(1), flag3(2) } ('000'B | '001'B | '010'B | '011'B) END asn1c-0.9.24+dfsg/tests/124-multiconstraint-OK.asn10000644000000000000000000000057411461147103020234 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .124 ModuleMultiConstraint { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 124 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN T ::= VisibleString (PATTERN "^[a-z]+$") (CONSTRAINED BY { ... }) END asn1c-0.9.24+dfsg/tests/84-param-tags-OK.asn10000644000000000000000000000151511461147103016752 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .84 1 -- .84 2 ModuleTestParameterizationTags1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 84 1 } DEFINITIONS ::= BEGIN TestType {Parameter} ::= SEQUENCE { common Parameter DEFAULT 0 } TestChoice ::= CHOICE { type1 TestType {INTEGER (1..10)}, type2 [0] IMPLICIT TestType {BOOLEAN} } END ModuleTestParameterizationTagsAuto2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 84 2 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN AutoType {Parameter} ::= SEQUENCE { common Parameter (0) } AutoChoice ::= CHOICE { type1 AutoType {INTEGER (0..1)}, type2 AutoType {BOOLEAN} } END asn1c-0.9.24+dfsg/tests/65-multi-tag-OK.asn1.-P0000644000000000000000000007066311461146446017116 0ustar rootroot /*** <<< INCLUDES [T1] >>> ***/ #include "T2.h" /*** <<< TYPE-DECLS [T1] >>> ***/ typedef T2_t T1_t; /*** <<< FUNC-DECLS [T1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T1; asn_struct_free_f T1_free; asn_struct_print_f T1_print; asn_constr_check_f T1_constraint; ber_type_decoder_f T1_decode_ber; der_type_encoder_f T1_encode_der; xer_type_decoder_f T1_decode_xer; xer_type_encoder_f T1_encode_xer; /*** <<< CODE [T1] >>> ***/ int T1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_T2.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using T2, * so here we adjust the DEF accordingly. */ static void T1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_T2.free_struct; td->print_struct = asn_DEF_T2.print_struct; td->ber_decoder = asn_DEF_T2.ber_decoder; td->der_encoder = asn_DEF_T2.der_encoder; td->xer_decoder = asn_DEF_T2.xer_decoder; td->xer_encoder = asn_DEF_T2.xer_encoder; td->uper_decoder = asn_DEF_T2.uper_decoder; td->uper_encoder = asn_DEF_T2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_T2.per_constraints; td->elements = asn_DEF_T2.elements; td->elements_count = asn_DEF_T2.elements_count; td->specifics = asn_DEF_T2.specifics; } void T1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T1] >>> ***/ static ber_tlv_tag_t asn_DEF_T1_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)) }; static ber_tlv_tag_t asn_DEF_T1_all_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (5 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T1 = { "T1", "T1", T1_free, T1_print, T1_constraint, T1_decode_ber, T1_encode_der, T1_decode_xer, T1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T1_tags_1, sizeof(asn_DEF_T1_tags_1) /sizeof(asn_DEF_T1_tags_1[0]), /* 4 */ asn_DEF_T1_all_tags_1, sizeof(asn_DEF_T1_all_tags_1) /sizeof(asn_DEF_T1_all_tags_1[0]), /* 6 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T2] >>> ***/ #include "T3.h" /*** <<< TYPE-DECLS [T2] >>> ***/ typedef T3_t T2_t; /*** <<< FUNC-DECLS [T2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T2; asn_struct_free_f T2_free; asn_struct_print_f T2_print; asn_constr_check_f T2_constraint; ber_type_decoder_f T2_decode_ber; der_type_encoder_f T2_encode_der; xer_type_decoder_f T2_decode_xer; xer_type_encoder_f T2_encode_xer; /*** <<< CODE [T2] >>> ***/ int T2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_T3.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using T3, * so here we adjust the DEF accordingly. */ static void T2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_T3.free_struct; td->print_struct = asn_DEF_T3.print_struct; td->ber_decoder = asn_DEF_T3.ber_decoder; td->der_encoder = asn_DEF_T3.der_encoder; td->xer_decoder = asn_DEF_T3.xer_decoder; td->xer_encoder = asn_DEF_T3.xer_encoder; td->uper_decoder = asn_DEF_T3.uper_decoder; td->uper_encoder = asn_DEF_T3.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_T3.per_constraints; td->elements = asn_DEF_T3.elements; td->elements_count = asn_DEF_T3.elements_count; td->specifics = asn_DEF_T3.specifics; } void T2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T2] >>> ***/ static ber_tlv_tag_t asn_DEF_T2_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)) }; static ber_tlv_tag_t asn_DEF_T2_all_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (5 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T2 = { "T2", "T2", T2_free, T2_print, T2_constraint, T2_decode_ber, T2_encode_der, T2_decode_xer, T2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T2_tags_1, sizeof(asn_DEF_T2_tags_1) /sizeof(asn_DEF_T2_tags_1[0]), /* 3 */ asn_DEF_T2_all_tags_1, sizeof(asn_DEF_T2_all_tags_1) /sizeof(asn_DEF_T2_all_tags_1[0]), /* 5 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T3] >>> ***/ #include "T4.h" /*** <<< TYPE-DECLS [T3] >>> ***/ typedef T4_t T3_t; /*** <<< FUNC-DECLS [T3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T3; asn_struct_free_f T3_free; asn_struct_print_f T3_print; asn_constr_check_f T3_constraint; ber_type_decoder_f T3_decode_ber; der_type_encoder_f T3_encode_der; xer_type_decoder_f T3_decode_xer; xer_type_encoder_f T3_encode_xer; /*** <<< CODE [T3] >>> ***/ int T3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_T4.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using T4, * so here we adjust the DEF accordingly. */ static void T3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_T4.free_struct; td->print_struct = asn_DEF_T4.print_struct; td->ber_decoder = asn_DEF_T4.ber_decoder; td->der_encoder = asn_DEF_T4.der_encoder; td->xer_decoder = asn_DEF_T4.xer_decoder; td->xer_encoder = asn_DEF_T4.xer_encoder; td->uper_decoder = asn_DEF_T4.uper_decoder; td->uper_encoder = asn_DEF_T4.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_T4.per_constraints; td->elements = asn_DEF_T4.elements; td->elements_count = asn_DEF_T4.elements_count; td->specifics = asn_DEF_T4.specifics; } void T3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T3] >>> ***/ static ber_tlv_tag_t asn_DEF_T3_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)) }; static ber_tlv_tag_t asn_DEF_T3_all_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (5 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T3 = { "T3", "T3", T3_free, T3_print, T3_constraint, T3_decode_ber, T3_encode_der, T3_decode_xer, T3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T3_tags_1, sizeof(asn_DEF_T3_tags_1) /sizeof(asn_DEF_T3_tags_1[0]), /* 2 */ asn_DEF_T3_all_tags_1, sizeof(asn_DEF_T3_all_tags_1) /sizeof(asn_DEF_T3_all_tags_1[0]), /* 4 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T4] >>> ***/ #include "T5.h" /*** <<< TYPE-DECLS [T4] >>> ***/ typedef T5_t T4_t; /*** <<< FUNC-DECLS [T4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T4; asn_struct_free_f T4_free; asn_struct_print_f T4_print; asn_constr_check_f T4_constraint; ber_type_decoder_f T4_decode_ber; der_type_encoder_f T4_encode_der; xer_type_decoder_f T4_decode_xer; xer_type_encoder_f T4_encode_xer; /*** <<< CODE [T4] >>> ***/ int T4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_T5.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using T5, * so here we adjust the DEF accordingly. */ static void T4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_T5.free_struct; td->print_struct = asn_DEF_T5.print_struct; td->ber_decoder = asn_DEF_T5.ber_decoder; td->der_encoder = asn_DEF_T5.der_encoder; td->xer_decoder = asn_DEF_T5.xer_decoder; td->xer_encoder = asn_DEF_T5.xer_encoder; td->uper_decoder = asn_DEF_T5.uper_decoder; td->uper_encoder = asn_DEF_T5.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_T5.per_constraints; td->elements = asn_DEF_T5.elements; td->elements_count = asn_DEF_T5.elements_count; td->specifics = asn_DEF_T5.specifics; } void T4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T4] >>> ***/ static ber_tlv_tag_t asn_DEF_T4_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T4 = { "T4", "T4", T4_free, T4_print, T4_constraint, T4_decode_ber, T4_encode_der, T4_decode_xer, T4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T4_tags_1, sizeof(asn_DEF_T4_tags_1) /sizeof(asn_DEF_T4_tags_1[0]) - 1, /* 2 */ asn_DEF_T4_tags_1, /* Same as above */ sizeof(asn_DEF_T4_tags_1) /sizeof(asn_DEF_T4_tags_1[0]), /* 3 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T5] >>> ***/ #include "T6.h" /*** <<< TYPE-DECLS [T5] >>> ***/ typedef T6_t T5_t; /*** <<< FUNC-DECLS [T5] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T5; asn_struct_free_f T5_free; asn_struct_print_f T5_print; asn_constr_check_f T5_constraint; ber_type_decoder_f T5_decode_ber; der_type_encoder_f T5_encode_der; xer_type_decoder_f T5_decode_xer; xer_type_encoder_f T5_encode_xer; /*** <<< CODE [T5] >>> ***/ int T5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_T6.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using T6, * so here we adjust the DEF accordingly. */ static void T5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_T6.free_struct; td->print_struct = asn_DEF_T6.print_struct; td->ber_decoder = asn_DEF_T6.ber_decoder; td->der_encoder = asn_DEF_T6.der_encoder; td->xer_decoder = asn_DEF_T6.xer_decoder; td->xer_encoder = asn_DEF_T6.xer_encoder; td->uper_decoder = asn_DEF_T6.uper_decoder; td->uper_encoder = asn_DEF_T6.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_T6.per_constraints; td->elements = asn_DEF_T6.elements; td->elements_count = asn_DEF_T6.elements_count; td->specifics = asn_DEF_T6.specifics; } void T5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T5_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T5_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T5_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T5_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T5_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T5_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T5] >>> ***/ static ber_tlv_tag_t asn_DEF_T5_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T5 = { "T5", "T5", T5_free, T5_print, T5_constraint, T5_decode_ber, T5_encode_der, T5_decode_xer, T5_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T5_tags_1, sizeof(asn_DEF_T5_tags_1) /sizeof(asn_DEF_T5_tags_1[0]) - 1, /* 1 */ asn_DEF_T5_tags_1, /* Same as above */ sizeof(asn_DEF_T5_tags_1) /sizeof(asn_DEF_T5_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T6] >>> ***/ #include /*** <<< TYPE-DECLS [T6] >>> ***/ typedef REAL_t T6_t; /*** <<< FUNC-DECLS [T6] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T6; asn_struct_free_f T6_free; asn_struct_print_f T6_print; asn_constr_check_f T6_constraint; ber_type_decoder_f T6_decode_ber; der_type_encoder_f T6_encode_der; xer_type_decoder_f T6_decode_xer; xer_type_encoder_f T6_encode_xer; /*** <<< CODE [T6] >>> ***/ int T6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_REAL.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using REAL, * so here we adjust the DEF accordingly. */ static void T6_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_REAL.free_struct; td->print_struct = asn_DEF_REAL.print_struct; td->ber_decoder = asn_DEF_REAL.ber_decoder; td->der_encoder = asn_DEF_REAL.der_encoder; td->xer_decoder = asn_DEF_REAL.xer_decoder; td->xer_encoder = asn_DEF_REAL.xer_encoder; td->uper_decoder = asn_DEF_REAL.uper_decoder; td->uper_encoder = asn_DEF_REAL.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_REAL.per_constraints; td->elements = asn_DEF_REAL.elements; td->elements_count = asn_DEF_REAL.elements_count; td->specifics = asn_DEF_REAL.specifics; } void T6_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T6_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T6_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T6_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T6_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T6_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T6_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T6_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T6] >>> ***/ static ber_tlv_tag_t asn_DEF_T6_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T6 = { "T6", "T6", T6_free, T6_print, T6_constraint, T6_decode_ber, T6_encode_der, T6_decode_xer, T6_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T6_tags_1, sizeof(asn_DEF_T6_tags_1) /sizeof(asn_DEF_T6_tags_1[0]), /* 1 */ asn_DEF_T6_tags_1, /* Same as above */ sizeof(asn_DEF_T6_tags_1) /sizeof(asn_DEF_T6_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T] >>> ***/ #include "Ts.h" /*** <<< TYPE-DECLS [T] >>> ***/ typedef Ts_t T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; asn_struct_free_f T_free; asn_struct_print_f T_print; asn_constr_check_f T_constraint; ber_type_decoder_f T_decode_ber; der_type_encoder_f T_encode_der; xer_type_decoder_f T_decode_xer; xer_type_encoder_f T_encode_xer; /*** <<< CODE [T] >>> ***/ int T_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Ts.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Ts, * so here we adjust the DEF accordingly. */ static void T_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Ts.free_struct; td->print_struct = asn_DEF_Ts.print_struct; td->ber_decoder = asn_DEF_Ts.ber_decoder; td->der_encoder = asn_DEF_Ts.der_encoder; td->xer_decoder = asn_DEF_Ts.xer_decoder; td->xer_encoder = asn_DEF_Ts.xer_encoder; td->uper_decoder = asn_DEF_Ts.uper_decoder; td->uper_encoder = asn_DEF_Ts.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Ts.per_constraints; td->elements = asn_DEF_Ts.elements; td->elements_count = asn_DEF_Ts.elements_count; td->specifics = asn_DEF_Ts.specifics; } void T_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T] >>> ***/ static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), (ASN_TAG_CLASS_CONTEXT | (123 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", T_free, T_print, T_constraint, T_decode_ber, T_encode_der, T_decode_xer, T_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]) - 2, /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 3 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [Ts] >>> ***/ #include "T2.h" #include "T3.h" #include /*** <<< TYPE-DECLS [Ts] >>> ***/ typedef struct Ts { T2_t m1; T3_t *m2 /* OPTIONAL */; T3_t m3; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Ts_t; /*** <<< FUNC-DECLS [Ts] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Ts; /*** <<< STAT-DEFS [Ts] >>> ***/ static asn_TYPE_member_t asn_MBR_Ts_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Ts, m1), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_T2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m1" }, { ATF_POINTER, 1, offsetof(struct Ts, m2), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_T3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m2" }, { ATF_NOFLAGS, 0, offsetof(struct Ts, m3), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_T3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m3" }, }; static ber_tlv_tag_t asn_DEF_Ts_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (123 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Ts_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* m1 at 24 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* m2 at 25 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 } /* m3 at 27 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Ts_specs_1 = { sizeof(struct Ts), offsetof(struct Ts, _asn_ctx), asn_MAP_Ts_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Ts = { "Ts", "Ts", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Ts_tags_1, sizeof(asn_DEF_Ts_tags_1) /sizeof(asn_DEF_Ts_tags_1[0]) - 1, /* 1 */ asn_DEF_Ts_tags_1, /* Same as above */ sizeof(asn_DEF_Ts_tags_1) /sizeof(asn_DEF_Ts_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_Ts_1, 3, /* Elements count */ &asn_SPC_Ts_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/32-sequence-of-OK.asn1.-EF0000644000000000000000000000102711461146446017476 0ustar rootrootModuleTestSequenceSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 32 } DEFINITIONS IMPLICIT TAGS ::= BEGIN Programming ::= SEQUENCE SIZE(1..10) OF [0] IMPLICIT Fault Fault ::= SET OF Error Error ::= SEQUENCE { ... } maxSize INTEGER ::= 10 SeqWithMandatory ::= SEQUENCE { someString UTF8String, seqOfMan [0] EXPLICIT SEQUENCE OF Error } SeqWithOptional ::= SEQUENCE { someString UTF8String, seqOfOpt [0] EXPLICIT SEQUENCE OF Error OPTIONAL } END asn1c-0.9.24+dfsg/tests/85-comments-OK.asn10000644000000000000000000000115111461147103016540 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .85 ModuleTestComments { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 85 } DEFINITIONS ::= BEGIN T1 ::= SEQUENCE--comment-- { ... } T2 ::= SEQUENCE-- comment-- { ... } T3 ::= SEQUENCE--- comment --- { ... } T4 ::= SEQUENCE----comment---- { ... } T5 ::= SEQUENCE---- comment ---- { ... } ----- Another ambiguous comment --- -- Immediately terminating ambiguous comment ---- ------------- -- cmt1 ---- cmt2 ---- END asn1c-0.9.24+dfsg/tests/101-class-ref-SE.asn10000644000000000000000000000063311461147103016641 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .101 ModuleClassMisUse { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 101 } DEFINITIONS ::= BEGIN NOTCLASS ::= SEQUENCE { ... } REF-ID ::= NOTCLASS RefID ::= SEQUENCE { field REF-ID.&id, params REF-ID.&Type } END asn1c-0.9.24+dfsg/tests/28-tags-SE.asn10000644000000000000000000000063611461147103015653 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .28 ModuleTestTagsDistinct { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 28 } DEFINITIONS IMPLICIT TAGS ::= BEGIN S ::= SET { a INTEGER, b CHOICE { c IA5String, ... }, d CHOICE { e BOOLEAN, ... } } END asn1c-0.9.24+dfsg/tests/10-int-OK.asn10000644000000000000000000000136611461147103015501 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .10 ModuleTestInt4 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 10 } DEFINITIONS ::= BEGIN alpha INTEGER ::= 1 Type1 ::= INTEGER { alpha(2) } Type2 ::= INTEGER { alpha(3), beta(alpha) } gamma Type2 ::= beta -- equals 1 -- delta Type2 ::= alpha -- equals 3 -- /* * The following are for post-fix checking by the check_fixer. * It will be able to pick-up these values if the file is parseable, * even if it contains some semantic errors. */ check-gamma INTEGER ::= 1 -- check "gamma"'s value check-delta INTEGER ::= 3 -- check "delta"'s value END asn1c-0.9.24+dfsg/tests/46-redefine-OK.asn10000644000000000000000000000065511461147103016501 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .46 ModuleRedefineType { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 46 } DEFINITIONS IMPLICIT TAGS ::= BEGIN PrimitiveType ::= OCTET STRING ConstructedType ::= SEQUENCE { field [5] PrimitiveType } T ::= [3] ConstructedType END asn1c-0.9.24+dfsg/tests/20-constr-OK.asn10000644000000000000000000000104511461147103016212 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .20 ModuleTestConstr { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 20 } DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::= BEGIN ConstructedType1 ::= SEQUENCE { a [1] INTEGER, b [2] INTEGER, ...!ex1, c IA5String, ..., d UTF8String } ConstructedType2 ::= SET { a [1] INTEGER, b [2] INTEGER } ex1 INTEGER ::= 1 END asn1c-0.9.24+dfsg/tests/83-with-comps-OK.asn10000644000000000000000000000060211461147103017003 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .83 ModuleTestWithComponents2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 83 } DEFINITIONS ::= BEGIN Type1 ::= SET {} Type2 ::= SET { COMPONENTS OF Type1 (WITH COMPONENTS { ... }) } END asn1c-0.9.24+dfsg/tests/51-constraint-SE.asn10000644000000000000000000000052311461147103017070 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .51 ModuleInvalidConstraintApplicability1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 51 } DEFINITIONS ::= BEGIN Int ::= INTEGER (FROM("abc")) END asn1c-0.9.24+dfsg/tests/119-per-strings-OK.asn1.-EF0000644000000000000000000000402111461146446017624 0ustar rootrootModulePERStrings { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 119 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN PDU ::= SEQUENCE { many [0] IMPLICIT SEQUENCE OF PDU OPTIONAL, ia5 [1] IMPLICIT IA5String OPTIONAL, ia5-c [2] IMPLICIT IA5String (FROM("A".."Z")) OPTIONAL, ia5-ce [3] IMPLICIT IA5String (FROM("A".."Z",...)) OPTIONAL, ia5-ir [4] IMPLICIT IA5String (FROM("A".."B" | "X".."Z")) OPTIONAL, vs [5] IMPLICIT VisibleString OPTIONAL, vs-c [6] IMPLICIT VisibleString (FROM("A".."Z")) OPTIONAL, vs-ce [7] IMPLICIT VisibleString (FROM("A".."Z",...)) OPTIONAL, vs-ir [8] IMPLICIT VisibleString (FROM("A".."B" | "X".."Z")) OPTIONAL, pr [9] IMPLICIT PrintableString OPTIONAL, pr-c [10] IMPLICIT PrintableString (FROM("A".."Z")) OPTIONAL, pr-ir [11] IMPLICIT PrintableString (FROM("A".."B" | "X".."Z")) OPTIONAL, ns [12] IMPLICIT NumericString OPTIONAL, ns-c [13] IMPLICIT NumericString (FROM("5".."9")) OPTIONAL, ns-ce [14] IMPLICIT NumericString (FROM("5".."9",...)) OPTIONAL, ns-ir [15] IMPLICIT NumericString (FROM("1" | "9")) OPTIONAL, ut-c [16] IMPLICIT UTF8String (SIZE(6)) OPTIONAL, ut-ce [17] IMPLICIT UTF8String (SIZE(6,...)) OPTIONAL, ut-ir [18] IMPLICIT UTF8String (FROM("A" | "Z")) OPTIONAL, bm [19] IMPLICIT BMPString OPTIONAL, bm-c [20] IMPLICIT BMPString (FROM("A".."Z")) OPTIONAL, bm-cs [21] IMPLICIT BMPString (SIZE(6)) OPTIONAL, bm-ce [22] IMPLICIT BMPString (FROM("A".."Z",...)) OPTIONAL, bm-ir [23] IMPLICIT BMPString (FROM("A".."B" | "X".."Z")) OPTIONAL, us [24] IMPLICIT UniversalString OPTIONAL, us-c [25] IMPLICIT UniversalString (FROM("A".."Z")) OPTIONAL, us-cs [26] IMPLICIT UniversalString (SIZE(6)) OPTIONAL, us-ce [27] IMPLICIT UniversalString (FROM("A".."Z",...)) OPTIONAL, us-ir [28] IMPLICIT UniversalString (FROM("A".."B" | "X".."Z")) OPTIONAL, real [29] IMPLICIT REAL OPTIONAL, oid [30] IMPLICIT OBJECT IDENTIFIER OPTIONAL } END asn1c-0.9.24+dfsg/tests/53-constraint-SE.asn10000644000000000000000000000052711461147103017076 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .53 ModuleInvalidConstraintApplicability1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 53 } DEFINITIONS ::= BEGIN Int ::= INTEGER (1..32) (MIN..63) END asn1c-0.9.24+dfsg/tests/88-integer-enum-OK.asn10000644000000000000000000000051011461147103017313 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .88 ModuleIntegerEnumeration { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 88 } DEFINITIONS ::= BEGIN T ::= INTEGER { a(1), b(2) } END asn1c-0.9.24+dfsg/tests/50-constraint-OK.asn1.-EFprint-constraints0000644000000000000000000002325211461146446023076 0ustar rootrootModuleNestedConstraintsCheck { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 50 1 } DEFINITIONS ::= BEGIN Int1 ::= INTEGER -- Practical constraints (Int1): (MIN..MAX) -- PER-visible constraints (Int1): (MIN..MAX) Int2 ::= Int1 (0..MAX) -- Combined constraints: (0..MAX) -- Practical constraints (Int1): (0..MAX) -- PER-visible constraints (Int1): (0..MAX) Int3 ::= Int2 (MIN..10) -- Combined constraints: (0..MAX)(MIN..10) -- Practical constraints (Int1): (0..10) -- PER-visible constraints (Int1): (0..10) Int4 ::= Int3 (5..MAX,...,1..4) -- Combined constraints: (0..MAX)(MIN..10)(5..MAX,...,1..4) -- Practical constraints (Int1): (1..10,...) -- PER-visible constraints (Int1): (1..10,...) Int5 ::= Int4 (MIN..5) -- Combined constraints: (0..MAX)(MIN..10)(5..MAX)(MIN..5) -- Practical constraints (Int1): (5) -- PER-visible constraints (Int1): (5) ten Int1 ::= 10 -- Practical constraints (Int1): (MIN..MAX) -- PER-visible constraints (Int1): (MIN..MAX) other-ten Int2 ::= 10 -- Practical constraints (Int1): (MIN..MAX) -- PER-visible constraints (Int1): (MIN..MAX) ExtensibleExtensions ::= INTEGER ((1..256,...) ^ (1..256)) -- Combined constraints: ((1..256,...) ^ (1..256)) -- Practical constraints (ExtensibleExtensions): (1..256,...) -- PER-visible constraints (ExtensibleExtensions): (1..256,...) Str1 ::= IA5String -- Practical constraints (Str1): (MIN..MAX) (SIZE(0..MAX)) (FROM("".."")) -- PER-visible constraints (Str1): (MIN..MAX) (SIZE(0..MAX)) (FROM("".."")) Str2 ::= Str1 (SIZE(MIN..20 | 25..30)) -- Combined constraints: (SIZE(MIN..20 | 25..30)) -- Practical constraints (Str1): (MIN..MAX) (SIZE(0..20 | 25..30)) (FROM("".."")) -- PER-visible constraints (Str1): (MIN..MAX) (SIZE(0..20 | 25..30)) (FROM("".."")) Str3 ::= Str2 (SIZE(10..27))(FROM("ABC" | "def")) -- Combined constraints: (SIZE(MIN..20 | 25..30))(SIZE(10..27))(FROM("ABC" | "def")) -- Practical constraints (Str1): (MIN..MAX) (SIZE(10..20 | 25..27)) (FROM("A".."C" | "d".."f")) -- PER-visible constraints (Str1): (MIN..MAX) (SIZE(10..20 | 25..27)) (FROM("A".."C" | "d".."f")) Str4 ::= IA5String ("ABCD" | SIZE(4)) -- Combined constraints: ("ABCD" | SIZE(4)) -- Practical constraints (Str4): (MIN..MAX) (SIZE(0..MAX)) (FROM("".."")) -- PER-visible constraints (Str4): (MIN..MAX) (SIZE(0..MAX)) (FROM("".."")) PER-Visible ::= IA5String (FROM("A".."F")) -- Combined constraints: (FROM("A".."F")) -- Practical constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."F")) -- PER-visible constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."F")) PER-Visible-2 ::= PER-Visible (FROM("E".."F")) -- Combined constraints: (FROM("A".."F"))(FROM("E".."F")) -- Practical constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("E".."F")) -- PER-visible constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("E".."F")) Not-PER-Visible-1 ::= PER-Visible (FROM("AB") | SIZE(1..2)) -- Combined constraints: (FROM("A".."F"))(FROM("AB") | SIZE(1..2)) -- Practical constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."F")) -- PER-visible constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."F")) Not-PER-Visible-2 ::= PER-Visible (FROM("AB",...)) -- Combined constraints: (FROM("A".."F"))(FROM("AB",...)) -- Practical constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."B",...)) -- PER-visible constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."F")) Not-PER-Visible-3 ::= PER-Visible (FROM("AB"),...) -- Combined constraints: (FROM("A".."F"))(FROM("AB"),...) -- Practical constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."B",...)) -- PER-visible constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."F")) SIZE-but-not-FROM ::= PER-Visible (SIZE(1..4) ^ FROM("ABCD",...)) -- Combined constraints: (FROM("A".."F"))(SIZE(1..4) ^ FROM("ABCD",...)) -- Practical constraints (PER-Visible): (MIN..MAX) (SIZE(1..4)) (FROM("A".."D",...)) -- PER-visible constraints (PER-Visible): (MIN..MAX) (SIZE(1..4)) (FROM("A".."F")) SIZE-and-FROM ::= PER-Visible (SIZE(1..4) ^ FROM("ABCD")) -- Combined constraints: (FROM("A".."F"))(SIZE(1..4) ^ FROM("ABCD")) -- Practical constraints (PER-Visible): (MIN..MAX) (SIZE(1..4)) (FROM("A".."D")) -- PER-visible constraints (PER-Visible): (MIN..MAX) (SIZE(1..4)) (FROM("A".."D")) Neither-SIZE-nor-FROM ::= PER-Visible (SIZE(1..4) | FROM("ABCD",...)) -- Combined constraints: (FROM("A".."F"))(SIZE(1..4) | FROM("ABCD",...)) -- Practical constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."F")) -- PER-visible constraints (PER-Visible): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."F")) Utf8-4 ::= UTF8String (FROM("A".."Z")) -- Combined constraints: (FROM("A".."Z")) -- Practical constraints (Utf8-4): (MIN..MAX) (SIZE(0..MAX)) (FROM("A".."Z")) -- PER-visible constraints (Utf8-4): Utf8-3 ::= Utf8-2 (FROM("A".."Z" | "a".."z")) -- Combined constraints: (SIZE(1..2))(FROM("A".."Z" | "a".."z")) -- Practical constraints (Utf8-1): (MIN..MAX) (SIZE(1..2)) (FROM("A".."Z" | "a".."z")) -- PER-visible constraints (Utf8-1): Utf8-2 ::= Utf8-1 (SIZE(1..2)) -- Combined constraints: (SIZE(1..2)) -- Practical constraints (Utf8-1): (MIN..MAX) (SIZE(1..2)) (FROM("".."ÿ")) -- PER-visible constraints (Utf8-1): Utf8-1 ::= UTF8String -- Practical constraints (Utf8-1): (MIN..MAX) (SIZE(0..MAX)) (FROM("".."ÿ")) -- PER-visible constraints (Utf8-1): VisibleIdentifier ::= Identifier -- Combined constraints: (FROM("A" | "a" | "B" | "b" | "C" | "c" | "D" | "d" | "E" | "e" | "F" | "f" | "G" | "g" | "H" | "h" | "I" | "i" | "J" | "j" | "K" | "k" | "L" | "l" | "M" | "m" | "N" | "n" | "O" | "o" | "P" | "p" | "Q" | "q" | "R" | "r" | "S" | "s" | "T" | "t" | "U" | "u" | "V" | "v" | "W" | "w" | "X" | "x" | "Y" | "y" | "Z" | "z" | "$" | "_" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"))(SIZE(1..32)) -- Practical constraints (Identifier): (MIN..MAX) (SIZE(1..32)) (FROM("$" | "0".."9" | "A".."Z" | "_" | "a".."z")) -- PER-visible constraints (Identifier): (MIN..MAX) (SIZE(1..32)) (FROM("$" | "0".."9" | "A".."Z" | "_" | "a".."z")) Sequence ::= SEQUENCE { int1-c Int1 (-2..MAX) -- Combined constraints: (-2..MAX) -- Practical constraints (Int1): (-2..MAX) -- PER-visible constraints (Int1): (-2..MAX) DEFAULT 3, int4 [2] EXPLICIT Int4 -- Combined constraints: (0..MAX)(MIN..10)(5..MAX,...,1..4) -- Practical constraints (Int1): (1..10,...) -- PER-visible constraints (Int1): (1..10,...) , int4-c Int4 (MIN..7) -- Combined constraints: (0..MAX)(MIN..10)(5..MAX)(MIN..7) -- Practical constraints (Int1): (5..7) -- PER-visible constraints (Int1): (5..7) , bool BOOLEAN -- Practical constraints (bool): (MIN..MAX) -- PER-visible constraints (bool): (MIN..MAX) DEFAULT 1, enum-c ENUMERATED { one(1) -- Practical constraints (one): -- PER-visible constraints (one): , two(2) -- Practical constraints (two): -- PER-visible constraints (two): , ..., three(3) -- Practical constraints (three): -- PER-visible constraints (three): } -- Practical constraints (enum-c): (MIN..MAX) -- PER-visible constraints (enum-c): (MIN..MAX) , null NULL -- Practical constraints (null): -- PER-visible constraints (null): OPTIONAL, ..., int5-c Int5 (5) -- Combined constraints: (0..MAX)(MIN..10)(5..MAX)(MIN..5)(5) -- Practical constraints (Int1): (5) -- PER-visible constraints (Int1): (5) OPTIONAL } -- Practical constraints (Sequence): -- PER-visible constraints (Sequence): SequenceOf ::= SEQUENCE (SIZE(1..2)) OF Sequence -- Practical constraints (Sequence): -- PER-visible constraints (Sequence): -- Combined constraints: (SIZE(1..2)) -- Practical constraints (SequenceOf): (SIZE(1..2)) -- PER-visible constraints (SequenceOf): (SIZE(1..2)) Enum0 ::= ENUMERATED { one(0) -- Practical constraints (one): -- PER-visible constraints (one): , two(1) -- Practical constraints (two): -- PER-visible constraints (two): } -- Practical constraints (Enum0): (MIN..MAX) -- PER-visible constraints (Enum0): (MIN..MAX) Enum1 ::= ENUMERATED { one(0) -- Practical constraints (one): -- PER-visible constraints (one): , two(1) -- Practical constraints (two): -- PER-visible constraints (two): } (0) -- Combined constraints: (0) -- Practical constraints (Enum1): (0) -- PER-visible constraints (Enum1): (0) END IdentifierModule { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 50 2 } DEFINITIONS ::= BEGIN maxIdentifier INTEGER ::= 32 -- Practical constraints (maxIdentifier): (MIN..MAX) -- PER-visible constraints (maxIdentifier): (MIN..MAX) Identifier ::= VisibleString (FROM("A" | "a" | "B" | "b" | "C" | "c" | "D" | "d" | "E" | "e" | "F" | "f" | "G" | "g" | "H" | "h" | "I" | "i" | "J" | "j" | "K" | "k" | "L" | "l" | "M" | "m" | "N" | "n" | "O" | "o" | "P" | "p" | "Q" | "q" | "R" | "r" | "S" | "s" | "T" | "t" | "U" | "u" | "V" | "v" | "W" | "w" | "X" | "x" | "Y" | "y" | "Z" | "z" | "$" | "_" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"))(SIZE(1..32)) -- Combined constraints: (FROM("A" | "a" | "B" | "b" | "C" | "c" | "D" | "d" | "E" | "e" | "F" | "f" | "G" | "g" | "H" | "h" | "I" | "i" | "J" | "j" | "K" | "k" | "L" | "l" | "M" | "m" | "N" | "n" | "O" | "o" | "P" | "p" | "Q" | "q" | "R" | "r" | "S" | "s" | "T" | "t" | "U" | "u" | "V" | "v" | "W" | "w" | "X" | "x" | "Y" | "y" | "Z" | "z" | "$" | "_" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"))(SIZE(1..32)) -- Practical constraints (Identifier): (MIN..MAX) (SIZE(1..32)) (FROM("$" | "0".."9" | "A".."Z" | "_" | "a".."z")) -- PER-visible constraints (Identifier): (MIN..MAX) (SIZE(1..32)) (FROM("$" | "0".."9" | "A".."Z" | "_" | "a".."z")) END asn1c-0.9.24+dfsg/tests/118-per-constraint-OK.asn1.-EFprint-constraints0000644000000000000000000000353211461146446023746 0ustar rootrootModuleConstraintPrecedence { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 118 } DEFINITIONS ::= BEGIN E1 ::= IA5String (SIZE(1..5,...) ^ FROM("A".."Z")) -- Combined constraints: (SIZE(1..5,...) ^ FROM("A".."Z")) -- Practical constraints (E1): (MIN..MAX) (SIZE(1..5,...)) (FROM("A".."Z")) -- PER-visible constraints (E1): (MIN..MAX) (SIZE(1..5,...)) (FROM("A".."Z")) E2 ::= IA5String (SIZE(1..5,...,5))(FROM("A".."Z")) -- Combined constraints: (SIZE(1..5))(FROM("A".."Z")) -- Practical constraints (E2): (MIN..MAX) (SIZE(1..5)) (FROM("A".."Z")) -- PER-visible constraints (E2): (MIN..MAX) (SIZE(1..5)) (FROM("A".."Z")) E3 ::= IA5String (SIZE(1..5) ^ FROM("A".."Z"),...) -- Combined constraints: (SIZE(1..5) ^ FROM("A".."Z"),...) -- Practical constraints (E3): (MIN..MAX,...) (SIZE(1..5,...)) (FROM("A".."Z",...)) -- PER-visible constraints (E3): (MIN..MAX,...) (SIZE(1..5,...)) (FROM("".."")) E4 ::= IA5String (FROM("A".."Z"),...)(SIZE(1..5)) -- Combined constraints: (FROM("A".."Z"))(SIZE(1..5)) -- Practical constraints (E4): (MIN..MAX) (SIZE(1..5)) (FROM("A".."Z")) -- PER-visible constraints (E4): (MIN..MAX) (SIZE(1..5)) (FROM("A".."Z")) C ::= IA5String (SIZE(10) ^ FROM("A".."D") | SIZE(20) ^ FROM("D".."F")) -- Combined constraints: (SIZE(10) ^ FROM("A".."D") | SIZE(20) ^ FROM("D".."F")) -- Practical constraints (C): (MIN..MAX) (SIZE(10 | 20)) (FROM("A".."F")) -- PER-visible constraints (C): (MIN..MAX) (SIZE(10 | 20)) (FROM("A".."F")) P ::= IA5String (FROM("AB") ^ SIZE(1..2) | FROM("DE") ^ SIZE(3) | FROM("AXE") ^ SIZE(1..5)) -- Combined constraints: (FROM("AB") ^ SIZE(1..2) | FROM("DE") ^ SIZE(3) | FROM("AXE") ^ SIZE(1..5)) -- Practical constraints (P): (MIN..MAX) (SIZE(1..5)) (FROM("A".."B" | "D".."E" | "X")) -- PER-visible constraints (P): (MIN..MAX) (SIZE(1..5)) (FROM("A".."B" | "D".."E" | "X")) END asn1c-0.9.24+dfsg/tests/23-bits-OK.asn1.-EF0000644000000000000000000000047111461146446016227 0ustar rootrootModuleTestBitString { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 23 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN v28 INTEGER ::= 28 BS1 ::= BIT STRING { first(0), third(2), twenty-eight(28) } one-zero-one BS1 ::= '101'B one0one BS1 ::= '101'B END asn1c-0.9.24+dfsg/tests/07-int-OK.asn1.-EF0000644000000000000000000000054611461146446016065 0ustar rootrootModuleTestInt1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 7 } DEFINITIONS ::= BEGIN int123456 INTEGER ::= 123456 Interval ::= INTEGER (1..123456) SameInterval INTEGER ::= {1 | 2 | 3 | 4 | 5 | 6} Reason ::= INTEGER { no-reason(0), negative-reason(-10), some-large-value(1324324) } END asn1c-0.9.24+dfsg/tests/89-bit-string-enum-OK.asn1.-Pfcompound-names0000644000000000000000000000347711461146446023260 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include #include /*** <<< DEPS [T] >>> ***/ typedef enum T_PR { T_PR_NOTHING, /* No components present */ T_PR_bs } T_PR; typedef enum T__bs { T__bs_a = 1, T__bs_b = 2 } e_T__bs; /*** <<< TYPE-DECLS [T] >>> ***/ typedef struct T { T_PR present; union T_u { BIT_STRING_t bs; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; /*** <<< STAT-DEFS [T] >>> ***/ static asn_TYPE_member_t asn_MBR_T_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T, choice.bs), .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), .tag_mode = 0, .type = &asn_DEF_BIT_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "bs" }, }; static asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* bs at 15 */ }; static asn_CHOICE_specifics_t asn_SPC_T_specs_1 = { sizeof(struct T), offsetof(struct T, _asn_ctx), offsetof(struct T, present), sizeof(((struct T *)0)->present), asn_MAP_T_tag2el_1, 1, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_T_1, 1, /* Elements count */ &asn_SPC_T_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/107-param-constr-2-OK.asn10000644000000000000000000000057711461147103017546 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .107 ModuleParameterizationWithConstraints2 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 107 } DEFINITIONS ::= BEGIN Narrow {Type} ::= Type (2..5) NarrowInteger ::= Narrow {INTEGER} END asn1c-0.9.24+dfsg/tests/50-constraint-OK.asn1.-Pgen-PER0000644000000000000000000047114311461230611020471 0ustar rootroot /*** <<< INCLUDES [Int1] >>> ***/ #include /*** <<< TYPE-DECLS [Int1] >>> ***/ typedef INTEGER_t Int1_t; /*** <<< FUNC-DECLS [Int1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Int1; asn_struct_free_f Int1_free; asn_struct_print_f Int1_print; asn_constr_check_f Int1_constraint; ber_type_decoder_f Int1_decode_ber; der_type_encoder_f Int1_encode_der; xer_type_decoder_f Int1_decode_xer; xer_type_encoder_f Int1_encode_xer; per_type_decoder_f Int1_decode_uper; per_type_encoder_f Int1_encode_uper; /*** <<< CODE [Int1] >>> ***/ int Int1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void Int1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void Int1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Int1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Int1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Int1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Int1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Int1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Int1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Int1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Int1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Int1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Int1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Int1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Int1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Int1_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Int1_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Int1_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< STAT-DEFS [Int1] >>> ***/ static ber_tlv_tag_t asn_DEF_Int1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Int1 = { "Int1", "Int1", Int1_free, Int1_print, Int1_constraint, Int1_decode_ber, Int1_encode_der, Int1_decode_xer, Int1_encode_xer, Int1_decode_uper, Int1_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Int1_tags_1, sizeof(asn_DEF_Int1_tags_1) /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */ asn_DEF_Int1_tags_1, /* Same as above */ sizeof(asn_DEF_Int1_tags_1) /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Int2] >>> ***/ #include "Int1.h" /*** <<< TYPE-DECLS [Int2] >>> ***/ typedef Int1_t Int2_t; /*** <<< FUNC-DECLS [Int2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Int2; asn_struct_free_f Int2_free; asn_struct_print_f Int2_print; asn_constr_check_f Int2_constraint; ber_type_decoder_f Int2_decode_ber; der_type_encoder_f Int2_encode_der; xer_type_decoder_f Int2_decode_xer; xer_type_encoder_f Int2_encode_xer; per_type_decoder_f Int2_decode_uper; per_type_encoder_f Int2_encode_uper; /*** <<< CODE [Int2] >>> ***/ int Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int1_t *st = (const Int1_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } /* Check if the sign bit is present */ value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0; if((value >= 0)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Int1, * so here we adjust the DEF accordingly. */ static void Int2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Int1.free_struct; td->print_struct = asn_DEF_Int1.print_struct; td->ber_decoder = asn_DEF_Int1.ber_decoder; td->der_encoder = asn_DEF_Int1.der_encoder; td->xer_decoder = asn_DEF_Int1.xer_decoder; td->xer_encoder = asn_DEF_Int1.xer_encoder; td->uper_decoder = asn_DEF_Int1.uper_decoder; td->uper_encoder = asn_DEF_Int1.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Int1.per_constraints; td->elements = asn_DEF_Int1.elements; td->elements_count = asn_DEF_Int1.elements_count; td->specifics = asn_DEF_Int1.specifics; } void Int2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Int2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Int2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Int2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Int2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Int2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Int2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Int2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Int2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Int2_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Int2_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Int2_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Int2] >>> ***/ static asn_per_constraints_t asn_PER_type_Int2_constr_1 = { { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Int2] >>> ***/ static ber_tlv_tag_t asn_DEF_Int2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Int2 = { "Int2", "Int2", Int2_free, Int2_print, Int2_constraint, Int2_decode_ber, Int2_encode_der, Int2_decode_xer, Int2_encode_xer, Int2_decode_uper, Int2_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Int2_tags_1, sizeof(asn_DEF_Int2_tags_1) /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */ asn_DEF_Int2_tags_1, /* Same as above */ sizeof(asn_DEF_Int2_tags_1) /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */ &asn_PER_type_Int2_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Int3] >>> ***/ #include "Int2.h" /*** <<< TYPE-DECLS [Int3] >>> ***/ typedef Int2_t Int3_t; /*** <<< FUNC-DECLS [Int3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Int3; asn_struct_free_f Int3_free; asn_struct_print_f Int3_print; asn_constr_check_f Int3_constraint; ber_type_decoder_f Int3_decode_ber; der_type_encoder_f Int3_encode_der; xer_type_decoder_f Int3_decode_xer; xer_type_encoder_f Int3_encode_xer; per_type_decoder_f Int3_decode_uper; per_type_encoder_f Int3_encode_uper; /*** <<< CODE [Int3] >>> ***/ int Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int2_t *st = (const Int2_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 0 && value <= 10)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Int2, * so here we adjust the DEF accordingly. */ static void Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Int2.free_struct; td->print_struct = asn_DEF_Int2.print_struct; td->ber_decoder = asn_DEF_Int2.ber_decoder; td->der_encoder = asn_DEF_Int2.der_encoder; td->xer_decoder = asn_DEF_Int2.xer_decoder; td->xer_encoder = asn_DEF_Int2.xer_encoder; td->uper_decoder = asn_DEF_Int2.uper_decoder; td->uper_encoder = asn_DEF_Int2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Int2.per_constraints; td->elements = asn_DEF_Int2.elements; td->elements_count = asn_DEF_Int2.elements_count; td->specifics = asn_DEF_Int2.specifics; } void Int3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Int3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Int3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Int3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Int3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Int3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Int3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Int3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Int3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Int3_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Int3_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Int3_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Int3] >>> ***/ static asn_per_constraints_t asn_PER_type_Int3_constr_1 = { { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Int3] >>> ***/ static ber_tlv_tag_t asn_DEF_Int3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Int3 = { "Int3", "Int3", Int3_free, Int3_print, Int3_constraint, Int3_decode_ber, Int3_encode_der, Int3_decode_xer, Int3_encode_xer, Int3_decode_uper, Int3_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Int3_tags_1, sizeof(asn_DEF_Int3_tags_1) /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */ asn_DEF_Int3_tags_1, /* Same as above */ sizeof(asn_DEF_Int3_tags_1) /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */ &asn_PER_type_Int3_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Int4] >>> ***/ #include "Int3.h" /*** <<< TYPE-DECLS [Int4] >>> ***/ typedef Int3_t Int4_t; /*** <<< FUNC-DECLS [Int4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Int4; asn_struct_free_f Int4_free; asn_struct_print_f Int4_print; asn_constr_check_f Int4_constraint; ber_type_decoder_f Int4_decode_ber; der_type_encoder_f Int4_encode_der; xer_type_decoder_f Int4_decode_xer; xer_type_encoder_f Int4_encode_xer; per_type_decoder_f Int4_decode_uper; per_type_encoder_f Int4_encode_uper; /*** <<< CODE [Int4] >>> ***/ int Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int3_t *st = (const Int3_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 1 && value <= 10)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Int3, * so here we adjust the DEF accordingly. */ static void Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Int3.free_struct; td->print_struct = asn_DEF_Int3.print_struct; td->ber_decoder = asn_DEF_Int3.ber_decoder; td->der_encoder = asn_DEF_Int3.der_encoder; td->xer_decoder = asn_DEF_Int3.xer_decoder; td->xer_encoder = asn_DEF_Int3.xer_encoder; td->uper_decoder = asn_DEF_Int3.uper_decoder; td->uper_encoder = asn_DEF_Int3.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Int3.per_constraints; td->elements = asn_DEF_Int3.elements; td->elements_count = asn_DEF_Int3.elements_count; td->specifics = asn_DEF_Int3.specifics; } void Int4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Int4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Int4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Int4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Int4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Int4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Int4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Int4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Int4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Int4_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Int4_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Int4_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Int4] >>> ***/ static asn_per_constraints_t asn_PER_type_Int4_constr_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Int4] >>> ***/ static ber_tlv_tag_t asn_DEF_Int4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Int4 = { "Int4", "Int4", Int4_free, Int4_print, Int4_constraint, Int4_decode_ber, Int4_encode_der, Int4_decode_xer, Int4_encode_xer, Int4_decode_uper, Int4_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Int4_tags_1, sizeof(asn_DEF_Int4_tags_1) /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */ asn_DEF_Int4_tags_1, /* Same as above */ sizeof(asn_DEF_Int4_tags_1) /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */ &asn_PER_type_Int4_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Int5] >>> ***/ #include "Int4.h" /*** <<< TYPE-DECLS [Int5] >>> ***/ typedef Int4_t Int5_t; /*** <<< FUNC-DECLS [Int5] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Int5; asn_struct_free_f Int5_free; asn_struct_print_f Int5_print; asn_constr_check_f Int5_constraint; ber_type_decoder_f Int5_decode_ber; der_type_encoder_f Int5_encode_der; xer_type_decoder_f Int5_decode_xer; xer_type_encoder_f Int5_encode_xer; per_type_decoder_f Int5_decode_uper; per_type_encoder_f Int5_encode_uper; /*** <<< CODE [Int5] >>> ***/ int Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int4_t *st = (const Int4_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value == 5)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Int4, * so here we adjust the DEF accordingly. */ static void Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Int4.free_struct; td->print_struct = asn_DEF_Int4.print_struct; td->ber_decoder = asn_DEF_Int4.ber_decoder; td->der_encoder = asn_DEF_Int4.der_encoder; td->xer_decoder = asn_DEF_Int4.xer_decoder; td->xer_encoder = asn_DEF_Int4.xer_encoder; td->uper_decoder = asn_DEF_Int4.uper_decoder; td->uper_encoder = asn_DEF_Int4.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Int4.per_constraints; td->elements = asn_DEF_Int4.elements; td->elements_count = asn_DEF_Int4.elements_count; td->specifics = asn_DEF_Int4.specifics; } void Int5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Int5_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Int5_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Int5_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Int5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Int5_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Int5_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Int5_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Int5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Int5_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Int5_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Int5_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Int5] >>> ***/ static asn_per_constraints_t asn_PER_type_Int5_constr_1 = { { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Int5] >>> ***/ static ber_tlv_tag_t asn_DEF_Int5_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Int5 = { "Int5", "Int5", Int5_free, Int5_print, Int5_constraint, Int5_decode_ber, Int5_encode_der, Int5_decode_xer, Int5_encode_xer, Int5_decode_uper, Int5_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Int5_tags_1, sizeof(asn_DEF_Int5_tags_1) /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */ asn_DEF_Int5_tags_1, /* Same as above */ sizeof(asn_DEF_Int5_tags_1) /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */ &asn_PER_type_Int5_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [ExtensibleExtensions] >>> ***/ #include /*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/ typedef INTEGER_t ExtensibleExtensions_t; /*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions; asn_struct_free_f ExtensibleExtensions_free; asn_struct_print_f ExtensibleExtensions_print; asn_constr_check_f ExtensibleExtensions_constraint; ber_type_decoder_f ExtensibleExtensions_decode_ber; der_type_encoder_f ExtensibleExtensions_encode_der; xer_type_decoder_f ExtensibleExtensions_decode_xer; xer_type_encoder_f ExtensibleExtensions_encode_xer; per_type_decoder_f ExtensibleExtensions_decode_uper; per_type_encoder_f ExtensibleExtensions_encode_uper; /*** <<< CODE [ExtensibleExtensions] >>> ***/ int ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 1 && value <= 256)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void ExtensibleExtensions_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t ExtensibleExtensions_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t ExtensibleExtensions_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [ExtensibleExtensions] >>> ***/ static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/ static ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = { "ExtensibleExtensions", "ExtensibleExtensions", ExtensibleExtensions_free, ExtensibleExtensions_print, ExtensibleExtensions_constraint, ExtensibleExtensions_decode_ber, ExtensibleExtensions_encode_der, ExtensibleExtensions_decode_xer, ExtensibleExtensions_encode_xer, ExtensibleExtensions_decode_uper, ExtensibleExtensions_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_ExtensibleExtensions_tags_1, sizeof(asn_DEF_ExtensibleExtensions_tags_1) /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */ asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */ sizeof(asn_DEF_ExtensibleExtensions_tags_1) /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */ &asn_PER_type_ExtensibleExtensions_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Str1] >>> ***/ #include /*** <<< TYPE-DECLS [Str1] >>> ***/ typedef IA5String_t Str1_t; /*** <<< FUNC-DECLS [Str1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Str1; asn_struct_free_f Str1_free; asn_struct_print_f Str1_print; asn_constr_check_f Str1_constraint; ber_type_decoder_f Str1_decode_ber; der_type_encoder_f Str1_encode_der; xer_type_decoder_f Str1_decode_xer; xer_type_encoder_f Str1_encode_xer; per_type_decoder_f Str1_decode_uper; per_type_encoder_f Str1_encode_uper; /*** <<< CODE [Str1] >>> ***/ int Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_IA5String.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using IA5String, * so here we adjust the DEF accordingly. */ static void Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_IA5String.free_struct; td->print_struct = asn_DEF_IA5String.print_struct; td->ber_decoder = asn_DEF_IA5String.ber_decoder; td->der_encoder = asn_DEF_IA5String.der_encoder; td->xer_decoder = asn_DEF_IA5String.xer_decoder; td->xer_encoder = asn_DEF_IA5String.xer_encoder; td->uper_decoder = asn_DEF_IA5String.uper_decoder; td->uper_encoder = asn_DEF_IA5String.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_IA5String.per_constraints; td->elements = asn_DEF_IA5String.elements; td->elements_count = asn_DEF_IA5String.elements_count; td->specifics = asn_DEF_IA5String.specifics; } void Str1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Str1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Str1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Str1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Str1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Str1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Str1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Str1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Str1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Str1_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Str1_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Str1_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< STAT-DEFS [Str1] >>> ***/ static ber_tlv_tag_t asn_DEF_Str1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Str1 = { "Str1", "Str1", Str1_free, Str1_print, Str1_constraint, Str1_decode_ber, Str1_encode_der, Str1_decode_xer, Str1_encode_xer, Str1_decode_uper, Str1_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Str1_tags_1, sizeof(asn_DEF_Str1_tags_1) /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */ asn_DEF_Str1_tags_1, /* Same as above */ sizeof(asn_DEF_Str1_tags_1) /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Str2] >>> ***/ #include "Str1.h" /*** <<< TYPE-DECLS [Str2] >>> ***/ typedef Str1_t Str2_t; /*** <<< FUNC-DECLS [Str2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Str2; asn_struct_free_f Str2_free; asn_struct_print_f Str2_print; asn_constr_check_f Str2_constraint; ber_type_decoder_f Str2_decode_ber; der_type_encoder_f Str2_encode_der; xer_type_decoder_f Str2_decode_xer; xer_type_encoder_f Str2_encode_xer; per_type_decoder_f Str2_decode_uper; per_type_encoder_f Str2_encode_uper; /*** <<< CTABLES [Str2] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv <= 127)) return -1; } return 0; } /*** <<< CODE [Str2] >>> ***/ int Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Str1_t *st = (const Str1_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if(((size <= 20) || (size >= 25 && size <= 30)) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Str1, * so here we adjust the DEF accordingly. */ static void Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Str1.free_struct; td->print_struct = asn_DEF_Str1.print_struct; td->ber_decoder = asn_DEF_Str1.ber_decoder; td->der_encoder = asn_DEF_Str1.der_encoder; td->xer_decoder = asn_DEF_Str1.xer_decoder; td->xer_encoder = asn_DEF_Str1.xer_encoder; td->uper_decoder = asn_DEF_Str1.uper_decoder; td->uper_encoder = asn_DEF_Str1.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Str1.per_constraints; td->elements = asn_DEF_Str1.elements; td->elements_count = asn_DEF_Str1.elements_count; td->specifics = asn_DEF_Str1.specifics; } void Str2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Str2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Str2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Str2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Str2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Str2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Str2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Str2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Str2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Str2_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Str2_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Str2_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Str2] >>> ***/ static asn_per_constraints_t asn_PER_type_Str2_constr_1 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */, 0, 0 /* No PER character map necessary */ }; /*** <<< STAT-DEFS [Str2] >>> ***/ static ber_tlv_tag_t asn_DEF_Str2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Str2 = { "Str2", "Str2", Str2_free, Str2_print, Str2_constraint, Str2_decode_ber, Str2_encode_der, Str2_decode_xer, Str2_encode_xer, Str2_decode_uper, Str2_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Str2_tags_1, sizeof(asn_DEF_Str2_tags_1) /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */ asn_DEF_Str2_tags_1, /* Same as above */ sizeof(asn_DEF_Str2_tags_1) /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */ &asn_PER_type_Str2_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Str3] >>> ***/ #include "Str2.h" /*** <<< TYPE-DECLS [Str3] >>> ***/ typedef Str2_t Str3_t; /*** <<< FUNC-DECLS [Str3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Str3; asn_struct_free_f Str3_free; asn_struct_print_f Str3_print; asn_constr_check_f Str3_constraint; ber_type_decoder_f Str3_decode_ber; der_type_encoder_f Str3_encode_der; xer_type_decoder_f Str3_decode_xer; xer_type_encoder_f Str3_encode_xer; per_type_decoder_f Str3_decode_uper; per_type_encoder_f Str3_encode_uper; /*** <<< CTABLES [Str3] >>> ***/ static int permitted_alphabet_table_1[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */ }; static int permitted_alphabet_code2value_1[6] = { 65,66,67,100,101,102,}; static int check_permitted_alphabet_1(const void *sptr) { int *table = permitted_alphabet_table_1; /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } /*** <<< CODE [Str3] >>> ***/ int Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Str2_t *st = (const Str2_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27)) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int asn_PER_MAP_Str3_1_v2c(unsigned int value) { if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0])) return -1; return permitted_alphabet_table_1[value] - 1; } static int asn_PER_MAP_Str3_1_c2v(unsigned int code) { if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0])) return -1; return permitted_alphabet_code2value_1[code]; } /* * This type is implemented using Str2, * so here we adjust the DEF accordingly. */ static void Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Str2.free_struct; td->print_struct = asn_DEF_Str2.print_struct; td->ber_decoder = asn_DEF_Str2.ber_decoder; td->der_encoder = asn_DEF_Str2.der_encoder; td->xer_decoder = asn_DEF_Str2.xer_decoder; td->xer_encoder = asn_DEF_Str2.xer_encoder; td->uper_decoder = asn_DEF_Str2.uper_decoder; td->uper_encoder = asn_DEF_Str2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Str2.per_constraints; td->elements = asn_DEF_Str2.elements; td->elements_count = asn_DEF_Str2.elements_count; td->specifics = asn_DEF_Str2.specifics; } void Str3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Str3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Str3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Str3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Str3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Str3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Str3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Str3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Str3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Str3_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Str3_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Str3_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Str3] >>> ***/ static asn_per_constraints_t asn_PER_type_Str3_constr_1 = { { APC_CONSTRAINED, 3, 3, 65, 102 } /* (65..102) */, { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */, asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */ asn_PER_MAP_Str3_1_c2v /* PER code to value map */ }; /*** <<< STAT-DEFS [Str3] >>> ***/ static ber_tlv_tag_t asn_DEF_Str3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Str3 = { "Str3", "Str3", Str3_free, Str3_print, Str3_constraint, Str3_decode_ber, Str3_encode_der, Str3_decode_xer, Str3_encode_xer, Str3_decode_uper, Str3_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Str3_tags_1, sizeof(asn_DEF_Str3_tags_1) /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */ asn_DEF_Str3_tags_1, /* Same as above */ sizeof(asn_DEF_Str3_tags_1) /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */ &asn_PER_type_Str3_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Str4] >>> ***/ #include /*** <<< TYPE-DECLS [Str4] >>> ***/ typedef IA5String_t Str4_t; /*** <<< FUNC-DECLS [Str4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Str4; asn_struct_free_f Str4_free; asn_struct_print_f Str4_print; asn_constr_check_f Str4_constraint; ber_type_decoder_f Str4_decode_ber; der_type_encoder_f Str4_encode_der; xer_type_decoder_f Str4_decode_xer; xer_type_encoder_f Str4_encode_xer; per_type_decoder_f Str4_decode_uper; per_type_encoder_f Str4_encode_uper; /*** <<< CTABLES [Str4] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv <= 127)) return -1; } return 0; } /*** <<< CODE [Str4] >>> ***/ int Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using IA5String, * so here we adjust the DEF accordingly. */ static void Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_IA5String.free_struct; td->print_struct = asn_DEF_IA5String.print_struct; td->ber_decoder = asn_DEF_IA5String.ber_decoder; td->der_encoder = asn_DEF_IA5String.der_encoder; td->xer_decoder = asn_DEF_IA5String.xer_decoder; td->xer_encoder = asn_DEF_IA5String.xer_encoder; td->uper_decoder = asn_DEF_IA5String.uper_decoder; td->uper_encoder = asn_DEF_IA5String.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_IA5String.per_constraints; td->elements = asn_DEF_IA5String.elements; td->elements_count = asn_DEF_IA5String.elements_count; td->specifics = asn_DEF_IA5String.specifics; } void Str4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Str4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Str4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Str4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Str4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Str4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Str4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Str4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Str4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Str4_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Str4_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Str4_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Str4] >>> ***/ static asn_per_constraints_t asn_PER_type_Str4_constr_1 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; /*** <<< STAT-DEFS [Str4] >>> ***/ static ber_tlv_tag_t asn_DEF_Str4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Str4 = { "Str4", "Str4", Str4_free, Str4_print, Str4_constraint, Str4_decode_ber, Str4_encode_der, Str4_decode_xer, Str4_encode_xer, Str4_decode_uper, Str4_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Str4_tags_1, sizeof(asn_DEF_Str4_tags_1) /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */ asn_DEF_Str4_tags_1, /* Same as above */ sizeof(asn_DEF_Str4_tags_1) /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */ &asn_PER_type_Str4_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [PER-Visible] >>> ***/ #include /*** <<< TYPE-DECLS [PER-Visible] >>> ***/ typedef IA5String_t PER_Visible_t; /*** <<< FUNC-DECLS [PER-Visible] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_PER_Visible; asn_struct_free_f PER_Visible_free; asn_struct_print_f PER_Visible_print; asn_constr_check_f PER_Visible_constraint; ber_type_decoder_f PER_Visible_decode_ber; der_type_encoder_f PER_Visible_encode_der; xer_type_decoder_f PER_Visible_decode_xer; xer_type_encoder_f PER_Visible_encode_xer; per_type_decoder_f PER_Visible_decode_uper; per_type_encoder_f PER_Visible_encode_uper; /*** <<< CTABLES [PER-Visible] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 70)) return -1; } return 0; } /*** <<< CODE [PER-Visible] >>> ***/ int PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using IA5String, * so here we adjust the DEF accordingly. */ static void PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_IA5String.free_struct; td->print_struct = asn_DEF_IA5String.print_struct; td->ber_decoder = asn_DEF_IA5String.ber_decoder; td->der_encoder = asn_DEF_IA5String.der_encoder; td->xer_decoder = asn_DEF_IA5String.xer_decoder; td->xer_encoder = asn_DEF_IA5String.xer_encoder; td->uper_decoder = asn_DEF_IA5String.uper_decoder; td->uper_encoder = asn_DEF_IA5String.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_IA5String.per_constraints; td->elements = asn_DEF_IA5String.elements; td->elements_count = asn_DEF_IA5String.elements_count; td->specifics = asn_DEF_IA5String.specifics; } void PER_Visible_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { PER_Visible_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t PER_Visible_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t PER_Visible_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t PER_Visible_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [PER-Visible] >>> ***/ static asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 = { { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; /*** <<< STAT-DEFS [PER-Visible] >>> ***/ static ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_PER_Visible = { "PER-Visible", "PER-Visible", PER_Visible_free, PER_Visible_print, PER_Visible_constraint, PER_Visible_decode_ber, PER_Visible_encode_der, PER_Visible_decode_xer, PER_Visible_encode_xer, PER_Visible_decode_uper, PER_Visible_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_PER_Visible_tags_1, sizeof(asn_DEF_PER_Visible_tags_1) /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */ asn_DEF_PER_Visible_tags_1, /* Same as above */ sizeof(asn_DEF_PER_Visible_tags_1) /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */ &asn_PER_type_PER_Visible_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [PER-Visible-2] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/ typedef PER_Visible_t PER_Visible_2_t; /*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2; asn_struct_free_f PER_Visible_2_free; asn_struct_print_f PER_Visible_2_print; asn_constr_check_f PER_Visible_2_constraint; ber_type_decoder_f PER_Visible_2_decode_ber; der_type_encoder_f PER_Visible_2_encode_der; xer_type_decoder_f PER_Visible_2_decode_xer; xer_type_encoder_f PER_Visible_2_encode_xer; per_type_decoder_f PER_Visible_2_decode_uper; per_type_encoder_f PER_Visible_2_encode_uper; /*** <<< CTABLES [PER-Visible-2] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 69 && cv <= 70)) return -1; } return 0; } /*** <<< CODE [PER-Visible-2] >>> ***/ int PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void PER_Visible_2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { PER_Visible_2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [PER-Visible-2] >>> ***/ static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 = { { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; /*** <<< STAT-DEFS [PER-Visible-2] >>> ***/ static ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = { "PER-Visible-2", "PER-Visible-2", PER_Visible_2_free, PER_Visible_2_print, PER_Visible_2_constraint, PER_Visible_2_decode_ber, PER_Visible_2_encode_der, PER_Visible_2_decode_xer, PER_Visible_2_encode_xer, PER_Visible_2_decode_uper, PER_Visible_2_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_PER_Visible_2_tags_1, sizeof(asn_DEF_PER_Visible_2_tags_1) /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */ asn_DEF_PER_Visible_2_tags_1, /* Same as above */ sizeof(asn_DEF_PER_Visible_2_tags_1) /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */ &asn_PER_type_PER_Visible_2_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/ typedef PER_Visible_t Not_PER_Visible_1_t; /*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1; asn_struct_free_f Not_PER_Visible_1_free; asn_struct_print_f Not_PER_Visible_1_print; asn_constr_check_f Not_PER_Visible_1_constraint; ber_type_decoder_f Not_PER_Visible_1_decode_ber; der_type_encoder_f Not_PER_Visible_1_encode_der; xer_type_decoder_f Not_PER_Visible_1_decode_xer; xer_type_encoder_f Not_PER_Visible_1_encode_xer; per_type_decoder_f Not_PER_Visible_1_decode_uper; per_type_encoder_f Not_PER_Visible_1_encode_uper; /*** <<< CTABLES [Not-PER-Visible-1] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 70)) return -1; } return 0; } /*** <<< CODE [Not-PER-Visible-1] >>> ***/ int Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Not_PER_Visible_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Not_PER_Visible_1_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/ static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 = { { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; /*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/ static ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = { "Not-PER-Visible-1", "Not-PER-Visible-1", Not_PER_Visible_1_free, Not_PER_Visible_1_print, Not_PER_Visible_1_constraint, Not_PER_Visible_1_decode_ber, Not_PER_Visible_1_encode_der, Not_PER_Visible_1_decode_xer, Not_PER_Visible_1_encode_xer, Not_PER_Visible_1_decode_uper, Not_PER_Visible_1_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Not_PER_Visible_1_tags_1, sizeof(asn_DEF_Not_PER_Visible_1_tags_1) /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */ asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */ sizeof(asn_DEF_Not_PER_Visible_1_tags_1) /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */ &asn_PER_type_Not_PER_Visible_1_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/ typedef PER_Visible_t Not_PER_Visible_2_t; /*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2; asn_struct_free_f Not_PER_Visible_2_free; asn_struct_print_f Not_PER_Visible_2_print; asn_constr_check_f Not_PER_Visible_2_constraint; ber_type_decoder_f Not_PER_Visible_2_decode_ber; der_type_encoder_f Not_PER_Visible_2_encode_der; xer_type_decoder_f Not_PER_Visible_2_decode_xer; xer_type_encoder_f Not_PER_Visible_2_encode_xer; per_type_decoder_f Not_PER_Visible_2_decode_uper; per_type_encoder_f Not_PER_Visible_2_encode_uper; /*** <<< CTABLES [Not-PER-Visible-2] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 66)) return -1; } return 0; } /*** <<< CODE [Not-PER-Visible-2] >>> ***/ int Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Not_PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Not_PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/ static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; /*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/ static ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = { "Not-PER-Visible-2", "Not-PER-Visible-2", Not_PER_Visible_2_free, Not_PER_Visible_2_print, Not_PER_Visible_2_constraint, Not_PER_Visible_2_decode_ber, Not_PER_Visible_2_encode_der, Not_PER_Visible_2_decode_xer, Not_PER_Visible_2_encode_xer, Not_PER_Visible_2_decode_uper, Not_PER_Visible_2_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Not_PER_Visible_2_tags_1, sizeof(asn_DEF_Not_PER_Visible_2_tags_1) /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */ asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */ sizeof(asn_DEF_Not_PER_Visible_2_tags_1) /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */ &asn_PER_type_Not_PER_Visible_2_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/ typedef PER_Visible_t Not_PER_Visible_3_t; /*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3; asn_struct_free_f Not_PER_Visible_3_free; asn_struct_print_f Not_PER_Visible_3_print; asn_constr_check_f Not_PER_Visible_3_constraint; ber_type_decoder_f Not_PER_Visible_3_decode_ber; der_type_encoder_f Not_PER_Visible_3_encode_der; xer_type_decoder_f Not_PER_Visible_3_decode_xer; xer_type_encoder_f Not_PER_Visible_3_encode_xer; per_type_decoder_f Not_PER_Visible_3_decode_uper; per_type_encoder_f Not_PER_Visible_3_encode_uper; /*** <<< CTABLES [Not-PER-Visible-3] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 66)) return -1; } return 0; } /*** <<< CODE [Not-PER-Visible-3] >>> ***/ int Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Not_PER_Visible_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Not_PER_Visible_3_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/ static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; /*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/ static ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = { "Not-PER-Visible-3", "Not-PER-Visible-3", Not_PER_Visible_3_free, Not_PER_Visible_3_print, Not_PER_Visible_3_constraint, Not_PER_Visible_3_decode_ber, Not_PER_Visible_3_encode_der, Not_PER_Visible_3_decode_xer, Not_PER_Visible_3_encode_xer, Not_PER_Visible_3_decode_uper, Not_PER_Visible_3_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Not_PER_Visible_3_tags_1, sizeof(asn_DEF_Not_PER_Visible_3_tags_1) /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */ asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */ sizeof(asn_DEF_Not_PER_Visible_3_tags_1) /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */ &asn_PER_type_Not_PER_Visible_3_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/ typedef PER_Visible_t SIZE_but_not_FROM_t; /*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM; asn_struct_free_f SIZE_but_not_FROM_free; asn_struct_print_f SIZE_but_not_FROM_print; asn_constr_check_f SIZE_but_not_FROM_constraint; ber_type_decoder_f SIZE_but_not_FROM_decode_ber; der_type_encoder_f SIZE_but_not_FROM_encode_der; xer_type_decoder_f SIZE_but_not_FROM_decode_xer; xer_type_encoder_f SIZE_but_not_FROM_encode_xer; per_type_decoder_f SIZE_but_not_FROM_decode_uper; per_type_encoder_f SIZE_but_not_FROM_encode_uper; /*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 68)) return -1; } return 0; } /*** <<< CODE [SIZE-but-not-FROM] >>> ***/ int SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1 && size <= 4) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t SIZE_but_not_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t SIZE_but_not_FROM_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/ static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */, 0, 0 /* No PER character map necessary */ }; /*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/ static ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = { "SIZE-but-not-FROM", "SIZE-but-not-FROM", SIZE_but_not_FROM_free, SIZE_but_not_FROM_print, SIZE_but_not_FROM_constraint, SIZE_but_not_FROM_decode_ber, SIZE_but_not_FROM_encode_der, SIZE_but_not_FROM_decode_xer, SIZE_but_not_FROM_encode_xer, SIZE_but_not_FROM_decode_uper, SIZE_but_not_FROM_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_SIZE_but_not_FROM_tags_1, sizeof(asn_DEF_SIZE_but_not_FROM_tags_1) /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */ asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */ sizeof(asn_DEF_SIZE_but_not_FROM_tags_1) /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */ &asn_PER_type_SIZE_but_not_FROM_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [SIZE-and-FROM] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/ typedef PER_Visible_t SIZE_and_FROM_t; /*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM; asn_struct_free_f SIZE_and_FROM_free; asn_struct_print_f SIZE_and_FROM_print; asn_constr_check_f SIZE_and_FROM_constraint; ber_type_decoder_f SIZE_and_FROM_decode_ber; der_type_encoder_f SIZE_and_FROM_encode_der; xer_type_decoder_f SIZE_and_FROM_decode_xer; xer_type_encoder_f SIZE_and_FROM_encode_xer; per_type_decoder_f SIZE_and_FROM_decode_uper; per_type_encoder_f SIZE_and_FROM_encode_uper; /*** <<< CTABLES [SIZE-and-FROM] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 68)) return -1; } return 0; } /*** <<< CODE [SIZE-and-FROM] >>> ***/ int SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1 && size <= 4) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void SIZE_and_FROM_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t SIZE_and_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t SIZE_and_FROM_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [SIZE-and-FROM] >>> ***/ static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 = { { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */, { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */, 0, 0 /* No PER character map necessary */ }; /*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/ static ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = { "SIZE-and-FROM", "SIZE-and-FROM", SIZE_and_FROM_free, SIZE_and_FROM_print, SIZE_and_FROM_constraint, SIZE_and_FROM_decode_ber, SIZE_and_FROM_encode_der, SIZE_and_FROM_decode_xer, SIZE_and_FROM_encode_xer, SIZE_and_FROM_decode_uper, SIZE_and_FROM_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_SIZE_and_FROM_tags_1, sizeof(asn_DEF_SIZE_and_FROM_tags_1) /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */ asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */ sizeof(asn_DEF_SIZE_and_FROM_tags_1) /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */ &asn_PER_type_SIZE_and_FROM_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/ typedef PER_Visible_t Neither_SIZE_nor_FROM_t; /*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM; asn_struct_free_f Neither_SIZE_nor_FROM_free; asn_struct_print_f Neither_SIZE_nor_FROM_print; asn_constr_check_f Neither_SIZE_nor_FROM_constraint; ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber; der_type_encoder_f Neither_SIZE_nor_FROM_encode_der; xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer; xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer; per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper; per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper; /*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 70)) return -1; } return 0; } /*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/ int Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Neither_SIZE_nor_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Neither_SIZE_nor_FROM_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/ static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 = { { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, 0, 0 /* No PER character map necessary */ }; /*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/ static ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = { "Neither-SIZE-nor-FROM", "Neither-SIZE-nor-FROM", Neither_SIZE_nor_FROM_free, Neither_SIZE_nor_FROM_print, Neither_SIZE_nor_FROM_constraint, Neither_SIZE_nor_FROM_decode_ber, Neither_SIZE_nor_FROM_encode_der, Neither_SIZE_nor_FROM_decode_xer, Neither_SIZE_nor_FROM_encode_xer, Neither_SIZE_nor_FROM_decode_uper, Neither_SIZE_nor_FROM_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Neither_SIZE_nor_FROM_tags_1, sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1) /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */ asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */ sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1) /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */ &asn_PER_type_Neither_SIZE_nor_FROM_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Utf8-4] >>> ***/ #include /*** <<< TYPE-DECLS [Utf8-4] >>> ***/ typedef UTF8String_t Utf8_4_t; /*** <<< FUNC-DECLS [Utf8-4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Utf8_4; asn_struct_free_f Utf8_4_free; asn_struct_print_f Utf8_4_print; asn_constr_check_f Utf8_4_constraint; ber_type_decoder_f Utf8_4_decode_ber; der_type_encoder_f Utf8_4_encode_der; xer_type_decoder_f Utf8_4_decode_xer; xer_type_encoder_f Utf8_4_encode_xer; per_type_decoder_f Utf8_4_decode_uper; per_type_encoder_f Utf8_4_encode_uper; /*** <<< CTABLES [Utf8-4] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { if(UTF8String_length((const UTF8String_t *)sptr) < 0) return -1; /* Alphabet (sic!) test failed. */ return 0; } /*** <<< CODE [Utf8-4] >>> ***/ int Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using UTF8String, * so here we adjust the DEF accordingly. */ static void Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_UTF8String.free_struct; td->print_struct = asn_DEF_UTF8String.print_struct; td->ber_decoder = asn_DEF_UTF8String.ber_decoder; td->der_encoder = asn_DEF_UTF8String.der_encoder; td->xer_decoder = asn_DEF_UTF8String.xer_decoder; td->xer_encoder = asn_DEF_UTF8String.xer_encoder; td->uper_decoder = asn_DEF_UTF8String.uper_decoder; td->uper_encoder = asn_DEF_UTF8String.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_UTF8String.per_constraints; td->elements = asn_DEF_UTF8String.elements; td->elements_count = asn_DEF_UTF8String.elements_count; td->specifics = asn_DEF_UTF8String.specifics; } void Utf8_4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Utf8_4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Utf8_4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Utf8_4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Utf8_4_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Utf8-4] >>> ***/ static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Utf8-4] >>> ***/ static ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Utf8_4 = { "Utf8-4", "Utf8-4", Utf8_4_free, Utf8_4_print, Utf8_4_constraint, Utf8_4_decode_ber, Utf8_4_encode_der, Utf8_4_decode_xer, Utf8_4_encode_xer, Utf8_4_decode_uper, Utf8_4_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Utf8_4_tags_1, sizeof(asn_DEF_Utf8_4_tags_1) /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */ asn_DEF_Utf8_4_tags_1, /* Same as above */ sizeof(asn_DEF_Utf8_4_tags_1) /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */ &asn_PER_type_Utf8_4_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Utf8-3] >>> ***/ #include "Utf8-2.h" /*** <<< TYPE-DECLS [Utf8-3] >>> ***/ typedef Utf8_2_t Utf8_3_t; /*** <<< FUNC-DECLS [Utf8-3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Utf8_3; asn_struct_free_f Utf8_3_free; asn_struct_print_f Utf8_3_print; asn_constr_check_f Utf8_3_constraint; ber_type_decoder_f Utf8_3_decode_ber; der_type_encoder_f Utf8_3_encode_der; xer_type_decoder_f Utf8_3_decode_xer; xer_type_encoder_f Utf8_3_encode_xer; per_type_decoder_f Utf8_3_decode_uper; per_type_encoder_f Utf8_3_encode_uper; /*** <<< CTABLES [Utf8-3] >>> ***/ static int permitted_alphabet_table_1[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */ 16,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */ 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */ 42,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ }; static int check_permitted_alphabet_1(const void *sptr) { int *table = permitted_alphabet_table_1; /* The underlying type is UTF8String */ const UTF8String_t *st = (const UTF8String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(cv >= 0x80) return -1; if(!table[cv]) return -1; } return 0; } /*** <<< CODE [Utf8-3] >>> ***/ int Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Utf8_2_t *st = (const Utf8_2_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, "%s: UTF-8: broken encoding (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((size >= 1 && size <= 2) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Utf8_2, * so here we adjust the DEF accordingly. */ static void Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Utf8_2.free_struct; td->print_struct = asn_DEF_Utf8_2.print_struct; td->ber_decoder = asn_DEF_Utf8_2.ber_decoder; td->der_encoder = asn_DEF_Utf8_2.der_encoder; td->xer_decoder = asn_DEF_Utf8_2.xer_decoder; td->xer_encoder = asn_DEF_Utf8_2.xer_encoder; td->uper_decoder = asn_DEF_Utf8_2.uper_decoder; td->uper_encoder = asn_DEF_Utf8_2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Utf8_2.per_constraints; td->elements = asn_DEF_Utf8_2.elements; td->elements_count = asn_DEF_Utf8_2.elements_count; td->specifics = asn_DEF_Utf8_2.specifics; } void Utf8_3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Utf8_3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Utf8_3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Utf8_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Utf8_3_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Utf8-3] >>> ***/ static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Utf8-3] >>> ***/ static ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Utf8_3 = { "Utf8-3", "Utf8-3", Utf8_3_free, Utf8_3_print, Utf8_3_constraint, Utf8_3_decode_ber, Utf8_3_encode_der, Utf8_3_decode_xer, Utf8_3_encode_xer, Utf8_3_decode_uper, Utf8_3_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Utf8_3_tags_1, sizeof(asn_DEF_Utf8_3_tags_1) /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */ asn_DEF_Utf8_3_tags_1, /* Same as above */ sizeof(asn_DEF_Utf8_3_tags_1) /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */ &asn_PER_type_Utf8_3_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Utf8-2] >>> ***/ #include "Utf8-1.h" /*** <<< TYPE-DECLS [Utf8-2] >>> ***/ typedef Utf8_1_t Utf8_2_t; /*** <<< FUNC-DECLS [Utf8-2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Utf8_2; asn_struct_free_f Utf8_2_free; asn_struct_print_f Utf8_2_print; asn_constr_check_f Utf8_2_constraint; ber_type_decoder_f Utf8_2_decode_ber; der_type_encoder_f Utf8_2_encode_der; xer_type_decoder_f Utf8_2_decode_xer; xer_type_encoder_f Utf8_2_encode_xer; per_type_decoder_f Utf8_2_decode_uper; per_type_encoder_f Utf8_2_encode_uper; /*** <<< CODE [Utf8-2] >>> ***/ int Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Utf8_1_t *st = (const Utf8_1_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, "%s: UTF-8: broken encoding (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((size >= 1 && size <= 2)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Utf8_1, * so here we adjust the DEF accordingly. */ static void Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Utf8_1.free_struct; td->print_struct = asn_DEF_Utf8_1.print_struct; td->ber_decoder = asn_DEF_Utf8_1.ber_decoder; td->der_encoder = asn_DEF_Utf8_1.der_encoder; td->xer_decoder = asn_DEF_Utf8_1.xer_decoder; td->xer_encoder = asn_DEF_Utf8_1.xer_encoder; td->uper_decoder = asn_DEF_Utf8_1.uper_decoder; td->uper_encoder = asn_DEF_Utf8_1.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Utf8_1.per_constraints; td->elements = asn_DEF_Utf8_1.elements; td->elements_count = asn_DEF_Utf8_1.elements_count; td->specifics = asn_DEF_Utf8_1.specifics; } void Utf8_2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Utf8_2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Utf8_2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Utf8_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Utf8_2_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Utf8-2] >>> ***/ static asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Utf8-2] >>> ***/ static ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Utf8_2 = { "Utf8-2", "Utf8-2", Utf8_2_free, Utf8_2_print, Utf8_2_constraint, Utf8_2_decode_ber, Utf8_2_encode_der, Utf8_2_decode_xer, Utf8_2_encode_xer, Utf8_2_decode_uper, Utf8_2_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Utf8_2_tags_1, sizeof(asn_DEF_Utf8_2_tags_1) /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */ asn_DEF_Utf8_2_tags_1, /* Same as above */ sizeof(asn_DEF_Utf8_2_tags_1) /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */ &asn_PER_type_Utf8_2_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Utf8-1] >>> ***/ #include /*** <<< TYPE-DECLS [Utf8-1] >>> ***/ typedef UTF8String_t Utf8_1_t; /*** <<< FUNC-DECLS [Utf8-1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Utf8_1; asn_struct_free_f Utf8_1_free; asn_struct_print_f Utf8_1_print; asn_constr_check_f Utf8_1_constraint; ber_type_decoder_f Utf8_1_decode_ber; der_type_encoder_f Utf8_1_encode_der; xer_type_decoder_f Utf8_1_decode_xer; xer_type_encoder_f Utf8_1_encode_xer; per_type_decoder_f Utf8_1_decode_uper; per_type_encoder_f Utf8_1_encode_uper; /*** <<< CODE [Utf8-1] >>> ***/ int Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_UTF8String.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using UTF8String, * so here we adjust the DEF accordingly. */ static void Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_UTF8String.free_struct; td->print_struct = asn_DEF_UTF8String.print_struct; td->ber_decoder = asn_DEF_UTF8String.ber_decoder; td->der_encoder = asn_DEF_UTF8String.der_encoder; td->xer_decoder = asn_DEF_UTF8String.xer_decoder; td->xer_encoder = asn_DEF_UTF8String.xer_encoder; td->uper_decoder = asn_DEF_UTF8String.uper_decoder; td->uper_encoder = asn_DEF_UTF8String.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_UTF8String.per_constraints; td->elements = asn_DEF_UTF8String.elements; td->elements_count = asn_DEF_UTF8String.elements_count; td->specifics = asn_DEF_UTF8String.specifics; } void Utf8_1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Utf8_1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Utf8_1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Utf8_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Utf8_1_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< STAT-DEFS [Utf8-1] >>> ***/ static ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Utf8_1 = { "Utf8-1", "Utf8-1", Utf8_1_free, Utf8_1_print, Utf8_1_constraint, Utf8_1_decode_ber, Utf8_1_encode_der, Utf8_1_decode_xer, Utf8_1_encode_xer, Utf8_1_decode_uper, Utf8_1_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Utf8_1_tags_1, sizeof(asn_DEF_Utf8_1_tags_1) /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */ asn_DEF_Utf8_1_tags_1, /* Same as above */ sizeof(asn_DEF_Utf8_1_tags_1) /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [VisibleIdentifier] >>> ***/ #include "Identifier.h" /*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/ typedef Identifier_t VisibleIdentifier_t; /*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier; asn_struct_free_f VisibleIdentifier_free; asn_struct_print_f VisibleIdentifier_print; asn_constr_check_f VisibleIdentifier_constraint; ber_type_decoder_f VisibleIdentifier_decode_ber; der_type_encoder_f VisibleIdentifier_encode_der; xer_type_decoder_f VisibleIdentifier_decode_xer; xer_type_encoder_f VisibleIdentifier_encode_xer; per_type_decoder_f VisibleIdentifier_decode_uper; per_type_encoder_f VisibleIdentifier_encode_uper; /*** <<< CTABLES [VisibleIdentifier] >>> ***/ static int permitted_alphabet_table_1[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */ 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */ 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */ 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */ 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */ 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ }; static int permitted_alphabet_code2value_1[64] = { 36,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69, 70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85, 86,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106, 107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122, }; static int check_permitted_alphabet_1(const void *sptr) { int *table = permitted_alphabet_table_1; /* The underlying type is VisibleString */ const VisibleString_t *st = (const VisibleString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } /*** <<< CODE [VisibleIdentifier] >>> ***/ int VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Identifier_t *st = (const Identifier_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1 && size <= 32) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Identifier, * so here we adjust the DEF accordingly. */ static void VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Identifier.free_struct; td->print_struct = asn_DEF_Identifier.print_struct; td->ber_decoder = asn_DEF_Identifier.ber_decoder; td->der_encoder = asn_DEF_Identifier.der_encoder; td->xer_decoder = asn_DEF_Identifier.xer_decoder; td->xer_encoder = asn_DEF_Identifier.xer_encoder; td->uper_decoder = asn_DEF_Identifier.uper_decoder; td->uper_encoder = asn_DEF_Identifier.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Identifier.per_constraints; td->elements = asn_DEF_Identifier.elements; td->elements_count = asn_DEF_Identifier.elements_count; td->specifics = asn_DEF_Identifier.specifics; } void VisibleIdentifier_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t VisibleIdentifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t VisibleIdentifier_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/ static ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)) }; asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = { "VisibleIdentifier", "VisibleIdentifier", VisibleIdentifier_free, VisibleIdentifier_print, VisibleIdentifier_constraint, VisibleIdentifier_decode_ber, VisibleIdentifier_encode_der, VisibleIdentifier_decode_xer, VisibleIdentifier_encode_xer, VisibleIdentifier_decode_uper, VisibleIdentifier_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_VisibleIdentifier_tags_1, sizeof(asn_DEF_VisibleIdentifier_tags_1) /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */ asn_DEF_VisibleIdentifier_tags_1, /* Same as above */ sizeof(asn_DEF_VisibleIdentifier_tags_1) /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Sequence] >>> ***/ #include "Int1.h" #include "Int4.h" #include #include #include #include "Int5.h" #include /*** <<< DEPS [Sequence] >>> ***/ typedef enum enum_c { enum_c_one = 1, enum_c_two = 2, /* * Enumeration is extensible */ enum_c_three = 3 } e_enum_c; /*** <<< TYPE-DECLS [Sequence] >>> ***/ typedef struct Sequence { Int1_t *int1_c /* DEFAULT 3 */; Int4_t int4; Int4_t int4_c; BOOLEAN_t *bool /* DEFAULT 1 */; ENUMERATED_t enum_c; NULL_t *null /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */ Int5_t *int5_c /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Sequence_t; /*** <<< FUNC-DECLS [Sequence] >>> ***/ /* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_Sequence; /*** <<< CODE [Sequence] >>> ***/ static int enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } static void enum_c_6_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { enum_c_6_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { enum_c_6_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { enum_c_6_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t enum_c_6_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { enum_c_6_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { enum_c_6_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { enum_c_6_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static asn_dec_rval_t enum_c_6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { enum_c_6_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } static asn_enc_rval_t enum_c_6_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { enum_c_6_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } static int memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int1_t *st = (const Int1_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= -2)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int4_t *st = (const Int4_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 5 && value <= 7)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int5_t *st = (const Int5_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value == 5)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< CTDEFS [Sequence] >>> ***/ static asn_per_constraints_t asn_PER_type_enum_c_constr_6 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 = { { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 = { { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 = { { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Sequence] >>> ***/ static int asn_DFL_2_set_3(int set_value, void **sptr) { Int1_t *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { /* Install default value 3 */ return asn_long2INTEGER(st, 3); } else { /* Test default value 3 */ long value; if(asn_INTEGER2long(st, &value)) return -1; return (value == 3); } } static int asn_DFL_5_set_1(int set_value, void **sptr) { BOOLEAN_t *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { /* Install default value 1 */ *st = 1; return 0; } else { /* Test default value 1 */ return (*st == 1); } } static asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = { { 1, 3, "one" }, { 2, 3, "two" }, { 3, 5, "three" } /* This list is extensible */ }; static unsigned int asn_MAP_enum_c_enum2value_6[] = { 0, /* one(1) */ 2, /* three(3) */ 1 /* two(2) */ /* This list is extensible */ }; static asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = { asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */ asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */ 3, /* Number of elements in the maps */ 3, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_enum_c_6 = { "enum-c", "enum-c", enum_c_6_free, enum_c_6_print, enum_c_6_constraint, enum_c_6_decode_ber, enum_c_6_encode_der, enum_c_6_decode_xer, enum_c_6_encode_xer, enum_c_6_decode_uper, enum_c_6_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_enum_c_tags_6, sizeof(asn_DEF_enum_c_tags_6) /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */ asn_DEF_enum_c_tags_6, /* Same as above */ sizeof(asn_DEF_enum_c_tags_6) /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */ &asn_PER_type_enum_c_constr_6, 0, 0, /* Defined elsewhere */ &asn_SPC_enum_c_specs_6 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Sequence_1[] = { { ATF_POINTER, 1, offsetof(struct Sequence, int1_c), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_Int1, .memb_constraints = memb_int1_c_constraint_1, .per_constraints = &asn_PER_memb_int1_c_constr_2, .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */ .name = "int1-c" }, { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Int4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "int4" }, { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_Int4, .memb_constraints = memb_int4_c_constraint_1, .per_constraints = &asn_PER_memb_int4_c_constr_4, .default_value = 0, .name = "int4-c" }, { ATF_POINTER, 1, offsetof(struct Sequence, bool), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */ .name = "bool" }, { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c), .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), .tag_mode = 0, .type = &asn_DEF_enum_c_6, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "enum-c" }, { ATF_POINTER, 2, offsetof(struct Sequence, null), .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), .tag_mode = 0, .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "null" }, { ATF_POINTER, 1, offsetof(struct Sequence, int5_c), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_Int5, .memb_constraints = memb_int5_c_constraint_1, .per_constraints = &asn_PER_memb_int5_c_constr_13, .default_value = 0, .name = "int5-c" }, }; static int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 }; static ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool at 59 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c at 56 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c at 58 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c at 62 */ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null at 64 */ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c at 60 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 at 57 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = { sizeof(struct Sequence), offsetof(struct Sequence, _asn_ctx), asn_MAP_Sequence_tag2el_1, 7, /* Count of tags in the map */ asn_MAP_Sequence_oms_1, /* Optional members */ 3, 1, /* Root/Additions */ 5, /* Start extensions */ 8 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Sequence = { "Sequence", "Sequence", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Sequence_tags_1, sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ asn_DEF_Sequence_tags_1, /* Same as above */ sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Sequence_1, 7, /* Elements count */ &asn_SPC_Sequence_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SequenceOf] >>> ***/ #include #include /*** <<< FWD-DECLS [SequenceOf] >>> ***/ struct Sequence; /*** <<< TYPE-DECLS [SequenceOf] >>> ***/ typedef struct SequenceOf { A_SEQUENCE_OF(struct Sequence) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SequenceOf_t; /*** <<< FUNC-DECLS [SequenceOf] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SequenceOf; /*** <<< POST-INCLUDE [SequenceOf] >>> ***/ #include "Sequence.h" /*** <<< CTDEFS [SequenceOf] >>> ***/ static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [SequenceOf] >>> ***/ static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = { sizeof(struct SequenceOf), offsetof(struct SequenceOf, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_SequenceOf = { "SequenceOf", "SequenceOf", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, SEQUENCE_OF_decode_uper, SEQUENCE_OF_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_SequenceOf_tags_1, sizeof(asn_DEF_SequenceOf_tags_1) /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */ asn_DEF_SequenceOf_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOf_tags_1) /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */ &asn_PER_type_SequenceOf_constr_1, asn_MBR_SequenceOf_1, 1, /* Single element */ &asn_SPC_SequenceOf_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Enum0] >>> ***/ #include /*** <<< DEPS [Enum0] >>> ***/ typedef enum Enum0 { Enum0_one = 0, Enum0_two = 1 } e_Enum0; /*** <<< TYPE-DECLS [Enum0] >>> ***/ typedef ENUMERATED_t Enum0_t; /*** <<< FUNC-DECLS [Enum0] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Enum0; asn_struct_free_f Enum0_free; asn_struct_print_f Enum0_print; asn_constr_check_f Enum0_constraint; ber_type_decoder_f Enum0_decode_ber; der_type_encoder_f Enum0_encode_der; xer_type_decoder_f Enum0_decode_xer; xer_type_encoder_f Enum0_encode_xer; per_type_decoder_f Enum0_decode_uper; per_type_encoder_f Enum0_encode_uper; /*** <<< CODE [Enum0] >>> ***/ int Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } void Enum0_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Enum0_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Enum0_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Enum0_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Enum0_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Enum0_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Enum0_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Enum0_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Enum0_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Enum0_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Enum0_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Enum0_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Enum0] >>> ***/ static asn_per_constraints_t asn_PER_type_Enum0_constr_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Enum0] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = { { 0, 3, "one" }, { 1, 3, "two" } }; static unsigned int asn_MAP_Enum0_enum2value_1[] = { 0, /* one(0) */ 1 /* two(1) */ }; static asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = { asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */ 2, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Enum0 = { "Enum0", "Enum0", Enum0_free, Enum0_print, Enum0_constraint, Enum0_decode_ber, Enum0_encode_der, Enum0_decode_xer, Enum0_encode_xer, Enum0_decode_uper, Enum0_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Enum0_tags_1, sizeof(asn_DEF_Enum0_tags_1) /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */ asn_DEF_Enum0_tags_1, /* Same as above */ sizeof(asn_DEF_Enum0_tags_1) /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */ &asn_PER_type_Enum0_constr_1, 0, 0, /* Defined elsewhere */ &asn_SPC_Enum0_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Enum1] >>> ***/ #include /*** <<< DEPS [Enum1] >>> ***/ typedef enum Enum1 { Enum1_one = 0, Enum1_two = 1 } e_Enum1; /*** <<< TYPE-DECLS [Enum1] >>> ***/ typedef long Enum1_t; /*** <<< FUNC-DECLS [Enum1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Enum1; asn_struct_free_f Enum1_free; asn_struct_print_f Enum1_print; asn_constr_check_f Enum1_constraint; ber_type_decoder_f Enum1_decode_ber; der_type_encoder_f Enum1_encode_der; xer_type_decoder_f Enum1_decode_xer; xer_type_encoder_f Enum1_encode_xer; per_type_decoder_f Enum1_decode_uper; per_type_encoder_f Enum1_encode_uper; /*** <<< CODE [Enum1] >>> ***/ int Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value == 0)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ static void Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeEnumerated.free_struct; td->print_struct = asn_DEF_NativeEnumerated.print_struct; td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } void Enum1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Enum1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Enum1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Enum1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Enum1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Enum1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Enum1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Enum1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Enum1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Enum1_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Enum1_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Enum1_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Enum1] >>> ***/ static asn_per_constraints_t asn_PER_type_Enum1_constr_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Enum1] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = { { 0, 3, "one" }, { 1, 3, "two" } }; static unsigned int asn_MAP_Enum1_enum2value_1[] = { 0, /* one(0) */ 1 /* two(1) */ }; static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = { asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */ 2, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Enum1 = { "Enum1", "Enum1", Enum1_free, Enum1_print, Enum1_constraint, Enum1_decode_ber, Enum1_encode_der, Enum1_decode_xer, Enum1_encode_xer, Enum1_decode_uper, Enum1_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Enum1_tags_1, sizeof(asn_DEF_Enum1_tags_1) /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ asn_DEF_Enum1_tags_1, /* Same as above */ sizeof(asn_DEF_Enum1_tags_1) /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ &asn_PER_type_Enum1_constr_1, 0, 0, /* Defined elsewhere */ &asn_SPC_Enum1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Identifier] >>> ***/ #include /*** <<< TYPE-DECLS [Identifier] >>> ***/ typedef VisibleString_t Identifier_t; /*** <<< FUNC-DECLS [Identifier] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Identifier; asn_struct_free_f Identifier_free; asn_struct_print_f Identifier_print; asn_constr_check_f Identifier_constraint; ber_type_decoder_f Identifier_decode_ber; der_type_encoder_f Identifier_encode_der; xer_type_decoder_f Identifier_decode_xer; xer_type_encoder_f Identifier_encode_xer; per_type_decoder_f Identifier_decode_uper; per_type_encoder_f Identifier_encode_uper; /*** <<< CTABLES [Identifier] >>> ***/ static int permitted_alphabet_table_1[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */ 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */ 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */ 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */ 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */ 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ }; static int permitted_alphabet_code2value_1[64] = { 36,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69, 70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85, 86,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106, 107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122, }; static int check_permitted_alphabet_1(const void *sptr) { int *table = permitted_alphabet_table_1; /* The underlying type is VisibleString */ const VisibleString_t *st = (const VisibleString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } /*** <<< CODE [Identifier] >>> ***/ int Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const VisibleString_t *st = (const VisibleString_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1 && size <= 32) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) { if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0])) return -1; return permitted_alphabet_table_1[value] - 1; } static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) { if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0])) return -1; return permitted_alphabet_code2value_1[code]; } /* * This type is implemented using VisibleString, * so here we adjust the DEF accordingly. */ static void Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_VisibleString.free_struct; td->print_struct = asn_DEF_VisibleString.print_struct; td->ber_decoder = asn_DEF_VisibleString.ber_decoder; td->der_encoder = asn_DEF_VisibleString.der_encoder; td->xer_decoder = asn_DEF_VisibleString.xer_decoder; td->xer_encoder = asn_DEF_VisibleString.xer_encoder; td->uper_decoder = asn_DEF_VisibleString.uper_decoder; td->uper_encoder = asn_DEF_VisibleString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_VisibleString.per_constraints; td->elements = asn_DEF_VisibleString.elements; td->elements_count = asn_DEF_VisibleString.elements_count; td->specifics = asn_DEF_VisibleString.specifics; } void Identifier_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Identifier_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Identifier_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Identifier_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Identifier_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Identifier_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Identifier_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Identifier_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t Identifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { Identifier_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t Identifier_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { Identifier_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [Identifier] >>> ***/ static asn_per_constraints_t asn_PER_type_Identifier_constr_1 = { { APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */, { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */, asn_PER_MAP_Identifier_1_v2c, /* Value to PER code map */ asn_PER_MAP_Identifier_1_c2v /* PER code to value map */ }; /*** <<< STAT-DEFS [Identifier] >>> ***/ static ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Identifier = { "Identifier", "Identifier", Identifier_free, Identifier_print, Identifier_constraint, Identifier_decode_ber, Identifier_encode_der, Identifier_decode_xer, Identifier_encode_xer, Identifier_decode_uper, Identifier_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_Identifier_tags_1, sizeof(asn_DEF_Identifier_tags_1) /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */ asn_DEF_Identifier_tags_1, /* Same as above */ sizeof(asn_DEF_Identifier_tags_1) /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */ &asn_PER_type_Identifier_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/34-class-OK.asn1.-EF0000644000000000000000000000157311461146446016401 0ustar rootrootModuleTestClassSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 34 } DEFINITIONS IMPLICIT TAGS ::= BEGIN EXTENSION ::= CLASS { &id [PRIVATE 0] INTEGER UNIQUE, &ExtnType } WITH SYNTAX { SYNTAX &ExtnType IDENTIFIED BY &id } Ext1 ::= SEQUENCE { extnId EXTENSION.&id } EXTENSION-ATTRIBUTE ::= CLASS { &id INTEGER (0..256) UNIQUE, &Type ANY } WITH SYNTAX {&Type IDENTIFIED BY &id} terminal-type EXTENSION-ATTRIBUTE ::= {TerminalType IDENTIFIED BY 23} TerminalType ::= INTEGER { terminal(0) } ExtensionAttribute ::= SEQUENCE { extension-attribute-type [0] IMPLICIT EXTENSION-ATTRIBUTE.&id ({ExtensionAttributeTable}), extension-attribute-value [1] EXPLICIT EXTENSION-ATTRIBUTE.&Type ({ExtensionAttributeTable}{@extension-attribute-type}) } ub-extension-attributes INTEGER ::= 256 END asn1c-0.9.24+dfsg/tests/35-set-choice-OK.asn10000644000000000000000000000114711461147103016736 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .35 ModuleTestSetAndUntaggedChoice { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 35 } DEFINITIONS ::= BEGIN T ::= SET { a NumericString, b CHOICE { -- Untagged choice b1 IA5String, b2 ObjectDescriptor, b3 Choice }, c BOOLEAN, ..., d OID } Choice ::= CHOICE { -- One more level ch-a OCTET STRING, ch-b BIT STRING } OID ::= CHOICE { oid OBJECT IDENTIFIER, r-oid RELATIVE-OID } END asn1c-0.9.24+dfsg/tests/105-param-2-OK.asn10000644000000000000000000000064611461147103016233 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .105 ModuleParameterization2 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 105 } DEFINITIONS ::= BEGIN SIGNED {Type} ::= SEQUENCE { signed Type } SignedREAL ::= SIGNED {REAL} SignedSET ::= SIGNED { SET { a INTEGER } } END asn1c-0.9.24+dfsg/tests/94-set-optionals-OK.asn1.-P0000644000000000000000000001605711461146446020013 0ustar rootroot /*** <<< INCLUDES [TestSet] >>> ***/ #include #include /*** <<< DEPS [TestSet] >>> ***/ /* * Method of determining the components presence */ typedef enum TestSet_PR { TestSet_PR_m0, /* Member m0 is present */ TestSet_PR_m1, /* Member m1 is present */ TestSet_PR_m2, /* Member m2 is present */ TestSet_PR_m3, /* Member m3 is present */ TestSet_PR_m4, /* Member m4 is present */ TestSet_PR_m5, /* Member m5 is present */ TestSet_PR_m6, /* Member m6 is present */ TestSet_PR_m7, /* Member m7 is present */ TestSet_PR_m8, /* Member m8 is present */ TestSet_PR_m9, /* Member m9 is present */ } TestSet_PR; /*** <<< TYPE-DECLS [TestSet] >>> ***/ typedef struct TestSet { VisibleString_t m0; VisibleString_t *m1 /* OPTIONAL */; VisibleString_t m2; VisibleString_t m3; VisibleString_t *m4 /* OPTIONAL */; VisibleString_t m5; VisibleString_t m6; VisibleString_t m7; VisibleString_t *m8 /* OPTIONAL */; VisibleString_t m9; /* * This type is extensible, * possible extensions are below. */ /* Presence bitmask: ASN_SET_ISPRESENT(pTestSet, TestSet_PR_x) */ unsigned int _presence_map [((10+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } TestSet_t; /*** <<< FUNC-DECLS [TestSet] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_TestSet; /*** <<< STAT-DEFS [TestSet] >>> ***/ static asn_TYPE_member_t asn_MBR_TestSet_1[] = { { ATF_NOFLAGS, 0, offsetof(struct TestSet, m0), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m0" }, { ATF_POINTER, 1, offsetof(struct TestSet, m1), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m1" }, { ATF_NOFLAGS, 0, offsetof(struct TestSet, m2), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m2" }, { ATF_NOFLAGS, 0, offsetof(struct TestSet, m3), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m3" }, { ATF_POINTER, 1, offsetof(struct TestSet, m4), .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m4" }, { ATF_NOFLAGS, 0, offsetof(struct TestSet, m5), .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m5" }, { ATF_NOFLAGS, 0, offsetof(struct TestSet, m6), .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m6" }, { ATF_NOFLAGS, 0, offsetof(struct TestSet, m7), .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m7" }, { ATF_POINTER, 1, offsetof(struct TestSet, m8), .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m8" }, { ATF_NOFLAGS, 0, offsetof(struct TestSet, m9), .tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m9" }, }; static ber_tlv_tag_t asn_DEF_TestSet_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_TestSet_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* m0 at 15 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* m1 at 16 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* m2 at 17 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* m3 at 18 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* m4 at 19 */ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* m5 at 20 */ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* m6 at 21 */ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* m7 at 22 */ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* m8 at 23 */ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 } /* m9 at 24 */ }; static uint8_t asn_MAP_TestSet_mmap_1[(10 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (0 << 3) | (1 << 2) | (1 << 1) | (1 << 0), (0 << 7) | (1 << 6) }; static asn_SET_specifics_t asn_SPC_TestSet_specs_1 = { sizeof(struct TestSet), offsetof(struct TestSet, _asn_ctx), offsetof(struct TestSet, _presence_map), asn_MAP_TestSet_tag2el_1, 10, /* Count of tags in the map */ asn_MAP_TestSet_tag2el_1, /* Same as above */ 10, /* Count of tags in the CXER map */ 1, /* Whether extensible */ (unsigned int *)asn_MAP_TestSet_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_TestSet = { "TestSet", "TestSet", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TestSet_tags_1, sizeof(asn_DEF_TestSet_tags_1) /sizeof(asn_DEF_TestSet_tags_1[0]), /* 1 */ asn_DEF_TestSet_tags_1, /* Same as above */ sizeof(asn_DEF_TestSet_tags_1) /sizeof(asn_DEF_TestSet_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_TestSet_1, 10, /* Elements count */ &asn_SPC_TestSet_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/78-str-default-SE.asn10000644000000000000000000000064111461147103017150 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .78 ModuleTestStringDefault2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 78 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN Type ::= SEQUENCE { country UTF8String DEFAULT country1, ... } country1 GeneralString ::= "Cyprus" END asn1c-0.9.24+dfsg/tests/88-integer-enum-OK.asn1.-P0000644000000000000000000000721011461146446017603 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include /*** <<< DEPS [T] >>> ***/ typedef enum T { T_a = 1, T_b = 2 } e_T; /*** <<< TYPE-DECLS [T] >>> ***/ typedef INTEGER_t T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; asn_struct_free_f T_free; asn_struct_print_f T_print; asn_constr_check_f T_constraint; ber_type_decoder_f T_decode_ber; der_type_encoder_f T_encode_der; xer_type_decoder_f T_decode_xer; xer_type_encoder_f T_encode_xer; /*** <<< CODE [T] >>> ***/ int T_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void T_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void T_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T] >>> ***/ static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", T_free, T_print, T_constraint, T_decode_ber, T_encode_der, T_decode_xer, T_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/92-circular-loops-OK.asn1.-Pfindirect-choice0000644000000000000000000013737411461146446023274 0ustar rootroot /*** <<< INCLUDES [Everything] >>> ***/ #include "Set.h" #include "Alpha.h" #include "Beta.h" #include "Gamma.h" #include "OneTwo.h" #include "TwoThree.h" #include "ThreeOne.h" #include /*** <<< FWD-DECLS [Everything] >>> ***/ struct Choice1; struct Choice2; struct Choice3; /*** <<< TYPE-DECLS [Everything] >>> ***/ typedef struct Everything { struct Choice1 *ch1; struct Choice2 *ch2; struct Choice3 *ch3; Set_t set; Alpha_t a; Beta_t b; Gamma_t g; OneTwo_t ot; TwoThree_t tt; ThreeOne_t to; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Everything_t; /*** <<< FUNC-DECLS [Everything] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Everything; /*** <<< POST-INCLUDE [Everything] >>> ***/ #include "Choice1.h" #include "Choice2.h" #include "Choice3.h" /*** <<< STAT-DEFS [Everything] >>> ***/ static asn_TYPE_member_t asn_MBR_Everything_1[] = { { ATF_POINTER, 0, offsetof(struct Everything, ch1), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ch1" }, { ATF_POINTER, 0, offsetof(struct Everything, ch2), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ch2" }, { ATF_POINTER, 0, offsetof(struct Everything, ch3), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ch3" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, set), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, a), .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Alpha, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, b), .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Beta, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, g), .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Gamma, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "g" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, ot), .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_OneTwo, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ot" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, tt), .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_TwoThree, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "tt" }, { ATF_NOFLAGS, 0, offsetof(struct Everything, to), .tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_ThreeOne, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "to" }, }; static ber_tlv_tag_t asn_DEF_Everything_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Everything_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ch1 at 15 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ch2 at 16 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ch3 at 17 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* set at 18 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* a at 19 */ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* b at 20 */ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* g at 21 */ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* ot at 22 */ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* tt at 23 */ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 } /* to at 25 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Everything_specs_1 = { sizeof(struct Everything), offsetof(struct Everything, _asn_ctx), asn_MAP_Everything_tag2el_1, 10, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Everything = { "Everything", "Everything", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Everything_tags_1, sizeof(asn_DEF_Everything_tags_1) /sizeof(asn_DEF_Everything_tags_1[0]), /* 1 */ asn_DEF_Everything_tags_1, /* Same as above */ sizeof(asn_DEF_Everything_tags_1) /sizeof(asn_DEF_Everything_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Everything_1, 10, /* Elements count */ &asn_SPC_Everything_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice1] >>> ***/ #include /*** <<< DEPS [Choice1] >>> ***/ typedef enum Choice1_PR { Choice1_PR_NOTHING, /* No components present */ Choice1_PR_something, /* Extensions may appear below */ Choice1_PR_some2 } Choice1_PR; /*** <<< FWD-DECLS [Choice1] >>> ***/ struct Everything; /*** <<< TYPE-DECLS [Choice1] >>> ***/ typedef struct Choice1 { Choice1_PR present; union Choice1_u { struct Everything *something; /* * This type is extensible, * possible extensions are below. */ struct Everything *some2; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice1_t; /*** <<< FUNC-DECLS [Choice1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice1; /*** <<< POST-INCLUDE [Choice1] >>> ***/ #include "Everything.h" /*** <<< STAT-DEFS [Choice1] >>> ***/ static asn_TYPE_member_t asn_MBR_Choice1_1[] = { { ATF_POINTER, 0, offsetof(struct Choice1, choice.something), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Everything, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "something" }, { ATF_POINTER, 0, offsetof(struct Choice1, choice.some2), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Everything, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "some2" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice1_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* something at 29 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* some2 at 32 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice1_specs_1 = { sizeof(struct Choice1), offsetof(struct Choice1, _asn_ctx), offsetof(struct Choice1, present), sizeof(((struct Choice1 *)0)->present), asn_MAP_Choice1_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = 1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice1 = { "Choice1", "Choice1", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice1_1, 2, /* Elements count */ &asn_SPC_Choice1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice2] >>> ***/ #include /*** <<< DEPS [Choice2] >>> ***/ typedef enum Choice2_PR { Choice2_PR_NOTHING, /* No components present */ Choice2_PR_typeref, /* Extensions may appear below */ Choice2_PR_some3 } Choice2_PR; /*** <<< FWD-DECLS [Choice2] >>> ***/ struct Sequence; struct Everything; /*** <<< TYPE-DECLS [Choice2] >>> ***/ typedef struct Choice2 { Choice2_PR present; union Choice2_u { struct Sequence *typeref; /* * This type is extensible, * possible extensions are below. */ struct Everything *some3; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice2_t; /*** <<< FUNC-DECLS [Choice2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice2; /*** <<< POST-INCLUDE [Choice2] >>> ***/ #include "TypeRef.h" #include "Everything.h" /*** <<< STAT-DEFS [Choice2] >>> ***/ static asn_TYPE_member_t asn_MBR_Choice2_1[] = { { ATF_POINTER, 0, offsetof(struct Choice2, choice.typeref), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_TypeRef, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "typeref" }, { ATF_POINTER, 0, offsetof(struct Choice2, choice.some3), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Everything, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "some3" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* typeref at 35 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* some3 at 38 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = { sizeof(struct Choice2), offsetof(struct Choice2, _asn_ctx), offsetof(struct Choice2, present), sizeof(((struct Choice2 *)0)->present), asn_MAP_Choice2_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = 1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice2 = { "Choice2", "Choice2", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice2_1, 2, /* Elements count */ &asn_SPC_Choice2_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice3] >>> ***/ #include #include #include #include /*** <<< DEPS [Choice3] >>> ***/ typedef enum Choice3_PR { Choice3_PR_NOTHING, /* No components present */ Choice3_PR_a, Choice3_PR_b, Choice3_PR_c } Choice3_PR; /*** <<< FWD-DECLS [Choice3] >>> ***/ struct Everything; struct Choice3; /*** <<< TYPE-DECLS [Choice3] >>> ***/ typedef struct Choice3 { Choice3_PR present; union Choice3_u { struct a { struct Everything *aa; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } *a; struct Everything *b; struct c { A_SEQUENCE_OF(struct Choice3) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } *c; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice3_t; /*** <<< FUNC-DECLS [Choice3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice3; /*** <<< POST-INCLUDE [Choice3] >>> ***/ #include "Everything.h" #include "Choice3.h" /*** <<< STAT-DEFS [Choice3] >>> ***/ static asn_TYPE_member_t asn_MBR_a_2[] = { { ATF_POINTER, 0, offsetof(struct a, aa), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Everything, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "aa" }, }; static ber_tlv_tag_t asn_DEF_a_tags_2[] = { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_a_tag2el_2[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* aa at 43 */ }; static asn_SEQUENCE_specifics_t asn_SPC_a_specs_2 = { sizeof(struct a), offsetof(struct a, _asn_ctx), asn_MAP_a_tag2el_2, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_a_2 = { "a", "a", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_a_tags_2, sizeof(asn_DEF_a_tags_2) /sizeof(asn_DEF_a_tags_2[0]) - 1, /* 1 */ asn_DEF_a_tags_2, /* Same as above */ sizeof(asn_DEF_a_tags_2) /sizeof(asn_DEF_a_tags_2[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_a_2, 1, /* Elements count */ &asn_SPC_a_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_c_5[] = { { ATF_POINTER, 0, 0, .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_Choice3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_c_tags_5[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_c_specs_5 = { sizeof(struct c), offsetof(struct c, _asn_ctx), 2, /* XER encoding is XMLValueList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_c_5 = { "c", "c", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_c_tags_5, sizeof(asn_DEF_c_tags_5) /sizeof(asn_DEF_c_tags_5[0]) - 1, /* 1 */ asn_DEF_c_tags_5, /* Same as above */ sizeof(asn_DEF_c_tags_5) /sizeof(asn_DEF_c_tags_5[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_c_5, 1, /* Single element */ &asn_SPC_c_specs_5 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Choice3_1[] = { { ATF_POINTER, 0, offsetof(struct Choice3, choice.a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = 0, .type = &asn_DEF_a_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_POINTER, 0, offsetof(struct Choice3, choice.b), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Everything, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, { ATF_POINTER, 0, offsetof(struct Choice3, choice.c), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_c_5, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice3_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 43 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* b at 44 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* c at 46 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice3_specs_1 = { sizeof(struct Choice3), offsetof(struct Choice3, _asn_ctx), offsetof(struct Choice3, present), sizeof(((struct Choice3 *)0)->present), asn_MAP_Choice3_tag2el_1, 3, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice3 = { "Choice3", "Choice3", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice3_1, 3, /* Elements count */ &asn_SPC_Choice3_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Set] >>> ***/ #include #include #include #include /*** <<< FWD-DECLS [Set] >>> ***/ struct Set; struct Sequence; /*** <<< TYPE-DECLS [Set] >>> ***/ typedef struct Set { A_SET_OF(struct Member { INTEGER_t Int; struct Set *set; struct Sequence *seq; struct Set *set2 /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */ struct Set *set3; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Set_t; /*** <<< FUNC-DECLS [Set] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Set; /*** <<< POST-INCLUDE [Set] >>> ***/ #include "Set.h" #include "Sequence.h" /*** <<< STAT-DEFS [Set] >>> ***/ static asn_TYPE_member_t asn_MBR_Member_2[] = { { ATF_NOFLAGS, 0, offsetof(struct Member, Int), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "int" }, { ATF_POINTER, 0, offsetof(struct Member, set), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set" }, { ATF_POINTER, 0, offsetof(struct Member, seq), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "seq" }, { ATF_POINTER, 2, offsetof(struct Member, set2), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set2" }, { ATF_POINTER, 1, offsetof(struct Member, set3), .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set3" }, }; static ber_tlv_tag_t asn_DEF_Member_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Member_tag2el_2[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* int at 49 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* set at 50 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* seq at 51 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* set2 at 52 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* set3 at 55 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_2 = { sizeof(struct Member), offsetof(struct Member, _asn_ctx), asn_MAP_Member_tag2el_2, 5, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 3, /* Start extensions */ 6 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_Member_2 = { "SEQUENCE", "SEQUENCE", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Member_tags_2, sizeof(asn_DEF_Member_tags_2) /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */ asn_DEF_Member_tags_2, /* Same as above */ sizeof(asn_DEF_Member_tags_2) /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Member_2, 5, /* Elements count */ &asn_SPC_Member_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Set_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Member_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_Set_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_Set_specs_1 = { sizeof(struct Set), offsetof(struct Set, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_Set = { "Set", "Set", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Set_tags_1, sizeof(asn_DEF_Set_tags_1) /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */ asn_DEF_Set_tags_1, /* Same as above */ sizeof(asn_DEF_Set_tags_1) /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Set_1, 1, /* Single element */ &asn_SPC_Set_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Sequence] >>> ***/ #include #include /*** <<< FWD-DECLS [Sequence] >>> ***/ struct Sequence; struct Set; /*** <<< TYPE-DECLS [Sequence] >>> ***/ typedef struct Sequence { INTEGER_t a; struct Sequence *seq /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */ INTEGER_t *b; struct Set *set /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Sequence_t; /*** <<< FUNC-DECLS [Sequence] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Sequence; /*** <<< POST-INCLUDE [Sequence] >>> ***/ #include "Sequence.h" #include "Set.h" /*** <<< STAT-DEFS [Sequence] >>> ***/ static asn_TYPE_member_t asn_MBR_Sequence_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Sequence, a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_POINTER, 3, offsetof(struct Sequence, seq), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "seq" }, { ATF_POINTER, 2, offsetof(struct Sequence, b), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, { ATF_POINTER, 1, offsetof(struct Sequence, set), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set" }, }; static ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 58 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* seq at 59 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* b at 61 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* set at 62 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = { sizeof(struct Sequence), offsetof(struct Sequence, _asn_ctx), asn_MAP_Sequence_tag2el_1, 4, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 1, /* Start extensions */ 5 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Sequence = { "Sequence", "Sequence", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Sequence_tags_1, sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ asn_DEF_Sequence_tags_1, /* Same as above */ sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Sequence_1, 4, /* Elements count */ &asn_SPC_Sequence_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [TypeRef] >>> ***/ #include "Sequence.h" /*** <<< TYPE-DECLS [TypeRef] >>> ***/ typedef Sequence_t TypeRef_t; /*** <<< FUNC-DECLS [TypeRef] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_TypeRef; asn_struct_free_f TypeRef_free; asn_struct_print_f TypeRef_print; asn_constr_check_f TypeRef_constraint; ber_type_decoder_f TypeRef_decode_ber; der_type_encoder_f TypeRef_encode_der; xer_type_decoder_f TypeRef_decode_xer; xer_type_encoder_f TypeRef_encode_xer; /*** <<< CODE [TypeRef] >>> ***/ int TypeRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Sequence.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Sequence, * so here we adjust the DEF accordingly. */ static void TypeRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Sequence.free_struct; td->print_struct = asn_DEF_Sequence.print_struct; td->ber_decoder = asn_DEF_Sequence.ber_decoder; td->der_encoder = asn_DEF_Sequence.der_encoder; td->xer_decoder = asn_DEF_Sequence.xer_decoder; td->xer_encoder = asn_DEF_Sequence.xer_encoder; td->uper_decoder = asn_DEF_Sequence.uper_decoder; td->uper_encoder = asn_DEF_Sequence.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Sequence.per_constraints; td->elements = asn_DEF_Sequence.elements; td->elements_count = asn_DEF_Sequence.elements_count; td->specifics = asn_DEF_Sequence.specifics; } void TypeRef_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { TypeRef_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int TypeRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { TypeRef_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t TypeRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { TypeRef_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t TypeRef_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { TypeRef_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t TypeRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { TypeRef_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t TypeRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { TypeRef_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [TypeRef] >>> ***/ static ber_tlv_tag_t asn_DEF_TypeRef_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_TypeRef = { "TypeRef", "TypeRef", TypeRef_free, TypeRef_print, TypeRef_constraint, TypeRef_decode_ber, TypeRef_encode_der, TypeRef_decode_xer, TypeRef_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TypeRef_tags_1, sizeof(asn_DEF_TypeRef_tags_1) /sizeof(asn_DEF_TypeRef_tags_1[0]), /* 1 */ asn_DEF_TypeRef_tags_1, /* Same as above */ sizeof(asn_DEF_TypeRef_tags_1) /sizeof(asn_DEF_TypeRef_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [Alpha] >>> ***/ #include /*** <<< FWD-DECLS [Alpha] >>> ***/ struct Beta; /*** <<< TYPE-DECLS [Alpha] >>> ***/ typedef struct Alpha { struct Beta *a; struct b { struct Beta *b /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } b; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Alpha_t; /*** <<< FUNC-DECLS [Alpha] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Alpha; /*** <<< POST-INCLUDE [Alpha] >>> ***/ #include "Beta.h" /*** <<< STAT-DEFS [Alpha] >>> ***/ static asn_TYPE_member_t asn_MBR_b_3[] = { { ATF_POINTER, 1, offsetof(struct b, b), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Beta, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_b_tags_3[] = { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_b_tag2el_3[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* b at 70 */ }; static asn_SEQUENCE_specifics_t asn_SPC_b_specs_3 = { sizeof(struct b), offsetof(struct b, _asn_ctx), asn_MAP_b_tag2el_3, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_b_3 = { "b", "b", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_b_tags_3, sizeof(asn_DEF_b_tags_3) /sizeof(asn_DEF_b_tags_3[0]) - 1, /* 1 */ asn_DEF_b_tags_3, /* Same as above */ sizeof(asn_DEF_b_tags_3) /sizeof(asn_DEF_b_tags_3[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_b_3, 1, /* Elements count */ &asn_SPC_b_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Alpha_1[] = { { ATF_POINTER, 0, offsetof(struct Alpha, a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Beta, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct Alpha, b), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_b_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_Alpha_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Alpha_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 68 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* b at 70 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Alpha_specs_1 = { sizeof(struct Alpha), offsetof(struct Alpha, _asn_ctx), asn_MAP_Alpha_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Alpha = { "Alpha", "Alpha", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Alpha_tags_1, sizeof(asn_DEF_Alpha_tags_1) /sizeof(asn_DEF_Alpha_tags_1[0]), /* 1 */ asn_DEF_Alpha_tags_1, /* Same as above */ sizeof(asn_DEF_Alpha_tags_1) /sizeof(asn_DEF_Alpha_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Alpha_1, 2, /* Elements count */ &asn_SPC_Alpha_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Beta] >>> ***/ #include /*** <<< FWD-DECLS [Beta] >>> ***/ struct Alpha; struct Gamma; /*** <<< TYPE-DECLS [Beta] >>> ***/ typedef struct Beta { struct Alpha *b /* OPTIONAL */; struct Gamma *g /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Beta_t; /*** <<< FUNC-DECLS [Beta] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Beta; /*** <<< POST-INCLUDE [Beta] >>> ***/ #include "Alpha.h" #include "Gamma.h" /*** <<< STAT-DEFS [Beta] >>> ***/ static asn_TYPE_member_t asn_MBR_Beta_1[] = { { ATF_POINTER, 2, offsetof(struct Beta, b), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Alpha, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, { ATF_POINTER, 1, offsetof(struct Beta, g), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Gamma, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "g" }, }; static ber_tlv_tag_t asn_DEF_Beta_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Beta_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* b at 75 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* g at 76 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Beta_specs_1 = { sizeof(struct Beta), offsetof(struct Beta, _asn_ctx), asn_MAP_Beta_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Beta = { "Beta", "Beta", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Beta_tags_1, sizeof(asn_DEF_Beta_tags_1) /sizeof(asn_DEF_Beta_tags_1[0]), /* 1 */ asn_DEF_Beta_tags_1, /* Same as above */ sizeof(asn_DEF_Beta_tags_1) /sizeof(asn_DEF_Beta_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Beta_1, 2, /* Elements count */ &asn_SPC_Beta_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Gamma] >>> ***/ #include /*** <<< FWD-DECLS [Gamma] >>> ***/ struct TwoThree; struct Alpha; struct Beta; /*** <<< TYPE-DECLS [Gamma] >>> ***/ typedef struct Gamma { struct TwoThree *o; struct Alpha *a; struct Beta *b; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Gamma_t; /*** <<< FUNC-DECLS [Gamma] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Gamma; /*** <<< POST-INCLUDE [Gamma] >>> ***/ #include "TwoThree.h" #include "Alpha.h" #include "Beta.h" /*** <<< STAT-DEFS [Gamma] >>> ***/ static asn_TYPE_member_t asn_MBR_Gamma_1[] = { { ATF_POINTER, 0, offsetof(struct Gamma, o), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_TwoThree, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "o" }, { ATF_POINTER, 0, offsetof(struct Gamma, a), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Alpha, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_POINTER, 0, offsetof(struct Gamma, b), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Beta, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_Gamma_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Gamma_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* o at 80 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* a at 81 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* b at 83 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Gamma_specs_1 = { sizeof(struct Gamma), offsetof(struct Gamma, _asn_ctx), asn_MAP_Gamma_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Gamma = { "Gamma", "Gamma", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Gamma_tags_1, sizeof(asn_DEF_Gamma_tags_1) /sizeof(asn_DEF_Gamma_tags_1[0]), /* 1 */ asn_DEF_Gamma_tags_1, /* Same as above */ sizeof(asn_DEF_Gamma_tags_1) /sizeof(asn_DEF_Gamma_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Gamma_1, 3, /* Elements count */ &asn_SPC_Gamma_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [OneTwo] >>> ***/ #include /*** <<< DEPS [OneTwo] >>> ***/ /* * Method of determining the components presence */ typedef enum OneTwo_PR { OneTwo_PR_m12, /* Member m12 is present */ } OneTwo_PR; /*** <<< FWD-DECLS [OneTwo] >>> ***/ struct TwoThree; /*** <<< TYPE-DECLS [OneTwo] >>> ***/ typedef struct OneTwo { struct TwoThree *m12; /* Presence bitmask: ASN_SET_ISPRESENT(pOneTwo, OneTwo_PR_x) */ unsigned int _presence_map [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } OneTwo_t; /*** <<< FUNC-DECLS [OneTwo] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OneTwo; /*** <<< POST-INCLUDE [OneTwo] >>> ***/ #include "TwoThree.h" /*** <<< STAT-DEFS [OneTwo] >>> ***/ static asn_TYPE_member_t asn_MBR_OneTwo_1[] = { { ATF_POINTER, 0, offsetof(struct OneTwo, m12), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_TwoThree, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m12" }, }; static ber_tlv_tag_t asn_DEF_OneTwo_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_OneTwo_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* m12 at 86 */ }; static uint8_t asn_MAP_OneTwo_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) }; static asn_SET_specifics_t asn_SPC_OneTwo_specs_1 = { sizeof(struct OneTwo), offsetof(struct OneTwo, _asn_ctx), offsetof(struct OneTwo, _presence_map), asn_MAP_OneTwo_tag2el_1, 1, /* Count of tags in the map */ asn_MAP_OneTwo_tag2el_1, /* Same as above */ 1, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_OneTwo_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_OneTwo = { "OneTwo", "OneTwo", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OneTwo_tags_1, sizeof(asn_DEF_OneTwo_tags_1) /sizeof(asn_DEF_OneTwo_tags_1[0]), /* 1 */ asn_DEF_OneTwo_tags_1, /* Same as above */ sizeof(asn_DEF_OneTwo_tags_1) /sizeof(asn_DEF_OneTwo_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_OneTwo_1, 1, /* Elements count */ &asn_SPC_OneTwo_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [TwoThree] >>> ***/ #include /*** <<< DEPS [TwoThree] >>> ***/ /* * Method of determining the components presence */ typedef enum TwoThree_PR { TwoThree_PR_m23, /* Member m23 is present */ } TwoThree_PR; /*** <<< FWD-DECLS [TwoThree] >>> ***/ struct ThreeOne; /*** <<< TYPE-DECLS [TwoThree] >>> ***/ typedef struct TwoThree { struct ThreeOne *m23; /* Presence bitmask: ASN_SET_ISPRESENT(pTwoThree, TwoThree_PR_x) */ unsigned int _presence_map [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } TwoThree_t; /*** <<< FUNC-DECLS [TwoThree] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_TwoThree; /*** <<< POST-INCLUDE [TwoThree] >>> ***/ #include "ThreeOne.h" /*** <<< STAT-DEFS [TwoThree] >>> ***/ static asn_TYPE_member_t asn_MBR_TwoThree_1[] = { { ATF_POINTER, 0, offsetof(struct TwoThree, m23), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_ThreeOne, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m23" }, }; static ber_tlv_tag_t asn_DEF_TwoThree_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_TwoThree_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* m23 at 87 */ }; static uint8_t asn_MAP_TwoThree_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) }; static asn_SET_specifics_t asn_SPC_TwoThree_specs_1 = { sizeof(struct TwoThree), offsetof(struct TwoThree, _asn_ctx), offsetof(struct TwoThree, _presence_map), asn_MAP_TwoThree_tag2el_1, 1, /* Count of tags in the map */ asn_MAP_TwoThree_tag2el_1, /* Same as above */ 1, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_TwoThree_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_TwoThree = { "TwoThree", "TwoThree", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TwoThree_tags_1, sizeof(asn_DEF_TwoThree_tags_1) /sizeof(asn_DEF_TwoThree_tags_1[0]), /* 1 */ asn_DEF_TwoThree_tags_1, /* Same as above */ sizeof(asn_DEF_TwoThree_tags_1) /sizeof(asn_DEF_TwoThree_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_TwoThree_1, 1, /* Elements count */ &asn_SPC_TwoThree_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [ThreeOne] >>> ***/ #include /*** <<< DEPS [ThreeOne] >>> ***/ /* * Method of determining the components presence */ typedef enum ThreeOne_PR { ThreeOne_PR_m31, /* Member m31 is present */ ThreeOne_PR_g, /* Member g is present */ } ThreeOne_PR; /*** <<< FWD-DECLS [ThreeOne] >>> ***/ struct OneTwo; struct Gamma; /*** <<< TYPE-DECLS [ThreeOne] >>> ***/ typedef struct ThreeOne { struct OneTwo *m31; struct Gamma *g; /* Presence bitmask: ASN_SET_ISPRESENT(pThreeOne, ThreeOne_PR_x) */ unsigned int _presence_map [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ThreeOne_t; /*** <<< FUNC-DECLS [ThreeOne] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_ThreeOne; /*** <<< POST-INCLUDE [ThreeOne] >>> ***/ #include "OneTwo.h" #include "Gamma.h" /*** <<< STAT-DEFS [ThreeOne] >>> ***/ static asn_TYPE_member_t asn_MBR_ThreeOne_1[] = { { ATF_POINTER, 0, offsetof(struct ThreeOne, m31), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_OneTwo, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m31" }, { ATF_POINTER, 0, offsetof(struct ThreeOne, g), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Gamma, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "g" }, }; static ber_tlv_tag_t asn_DEF_ThreeOne_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ThreeOne_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* m31 at 88 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* g at 88 */ }; static uint8_t asn_MAP_ThreeOne_mmap_1[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) | (1 << 6) }; static asn_SET_specifics_t asn_SPC_ThreeOne_specs_1 = { sizeof(struct ThreeOne), offsetof(struct ThreeOne, _asn_ctx), offsetof(struct ThreeOne, _presence_map), asn_MAP_ThreeOne_tag2el_1, 2, /* Count of tags in the map */ asn_MAP_ThreeOne_tag2el_1, /* Same as above */ 2, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_ThreeOne_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_ThreeOne = { "ThreeOne", "ThreeOne", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ThreeOne_tags_1, sizeof(asn_DEF_ThreeOne_tags_1) /sizeof(asn_DEF_ThreeOne_tags_1[0]), /* 1 */ asn_DEF_ThreeOne_tags_1, /* Same as above */ sizeof(asn_DEF_ThreeOne_tags_1) /sizeof(asn_DEF_ThreeOne_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ThreeOne_1, 2, /* Elements count */ &asn_SPC_ThreeOne_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/37-indirect-choice-OK.asn1.-P0000644000000000000000000006020611461146446020233 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include #include #include "Choice1.h" #include "Choice2.h" #include /*** <<< DEPS [T] >>> ***/ typedef enum T_PR { T_PR_NOTHING, /* No components present */ T_PR_t_a, T_PR_t_b, T_PR_t_c, T_PR_t_d } T_PR; /*** <<< TYPE-DECLS [T] >>> ***/ typedef struct T { T_PR present; union T_u { INTEGER_t t_a; OCTET_STRING_t t_b; Choice1_t t_c; Choice2_t t_d; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; /*** <<< STAT-DEFS [T] >>> ***/ static asn_TYPE_member_t asn_MBR_T_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T, choice.t_a), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "t-a" }, { ATF_NOFLAGS, 0, offsetof(struct T, choice.t_b), .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), .tag_mode = 0, .type = &asn_DEF_OCTET_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "t-b" }, { ATF_NOFLAGS, 0, offsetof(struct T, choice.t_c), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "t-c" }, { ATF_NOFLAGS, 0, offsetof(struct T, choice.t_d), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Choice2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "t-d" }, }; static asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* t-a at 15 */ { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* t-b at 16 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 }, /* t-c at 17 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* t-d at 19 */ }; static asn_CHOICE_specifics_t asn_SPC_T_specs_1 = { sizeof(struct T), offsetof(struct T, _asn_ctx), offsetof(struct T, present), sizeof(((struct T *)0)->present), asn_MAP_T_tag2el_1, 4, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_T_1, 4, /* Elements count */ &asn_SPC_T_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice1] >>> ***/ #include #include #include /*** <<< DEPS [Choice1] >>> ***/ typedef enum Choice1_PR { Choice1_PR_NOTHING, /* No components present */ Choice1_PR_c_a, Choice1_PR_c_b } Choice1_PR; /*** <<< TYPE-DECLS [Choice1] >>> ***/ typedef struct Choice1 { Choice1_PR present; union Choice1_u { OCTET_STRING_t c_a; INTEGER_t c_b; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice1_t; /*** <<< FUNC-DECLS [Choice1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice1; /*** <<< STAT-DEFS [Choice1] >>> ***/ static asn_TYPE_member_t asn_MBR_Choice1_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Choice1, choice.c_a), .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), .tag_mode = 0, .type = &asn_DEF_OCTET_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c-a" }, { ATF_NOFLAGS, 0, offsetof(struct Choice1, choice.c_b), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c-b" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice1_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* c-b at 24 */ { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* c-a at 22 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice1_specs_1 = { sizeof(struct Choice1), offsetof(struct Choice1, _asn_ctx), offsetof(struct Choice1, present), sizeof(((struct Choice1 *)0)->present), asn_MAP_Choice1_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice1 = { "Choice1", "Choice1", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice1_1, 2, /* Elements count */ &asn_SPC_Choice1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice2] >>> ***/ #include #include #include "Choice1.h" #include /*** <<< DEPS [Choice2] >>> ***/ typedef enum Choice2_PR { Choice2_PR_NOTHING, /* No components present */ Choice2_PR_c_a, Choice2_PR_c_b, Choice2_PR_c_d, Choice2_PR_c_e } Choice2_PR; /*** <<< TYPE-DECLS [Choice2] >>> ***/ typedef struct Choice2 { Choice2_PR present; union Choice2_u { OCTET_STRING_t c_a; INTEGER_t c_b; Choice1_t c_d; Choice1_t c_e; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice2_t; /*** <<< FUNC-DECLS [Choice2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice2; /*** <<< STAT-DEFS [Choice2] >>> ***/ static asn_TYPE_member_t asn_MBR_Choice2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.c_a), .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), .tag_mode = 0, .type = &asn_DEF_OCTET_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c-a" }, { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.c_b), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c-b" }, { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.c_d), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c-d" }, { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.c_e), .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c-e" }, }; static ber_tlv_tag_t asn_DEF_Choice2_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* c-b at 28 */ { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 }, /* c-a at 27 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* c-d at 29 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 3, 0, 0 } /* c-e at 31 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = { sizeof(struct Choice2), offsetof(struct Choice2, _asn_ctx), offsetof(struct Choice2, present), sizeof(((struct Choice2 *)0)->present), asn_MAP_Choice2_tag2el_1, 4, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice2 = { "Choice2", "Choice2", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, asn_DEF_Choice2_tags_1, sizeof(asn_DEF_Choice2_tags_1) /sizeof(asn_DEF_Choice2_tags_1[0]), /* 1 */ asn_DEF_Choice2_tags_1, /* Same as above */ sizeof(asn_DEF_Choice2_tags_1) /sizeof(asn_DEF_Choice2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Choice2_1, 4, /* Elements count */ &asn_SPC_Choice2_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice3] >>> ***/ #include "Choice2.h" /*** <<< TYPE-DECLS [Choice3] >>> ***/ typedef Choice2_t Choice3_t; /*** <<< FUNC-DECLS [Choice3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice3; asn_struct_free_f Choice3_free; asn_struct_print_f Choice3_print; asn_constr_check_f Choice3_constraint; ber_type_decoder_f Choice3_decode_ber; der_type_encoder_f Choice3_encode_der; xer_type_decoder_f Choice3_decode_xer; xer_type_encoder_f Choice3_encode_xer; /*** <<< CODE [Choice3] >>> ***/ int Choice3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Choice2.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Choice2, * so here we adjust the DEF accordingly. */ static void Choice3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Choice2.free_struct; td->print_struct = asn_DEF_Choice2.print_struct; td->ber_decoder = asn_DEF_Choice2.ber_decoder; td->der_encoder = asn_DEF_Choice2.der_encoder; td->xer_decoder = asn_DEF_Choice2.xer_decoder; td->xer_encoder = asn_DEF_Choice2.xer_encoder; td->uper_decoder = asn_DEF_Choice2.uper_decoder; td->uper_encoder = asn_DEF_Choice2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Choice2.per_constraints; td->elements = asn_DEF_Choice2.elements; td->elements_count = asn_DEF_Choice2.elements_count; td->specifics = asn_DEF_Choice2.specifics; } void Choice3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Choice3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Choice3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Choice3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Choice3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Choice3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Choice3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Choice3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Choice3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Choice3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Choice3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Choice3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Choice3] >>> ***/ static ber_tlv_tag_t asn_DEF_Choice3_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_CONTEXT | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Choice3 = { "Choice3", "Choice3", Choice3_free, Choice3_print, Choice3_constraint, Choice3_decode_ber, Choice3_encode_der, Choice3_decode_xer, Choice3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, asn_DEF_Choice3_tags_1, sizeof(asn_DEF_Choice3_tags_1) /sizeof(asn_DEF_Choice3_tags_1[0]), /* 2 */ asn_DEF_Choice3_tags_1, /* Same as above */ sizeof(asn_DEF_Choice3_tags_1) /sizeof(asn_DEF_Choice3_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [Choice4] >>> ***/ #include "Choice2.h" /*** <<< TYPE-DECLS [Choice4] >>> ***/ typedef Choice2_t Choice4_t; /*** <<< FUNC-DECLS [Choice4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice4; asn_struct_free_f Choice4_free; asn_struct_print_f Choice4_print; asn_constr_check_f Choice4_constraint; ber_type_decoder_f Choice4_decode_ber; der_type_encoder_f Choice4_encode_der; xer_type_decoder_f Choice4_decode_xer; xer_type_encoder_f Choice4_encode_xer; /*** <<< CODE [Choice4] >>> ***/ int Choice4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Choice2.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Choice2, * so here we adjust the DEF accordingly. */ static void Choice4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Choice2.free_struct; td->print_struct = asn_DEF_Choice2.print_struct; td->ber_decoder = asn_DEF_Choice2.ber_decoder; td->der_encoder = asn_DEF_Choice2.der_encoder; td->xer_decoder = asn_DEF_Choice2.xer_decoder; td->xer_encoder = asn_DEF_Choice2.xer_encoder; td->uper_decoder = asn_DEF_Choice2.uper_decoder; td->uper_encoder = asn_DEF_Choice2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Choice2.per_constraints; td->elements = asn_DEF_Choice2.elements; td->elements_count = asn_DEF_Choice2.elements_count; td->specifics = asn_DEF_Choice2.specifics; } void Choice4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Choice4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Choice4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Choice4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Choice4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Choice4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Choice4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Choice4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Choice4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Choice4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Choice4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Choice4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Choice4] >>> ***/ static ber_tlv_tag_t asn_DEF_Choice4_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Choice4 = { "Choice4", "Choice4", Choice4_free, Choice4_print, Choice4_constraint, Choice4_decode_ber, Choice4_encode_der, Choice4_decode_xer, Choice4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, asn_DEF_Choice4_tags_1, sizeof(asn_DEF_Choice4_tags_1) /sizeof(asn_DEF_Choice4_tags_1[0]) - 1, /* 1 */ asn_DEF_Choice4_tags_1, /* Same as above */ sizeof(asn_DEF_Choice4_tags_1) /sizeof(asn_DEF_Choice4_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [Choice5] >>> ***/ #include "Choice2.h" /*** <<< TYPE-DECLS [Choice5] >>> ***/ typedef Choice2_t Choice5_t; /*** <<< FUNC-DECLS [Choice5] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice5; asn_struct_free_f Choice5_free; asn_struct_print_f Choice5_print; asn_constr_check_f Choice5_constraint; ber_type_decoder_f Choice5_decode_ber; der_type_encoder_f Choice5_encode_der; xer_type_decoder_f Choice5_decode_xer; xer_type_encoder_f Choice5_encode_xer; /*** <<< CODE [Choice5] >>> ***/ int Choice5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Choice2.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Choice2, * so here we adjust the DEF accordingly. */ static void Choice5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Choice2.free_struct; td->print_struct = asn_DEF_Choice2.print_struct; td->ber_decoder = asn_DEF_Choice2.ber_decoder; td->der_encoder = asn_DEF_Choice2.der_encoder; td->xer_decoder = asn_DEF_Choice2.xer_decoder; td->xer_encoder = asn_DEF_Choice2.xer_encoder; td->uper_decoder = asn_DEF_Choice2.uper_decoder; td->uper_encoder = asn_DEF_Choice2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Choice2.per_constraints; td->elements = asn_DEF_Choice2.elements; td->elements_count = asn_DEF_Choice2.elements_count; td->specifics = asn_DEF_Choice2.specifics; } void Choice5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Choice5_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Choice5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Choice5_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Choice5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Choice5_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Choice5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Choice5_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Choice5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Choice5_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Choice5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Choice5_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Choice5] >>> ***/ static ber_tlv_tag_t asn_DEF_Choice5_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Choice5 = { "Choice5", "Choice5", Choice5_free, Choice5_print, Choice5_constraint, Choice5_decode_ber, Choice5_encode_der, Choice5_decode_xer, Choice5_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, asn_DEF_Choice5_tags_1, sizeof(asn_DEF_Choice5_tags_1) /sizeof(asn_DEF_Choice5_tags_1[0]), /* 1 */ asn_DEF_Choice5_tags_1, /* Same as above */ sizeof(asn_DEF_Choice5_tags_1) /sizeof(asn_DEF_Choice5_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [Choice6] >>> ***/ #include "Choice1.h" /*** <<< TYPE-DECLS [Choice6] >>> ***/ typedef Choice1_t Choice6_t; /*** <<< FUNC-DECLS [Choice6] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice6; asn_struct_free_f Choice6_free; asn_struct_print_f Choice6_print; asn_constr_check_f Choice6_constraint; ber_type_decoder_f Choice6_decode_ber; der_type_encoder_f Choice6_encode_der; xer_type_decoder_f Choice6_decode_xer; xer_type_encoder_f Choice6_encode_xer; /*** <<< CODE [Choice6] >>> ***/ int Choice6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Choice1.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Choice1, * so here we adjust the DEF accordingly. */ static void Choice6_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Choice1.free_struct; td->print_struct = asn_DEF_Choice1.print_struct; td->ber_decoder = asn_DEF_Choice1.ber_decoder; td->der_encoder = asn_DEF_Choice1.der_encoder; td->xer_decoder = asn_DEF_Choice1.xer_decoder; td->xer_encoder = asn_DEF_Choice1.xer_encoder; td->uper_decoder = asn_DEF_Choice1.uper_decoder; td->uper_encoder = asn_DEF_Choice1.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Choice1.per_constraints; td->elements = asn_DEF_Choice1.elements; td->elements_count = asn_DEF_Choice1.elements_count; td->specifics = asn_DEF_Choice1.specifics; } void Choice6_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Choice6_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Choice6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Choice6_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Choice6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Choice6_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Choice6_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Choice6_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Choice6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Choice6_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Choice6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Choice6_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Choice6] >>> ***/ asn_TYPE_descriptor_t asn_DEF_Choice6 = { "Choice6", "Choice6", Choice6_free, Choice6_print, Choice6_constraint, Choice6_decode_ber, Choice6_encode_der, Choice6_decode_xer, Choice6_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/68-enum-default-OK.asn10000644000000000000000000000070411461147103017305 0ustar rootroot -- OK: Everything is Fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .68 ModuleTestEnumeratedDefault { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 68 } DEFINITIONS ::= BEGIN Type ::= SEQUENCE { reportAmount ReportAmount DEFAULT ra-default, reportInterval INTEGER } ReportAmount ::= ENUMERATED { a, b, c, ra-default } END asn1c-0.9.24+dfsg/tests/128-enum-SE.asn10000644000000000000000000000050712015121740015732 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .128 ModuleTestEnum1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 128 } DEFINITIONS ::= BEGIN A ::= ENUMERATED {a, b, ..., c, d(2)} END asn1c-0.9.24+dfsg/tests/122-pattern-OK.asn10000644000000000000000000000126011461147103016441 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .122 ModulePatternConstraint { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 122 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN Language ::= VisibleString (FROM ("a".."z" | "A".."Z" | "-" | "0".."9")) (PATTERN "[a-zA-Z]#(1,8)(-[a-zA-Z0-9]#(1,8))*") PatternByRef1 ::= VisibleString (PATTERN refPattern1) PatternByRef2 ::= VisibleString (PATTERN refPattern2) refPattern1 UniversalString ::= "[a-zA-Z]#(1,8)(-[a-zA-Z0-9]#(1,8))*" refPattern2 UTF8String ::= "[a-zA-Z]#(1,8)(-[a-zA-Z0-9]#(1,8))*" END asn1c-0.9.24+dfsg/tests/67-embedded-choice-OK.asn10000644000000000000000000000100711461147103017674 0ustar rootroot -- OK: Everything is Fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .67 ModuleTestEmbeddedChoice { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 67 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN A ::= CHOICE { a NULL, b NULL, ... } B ::= CHOICE { a NULL, b NULL, ..., other A -- Only AUTOMATIC TAGS make it right } C ::= SET { a NULL, b NULL, ..., other1 A, other2 B } END asn1c-0.9.24+dfsg/tests/95-choice-per-order-OK.asn1.-P0000644000000000000000000001766111461146446020344 0ustar rootroot /*** <<< INCLUDES [Choice] >>> ***/ #include #include #include #include #include #include /*** <<< DEPS [Choice] >>> ***/ typedef enum Choice_PR { Choice_PR_NOTHING, /* No components present */ Choice_PR_roid, Choice_PR_bitstr, Choice_PR_ch, /* Extensions may appear below */ Choice_PR_bool } Choice_PR; typedef enum ch_PR { ch_PR_NOTHING, /* No components present */ ch_PR_null, ch_PR_int } ch_PR; /*** <<< TYPE-DECLS [Choice] >>> ***/ typedef struct Choice { Choice_PR present; union Choice_u { RELATIVE_OID_t roid; BIT_STRING_t bitstr; struct ch { ch_PR present; union Choice__ch_u { NULL_t null; INTEGER_t Int; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ch; /* * This type is extensible, * possible extensions are below. */ BOOLEAN_t bool; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice_t; /*** <<< FUNC-DECLS [Choice] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice; /*** <<< STAT-DEFS [Choice] >>> ***/ static asn_TYPE_member_t asn_MBR_ch_4[] = { { ATF_NOFLAGS, 0, offsetof(struct ch, choice.null), .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), .tag_mode = 0, .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "null" }, { ATF_NOFLAGS, 0, offsetof(struct ch, choice.Int), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "int" }, }; static asn_TYPE_tag2member_t asn_MAP_ch_tag2el_4[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* int at 20 */ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 0, 0, 0 } /* null at 18 */ }; static asn_CHOICE_specifics_t asn_SPC_ch_specs_4 = { sizeof(struct ch), offsetof(struct ch, _asn_ctx), offsetof(struct ch, present), sizeof(((struct ch *)0)->present), asn_MAP_ch_tag2el_4, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_ch_4 = { "ch", "ch", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_ch_4, 2, /* Elements count */ &asn_SPC_ch_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Choice_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.roid), .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), .tag_mode = 0, .type = &asn_DEF_RELATIVE_OID, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "roid" }, { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bitstr), .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), .tag_mode = 0, .type = &asn_DEF_BIT_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "bitstr" }, { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ch), .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_ch_4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ch" }, { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bool), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "bool" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool at 22 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 0 }, /* int at 20 */ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 1, 0, 0 }, /* bitstr at 16 */ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 2, 0, 0 }, /* null at 18 */ { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 } /* roid at 15 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = { sizeof(struct Choice), offsetof(struct Choice, _asn_ctx), offsetof(struct Choice, present), sizeof(((struct Choice *)0)->present), asn_MAP_Choice_tag2el_1, 5, /* Count of tags in the map */ .canonical_order = 0, .ext_start = 3 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice = { "Choice", "Choice", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice_1, 4, /* Elements count */ &asn_SPC_Choice_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice2] >>> ***/ #include #include #include /*** <<< DEPS [Choice2] >>> ***/ typedef enum Choice2_PR { Choice2_PR_NOTHING, /* No components present */ Choice2_PR_bitstr, Choice2_PR_roid } Choice2_PR; /*** <<< TYPE-DECLS [Choice2] >>> ***/ typedef struct Choice2 { Choice2_PR present; union Choice2_u { BIT_STRING_t bitstr; RELATIVE_OID_t roid; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice2_t; /*** <<< FUNC-DECLS [Choice2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice2; /*** <<< STAT-DEFS [Choice2] >>> ***/ static asn_TYPE_member_t asn_MBR_Choice2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.bitstr), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_BIT_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "bitstr" }, { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.roid), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_RELATIVE_OID, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "roid" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bitstr at 26 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* roid at 27 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = { sizeof(struct Choice2), offsetof(struct Choice2, _asn_ctx), offsetof(struct Choice2, present), sizeof(((struct Choice2 *)0)->present), asn_MAP_Choice2_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice2 = { "Choice2", "Choice2", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice2_1, 2, /* Elements count */ &asn_SPC_Choice2_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/126-per-extensions-OK.asn10000644000000000000000000000110411461147103017750 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .126 ModulePERExtensions { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 126 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN PDU ::= SEQUENCE { ..., str-o IA5String OPTIONAL, str-m IA5String, singl Singleton, pdu-2 PDU-2 OPTIONAL } Singleton ::= SEQUENCE { opt-z IA5String DEFAULT "z" } PDU-2 ::= CHOICE { main [3] INTEGER, ..., ext1 [1] INTEGER, ext0 [0] INTEGER } END asn1c-0.9.24+dfsg/tests/75-duplicate-modules-SE.asn10000644000000000000000000000072711461146446020351 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .75 1 -- .75 1 ModuleDuplicateModuleName { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 75 1 } DEFINITIONS ::= BEGIN END ModuleDuplicateModuleName { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 75 1 } DEFINITIONS ::= BEGIN END asn1c-0.9.24+dfsg/tests/97-type-identifier-SW.asn10000644000000000000000000000156411461147103020047 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .97 ModuleTypeIdentifier1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 97 1 } DEFINITIONS ::= BEGIN /* * TYPE-IDENTIFIER is resolved to a clause below. */ T1 ::= SEQUENCE { id TYPE-IDENTIFIER.&id2, type TYPE-IDENTIFIER.&Type } TYPE-IDENTIFIER ::= CLASS { &id2 OBJECT IDENTIFIER UNIQUE, &Type } WITH SYNTAX { [ &Type -- comment --] IDENTIFIED BY &id2 } END ModuleTypeIdentifier2 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 97 2 } DEFINITIONS ::= BEGIN /* * TYPE-IDENTIFIER is resolved to a default TYPE-IDENTIFIER class. */ T2 ::= SEQUENCE { id TYPE-IDENTIFIER.&id, type TYPE-IDENTIFIER.&Type } END asn1c-0.9.24+dfsg/tests/33-misc-OK.asn10000644000000000000000000000114211461147103015637 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .33 ModuleTestMiscComplex { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 33 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= SEQUENCE { a [1] INTEGER, ..., b [2] EXPLICIT BitString, c [8] IMPLICIT Label, d [10] IMPLICIT Int, e [12] T2 } BitString ::= [8] BIT STRING Label ::= [9] EXPLICIT UTF8String Label2 ::= [1] Label Int ::= [3] IMPLICIT INTEGER { a(1), b(2) } T2 ::= SEQUENCE { l Label2 } END asn1c-0.9.24+dfsg/tests/24-sequence-OK.asn10000644000000000000000000000071211461150505016516 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .24 ModuleTestSequence { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 24 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= [5] EXPLICIT SEQUENCE { a INTEGER, b [0] INTEGER OPTIONAL, c [1] INTEGER DEFAULT ten, d [5] EXPLICIT INTEGER } ten INTEGER ::= 10 END asn1c-0.9.24+dfsg/tests/55-components-of-OK.asn10000644000000000000000000000113211461147103017476 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .55 ModuleTestComponentsOf { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 55 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN OneType ::= SEQUENCE { one-1 INTEGER, one-2 [1] BOOLEAN, one-3 SEQUENCE { alpha INTEGER, beta INTEGER, ... }, ..., ignored-in-SecondType INTEGER, ..., one-4 INTEGER } SecondType ::= SEQUENCE { a IA5String, COMPONENTS OF OneType, b UniversalString } END asn1c-0.9.24+dfsg/tests/58-param-OK.asn10000644000000000000000000000076311461147103016023 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .58 ModuleTestParam { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 58 } DEFINITIONS ::= BEGIN DirectoryString { INTEGER:maxSize } ::= CHOICE { teletexString TeletexString (SIZE(1..maxSize)), utf8String UTF8String (SIZE(1..maxSize)) } DS1 ::= DirectoryString { ub-name } ub-name INTEGER ::= 128 END asn1c-0.9.24+dfsg/tests/66-ref-simple-OK.asn1.-P0000644000000000000000000001444611461230611017240 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include "SimpleType.h" #include #include /*** <<< TYPE-DECLS [T] >>> ***/ typedef struct T { A_SET_OF(SimpleType_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; /*** <<< STAT-DEFS [T] >>> ***/ static asn_TYPE_member_t asn_MBR_T_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), .tag_mode = 0, .type = &asn_DEF_SimpleType, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "named" }, }; static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_T_specs_1 = { sizeof(struct T), offsetof(struct T, _asn_ctx), 1, /* XER encoding is XMLValueList */ }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T_1, 1, /* Single element */ &asn_SPC_T_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SimpleType] >>> ***/ #include /*** <<< DEPS [SimpleType] >>> ***/ typedef enum SimpleType { SimpleType_one = 0, SimpleType_two = 1, SimpleType_three = 2 } e_SimpleType; /*** <<< TYPE-DECLS [SimpleType] >>> ***/ typedef ENUMERATED_t SimpleType_t; /*** <<< FUNC-DECLS [SimpleType] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SimpleType; asn_struct_free_f SimpleType_free; asn_struct_print_f SimpleType_print; asn_constr_check_f SimpleType_constraint; ber_type_decoder_f SimpleType_decode_ber; der_type_encoder_f SimpleType_encode_der; xer_type_decoder_f SimpleType_decode_xer; xer_type_encoder_f SimpleType_encode_xer; /*** <<< CODE [SimpleType] >>> ***/ int SimpleType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void SimpleType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } void SimpleType_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { SimpleType_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int SimpleType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { SimpleType_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t SimpleType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { SimpleType_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t SimpleType_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { SimpleType_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t SimpleType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { SimpleType_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t SimpleType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { SimpleType_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [SimpleType] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_SimpleType_value2enum_1[] = { { 0, 3, "one" }, { 1, 3, "two" }, { 2, 5, "three" } }; static unsigned int asn_MAP_SimpleType_enum2value_1[] = { 0, /* one(0) */ 2, /* three(2) */ 1 /* two(1) */ }; static asn_INTEGER_specifics_t asn_SPC_SimpleType_specs_1 = { asn_MAP_SimpleType_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_SimpleType_enum2value_1, /* N => "tag"; sorted by N */ 3, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_SimpleType_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_SimpleType = { "SimpleType", "SimpleType", SimpleType_free, SimpleType_print, SimpleType_constraint, SimpleType_decode_ber, SimpleType_encode_der, SimpleType_decode_xer, SimpleType_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SimpleType_tags_1, sizeof(asn_DEF_SimpleType_tags_1) /sizeof(asn_DEF_SimpleType_tags_1[0]), /* 1 */ asn_DEF_SimpleType_tags_1, /* Same as above */ sizeof(asn_DEF_SimpleType_tags_1) /sizeof(asn_DEF_SimpleType_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_SimpleType_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/36-indirect-choice-SE.asn10000644000000000000000000000070011461150505017735 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .36 ModuleTestIndirectChoiceError { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 36 } DEFINITIONS ::= BEGIN T ::= CHOICE { t-a INTEGER, t-b OCTET STRING, t-c Choice } Choice ::= CHOICE { -- One more level c-a OCTET STRING, c-b INTEGER } END asn1c-0.9.24+dfsg/tests/12-int-SE.asn10000644000000000000000000000051611461150505015475 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .12 ModuleTestInt6 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 12 } DEFINITIONS ::= BEGIN -- unresolved reference alpha INTEGER ::= beta END asn1c-0.9.24+dfsg/tests/125-bitstring-constraint-OK.asn1.-P0000644000000000000000000000775011461146446021454 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include /*** <<< DEPS [T] >>> ***/ typedef enum T { T_flag1 = 0, T_flag2 = 1, T_flag3 = 2 } e_T; /*** <<< TYPE-DECLS [T] >>> ***/ typedef BIT_STRING_t T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; asn_struct_free_f T_free; asn_struct_print_f T_print; asn_constr_check_f T_constraint; ber_type_decoder_f T_decode_ber; der_type_encoder_f T_encode_der; xer_type_decoder_f T_decode_xer; xer_type_encoder_f T_encode_xer; /*** <<< CODE [T] >>> ***/ int T_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } /* Replace with underlying type checker */ td->check_constraints = asn_DEF_BIT_STRING.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using BIT_STRING, * so here we adjust the DEF accordingly. */ static void T_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_BIT_STRING.free_struct; td->print_struct = asn_DEF_BIT_STRING.print_struct; td->ber_decoder = asn_DEF_BIT_STRING.ber_decoder; td->der_encoder = asn_DEF_BIT_STRING.der_encoder; td->xer_decoder = asn_DEF_BIT_STRING.xer_decoder; td->xer_encoder = asn_DEF_BIT_STRING.xer_encoder; td->uper_decoder = asn_DEF_BIT_STRING.uper_decoder; td->uper_encoder = asn_DEF_BIT_STRING.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_BIT_STRING.per_constraints; td->elements = asn_DEF_BIT_STRING.elements; td->elements_count = asn_DEF_BIT_STRING.elements_count; td->specifics = asn_DEF_BIT_STRING.specifics; } void T_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T] >>> ***/ static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", T_free, T_print, T_constraint, T_decode_ber, T_encode_der, T_decode_xer, T_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/69-reserved-words-OK.asn1.-P0000644000000000000000000001233211461146446020157 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include #include #include #include #include /*** <<< DEPS [T] >>> ***/ /* * Method of determining the components presence */ typedef enum class_PR { } class_PR; /*** <<< TYPE-DECLS [T] >>> ***/ typedef struct T { INTEGER_t Int; OCTET_STRING_t Char; struct Class { /* * This type is extensible, * possible extensions are below. */ /* Presence bitmask: ASN_SET_ISPRESENT(pclass, class_PR_x) */ unsigned int _presence_map [((0+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Class; REAL_t Double; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; /*** <<< CODE [T] >>> ***/ static int memb_char_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size == 1)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [T] >>> ***/ static ber_tlv_tag_t asn_DEF_class_tags_4[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static uint8_t asn_MAP_class_mmap_4[(0 + (8 * sizeof(unsigned int)) - 1) / 8] = { 0 }; static asn_SET_specifics_t asn_SPC_class_specs_4 = { sizeof(struct Class), offsetof(struct Class, _asn_ctx), offsetof(struct Class, _presence_map), asn_MAP_class_tag2el_4, 0, /* Count of tags in the map */ asn_MAP_class_tag2el_4, /* Same as above */ 0, /* Count of tags in the CXER map */ 1, /* Whether extensible */ (unsigned int *)asn_MAP_class_mmap_4 /* Mandatory elements map */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_class_4 = { "class", "class", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_class_tags_4, sizeof(asn_DEF_class_tags_4) /sizeof(asn_DEF_class_tags_4[0]), /* 1 */ asn_DEF_class_tags_4, /* Same as above */ sizeof(asn_DEF_class_tags_4) /sizeof(asn_DEF_class_tags_4[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_class_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_T_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T, Int), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "int" }, { ATF_NOFLAGS, 0, offsetof(struct T, Char), .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), .tag_mode = 0, .type = &asn_DEF_OCTET_STRING, .memb_constraints = memb_char_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "char" }, { ATF_NOFLAGS, 0, offsetof(struct T, Class), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_class_4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "class" }, { ATF_NOFLAGS, 0, offsetof(struct T, Double), .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), .tag_mode = 0, .type = &asn_DEF_REAL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "double" }, }; static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int at 15 */ { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* char at 16 */ { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 3, 0, 0 }, /* double at 18 */ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 } /* class at 17 */ }; static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = { sizeof(struct T), offsetof(struct T, _asn_ctx), asn_MAP_T_tag2el_1, 4, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T_1, 4, /* Elements count */ &asn_SPC_T_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/89-bit-string-enum-OK.asn10000644000000000000000000000053611461147103017751 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .89 ModuleBitStringEnumeration { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 89 } DEFINITIONS ::= BEGIN T ::= CHOICE { bs BIT STRING { a(1), b(2) } } END asn1c-0.9.24+dfsg/tests/105-param-2-OK.asn1.-P0000644000000000000000000003371511461146446016522 0ustar rootroot /*** <<< INCLUDES [SIGNED] >>> ***/ #include #include #include #include /*** <<< DEPS [SIGNED] >>> ***/ /* * Method of determining the components presence */ typedef enum signed_PR { signed_PR_a, /* Member a is present */ } signed_PR; /*** <<< TYPE-DECLS [SIGNED] >>> ***/ typedef struct SIGNED_16P0 { REAL_t Signed; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SIGNED_16P0_t; typedef struct SIGNED_16P1 { struct Signed { INTEGER_t a; /* Presence bitmask: ASN_SET_ISPRESENT(psigned, signed_PR_x) */ unsigned int _presence_map [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Signed; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SIGNED_16P1_t; /*** <<< FUNC-DECLS [SIGNED] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0; extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1; /*** <<< STAT-DEFS [SIGNED] >>> ***/ static asn_TYPE_member_t asn_MBR_SIGNED_16P0_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P0, Signed), .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), .tag_mode = 0, .type = &asn_DEF_REAL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "signed" }, }; static ber_tlv_tag_t asn_DEF_SIGNED_16P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_SIGNED_16P0_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 0, 0, 0 } /* signed at 18 */ }; static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P0_specs_1 = { sizeof(struct SIGNED_16P0), offsetof(struct SIGNED_16P0, _asn_ctx), asn_MAP_SIGNED_16P0_tag2el_1, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0 = { "SIGNED", "SIGNED", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SIGNED_16P0_tags_1, sizeof(asn_DEF_SIGNED_16P0_tags_1) /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */ asn_DEF_SIGNED_16P0_tags_1, /* Same as above */ sizeof(asn_DEF_SIGNED_16P0_tags_1) /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SIGNED_16P0_1, 1, /* Elements count */ &asn_SPC_SIGNED_16P0_specs_1 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_signed_4[] = { { ATF_NOFLAGS, 0, offsetof(struct Signed, a), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, }; static ber_tlv_tag_t asn_DEF_signed_tags_4[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_signed_tag2el_4[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* a at 19 */ }; static uint8_t asn_MAP_signed_mmap_4[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) }; static asn_SET_specifics_t asn_SPC_signed_specs_4 = { sizeof(struct Signed), offsetof(struct Signed, _asn_ctx), offsetof(struct Signed, _presence_map), asn_MAP_signed_tag2el_4, 1, /* Count of tags in the map */ asn_MAP_signed_tag2el_4, /* Same as above */ 1, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_signed_mmap_4 /* Mandatory elements map */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_signed_4 = { "signed", "signed", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_signed_tags_4, sizeof(asn_DEF_signed_tags_4) /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */ asn_DEF_signed_tags_4, /* Same as above */ sizeof(asn_DEF_signed_tags_4) /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_signed_4, 1, /* Elements count */ &asn_SPC_signed_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_SIGNED_16P1_3[] = { { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P1, Signed), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_signed_4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "signed" }, }; static ber_tlv_tag_t asn_DEF_SIGNED_16P1_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_SIGNED_16P1_tag2el_3[] = { { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* signed at 19 */ }; static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P1_specs_3 = { sizeof(struct SIGNED_16P1), offsetof(struct SIGNED_16P1, _asn_ctx), asn_MAP_SIGNED_16P1_tag2el_3, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1 = { "SIGNED", "SIGNED", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SIGNED_16P1_tags_3, sizeof(asn_DEF_SIGNED_16P1_tags_3) /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */ asn_DEF_SIGNED_16P1_tags_3, /* Same as above */ sizeof(asn_DEF_SIGNED_16P1_tags_3) /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SIGNED_16P1_3, 1, /* Elements count */ &asn_SPC_SIGNED_16P1_specs_3 /* Additional specs */ }; /*** <<< INCLUDES [SignedREAL] >>> ***/ #include "SIGNED.h" /*** <<< TYPE-DECLS [SignedREAL] >>> ***/ typedef SIGNED_16P0_t SignedREAL_t; /*** <<< FUNC-DECLS [SignedREAL] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SignedREAL; asn_struct_free_f SignedREAL_free; asn_struct_print_f SignedREAL_print; asn_constr_check_f SignedREAL_constraint; ber_type_decoder_f SignedREAL_decode_ber; der_type_encoder_f SignedREAL_encode_der; xer_type_decoder_f SignedREAL_decode_xer; xer_type_encoder_f SignedREAL_encode_xer; /*** <<< CODE [SignedREAL] >>> ***/ int SignedREAL_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_SIGNED_16P0.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using SIGNED_16P0, * so here we adjust the DEF accordingly. */ static void SignedREAL_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_SIGNED_16P0.free_struct; td->print_struct = asn_DEF_SIGNED_16P0.print_struct; td->ber_decoder = asn_DEF_SIGNED_16P0.ber_decoder; td->der_encoder = asn_DEF_SIGNED_16P0.der_encoder; td->xer_decoder = asn_DEF_SIGNED_16P0.xer_decoder; td->xer_encoder = asn_DEF_SIGNED_16P0.xer_encoder; td->uper_decoder = asn_DEF_SIGNED_16P0.uper_decoder; td->uper_encoder = asn_DEF_SIGNED_16P0.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_SIGNED_16P0.per_constraints; td->elements = asn_DEF_SIGNED_16P0.elements; td->elements_count = asn_DEF_SIGNED_16P0.elements_count; td->specifics = asn_DEF_SIGNED_16P0.specifics; } void SignedREAL_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { SignedREAL_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int SignedREAL_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { SignedREAL_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t SignedREAL_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { SignedREAL_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t SignedREAL_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { SignedREAL_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t SignedREAL_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { SignedREAL_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t SignedREAL_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { SignedREAL_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [SignedREAL] >>> ***/ static ber_tlv_tag_t asn_DEF_SignedREAL_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_SignedREAL = { "SignedREAL", "SignedREAL", SignedREAL_free, SignedREAL_print, SignedREAL_constraint, SignedREAL_decode_ber, SignedREAL_encode_der, SignedREAL_decode_xer, SignedREAL_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SignedREAL_tags_1, sizeof(asn_DEF_SignedREAL_tags_1) /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */ asn_DEF_SignedREAL_tags_1, /* Same as above */ sizeof(asn_DEF_SignedREAL_tags_1) /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [SignedSET] >>> ***/ #include "SIGNED.h" /*** <<< TYPE-DECLS [SignedSET] >>> ***/ typedef SIGNED_16P1_t SignedSET_t; /*** <<< FUNC-DECLS [SignedSET] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SignedSET; asn_struct_free_f SignedSET_free; asn_struct_print_f SignedSET_print; asn_constr_check_f SignedSET_constraint; ber_type_decoder_f SignedSET_decode_ber; der_type_encoder_f SignedSET_encode_der; xer_type_decoder_f SignedSET_decode_xer; xer_type_encoder_f SignedSET_encode_xer; /*** <<< CODE [SignedSET] >>> ***/ int SignedSET_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_SIGNED_16P1.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using SIGNED_16P1, * so here we adjust the DEF accordingly. */ static void SignedSET_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_SIGNED_16P1.free_struct; td->print_struct = asn_DEF_SIGNED_16P1.print_struct; td->ber_decoder = asn_DEF_SIGNED_16P1.ber_decoder; td->der_encoder = asn_DEF_SIGNED_16P1.der_encoder; td->xer_decoder = asn_DEF_SIGNED_16P1.xer_decoder; td->xer_encoder = asn_DEF_SIGNED_16P1.xer_encoder; td->uper_decoder = asn_DEF_SIGNED_16P1.uper_decoder; td->uper_encoder = asn_DEF_SIGNED_16P1.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_SIGNED_16P1.per_constraints; td->elements = asn_DEF_SIGNED_16P1.elements; td->elements_count = asn_DEF_SIGNED_16P1.elements_count; td->specifics = asn_DEF_SIGNED_16P1.specifics; } void SignedSET_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { SignedSET_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int SignedSET_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { SignedSET_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t SignedSET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { SignedSET_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t SignedSET_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { SignedSET_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t SignedSET_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { SignedSET_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t SignedSET_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { SignedSET_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [SignedSET] >>> ***/ static ber_tlv_tag_t asn_DEF_SignedSET_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_SignedSET = { "SignedSET", "SignedSET", SignedSET_free, SignedSET_print, SignedSET_constraint, SignedSET_decode_ber, SignedSET_encode_der, SignedSET_decode_xer, SignedSET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SignedSET_tags_1, sizeof(asn_DEF_SignedSET_tags_1) /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */ asn_DEF_SignedSET_tags_1, /* Same as above */ sizeof(asn_DEF_SignedSET_tags_1) /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/24-sequence-OK.asn1.-EF0000644000000000000000000000052411461146446017076 0ustar rootrootModuleTestSequence { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 24 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= [5] EXPLICIT SEQUENCE { a INTEGER, b [0] IMPLICIT INTEGER OPTIONAL, c [1] IMPLICIT INTEGER DEFAULT 10, d [5] EXPLICIT INTEGER } ten INTEGER ::= 10 END asn1c-0.9.24+dfsg/tests/112-param-class-OK.asn10000644000000000000000000000116111461147103017166 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .112 ModuleParameterizationClass { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 112 } DEFINITIONS ::= BEGIN PCLASS {Type, INTEGER:value, INTEGER:ValueSet} ::= CLASS { &valueField1 Type, &valueField2 INTEGER DEFAULT value, &valueField3 INTEGER (ValueSet), &ValueSetField INTEGER DEFAULT {ValueSet} } WITH SYNTAX { &valueField1, &valueField2, &valueField3, &ValueSetField } SCLASS ::= PCLASS {REAL, 111, {1 | 2 | 3}} END asn1c-0.9.24+dfsg/tests/98-attribute-class-OK.asn1.-P0000644000000000000000000000566011461146446020322 0ustar rootroot /*** <<< INCLUDES [Attribute] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [Attribute] >>> ***/ typedef struct Attribute { RELATIVE_OID_t identifier; IA5String_t siAttributeValue; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Attribute_t; /*** <<< FUNC-DECLS [Attribute] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Attribute; /*** <<< CODE [Attribute] >>> ***/ static int memb_identifier_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } return td->check_constraints(td, sptr, ctfailcb, app_key); } /*** <<< STAT-DEFS [Attribute] >>> ***/ static asn_TYPE_member_t asn_MBR_Attribute_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Attribute, identifier), .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), .tag_mode = 0, .type = &asn_DEF_RELATIVE_OID, .memb_constraints = memb_identifier_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "identifier" }, { ATF_NOFLAGS, 0, offsetof(struct Attribute, siAttributeValue), .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), .tag_mode = 0, .type = &asn_DEF_IA5String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "siAttributeValue" }, }; static ber_tlv_tag_t asn_DEF_Attribute_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Attribute_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 }, /* identifier at 19 */ { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 } /* siAttributeValue at 20 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Attribute_specs_1 = { sizeof(struct Attribute), offsetof(struct Attribute, _asn_ctx), asn_MAP_Attribute_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Attribute = { "Attribute", "Attribute", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Attribute_tags_1, sizeof(asn_DEF_Attribute_tags_1) /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */ asn_DEF_Attribute_tags_1, /* Same as above */ sizeof(asn_DEF_Attribute_tags_1) /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Attribute_1, 2, /* Elements count */ &asn_SPC_Attribute_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/58-param-OK.asn1.-EF0000644000000000000000000000054311461146446016376 0ustar rootrootModuleTestParam { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 58 } DEFINITIONS ::= BEGIN DirectoryString{INTEGER:maxSize} ::= CHOICE { teletexString TeletexString (SIZE(1..maxSize)), utf8String UTF8String (SIZE(1..maxSize)) } DS1 ::= DirectoryString{ub-name} ub-name INTEGER ::= 128 END asn1c-0.9.24+dfsg/tests/86-atags-OK.asn10000644000000000000000000000076511461147103016025 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .86 ModuleAutoTags { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 86 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN A ::= SEQUENCE { a INTEGER } B ::= SEQUENCE { a [0] INTEGER } C ::= SEQUENCE { a [0] IMPLICIT INTEGER } D ::= SEQUENCE { a [0] EXPLICIT INTEGER } E ::= SEQUENCE { a [0] CHOICE { b INTEGER } } END asn1c-0.9.24+dfsg/tests/123-valueassignment-OK.asn1.-EF0000644000000000000000000000033511461146446020553 0ustar rootrootModuleValueAssignmentConstrained { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 123 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN zzz OCTET STRING (SIZE(1)) ::= '0001'B END asn1c-0.9.24+dfsg/tests/50-constraint-OK.asn10000644000000000000000000000522111461147103017071 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .50 1 -- .50 2 ModuleNestedConstraintsCheck { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 50 1 } DEFINITIONS ::= BEGIN IMPORTS Identifier FROM IdentifierModule; Int1 ::= INTEGER Int2 ::= Int1 (0..MAX) -- X.680-0207::41.4.4 Int3 ::= Int2 (MIN..ten) -- Means (0..10) Int4 ::= Int3 (5..MAX,...,1..4) -- Means (1..10,...) Int5 ::= Int4 (MIN..5) -- Means (5) -- Int6 ::= INTEGER (Int5) -- -- Not yet supported ten Int1 ::= other-ten other-ten Int2 ::= 10 -- G.4.3.4 ExtensibleExtensions ::= INTEGER ((1..256,...) INTERSECTION (1..256)) Str1 ::= IA5String Str2 ::= Str1 (SIZE(MIN..20 | 25..30)) -- Means (SIZE(0..20 | 25..30)) Str3 ::= Str2 (SIZE(10..27))(FROM("ABC"|"def")) -- (SIZE(10..20,25..27))(FROM("ABCdef")) Str4 ::= IA5String ("ABCD"|SIZE(4)) -- Not PER-visible PER-Visible ::= IA5String (FROM("A".."F")) PER-Visible-2 ::= PER-Visible (FROM("E".."F")) -- Means (FROM("EF")) -- The following maintain parent permitted alphabet constraint Not-PER-Visible-1 ::= PER-Visible (FROM("AB") | SIZE(1..2)) Not-PER-Visible-2 ::= PER-Visible (FROM("AB",...)) Not-PER-Visible-3 ::= PER-Visible (FROM("AB"),...) SIZE-but-not-FROM ::= PER-Visible (SIZE(1..4) ^ FROM("ABCD",...)) SIZE-and-FROM ::= PER-Visible (SIZE(1..4) ^ FROM("ABCD")) Neither-SIZE-nor-FROM ::= PER-Visible (SIZE(1..4) | FROM("ABCD",...)) Utf8-4 ::= UTF8String (FROM("A".."Z")) -- Alphabet Utf8-3 ::= Utf8-2 (FROM("A".."Z"|"a".."z")) -- Alphabet and size Utf8-2 ::= Utf8-1 (SIZE(1..2)) -- Size Utf8-1 ::= UTF8String VisibleIdentifier ::= Identifier Sequence ::= SEQUENCE { int1-c Int1 (-2..MAX) DEFAULT 3, int4 [2] Int4, int4-c Int4 (MIN..7), bool BOOLEAN DEFAULT 1, enum-c ENUMERATED { one(1), two(2), ..., three(3) }, ..., int5-c Int5 (5) OPTIONAL, ..., null NULL OPTIONAL } SequenceOf ::= SEQUENCE (SIZE(1..2)) OF Sequence Enum0 ::= ENUMERATED { one, two } Enum1 ::= ENUMERATED { one, two } (one) END IdentifierModule { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 50 2 } DEFINITIONS ::= BEGIN EXPORTS Identifier; maxIdentifier INTEGER ::= 32 Identifier ::= VisibleString ( FROM ("A"|"a"|"B"|"b"|"C"|"c"|"D"|"d"|"E"|"e"|"F"|"f"| "G"|"g"|"H"|"h"|"I"|"i"|"J"|"j"|"K"|"k"|"L"|"l"| "M"|"m"|"N"|"n"|"O"|"o"|"P"|"p"|"Q"|"q"|"R"|"r"| "S"|"s"|"T"|"t"|"U"|"u"|"V"|"v"|"W"|"w"|"X"|"x"| "Y"|"y"|"Z"|"z"|"$"|"_"|"0"|"1"|"2"|"3"|"4"|"5"| "6"|"7"|"8"|"9") ) (SIZE(1..maxIdentifier)) END asn1c-0.9.24+dfsg/tests/39-sequence-of-OK.asn10000644000000000000000000000064011461147103017126 0ustar rootroot -- OK: Everything is Fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .39 ModuleNestedSequenceOf { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 39 } DEFINITIONS ::= BEGIN T ::= SEQUENCE { int INTEGER, collection SEQUENCE OF T2 } T2 ::= SEQUENCE { flag BOOLEAN, str UTF8String } END asn1c-0.9.24+dfsg/tests/42-real-life-OK.asn1.-PR0000644000000000000000000006570111461230611017151 0ustar rootroot /*** <<< INCLUDES [LogLine] >>> ***/ #include #include #include #include /*** <<< FWD-DECLS [LogLine] >>> ***/ struct VariablePartSet; /*** <<< TYPE-DECLS [LogLine] >>> ***/ typedef struct LogLine { IA5String_t line_digest; struct varsets { A_SEQUENCE_OF(struct VariablePartSet) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } varsets; /* * This type is extensible, * possible extensions are below. */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } LogLine_t; /*** <<< FUNC-DECLS [LogLine] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_LogLine; /*** <<< POST-INCLUDE [LogLine] >>> ***/ #include "VariablePartSet.h" /*** <<< CODE [LogLine] >>> ***/ static int memb_varsets_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } /* Determine the number of elements */ size = _A_CSEQUENCE_FROM_VOID(sptr)->count; if((size >= 1)) { /* Perform validation of the inner elements */ return td->check_constraints(td, sptr, ctfailcb, app_key); } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [LogLine] >>> ***/ static asn_TYPE_member_t asn_MBR_varsets_3[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_VariablePartSet, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_varsets_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_varsets_specs_3 = { sizeof(struct varsets), offsetof(struct varsets, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_varsets_3 = { "varsets", "varsets", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_varsets_tags_3, sizeof(asn_DEF_varsets_tags_3) /sizeof(asn_DEF_varsets_tags_3[0]), /* 1 */ asn_DEF_varsets_tags_3, /* Same as above */ sizeof(asn_DEF_varsets_tags_3) /sizeof(asn_DEF_varsets_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_varsets_3, 1, /* Single element */ &asn_SPC_varsets_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_LogLine_1[] = { { ATF_NOFLAGS, 0, offsetof(struct LogLine, line_digest), .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), .tag_mode = 0, .type = &asn_DEF_IA5String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "line-digest" }, { ATF_NOFLAGS, 0, offsetof(struct LogLine, varsets), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_varsets_3, .memb_constraints = memb_varsets_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "varsets" }, }; static ber_tlv_tag_t asn_DEF_LogLine_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_LogLine_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* varsets at 25 */ { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 0, 0, 0 } /* line-digest at 23 */ }; static asn_SEQUENCE_specifics_t asn_SPC_LogLine_specs_1 = { sizeof(struct LogLine), offsetof(struct LogLine, _asn_ctx), asn_MAP_LogLine_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 1, /* Start extensions */ 3 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_LogLine = { "LogLine", "LogLine", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_LogLine_tags_1, sizeof(asn_DEF_LogLine_tags_1) /sizeof(asn_DEF_LogLine_tags_1[0]), /* 1 */ asn_DEF_LogLine_tags_1, /* Same as above */ sizeof(asn_DEF_LogLine_tags_1) /sizeof(asn_DEF_LogLine_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_LogLine_1, 2, /* Elements count */ &asn_SPC_LogLine_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [VariablePartSet] >>> ***/ #include "ActionItem.h" #include #include #include /*** <<< FWD-DECLS [VariablePartSet] >>> ***/ struct VariablePart; /*** <<< TYPE-DECLS [VariablePartSet] >>> ***/ typedef struct VariablePartSet { struct vparts { A_SEQUENCE_OF(struct VariablePart) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } vparts; ActionItem_t resolution; /* * This type is extensible, * possible extensions are below. */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } VariablePartSet_t; /*** <<< FUNC-DECLS [VariablePartSet] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_VariablePartSet; /*** <<< POST-INCLUDE [VariablePartSet] >>> ***/ #include "VariablePart.h" /*** <<< CODE [VariablePartSet] >>> ***/ static int memb_vparts_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } return td->check_constraints(td, sptr, ctfailcb, app_key); } /*** <<< STAT-DEFS [VariablePartSet] >>> ***/ static asn_TYPE_member_t asn_MBR_vparts_2[] = { { ATF_POINTER, 0, 0, .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_VariablePart, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_vparts_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_vparts_specs_2 = { sizeof(struct vparts), offsetof(struct vparts, _asn_ctx), 2, /* XER encoding is XMLValueList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_vparts_2 = { "vparts", "vparts", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_vparts_tags_2, sizeof(asn_DEF_vparts_tags_2) /sizeof(asn_DEF_vparts_tags_2[0]), /* 1 */ asn_DEF_vparts_tags_2, /* Same as above */ sizeof(asn_DEF_vparts_tags_2) /sizeof(asn_DEF_vparts_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_vparts_2, 1, /* Single element */ &asn_SPC_vparts_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_VariablePartSet_1[] = { { ATF_NOFLAGS, 0, offsetof(struct VariablePartSet, vparts), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_vparts_2, .memb_constraints = memb_vparts_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "vparts" }, { ATF_NOFLAGS, 0, offsetof(struct VariablePartSet, resolution), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_ActionItem, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "resolution" }, }; static ber_tlv_tag_t asn_DEF_VariablePartSet_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_VariablePartSet_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* vparts at 33 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* resolution at 35 */ }; static asn_SEQUENCE_specifics_t asn_SPC_VariablePartSet_specs_1 = { sizeof(struct VariablePartSet), offsetof(struct VariablePartSet, _asn_ctx), asn_MAP_VariablePartSet_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 1, /* Start extensions */ 3 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_VariablePartSet = { "VariablePartSet", "VariablePartSet", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_VariablePartSet_tags_1, sizeof(asn_DEF_VariablePartSet_tags_1) /sizeof(asn_DEF_VariablePartSet_tags_1[0]), /* 1 */ asn_DEF_VariablePartSet_tags_1, /* Same as above */ sizeof(asn_DEF_VariablePartSet_tags_1) /sizeof(asn_DEF_VariablePartSet_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_VariablePartSet_1, 2, /* Elements count */ &asn_SPC_VariablePartSet_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [VariablePart] >>> ***/ #include #include #include #include #include /*** <<< DEPS [VariablePart] >>> ***/ typedef enum VariablePart_PR { VariablePart_PR_NOTHING, /* No components present */ VariablePart_PR_vset, VariablePart_PR_vrange, /* Extensions may appear below */ } VariablePart_PR; /*** <<< TYPE-DECLS [VariablePart] >>> ***/ typedef struct VariablePart { VariablePart_PR present; union VariablePart_u { struct vset { A_SET_OF(VisibleString_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } vset; struct vrange { VisibleString_t from; VisibleString_t to; /* * This type is extensible, * possible extensions are below. */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } vrange; /* * This type is extensible, * possible extensions are below. */ } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } VariablePart_t; /*** <<< FUNC-DECLS [VariablePart] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_VariablePart; /*** <<< CODE [VariablePart] >>> ***/ static int memb_vset_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } /* Determine the number of elements */ size = _A_CSET_FROM_VOID(sptr)->count; if((size >= 1)) { /* Perform validation of the inner elements */ return td->check_constraints(td, sptr, ctfailcb, app_key); } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [VariablePart] >>> ***/ static asn_TYPE_member_t asn_MBR_vset_2[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), .tag_mode = 0, .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_vset_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_vset_specs_2 = { sizeof(struct vset), offsetof(struct vset, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_vset_2 = { "vset", "vset", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_vset_tags_2, sizeof(asn_DEF_vset_tags_2) /sizeof(asn_DEF_vset_tags_2[0]), /* 1 */ asn_DEF_vset_tags_2, /* Same as above */ sizeof(asn_DEF_vset_tags_2) /sizeof(asn_DEF_vset_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_vset_2, 1, /* Single element */ &asn_SPC_vset_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_vrange_4[] = { { ATF_NOFLAGS, 0, offsetof(struct vrange, from), .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), .tag_mode = 0, .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "from" }, { ATF_NOFLAGS, 0, offsetof(struct vrange, to), .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), .tag_mode = 0, .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "to" }, }; static ber_tlv_tag_t asn_DEF_vrange_tags_4[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_vrange_tag2el_4[] = { { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), 0, 0, 1 }, /* from at 45 */ { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), 1, -1, 0 } /* to at 46 */ }; static asn_SEQUENCE_specifics_t asn_SPC_vrange_specs_4 = { sizeof(struct vrange), offsetof(struct vrange, _asn_ctx), asn_MAP_vrange_tag2el_4, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 1, /* Start extensions */ 3 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_vrange_4 = { "vrange", "vrange", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_vrange_tags_4, sizeof(asn_DEF_vrange_tags_4) /sizeof(asn_DEF_vrange_tags_4[0]), /* 1 */ asn_DEF_vrange_tags_4, /* Same as above */ sizeof(asn_DEF_vrange_tags_4) /sizeof(asn_DEF_vrange_tags_4[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_vrange_4, 2, /* Elements count */ &asn_SPC_vrange_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_VariablePart_1[] = { { ATF_NOFLAGS, 0, offsetof(struct VariablePart, choice.vset), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_vset_2, .memb_constraints = memb_vset_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "vset" }, { ATF_NOFLAGS, 0, offsetof(struct VariablePart, choice.vrange), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_vrange_4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "vrange" }, }; static asn_TYPE_tag2member_t asn_MAP_VariablePart_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* vrange at 45 */ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* vset at 42 */ }; static asn_CHOICE_specifics_t asn_SPC_VariablePart_specs_1 = { sizeof(struct VariablePart), offsetof(struct VariablePart, _asn_ctx), offsetof(struct VariablePart, present), sizeof(((struct VariablePart *)0)->present), asn_MAP_VariablePart_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = 2 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_VariablePart = { "VariablePart", "VariablePart", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_VariablePart_1, 2, /* Elements count */ &asn_SPC_VariablePart_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [ActionItem] >>> ***/ #include #include #include #include #include #include /*** <<< DEPS [ActionItem] >>> ***/ typedef enum accept_as { accept_as_unknown = 0, accept_as_safe = 1, accept_as_unsafe = 2 /* * Enumeration is extensible */ } e_accept_as; /*** <<< TYPE-DECLS [ActionItem] >>> ***/ typedef struct ActionItem { ENUMERATED_t accept_as; struct notify { BOOLEAN_t critical; struct email { A_SET_OF(VisibleString_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } email; /* * This type is extensible, * possible extensions are below. */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } *notify; /* * This type is extensible, * possible extensions are below. */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ActionItem_t; /*** <<< FUNC-DECLS [ActionItem] >>> ***/ /* extern asn_TYPE_descriptor_t asn_DEF_accept_as_2; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_ActionItem; /*** <<< CODE [ActionItem] >>> ***/ static int accept_as_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void accept_as_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } static void accept_as_2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { accept_as_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int accept_as_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { accept_as_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t accept_as_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { accept_as_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t accept_as_2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { accept_as_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t accept_as_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { accept_as_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t accept_as_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { accept_as_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [ActionItem] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_accept_as_value2enum_2[] = { { 0, 7, "unknown" }, { 1, 4, "safe" }, { 2, 6, "unsafe" } /* This list is extensible */ }; static unsigned int asn_MAP_accept_as_enum2value_2[] = { 1, /* safe(1) */ 0, /* unknown(0) */ 2 /* unsafe(2) */ /* This list is extensible */ }; static asn_INTEGER_specifics_t asn_SPC_accept_as_specs_2 = { asn_MAP_accept_as_value2enum_2, /* "tag" => N; sorted by tag */ asn_MAP_accept_as_enum2value_2, /* N => "tag"; sorted by N */ 3, /* Number of elements in the maps */ 4, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_accept_as_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_accept_as_2 = { "accept-as", "accept-as", accept_as_2_free, accept_as_2_print, accept_as_2_constraint, accept_as_2_decode_ber, accept_as_2_encode_der, accept_as_2_decode_xer, accept_as_2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_accept_as_tags_2, sizeof(asn_DEF_accept_as_tags_2) /sizeof(asn_DEF_accept_as_tags_2[0]), /* 1 */ asn_DEF_accept_as_tags_2, /* Same as above */ sizeof(asn_DEF_accept_as_tags_2) /sizeof(asn_DEF_accept_as_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_accept_as_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_email_9[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), .tag_mode = 0, .type = &asn_DEF_VisibleString, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_email_tags_9[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_email_specs_9 = { sizeof(struct email), offsetof(struct email, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_email_9 = { "email", "email", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_email_tags_9, sizeof(asn_DEF_email_tags_9) /sizeof(asn_DEF_email_tags_9[0]), /* 1 */ asn_DEF_email_tags_9, /* Same as above */ sizeof(asn_DEF_email_tags_9) /sizeof(asn_DEF_email_tags_9[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_email_9, 1, /* Single element */ &asn_SPC_email_specs_9 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_notify_7[] = { { ATF_NOFLAGS, 0, offsetof(struct notify, critical), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "critical" }, { ATF_NOFLAGS, 0, offsetof(struct notify, email), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_email_9, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "email" }, }; static ber_tlv_tag_t asn_DEF_notify_tags_7[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_notify_tag2el_7[] = { { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* critical at 61 */ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* email at 62 */ }; static asn_SEQUENCE_specifics_t asn_SPC_notify_specs_7 = { sizeof(struct notify), offsetof(struct notify, _asn_ctx), asn_MAP_notify_tag2el_7, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 1, /* Start extensions */ 3 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_notify_7 = { "notify", "notify", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_notify_tags_7, sizeof(asn_DEF_notify_tags_7) /sizeof(asn_DEF_notify_tags_7[0]), /* 1 */ asn_DEF_notify_tags_7, /* Same as above */ sizeof(asn_DEF_notify_tags_7) /sizeof(asn_DEF_notify_tags_7[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_notify_7, 2, /* Elements count */ &asn_SPC_notify_specs_7 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_ActionItem_1[] = { { ATF_NOFLAGS, 0, offsetof(struct ActionItem, accept_as), .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), .tag_mode = 0, .type = &asn_DEF_accept_as_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "accept-as" }, { ATF_POINTER, 1, offsetof(struct ActionItem, notify), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_notify_7, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "notify" }, }; static ber_tlv_tag_t asn_DEF_ActionItem_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ActionItem_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 }, /* accept-as at 55 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* notify at 61 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ActionItem_specs_1 = { sizeof(struct ActionItem), offsetof(struct ActionItem, _asn_ctx), asn_MAP_ActionItem_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 1, /* Start extensions */ 3 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_ActionItem = { "ActionItem", "ActionItem", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ActionItem_tags_1, sizeof(asn_DEF_ActionItem_tags_1) /sizeof(asn_DEF_ActionItem_tags_1[0]), /* 1 */ asn_DEF_ActionItem_tags_1, /* Same as above */ sizeof(asn_DEF_ActionItem_tags_1) /sizeof(asn_DEF_ActionItem_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ActionItem_1, 2, /* Elements count */ &asn_SPC_ActionItem_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/50-constraint-OK.asn1.-P0000644000000000000000000040757611461230611017364 0ustar rootroot /*** <<< INCLUDES [Int1] >>> ***/ #include /*** <<< TYPE-DECLS [Int1] >>> ***/ typedef INTEGER_t Int1_t; /*** <<< FUNC-DECLS [Int1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Int1; asn_struct_free_f Int1_free; asn_struct_print_f Int1_print; asn_constr_check_f Int1_constraint; ber_type_decoder_f Int1_decode_ber; der_type_encoder_f Int1_encode_der; xer_type_decoder_f Int1_decode_xer; xer_type_encoder_f Int1_encode_xer; /*** <<< CODE [Int1] >>> ***/ int Int1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void Int1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void Int1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Int1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Int1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Int1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Int1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Int1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Int1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Int1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Int1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Int1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Int1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Int1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Int1] >>> ***/ static ber_tlv_tag_t asn_DEF_Int1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Int1 = { "Int1", "Int1", Int1_free, Int1_print, Int1_constraint, Int1_decode_ber, Int1_encode_der, Int1_decode_xer, Int1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Int1_tags_1, sizeof(asn_DEF_Int1_tags_1) /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */ asn_DEF_Int1_tags_1, /* Same as above */ sizeof(asn_DEF_Int1_tags_1) /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Int2] >>> ***/ #include "Int1.h" /*** <<< TYPE-DECLS [Int2] >>> ***/ typedef Int1_t Int2_t; /*** <<< FUNC-DECLS [Int2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Int2; asn_struct_free_f Int2_free; asn_struct_print_f Int2_print; asn_constr_check_f Int2_constraint; ber_type_decoder_f Int2_decode_ber; der_type_encoder_f Int2_encode_der; xer_type_decoder_f Int2_decode_xer; xer_type_encoder_f Int2_encode_xer; /*** <<< CODE [Int2] >>> ***/ int Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int1_t *st = (const Int1_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } /* Check if the sign bit is present */ value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0; if((value >= 0)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Int1, * so here we adjust the DEF accordingly. */ static void Int2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Int1.free_struct; td->print_struct = asn_DEF_Int1.print_struct; td->ber_decoder = asn_DEF_Int1.ber_decoder; td->der_encoder = asn_DEF_Int1.der_encoder; td->xer_decoder = asn_DEF_Int1.xer_decoder; td->xer_encoder = asn_DEF_Int1.xer_encoder; td->uper_decoder = asn_DEF_Int1.uper_decoder; td->uper_encoder = asn_DEF_Int1.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Int1.per_constraints; td->elements = asn_DEF_Int1.elements; td->elements_count = asn_DEF_Int1.elements_count; td->specifics = asn_DEF_Int1.specifics; } void Int2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Int2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Int2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Int2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Int2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Int2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Int2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Int2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Int2] >>> ***/ static ber_tlv_tag_t asn_DEF_Int2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Int2 = { "Int2", "Int2", Int2_free, Int2_print, Int2_constraint, Int2_decode_ber, Int2_encode_der, Int2_decode_xer, Int2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Int2_tags_1, sizeof(asn_DEF_Int2_tags_1) /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */ asn_DEF_Int2_tags_1, /* Same as above */ sizeof(asn_DEF_Int2_tags_1) /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Int3] >>> ***/ #include "Int2.h" /*** <<< TYPE-DECLS [Int3] >>> ***/ typedef Int2_t Int3_t; /*** <<< FUNC-DECLS [Int3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Int3; asn_struct_free_f Int3_free; asn_struct_print_f Int3_print; asn_constr_check_f Int3_constraint; ber_type_decoder_f Int3_decode_ber; der_type_encoder_f Int3_encode_der; xer_type_decoder_f Int3_decode_xer; xer_type_encoder_f Int3_encode_xer; /*** <<< CODE [Int3] >>> ***/ int Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int2_t *st = (const Int2_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 0 && value <= 10)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Int2, * so here we adjust the DEF accordingly. */ static void Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Int2.free_struct; td->print_struct = asn_DEF_Int2.print_struct; td->ber_decoder = asn_DEF_Int2.ber_decoder; td->der_encoder = asn_DEF_Int2.der_encoder; td->xer_decoder = asn_DEF_Int2.xer_decoder; td->xer_encoder = asn_DEF_Int2.xer_encoder; td->uper_decoder = asn_DEF_Int2.uper_decoder; td->uper_encoder = asn_DEF_Int2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Int2.per_constraints; td->elements = asn_DEF_Int2.elements; td->elements_count = asn_DEF_Int2.elements_count; td->specifics = asn_DEF_Int2.specifics; } void Int3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Int3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Int3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Int3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Int3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Int3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Int3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Int3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Int3] >>> ***/ static ber_tlv_tag_t asn_DEF_Int3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Int3 = { "Int3", "Int3", Int3_free, Int3_print, Int3_constraint, Int3_decode_ber, Int3_encode_der, Int3_decode_xer, Int3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Int3_tags_1, sizeof(asn_DEF_Int3_tags_1) /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */ asn_DEF_Int3_tags_1, /* Same as above */ sizeof(asn_DEF_Int3_tags_1) /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Int4] >>> ***/ #include "Int3.h" /*** <<< TYPE-DECLS [Int4] >>> ***/ typedef Int3_t Int4_t; /*** <<< FUNC-DECLS [Int4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Int4; asn_struct_free_f Int4_free; asn_struct_print_f Int4_print; asn_constr_check_f Int4_constraint; ber_type_decoder_f Int4_decode_ber; der_type_encoder_f Int4_encode_der; xer_type_decoder_f Int4_decode_xer; xer_type_encoder_f Int4_encode_xer; /*** <<< CODE [Int4] >>> ***/ int Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int3_t *st = (const Int3_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 1 && value <= 10)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Int3, * so here we adjust the DEF accordingly. */ static void Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Int3.free_struct; td->print_struct = asn_DEF_Int3.print_struct; td->ber_decoder = asn_DEF_Int3.ber_decoder; td->der_encoder = asn_DEF_Int3.der_encoder; td->xer_decoder = asn_DEF_Int3.xer_decoder; td->xer_encoder = asn_DEF_Int3.xer_encoder; td->uper_decoder = asn_DEF_Int3.uper_decoder; td->uper_encoder = asn_DEF_Int3.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Int3.per_constraints; td->elements = asn_DEF_Int3.elements; td->elements_count = asn_DEF_Int3.elements_count; td->specifics = asn_DEF_Int3.specifics; } void Int4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Int4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Int4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Int4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Int4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Int4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Int4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Int4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Int4] >>> ***/ static ber_tlv_tag_t asn_DEF_Int4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Int4 = { "Int4", "Int4", Int4_free, Int4_print, Int4_constraint, Int4_decode_ber, Int4_encode_der, Int4_decode_xer, Int4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Int4_tags_1, sizeof(asn_DEF_Int4_tags_1) /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */ asn_DEF_Int4_tags_1, /* Same as above */ sizeof(asn_DEF_Int4_tags_1) /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Int5] >>> ***/ #include "Int4.h" /*** <<< TYPE-DECLS [Int5] >>> ***/ typedef Int4_t Int5_t; /*** <<< FUNC-DECLS [Int5] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Int5; asn_struct_free_f Int5_free; asn_struct_print_f Int5_print; asn_constr_check_f Int5_constraint; ber_type_decoder_f Int5_decode_ber; der_type_encoder_f Int5_encode_der; xer_type_decoder_f Int5_decode_xer; xer_type_encoder_f Int5_encode_xer; /*** <<< CODE [Int5] >>> ***/ int Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int4_t *st = (const Int4_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value == 5)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Int4, * so here we adjust the DEF accordingly. */ static void Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Int4.free_struct; td->print_struct = asn_DEF_Int4.print_struct; td->ber_decoder = asn_DEF_Int4.ber_decoder; td->der_encoder = asn_DEF_Int4.der_encoder; td->xer_decoder = asn_DEF_Int4.xer_decoder; td->xer_encoder = asn_DEF_Int4.xer_encoder; td->uper_decoder = asn_DEF_Int4.uper_decoder; td->uper_encoder = asn_DEF_Int4.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Int4.per_constraints; td->elements = asn_DEF_Int4.elements; td->elements_count = asn_DEF_Int4.elements_count; td->specifics = asn_DEF_Int4.specifics; } void Int5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Int5_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Int5_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Int5_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Int5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Int5_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Int5_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Int5_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Int5] >>> ***/ static ber_tlv_tag_t asn_DEF_Int5_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Int5 = { "Int5", "Int5", Int5_free, Int5_print, Int5_constraint, Int5_decode_ber, Int5_encode_der, Int5_decode_xer, Int5_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Int5_tags_1, sizeof(asn_DEF_Int5_tags_1) /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */ asn_DEF_Int5_tags_1, /* Same as above */ sizeof(asn_DEF_Int5_tags_1) /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [ExtensibleExtensions] >>> ***/ #include /*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/ typedef INTEGER_t ExtensibleExtensions_t; /*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions; asn_struct_free_f ExtensibleExtensions_free; asn_struct_print_f ExtensibleExtensions_print; asn_constr_check_f ExtensibleExtensions_constraint; ber_type_decoder_f ExtensibleExtensions_decode_ber; der_type_encoder_f ExtensibleExtensions_encode_der; xer_type_decoder_f ExtensibleExtensions_decode_xer; xer_type_encoder_f ExtensibleExtensions_encode_xer; /*** <<< CODE [ExtensibleExtensions] >>> ***/ int ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 1 && value <= 256)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void ExtensibleExtensions_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { ExtensibleExtensions_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/ static ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = { "ExtensibleExtensions", "ExtensibleExtensions", ExtensibleExtensions_free, ExtensibleExtensions_print, ExtensibleExtensions_constraint, ExtensibleExtensions_decode_ber, ExtensibleExtensions_encode_der, ExtensibleExtensions_decode_xer, ExtensibleExtensions_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ExtensibleExtensions_tags_1, sizeof(asn_DEF_ExtensibleExtensions_tags_1) /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */ asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */ sizeof(asn_DEF_ExtensibleExtensions_tags_1) /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Str1] >>> ***/ #include /*** <<< TYPE-DECLS [Str1] >>> ***/ typedef IA5String_t Str1_t; /*** <<< FUNC-DECLS [Str1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Str1; asn_struct_free_f Str1_free; asn_struct_print_f Str1_print; asn_constr_check_f Str1_constraint; ber_type_decoder_f Str1_decode_ber; der_type_encoder_f Str1_encode_der; xer_type_decoder_f Str1_decode_xer; xer_type_encoder_f Str1_encode_xer; /*** <<< CODE [Str1] >>> ***/ int Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_IA5String.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using IA5String, * so here we adjust the DEF accordingly. */ static void Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_IA5String.free_struct; td->print_struct = asn_DEF_IA5String.print_struct; td->ber_decoder = asn_DEF_IA5String.ber_decoder; td->der_encoder = asn_DEF_IA5String.der_encoder; td->xer_decoder = asn_DEF_IA5String.xer_decoder; td->xer_encoder = asn_DEF_IA5String.xer_encoder; td->uper_decoder = asn_DEF_IA5String.uper_decoder; td->uper_encoder = asn_DEF_IA5String.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_IA5String.per_constraints; td->elements = asn_DEF_IA5String.elements; td->elements_count = asn_DEF_IA5String.elements_count; td->specifics = asn_DEF_IA5String.specifics; } void Str1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Str1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Str1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Str1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Str1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Str1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Str1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Str1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Str1] >>> ***/ static ber_tlv_tag_t asn_DEF_Str1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Str1 = { "Str1", "Str1", Str1_free, Str1_print, Str1_constraint, Str1_decode_ber, Str1_encode_der, Str1_decode_xer, Str1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Str1_tags_1, sizeof(asn_DEF_Str1_tags_1) /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */ asn_DEF_Str1_tags_1, /* Same as above */ sizeof(asn_DEF_Str1_tags_1) /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Str2] >>> ***/ #include "Str1.h" /*** <<< TYPE-DECLS [Str2] >>> ***/ typedef Str1_t Str2_t; /*** <<< FUNC-DECLS [Str2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Str2; asn_struct_free_f Str2_free; asn_struct_print_f Str2_print; asn_constr_check_f Str2_constraint; ber_type_decoder_f Str2_decode_ber; der_type_encoder_f Str2_encode_der; xer_type_decoder_f Str2_decode_xer; xer_type_encoder_f Str2_encode_xer; /*** <<< CTABLES [Str2] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv <= 127)) return -1; } return 0; } /*** <<< CODE [Str2] >>> ***/ int Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Str1_t *st = (const Str1_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if(((size <= 20) || (size >= 25 && size <= 30)) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Str1, * so here we adjust the DEF accordingly. */ static void Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Str1.free_struct; td->print_struct = asn_DEF_Str1.print_struct; td->ber_decoder = asn_DEF_Str1.ber_decoder; td->der_encoder = asn_DEF_Str1.der_encoder; td->xer_decoder = asn_DEF_Str1.xer_decoder; td->xer_encoder = asn_DEF_Str1.xer_encoder; td->uper_decoder = asn_DEF_Str1.uper_decoder; td->uper_encoder = asn_DEF_Str1.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Str1.per_constraints; td->elements = asn_DEF_Str1.elements; td->elements_count = asn_DEF_Str1.elements_count; td->specifics = asn_DEF_Str1.specifics; } void Str2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Str2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Str2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Str2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Str2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Str2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Str2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Str2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Str2] >>> ***/ static ber_tlv_tag_t asn_DEF_Str2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Str2 = { "Str2", "Str2", Str2_free, Str2_print, Str2_constraint, Str2_decode_ber, Str2_encode_der, Str2_decode_xer, Str2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Str2_tags_1, sizeof(asn_DEF_Str2_tags_1) /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */ asn_DEF_Str2_tags_1, /* Same as above */ sizeof(asn_DEF_Str2_tags_1) /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Str3] >>> ***/ #include "Str2.h" /*** <<< TYPE-DECLS [Str3] >>> ***/ typedef Str2_t Str3_t; /*** <<< FUNC-DECLS [Str3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Str3; asn_struct_free_f Str3_free; asn_struct_print_f Str3_print; asn_constr_check_f Str3_constraint; ber_type_decoder_f Str3_decode_ber; der_type_encoder_f Str3_encode_der; xer_type_decoder_f Str3_decode_xer; xer_type_encoder_f Str3_encode_xer; /*** <<< CTABLES [Str3] >>> ***/ static int permitted_alphabet_table_1[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */ }; static int check_permitted_alphabet_1(const void *sptr) { int *table = permitted_alphabet_table_1; /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } /*** <<< CODE [Str3] >>> ***/ int Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Str2_t *st = (const Str2_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27)) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Str2, * so here we adjust the DEF accordingly. */ static void Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Str2.free_struct; td->print_struct = asn_DEF_Str2.print_struct; td->ber_decoder = asn_DEF_Str2.ber_decoder; td->der_encoder = asn_DEF_Str2.der_encoder; td->xer_decoder = asn_DEF_Str2.xer_decoder; td->xer_encoder = asn_DEF_Str2.xer_encoder; td->uper_decoder = asn_DEF_Str2.uper_decoder; td->uper_encoder = asn_DEF_Str2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Str2.per_constraints; td->elements = asn_DEF_Str2.elements; td->elements_count = asn_DEF_Str2.elements_count; td->specifics = asn_DEF_Str2.specifics; } void Str3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Str3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Str3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Str3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Str3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Str3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Str3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Str3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Str3] >>> ***/ static ber_tlv_tag_t asn_DEF_Str3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Str3 = { "Str3", "Str3", Str3_free, Str3_print, Str3_constraint, Str3_decode_ber, Str3_encode_der, Str3_decode_xer, Str3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Str3_tags_1, sizeof(asn_DEF_Str3_tags_1) /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */ asn_DEF_Str3_tags_1, /* Same as above */ sizeof(asn_DEF_Str3_tags_1) /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Str4] >>> ***/ #include /*** <<< TYPE-DECLS [Str4] >>> ***/ typedef IA5String_t Str4_t; /*** <<< FUNC-DECLS [Str4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Str4; asn_struct_free_f Str4_free; asn_struct_print_f Str4_print; asn_constr_check_f Str4_constraint; ber_type_decoder_f Str4_decode_ber; der_type_encoder_f Str4_encode_der; xer_type_decoder_f Str4_decode_xer; xer_type_encoder_f Str4_encode_xer; /*** <<< CTABLES [Str4] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv <= 127)) return -1; } return 0; } /*** <<< CODE [Str4] >>> ***/ int Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using IA5String, * so here we adjust the DEF accordingly. */ static void Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_IA5String.free_struct; td->print_struct = asn_DEF_IA5String.print_struct; td->ber_decoder = asn_DEF_IA5String.ber_decoder; td->der_encoder = asn_DEF_IA5String.der_encoder; td->xer_decoder = asn_DEF_IA5String.xer_decoder; td->xer_encoder = asn_DEF_IA5String.xer_encoder; td->uper_decoder = asn_DEF_IA5String.uper_decoder; td->uper_encoder = asn_DEF_IA5String.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_IA5String.per_constraints; td->elements = asn_DEF_IA5String.elements; td->elements_count = asn_DEF_IA5String.elements_count; td->specifics = asn_DEF_IA5String.specifics; } void Str4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Str4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Str4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Str4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Str4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Str4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Str4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Str4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Str4] >>> ***/ static ber_tlv_tag_t asn_DEF_Str4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Str4 = { "Str4", "Str4", Str4_free, Str4_print, Str4_constraint, Str4_decode_ber, Str4_encode_der, Str4_decode_xer, Str4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Str4_tags_1, sizeof(asn_DEF_Str4_tags_1) /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */ asn_DEF_Str4_tags_1, /* Same as above */ sizeof(asn_DEF_Str4_tags_1) /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [PER-Visible] >>> ***/ #include /*** <<< TYPE-DECLS [PER-Visible] >>> ***/ typedef IA5String_t PER_Visible_t; /*** <<< FUNC-DECLS [PER-Visible] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_PER_Visible; asn_struct_free_f PER_Visible_free; asn_struct_print_f PER_Visible_print; asn_constr_check_f PER_Visible_constraint; ber_type_decoder_f PER_Visible_decode_ber; der_type_encoder_f PER_Visible_encode_der; xer_type_decoder_f PER_Visible_decode_xer; xer_type_encoder_f PER_Visible_encode_xer; /*** <<< CTABLES [PER-Visible] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 70)) return -1; } return 0; } /*** <<< CODE [PER-Visible] >>> ***/ int PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using IA5String, * so here we adjust the DEF accordingly. */ static void PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_IA5String.free_struct; td->print_struct = asn_DEF_IA5String.print_struct; td->ber_decoder = asn_DEF_IA5String.ber_decoder; td->der_encoder = asn_DEF_IA5String.der_encoder; td->xer_decoder = asn_DEF_IA5String.xer_decoder; td->xer_encoder = asn_DEF_IA5String.xer_encoder; td->uper_decoder = asn_DEF_IA5String.uper_decoder; td->uper_encoder = asn_DEF_IA5String.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_IA5String.per_constraints; td->elements = asn_DEF_IA5String.elements; td->elements_count = asn_DEF_IA5String.elements_count; td->specifics = asn_DEF_IA5String.specifics; } void PER_Visible_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { PER_Visible_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t PER_Visible_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [PER-Visible] >>> ***/ static ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_PER_Visible = { "PER-Visible", "PER-Visible", PER_Visible_free, PER_Visible_print, PER_Visible_constraint, PER_Visible_decode_ber, PER_Visible_encode_der, PER_Visible_decode_xer, PER_Visible_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_PER_Visible_tags_1, sizeof(asn_DEF_PER_Visible_tags_1) /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */ asn_DEF_PER_Visible_tags_1, /* Same as above */ sizeof(asn_DEF_PER_Visible_tags_1) /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [PER-Visible-2] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/ typedef PER_Visible_t PER_Visible_2_t; /*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2; asn_struct_free_f PER_Visible_2_free; asn_struct_print_f PER_Visible_2_print; asn_constr_check_f PER_Visible_2_constraint; ber_type_decoder_f PER_Visible_2_decode_ber; der_type_encoder_f PER_Visible_2_encode_der; xer_type_decoder_f PER_Visible_2_decode_xer; xer_type_encoder_f PER_Visible_2_encode_xer; /*** <<< CTABLES [PER-Visible-2] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 69 && cv <= 70)) return -1; } return 0; } /*** <<< CODE [PER-Visible-2] >>> ***/ int PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void PER_Visible_2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { PER_Visible_2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [PER-Visible-2] >>> ***/ static ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = { "PER-Visible-2", "PER-Visible-2", PER_Visible_2_free, PER_Visible_2_print, PER_Visible_2_constraint, PER_Visible_2_decode_ber, PER_Visible_2_encode_der, PER_Visible_2_decode_xer, PER_Visible_2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_PER_Visible_2_tags_1, sizeof(asn_DEF_PER_Visible_2_tags_1) /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */ asn_DEF_PER_Visible_2_tags_1, /* Same as above */ sizeof(asn_DEF_PER_Visible_2_tags_1) /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/ typedef PER_Visible_t Not_PER_Visible_1_t; /*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1; asn_struct_free_f Not_PER_Visible_1_free; asn_struct_print_f Not_PER_Visible_1_print; asn_constr_check_f Not_PER_Visible_1_constraint; ber_type_decoder_f Not_PER_Visible_1_decode_ber; der_type_encoder_f Not_PER_Visible_1_encode_der; xer_type_decoder_f Not_PER_Visible_1_decode_xer; xer_type_encoder_f Not_PER_Visible_1_encode_xer; /*** <<< CTABLES [Not-PER-Visible-1] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 70)) return -1; } return 0; } /*** <<< CODE [Not-PER-Visible-1] >>> ***/ int Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/ static ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = { "Not-PER-Visible-1", "Not-PER-Visible-1", Not_PER_Visible_1_free, Not_PER_Visible_1_print, Not_PER_Visible_1_constraint, Not_PER_Visible_1_decode_ber, Not_PER_Visible_1_encode_der, Not_PER_Visible_1_decode_xer, Not_PER_Visible_1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Not_PER_Visible_1_tags_1, sizeof(asn_DEF_Not_PER_Visible_1_tags_1) /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */ asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */ sizeof(asn_DEF_Not_PER_Visible_1_tags_1) /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/ typedef PER_Visible_t Not_PER_Visible_2_t; /*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2; asn_struct_free_f Not_PER_Visible_2_free; asn_struct_print_f Not_PER_Visible_2_print; asn_constr_check_f Not_PER_Visible_2_constraint; ber_type_decoder_f Not_PER_Visible_2_decode_ber; der_type_encoder_f Not_PER_Visible_2_encode_der; xer_type_decoder_f Not_PER_Visible_2_decode_xer; xer_type_encoder_f Not_PER_Visible_2_encode_xer; /*** <<< CTABLES [Not-PER-Visible-2] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 66)) return -1; } return 0; } /*** <<< CODE [Not-PER-Visible-2] >>> ***/ int Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/ static ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = { "Not-PER-Visible-2", "Not-PER-Visible-2", Not_PER_Visible_2_free, Not_PER_Visible_2_print, Not_PER_Visible_2_constraint, Not_PER_Visible_2_decode_ber, Not_PER_Visible_2_encode_der, Not_PER_Visible_2_decode_xer, Not_PER_Visible_2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Not_PER_Visible_2_tags_1, sizeof(asn_DEF_Not_PER_Visible_2_tags_1) /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */ asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */ sizeof(asn_DEF_Not_PER_Visible_2_tags_1) /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/ typedef PER_Visible_t Not_PER_Visible_3_t; /*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3; asn_struct_free_f Not_PER_Visible_3_free; asn_struct_print_f Not_PER_Visible_3_print; asn_constr_check_f Not_PER_Visible_3_constraint; ber_type_decoder_f Not_PER_Visible_3_decode_ber; der_type_encoder_f Not_PER_Visible_3_encode_der; xer_type_decoder_f Not_PER_Visible_3_decode_xer; xer_type_encoder_f Not_PER_Visible_3_encode_xer; /*** <<< CTABLES [Not-PER-Visible-3] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 66)) return -1; } return 0; } /*** <<< CODE [Not-PER-Visible-3] >>> ***/ int Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/ static ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = { "Not-PER-Visible-3", "Not-PER-Visible-3", Not_PER_Visible_3_free, Not_PER_Visible_3_print, Not_PER_Visible_3_constraint, Not_PER_Visible_3_decode_ber, Not_PER_Visible_3_encode_der, Not_PER_Visible_3_decode_xer, Not_PER_Visible_3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Not_PER_Visible_3_tags_1, sizeof(asn_DEF_Not_PER_Visible_3_tags_1) /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */ asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */ sizeof(asn_DEF_Not_PER_Visible_3_tags_1) /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/ typedef PER_Visible_t SIZE_but_not_FROM_t; /*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM; asn_struct_free_f SIZE_but_not_FROM_free; asn_struct_print_f SIZE_but_not_FROM_print; asn_constr_check_f SIZE_but_not_FROM_constraint; ber_type_decoder_f SIZE_but_not_FROM_decode_ber; der_type_encoder_f SIZE_but_not_FROM_encode_der; xer_type_decoder_f SIZE_but_not_FROM_decode_xer; xer_type_encoder_f SIZE_but_not_FROM_encode_xer; /*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 68)) return -1; } return 0; } /*** <<< CODE [SIZE-but-not-FROM] >>> ***/ int SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1 && size <= 4) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/ static ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = { "SIZE-but-not-FROM", "SIZE-but-not-FROM", SIZE_but_not_FROM_free, SIZE_but_not_FROM_print, SIZE_but_not_FROM_constraint, SIZE_but_not_FROM_decode_ber, SIZE_but_not_FROM_encode_der, SIZE_but_not_FROM_decode_xer, SIZE_but_not_FROM_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SIZE_but_not_FROM_tags_1, sizeof(asn_DEF_SIZE_but_not_FROM_tags_1) /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */ asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */ sizeof(asn_DEF_SIZE_but_not_FROM_tags_1) /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [SIZE-and-FROM] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/ typedef PER_Visible_t SIZE_and_FROM_t; /*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM; asn_struct_free_f SIZE_and_FROM_free; asn_struct_print_f SIZE_and_FROM_print; asn_constr_check_f SIZE_and_FROM_constraint; ber_type_decoder_f SIZE_and_FROM_decode_ber; der_type_encoder_f SIZE_and_FROM_encode_der; xer_type_decoder_f SIZE_and_FROM_decode_xer; xer_type_encoder_f SIZE_and_FROM_encode_xer; /*** <<< CTABLES [SIZE-and-FROM] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 68)) return -1; } return 0; } /*** <<< CODE [SIZE-and-FROM] >>> ***/ int SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1 && size <= 4) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void SIZE_and_FROM_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { SIZE_and_FROM_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/ static ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = { "SIZE-and-FROM", "SIZE-and-FROM", SIZE_and_FROM_free, SIZE_and_FROM_print, SIZE_and_FROM_constraint, SIZE_and_FROM_decode_ber, SIZE_and_FROM_encode_der, SIZE_and_FROM_decode_xer, SIZE_and_FROM_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SIZE_and_FROM_tags_1, sizeof(asn_DEF_SIZE_and_FROM_tags_1) /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */ asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */ sizeof(asn_DEF_SIZE_and_FROM_tags_1) /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/ #include "PER-Visible.h" /*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/ typedef PER_Visible_t Neither_SIZE_nor_FROM_t; /*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM; asn_struct_free_f Neither_SIZE_nor_FROM_free; asn_struct_print_f Neither_SIZE_nor_FROM_print; asn_constr_check_f Neither_SIZE_nor_FROM_constraint; ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber; der_type_encoder_f Neither_SIZE_nor_FROM_encode_der; xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer; xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer; /*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 70)) return -1; } return 0; } /*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/ int Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PER_Visible_t *st = (const PER_Visible_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */ static void Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_PER_Visible.free_struct; td->print_struct = asn_DEF_PER_Visible.print_struct; td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; td->der_encoder = asn_DEF_PER_Visible.der_encoder; td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_PER_Visible.per_constraints; td->elements = asn_DEF_PER_Visible.elements; td->elements_count = asn_DEF_PER_Visible.elements_count; td->specifics = asn_DEF_PER_Visible.specifics; } void Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/ static ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = { "Neither-SIZE-nor-FROM", "Neither-SIZE-nor-FROM", Neither_SIZE_nor_FROM_free, Neither_SIZE_nor_FROM_print, Neither_SIZE_nor_FROM_constraint, Neither_SIZE_nor_FROM_decode_ber, Neither_SIZE_nor_FROM_encode_der, Neither_SIZE_nor_FROM_decode_xer, Neither_SIZE_nor_FROM_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Neither_SIZE_nor_FROM_tags_1, sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1) /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */ asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */ sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1) /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Utf8-4] >>> ***/ #include /*** <<< TYPE-DECLS [Utf8-4] >>> ***/ typedef UTF8String_t Utf8_4_t; /*** <<< FUNC-DECLS [Utf8-4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Utf8_4; asn_struct_free_f Utf8_4_free; asn_struct_print_f Utf8_4_print; asn_constr_check_f Utf8_4_constraint; ber_type_decoder_f Utf8_4_decode_ber; der_type_encoder_f Utf8_4_encode_der; xer_type_decoder_f Utf8_4_decode_xer; xer_type_encoder_f Utf8_4_encode_xer; /*** <<< CTABLES [Utf8-4] >>> ***/ static int check_permitted_alphabet_1(const void *sptr) { if(UTF8String_length((const UTF8String_t *)sptr) < 0) return -1; /* Alphabet (sic!) test failed. */ return 0; } /*** <<< CODE [Utf8-4] >>> ***/ int Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using UTF8String, * so here we adjust the DEF accordingly. */ static void Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_UTF8String.free_struct; td->print_struct = asn_DEF_UTF8String.print_struct; td->ber_decoder = asn_DEF_UTF8String.ber_decoder; td->der_encoder = asn_DEF_UTF8String.der_encoder; td->xer_decoder = asn_DEF_UTF8String.xer_decoder; td->xer_encoder = asn_DEF_UTF8String.xer_encoder; td->uper_decoder = asn_DEF_UTF8String.uper_decoder; td->uper_encoder = asn_DEF_UTF8String.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_UTF8String.per_constraints; td->elements = asn_DEF_UTF8String.elements; td->elements_count = asn_DEF_UTF8String.elements_count; td->specifics = asn_DEF_UTF8String.specifics; } void Utf8_4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Utf8_4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Utf8_4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Utf8-4] >>> ***/ static ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Utf8_4 = { "Utf8-4", "Utf8-4", Utf8_4_free, Utf8_4_print, Utf8_4_constraint, Utf8_4_decode_ber, Utf8_4_encode_der, Utf8_4_decode_xer, Utf8_4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Utf8_4_tags_1, sizeof(asn_DEF_Utf8_4_tags_1) /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */ asn_DEF_Utf8_4_tags_1, /* Same as above */ sizeof(asn_DEF_Utf8_4_tags_1) /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Utf8-3] >>> ***/ #include "Utf8-2.h" /*** <<< TYPE-DECLS [Utf8-3] >>> ***/ typedef Utf8_2_t Utf8_3_t; /*** <<< FUNC-DECLS [Utf8-3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Utf8_3; asn_struct_free_f Utf8_3_free; asn_struct_print_f Utf8_3_print; asn_constr_check_f Utf8_3_constraint; ber_type_decoder_f Utf8_3_decode_ber; der_type_encoder_f Utf8_3_encode_der; xer_type_decoder_f Utf8_3_decode_xer; xer_type_encoder_f Utf8_3_encode_xer; /*** <<< CTABLES [Utf8-3] >>> ***/ static int permitted_alphabet_table_1[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */ 16,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */ 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */ 42,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ }; static int check_permitted_alphabet_1(const void *sptr) { int *table = permitted_alphabet_table_1; /* The underlying type is UTF8String */ const UTF8String_t *st = (const UTF8String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(cv >= 0x80) return -1; if(!table[cv]) return -1; } return 0; } /*** <<< CODE [Utf8-3] >>> ***/ int Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Utf8_2_t *st = (const Utf8_2_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, "%s: UTF-8: broken encoding (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((size >= 1 && size <= 2) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Utf8_2, * so here we adjust the DEF accordingly. */ static void Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Utf8_2.free_struct; td->print_struct = asn_DEF_Utf8_2.print_struct; td->ber_decoder = asn_DEF_Utf8_2.ber_decoder; td->der_encoder = asn_DEF_Utf8_2.der_encoder; td->xer_decoder = asn_DEF_Utf8_2.xer_decoder; td->xer_encoder = asn_DEF_Utf8_2.xer_encoder; td->uper_decoder = asn_DEF_Utf8_2.uper_decoder; td->uper_encoder = asn_DEF_Utf8_2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Utf8_2.per_constraints; td->elements = asn_DEF_Utf8_2.elements; td->elements_count = asn_DEF_Utf8_2.elements_count; td->specifics = asn_DEF_Utf8_2.specifics; } void Utf8_3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Utf8_3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Utf8_3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Utf8-3] >>> ***/ static ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Utf8_3 = { "Utf8-3", "Utf8-3", Utf8_3_free, Utf8_3_print, Utf8_3_constraint, Utf8_3_decode_ber, Utf8_3_encode_der, Utf8_3_decode_xer, Utf8_3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Utf8_3_tags_1, sizeof(asn_DEF_Utf8_3_tags_1) /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */ asn_DEF_Utf8_3_tags_1, /* Same as above */ sizeof(asn_DEF_Utf8_3_tags_1) /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Utf8-2] >>> ***/ #include "Utf8-1.h" /*** <<< TYPE-DECLS [Utf8-2] >>> ***/ typedef Utf8_1_t Utf8_2_t; /*** <<< FUNC-DECLS [Utf8-2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Utf8_2; asn_struct_free_f Utf8_2_free; asn_struct_print_f Utf8_2_print; asn_constr_check_f Utf8_2_constraint; ber_type_decoder_f Utf8_2_decode_ber; der_type_encoder_f Utf8_2_encode_der; xer_type_decoder_f Utf8_2_decode_xer; xer_type_encoder_f Utf8_2_encode_xer; /*** <<< CODE [Utf8-2] >>> ***/ int Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Utf8_1_t *st = (const Utf8_1_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, "%s: UTF-8: broken encoding (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((size >= 1 && size <= 2)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Utf8_1, * so here we adjust the DEF accordingly. */ static void Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Utf8_1.free_struct; td->print_struct = asn_DEF_Utf8_1.print_struct; td->ber_decoder = asn_DEF_Utf8_1.ber_decoder; td->der_encoder = asn_DEF_Utf8_1.der_encoder; td->xer_decoder = asn_DEF_Utf8_1.xer_decoder; td->xer_encoder = asn_DEF_Utf8_1.xer_encoder; td->uper_decoder = asn_DEF_Utf8_1.uper_decoder; td->uper_encoder = asn_DEF_Utf8_1.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Utf8_1.per_constraints; td->elements = asn_DEF_Utf8_1.elements; td->elements_count = asn_DEF_Utf8_1.elements_count; td->specifics = asn_DEF_Utf8_1.specifics; } void Utf8_2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Utf8_2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Utf8_2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Utf8-2] >>> ***/ static ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Utf8_2 = { "Utf8-2", "Utf8-2", Utf8_2_free, Utf8_2_print, Utf8_2_constraint, Utf8_2_decode_ber, Utf8_2_encode_der, Utf8_2_decode_xer, Utf8_2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Utf8_2_tags_1, sizeof(asn_DEF_Utf8_2_tags_1) /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */ asn_DEF_Utf8_2_tags_1, /* Same as above */ sizeof(asn_DEF_Utf8_2_tags_1) /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Utf8-1] >>> ***/ #include /*** <<< TYPE-DECLS [Utf8-1] >>> ***/ typedef UTF8String_t Utf8_1_t; /*** <<< FUNC-DECLS [Utf8-1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Utf8_1; asn_struct_free_f Utf8_1_free; asn_struct_print_f Utf8_1_print; asn_constr_check_f Utf8_1_constraint; ber_type_decoder_f Utf8_1_decode_ber; der_type_encoder_f Utf8_1_encode_der; xer_type_decoder_f Utf8_1_decode_xer; xer_type_encoder_f Utf8_1_encode_xer; /*** <<< CODE [Utf8-1] >>> ***/ int Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_UTF8String.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using UTF8String, * so here we adjust the DEF accordingly. */ static void Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_UTF8String.free_struct; td->print_struct = asn_DEF_UTF8String.print_struct; td->ber_decoder = asn_DEF_UTF8String.ber_decoder; td->der_encoder = asn_DEF_UTF8String.der_encoder; td->xer_decoder = asn_DEF_UTF8String.xer_decoder; td->xer_encoder = asn_DEF_UTF8String.xer_encoder; td->uper_decoder = asn_DEF_UTF8String.uper_decoder; td->uper_encoder = asn_DEF_UTF8String.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_UTF8String.per_constraints; td->elements = asn_DEF_UTF8String.elements; td->elements_count = asn_DEF_UTF8String.elements_count; td->specifics = asn_DEF_UTF8String.specifics; } void Utf8_1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Utf8_1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Utf8_1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Utf8_1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Utf8-1] >>> ***/ static ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Utf8_1 = { "Utf8-1", "Utf8-1", Utf8_1_free, Utf8_1_print, Utf8_1_constraint, Utf8_1_decode_ber, Utf8_1_encode_der, Utf8_1_decode_xer, Utf8_1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Utf8_1_tags_1, sizeof(asn_DEF_Utf8_1_tags_1) /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */ asn_DEF_Utf8_1_tags_1, /* Same as above */ sizeof(asn_DEF_Utf8_1_tags_1) /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [VisibleIdentifier] >>> ***/ #include "Identifier.h" /*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/ typedef Identifier_t VisibleIdentifier_t; /*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier; asn_struct_free_f VisibleIdentifier_free; asn_struct_print_f VisibleIdentifier_print; asn_constr_check_f VisibleIdentifier_constraint; ber_type_decoder_f VisibleIdentifier_decode_ber; der_type_encoder_f VisibleIdentifier_encode_der; xer_type_decoder_f VisibleIdentifier_decode_xer; xer_type_encoder_f VisibleIdentifier_encode_xer; /*** <<< CTABLES [VisibleIdentifier] >>> ***/ static int permitted_alphabet_table_1[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */ 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */ 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */ 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */ 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */ 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ }; static int check_permitted_alphabet_1(const void *sptr) { int *table = permitted_alphabet_table_1; /* The underlying type is VisibleString */ const VisibleString_t *st = (const VisibleString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } /*** <<< CODE [VisibleIdentifier] >>> ***/ int VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Identifier_t *st = (const Identifier_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1 && size <= 32) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using Identifier, * so here we adjust the DEF accordingly. */ static void VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Identifier.free_struct; td->print_struct = asn_DEF_Identifier.print_struct; td->ber_decoder = asn_DEF_Identifier.ber_decoder; td->der_encoder = asn_DEF_Identifier.der_encoder; td->xer_decoder = asn_DEF_Identifier.xer_decoder; td->xer_encoder = asn_DEF_Identifier.xer_encoder; td->uper_decoder = asn_DEF_Identifier.uper_decoder; td->uper_encoder = asn_DEF_Identifier.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Identifier.per_constraints; td->elements = asn_DEF_Identifier.elements; td->elements_count = asn_DEF_Identifier.elements_count; td->specifics = asn_DEF_Identifier.specifics; } void VisibleIdentifier_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { VisibleIdentifier_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/ static ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)) }; asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = { "VisibleIdentifier", "VisibleIdentifier", VisibleIdentifier_free, VisibleIdentifier_print, VisibleIdentifier_constraint, VisibleIdentifier_decode_ber, VisibleIdentifier_encode_der, VisibleIdentifier_decode_xer, VisibleIdentifier_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_VisibleIdentifier_tags_1, sizeof(asn_DEF_VisibleIdentifier_tags_1) /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */ asn_DEF_VisibleIdentifier_tags_1, /* Same as above */ sizeof(asn_DEF_VisibleIdentifier_tags_1) /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [Sequence] >>> ***/ #include "Int1.h" #include "Int4.h" #include #include #include #include "Int5.h" #include /*** <<< DEPS [Sequence] >>> ***/ typedef enum enum_c { enum_c_one = 1, enum_c_two = 2, /* * Enumeration is extensible */ enum_c_three = 3 } e_enum_c; /*** <<< TYPE-DECLS [Sequence] >>> ***/ typedef struct Sequence { Int1_t *int1_c /* DEFAULT 3 */; Int4_t int4; Int4_t int4_c; BOOLEAN_t *bool /* DEFAULT 1 */; ENUMERATED_t enum_c; NULL_t *null /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */ Int5_t *int5_c /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Sequence_t; /*** <<< FUNC-DECLS [Sequence] >>> ***/ /* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_Sequence; /*** <<< CODE [Sequence] >>> ***/ static int enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } static void enum_c_6_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { enum_c_6_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { enum_c_6_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { enum_c_6_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t enum_c_6_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { enum_c_6_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { enum_c_6_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { enum_c_6_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int1_t *st = (const Int1_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= -2)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int4_t *st = (const Int4_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 5 && value <= 7)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const Int5_t *st = (const Int5_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value == 5)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [Sequence] >>> ***/ static int asn_DFL_2_set_3(int set_value, void **sptr) { Int1_t *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { /* Install default value 3 */ return asn_long2INTEGER(st, 3); } else { /* Test default value 3 */ long value; if(asn_INTEGER2long(st, &value)) return -1; return (value == 3); } } static int asn_DFL_5_set_1(int set_value, void **sptr) { BOOLEAN_t *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { /* Install default value 1 */ *st = 1; return 0; } else { /* Test default value 1 */ return (*st == 1); } } static asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = { { 1, 3, "one" }, { 2, 3, "two" }, { 3, 5, "three" } /* This list is extensible */ }; static unsigned int asn_MAP_enum_c_enum2value_6[] = { 0, /* one(1) */ 2, /* three(3) */ 1 /* two(2) */ /* This list is extensible */ }; static asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = { asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */ asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */ 3, /* Number of elements in the maps */ 3, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_enum_c_6 = { "enum-c", "enum-c", enum_c_6_free, enum_c_6_print, enum_c_6_constraint, enum_c_6_decode_ber, enum_c_6_encode_der, enum_c_6_decode_xer, enum_c_6_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_enum_c_tags_6, sizeof(asn_DEF_enum_c_tags_6) /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */ asn_DEF_enum_c_tags_6, /* Same as above */ sizeof(asn_DEF_enum_c_tags_6) /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_enum_c_specs_6 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Sequence_1[] = { { ATF_POINTER, 1, offsetof(struct Sequence, int1_c), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_Int1, .memb_constraints = memb_int1_c_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */ .name = "int1-c" }, { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Int4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "int4" }, { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_Int4, .memb_constraints = memb_int4_c_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "int4-c" }, { ATF_POINTER, 1, offsetof(struct Sequence, bool), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */ .name = "bool" }, { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c), .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), .tag_mode = 0, .type = &asn_DEF_enum_c_6, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "enum-c" }, { ATF_POINTER, 2, offsetof(struct Sequence, null), .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), .tag_mode = 0, .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "null" }, { ATF_POINTER, 1, offsetof(struct Sequence, int5_c), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_Int5, .memb_constraints = memb_int5_c_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "int5-c" }, }; static ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool at 59 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c at 56 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c at 58 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c at 62 */ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null at 64 */ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c at 60 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 at 57 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = { sizeof(struct Sequence), offsetof(struct Sequence, _asn_ctx), asn_MAP_Sequence_tag2el_1, 7, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 5, /* Start extensions */ 8 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Sequence = { "Sequence", "Sequence", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Sequence_tags_1, sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ asn_DEF_Sequence_tags_1, /* Same as above */ sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Sequence_1, 7, /* Elements count */ &asn_SPC_Sequence_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SequenceOf] >>> ***/ #include #include /*** <<< FWD-DECLS [SequenceOf] >>> ***/ struct Sequence; /*** <<< TYPE-DECLS [SequenceOf] >>> ***/ typedef struct SequenceOf { A_SEQUENCE_OF(struct Sequence) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SequenceOf_t; /*** <<< FUNC-DECLS [SequenceOf] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SequenceOf; /*** <<< POST-INCLUDE [SequenceOf] >>> ***/ #include "Sequence.h" /*** <<< STAT-DEFS [SequenceOf] >>> ***/ static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = { sizeof(struct SequenceOf), offsetof(struct SequenceOf, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_SequenceOf = { "SequenceOf", "SequenceOf", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SequenceOf_tags_1, sizeof(asn_DEF_SequenceOf_tags_1) /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */ asn_DEF_SequenceOf_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOf_tags_1) /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SequenceOf_1, 1, /* Single element */ &asn_SPC_SequenceOf_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Enum0] >>> ***/ #include /*** <<< DEPS [Enum0] >>> ***/ typedef enum Enum0 { Enum0_one = 0, Enum0_two = 1 } e_Enum0; /*** <<< TYPE-DECLS [Enum0] >>> ***/ typedef ENUMERATED_t Enum0_t; /*** <<< FUNC-DECLS [Enum0] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Enum0; asn_struct_free_f Enum0_free; asn_struct_print_f Enum0_print; asn_constr_check_f Enum0_constraint; ber_type_decoder_f Enum0_decode_ber; der_type_encoder_f Enum0_encode_der; xer_type_decoder_f Enum0_decode_xer; xer_type_encoder_f Enum0_encode_xer; /*** <<< CODE [Enum0] >>> ***/ int Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } void Enum0_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Enum0_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Enum0_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Enum0_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Enum0_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Enum0_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Enum0_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Enum0_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Enum0] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = { { 0, 3, "one" }, { 1, 3, "two" } }; static unsigned int asn_MAP_Enum0_enum2value_1[] = { 0, /* one(0) */ 1 /* two(1) */ }; static asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = { asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */ 2, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Enum0 = { "Enum0", "Enum0", Enum0_free, Enum0_print, Enum0_constraint, Enum0_decode_ber, Enum0_encode_der, Enum0_decode_xer, Enum0_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Enum0_tags_1, sizeof(asn_DEF_Enum0_tags_1) /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */ asn_DEF_Enum0_tags_1, /* Same as above */ sizeof(asn_DEF_Enum0_tags_1) /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_Enum0_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Enum1] >>> ***/ #include /*** <<< DEPS [Enum1] >>> ***/ typedef enum Enum1 { Enum1_one = 0, Enum1_two = 1 } e_Enum1; /*** <<< TYPE-DECLS [Enum1] >>> ***/ typedef long Enum1_t; /*** <<< FUNC-DECLS [Enum1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Enum1; asn_struct_free_f Enum1_free; asn_struct_print_f Enum1_print; asn_constr_check_f Enum1_constraint; ber_type_decoder_f Enum1_decode_ber; der_type_encoder_f Enum1_encode_der; xer_type_decoder_f Enum1_decode_xer; xer_type_encoder_f Enum1_encode_xer; /*** <<< CODE [Enum1] >>> ***/ int Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value == 0)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ static void Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeEnumerated.free_struct; td->print_struct = asn_DEF_NativeEnumerated.print_struct; td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } void Enum1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Enum1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Enum1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Enum1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Enum1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Enum1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Enum1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Enum1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Enum1] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = { { 0, 3, "one" }, { 1, 3, "two" } }; static unsigned int asn_MAP_Enum1_enum2value_1[] = { 0, /* one(0) */ 1 /* two(1) */ }; static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = { asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */ 2, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Enum1 = { "Enum1", "Enum1", Enum1_free, Enum1_print, Enum1_constraint, Enum1_decode_ber, Enum1_encode_der, Enum1_decode_xer, Enum1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Enum1_tags_1, sizeof(asn_DEF_Enum1_tags_1) /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ asn_DEF_Enum1_tags_1, /* Same as above */ sizeof(asn_DEF_Enum1_tags_1) /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_Enum1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Identifier] >>> ***/ #include /*** <<< TYPE-DECLS [Identifier] >>> ***/ typedef VisibleString_t Identifier_t; /*** <<< FUNC-DECLS [Identifier] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Identifier; asn_struct_free_f Identifier_free; asn_struct_print_f Identifier_print; asn_constr_check_f Identifier_constraint; ber_type_decoder_f Identifier_decode_ber; der_type_encoder_f Identifier_encode_der; xer_type_decoder_f Identifier_decode_xer; xer_type_encoder_f Identifier_encode_xer; /*** <<< CTABLES [Identifier] >>> ***/ static int permitted_alphabet_table_1[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */ 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */ 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */ 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */ 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */ 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ }; static int check_permitted_alphabet_1(const void *sptr) { int *table = permitted_alphabet_table_1; /* The underlying type is VisibleString */ const VisibleString_t *st = (const VisibleString_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } /*** <<< CODE [Identifier] >>> ***/ int Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const VisibleString_t *st = (const VisibleString_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1 && size <= 32) && !check_permitted_alphabet_1(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using VisibleString, * so here we adjust the DEF accordingly. */ static void Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_VisibleString.free_struct; td->print_struct = asn_DEF_VisibleString.print_struct; td->ber_decoder = asn_DEF_VisibleString.ber_decoder; td->der_encoder = asn_DEF_VisibleString.der_encoder; td->xer_decoder = asn_DEF_VisibleString.xer_decoder; td->xer_encoder = asn_DEF_VisibleString.xer_encoder; td->uper_decoder = asn_DEF_VisibleString.uper_decoder; td->uper_encoder = asn_DEF_VisibleString.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_VisibleString.per_constraints; td->elements = asn_DEF_VisibleString.elements; td->elements_count = asn_DEF_VisibleString.elements_count; td->specifics = asn_DEF_VisibleString.specifics; } void Identifier_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Identifier_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Identifier_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Identifier_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Identifier_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Identifier_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Identifier_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Identifier_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Identifier] >>> ***/ static ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Identifier = { "Identifier", "Identifier", Identifier_free, Identifier_print, Identifier_constraint, Identifier_decode_ber, Identifier_encode_der, Identifier_decode_xer, Identifier_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Identifier_tags_1, sizeof(asn_DEF_Identifier_tags_1) /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */ asn_DEF_Identifier_tags_1, /* Same as above */ sizeof(asn_DEF_Identifier_tags_1) /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/99-class-sample-OK.asn1.-EFprint-class-matrix0000644000000000000000000000277011461146446023355 0ustar rootrootModuleClassSample { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 99 } DEFINITIONS ::= BEGIN SAMPLE-CLASS ::= CLASS { &id RELATIVE-OID UNIQUE, &code ENUMERATED { request(0), response(1), status(2) } DEFAULT 0, &Type OPTIONAL } WITH SYNTAX { [TYPE &Type] [WITH CODE &code] IDENTIFIED BY &id } -- Class matrix has 4 entries: -- [ &id][ &code][ &Type] -- [1] request-whatever -- [2] response-stuff 1 -- [3] request-id 2 SampleType -- [4] request-salt Salt SampleClassObjectSet SAMPLE-CLASS ::= {{ IDENTIFIED BY request-whatever } | { WITH CODE 1 IDENTIFIED BY response-stuff } | { TYPE SampleType WITH CODE 2 IDENTIFIED BY request-id } | { TYPE Salt IDENTIFIED BY request-salt }} request-Whatever SAMPLE-CLASS ::= { IDENTIFIED BY request-whatever } respond-Stuff SAMPLE-CLASS ::= { WITH CODE 1 IDENTIFIED BY response-stuff } request-Status SAMPLE-CLASS ::= { TYPE SampleType WITH CODE 2 IDENTIFIED BY request-id } request-Salt SAMPLE-CLASS ::= { TYPE Salt IDENTIFIED BY request-salt } request-id RELATIVE-OID ::= { 1 1 1 } request-salt RELATIVE-OID ::= { 1 1 1 } request-whatever RELATIVE-OID ::= { 1 1 5 } response-stuff RELATIVE-OID ::= { 2 0 1 } SampleType ::= SEQUENCE { ... } Salt ::= SET { ... } END asn1c-0.9.24+dfsg/tests/118-per-constraint-OK.asn10000644000000000000000000000127011461147103017742 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .118 ModuleConstraintPrecedence { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 118 } DEFINITIONS ::= BEGIN E1 ::= IA5String (SIZE(1..5, ...) ^ FROM("A".."Z")) E2 ::= IA5String (SIZE(1..5,...,5)) (FROM("A".."Z")) E3 ::= IA5String (SIZE(1..5) ^ FROM("A".."Z"),...) E4 ::= IA5String (FROM("A".."Z"),...) (SIZE(1..5)) C ::= IA5String (SIZE(10) ^ FROM("A".."D") | SIZE(20) ^ FROM("D".."F")) P ::= IA5String (FROM("AB") ^ SIZE(1..2) | FROM("DE") ^ SIZE(3) | FROM("AXE") ^ SIZE(1..5)) END asn1c-0.9.24+dfsg/tests/73-circular-OK.asn1.-P0000644000000000000000000005775111461230611017005 0ustar rootroot /*** <<< INCLUDES [Type] >>> ***/ #include #include #include /*** <<< FWD-DECLS [Type] >>> ***/ struct Epyt; /*** <<< TYPE-DECLS [Type] >>> ***/ typedef struct Type { struct data { A_SEQUENCE_OF(struct Epyt) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } data; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Type_t; /*** <<< FUNC-DECLS [Type] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Type; /*** <<< POST-INCLUDE [Type] >>> ***/ #include "EpytRef.h" /*** <<< STAT-DEFS [Type] >>> ***/ static asn_TYPE_member_t asn_MBR_data_2[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_EpytRef, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_data_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_data_specs_2 = { sizeof(struct data), offsetof(struct data, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_data_2 = { "data", "data", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_data_tags_2, sizeof(asn_DEF_data_tags_2) /sizeof(asn_DEF_data_tags_2[0]), /* 1 */ asn_DEF_data_tags_2, /* Same as above */ sizeof(asn_DEF_data_tags_2) /sizeof(asn_DEF_data_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_data_2, 1, /* Single element */ &asn_SPC_data_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Type_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Type, data), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_data_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "data" }, }; static ber_tlv_tag_t asn_DEF_Type_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Type_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data at 16 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1 = { sizeof(struct Type), offsetof(struct Type, _asn_ctx), asn_MAP_Type_tag2el_1, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Type = { "Type", "Type", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Type_tags_1, sizeof(asn_DEF_Type_tags_1) /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */ asn_DEF_Type_tags_1, /* Same as above */ sizeof(asn_DEF_Type_tags_1) /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Type_1, 1, /* Elements count */ &asn_SPC_Type_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [EpytRef] >>> ***/ #include "Epyt.h" /*** <<< TYPE-DECLS [EpytRef] >>> ***/ typedef Epyt_t EpytRef_t; /*** <<< FUNC-DECLS [EpytRef] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_EpytRef; asn_struct_free_f EpytRef_free; asn_struct_print_f EpytRef_print; asn_constr_check_f EpytRef_constraint; ber_type_decoder_f EpytRef_decode_ber; der_type_encoder_f EpytRef_encode_der; xer_type_decoder_f EpytRef_decode_xer; xer_type_encoder_f EpytRef_encode_xer; /*** <<< CODE [EpytRef] >>> ***/ int EpytRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Epyt.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Epyt, * so here we adjust the DEF accordingly. */ static void EpytRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Epyt.free_struct; td->print_struct = asn_DEF_Epyt.print_struct; td->ber_decoder = asn_DEF_Epyt.ber_decoder; td->der_encoder = asn_DEF_Epyt.der_encoder; td->xer_decoder = asn_DEF_Epyt.xer_decoder; td->xer_encoder = asn_DEF_Epyt.xer_encoder; td->uper_decoder = asn_DEF_Epyt.uper_decoder; td->uper_encoder = asn_DEF_Epyt.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Epyt.per_constraints; td->elements = asn_DEF_Epyt.elements; td->elements_count = asn_DEF_Epyt.elements_count; td->specifics = asn_DEF_Epyt.specifics; } void EpytRef_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { EpytRef_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int EpytRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { EpytRef_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t EpytRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { EpytRef_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t EpytRef_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { EpytRef_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t EpytRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { EpytRef_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t EpytRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { EpytRef_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [EpytRef] >>> ***/ static ber_tlv_tag_t asn_DEF_EpytRef_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_EpytRef = { "EpytRef", "EpytRef", EpytRef_free, EpytRef_print, EpytRef_constraint, EpytRef_decode_ber, EpytRef_encode_der, EpytRef_decode_xer, EpytRef_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_EpytRef_tags_1, sizeof(asn_DEF_EpytRef_tags_1) /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */ asn_DEF_EpytRef_tags_1, /* Same as above */ sizeof(asn_DEF_EpytRef_tags_1) /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [Epyt] >>> ***/ #include #include #include /*** <<< FWD-DECLS [Epyt] >>> ***/ struct Type; struct Ypet; /*** <<< TYPE-DECLS [Epyt] >>> ***/ typedef struct Epyt { struct stype { A_SET_OF(struct Type) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } stype; struct Type *type /* OPTIONAL */; struct Ypet *ypet /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Epyt_t; /*** <<< FUNC-DECLS [Epyt] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Epyt; /*** <<< POST-INCLUDE [Epyt] >>> ***/ #include "Type.h" #include "Ypet.h" /*** <<< STAT-DEFS [Epyt] >>> ***/ static asn_TYPE_member_t asn_MBR_stype_2[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Type, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_stype_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_stype_specs_2 = { sizeof(struct stype), offsetof(struct stype, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_stype_2 = { "stype", "stype", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_stype_tags_2, sizeof(asn_DEF_stype_tags_2) /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */ asn_DEF_stype_tags_2, /* Same as above */ sizeof(asn_DEF_stype_tags_2) /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_stype_2, 1, /* Single element */ &asn_SPC_stype_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Epyt_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_stype_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "stype" }, { ATF_POINTER, 2, offsetof(struct Epyt, type), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Type, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "type" }, { ATF_POINTER, 1, offsetof(struct Epyt, ypet), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_Ypet, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ypet" }, }; static ber_tlv_tag_t asn_DEF_Epyt_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Epyt_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type at 22 */ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype at 21 */ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet at 23 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1 = { sizeof(struct Epyt), offsetof(struct Epyt, _asn_ctx), asn_MAP_Epyt_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Epyt = { "Epyt", "Epyt", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Epyt_tags_1, sizeof(asn_DEF_Epyt_tags_1) /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */ asn_DEF_Epyt_tags_1, /* Same as above */ sizeof(asn_DEF_Epyt_tags_1) /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Epyt_1, 3, /* Elements count */ &asn_SPC_Epyt_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Ypet] >>> ***/ #include #include #include "EnumType.h" #include #include #include /*** <<< DEPS [Ypet] >>> ***/ /* * Method of determining the components presence */ typedef enum Ypet_PR { Ypet_PR_epyt, /* Member epyt is present */ Ypet_PR_plain, /* Member plain is present */ Ypet_PR_senums, /* Member senums is present */ Ypet_PR_patest1, /* Member patest1 is present */ Ypet_PR_patest2, /* Member patest2 is present */ } Ypet_PR; /*** <<< FWD-DECLS [Ypet] >>> ***/ struct Epyt; /*** <<< TYPE-DECLS [Ypet] >>> ***/ typedef struct Ypet { struct Epyt *epyt; INTEGER_t *plain /* DEFAULT 7 */; struct senums { A_SET_OF(EnumType_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } senums; IA5String_t patest1; IA5String_t patest2; /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */ unsigned int _presence_map [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Ypet_t; /*** <<< FUNC-DECLS [Ypet] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Ypet; /*** <<< POST-INCLUDE [Ypet] >>> ***/ #include "Epyt.h" /*** <<< CTABLES [Ypet] >>> ***/ static int check_permitted_alphabet_6(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 65 && cv <= 90)) return -1; } return 0; } static int check_permitted_alphabet_7(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv >= 97 && cv <= 122)) return -1; } return 0; } /*** <<< CODE [Ypet] >>> ***/ static int memb_patest1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_6(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_patest2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_7(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [Ypet] >>> ***/ static int asn_DFL_3_set_7(int set_value, void **sptr) { INTEGER_t *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { /* Install default value 7 */ return asn_long2INTEGER(st, 7); } else { /* Test default value 7 */ long value; if(asn_INTEGER2long(st, &value)) return -1; return (value == 7); } } static asn_TYPE_member_t asn_MBR_senums_4[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), .tag_mode = 0, .type = &asn_DEF_EnumType, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_senums_tags_4[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_senums_specs_4 = { sizeof(struct senums), offsetof(struct senums, _asn_ctx), 1, /* XER encoding is XMLValueList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_senums_4 = { "senums", "senums", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_senums_tags_4, sizeof(asn_DEF_senums_tags_4) /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */ asn_DEF_senums_tags_4, /* Same as above */ sizeof(asn_DEF_senums_tags_4) /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_senums_4, 1, /* Single element */ &asn_SPC_senums_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Ypet_1[] = { { ATF_POINTER, 0, offsetof(struct Ypet, epyt), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Epyt, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "epyt" }, { ATF_POINTER, 1, offsetof(struct Ypet, plain), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = asn_DFL_3_set_7, /* DEFAULT 7 */ .name = "plain" }, { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums), .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_senums_4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "senums" }, { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_IA5String, .memb_constraints = memb_patest1_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "patest1" }, { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_IA5String, .memb_constraints = memb_patest2_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "patest2" }, }; static ber_tlv_tag_t asn_DEF_Ypet_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Ypet_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain at 28 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt at 27 */ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums at 29 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 at 30 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 at 31 */ }; static uint8_t asn_MAP_Ypet_mmap_1[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3) }; static asn_SET_specifics_t asn_SPC_Ypet_specs_1 = { sizeof(struct Ypet), offsetof(struct Ypet, _asn_ctx), offsetof(struct Ypet, _presence_map), asn_MAP_Ypet_tag2el_1, 5, /* Count of tags in the map */ asn_MAP_Ypet_tag2el_1, /* Same as above */ 5, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_Ypet_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_Ypet = { "Ypet", "Ypet", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Ypet_tags_1, sizeof(asn_DEF_Ypet_tags_1) /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */ asn_DEF_Ypet_tags_1, /* Same as above */ sizeof(asn_DEF_Ypet_tags_1) /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Ypet_1, 5, /* Elements count */ &asn_SPC_Ypet_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [EnumType] >>> ***/ #include /*** <<< DEPS [EnumType] >>> ***/ typedef enum EnumType { EnumType_one = 0, EnumType_two = 1 } e_EnumType; /*** <<< TYPE-DECLS [EnumType] >>> ***/ typedef ENUMERATED_t EnumType_t; /*** <<< FUNC-DECLS [EnumType] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_EnumType; asn_struct_free_f EnumType_free; asn_struct_print_f EnumType_print; asn_constr_check_f EnumType_constraint; ber_type_decoder_f EnumType_decode_ber; der_type_encoder_f EnumType_encode_der; xer_type_decoder_f EnumType_decode_xer; xer_type_encoder_f EnumType_encode_xer; /*** <<< CODE [EnumType] >>> ***/ int EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } void EnumType_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { EnumType_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { EnumType_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { EnumType_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t EnumType_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { EnumType_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { EnumType_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { EnumType_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [EnumType] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_EnumType_value2enum_1[] = { { 0, 3, "one" }, { 1, 3, "two" } }; static unsigned int asn_MAP_EnumType_enum2value_1[] = { 0, /* one(0) */ 1 /* two(1) */ }; static asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1 = { asn_MAP_EnumType_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_EnumType_enum2value_1, /* N => "tag"; sorted by N */ 2, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_EnumType_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_EnumType = { "EnumType", "EnumType", EnumType_free, EnumType_print, EnumType_constraint, EnumType_decode_ber, EnumType_encode_der, EnumType_decode_xer, EnumType_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_EnumType_tags_1, sizeof(asn_DEF_EnumType_tags_1) /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */ asn_DEF_EnumType_tags_1, /* Same as above */ sizeof(asn_DEF_EnumType_tags_1) /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_EnumType_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/23-bits-OK.asn10000644000000000000000000000077511461147103015657 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .23 ModuleTestBitString { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 23 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN v28 INTEGER ::= 28 BS1 ::= BIT STRING { first(0), third(2), twenty-eight(v28) } one-zero-one BS1 ::= { first, third } -- Equivalent to '101'B one0one BS1 ::= '1010000'B -- Equivalent to '101'B END asn1c-0.9.24+dfsg/tests/90-cond-int-type-OK.asn10000644000000000000000000000222511461147103017404 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .90 ModuleConditionalIntegerType { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 90 } DEFINITIONS ::= BEGIN CN-IntegerUnlimited ::= INTEGER CN-IntegerMinMax ::= INTEGER (MIN..MAX) CN-IntegerMinLow ::= INTEGER (MIN..1) NO-IntegerMinHigh ::= INTEGER (MIN..3000000000) NO-IntegerLowHigh ::= INTEGER (1..3000000000) CN-IntegerLowMax ::= INTEGER (1..MAX) NO-IntegerHighMax ::= INTEGER (3000000000..MAX) NO-IntegerLowestMax ::= INTEGER (-3000000000..MAX) NO-IntegerOutRange ::= INTEGER (3000000000..3000000001) NO-IntegerOutValue ::= INTEGER (3000000000) OK-IntegerInRange1 ::= INTEGER (-100..100) OK-IntegerInRange2 ::= INTEGER (-100|100) OK-IntegerInRange3 ::= INTEGER (-2147483648..2147483647) OK-IntegerInRange4 ::= INTEGER (-2147483648|2147483647) OK-IntegerInRange5 ::= INTEGER (-2147483648|2147483647,...) NO-IntegerInRange6 ::= INTEGER (0..4294967295) CN-IntegerEnumerated1 ::= INTEGER { a(1), b(2) } NO-IntegerEnumerated2 ::= INTEGER { a(1), b(3000000000) } END asn1c-0.9.24+dfsg/tests/56-components-of-SE.asn10000644000000000000000000000065311461147103017504 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .56 ModuleTestComponentsOfInvalidReference { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 56 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN OneType ::= SEQUENCE { a IA5String, COMPONENTS OF INTEGER, -- Error is here b UniversalString } END asn1c-0.9.24+dfsg/tests/70-xer-test-OK.asn10000644000000000000000000000356411461147103016472 0ustar rootroot -- OK: Everything is Fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .70 ModuleTestXERDecoding { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 70 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN /* * This module defines several types for the XER decoder testing * environment (defined elsewhere). */ PDU ::= CHOICE { sequence Sequence, set Set, sequenceOf SequenceOf, extensibleSet ExtensibleSet, extensibleSequence ExtensibleSequence, extensibleSequence2 ExtensibleSequence2, setOfNULL SetOfNULL, setOfREAL SetOfREAL, setOfEnums SetOfEnums, namedSetOfNULL NamedSetOfNULL, namedSetOfREAL NamedSetOfREAL, namedSetOfEnums NamedSetOfEnums, seqOfZuka SeqOfZuka, setOfChoice SetOfChoice, namedSetOfChoice NamedSetOfChoice, ... } Sequence ::= SEQUENCE { integer INTEGER, sequence Sequence OPTIONAL, -- backreference bits BIT STRING OPTIONAL, string UTF8String } Set ::= SET { roid RELATIVE-OID, opaque OCTET STRING OPTIONAL } ExtensibleSet ::= SET { string UTF8String OPTIONAL, ..., enum ENUMERATED { b, a } } ExtensibleSequence ::= SEQUENCE { string UTF8String OPTIONAL, ..., integer INTEGER OPTIONAL, gtime GeneralizedTime } ExtensibleSequence2 ::= SEQUENCE { string UTF8String OPTIONAL, ..., integer INTEGER OPTIONAL } SetOfNULL ::= SET OF NULL SetOfREAL ::= SET OF REAL SetOfEnums ::= SET OF ENUMERATED { one, oneMore } NamedSetOfNULL ::= SET OF y NULL NamedSetOfREAL ::= SET OF name REAL NamedSetOfEnums ::= SET OF name ENUMERATED { one, oneMore } SequenceOf ::= SEQUENCE OF id INTEGER { one(1), two(2) } SeqOfZuka ::= SEQUENCE OF zuka NULL SetOfChoice ::= SET OF SimpleChoice NamedSetOfChoice ::= SET OF whatever SimpleChoice SimpleChoice ::= CHOICE { a NULL, b INTEGER } END asn1c-0.9.24+dfsg/tests/127-per-long-OK.asn1.-Pgen-PER0000644000000000000000000003733011461230611020111 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include #include /*** <<< TYPE-DECLS [T] >>> ***/ typedef struct T { long small32range; long full32range; unsigned long unsigned32; unsigned long unsplit32; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T_t; /*** <<< FUNC-DECLS [T] >>> ***/ /* extern asn_TYPE_descriptor_t asn_DEF_unsigned32_4; // (Use -fall-defs-global to expose) */ /* extern asn_TYPE_descriptor_t asn_DEF_unsplit32_5; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_T; /*** <<< CODE [T] >>> ***/ static int unsigned32_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; /* Constraint check succeeded */ return 0; } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void unsigned32_4_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } static void unsigned32_4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { unsigned32_4_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int unsigned32_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { unsigned32_4_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t unsigned32_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { unsigned32_4_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t unsigned32_4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { unsigned32_4_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t unsigned32_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { unsigned32_4_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t unsigned32_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { unsigned32_4_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static asn_dec_rval_t unsigned32_4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { unsigned32_4_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } static asn_enc_rval_t unsigned32_4_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { unsigned32_4_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } static int unsplit32_5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if(((value >= 5 && value <= 500) || (value >= 600 && value <= 4294967290))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void unsplit32_5_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } static void unsplit32_5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { unsplit32_5_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int unsplit32_5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { unsplit32_5_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t unsplit32_5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { unsplit32_5_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t unsplit32_5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { unsplit32_5_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t unsplit32_5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { unsplit32_5_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t unsplit32_5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { unsplit32_5_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static asn_dec_rval_t unsplit32_5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { unsplit32_5_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } static asn_enc_rval_t unsplit32_5_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { unsplit32_5_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } static int memb_small32range_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= -2000000000 && value <= 2000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_full32range_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= (-2147483647L - 1) && value <= 2147483647)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_unsigned32_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; /* Constraint check succeeded */ return 0; } static int memb_unsplit32_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if(((value >= 5 && value <= 500) || (value >= 600 && value <= 4294967290))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< CTDEFS [T] >>> ***/ static asn_per_constraints_t asn_PER_type_unsigned32_constr_4 = { { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_type_unsplit32_constr_5 = { { APC_CONSTRAINED, 32, -1, 5, 4294967290 } /* (5..4294967290) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_small32range_constr_2 = { { APC_CONSTRAINED, 32, -1, -2000000000, 2000000000 } /* (-2000000000..2000000000) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_full32range_constr_3 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_unsigned32_constr_4 = { { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_unsplit32_constr_5 = { { APC_CONSTRAINED, 32, -1, 5, 4294967290 } /* (5..4294967290) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [T] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_unsigned32_specs_4 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_unsigned32_tags_4[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_unsigned32_4 = { "unsigned32", "unsigned32", unsigned32_4_free, unsigned32_4_print, unsigned32_4_constraint, unsigned32_4_decode_ber, unsigned32_4_encode_der, unsigned32_4_decode_xer, unsigned32_4_encode_xer, unsigned32_4_decode_uper, unsigned32_4_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_unsigned32_tags_4, sizeof(asn_DEF_unsigned32_tags_4) /sizeof(asn_DEF_unsigned32_tags_4[0]) - 1, /* 1 */ asn_DEF_unsigned32_tags_4, /* Same as above */ sizeof(asn_DEF_unsigned32_tags_4) /sizeof(asn_DEF_unsigned32_tags_4[0]), /* 2 */ &asn_PER_type_unsigned32_constr_4, 0, 0, /* No members */ &asn_SPC_unsigned32_specs_4 /* Additional specs */ }; static asn_INTEGER_specifics_t asn_SPC_unsplit32_specs_5 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_unsplit32_tags_5[] = { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_unsplit32_5 = { "unsplit32", "unsplit32", unsplit32_5_free, unsplit32_5_print, unsplit32_5_constraint, unsplit32_5_decode_ber, unsplit32_5_encode_der, unsplit32_5_decode_xer, unsplit32_5_encode_xer, unsplit32_5_decode_uper, unsplit32_5_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_unsplit32_tags_5, sizeof(asn_DEF_unsplit32_tags_5) /sizeof(asn_DEF_unsplit32_tags_5[0]) - 1, /* 1 */ asn_DEF_unsplit32_tags_5, /* Same as above */ sizeof(asn_DEF_unsplit32_tags_5) /sizeof(asn_DEF_unsplit32_tags_5[0]), /* 2 */ &asn_PER_type_unsplit32_constr_5, 0, 0, /* No members */ &asn_SPC_unsplit32_specs_5 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_T_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T, small32range), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NativeInteger, .memb_constraints = memb_small32range_constraint_1, .per_constraints = &asn_PER_memb_small32range_constr_2, .default_value = 0, .name = "small32range" }, { ATF_NOFLAGS, 0, offsetof(struct T, full32range), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NativeInteger, .memb_constraints = memb_full32range_constraint_1, .per_constraints = &asn_PER_memb_full32range_constr_3, .default_value = 0, .name = "full32range" }, { ATF_NOFLAGS, 0, offsetof(struct T, unsigned32), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_unsigned32_4, .memb_constraints = memb_unsigned32_constraint_1, .per_constraints = &asn_PER_memb_unsigned32_constr_4, .default_value = 0, .name = "unsigned32" }, { ATF_NOFLAGS, 0, offsetof(struct T, unsplit32), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_unsplit32_5, .memb_constraints = memb_unsplit32_constraint_1, .per_constraints = &asn_PER_memb_unsplit32_constr_5, .default_value = 0, .name = "unsplit32" }, }; static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* small32range at 15 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* full32range at 16 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* unsigned32 at 17 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* unsplit32 at 18 */ }; static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = { sizeof(struct T), offsetof(struct T, _asn_ctx), asn_MAP_T_tag2el_1, 4, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T_1, 4, /* Elements count */ &asn_SPC_T_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/129-enum-OK.asn10000644000000000000000000000051012015121740015727 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .129 ModuleTestEnum1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 129 } DEFINITIONS ::= BEGIN A ::= ENUMERATED {a(-5), b(-4), c} END asn1c-0.9.24+dfsg/tests/14-resolver-OK.asn10000644000000000000000000000304711461150505016552 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .14 1 -- .14 2 -- .14 3 ModuleTestResolver2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 14 1 } DEFINITIONS ::= BEGIN IMPORTS Enumeration, beta, gamma FROM OtherModuleRenamed { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 14 2 }; -- external references alpha Enumeration ::= beta other Enumeration ::= gamma Struct ::= SEQUENCE { member1 [1] ModuleTestResolver3.Enumeration OPTIONAL, member2 [2] OtherModuleRenamed.Enumeration DEFAULT b } -- -- The following are for post-fix checking by the check_fixer. -- It will be able to pick-up these values if the file is parseable, -- even if it contains some semantic errors. -- check-alpha INTEGER ::= 2 check-other INTEGER ::= 1 END ModuleTestResolver3 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 14 2 } DEFINITIONS ::= BEGIN EXPORTS Enumeration, beta, gamma; IMPORTS gamma, HiddenEnum FROM HiddenModule; beta HiddenEnum ::= b Enumeration ::= ENUMERATED { a(1), b(2) } -- the same type -- END HiddenModule { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 14 3 } DEFINITIONS ::= BEGIN EXPORTS HiddenEnum, gamma; IMPORTS Enumeration FROM ModuleTestResolver3; HiddenEnum ::= ENUMERATED { a(1), b(2) } gamma Enumeration ::= a END asn1c-0.9.24+dfsg/tests/93-asn1c-controls-OK.asn1.-EF0000644000000000000000000000114111461146446020136 0ustar rootrootModule-asn1c-controls { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 93 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN Sequence ::= SEQUENCE { ainl [0] IMPLICIT INTEGER, ---- aptr [1] IMPLICIT INTEGER } Set ::= SET { ainl [0] IMPLICIT Sequence, ---- aptr [1] IMPLICIT Sequence } Choice ::= CHOICE { ---- setof [0] IMPLICIT SET OF INTEGER, ---- aptr [1] IMPLICIT Sequence, ainl [2] IMPLICIT Sequence } END asn1c-0.9.24+dfsg/tests/130-enum-OK.asn1.-EF0000644000000000000000000000032312015121740016267 0ustar rootrootModuleTestEnum1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 130 } DEFINITIONS ::= BEGIN A ::= ENUMERATED { a(-5), b(-4), ..., c(0) } END asn1c-0.9.24+dfsg/tests/22-tags-OK.asn1.-EF0000644000000000000000000000053711461146446016226 0ustar rootrootModuleTestTags3 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 22 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN T1 ::= SEQUENCE { a [0] IMPLICIT INTEGER, b [1] EXPLICIT CHOICE { i [0] IMPLICIT INTEGER, n [1] IMPLICIT IA5String }, c [2] IMPLICIT UTF8String } END asn1c-0.9.24+dfsg/tests/30-set-OK.asn1.-P0000644000000000000000000000637711461146446015777 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include #include #include #include /*** <<< DEPS [T] >>> ***/ /* * Method of determining the components presence */ typedef enum T_PR { T_PR_i, /* Member i is present */ T_PR_s, /* Member s is present */ T_PR_b, /* Member b is present */ } T_PR; /*** <<< TYPE-DECLS [T] >>> ***/ typedef struct T { INTEGER_t i; IA5String_t s; /* * This type is extensible, * possible extensions are below. */ BOOLEAN_t *b; /* Presence bitmask: ASN_SET_ISPRESENT(pT, T_PR_x) */ unsigned int _presence_map [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; /*** <<< STAT-DEFS [T] >>> ***/ static asn_TYPE_member_t asn_MBR_T_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T, i), .tag = (ASN_TAG_CLASS_APPLICATION | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "i" }, { ATF_NOFLAGS, 0, offsetof(struct T, s), .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), .tag_mode = 0, .type = &asn_DEF_IA5String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "s" }, { ATF_POINTER, 1, offsetof(struct T, b), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_BOOLEAN, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 }, /* s at 16 */ { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 0, 0, 0 }, /* i at 15 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* b at 18 */ }; static uint8_t asn_MAP_T_mmap_1[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) | (1 << 6) | (0 << 5) }; static asn_SET_specifics_t asn_SPC_T_specs_1 = { sizeof(struct T), offsetof(struct T, _asn_ctx), offsetof(struct T, _presence_map), asn_MAP_T_tag2el_1, 3, /* Count of tags in the map */ asn_MAP_T_tag2el_1, /* Same as above */ 3, /* Count of tags in the CXER map */ 1, /* Whether extensible */ (unsigned int *)asn_MAP_T_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T_1, 3, /* Elements count */ &asn_SPC_T_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/114-bit-string-SE.asn10000644000000000000000000000051511461147103017047 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .114 ModuleBitStringNegativeInteger { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 114 } DEFINITIONS ::= BEGIN T ::= BIT STRING { one(-2) } END asn1c-0.9.24+dfsg/tests/62-any-OK.asn1.-EF0000644000000000000000000000133511461146446016060 0ustar rootrootModuleTestANYSyntax { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 62 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= CHOICE { s1 T1-ext, s2 T2, s3 T3, s4 T4 } T1-ext ::= SEQUENCE { i INTEGER OPTIONAL, any [1] EXPLICIT ANY, ... } T2 ::= [16] IMPLICIT SEQUENCE { m1 [0] IMPLICIT NumericString, m2 [1] IMPLICIT BOOLEAN, m3 [3] IMPLICIT SEQUENCE OF NumericString, o4 [4] IMPLICIT BOOLEAN OPTIONAL, o5 [5] IMPLICIT BOOLEAN OPTIONAL, o6 [6] IMPLICIT BOOLEAN OPTIONAL } T3 ::= SET { m1 [0] IMPLICIT NumericString, m2 [1] IMPLICIT BOOLEAN } T4 ::= [53] EXPLICIT CHOICE { m1 [1] IMPLICIT OCTET STRING } END asn1c-0.9.24+dfsg/tests/130-enum-OK.asn10000644000000000000000000000051412015121740015723 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .130 ModuleTestEnum1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 130 } DEFINITIONS ::= BEGIN A ::= ENUMERATED {a(-5), b(-4),..., c} END asn1c-0.9.24+dfsg/tests/74-int-enum-constraints-OK.asn1.-EFprint-constraints0000644000000000000000000000153711461146446025023 0ustar rootrootModuleTestIntegerAndEnumeratedConstraints { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 74 } DEFINITIONS ::= BEGIN Enum ::= ENUMERATED { one(0) -- Practical constraints (one): -- PER-visible constraints (one): , two(1) -- Practical constraints (two): -- PER-visible constraints (two): } (1 | 0) -- Combined constraints: (1 | 0) -- Practical constraints (Enum): (0..1) -- PER-visible constraints (Enum): (0..1) Int ::= INTEGER { v1-0(123) -- Practical constraints (v1-0): -- PER-visible constraints (v1-0): } (123) -- Combined constraints: (123) -- Practical constraints (Int): (123) -- PER-visible constraints (Int): (123) EnumRef ::= Enum (1) -- Combined constraints: (1 | 0)(1) -- Practical constraints (Enum): (1) -- PER-visible constraints (Enum): (1) END asn1c-0.9.24+dfsg/tests/69-reserved-words-OK.asn10000644000000000000000000000061711461147103017676 0ustar rootroot -- OK: Everything is Fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .69 ModuleTestReservedWords { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 69 } DEFINITIONS ::= BEGIN T ::= SEQUENCE { int INTEGER, char OCTET STRING (SIZE(1)), class SET { ... }, double REAL } END asn1c-0.9.24+dfsg/tests/98-attribute-class-OK.asn10000644000000000000000000000127011461147103020027 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .98 ModuleAttributeClass { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 98 } DEFINITIONS ::= BEGIN ATTRIBUTE ::= CLASS { &id RELATIVE-OID UNIQUE } WITH SYNTAX { ID &id } Attribute ::= SEQUENCE { identifier ATTRIBUTE.&id ({Attributes}), siAttributeValue IA5String } Attributes ATTRIBUTE ::= { Names } Names ATTRIBUTE ::= { rafService | rcfService } rafService ATTRIBUTE ::= { ID raf } rcfService ATTRIBUTE ::= { ID rcf } raf RELATIVE-OID ::= {3 2 1} rcf RELATIVE-OID ::= {3 2 2} END asn1c-0.9.24+dfsg/tests/19-param-OK.asn1.-EF0000644000000000000000000000107711461146446016376 0ustar rootrootModuleTestParam { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 19 } DEFINITIONS ::= BEGIN SIGNED{ToBeSigned} ::= SEQUENCE { toBeSigned ToBeSigned, algorithm OBJECT IDENTIFIER, signature BIT STRING SIZE(0..256) } Certificate ::= SIGNED{ SEQUENCE { version INTEGER, signature OBJECT IDENTIFIER, issuer Name }} Name ::= SEQUENCE OF RelativeDistinguishedName RelativeDistinguishedName ::= SET SIZE(1..MAX) OF IA5String (FROM("A".."Z" | "a".."z" | "0-9" | ",-.")) END asn1c-0.9.24+dfsg/tests/22-tags-OK.asn10000644000000000000000000000062411461147103015644 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .22 ModuleTestTags3 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 22 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN T1 ::= SEQUENCE { a INTEGER, b CHOICE { i INTEGER, n IA5String }, c UTF8String } END asn1c-0.9.24+dfsg/tests/108-param-constr-3-OK.asn10000644000000000000000000000063311461147103017541 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .108 ModuleParameterizationWithConstraints3 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 108 } DEFINITIONS ::= BEGIN MinMax {Type, INTEGER:low-bound} ::= Type (low-bound..MAX) ThreePlus ::= MinMax {INTEGER, 3} END asn1c-0.9.24+dfsg/tests/59-choice-extended-OK.asn10000644000000000000000000000063711461147103017754 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .59 ModuleTestExtensibleChoice { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 59 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN Choice ::= [123] CHOICE { a INTEGER, ..., b INTEGER, c Choice -- A reference to itself } END asn1c-0.9.24+dfsg/tests/72-same-names-OK.asn10000644000000000000000000000161111461147103016736 0ustar rootroot -- OK: Everything is Fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .72 ModuleTestSameNames { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 72 } DEFINITIONS ::= BEGIN /* * This test checks whether different top-level types containing * similarly named inner types may be compiled by the target language * compiler successfully. This was not the case before asn1c-0.9.11. */ Type ::= SET OF SEQUENCE { t1 Type1, t2 Type2 } Type1 ::= SEQUENCE { one-name CHOICE { another-name SEQUENCE { a INTEGER, b INTEGER } } } Type2 ::= CHOICE { one-name SEQUENCE { another-name SEQUENCE { a BIT STRING { one(0) } SIZE(2), b INTEGER } }, two-name SET { another-name SEQUENCE { a BIT STRING { one(0) } SIZE(2), b INTEGER } } } END asn1c-0.9.24+dfsg/tests/76-duplicate-modules-SW.asn10000644000000000000000000000074011461146446020367 0ustar rootroot -- SW: Semantically suspicious -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .76 1 -- .76 2 ModuleDuplicateModuleName { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 76 1 } DEFINITIONS ::= BEGIN END ModuleDuplicateModuleName { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 76 2 } DEFINITIONS ::= BEGIN END asn1c-0.9.24+dfsg/tests/84-param-tags-OK.asn1.-P0000644000000000000000000003633111461146446017242 0ustar rootroot /*** <<< INCLUDES [TestType] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [TestType] >>> ***/ typedef struct TestType_16P0 { long common /* DEFAULT 0 */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } TestType_16P0_t; typedef struct TestType_16P1 { BOOLEAN_t common /* DEFAULT 0 */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } TestType_16P1_t; /*** <<< FUNC-DECLS [TestType] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_TestType_16P0; extern asn_TYPE_descriptor_t asn_DEF_TestType_16P1; /*** <<< CODE [TestType] >>> ***/ static int memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= 1 && value <= 10)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [TestType] >>> ***/ static int asn_DFL_2_set_0(int set_value, void **sptr) { long *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { /* Install default value 0 */ *st = 0; return 0; } else { /* Test default value 0 */ return (*st == 0); } } static asn_TYPE_member_t asn_MBR_TestType_16P0_1[] = { { ATF_NOFLAGS, 1, offsetof(struct TestType_16P0, common), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_NativeInteger, .memb_constraints = memb_common_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = asn_DFL_2_set_0, /* DEFAULT 0 */ .name = "common" }, }; static ber_tlv_tag_t asn_DEF_TestType_16P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_TestType_16P0_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* common at 20 */ }; static asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1 = { sizeof(struct TestType_16P0), offsetof(struct TestType_16P0, _asn_ctx), asn_MAP_TestType_16P0_tag2el_1, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_TestType_16P0 = { "TestType", "TestType", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TestType_16P0_tags_1, sizeof(asn_DEF_TestType_16P0_tags_1) /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */ asn_DEF_TestType_16P0_tags_1, /* Same as above */ sizeof(asn_DEF_TestType_16P0_tags_1) /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_TestType_16P0_1, 1, /* Elements count */ &asn_SPC_TestType_16P0_specs_1 /* Additional specs */ }; static int asn_DFL_4_set_0(int set_value, void **sptr) { BOOLEAN_t *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { /* Install default value 0 */ *st = 0; return 0; } else { /* Test default value 0 */ return (*st == 0); } } static asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = { { ATF_NOFLAGS, 1, offsetof(struct TestType_16P1, common), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = asn_DFL_4_set_0, /* DEFAULT 0 */ .name = "common" }, }; static ber_tlv_tag_t asn_DEF_TestType_16P1_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_TestType_16P1_tag2el_3[] = { { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 } /* common at 21 */ }; static asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3 = { sizeof(struct TestType_16P1), offsetof(struct TestType_16P1, _asn_ctx), asn_MAP_TestType_16P1_tag2el_3, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_TestType_16P1 = { "TestType", "TestType", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_TestType_16P1_tags_3, sizeof(asn_DEF_TestType_16P1_tags_3) /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */ asn_DEF_TestType_16P1_tags_3, /* Same as above */ sizeof(asn_DEF_TestType_16P1_tags_3) /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_TestType_16P1_3, 1, /* Elements count */ &asn_SPC_TestType_16P1_specs_3 /* Additional specs */ }; /*** <<< INCLUDES [TestChoice] >>> ***/ #include "TestType.h" #include /*** <<< DEPS [TestChoice] >>> ***/ typedef enum TestChoice_PR { TestChoice_PR_NOTHING, /* No components present */ TestChoice_PR_type1, TestChoice_PR_type2 } TestChoice_PR; /*** <<< TYPE-DECLS [TestChoice] >>> ***/ typedef struct TestChoice { TestChoice_PR present; union TestChoice_u { TestType_16P0_t type1; TestType_16P1_t type2; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } TestChoice_t; /*** <<< FUNC-DECLS [TestChoice] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_TestChoice; /*** <<< STAT-DEFS [TestChoice] >>> ***/ static asn_TYPE_member_t asn_MBR_TestChoice_1[] = { { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type1), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_TestType_16P0, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "type1" }, { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type2), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_TestType_16P1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "type2" }, }; static asn_TYPE_tag2member_t asn_MAP_TestChoice_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 at 20 */ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 at 21 */ }; static asn_CHOICE_specifics_t asn_SPC_TestChoice_specs_1 = { sizeof(struct TestChoice), offsetof(struct TestChoice, _asn_ctx), offsetof(struct TestChoice, present), sizeof(((struct TestChoice *)0)->present), asn_MAP_TestChoice_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_TestChoice = { "TestChoice", "TestChoice", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_TestChoice_1, 2, /* Elements count */ &asn_SPC_TestChoice_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [AutoType] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [AutoType] >>> ***/ typedef struct AutoType_34P0 { long common; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } AutoType_34P0_t; typedef struct AutoType_34P1 { BOOLEAN_t common; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } AutoType_34P1_t; /*** <<< FUNC-DECLS [AutoType] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P0; extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P1; /*** <<< CODE [AutoType] >>> ***/ static int memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value == 0)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_common_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { BOOLEAN_t value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = (*(const long *)sptr) ? 1 : 0; if((value <= 0)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [AutoType] >>> ***/ static asn_TYPE_member_t asn_MBR_AutoType_34P0_1[] = { { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P0, common), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NativeInteger, .memb_constraints = memb_common_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "common" }, }; static ber_tlv_tag_t asn_DEF_AutoType_34P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AutoType_34P0_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common at 37 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1 = { sizeof(struct AutoType_34P0), offsetof(struct AutoType_34P0, _asn_ctx), asn_MAP_AutoType_34P0_tag2el_1, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_AutoType_34P0 = { "AutoType", "AutoType", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_AutoType_34P0_tags_1, sizeof(asn_DEF_AutoType_34P0_tags_1) /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */ asn_DEF_AutoType_34P0_tags_1, /* Same as above */ sizeof(asn_DEF_AutoType_34P0_tags_1) /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_AutoType_34P0_1, 1, /* Elements count */ &asn_SPC_AutoType_34P0_specs_1 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_AutoType_34P1_3[] = { { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P1, common), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_BOOLEAN, .memb_constraints = memb_common_constraint_3, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "common" }, }; static ber_tlv_tag_t asn_DEF_AutoType_34P1_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AutoType_34P1_tag2el_3[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common at 38 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3 = { sizeof(struct AutoType_34P1), offsetof(struct AutoType_34P1, _asn_ctx), asn_MAP_AutoType_34P1_tag2el_3, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_AutoType_34P1 = { "AutoType", "AutoType", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_AutoType_34P1_tags_3, sizeof(asn_DEF_AutoType_34P1_tags_3) /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */ asn_DEF_AutoType_34P1_tags_3, /* Same as above */ sizeof(asn_DEF_AutoType_34P1_tags_3) /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_AutoType_34P1_3, 1, /* Elements count */ &asn_SPC_AutoType_34P1_specs_3 /* Additional specs */ }; /*** <<< INCLUDES [AutoChoice] >>> ***/ #include "AutoType.h" #include /*** <<< DEPS [AutoChoice] >>> ***/ typedef enum AutoChoice_PR { AutoChoice_PR_NOTHING, /* No components present */ AutoChoice_PR_type1, AutoChoice_PR_type2 } AutoChoice_PR; /*** <<< TYPE-DECLS [AutoChoice] >>> ***/ typedef struct AutoChoice { AutoChoice_PR present; union AutoChoice_u { AutoType_34P0_t type1; AutoType_34P1_t type2; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } AutoChoice_t; /*** <<< FUNC-DECLS [AutoChoice] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_AutoChoice; /*** <<< STAT-DEFS [AutoChoice] >>> ***/ static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = { { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type1), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_AutoType_34P0, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "type1" }, { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type2), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_AutoType_34P1, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "type2" }, }; static asn_TYPE_tag2member_t asn_MAP_AutoChoice_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 at 37 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 at 38 */ }; static asn_CHOICE_specifics_t asn_SPC_AutoChoice_specs_1 = { sizeof(struct AutoChoice), offsetof(struct AutoChoice, _asn_ctx), offsetof(struct AutoChoice, present), sizeof(((struct AutoChoice *)0)->present), asn_MAP_AutoChoice_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_AutoChoice = { "AutoChoice", "AutoChoice", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_AutoChoice_1, 2, /* Elements count */ &asn_SPC_AutoChoice_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/16-constraint-OK.asn1.-EFprint-constraints0000644000000000000000000000436111461146446023100 0ustar rootrootModuleTestConstraint1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 16 1 } DEFINITIONS ::= BEGIN Type0 ::= IA5String (((SIZE(1..10))(FROM("a".."z" | "#")))) -- Combined constraints: (((SIZE(1..10))(FROM("a".."z" | "#")))) -- Practical constraints (Type0): (MIN..MAX) (SIZE(1..10)) (FROM("#" | "a".."z")) -- PER-visible constraints (Type0): (MIN..MAX) (SIZE(1..10)) (FROM("#" | "a".."z")) Type6 ::= IA5String ((SIZE(1..10))(FROM("a".."z" | "#"))) -- Combined constraints: ((SIZE(1..10))(FROM("a".."z" | "#"))) -- Practical constraints (Type6): (MIN..MAX) (SIZE(1..10)) (FROM("#" | "a".."z")) -- PER-visible constraints (Type6): (MIN..MAX) (SIZE(1..10)) (FROM("#" | "a".."z")) END ModuleTestConstraint2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 16 2 } DEFINITIONS ::= BEGIN Type1 ::= IA5String (SIZE(1..10,...))(FROM("a".."z" | "#",...)) -- Combined constraints: (SIZE(1..10))(FROM("a".."z" | "#",...)) -- Practical constraints (Type1): (MIN..MAX) (SIZE(1..10)) (FROM("#" | "a".."z",...)) -- PER-visible constraints (Type1): (MIN..MAX) (SIZE(1..10)) (FROM("".."")) Type2 ::= IA5String (SIZE(MIN..4) | FROM("abc")) -- Combined constraints: (SIZE(MIN..4) | FROM("abc")) -- Practical constraints (Type2): (MIN..MAX) (SIZE(0..MAX)) (FROM("".."")) -- PER-visible constraints (Type2): (MIN..MAX) (SIZE(0..MAX)) (FROM("".."")) Type3 ::= BMPString (SIZE(1)) -- Combined constraints: (SIZE(1)) -- Practical constraints (Type3): (MIN..MAX) (SIZE(1)) (FROM("".."ý")) -- PER-visible constraints (Type3): (MIN..MAX) (SIZE(1)) (FROM("".."ý")) Type4 ::= INTEGER (1..MAX) -- Combined constraints: (1..MAX) -- Practical constraints (Type4): (1..MAX) -- PER-visible constraints (Type4): (1..MAX) Type5 ::= BOOLEAN (TRUE | FALSE) -- Combined constraints: (TRUE | FALSE) -- Practical constraints (Type5): (0..1) -- PER-visible constraints (Type5): (0..1) ten INTEGER ::= 10 -- Practical constraints (ten): (MIN..MAX) -- PER-visible constraints (ten): (MIN..MAX) v1 Type1 ::= "#value with ""double quotes""" -- Practical constraints (Type1): (MIN..MAX) (SIZE(0..MAX)) (FROM("".."")) -- PER-visible constraints (Type1): (MIN..MAX) (SIZE(0..MAX)) (FROM("".."")) END asn1c-0.9.24+dfsg/tests/52-constraint-SE.asn10000644000000000000000000000052211461147103017070 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .52 ModuleInvalidConstraintApplicability1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 52 } DEFINITIONS ::= BEGIN Int ::= INTEGER (SIZE(0..4)) END asn1c-0.9.24+dfsg/tests/90-cond-int-type-OK.asn1.-Pgen-PER0000644000000000000000000031012711461230611020775 0ustar rootroot /*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/ typedef INTEGER_t CN_IntegerUnlimited_t; /*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited; asn_struct_free_f CN_IntegerUnlimited_free; asn_struct_print_f CN_IntegerUnlimited_print; asn_constr_check_f CN_IntegerUnlimited_constraint; ber_type_decoder_f CN_IntegerUnlimited_decode_ber; der_type_encoder_f CN_IntegerUnlimited_encode_der; xer_type_decoder_f CN_IntegerUnlimited_decode_xer; xer_type_encoder_f CN_IntegerUnlimited_encode_xer; per_type_decoder_f CN_IntegerUnlimited_decode_uper; per_type_encoder_f CN_IntegerUnlimited_encode_uper; /*** <<< CODE [CN-IntegerUnlimited] >>> ***/ int CN_IntegerUnlimited_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerUnlimited_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CN_IntegerUnlimited_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerUnlimited_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerUnlimited_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerUnlimited_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerUnlimited_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerUnlimited_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t CN_IntegerUnlimited_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t CN_IntegerUnlimited_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< STAT-DEFS [CN-IntegerUnlimited] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerUnlimited_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = { "CN-IntegerUnlimited", "CN-IntegerUnlimited", CN_IntegerUnlimited_free, CN_IntegerUnlimited_print, CN_IntegerUnlimited_constraint, CN_IntegerUnlimited_decode_ber, CN_IntegerUnlimited_encode_der, CN_IntegerUnlimited_decode_xer, CN_IntegerUnlimited_encode_xer, CN_IntegerUnlimited_decode_uper, CN_IntegerUnlimited_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerUnlimited_tags_1, sizeof(asn_DEF_CN_IntegerUnlimited_tags_1) /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerUnlimited_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerUnlimited_tags_1) /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/ typedef INTEGER_t CN_IntegerMinMax_t; /*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax; asn_struct_free_f CN_IntegerMinMax_free; asn_struct_print_f CN_IntegerMinMax_print; asn_constr_check_f CN_IntegerMinMax_constraint; ber_type_decoder_f CN_IntegerMinMax_decode_ber; der_type_encoder_f CN_IntegerMinMax_encode_der; xer_type_decoder_f CN_IntegerMinMax_decode_xer; xer_type_encoder_f CN_IntegerMinMax_encode_xer; per_type_decoder_f CN_IntegerMinMax_decode_uper; per_type_encoder_f CN_IntegerMinMax_encode_uper; /*** <<< CODE [CN-IntegerMinMax] >>> ***/ int CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CN_IntegerMinMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerMinMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerMinMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerMinMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerMinMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerMinMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t CN_IntegerMinMax_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t CN_IntegerMinMax_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [CN-IntegerMinMax] >>> ***/ static asn_per_constraints_t asn_PER_type_CN_IntegerMinMax_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [CN-IntegerMinMax] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerMinMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = { "CN-IntegerMinMax", "CN-IntegerMinMax", CN_IntegerMinMax_free, CN_IntegerMinMax_print, CN_IntegerMinMax_constraint, CN_IntegerMinMax_decode_ber, CN_IntegerMinMax_encode_der, CN_IntegerMinMax_decode_xer, CN_IntegerMinMax_encode_xer, CN_IntegerMinMax_decode_uper, CN_IntegerMinMax_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerMinMax_tags_1, sizeof(asn_DEF_CN_IntegerMinMax_tags_1) /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerMinMax_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerMinMax_tags_1) /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */ &asn_PER_type_CN_IntegerMinMax_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/ typedef INTEGER_t CN_IntegerMinLow_t; /*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow; asn_struct_free_f CN_IntegerMinLow_free; asn_struct_print_f CN_IntegerMinLow_print; asn_constr_check_f CN_IntegerMinLow_constraint; ber_type_decoder_f CN_IntegerMinLow_decode_ber; der_type_encoder_f CN_IntegerMinLow_encode_der; xer_type_decoder_f CN_IntegerMinLow_decode_xer; xer_type_encoder_f CN_IntegerMinLow_encode_xer; per_type_decoder_f CN_IntegerMinLow_decode_uper; per_type_encoder_f CN_IntegerMinLow_encode_uper; /*** <<< CODE [CN-IntegerMinLow] >>> ***/ int CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value <= 1)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinLow_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CN_IntegerMinLow_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerMinLow_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerMinLow_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerMinLow_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerMinLow_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerMinLow_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t CN_IntegerMinLow_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t CN_IntegerMinLow_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [CN-IntegerMinLow] >>> ***/ static asn_per_constraints_t asn_PER_type_CN_IntegerMinLow_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 } /* (MIN..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [CN-IntegerMinLow] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerMinLow_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow = { "CN-IntegerMinLow", "CN-IntegerMinLow", CN_IntegerMinLow_free, CN_IntegerMinLow_print, CN_IntegerMinLow_constraint, CN_IntegerMinLow_decode_ber, CN_IntegerMinLow_encode_der, CN_IntegerMinLow_decode_xer, CN_IntegerMinLow_encode_xer, CN_IntegerMinLow_decode_uper, CN_IntegerMinLow_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerMinLow_tags_1, sizeof(asn_DEF_CN_IntegerMinLow_tags_1) /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerMinLow_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerMinLow_tags_1) /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */ &asn_PER_type_CN_IntegerMinLow_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerMinHigh] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerMinHigh] >>> ***/ typedef INTEGER_t NO_IntegerMinHigh_t; /*** <<< FUNC-DECLS [NO-IntegerMinHigh] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh; asn_struct_free_f NO_IntegerMinHigh_free; asn_struct_print_f NO_IntegerMinHigh_print; asn_constr_check_f NO_IntegerMinHigh_constraint; ber_type_decoder_f NO_IntegerMinHigh_decode_ber; der_type_encoder_f NO_IntegerMinHigh_encode_der; xer_type_decoder_f NO_IntegerMinHigh_decode_xer; xer_type_encoder_f NO_IntegerMinHigh_encode_xer; per_type_decoder_f NO_IntegerMinHigh_decode_uper; per_type_encoder_f NO_IntegerMinHigh_encode_uper; /*** <<< CODE [NO-IntegerMinHigh] >>> ***/ int NO_IntegerMinHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value <= 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerMinHigh_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerMinHigh_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerMinHigh_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerMinHigh_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerMinHigh_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerMinHigh_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerMinHigh_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t NO_IntegerMinHigh_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t NO_IntegerMinHigh_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [NO-IntegerMinHigh] >>> ***/ static asn_per_constraints_t asn_PER_type_NO_IntegerMinHigh_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 } /* (MIN..3000000000) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [NO-IntegerMinHigh] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerMinHigh_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh = { "NO-IntegerMinHigh", "NO-IntegerMinHigh", NO_IntegerMinHigh_free, NO_IntegerMinHigh_print, NO_IntegerMinHigh_constraint, NO_IntegerMinHigh_decode_ber, NO_IntegerMinHigh_encode_der, NO_IntegerMinHigh_decode_xer, NO_IntegerMinHigh_encode_xer, NO_IntegerMinHigh_decode_uper, NO_IntegerMinHigh_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerMinHigh_tags_1, sizeof(asn_DEF_NO_IntegerMinHigh_tags_1) /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerMinHigh_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerMinHigh_tags_1) /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */ &asn_PER_type_NO_IntegerMinHigh_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerLowHigh] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerLowHigh] >>> ***/ typedef unsigned long NO_IntegerLowHigh_t; /*** <<< FUNC-DECLS [NO-IntegerLowHigh] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh; asn_struct_free_f NO_IntegerLowHigh_free; asn_struct_print_f NO_IntegerLowHigh_print; asn_constr_check_f NO_IntegerLowHigh_constraint; ber_type_decoder_f NO_IntegerLowHigh_decode_ber; der_type_encoder_f NO_IntegerLowHigh_encode_der; xer_type_decoder_f NO_IntegerLowHigh_decode_xer; xer_type_encoder_f NO_IntegerLowHigh_encode_xer; per_type_decoder_f NO_IntegerLowHigh_decode_uper; per_type_encoder_f NO_IntegerLowHigh_encode_uper; /*** <<< CODE [NO-IntegerLowHigh] >>> ***/ int NO_IntegerLowHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if((value >= 1 && value <= 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerLowHigh_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerLowHigh_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerLowHigh_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerLowHigh_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerLowHigh_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerLowHigh_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerLowHigh_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t NO_IntegerLowHigh_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t NO_IntegerLowHigh_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [NO-IntegerLowHigh] >>> ***/ static asn_per_constraints_t asn_PER_type_NO_IntegerLowHigh_constr_1 = { { APC_CONSTRAINED, 32, -1, 1, 3000000000 } /* (1..3000000000) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [NO-IntegerLowHigh] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerLowHigh_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerLowHigh_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = { "NO-IntegerLowHigh", "NO-IntegerLowHigh", NO_IntegerLowHigh_free, NO_IntegerLowHigh_print, NO_IntegerLowHigh_constraint, NO_IntegerLowHigh_decode_ber, NO_IntegerLowHigh_encode_der, NO_IntegerLowHigh_decode_xer, NO_IntegerLowHigh_encode_xer, NO_IntegerLowHigh_decode_uper, NO_IntegerLowHigh_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerLowHigh_tags_1, sizeof(asn_DEF_NO_IntegerLowHigh_tags_1) /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerLowHigh_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerLowHigh_tags_1) /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */ &asn_PER_type_NO_IntegerLowHigh_constr_1, 0, 0, /* No members */ &asn_SPC_NO_IntegerLowHigh_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/ typedef INTEGER_t CN_IntegerLowMax_t; /*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax; asn_struct_free_f CN_IntegerLowMax_free; asn_struct_print_f CN_IntegerLowMax_print; asn_constr_check_f CN_IntegerLowMax_constraint; ber_type_decoder_f CN_IntegerLowMax_decode_ber; der_type_encoder_f CN_IntegerLowMax_encode_der; xer_type_decoder_f CN_IntegerLowMax_decode_xer; xer_type_encoder_f CN_IntegerLowMax_encode_xer; per_type_decoder_f CN_IntegerLowMax_decode_uper; per_type_encoder_f CN_IntegerLowMax_encode_uper; /*** <<< CODE [CN-IntegerLowMax] >>> ***/ int CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 1)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerLowMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CN_IntegerLowMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerLowMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerLowMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerLowMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerLowMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerLowMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t CN_IntegerLowMax_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t CN_IntegerLowMax_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [CN-IntegerLowMax] >>> ***/ static asn_per_constraints_t asn_PER_type_CN_IntegerLowMax_constr_1 = { { APC_SEMI_CONSTRAINED, -1, -1, 1, 0 } /* (1..MAX) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [CN-IntegerLowMax] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerLowMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax = { "CN-IntegerLowMax", "CN-IntegerLowMax", CN_IntegerLowMax_free, CN_IntegerLowMax_print, CN_IntegerLowMax_constraint, CN_IntegerLowMax_decode_ber, CN_IntegerLowMax_encode_der, CN_IntegerLowMax_decode_xer, CN_IntegerLowMax_encode_xer, CN_IntegerLowMax_decode_uper, CN_IntegerLowMax_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerLowMax_tags_1, sizeof(asn_DEF_CN_IntegerLowMax_tags_1) /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerLowMax_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerLowMax_tags_1) /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */ &asn_PER_type_CN_IntegerLowMax_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerHighMax] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerHighMax] >>> ***/ typedef INTEGER_t NO_IntegerHighMax_t; /*** <<< FUNC-DECLS [NO-IntegerHighMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax; asn_struct_free_f NO_IntegerHighMax_free; asn_struct_print_f NO_IntegerHighMax_print; asn_constr_check_f NO_IntegerHighMax_constraint; ber_type_decoder_f NO_IntegerHighMax_decode_ber; der_type_encoder_f NO_IntegerHighMax_encode_der; xer_type_decoder_f NO_IntegerHighMax_decode_xer; xer_type_encoder_f NO_IntegerHighMax_encode_xer; per_type_decoder_f NO_IntegerHighMax_decode_uper; per_type_encoder_f NO_IntegerHighMax_encode_uper; /*** <<< CODE [NO-IntegerHighMax] >>> ***/ int NO_IntegerHighMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerHighMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerHighMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerHighMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerHighMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerHighMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerHighMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerHighMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t NO_IntegerHighMax_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t NO_IntegerHighMax_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [NO-IntegerHighMax] >>> ***/ static asn_per_constraints_t asn_PER_type_NO_IntegerHighMax_constr_1 = { { APC_SEMI_CONSTRAINED, -1, -1, 3000000000, 0 } /* (3000000000..MAX) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [NO-IntegerHighMax] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerHighMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax = { "NO-IntegerHighMax", "NO-IntegerHighMax", NO_IntegerHighMax_free, NO_IntegerHighMax_print, NO_IntegerHighMax_constraint, NO_IntegerHighMax_decode_ber, NO_IntegerHighMax_encode_der, NO_IntegerHighMax_decode_xer, NO_IntegerHighMax_encode_xer, NO_IntegerHighMax_decode_uper, NO_IntegerHighMax_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerHighMax_tags_1, sizeof(asn_DEF_NO_IntegerHighMax_tags_1) /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerHighMax_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerHighMax_tags_1) /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */ &asn_PER_type_NO_IntegerHighMax_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerLowestMax] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerLowestMax] >>> ***/ typedef INTEGER_t NO_IntegerLowestMax_t; /*** <<< FUNC-DECLS [NO-IntegerLowestMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax; asn_struct_free_f NO_IntegerLowestMax_free; asn_struct_print_f NO_IntegerLowestMax_print; asn_constr_check_f NO_IntegerLowestMax_constraint; ber_type_decoder_f NO_IntegerLowestMax_decode_ber; der_type_encoder_f NO_IntegerLowestMax_encode_der; xer_type_decoder_f NO_IntegerLowestMax_decode_xer; xer_type_encoder_f NO_IntegerLowestMax_encode_xer; per_type_decoder_f NO_IntegerLowestMax_decode_uper; per_type_encoder_f NO_IntegerLowestMax_encode_uper; /*** <<< CODE [NO-IntegerLowestMax] >>> ***/ int NO_IntegerLowestMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= -3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerLowestMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerLowestMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerLowestMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerLowestMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerLowestMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerLowestMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerLowestMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t NO_IntegerLowestMax_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t NO_IntegerLowestMax_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [NO-IntegerLowestMax] >>> ***/ static asn_per_constraints_t asn_PER_type_NO_IntegerLowestMax_constr_1 = { { APC_SEMI_CONSTRAINED, -1, -1, -3000000000, 0 } /* (-3000000000..MAX) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [NO-IntegerLowestMax] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerLowestMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax = { "NO-IntegerLowestMax", "NO-IntegerLowestMax", NO_IntegerLowestMax_free, NO_IntegerLowestMax_print, NO_IntegerLowestMax_constraint, NO_IntegerLowestMax_decode_ber, NO_IntegerLowestMax_encode_der, NO_IntegerLowestMax_decode_xer, NO_IntegerLowestMax_encode_xer, NO_IntegerLowestMax_decode_uper, NO_IntegerLowestMax_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerLowestMax_tags_1, sizeof(asn_DEF_NO_IntegerLowestMax_tags_1) /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerLowestMax_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerLowestMax_tags_1) /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */ &asn_PER_type_NO_IntegerLowestMax_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerOutRange] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerOutRange] >>> ***/ typedef unsigned long NO_IntegerOutRange_t; /*** <<< FUNC-DECLS [NO-IntegerOutRange] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange; asn_struct_free_f NO_IntegerOutRange_free; asn_struct_print_f NO_IntegerOutRange_print; asn_constr_check_f NO_IntegerOutRange_constraint; ber_type_decoder_f NO_IntegerOutRange_decode_ber; der_type_encoder_f NO_IntegerOutRange_encode_der; xer_type_decoder_f NO_IntegerOutRange_decode_xer; xer_type_encoder_f NO_IntegerOutRange_encode_xer; per_type_decoder_f NO_IntegerOutRange_decode_uper; per_type_encoder_f NO_IntegerOutRange_encode_uper; /*** <<< CODE [NO-IntegerOutRange] >>> ***/ int NO_IntegerOutRange_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if((value >= 3000000000 && value <= 3000000001)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerOutRange_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerOutRange_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerOutRange_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerOutRange_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerOutRange_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerOutRange_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerOutRange_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t NO_IntegerOutRange_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t NO_IntegerOutRange_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [NO-IntegerOutRange] >>> ***/ static asn_per_constraints_t asn_PER_type_NO_IntegerOutRange_constr_1 = { { APC_CONSTRAINED, 1, -1, 3000000000, 3000000001 } /* (3000000000..3000000001) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [NO-IntegerOutRange] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutRange_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerOutRange_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange = { "NO-IntegerOutRange", "NO-IntegerOutRange", NO_IntegerOutRange_free, NO_IntegerOutRange_print, NO_IntegerOutRange_constraint, NO_IntegerOutRange_decode_ber, NO_IntegerOutRange_encode_der, NO_IntegerOutRange_decode_xer, NO_IntegerOutRange_encode_xer, NO_IntegerOutRange_decode_uper, NO_IntegerOutRange_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerOutRange_tags_1, sizeof(asn_DEF_NO_IntegerOutRange_tags_1) /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerOutRange_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerOutRange_tags_1) /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */ &asn_PER_type_NO_IntegerOutRange_constr_1, 0, 0, /* No members */ &asn_SPC_NO_IntegerOutRange_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [NO-IntegerOutValue] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerOutValue] >>> ***/ typedef unsigned long NO_IntegerOutValue_t; /*** <<< FUNC-DECLS [NO-IntegerOutValue] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue; asn_struct_free_f NO_IntegerOutValue_free; asn_struct_print_f NO_IntegerOutValue_print; asn_constr_check_f NO_IntegerOutValue_constraint; ber_type_decoder_f NO_IntegerOutValue_decode_ber; der_type_encoder_f NO_IntegerOutValue_encode_der; xer_type_decoder_f NO_IntegerOutValue_decode_xer; xer_type_encoder_f NO_IntegerOutValue_encode_xer; per_type_decoder_f NO_IntegerOutValue_decode_uper; per_type_encoder_f NO_IntegerOutValue_encode_uper; /*** <<< CODE [NO-IntegerOutValue] >>> ***/ int NO_IntegerOutValue_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if((value == 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerOutValue_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerOutValue_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerOutValue_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerOutValue_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerOutValue_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerOutValue_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerOutValue_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t NO_IntegerOutValue_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t NO_IntegerOutValue_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [NO-IntegerOutValue] >>> ***/ static asn_per_constraints_t asn_PER_type_NO_IntegerOutValue_constr_1 = { { APC_CONSTRAINED, 0, -1, 3000000000, 3000000000 } /* (3000000000..3000000000) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [NO-IntegerOutValue] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutValue_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerOutValue_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue = { "NO-IntegerOutValue", "NO-IntegerOutValue", NO_IntegerOutValue_free, NO_IntegerOutValue_print, NO_IntegerOutValue_constraint, NO_IntegerOutValue_decode_ber, NO_IntegerOutValue_encode_der, NO_IntegerOutValue_decode_xer, NO_IntegerOutValue_encode_xer, NO_IntegerOutValue_decode_uper, NO_IntegerOutValue_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerOutValue_tags_1, sizeof(asn_DEF_NO_IntegerOutValue_tags_1) /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerOutValue_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerOutValue_tags_1) /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */ &asn_PER_type_NO_IntegerOutValue_constr_1, 0, 0, /* No members */ &asn_SPC_NO_IntegerOutValue_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [OK-IntegerInRange1] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange1] >>> ***/ typedef long OK_IntegerInRange1_t; /*** <<< FUNC-DECLS [OK-IntegerInRange1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1; asn_struct_free_f OK_IntegerInRange1_free; asn_struct_print_f OK_IntegerInRange1_print; asn_constr_check_f OK_IntegerInRange1_constraint; ber_type_decoder_f OK_IntegerInRange1_decode_ber; der_type_encoder_f OK_IntegerInRange1_encode_der; xer_type_decoder_f OK_IntegerInRange1_decode_xer; xer_type_encoder_f OK_IntegerInRange1_encode_xer; per_type_decoder_f OK_IntegerInRange1_decode_uper; per_type_encoder_f OK_IntegerInRange1_encode_uper; /*** <<< CODE [OK-IntegerInRange1] >>> ***/ int OK_IntegerInRange1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= -100 && value <= 100)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t OK_IntegerInRange1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t OK_IntegerInRange1_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [OK-IntegerInRange1] >>> ***/ static asn_per_constraints_t asn_PER_type_OK_IntegerInRange1_constr_1 = { { APC_CONSTRAINED, 8, 8, -100, 100 } /* (-100..100) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [OK-IntegerInRange1] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1 = { "OK-IntegerInRange1", "OK-IntegerInRange1", OK_IntegerInRange1_free, OK_IntegerInRange1_print, OK_IntegerInRange1_constraint, OK_IntegerInRange1_decode_ber, OK_IntegerInRange1_encode_der, OK_IntegerInRange1_decode_xer, OK_IntegerInRange1_encode_xer, OK_IntegerInRange1_decode_uper, OK_IntegerInRange1_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange1_tags_1, sizeof(asn_DEF_OK_IntegerInRange1_tags_1) /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange1_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange1_tags_1) /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */ &asn_PER_type_OK_IntegerInRange1_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange2] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange2] >>> ***/ typedef long OK_IntegerInRange2_t; /*** <<< FUNC-DECLS [OK-IntegerInRange2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2; asn_struct_free_f OK_IntegerInRange2_free; asn_struct_print_f OK_IntegerInRange2_print; asn_constr_check_f OK_IntegerInRange2_constraint; ber_type_decoder_f OK_IntegerInRange2_decode_ber; der_type_encoder_f OK_IntegerInRange2_encode_der; xer_type_decoder_f OK_IntegerInRange2_decode_xer; xer_type_encoder_f OK_IntegerInRange2_encode_xer; per_type_decoder_f OK_IntegerInRange2_decode_uper; per_type_encoder_f OK_IntegerInRange2_encode_uper; /*** <<< CODE [OK-IntegerInRange2] >>> ***/ int OK_IntegerInRange2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if(((value == -100) || (value == 100))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t OK_IntegerInRange2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t OK_IntegerInRange2_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [OK-IntegerInRange2] >>> ***/ static asn_per_constraints_t asn_PER_type_OK_IntegerInRange2_constr_1 = { { APC_CONSTRAINED, 8, 8, -100, 100 } /* (-100..100) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [OK-IntegerInRange2] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2 = { "OK-IntegerInRange2", "OK-IntegerInRange2", OK_IntegerInRange2_free, OK_IntegerInRange2_print, OK_IntegerInRange2_constraint, OK_IntegerInRange2_decode_ber, OK_IntegerInRange2_encode_der, OK_IntegerInRange2_decode_xer, OK_IntegerInRange2_encode_xer, OK_IntegerInRange2_decode_uper, OK_IntegerInRange2_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange2_tags_1, sizeof(asn_DEF_OK_IntegerInRange2_tags_1) /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange2_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange2_tags_1) /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */ &asn_PER_type_OK_IntegerInRange2_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange3] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange3] >>> ***/ typedef long OK_IntegerInRange3_t; /*** <<< FUNC-DECLS [OK-IntegerInRange3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3; asn_struct_free_f OK_IntegerInRange3_free; asn_struct_print_f OK_IntegerInRange3_print; asn_constr_check_f OK_IntegerInRange3_constraint; ber_type_decoder_f OK_IntegerInRange3_decode_ber; der_type_encoder_f OK_IntegerInRange3_encode_der; xer_type_decoder_f OK_IntegerInRange3_decode_xer; xer_type_encoder_f OK_IntegerInRange3_encode_xer; per_type_decoder_f OK_IntegerInRange3_decode_uper; per_type_encoder_f OK_IntegerInRange3_encode_uper; /*** <<< CODE [OK-IntegerInRange3] >>> ***/ int OK_IntegerInRange3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= (-2147483647L - 1) && value <= 2147483647)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t OK_IntegerInRange3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t OK_IntegerInRange3_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [OK-IntegerInRange3] >>> ***/ static asn_per_constraints_t asn_PER_type_OK_IntegerInRange3_constr_1 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [OK-IntegerInRange3] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3 = { "OK-IntegerInRange3", "OK-IntegerInRange3", OK_IntegerInRange3_free, OK_IntegerInRange3_print, OK_IntegerInRange3_constraint, OK_IntegerInRange3_decode_ber, OK_IntegerInRange3_encode_der, OK_IntegerInRange3_decode_xer, OK_IntegerInRange3_encode_xer, OK_IntegerInRange3_decode_uper, OK_IntegerInRange3_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange3_tags_1, sizeof(asn_DEF_OK_IntegerInRange3_tags_1) /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange3_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange3_tags_1) /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */ &asn_PER_type_OK_IntegerInRange3_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange4] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange4] >>> ***/ typedef long OK_IntegerInRange4_t; /*** <<< FUNC-DECLS [OK-IntegerInRange4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4; asn_struct_free_f OK_IntegerInRange4_free; asn_struct_print_f OK_IntegerInRange4_print; asn_constr_check_f OK_IntegerInRange4_constraint; ber_type_decoder_f OK_IntegerInRange4_decode_ber; der_type_encoder_f OK_IntegerInRange4_encode_der; xer_type_decoder_f OK_IntegerInRange4_decode_xer; xer_type_encoder_f OK_IntegerInRange4_encode_xer; per_type_decoder_f OK_IntegerInRange4_decode_uper; per_type_encoder_f OK_IntegerInRange4_encode_uper; /*** <<< CODE [OK-IntegerInRange4] >>> ***/ int OK_IntegerInRange4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if(((value == (-2147483647L - 1)) || (value == 2147483647))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t OK_IntegerInRange4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t OK_IntegerInRange4_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [OK-IntegerInRange4] >>> ***/ static asn_per_constraints_t asn_PER_type_OK_IntegerInRange4_constr_1 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [OK-IntegerInRange4] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = { "OK-IntegerInRange4", "OK-IntegerInRange4", OK_IntegerInRange4_free, OK_IntegerInRange4_print, OK_IntegerInRange4_constraint, OK_IntegerInRange4_decode_ber, OK_IntegerInRange4_encode_der, OK_IntegerInRange4_decode_xer, OK_IntegerInRange4_encode_xer, OK_IntegerInRange4_decode_uper, OK_IntegerInRange4_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange4_tags_1, sizeof(asn_DEF_OK_IntegerInRange4_tags_1) /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange4_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange4_tags_1) /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */ &asn_PER_type_OK_IntegerInRange4_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/ typedef INTEGER_t OK_IntegerInRange5_t; /*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5; asn_struct_free_f OK_IntegerInRange5_free; asn_struct_print_f OK_IntegerInRange5_print; asn_constr_check_f OK_IntegerInRange5_constraint; ber_type_decoder_f OK_IntegerInRange5_decode_ber; der_type_encoder_f OK_IntegerInRange5_encode_der; xer_type_decoder_f OK_IntegerInRange5_decode_xer; xer_type_encoder_f OK_IntegerInRange5_encode_xer; per_type_decoder_f OK_IntegerInRange5_decode_uper; per_type_encoder_f OK_IntegerInRange5_encode_uper; /*** <<< CODE [OK-IntegerInRange5] >>> ***/ int OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(((value == (-2147483647L - 1)) || (value == 2147483647))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void OK_IntegerInRange5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t OK_IntegerInRange5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t OK_IntegerInRange5_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [OK-IntegerInRange5] >>> ***/ static asn_per_constraints_t asn_PER_type_OK_IntegerInRange5_constr_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [OK-IntegerInRange5] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange5_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5 = { "OK-IntegerInRange5", "OK-IntegerInRange5", OK_IntegerInRange5_free, OK_IntegerInRange5_print, OK_IntegerInRange5_constraint, OK_IntegerInRange5_decode_ber, OK_IntegerInRange5_encode_der, OK_IntegerInRange5_decode_xer, OK_IntegerInRange5_encode_xer, OK_IntegerInRange5_decode_uper, OK_IntegerInRange5_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange5_tags_1, sizeof(asn_DEF_OK_IntegerInRange5_tags_1) /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange5_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange5_tags_1) /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */ &asn_PER_type_OK_IntegerInRange5_constr_1, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerInRange6] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerInRange6] >>> ***/ typedef unsigned long NO_IntegerInRange6_t; /*** <<< FUNC-DECLS [NO-IntegerInRange6] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6; asn_struct_free_f NO_IntegerInRange6_free; asn_struct_print_f NO_IntegerInRange6_print; asn_constr_check_f NO_IntegerInRange6_constraint; ber_type_decoder_f NO_IntegerInRange6_decode_ber; der_type_encoder_f NO_IntegerInRange6_encode_der; xer_type_decoder_f NO_IntegerInRange6_decode_xer; xer_type_encoder_f NO_IntegerInRange6_encode_xer; per_type_decoder_f NO_IntegerInRange6_decode_uper; per_type_encoder_f NO_IntegerInRange6_encode_uper; /*** <<< CODE [NO-IntegerInRange6] >>> ***/ int NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; /* Constraint check succeeded */ return 0; } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerInRange6_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerInRange6_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerInRange6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerInRange6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerInRange6_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerInRange6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerInRange6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t NO_IntegerInRange6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t NO_IntegerInRange6_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< CTDEFS [NO-IntegerInRange6] >>> ***/ static asn_per_constraints_t asn_PER_type_NO_IntegerInRange6_constr_1 = { { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [NO-IntegerInRange6] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerInRange6_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerInRange6_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { "NO-IntegerInRange6", "NO-IntegerInRange6", NO_IntegerInRange6_free, NO_IntegerInRange6_print, NO_IntegerInRange6_constraint, NO_IntegerInRange6_decode_ber, NO_IntegerInRange6_encode_der, NO_IntegerInRange6_decode_xer, NO_IntegerInRange6_encode_xer, NO_IntegerInRange6_decode_uper, NO_IntegerInRange6_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerInRange6_tags_1, sizeof(asn_DEF_NO_IntegerInRange6_tags_1) /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerInRange6_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerInRange6_tags_1) /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */ &asn_PER_type_NO_IntegerInRange6_constr_1, 0, 0, /* No members */ &asn_SPC_NO_IntegerInRange6_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/ #include /*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/ typedef enum CN_IntegerEnumerated1 { CN_IntegerEnumerated1_a = 1, CN_IntegerEnumerated1_b = 2 } e_CN_IntegerEnumerated1; /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ typedef INTEGER_t CN_IntegerEnumerated1_t; /*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1; asn_struct_free_f CN_IntegerEnumerated1_free; asn_struct_print_f CN_IntegerEnumerated1_print; asn_constr_check_f CN_IntegerEnumerated1_constraint; ber_type_decoder_f CN_IntegerEnumerated1_decode_ber; der_type_encoder_f CN_IntegerEnumerated1_encode_der; xer_type_decoder_f CN_IntegerEnumerated1_decode_xer; xer_type_encoder_f CN_IntegerEnumerated1_encode_xer; per_type_decoder_f CN_IntegerEnumerated1_decode_uper; per_type_encoder_f CN_IntegerEnumerated1_encode_uper; /*** <<< CODE [CN-IntegerEnumerated1] >>> ***/ int CN_IntegerEnumerated1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CN_IntegerEnumerated1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerEnumerated1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerEnumerated1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerEnumerated1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerEnumerated1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerEnumerated1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t CN_IntegerEnumerated1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t CN_IntegerEnumerated1_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< STAT-DEFS [CN-IntegerEnumerated1] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerEnumerated1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = { "CN-IntegerEnumerated1", "CN-IntegerEnumerated1", CN_IntegerEnumerated1_free, CN_IntegerEnumerated1_print, CN_IntegerEnumerated1_constraint, CN_IntegerEnumerated1_decode_ber, CN_IntegerEnumerated1_encode_der, CN_IntegerEnumerated1_decode_xer, CN_IntegerEnumerated1_encode_xer, CN_IntegerEnumerated1_decode_uper, CN_IntegerEnumerated1_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerEnumerated1_tags_1, sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1) /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerEnumerated1_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1) /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerEnumerated2] >>> ***/ #include /*** <<< DEPS [NO-IntegerEnumerated2] >>> ***/ typedef enum NO_IntegerEnumerated2 { NO_IntegerEnumerated2_a = 1, NO_IntegerEnumerated2_b = 3000000000 } e_NO_IntegerEnumerated2; /*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/ typedef INTEGER_t NO_IntegerEnumerated2_t; /*** <<< FUNC-DECLS [NO-IntegerEnumerated2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2; asn_struct_free_f NO_IntegerEnumerated2_free; asn_struct_print_f NO_IntegerEnumerated2_print; asn_constr_check_f NO_IntegerEnumerated2_constraint; ber_type_decoder_f NO_IntegerEnumerated2_decode_ber; der_type_encoder_f NO_IntegerEnumerated2_encode_der; xer_type_decoder_f NO_IntegerEnumerated2_decode_xer; xer_type_encoder_f NO_IntegerEnumerated2_encode_xer; per_type_decoder_f NO_IntegerEnumerated2_decode_uper; per_type_encoder_f NO_IntegerEnumerated2_encode_uper; /*** <<< CODE [NO-IntegerEnumerated2] >>> ***/ int NO_IntegerEnumerated2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerEnumerated2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerEnumerated2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerEnumerated2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerEnumerated2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerEnumerated2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerEnumerated2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t NO_IntegerEnumerated2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t NO_IntegerEnumerated2_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } /*** <<< STAT-DEFS [NO-IntegerEnumerated2] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerEnumerated2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2 = { "NO-IntegerEnumerated2", "NO-IntegerEnumerated2", NO_IntegerEnumerated2_free, NO_IntegerEnumerated2_print, NO_IntegerEnumerated2_constraint, NO_IntegerEnumerated2_decode_ber, NO_IntegerEnumerated2_encode_der, NO_IntegerEnumerated2_decode_xer, NO_IntegerEnumerated2_encode_xer, NO_IntegerEnumerated2_decode_uper, NO_IntegerEnumerated2_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerEnumerated2_tags_1, sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1) /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerEnumerated2_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1) /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/94-set-optionals-OK.asn10000644000000000000000000000126511461147103017522 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .94 ModuleSetOptionals { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 94 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN TestSet ::= SET { m0 [0] IMPLICIT VisibleString, m1 [1] IMPLICIT VisibleString OPTIONAL, m2 [2] IMPLICIT VisibleString, m3 [3] IMPLICIT VisibleString, m4 [4] IMPLICIT VisibleString OPTIONAL, m5 [5] IMPLICIT VisibleString, m6 [6] IMPLICIT VisibleString, m7 [7] IMPLICIT VisibleString, m8 [8] IMPLICIT VisibleString OPTIONAL, m9 [9] IMPLICIT VisibleString, ... } END asn1c-0.9.24+dfsg/tests/44-choice-in-sequence-OK.asn10000644000000000000000000000111311461147103020350 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .44 ModuleChoiceInSequence { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 44 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= [PRIVATE 1] SEQUENCE { a [PRIVATE 2] NULL, b CHOICE { c [PRIVATE 5] NULL, d [PRIVATE 6] NULL, e CHOICE { f [PRIVATE 7] NULL, g [PRIVATE 8] NULL }, h [PRIVATE 9] CHOICE { -- EXPLICIT! i [PRIVATE 1] NULL, j [PRIVATE 2] NULL } } } END asn1c-0.9.24+dfsg/tests/93-asn1c-controls-OK.asn10000644000000000000000000000117311461147103017564 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .93 Module-asn1c-controls { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 93 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN Sequence ::= SEQUENCE { ainl INTEGER, ---- aptr INTEGER } Set ::= SET { ainl Sequence, ---- aptr Sequence } Choice ::= CHOICE { ---- setof SET OF INTEGER, ---- aptr Sequence, ainl Sequence } END asn1c-0.9.24+dfsg/tests/45-undefined-type-SE.asn10000644000000000000000000000053411461147103017631 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .45 ModuleKnownExternType { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 45 } DEFINITIONS ::= BEGIN Type ::= KnownExt -- KnownExt is known to be external. END asn1c-0.9.24+dfsg/tests/60-any-OK.asn1.-EF0000644000000000000000000000051411461146446016054 0ustar rootrootModuleTestANY { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 60 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T1 ::= SEQUENCE { i INTEGER, any ANY } T2 ::= SEQUENCE { i INTEGER, any [0] EXPLICIT ANY OPTIONAL } T3 ::= SEQUENCE { any1 ANY, any2 ANY } END asn1c-0.9.24+dfsg/tests/104-param-1-OK.asn1.-EFprint-class-matrix0000644000000000000000000000053711461146446022271 0ustar rootrootModuleParameterization1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 104 } DEFINITIONS ::= BEGIN Collection{T} ::= SET OF T -- Specializations list has 2 entries: -- REAL -- IA5String Bunch ::= SEQUENCE { field-REAL Collection{ REAL}, field-IA5String Collection{ IA5String} } END asn1c-0.9.24+dfsg/tests/06-enum-SE.asn10000644000000000000000000000062411461147103015652 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .6 ModuleTestEnum4 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 6 } DEFINITIONS ::= BEGIN enum1 Enum1 ::= red Enum1 ::= ENUMERATED { red(5), ..., green(7), blue(6) -- order is not maintained after ... } END asn1c-0.9.24+dfsg/tests/63-any-2-SE.asn10000644000000000000000000000051311461147103015634 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .63 ModuleTestBadANY2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 62 } DEFINITIONS ::= BEGIN T ::= SEQUENCE { any [1] IMPLICIT ANY } END asn1c-0.9.24+dfsg/tests/31-set-of-OK.asn1.-P0000644000000000000000000003520411461146446016371 0ustar rootroot /*** <<< INCLUDES [Forest] >>> ***/ #include #include /*** <<< FWD-DECLS [Forest] >>> ***/ struct Tree; /*** <<< TYPE-DECLS [Forest] >>> ***/ typedef struct Forest { A_SET_OF(struct Tree) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Forest_t; /*** <<< FUNC-DECLS [Forest] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Forest; /*** <<< POST-INCLUDE [Forest] >>> ***/ #include "Tree.h" /*** <<< STAT-DEFS [Forest] >>> ***/ static asn_TYPE_member_t asn_MBR_Forest_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Tree, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_Forest_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_Forest_specs_1 = { sizeof(struct Forest), offsetof(struct Forest, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_Forest = { "Forest", "Forest", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Forest_tags_1, sizeof(asn_DEF_Forest_tags_1) /sizeof(asn_DEF_Forest_tags_1[0]), /* 1 */ asn_DEF_Forest_tags_1, /* Same as above */ sizeof(asn_DEF_Forest_tags_1) /sizeof(asn_DEF_Forest_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Forest_1, 1, /* Single element */ &asn_SPC_Forest_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Tree] >>> ***/ #include #include /*** <<< TYPE-DECLS [Tree] >>> ***/ typedef struct Tree { INTEGER_t height; INTEGER_t width; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Tree_t; /*** <<< FUNC-DECLS [Tree] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Tree; /*** <<< STAT-DEFS [Tree] >>> ***/ static asn_TYPE_member_t asn_MBR_Tree_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Tree, height), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "height" }, { ATF_NOFLAGS, 0, offsetof(struct Tree, width), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "width" }, }; static ber_tlv_tag_t asn_DEF_Tree_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Tree_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* height at 17 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* width at 19 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Tree_specs_1 = { sizeof(struct Tree), offsetof(struct Tree, _asn_ctx), asn_MAP_Tree_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Tree = { "Tree", "Tree", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Tree_tags_1, sizeof(asn_DEF_Tree_tags_1) /sizeof(asn_DEF_Tree_tags_1[0]), /* 1 */ asn_DEF_Tree_tags_1, /* Same as above */ sizeof(asn_DEF_Tree_tags_1) /sizeof(asn_DEF_Tree_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Tree_1, 2, /* Elements count */ &asn_SPC_Tree_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Stuff] >>> ***/ #include #include #include #include #include #include #include /*** <<< DEPS [Stuff] >>> ***/ /* * Method of determining the components presence */ typedef enum Stuff_PR { Stuff_PR_trees, /* Member trees is present */ Stuff_PR_anything, /* Member anything is present */ Stuff_PR_other, /* Member other is present */ } Stuff_PR; typedef enum other_PR { other_PR_NOTHING, /* No components present */ other_PR_a, other_PR_b } other_PR; /*** <<< FWD-DECLS [Stuff] >>> ***/ struct Forest; /*** <<< TYPE-DECLS [Stuff] >>> ***/ typedef struct Stuff { struct trees { A_SET_OF(struct Forest) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } *trees; struct anything { A_SET_OF(struct Member { BIT_STRING_t cup_of_coffee; /* * This type is extensible, * possible extensions are below. */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } *anything; /* * This type is extensible, * possible extensions are below. */ struct other { other_PR present; union Stuff__other_u { INTEGER_t a; INTEGER_t b; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } *other; /* Presence bitmask: ASN_SET_ISPRESENT(pStuff, Stuff_PR_x) */ unsigned int _presence_map [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Stuff_t; /*** <<< FUNC-DECLS [Stuff] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Stuff; /*** <<< POST-INCLUDE [Stuff] >>> ***/ #include "Forest.h" /*** <<< STAT-DEFS [Stuff] >>> ***/ static asn_TYPE_member_t asn_MBR_trees_2[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_Forest, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_trees_tags_2[] = { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_trees_specs_2 = { sizeof(struct trees), offsetof(struct trees, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_trees_2 = { "trees", "trees", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_trees_tags_2, sizeof(asn_DEF_trees_tags_2) /sizeof(asn_DEF_trees_tags_2[0]) - 1, /* 1 */ asn_DEF_trees_tags_2, /* Same as above */ sizeof(asn_DEF_trees_tags_2) /sizeof(asn_DEF_trees_tags_2[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_trees_2, 1, /* Single element */ &asn_SPC_trees_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Member_5[] = { { ATF_NOFLAGS, 0, offsetof(struct Member, cup_of_coffee), .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), .tag_mode = 0, .type = &asn_DEF_BIT_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "cup-of-coffee" }, }; static ber_tlv_tag_t asn_DEF_Member_tags_5[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Member_tag2el_5[] = { { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* cup-of-coffee at 32 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_5 = { sizeof(struct Member), offsetof(struct Member, _asn_ctx), asn_MAP_Member_tag2el_5, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 0, /* Start extensions */ 2 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_Member_5 = { "SEQUENCE", "SEQUENCE", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Member_tags_5, sizeof(asn_DEF_Member_tags_5) /sizeof(asn_DEF_Member_tags_5[0]), /* 1 */ asn_DEF_Member_tags_5, /* Same as above */ sizeof(asn_DEF_Member_tags_5) /sizeof(asn_DEF_Member_tags_5[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Member_5, 1, /* Elements count */ &asn_SPC_Member_specs_5 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_anything_4[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Member_5, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_anything_tags_4[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_anything_specs_4 = { sizeof(struct anything), offsetof(struct anything, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_anything_4 = { "anything", "anything", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_anything_tags_4, sizeof(asn_DEF_anything_tags_4) /sizeof(asn_DEF_anything_tags_4[0]) - 1, /* 1 */ asn_DEF_anything_tags_4, /* Same as above */ sizeof(asn_DEF_anything_tags_4) /sizeof(asn_DEF_anything_tags_4[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_anything_4, 1, /* Single element */ &asn_SPC_anything_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_other_9[] = { { ATF_NOFLAGS, 0, offsetof(struct other, choice.a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct other, choice.b), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static asn_TYPE_tag2member_t asn_MAP_other_tag2el_9[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 26 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 } /* b at 28 */ }; static asn_CHOICE_specifics_t asn_SPC_other_specs_9 = { sizeof(struct other), offsetof(struct other, _asn_ctx), offsetof(struct other, present), sizeof(((struct other *)0)->present), asn_MAP_other_tag2el_9, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_other_9 = { "other", "other", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_other_9, 2, /* Elements count */ &asn_SPC_other_specs_9 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Stuff_1[] = { { ATF_POINTER, 3, offsetof(struct Stuff, trees), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_trees_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "trees" }, { ATF_POINTER, 2, offsetof(struct Stuff, anything), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_anything_4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "anything" }, { ATF_POINTER, 1, offsetof(struct Stuff, other), .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_other_9, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "other" }, }; static ber_tlv_tag_t asn_DEF_Stuff_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Stuff_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* a at 26 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* trees at 23 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* anything at 34 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 } /* b at 28 */ }; static asn_TYPE_tag2member_t asn_MAP_Stuff_tag2el_cxer_1[] = { { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* trees at 23 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* anything at 34 */ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 } /* a at 26 */ }; static uint8_t asn_MAP_Stuff_mmap_1[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = { (0 << 7) | (0 << 6) | (0 << 5) }; static asn_SET_specifics_t asn_SPC_Stuff_specs_1 = { sizeof(struct Stuff), offsetof(struct Stuff, _asn_ctx), offsetof(struct Stuff, _presence_map), asn_MAP_Stuff_tag2el_1, 4, /* Count of tags in the map */ asn_MAP_Stuff_tag2el_cxer_1, 3, /* Count of tags in the CXER map */ 1, /* Whether extensible */ (unsigned int *)asn_MAP_Stuff_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_Stuff = { "Stuff", "Stuff", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Stuff_tags_1, sizeof(asn_DEF_Stuff_tags_1) /sizeof(asn_DEF_Stuff_tags_1[0]), /* 1 */ asn_DEF_Stuff_tags_1, /* Same as above */ sizeof(asn_DEF_Stuff_tags_1) /sizeof(asn_DEF_Stuff_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Stuff_1, 3, /* Elements count */ &asn_SPC_Stuff_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/100-class-ref-OK.asn10000644000000000000000000000065711461147103016650 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .100 ModuleClassSample { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 100 } DEFINITIONS ::= BEGIN REF-ID ::= TYPE-IDENTIFIER RefID ::= SEQUENCE { field REF-ID.&id, params REF-ID.&Type } SupportedReferences REF-ID ::= { ... } END asn1c-0.9.24+dfsg/tests/34-class-OK.asn10000644000000000000000000000221511461150505016014 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .34 ModuleTestClassSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 34 } DEFINITIONS IMPLICIT TAGS ::= BEGIN -- First CLASS EXTENSION ::= CLASS { &id [PRIVATE 0] INTEGER UNIQUE, &ExtnType } WITH SYNTAX { SYNTAX &ExtnType IDENTIFIED BY &id } -- Basic CLASS extraction Ext1 ::= SEQUENCE { extnId EXTENSION.&id } -- Second CLASS EXTENSION-ATTRIBUTE ::= CLASS { &id INTEGER (0..ub-extension-attributes) UNIQUE, &Type } WITH SYNTAX {&Type IDENTIFIED BY &id} terminal-type EXTENSION-ATTRIBUTE ::= {TerminalType IDENTIFIED BY 23} TerminalType ::= INTEGER { terminal(0) } -- Advanced CLASS extraction ExtensionAttribute ::= SEQUENCE { extension-attribute-type [0] EXTENSION-ATTRIBUTE.&id ({ExtensionAttributeTable}), extension-attribute-value [1] EXTENSION-ATTRIBUTE.&Type ({ExtensionAttributeTable} {@extension-attribute-type}) } -- Variables referenced by subtype constraints ub-extension-attributes INTEGER ::= 256 END asn1c-0.9.24+dfsg/tests/90-cond-int-type-OK.asn1.-P0000644000000000000000000024715311461230611017667 0ustar rootroot /*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/ typedef INTEGER_t CN_IntegerUnlimited_t; /*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited; asn_struct_free_f CN_IntegerUnlimited_free; asn_struct_print_f CN_IntegerUnlimited_print; asn_constr_check_f CN_IntegerUnlimited_constraint; ber_type_decoder_f CN_IntegerUnlimited_decode_ber; der_type_encoder_f CN_IntegerUnlimited_encode_der; xer_type_decoder_f CN_IntegerUnlimited_decode_xer; xer_type_encoder_f CN_IntegerUnlimited_encode_xer; /*** <<< CODE [CN-IntegerUnlimited] >>> ***/ int CN_IntegerUnlimited_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerUnlimited_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CN_IntegerUnlimited_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerUnlimited_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerUnlimited_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerUnlimited_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerUnlimited_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerUnlimited_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [CN-IntegerUnlimited] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerUnlimited_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = { "CN-IntegerUnlimited", "CN-IntegerUnlimited", CN_IntegerUnlimited_free, CN_IntegerUnlimited_print, CN_IntegerUnlimited_constraint, CN_IntegerUnlimited_decode_ber, CN_IntegerUnlimited_encode_der, CN_IntegerUnlimited_decode_xer, CN_IntegerUnlimited_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerUnlimited_tags_1, sizeof(asn_DEF_CN_IntegerUnlimited_tags_1) /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerUnlimited_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerUnlimited_tags_1) /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/ typedef INTEGER_t CN_IntegerMinMax_t; /*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax; asn_struct_free_f CN_IntegerMinMax_free; asn_struct_print_f CN_IntegerMinMax_print; asn_constr_check_f CN_IntegerMinMax_constraint; ber_type_decoder_f CN_IntegerMinMax_decode_ber; der_type_encoder_f CN_IntegerMinMax_encode_der; xer_type_decoder_f CN_IntegerMinMax_decode_xer; xer_type_encoder_f CN_IntegerMinMax_encode_xer; /*** <<< CODE [CN-IntegerMinMax] >>> ***/ int CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CN_IntegerMinMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerMinMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerMinMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerMinMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerMinMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerMinMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [CN-IntegerMinMax] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerMinMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = { "CN-IntegerMinMax", "CN-IntegerMinMax", CN_IntegerMinMax_free, CN_IntegerMinMax_print, CN_IntegerMinMax_constraint, CN_IntegerMinMax_decode_ber, CN_IntegerMinMax_encode_der, CN_IntegerMinMax_decode_xer, CN_IntegerMinMax_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerMinMax_tags_1, sizeof(asn_DEF_CN_IntegerMinMax_tags_1) /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerMinMax_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerMinMax_tags_1) /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/ typedef INTEGER_t CN_IntegerMinLow_t; /*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow; asn_struct_free_f CN_IntegerMinLow_free; asn_struct_print_f CN_IntegerMinLow_print; asn_constr_check_f CN_IntegerMinLow_constraint; ber_type_decoder_f CN_IntegerMinLow_decode_ber; der_type_encoder_f CN_IntegerMinLow_encode_der; xer_type_decoder_f CN_IntegerMinLow_decode_xer; xer_type_encoder_f CN_IntegerMinLow_encode_xer; /*** <<< CODE [CN-IntegerMinLow] >>> ***/ int CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value <= 1)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinLow_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CN_IntegerMinLow_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerMinLow_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerMinLow_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerMinLow_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerMinLow_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerMinLow_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [CN-IntegerMinLow] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerMinLow_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow = { "CN-IntegerMinLow", "CN-IntegerMinLow", CN_IntegerMinLow_free, CN_IntegerMinLow_print, CN_IntegerMinLow_constraint, CN_IntegerMinLow_decode_ber, CN_IntegerMinLow_encode_der, CN_IntegerMinLow_decode_xer, CN_IntegerMinLow_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerMinLow_tags_1, sizeof(asn_DEF_CN_IntegerMinLow_tags_1) /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerMinLow_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerMinLow_tags_1) /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerMinHigh] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerMinHigh] >>> ***/ typedef INTEGER_t NO_IntegerMinHigh_t; /*** <<< FUNC-DECLS [NO-IntegerMinHigh] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh; asn_struct_free_f NO_IntegerMinHigh_free; asn_struct_print_f NO_IntegerMinHigh_print; asn_constr_check_f NO_IntegerMinHigh_constraint; ber_type_decoder_f NO_IntegerMinHigh_decode_ber; der_type_encoder_f NO_IntegerMinHigh_encode_der; xer_type_decoder_f NO_IntegerMinHigh_decode_xer; xer_type_encoder_f NO_IntegerMinHigh_encode_xer; /*** <<< CODE [NO-IntegerMinHigh] >>> ***/ int NO_IntegerMinHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value <= 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerMinHigh_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerMinHigh_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerMinHigh_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerMinHigh_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerMinHigh_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerMinHigh_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerMinHigh_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerMinHigh] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerMinHigh_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh = { "NO-IntegerMinHigh", "NO-IntegerMinHigh", NO_IntegerMinHigh_free, NO_IntegerMinHigh_print, NO_IntegerMinHigh_constraint, NO_IntegerMinHigh_decode_ber, NO_IntegerMinHigh_encode_der, NO_IntegerMinHigh_decode_xer, NO_IntegerMinHigh_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerMinHigh_tags_1, sizeof(asn_DEF_NO_IntegerMinHigh_tags_1) /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerMinHigh_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerMinHigh_tags_1) /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerLowHigh] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerLowHigh] >>> ***/ typedef unsigned long NO_IntegerLowHigh_t; /*** <<< FUNC-DECLS [NO-IntegerLowHigh] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh; asn_struct_free_f NO_IntegerLowHigh_free; asn_struct_print_f NO_IntegerLowHigh_print; asn_constr_check_f NO_IntegerLowHigh_constraint; ber_type_decoder_f NO_IntegerLowHigh_decode_ber; der_type_encoder_f NO_IntegerLowHigh_encode_der; xer_type_decoder_f NO_IntegerLowHigh_decode_xer; xer_type_encoder_f NO_IntegerLowHigh_encode_xer; /*** <<< CODE [NO-IntegerLowHigh] >>> ***/ int NO_IntegerLowHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if((value >= 1 && value <= 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerLowHigh_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerLowHigh_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerLowHigh_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerLowHigh_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerLowHigh_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerLowHigh_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerLowHigh_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerLowHigh] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerLowHigh_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerLowHigh_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = { "NO-IntegerLowHigh", "NO-IntegerLowHigh", NO_IntegerLowHigh_free, NO_IntegerLowHigh_print, NO_IntegerLowHigh_constraint, NO_IntegerLowHigh_decode_ber, NO_IntegerLowHigh_encode_der, NO_IntegerLowHigh_decode_xer, NO_IntegerLowHigh_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerLowHigh_tags_1, sizeof(asn_DEF_NO_IntegerLowHigh_tags_1) /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerLowHigh_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerLowHigh_tags_1) /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_NO_IntegerLowHigh_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/ typedef INTEGER_t CN_IntegerLowMax_t; /*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax; asn_struct_free_f CN_IntegerLowMax_free; asn_struct_print_f CN_IntegerLowMax_print; asn_constr_check_f CN_IntegerLowMax_constraint; ber_type_decoder_f CN_IntegerLowMax_decode_ber; der_type_encoder_f CN_IntegerLowMax_encode_der; xer_type_decoder_f CN_IntegerLowMax_decode_xer; xer_type_encoder_f CN_IntegerLowMax_encode_xer; /*** <<< CODE [CN-IntegerLowMax] >>> ***/ int CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 1)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerLowMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CN_IntegerLowMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerLowMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerLowMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerLowMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerLowMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerLowMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [CN-IntegerLowMax] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerLowMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax = { "CN-IntegerLowMax", "CN-IntegerLowMax", CN_IntegerLowMax_free, CN_IntegerLowMax_print, CN_IntegerLowMax_constraint, CN_IntegerLowMax_decode_ber, CN_IntegerLowMax_encode_der, CN_IntegerLowMax_decode_xer, CN_IntegerLowMax_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerLowMax_tags_1, sizeof(asn_DEF_CN_IntegerLowMax_tags_1) /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerLowMax_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerLowMax_tags_1) /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerHighMax] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerHighMax] >>> ***/ typedef INTEGER_t NO_IntegerHighMax_t; /*** <<< FUNC-DECLS [NO-IntegerHighMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax; asn_struct_free_f NO_IntegerHighMax_free; asn_struct_print_f NO_IntegerHighMax_print; asn_constr_check_f NO_IntegerHighMax_constraint; ber_type_decoder_f NO_IntegerHighMax_decode_ber; der_type_encoder_f NO_IntegerHighMax_encode_der; xer_type_decoder_f NO_IntegerHighMax_decode_xer; xer_type_encoder_f NO_IntegerHighMax_encode_xer; /*** <<< CODE [NO-IntegerHighMax] >>> ***/ int NO_IntegerHighMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerHighMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerHighMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerHighMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerHighMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerHighMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerHighMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerHighMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerHighMax] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerHighMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax = { "NO-IntegerHighMax", "NO-IntegerHighMax", NO_IntegerHighMax_free, NO_IntegerHighMax_print, NO_IntegerHighMax_constraint, NO_IntegerHighMax_decode_ber, NO_IntegerHighMax_encode_der, NO_IntegerHighMax_decode_xer, NO_IntegerHighMax_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerHighMax_tags_1, sizeof(asn_DEF_NO_IntegerHighMax_tags_1) /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerHighMax_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerHighMax_tags_1) /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerLowestMax] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerLowestMax] >>> ***/ typedef INTEGER_t NO_IntegerLowestMax_t; /*** <<< FUNC-DECLS [NO-IntegerLowestMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax; asn_struct_free_f NO_IntegerLowestMax_free; asn_struct_print_f NO_IntegerLowestMax_print; asn_constr_check_f NO_IntegerLowestMax_constraint; ber_type_decoder_f NO_IntegerLowestMax_decode_ber; der_type_encoder_f NO_IntegerLowestMax_encode_der; xer_type_decoder_f NO_IntegerLowestMax_decode_xer; xer_type_encoder_f NO_IntegerLowestMax_encode_xer; /*** <<< CODE [NO-IntegerLowestMax] >>> ***/ int NO_IntegerLowestMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= -3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerLowestMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerLowestMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerLowestMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerLowestMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerLowestMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerLowestMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerLowestMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerLowestMax] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerLowestMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax = { "NO-IntegerLowestMax", "NO-IntegerLowestMax", NO_IntegerLowestMax_free, NO_IntegerLowestMax_print, NO_IntegerLowestMax_constraint, NO_IntegerLowestMax_decode_ber, NO_IntegerLowestMax_encode_der, NO_IntegerLowestMax_decode_xer, NO_IntegerLowestMax_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerLowestMax_tags_1, sizeof(asn_DEF_NO_IntegerLowestMax_tags_1) /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerLowestMax_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerLowestMax_tags_1) /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerOutRange] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerOutRange] >>> ***/ typedef unsigned long NO_IntegerOutRange_t; /*** <<< FUNC-DECLS [NO-IntegerOutRange] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange; asn_struct_free_f NO_IntegerOutRange_free; asn_struct_print_f NO_IntegerOutRange_print; asn_constr_check_f NO_IntegerOutRange_constraint; ber_type_decoder_f NO_IntegerOutRange_decode_ber; der_type_encoder_f NO_IntegerOutRange_encode_der; xer_type_decoder_f NO_IntegerOutRange_decode_xer; xer_type_encoder_f NO_IntegerOutRange_encode_xer; /*** <<< CODE [NO-IntegerOutRange] >>> ***/ int NO_IntegerOutRange_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if((value >= 3000000000 && value <= 3000000001)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerOutRange_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerOutRange_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerOutRange_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerOutRange_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerOutRange_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerOutRange_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerOutRange_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerOutRange] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutRange_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerOutRange_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange = { "NO-IntegerOutRange", "NO-IntegerOutRange", NO_IntegerOutRange_free, NO_IntegerOutRange_print, NO_IntegerOutRange_constraint, NO_IntegerOutRange_decode_ber, NO_IntegerOutRange_encode_der, NO_IntegerOutRange_decode_xer, NO_IntegerOutRange_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerOutRange_tags_1, sizeof(asn_DEF_NO_IntegerOutRange_tags_1) /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerOutRange_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerOutRange_tags_1) /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_NO_IntegerOutRange_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [NO-IntegerOutValue] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerOutValue] >>> ***/ typedef unsigned long NO_IntegerOutValue_t; /*** <<< FUNC-DECLS [NO-IntegerOutValue] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue; asn_struct_free_f NO_IntegerOutValue_free; asn_struct_print_f NO_IntegerOutValue_print; asn_constr_check_f NO_IntegerOutValue_constraint; ber_type_decoder_f NO_IntegerOutValue_decode_ber; der_type_encoder_f NO_IntegerOutValue_encode_der; xer_type_decoder_f NO_IntegerOutValue_decode_xer; xer_type_encoder_f NO_IntegerOutValue_encode_xer; /*** <<< CODE [NO-IntegerOutValue] >>> ***/ int NO_IntegerOutValue_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if((value == 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerOutValue_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerOutValue_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerOutValue_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerOutValue_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerOutValue_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerOutValue_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerOutValue_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerOutValue] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutValue_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerOutValue_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue = { "NO-IntegerOutValue", "NO-IntegerOutValue", NO_IntegerOutValue_free, NO_IntegerOutValue_print, NO_IntegerOutValue_constraint, NO_IntegerOutValue_decode_ber, NO_IntegerOutValue_encode_der, NO_IntegerOutValue_decode_xer, NO_IntegerOutValue_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerOutValue_tags_1, sizeof(asn_DEF_NO_IntegerOutValue_tags_1) /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerOutValue_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerOutValue_tags_1) /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_NO_IntegerOutValue_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [OK-IntegerInRange1] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange1] >>> ***/ typedef long OK_IntegerInRange1_t; /*** <<< FUNC-DECLS [OK-IntegerInRange1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1; asn_struct_free_f OK_IntegerInRange1_free; asn_struct_print_f OK_IntegerInRange1_print; asn_constr_check_f OK_IntegerInRange1_constraint; ber_type_decoder_f OK_IntegerInRange1_decode_ber; der_type_encoder_f OK_IntegerInRange1_encode_der; xer_type_decoder_f OK_IntegerInRange1_decode_xer; xer_type_encoder_f OK_IntegerInRange1_encode_xer; /*** <<< CODE [OK-IntegerInRange1] >>> ***/ int OK_IntegerInRange1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= -100 && value <= 100)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-IntegerInRange1] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1 = { "OK-IntegerInRange1", "OK-IntegerInRange1", OK_IntegerInRange1_free, OK_IntegerInRange1_print, OK_IntegerInRange1_constraint, OK_IntegerInRange1_decode_ber, OK_IntegerInRange1_encode_der, OK_IntegerInRange1_decode_xer, OK_IntegerInRange1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange1_tags_1, sizeof(asn_DEF_OK_IntegerInRange1_tags_1) /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange1_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange1_tags_1) /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange2] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange2] >>> ***/ typedef long OK_IntegerInRange2_t; /*** <<< FUNC-DECLS [OK-IntegerInRange2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2; asn_struct_free_f OK_IntegerInRange2_free; asn_struct_print_f OK_IntegerInRange2_print; asn_constr_check_f OK_IntegerInRange2_constraint; ber_type_decoder_f OK_IntegerInRange2_decode_ber; der_type_encoder_f OK_IntegerInRange2_encode_der; xer_type_decoder_f OK_IntegerInRange2_decode_xer; xer_type_encoder_f OK_IntegerInRange2_encode_xer; /*** <<< CODE [OK-IntegerInRange2] >>> ***/ int OK_IntegerInRange2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if(((value == -100) || (value == 100))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-IntegerInRange2] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2 = { "OK-IntegerInRange2", "OK-IntegerInRange2", OK_IntegerInRange2_free, OK_IntegerInRange2_print, OK_IntegerInRange2_constraint, OK_IntegerInRange2_decode_ber, OK_IntegerInRange2_encode_der, OK_IntegerInRange2_decode_xer, OK_IntegerInRange2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange2_tags_1, sizeof(asn_DEF_OK_IntegerInRange2_tags_1) /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange2_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange2_tags_1) /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange3] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange3] >>> ***/ typedef long OK_IntegerInRange3_t; /*** <<< FUNC-DECLS [OK-IntegerInRange3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3; asn_struct_free_f OK_IntegerInRange3_free; asn_struct_print_f OK_IntegerInRange3_print; asn_constr_check_f OK_IntegerInRange3_constraint; ber_type_decoder_f OK_IntegerInRange3_decode_ber; der_type_encoder_f OK_IntegerInRange3_encode_der; xer_type_decoder_f OK_IntegerInRange3_decode_xer; xer_type_encoder_f OK_IntegerInRange3_encode_xer; /*** <<< CODE [OK-IntegerInRange3] >>> ***/ int OK_IntegerInRange3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= (-2147483647L - 1) && value <= 2147483647)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-IntegerInRange3] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3 = { "OK-IntegerInRange3", "OK-IntegerInRange3", OK_IntegerInRange3_free, OK_IntegerInRange3_print, OK_IntegerInRange3_constraint, OK_IntegerInRange3_decode_ber, OK_IntegerInRange3_encode_der, OK_IntegerInRange3_decode_xer, OK_IntegerInRange3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange3_tags_1, sizeof(asn_DEF_OK_IntegerInRange3_tags_1) /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange3_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange3_tags_1) /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange4] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange4] >>> ***/ typedef long OK_IntegerInRange4_t; /*** <<< FUNC-DECLS [OK-IntegerInRange4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4; asn_struct_free_f OK_IntegerInRange4_free; asn_struct_print_f OK_IntegerInRange4_print; asn_constr_check_f OK_IntegerInRange4_constraint; ber_type_decoder_f OK_IntegerInRange4_decode_ber; der_type_encoder_f OK_IntegerInRange4_encode_der; xer_type_decoder_f OK_IntegerInRange4_decode_xer; xer_type_encoder_f OK_IntegerInRange4_encode_xer; /*** <<< CODE [OK-IntegerInRange4] >>> ***/ int OK_IntegerInRange4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if(((value == (-2147483647L - 1)) || (value == 2147483647))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-IntegerInRange4] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = { "OK-IntegerInRange4", "OK-IntegerInRange4", OK_IntegerInRange4_free, OK_IntegerInRange4_print, OK_IntegerInRange4_constraint, OK_IntegerInRange4_decode_ber, OK_IntegerInRange4_encode_der, OK_IntegerInRange4_decode_xer, OK_IntegerInRange4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange4_tags_1, sizeof(asn_DEF_OK_IntegerInRange4_tags_1) /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange4_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange4_tags_1) /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/ typedef INTEGER_t OK_IntegerInRange5_t; /*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5; asn_struct_free_f OK_IntegerInRange5_free; asn_struct_print_f OK_IntegerInRange5_print; asn_constr_check_f OK_IntegerInRange5_constraint; ber_type_decoder_f OK_IntegerInRange5_decode_ber; der_type_encoder_f OK_IntegerInRange5_encode_der; xer_type_decoder_f OK_IntegerInRange5_decode_xer; xer_type_encoder_f OK_IntegerInRange5_encode_xer; /*** <<< CODE [OK-IntegerInRange5] >>> ***/ int OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(((value == (-2147483647L - 1)) || (value == 2147483647))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void OK_IntegerInRange5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-IntegerInRange5] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange5_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5 = { "OK-IntegerInRange5", "OK-IntegerInRange5", OK_IntegerInRange5_free, OK_IntegerInRange5_print, OK_IntegerInRange5_constraint, OK_IntegerInRange5_decode_ber, OK_IntegerInRange5_encode_der, OK_IntegerInRange5_decode_xer, OK_IntegerInRange5_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange5_tags_1, sizeof(asn_DEF_OK_IntegerInRange5_tags_1) /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange5_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange5_tags_1) /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerInRange6] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerInRange6] >>> ***/ typedef unsigned long NO_IntegerInRange6_t; /*** <<< FUNC-DECLS [NO-IntegerInRange6] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6; asn_struct_free_f NO_IntegerInRange6_free; asn_struct_print_f NO_IntegerInRange6_print; asn_constr_check_f NO_IntegerInRange6_constraint; ber_type_decoder_f NO_IntegerInRange6_decode_ber; der_type_encoder_f NO_IntegerInRange6_encode_der; xer_type_decoder_f NO_IntegerInRange6_decode_xer; xer_type_encoder_f NO_IntegerInRange6_encode_xer; /*** <<< CODE [NO-IntegerInRange6] >>> ***/ int NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; /* Constraint check succeeded */ return 0; } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerInRange6_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerInRange6_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerInRange6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerInRange6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerInRange6_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerInRange6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerInRange6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerInRange6] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerInRange6_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerInRange6_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { "NO-IntegerInRange6", "NO-IntegerInRange6", NO_IntegerInRange6_free, NO_IntegerInRange6_print, NO_IntegerInRange6_constraint, NO_IntegerInRange6_decode_ber, NO_IntegerInRange6_encode_der, NO_IntegerInRange6_decode_xer, NO_IntegerInRange6_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerInRange6_tags_1, sizeof(asn_DEF_NO_IntegerInRange6_tags_1) /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerInRange6_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerInRange6_tags_1) /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_NO_IntegerInRange6_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/ #include /*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/ typedef enum CN_IntegerEnumerated1 { CN_IntegerEnumerated1_a = 1, CN_IntegerEnumerated1_b = 2 } e_CN_IntegerEnumerated1; /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ typedef INTEGER_t CN_IntegerEnumerated1_t; /*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1; asn_struct_free_f CN_IntegerEnumerated1_free; asn_struct_print_f CN_IntegerEnumerated1_print; asn_constr_check_f CN_IntegerEnumerated1_constraint; ber_type_decoder_f CN_IntegerEnumerated1_decode_ber; der_type_encoder_f CN_IntegerEnumerated1_encode_der; xer_type_decoder_f CN_IntegerEnumerated1_decode_xer; xer_type_encoder_f CN_IntegerEnumerated1_encode_xer; /*** <<< CODE [CN-IntegerEnumerated1] >>> ***/ int CN_IntegerEnumerated1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void CN_IntegerEnumerated1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerEnumerated1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerEnumerated1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerEnumerated1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerEnumerated1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerEnumerated1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [CN-IntegerEnumerated1] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerEnumerated1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = { "CN-IntegerEnumerated1", "CN-IntegerEnumerated1", CN_IntegerEnumerated1_free, CN_IntegerEnumerated1_print, CN_IntegerEnumerated1_constraint, CN_IntegerEnumerated1_decode_ber, CN_IntegerEnumerated1_encode_der, CN_IntegerEnumerated1_decode_xer, CN_IntegerEnumerated1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerEnumerated1_tags_1, sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1) /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerEnumerated1_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1) /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerEnumerated2] >>> ***/ #include /*** <<< DEPS [NO-IntegerEnumerated2] >>> ***/ typedef enum NO_IntegerEnumerated2 { NO_IntegerEnumerated2_a = 1, NO_IntegerEnumerated2_b = 3000000000 } e_NO_IntegerEnumerated2; /*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/ typedef INTEGER_t NO_IntegerEnumerated2_t; /*** <<< FUNC-DECLS [NO-IntegerEnumerated2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2; asn_struct_free_f NO_IntegerEnumerated2_free; asn_struct_print_f NO_IntegerEnumerated2_print; asn_constr_check_f NO_IntegerEnumerated2_constraint; ber_type_decoder_f NO_IntegerEnumerated2_decode_ber; der_type_encoder_f NO_IntegerEnumerated2_encode_der; xer_type_decoder_f NO_IntegerEnumerated2_decode_xer; xer_type_encoder_f NO_IntegerEnumerated2_encode_xer; /*** <<< CODE [NO-IntegerEnumerated2] >>> ***/ int NO_IntegerEnumerated2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerEnumerated2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerEnumerated2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerEnumerated2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerEnumerated2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerEnumerated2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerEnumerated2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerEnumerated2] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerEnumerated2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2 = { "NO-IntegerEnumerated2", "NO-IntegerEnumerated2", NO_IntegerEnumerated2_free, NO_IntegerEnumerated2_print, NO_IntegerEnumerated2_constraint, NO_IntegerEnumerated2_decode_ber, NO_IntegerEnumerated2_encode_der, NO_IntegerEnumerated2_decode_xer, NO_IntegerEnumerated2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerEnumerated2_tags_1, sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1) /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerEnumerated2_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1) /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/82-with-comps-OK.asn10000644000000000000000000000077611461147103017016 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .82 ModuleTestWithComponents { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 82 } DEFINITIONS ::= BEGIN BunchOfStrings ::= SEQUENCE OF VisibleString Address ::= BunchOfStrings (SIZE (1..6)) (WITH COMPONENT (SIZE (1..32))) Type ::= SEQUENCE { one INTEGER DEFAULT 1 } (WITH COMPONENTS { ..., one (1) PRESENT }) END asn1c-0.9.24+dfsg/tests/111-param-4-SE.asn10000644000000000000000000000074511461147103016230 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .111 ModuleParameterization4 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 111 } DEFINITIONS ::= BEGIN Flag{Color} ::= SEQUENCE { field Color DEFAULT cyan } IntegerColorFlag ::= Flag{INTEGER{ red(0), green(1), blue(5) }} EnumeratedColorFlag ::= Flag{ENUMERATED{ red(3), green, blue }} END asn1c-0.9.24+dfsg/tests/124-multiconstraint-OK.asn1.-EF0000644000000000000000000000035411461146446020607 0ustar rootrootModuleMultiConstraint { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 124 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN T ::= VisibleString (PATTERN "^[a-z]+$")(CONSTRAINED BY { ... }) END asn1c-0.9.24+dfsg/tests/31-set-of-OK.asn10000644000000000000000000000143611461150505016105 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .31 ModuleTestSetOfSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 31 } DEFINITIONS IMPLICIT TAGS ::= BEGIN Forest ::= SET OF Tree Tree ::= SEQUENCE { height INTEGER, width INTEGER } -- The following clause tests OPTIONAL. Stuff ::= SET { trees [1] SET OF Forest OPTIONAL, ..., other CHOICE { a [0] INTEGER, b [3] INTEGER }, ..., anything [2] SET OF SEQUENCE { cup-of-coffee BIT STRING, ... } OPTIONAL -- The above OPTIONAL applies to the "anything" -- member of the outer CHOICE, -- not to the SET OF's embedded SEQUENCE! } END asn1c-0.9.24+dfsg/tests/96-type-identifier-OK.asn10000644000000000000000000000066211461147103020024 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .96 ModuleTypeIdentifier { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 96 } DEFINITIONS ::= BEGIN /* * TYPE-IDENTIFIER shall be automatically available. */ T ::= SEQUENCE { id TYPE-IDENTIFIER.&id, type TYPE-IDENTIFIER.&Type } END asn1c-0.9.24+dfsg/tests/49-real-life-OK.asn1.-E0000644000000000000000000000026011461146446017024 0ustar rootrootModuleSetChoiceExtensibility { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 49 } DEFINITIONS ::= BEGIN Z ::= INTEGER END asn1c-0.9.24+dfsg/tests/16-constraint-OK.asn1.-EF0000644000000000000000000000130311461146446017447 0ustar rootrootModuleTestConstraint1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 16 1 } DEFINITIONS ::= BEGIN Type0 ::= IA5String (((SIZE(1..10))(FROM("a".."z" | "#")))) Type6 ::= IA5String ((SIZE(1..10))(FROM("a".."z" | "#"))) END ModuleTestConstraint2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 16 2 } DEFINITIONS ::= BEGIN Type1 ::= IA5String (SIZE(1..10,...))(FROM("a".."z" | "#",...)) Type2 ::= IA5String (SIZE(MIN..4) | FROM("abc")) Type3 ::= BMPString (SIZE(1)) Type4 ::= INTEGER (1..MAX) Type5 ::= BOOLEAN (TRUE | FALSE) ten INTEGER ::= 10 v1 Type1 ::= "#value with ""double quotes""" END asn1c-0.9.24+dfsg/tests/40-int-optional-SE.asn10000644000000000000000000000076111461150505017323 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .40 ModuleTestIntOptional { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 40 } DEFINITIONS ::= BEGIN T ::= CHOICE { seq SEQUENCE { string UTF8String, alpha INTEGER OPTIONAL, beta INTEGER OPTIONAL }, set SET { string UTF8String, alpha INTEGER OPTIONAL, beta INTEGER OPTIONAL } } END asn1c-0.9.24+dfsg/tests/93-asn1c-controls-OK.asn1.-P0000644000000000000000000002340111461146446020046 0ustar rootroot /*** <<< INCLUDES [Sequence] >>> ***/ #include #include /*** <<< TYPE-DECLS [Sequence] >>> ***/ typedef struct Sequence { INTEGER_t ainl; INTEGER_t *aptr; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Sequence_t; /*** <<< FUNC-DECLS [Sequence] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Sequence; /*** <<< STAT-DEFS [Sequence] >>> ***/ static asn_TYPE_member_t asn_MBR_Sequence_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Sequence, ainl), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ainl" }, { ATF_POINTER, 0, offsetof(struct Sequence, aptr), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "aptr" }, }; static ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ainl at 15 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* aptr at 18 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = { sizeof(struct Sequence), offsetof(struct Sequence, _asn_ctx), asn_MAP_Sequence_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Sequence = { "Sequence", "Sequence", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Sequence_tags_1, sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ asn_DEF_Sequence_tags_1, /* Same as above */ sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Sequence_1, 2, /* Elements count */ &asn_SPC_Sequence_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Set] >>> ***/ #include "Sequence.h" #include /*** <<< DEPS [Set] >>> ***/ /* * Method of determining the components presence */ typedef enum Set_PR { Set_PR_ainl, /* Member ainl is present */ Set_PR_aptr, /* Member aptr is present */ } Set_PR; /*** <<< FWD-DECLS [Set] >>> ***/ struct Sequence; /*** <<< TYPE-DECLS [Set] >>> ***/ typedef struct Set { Sequence_t ainl; struct Sequence *aptr; /* Presence bitmask: ASN_SET_ISPRESENT(pSet, Set_PR_x) */ unsigned int _presence_map [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Set_t; /*** <<< FUNC-DECLS [Set] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Set; /*** <<< POST-INCLUDE [Set] >>> ***/ #include "Sequence.h" /*** <<< STAT-DEFS [Set] >>> ***/ static asn_TYPE_member_t asn_MBR_Set_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Set, ainl), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ainl" }, { ATF_POINTER, 0, offsetof(struct Set, aptr), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "aptr" }, }; static ber_tlv_tag_t asn_DEF_Set_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Set_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ainl at 21 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* aptr at 24 */ }; static uint8_t asn_MAP_Set_mmap_1[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) | (1 << 6) }; static asn_SET_specifics_t asn_SPC_Set_specs_1 = { sizeof(struct Set), offsetof(struct Set, _asn_ctx), offsetof(struct Set, _presence_map), asn_MAP_Set_tag2el_1, 2, /* Count of tags in the map */ asn_MAP_Set_tag2el_1, /* Same as above */ 2, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_Set_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_Set = { "Set", "Set", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Set_tags_1, sizeof(asn_DEF_Set_tags_1) /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */ asn_DEF_Set_tags_1, /* Same as above */ sizeof(asn_DEF_Set_tags_1) /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Set_1, 2, /* Elements count */ &asn_SPC_Set_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice] >>> ***/ #include "Sequence.h" #include #include #include #include /*** <<< DEPS [Choice] >>> ***/ typedef enum Choice_PR { Choice_PR_NOTHING, /* No components present */ Choice_PR_setof, Choice_PR_aptr, Choice_PR_ainl } Choice_PR; /*** <<< FWD-DECLS [Choice] >>> ***/ struct Sequence; /*** <<< TYPE-DECLS [Choice] >>> ***/ typedef struct Choice { Choice_PR present; union Choice_u { struct setof { A_SET_OF(INTEGER_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } *setof; struct Sequence *aptr; Sequence_t ainl; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice_t; /*** <<< FUNC-DECLS [Choice] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice; /*** <<< POST-INCLUDE [Choice] >>> ***/ #include "Sequence.h" /*** <<< STAT-DEFS [Choice] >>> ***/ static asn_TYPE_member_t asn_MBR_setof_2[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_setof_tags_2[] = { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_setof_specs_2 = { sizeof(struct setof), offsetof(struct setof, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_setof_2 = { "setof", "setof", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_setof_tags_2, sizeof(asn_DEF_setof_tags_2) /sizeof(asn_DEF_setof_tags_2[0]) - 1, /* 1 */ asn_DEF_setof_tags_2, /* Same as above */ sizeof(asn_DEF_setof_tags_2) /sizeof(asn_DEF_setof_tags_2[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_setof_2, 1, /* Single element */ &asn_SPC_setof_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Choice_1[] = { { ATF_POINTER, 0, offsetof(struct Choice, choice.setof), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = 0, .type = &asn_DEF_setof_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "setof" }, { ATF_POINTER, 0, offsetof(struct Choice, choice.aptr), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "aptr" }, { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ainl), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "ainl" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* setof at 28 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* aptr at 30 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ainl at 32 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = { sizeof(struct Choice), offsetof(struct Choice, _asn_ctx), offsetof(struct Choice, present), sizeof(((struct Choice *)0)->present), asn_MAP_Choice_tag2el_1, 3, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice = { "Choice", "Choice", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_Choice_1, 3, /* Elements count */ &asn_SPC_Choice_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/26-sequence-SE.asn10000644000000000000000000000057611461147103016526 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .26 ModuleTestSequenceTagsDistinct { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 26 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= SEQUENCE { a INTEGER, b INTEGER OPTIONAL, c INTEGER } END asn1c-0.9.24+dfsg/tests/104-param-1-OK.asn10000644000000000000000000000065411461147103016230 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .104 ModuleParameterization1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 104 } DEFINITIONS ::= BEGIN Collection {T} ::= SET OF T Bunch ::= SEQUENCE { field-REAL Collection {REAL}, field-IA5String Collection {IA5String} } END asn1c-0.9.24+dfsg/tests/38-comments-OK.asn10000644000000000000000000000115011461147103016535 0ustar rootroot -- OK: Everything is Fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .38 ModuleNestedCTypeComments { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 38 } DEFINITIONS ::= BEGIN T ::= CHOICE { t-a INTEGER, t-b OCTET STRING /* t-c [1] Choice1, t-d Choice2 */ } -- this is a comment too -- This-Is-Not-A-Comment ::= INTEGER /* ISO/IEC 8824-1 #11.6.4 blah blah blah /* nested comment */ -- this is an insignificant coment -- this is a comment too -- and this is a comment */ END asn1c-0.9.24+dfsg/tests/37-indirect-choice-OK.asn10000644000000000000000000000134411461150505017745 0ustar rootroot -- OK: Everything is Fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .37 ModuleTestIndirectChoiceFine { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 37 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= CHOICE { t-a INTEGER, t-b OCTET STRING, t-c [1] Choice1, t-d [3] Choice2 } Choice1 ::= CHOICE { c-a OCTET STRING, c-b INTEGER } Choice2 ::= [2] CHOICE { c-a OCTET STRING, c-b INTEGER, c-d [3] Choice1, c-e [4] Choice1 } Choice3 ::= [3] EXPLICIT Choice2 -- tags [3] [2] Choice4 ::= [4] IMPLICIT Choice2 -- tags [4] Choice5 ::= Choice2 -- tags [2] Choice6 ::= Choice1 -- tags END asn1c-0.9.24+dfsg/tests/03-enum-OK.asn10000644000000000000000000000144712015121740015650 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .3 ModuleTestEnum1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 3 } DEFINITIONS ::= BEGIN Enum1 ::= ENUMERATED { red, -- will be 0 -- green, -- will be 1 -- blue(4), alpha, ... -- extensible -- } Enum2 ::= ENUMERATED { red, -- will be 0 -- green, -- will be 1 -- blue(45), orange(23), -- Does not have to be ordered -- alpha, ..., -- extensible -- beta(12), -- May be less than the max value in the root -- gamma(103) -- Must be ordered -- } Enum3 ::= ENUMERATED { a, b(3), ..., c(1) } Enum4 ::= ENUMERATED { a, b, ..., c(3), d } Enum5 ::= ENUMERATED { a, z(25), ..., d } END asn1c-0.9.24+dfsg/tests/131-per-empty-OK.asn1.-Pgen-PER0000644000000000000000000000233212015121740020273 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include /*** <<< TYPE-DECLS [T] >>> ***/ typedef struct T { /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; /*** <<< STAT-DEFS [T] >>> ***/ static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = { sizeof(struct T), offsetof(struct T, _asn_ctx), 0, /* No top level tags */ 0, /* No tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_T_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/15-resolver-SE.asn10000644000000000000000000000142011461147103016542 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .15 1 -- .15 2 ModuleTestResolver4 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 15 1 } DEFINITIONS ::= BEGIN IMPORTS Enumeration, beta FROM OtherModuleRenamed { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 15 2 }; -- external reference alpha Enumeration ::= beta END ModuleTestResolver5 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 15 2 } DEFINITIONS ::= BEGIN EXPORTS; -- Does not export anything! beta Enumeration ::= b Enumeration ::= ENUMERATED { a(1), b(2) } END asn1c-0.9.24+dfsg/tests/119-per-strings-OK.asn10000644000000000000000000000324111461147103017250 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .119 ModulePERStrings { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 119 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN PDU ::= SEQUENCE { many SEQUENCE OF PDU OPTIONAL, ia5 IA5String OPTIONAL, ia5-c IA5String (FROM("A".."Z")) OPTIONAL, ia5-ce IA5String (FROM("A".."Z",...)) OPTIONAL, ia5-ir IA5String (FROM("A".."B"|"X".."Z")) OPTIONAL, vs VisibleString OPTIONAL, vs-c VisibleString (FROM("A".."Z")) OPTIONAL, vs-ce VisibleString (FROM("A".."Z",...)) OPTIONAL, vs-ir VisibleString (FROM("A".."B"|"X".."Z")) OPTIONAL, pr PrintableString OPTIONAL, pr-c PrintableString (FROM("A".."Z")) OPTIONAL, pr-ir PrintableString (FROM("A".."B"|"X".."Z")) OPTIONAL, ns NumericString OPTIONAL, ns-c NumericString (FROM("5".."9")) OPTIONAL, ns-ce NumericString (FROM("5".."9",...)) OPTIONAL, ns-ir NumericString (FROM("1"|"9")) OPTIONAL, ut-c UTF8String (SIZE(6)) OPTIONAL, ut-ce UTF8String (SIZE(6,...)) OPTIONAL, ut-ir UTF8String (FROM("A"|"Z")) OPTIONAL, bm BMPString OPTIONAL, bm-c BMPString (FROM("A".."Z")) OPTIONAL, bm-cs BMPString (SIZE(6)) OPTIONAL, bm-ce BMPString (FROM("A".."Z",...)) OPTIONAL, bm-ir BMPString (FROM("A".."B"|"X".."Z")) OPTIONAL, us UniversalString OPTIONAL, us-c UniversalString (FROM("A".."Z")) OPTIONAL, us-cs UniversalString (SIZE(6)) OPTIONAL, us-ce UniversalString (FROM("A".."Z",...)) OPTIONAL, us-ir UniversalString (FROM("A".."B"|"X".."Z")) OPTIONAL, real REAL OPTIONAL, oid OBJECT IDENTIFIER OPTIONAL } END asn1c-0.9.24+dfsg/tests/131-per-empty-OK.asn10000644000000000000000000000053012015121740016700 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .131 ModulePERLong { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 131 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN T ::= SEQUENCE { } -- Empty sequence END asn1c-0.9.24+dfsg/tests/97-type-identifier-SW.asn1.-EF0000644000000000000000000000113611461146446020421 0ustar rootrootModuleTypeIdentifier1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 97 1 } DEFINITIONS ::= BEGIN T1 ::= SEQUENCE { id TYPE-IDENTIFIER.&id2, type TYPE-IDENTIFIER.&Type } TYPE-IDENTIFIER ::= CLASS { &id2 OBJECT IDENTIFIER UNIQUE, &Type ANY } WITH SYNTAX { [ &Type ] IDENTIFIED BY &id2 } END ModuleTypeIdentifier2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 97 2 } DEFINITIONS ::= BEGIN T2 ::= SEQUENCE { id TYPE-IDENTIFIER.&id, type TYPE-IDENTIFIER.&Type } END asn1c-0.9.24+dfsg/tests/55-components-of-OK.asn1.-EF0000644000000000000000000000135411461146446020063 0ustar rootrootModuleTestComponentsOf { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 55 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN OneType ::= SEQUENCE { one-1 INTEGER, one-2 [1] IMPLICIT BOOLEAN, one-3 SEQUENCE { alpha [0] IMPLICIT INTEGER, beta [1] IMPLICIT INTEGER, ... }, one-4 INTEGER, ..., ignored-in-SecondType INTEGER } SecondType ::= SEQUENCE { a [0] IMPLICIT IA5String, one-1 [1] IMPLICIT INTEGER, one-2 [2] IMPLICIT BOOLEAN, one-3 [3] IMPLICIT SEQUENCE { alpha [0] IMPLICIT INTEGER, beta [1] IMPLICIT INTEGER }, one-4 [4] IMPLICIT INTEGER, b [5] IMPLICIT UniversalString } END asn1c-0.9.24+dfsg/tests/05-enum-SE.asn10000644000000000000000000000065511461147103015655 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .5 ModuleTestEnum3 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 5 } DEFINITIONS ::= BEGIN enum1 Enum1 ::= red Enum1 ::= ENUMERATED { red(5), green(4), ..., blue(6), -- second extension marker is not allowed -- ..., white(7) } END asn1c-0.9.24+dfsg/tests/90-cond-int-type-OK.asn1.-Pfnative-types0000644000000000000000000024704611461230611022407 0ustar rootroot /*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/ typedef long CN_IntegerUnlimited_t; /*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited; asn_struct_free_f CN_IntegerUnlimited_free; asn_struct_print_f CN_IntegerUnlimited_print; asn_constr_check_f CN_IntegerUnlimited_constraint; ber_type_decoder_f CN_IntegerUnlimited_decode_ber; der_type_encoder_f CN_IntegerUnlimited_encode_der; xer_type_decoder_f CN_IntegerUnlimited_decode_xer; xer_type_encoder_f CN_IntegerUnlimited_encode_xer; /*** <<< CODE [CN-IntegerUnlimited] >>> ***/ int CN_IntegerUnlimited_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerUnlimited_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void CN_IntegerUnlimited_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerUnlimited_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerUnlimited_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerUnlimited_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerUnlimited_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerUnlimited_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [CN-IntegerUnlimited] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerUnlimited_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = { "CN-IntegerUnlimited", "CN-IntegerUnlimited", CN_IntegerUnlimited_free, CN_IntegerUnlimited_print, CN_IntegerUnlimited_constraint, CN_IntegerUnlimited_decode_ber, CN_IntegerUnlimited_encode_der, CN_IntegerUnlimited_decode_xer, CN_IntegerUnlimited_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerUnlimited_tags_1, sizeof(asn_DEF_CN_IntegerUnlimited_tags_1) /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerUnlimited_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerUnlimited_tags_1) /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/ typedef long CN_IntegerMinMax_t; /*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax; asn_struct_free_f CN_IntegerMinMax_free; asn_struct_print_f CN_IntegerMinMax_print; asn_constr_check_f CN_IntegerMinMax_constraint; ber_type_decoder_f CN_IntegerMinMax_decode_ber; der_type_encoder_f CN_IntegerMinMax_encode_der; xer_type_decoder_f CN_IntegerMinMax_decode_xer; xer_type_encoder_f CN_IntegerMinMax_encode_xer; /*** <<< CODE [CN-IntegerMinMax] >>> ***/ int CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void CN_IntegerMinMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerMinMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerMinMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerMinMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerMinMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerMinMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [CN-IntegerMinMax] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerMinMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = { "CN-IntegerMinMax", "CN-IntegerMinMax", CN_IntegerMinMax_free, CN_IntegerMinMax_print, CN_IntegerMinMax_constraint, CN_IntegerMinMax_decode_ber, CN_IntegerMinMax_encode_der, CN_IntegerMinMax_decode_xer, CN_IntegerMinMax_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerMinMax_tags_1, sizeof(asn_DEF_CN_IntegerMinMax_tags_1) /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerMinMax_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerMinMax_tags_1) /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/ typedef long CN_IntegerMinLow_t; /*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow; asn_struct_free_f CN_IntegerMinLow_free; asn_struct_print_f CN_IntegerMinLow_print; asn_constr_check_f CN_IntegerMinLow_constraint; ber_type_decoder_f CN_IntegerMinLow_decode_ber; der_type_encoder_f CN_IntegerMinLow_encode_der; xer_type_decoder_f CN_IntegerMinLow_decode_xer; xer_type_encoder_f CN_IntegerMinLow_encode_xer; /*** <<< CODE [CN-IntegerMinLow] >>> ***/ int CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value <= 1)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinLow_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void CN_IntegerMinLow_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerMinLow_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerMinLow_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerMinLow_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerMinLow_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerMinLow_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [CN-IntegerMinLow] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerMinLow_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow = { "CN-IntegerMinLow", "CN-IntegerMinLow", CN_IntegerMinLow_free, CN_IntegerMinLow_print, CN_IntegerMinLow_constraint, CN_IntegerMinLow_decode_ber, CN_IntegerMinLow_encode_der, CN_IntegerMinLow_decode_xer, CN_IntegerMinLow_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerMinLow_tags_1, sizeof(asn_DEF_CN_IntegerMinLow_tags_1) /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerMinLow_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerMinLow_tags_1) /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerMinHigh] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerMinHigh] >>> ***/ typedef INTEGER_t NO_IntegerMinHigh_t; /*** <<< FUNC-DECLS [NO-IntegerMinHigh] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh; asn_struct_free_f NO_IntegerMinHigh_free; asn_struct_print_f NO_IntegerMinHigh_print; asn_constr_check_f NO_IntegerMinHigh_constraint; ber_type_decoder_f NO_IntegerMinHigh_decode_ber; der_type_encoder_f NO_IntegerMinHigh_encode_der; xer_type_decoder_f NO_IntegerMinHigh_decode_xer; xer_type_encoder_f NO_IntegerMinHigh_encode_xer; /*** <<< CODE [NO-IntegerMinHigh] >>> ***/ int NO_IntegerMinHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value <= 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerMinHigh_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerMinHigh_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerMinHigh_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerMinHigh_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerMinHigh_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerMinHigh_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerMinHigh_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerMinHigh] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerMinHigh_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh = { "NO-IntegerMinHigh", "NO-IntegerMinHigh", NO_IntegerMinHigh_free, NO_IntegerMinHigh_print, NO_IntegerMinHigh_constraint, NO_IntegerMinHigh_decode_ber, NO_IntegerMinHigh_encode_der, NO_IntegerMinHigh_decode_xer, NO_IntegerMinHigh_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerMinHigh_tags_1, sizeof(asn_DEF_NO_IntegerMinHigh_tags_1) /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerMinHigh_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerMinHigh_tags_1) /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerLowHigh] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerLowHigh] >>> ***/ typedef unsigned long NO_IntegerLowHigh_t; /*** <<< FUNC-DECLS [NO-IntegerLowHigh] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh; asn_struct_free_f NO_IntegerLowHigh_free; asn_struct_print_f NO_IntegerLowHigh_print; asn_constr_check_f NO_IntegerLowHigh_constraint; ber_type_decoder_f NO_IntegerLowHigh_decode_ber; der_type_encoder_f NO_IntegerLowHigh_encode_der; xer_type_decoder_f NO_IntegerLowHigh_decode_xer; xer_type_encoder_f NO_IntegerLowHigh_encode_xer; /*** <<< CODE [NO-IntegerLowHigh] >>> ***/ int NO_IntegerLowHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if((value >= 1 && value <= 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerLowHigh_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerLowHigh_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerLowHigh_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerLowHigh_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerLowHigh_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerLowHigh_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerLowHigh_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerLowHigh] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerLowHigh_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerLowHigh_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = { "NO-IntegerLowHigh", "NO-IntegerLowHigh", NO_IntegerLowHigh_free, NO_IntegerLowHigh_print, NO_IntegerLowHigh_constraint, NO_IntegerLowHigh_decode_ber, NO_IntegerLowHigh_encode_der, NO_IntegerLowHigh_decode_xer, NO_IntegerLowHigh_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerLowHigh_tags_1, sizeof(asn_DEF_NO_IntegerLowHigh_tags_1) /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerLowHigh_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerLowHigh_tags_1) /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_NO_IntegerLowHigh_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/ #include /*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/ typedef long CN_IntegerLowMax_t; /*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax; asn_struct_free_f CN_IntegerLowMax_free; asn_struct_print_f CN_IntegerLowMax_print; asn_constr_check_f CN_IntegerLowMax_constraint; ber_type_decoder_f CN_IntegerLowMax_decode_ber; der_type_encoder_f CN_IntegerLowMax_encode_der; xer_type_decoder_f CN_IntegerLowMax_decode_xer; xer_type_encoder_f CN_IntegerLowMax_encode_xer; /*** <<< CODE [CN-IntegerLowMax] >>> ***/ int CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= 1)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerLowMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void CN_IntegerLowMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerLowMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerLowMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerLowMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerLowMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerLowMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [CN-IntegerLowMax] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerLowMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax = { "CN-IntegerLowMax", "CN-IntegerLowMax", CN_IntegerLowMax_free, CN_IntegerLowMax_print, CN_IntegerLowMax_constraint, CN_IntegerLowMax_decode_ber, CN_IntegerLowMax_encode_der, CN_IntegerLowMax_decode_xer, CN_IntegerLowMax_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerLowMax_tags_1, sizeof(asn_DEF_CN_IntegerLowMax_tags_1) /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerLowMax_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerLowMax_tags_1) /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerHighMax] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerHighMax] >>> ***/ typedef INTEGER_t NO_IntegerHighMax_t; /*** <<< FUNC-DECLS [NO-IntegerHighMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax; asn_struct_free_f NO_IntegerHighMax_free; asn_struct_print_f NO_IntegerHighMax_print; asn_constr_check_f NO_IntegerHighMax_constraint; ber_type_decoder_f NO_IntegerHighMax_decode_ber; der_type_encoder_f NO_IntegerHighMax_encode_der; xer_type_decoder_f NO_IntegerHighMax_decode_xer; xer_type_encoder_f NO_IntegerHighMax_encode_xer; /*** <<< CODE [NO-IntegerHighMax] >>> ***/ int NO_IntegerHighMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerHighMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerHighMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerHighMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerHighMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerHighMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerHighMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerHighMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerHighMax] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerHighMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax = { "NO-IntegerHighMax", "NO-IntegerHighMax", NO_IntegerHighMax_free, NO_IntegerHighMax_print, NO_IntegerHighMax_constraint, NO_IntegerHighMax_decode_ber, NO_IntegerHighMax_encode_der, NO_IntegerHighMax_decode_xer, NO_IntegerHighMax_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerHighMax_tags_1, sizeof(asn_DEF_NO_IntegerHighMax_tags_1) /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerHighMax_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerHighMax_tags_1) /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerLowestMax] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerLowestMax] >>> ***/ typedef INTEGER_t NO_IntegerLowestMax_t; /*** <<< FUNC-DECLS [NO-IntegerLowestMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax; asn_struct_free_f NO_IntegerLowestMax_free; asn_struct_print_f NO_IntegerLowestMax_print; asn_constr_check_f NO_IntegerLowestMax_constraint; ber_type_decoder_f NO_IntegerLowestMax_decode_ber; der_type_encoder_f NO_IntegerLowestMax_encode_der; xer_type_decoder_f NO_IntegerLowestMax_decode_xer; xer_type_encoder_f NO_IntegerLowestMax_encode_xer; /*** <<< CODE [NO-IntegerLowestMax] >>> ***/ int NO_IntegerLowestMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= -3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerLowestMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerLowestMax_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerLowestMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerLowestMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerLowestMax_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerLowestMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerLowestMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerLowestMax] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerLowestMax_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax = { "NO-IntegerLowestMax", "NO-IntegerLowestMax", NO_IntegerLowestMax_free, NO_IntegerLowestMax_print, NO_IntegerLowestMax_constraint, NO_IntegerLowestMax_decode_ber, NO_IntegerLowestMax_encode_der, NO_IntegerLowestMax_decode_xer, NO_IntegerLowestMax_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerLowestMax_tags_1, sizeof(asn_DEF_NO_IntegerLowestMax_tags_1) /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerLowestMax_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerLowestMax_tags_1) /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerOutRange] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerOutRange] >>> ***/ typedef unsigned long NO_IntegerOutRange_t; /*** <<< FUNC-DECLS [NO-IntegerOutRange] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange; asn_struct_free_f NO_IntegerOutRange_free; asn_struct_print_f NO_IntegerOutRange_print; asn_constr_check_f NO_IntegerOutRange_constraint; ber_type_decoder_f NO_IntegerOutRange_decode_ber; der_type_encoder_f NO_IntegerOutRange_encode_der; xer_type_decoder_f NO_IntegerOutRange_decode_xer; xer_type_encoder_f NO_IntegerOutRange_encode_xer; /*** <<< CODE [NO-IntegerOutRange] >>> ***/ int NO_IntegerOutRange_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if((value >= 3000000000 && value <= 3000000001)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerOutRange_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerOutRange_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerOutRange_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerOutRange_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerOutRange_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerOutRange_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerOutRange_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerOutRange] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutRange_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerOutRange_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange = { "NO-IntegerOutRange", "NO-IntegerOutRange", NO_IntegerOutRange_free, NO_IntegerOutRange_print, NO_IntegerOutRange_constraint, NO_IntegerOutRange_decode_ber, NO_IntegerOutRange_encode_der, NO_IntegerOutRange_decode_xer, NO_IntegerOutRange_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerOutRange_tags_1, sizeof(asn_DEF_NO_IntegerOutRange_tags_1) /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerOutRange_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerOutRange_tags_1) /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_NO_IntegerOutRange_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [NO-IntegerOutValue] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerOutValue] >>> ***/ typedef unsigned long NO_IntegerOutValue_t; /*** <<< FUNC-DECLS [NO-IntegerOutValue] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue; asn_struct_free_f NO_IntegerOutValue_free; asn_struct_print_f NO_IntegerOutValue_print; asn_constr_check_f NO_IntegerOutValue_constraint; ber_type_decoder_f NO_IntegerOutValue_decode_ber; der_type_encoder_f NO_IntegerOutValue_encode_der; xer_type_decoder_f NO_IntegerOutValue_decode_xer; xer_type_encoder_f NO_IntegerOutValue_encode_xer; /*** <<< CODE [NO-IntegerOutValue] >>> ***/ int NO_IntegerOutValue_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; if((value == 3000000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerOutValue_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerOutValue_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerOutValue_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerOutValue_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerOutValue_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerOutValue_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerOutValue_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerOutValue] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutValue_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerOutValue_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue = { "NO-IntegerOutValue", "NO-IntegerOutValue", NO_IntegerOutValue_free, NO_IntegerOutValue_print, NO_IntegerOutValue_constraint, NO_IntegerOutValue_decode_ber, NO_IntegerOutValue_encode_der, NO_IntegerOutValue_decode_xer, NO_IntegerOutValue_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerOutValue_tags_1, sizeof(asn_DEF_NO_IntegerOutValue_tags_1) /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerOutValue_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerOutValue_tags_1) /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_NO_IntegerOutValue_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [OK-IntegerInRange1] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange1] >>> ***/ typedef long OK_IntegerInRange1_t; /*** <<< FUNC-DECLS [OK-IntegerInRange1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1; asn_struct_free_f OK_IntegerInRange1_free; asn_struct_print_f OK_IntegerInRange1_print; asn_constr_check_f OK_IntegerInRange1_constraint; ber_type_decoder_f OK_IntegerInRange1_decode_ber; der_type_encoder_f OK_IntegerInRange1_encode_der; xer_type_decoder_f OK_IntegerInRange1_decode_xer; xer_type_encoder_f OK_IntegerInRange1_encode_xer; /*** <<< CODE [OK-IntegerInRange1] >>> ***/ int OK_IntegerInRange1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= -100 && value <= 100)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-IntegerInRange1] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1 = { "OK-IntegerInRange1", "OK-IntegerInRange1", OK_IntegerInRange1_free, OK_IntegerInRange1_print, OK_IntegerInRange1_constraint, OK_IntegerInRange1_decode_ber, OK_IntegerInRange1_encode_der, OK_IntegerInRange1_decode_xer, OK_IntegerInRange1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange1_tags_1, sizeof(asn_DEF_OK_IntegerInRange1_tags_1) /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange1_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange1_tags_1) /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange2] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange2] >>> ***/ typedef long OK_IntegerInRange2_t; /*** <<< FUNC-DECLS [OK-IntegerInRange2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2; asn_struct_free_f OK_IntegerInRange2_free; asn_struct_print_f OK_IntegerInRange2_print; asn_constr_check_f OK_IntegerInRange2_constraint; ber_type_decoder_f OK_IntegerInRange2_decode_ber; der_type_encoder_f OK_IntegerInRange2_encode_der; xer_type_decoder_f OK_IntegerInRange2_decode_xer; xer_type_encoder_f OK_IntegerInRange2_encode_xer; /*** <<< CODE [OK-IntegerInRange2] >>> ***/ int OK_IntegerInRange2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if(((value == -100) || (value == 100))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-IntegerInRange2] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2 = { "OK-IntegerInRange2", "OK-IntegerInRange2", OK_IntegerInRange2_free, OK_IntegerInRange2_print, OK_IntegerInRange2_constraint, OK_IntegerInRange2_decode_ber, OK_IntegerInRange2_encode_der, OK_IntegerInRange2_decode_xer, OK_IntegerInRange2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange2_tags_1, sizeof(asn_DEF_OK_IntegerInRange2_tags_1) /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange2_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange2_tags_1) /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange3] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange3] >>> ***/ typedef long OK_IntegerInRange3_t; /*** <<< FUNC-DECLS [OK-IntegerInRange3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3; asn_struct_free_f OK_IntegerInRange3_free; asn_struct_print_f OK_IntegerInRange3_print; asn_constr_check_f OK_IntegerInRange3_constraint; ber_type_decoder_f OK_IntegerInRange3_decode_ber; der_type_encoder_f OK_IntegerInRange3_encode_der; xer_type_decoder_f OK_IntegerInRange3_decode_xer; xer_type_encoder_f OK_IntegerInRange3_encode_xer; /*** <<< CODE [OK-IntegerInRange3] >>> ***/ int OK_IntegerInRange3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= (-2147483647L - 1) && value <= 2147483647)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-IntegerInRange3] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3 = { "OK-IntegerInRange3", "OK-IntegerInRange3", OK_IntegerInRange3_free, OK_IntegerInRange3_print, OK_IntegerInRange3_constraint, OK_IntegerInRange3_decode_ber, OK_IntegerInRange3_encode_der, OK_IntegerInRange3_decode_xer, OK_IntegerInRange3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange3_tags_1, sizeof(asn_DEF_OK_IntegerInRange3_tags_1) /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange3_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange3_tags_1) /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange4] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange4] >>> ***/ typedef long OK_IntegerInRange4_t; /*** <<< FUNC-DECLS [OK-IntegerInRange4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4; asn_struct_free_f OK_IntegerInRange4_free; asn_struct_print_f OK_IntegerInRange4_print; asn_constr_check_f OK_IntegerInRange4_constraint; ber_type_decoder_f OK_IntegerInRange4_decode_ber; der_type_encoder_f OK_IntegerInRange4_encode_der; xer_type_decoder_f OK_IntegerInRange4_decode_xer; xer_type_encoder_f OK_IntegerInRange4_encode_xer; /*** <<< CODE [OK-IntegerInRange4] >>> ***/ int OK_IntegerInRange4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if(((value == (-2147483647L - 1)) || (value == 2147483647))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-IntegerInRange4] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = { "OK-IntegerInRange4", "OK-IntegerInRange4", OK_IntegerInRange4_free, OK_IntegerInRange4_print, OK_IntegerInRange4_constraint, OK_IntegerInRange4_decode_ber, OK_IntegerInRange4_encode_der, OK_IntegerInRange4_decode_xer, OK_IntegerInRange4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange4_tags_1, sizeof(asn_DEF_OK_IntegerInRange4_tags_1) /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange4_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange4_tags_1) /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/ #include /*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/ typedef long OK_IntegerInRange5_t; /*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5; asn_struct_free_f OK_IntegerInRange5_free; asn_struct_print_f OK_IntegerInRange5_print; asn_constr_check_f OK_IntegerInRange5_constraint; ber_type_decoder_f OK_IntegerInRange5_decode_ber; der_type_encoder_f OK_IntegerInRange5_encode_der; xer_type_decoder_f OK_IntegerInRange5_decode_xer; xer_type_encoder_f OK_IntegerInRange5_encode_xer; /*** <<< CODE [OK-IntegerInRange5] >>> ***/ int OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if(((value == (-2147483647L - 1)) || (value == 2147483647))) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void OK_IntegerInRange5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int OK_IntegerInRange5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t OK_IntegerInRange5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t OK_IntegerInRange5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t OK_IntegerInRange5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t OK_IntegerInRange5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [OK-IntegerInRange5] >>> ***/ static ber_tlv_tag_t asn_DEF_OK_IntegerInRange5_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5 = { "OK-IntegerInRange5", "OK-IntegerInRange5", OK_IntegerInRange5_free, OK_IntegerInRange5_print, OK_IntegerInRange5_constraint, OK_IntegerInRange5_decode_ber, OK_IntegerInRange5_encode_der, OK_IntegerInRange5_decode_xer, OK_IntegerInRange5_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OK_IntegerInRange5_tags_1, sizeof(asn_DEF_OK_IntegerInRange5_tags_1) /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */ asn_DEF_OK_IntegerInRange5_tags_1, /* Same as above */ sizeof(asn_DEF_OK_IntegerInRange5_tags_1) /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerInRange6] >>> ***/ #include /*** <<< TYPE-DECLS [NO-IntegerInRange6] >>> ***/ typedef unsigned long NO_IntegerInRange6_t; /*** <<< FUNC-DECLS [NO-IntegerInRange6] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6; asn_struct_free_f NO_IntegerInRange6_free; asn_struct_print_f NO_IntegerInRange6_print; asn_constr_check_f NO_IntegerInRange6_constraint; ber_type_decoder_f NO_IntegerInRange6_decode_ber; der_type_encoder_f NO_IntegerInRange6_encode_der; xer_type_decoder_f NO_IntegerInRange6_decode_xer; xer_type_encoder_f NO_IntegerInRange6_encode_xer; /*** <<< CODE [NO-IntegerInRange6] >>> ***/ int NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const unsigned long *)sptr; /* Constraint check succeeded */ return 0; } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_IntegerInRange6_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NO_IntegerInRange6_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerInRange6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerInRange6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerInRange6_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerInRange6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerInRange6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerInRange6] >>> ***/ static asn_INTEGER_specifics_t asn_SPC_NO_IntegerInRange6_specs_1 = { 0, 0, 0, 0, 0, 0, /* Native long size */ 1 /* Unsigned representation */ }; static ber_tlv_tag_t asn_DEF_NO_IntegerInRange6_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { "NO-IntegerInRange6", "NO-IntegerInRange6", NO_IntegerInRange6_free, NO_IntegerInRange6_print, NO_IntegerInRange6_constraint, NO_IntegerInRange6_decode_ber, NO_IntegerInRange6_encode_der, NO_IntegerInRange6_decode_xer, NO_IntegerInRange6_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerInRange6_tags_1, sizeof(asn_DEF_NO_IntegerInRange6_tags_1) /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerInRange6_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerInRange6_tags_1) /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_NO_IntegerInRange6_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/ #include /*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/ typedef enum CN_IntegerEnumerated1 { CN_IntegerEnumerated1_a = 1, CN_IntegerEnumerated1_b = 2 } e_CN_IntegerEnumerated1; /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ typedef long CN_IntegerEnumerated1_t; /*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1; asn_struct_free_f CN_IntegerEnumerated1_free; asn_struct_print_f CN_IntegerEnumerated1_print; asn_constr_check_f CN_IntegerEnumerated1_constraint; ber_type_decoder_f CN_IntegerEnumerated1_decode_ber; der_type_encoder_f CN_IntegerEnumerated1_encode_der; xer_type_decoder_f CN_IntegerEnumerated1_decode_xer; xer_type_encoder_f CN_IntegerEnumerated1_encode_xer; /*** <<< CODE [CN-IntegerEnumerated1] >>> ***/ int CN_IntegerEnumerated1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void CN_IntegerEnumerated1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int CN_IntegerEnumerated1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t CN_IntegerEnumerated1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t CN_IntegerEnumerated1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t CN_IntegerEnumerated1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t CN_IntegerEnumerated1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [CN-IntegerEnumerated1] >>> ***/ static ber_tlv_tag_t asn_DEF_CN_IntegerEnumerated1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = { "CN-IntegerEnumerated1", "CN-IntegerEnumerated1", CN_IntegerEnumerated1_free, CN_IntegerEnumerated1_print, CN_IntegerEnumerated1_constraint, CN_IntegerEnumerated1_decode_ber, CN_IntegerEnumerated1_encode_der, CN_IntegerEnumerated1_decode_xer, CN_IntegerEnumerated1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_CN_IntegerEnumerated1_tags_1, sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1) /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */ asn_DEF_CN_IntegerEnumerated1_tags_1, /* Same as above */ sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1) /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [NO-IntegerEnumerated2] >>> ***/ #include /*** <<< DEPS [NO-IntegerEnumerated2] >>> ***/ typedef enum NO_IntegerEnumerated2 { NO_IntegerEnumerated2_a = 1, NO_IntegerEnumerated2_b = 3000000000 } e_NO_IntegerEnumerated2; /*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/ typedef INTEGER_t NO_IntegerEnumerated2_t; /*** <<< FUNC-DECLS [NO-IntegerEnumerated2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2; asn_struct_free_f NO_IntegerEnumerated2_free; asn_struct_print_f NO_IntegerEnumerated2_print; asn_constr_check_f NO_IntegerEnumerated2_constraint; ber_type_decoder_f NO_IntegerEnumerated2_decode_ber; der_type_encoder_f NO_IntegerEnumerated2_encode_der; xer_type_decoder_f NO_IntegerEnumerated2_decode_xer; xer_type_encoder_f NO_IntegerEnumerated2_encode_xer; /*** <<< CODE [NO-IntegerEnumerated2] >>> ***/ int NO_IntegerEnumerated2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void NO_IntegerEnumerated2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NO_IntegerEnumerated2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NO_IntegerEnumerated2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NO_IntegerEnumerated2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NO_IntegerEnumerated2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NO_IntegerEnumerated2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NO-IntegerEnumerated2] >>> ***/ static ber_tlv_tag_t asn_DEF_NO_IntegerEnumerated2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2 = { "NO-IntegerEnumerated2", "NO-IntegerEnumerated2", NO_IntegerEnumerated2_free, NO_IntegerEnumerated2_print, NO_IntegerEnumerated2_constraint, NO_IntegerEnumerated2_decode_ber, NO_IntegerEnumerated2_encode_der, NO_IntegerEnumerated2_decode_xer, NO_IntegerEnumerated2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NO_IntegerEnumerated2_tags_1, sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1) /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */ asn_DEF_NO_IntegerEnumerated2_tags_1, /* Same as above */ sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1) /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/103-reference-SE.asn10000644000000000000000000000053311461147103016721 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .103 ModuleReference { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 103 } DEFINITIONS ::= BEGIN IMPORTS Type FROM ModuleReference; T ::= SEQUENCE OF Type END asn1c-0.9.24+dfsg/tests/19-param-OK.asn10000644000000000000000000000125311461150505016013 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .19 ModuleTestParam { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 19 } DEFINITIONS ::= BEGIN SIGNED { ToBeSigned } ::= SEQUENCE { toBeSigned ToBeSigned, algorithm OBJECT IDENTIFIER, signature BIT STRING SIZE(0..256) } Certificate ::= SIGNED { SEQUENCE { version INTEGER, signature OBJECT IDENTIFIER, issuer Name } } Name ::= SEQUENCE OF RelativeDistinguishedName RelativeDistinguishedName ::= SET SIZE (1..MAX) OF IA5String (FROM("A".."Z"|"a".."z"|"0-9"|",-.")) END asn1c-0.9.24+dfsg/tests/01-empty-OK.asn10000644000000000000000000000043711461147103016043 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .1 ModuleTestEmpty { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 1 } DEFINITIONS ::= BEGIN END asn1c-0.9.24+dfsg/tests/Makefile.in0000644000000000000000000002251412121076150015436 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = *.asn1* all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/tests/90-cond-int-type-OK.asn1.-EFprint-constraints0000644000000000000000000001040611461146446023405 0ustar rootrootModuleConditionalIntegerType { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 90 } DEFINITIONS ::= BEGIN CN-IntegerUnlimited ::= INTEGER -- Practical constraints (CN-IntegerUnlimited): (MIN..MAX) -- PER-visible constraints (CN-IntegerUnlimited): (MIN..MAX) CN-IntegerMinMax ::= INTEGER (MIN..MAX) -- Combined constraints: (MIN..MAX) -- Practical constraints (CN-IntegerMinMax): (MIN..MAX) -- PER-visible constraints (CN-IntegerMinMax): (MIN..MAX) CN-IntegerMinLow ::= INTEGER (MIN..1) -- Combined constraints: (MIN..1) -- Practical constraints (CN-IntegerMinLow): (MIN..1) -- PER-visible constraints (CN-IntegerMinLow): (MIN..1) NO-IntegerMinHigh ::= INTEGER (MIN..3000000000) -- Combined constraints: (MIN..3000000000) -- Practical constraints (NO-IntegerMinHigh): (MIN..3000000000) -- PER-visible constraints (NO-IntegerMinHigh): (MIN..3000000000) NO-IntegerLowHigh ::= INTEGER (1..3000000000) -- Combined constraints: (1..3000000000) -- Practical constraints (NO-IntegerLowHigh): (1..3000000000) -- PER-visible constraints (NO-IntegerLowHigh): (1..3000000000) CN-IntegerLowMax ::= INTEGER (1..MAX) -- Combined constraints: (1..MAX) -- Practical constraints (CN-IntegerLowMax): (1..MAX) -- PER-visible constraints (CN-IntegerLowMax): (1..MAX) NO-IntegerHighMax ::= INTEGER (3000000000..MAX) -- Combined constraints: (3000000000..MAX) -- Practical constraints (NO-IntegerHighMax): (3000000000..MAX) -- PER-visible constraints (NO-IntegerHighMax): (3000000000..MAX) NO-IntegerLowestMax ::= INTEGER (-3000000000..MAX) -- Combined constraints: (-3000000000..MAX) -- Practical constraints (NO-IntegerLowestMax): (-3000000000..MAX) -- PER-visible constraints (NO-IntegerLowestMax): (-3000000000..MAX) NO-IntegerOutRange ::= INTEGER (3000000000..3000000001) -- Combined constraints: (3000000000..3000000001) -- Practical constraints (NO-IntegerOutRange): (3000000000..3000000001) -- PER-visible constraints (NO-IntegerOutRange): (3000000000..3000000001) NO-IntegerOutValue ::= INTEGER (3000000000) -- Combined constraints: (3000000000) -- Practical constraints (NO-IntegerOutValue): (3000000000) -- PER-visible constraints (NO-IntegerOutValue): (3000000000) OK-IntegerInRange1 ::= INTEGER (-100..100) -- Combined constraints: (-100..100) -- Practical constraints (OK-IntegerInRange1): (-100..100) -- PER-visible constraints (OK-IntegerInRange1): (-100..100) OK-IntegerInRange2 ::= INTEGER (-100 | 100) -- Combined constraints: (-100 | 100) -- Practical constraints (OK-IntegerInRange2): (-100 | 100) -- PER-visible constraints (OK-IntegerInRange2): (-100 | 100) OK-IntegerInRange3 ::= INTEGER (-2147483648..2147483647) -- Combined constraints: (-2147483648..2147483647) -- Practical constraints (OK-IntegerInRange3): (-2147483648..2147483647) -- PER-visible constraints (OK-IntegerInRange3): (-2147483648..2147483647) OK-IntegerInRange4 ::= INTEGER (-2147483648 | 2147483647) -- Combined constraints: (-2147483648 | 2147483647) -- Practical constraints (OK-IntegerInRange4): (-2147483648 | 2147483647) -- PER-visible constraints (OK-IntegerInRange4): (-2147483648 | 2147483647) OK-IntegerInRange5 ::= INTEGER (-2147483648 | 2147483647,...) -- Combined constraints: (-2147483648 | 2147483647,...) -- Practical constraints (OK-IntegerInRange5): (-2147483648 | 2147483647,...) -- PER-visible constraints (OK-IntegerInRange5): (-2147483648 | 2147483647,...) NO-IntegerInRange6 ::= INTEGER (0..4294967295) -- Combined constraints: (0..4294967295) -- Practical constraints (NO-IntegerInRange6): (0..4294967295) -- PER-visible constraints (NO-IntegerInRange6): (0..4294967295) CN-IntegerEnumerated1 ::= INTEGER { a(1) -- Practical constraints (a): -- PER-visible constraints (a): , b(2) -- Practical constraints (b): -- PER-visible constraints (b): } -- Practical constraints (CN-IntegerEnumerated1): (MIN..MAX) -- PER-visible constraints (CN-IntegerEnumerated1): (MIN..MAX) NO-IntegerEnumerated2 ::= INTEGER { a(1) -- Practical constraints (a): -- PER-visible constraints (a): , b(3000000000) -- Practical constraints (b): -- PER-visible constraints (b): } -- Practical constraints (NO-IntegerEnumerated2): (MIN..MAX) -- PER-visible constraints (NO-IntegerEnumerated2): (MIN..MAX) END asn1c-0.9.24+dfsg/tests/129-enum-OK.asn1.-EF0000644000000000000000000000031212015121740016275 0ustar rootrootModuleTestEnum1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 129 } DEFINITIONS ::= BEGIN A ::= ENUMERATED { a(-5), b(-4), c(0) } END asn1c-0.9.24+dfsg/tests/47-set-ext-OK.asn1.-P0000644000000000000000000002053611461146446016576 0ustar rootroot /*** <<< INCLUDES [T1] >>> ***/ #include #include /*** <<< DEPS [T1] >>> ***/ /* * Method of determining the components presence */ typedef enum T1_PR { T1_PR_i, /* Member i is present */ } T1_PR; /*** <<< TYPE-DECLS [T1] >>> ***/ typedef struct T1 { INTEGER_t i; /* * This type is extensible, * possible extensions are below. */ /* Presence bitmask: ASN_SET_ISPRESENT(pT1, T1_PR_x) */ unsigned int _presence_map [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T1_t; /*** <<< FUNC-DECLS [T1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T1; /*** <<< STAT-DEFS [T1] >>> ***/ static asn_TYPE_member_t asn_MBR_T1_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T1, i), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "i" }, }; static ber_tlv_tag_t asn_DEF_T1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T1_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i at 14 */ }; static uint8_t asn_MAP_T1_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) }; static asn_SET_specifics_t asn_SPC_T1_specs_1 = { sizeof(struct T1), offsetof(struct T1, _asn_ctx), offsetof(struct T1, _presence_map), asn_MAP_T1_tag2el_1, 1, /* Count of tags in the map */ asn_MAP_T1_tag2el_1, /* Same as above */ 1, /* Count of tags in the CXER map */ 1, /* Whether extensible */ (unsigned int *)asn_MAP_T1_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_T1 = { "T1", "T1", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T1_tags_1, sizeof(asn_DEF_T1_tags_1) /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */ asn_DEF_T1_tags_1, /* Same as above */ sizeof(asn_DEF_T1_tags_1) /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T1_1, 1, /* Elements count */ &asn_SPC_T1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [T2] >>> ***/ #include #include /*** <<< DEPS [T2] >>> ***/ /* * Method of determining the components presence */ typedef enum T2_PR { T2_PR_i, /* Member i is present */ } T2_PR; /*** <<< TYPE-DECLS [T2] >>> ***/ typedef struct T2 { INTEGER_t i; /* * This type is extensible, * possible extensions are below. */ /* Presence bitmask: ASN_SET_ISPRESENT(pT2, T2_PR_x) */ unsigned int _presence_map [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T2_t; /*** <<< FUNC-DECLS [T2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T2; /*** <<< STAT-DEFS [T2] >>> ***/ static asn_TYPE_member_t asn_MBR_T2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T2, i), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "i" }, }; static ber_tlv_tag_t asn_DEF_T2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T2_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i at 15 */ }; static uint8_t asn_MAP_T2_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) }; static asn_SET_specifics_t asn_SPC_T2_specs_1 = { sizeof(struct T2), offsetof(struct T2, _asn_ctx), offsetof(struct T2, _presence_map), asn_MAP_T2_tag2el_1, 1, /* Count of tags in the map */ asn_MAP_T2_tag2el_1, /* Same as above */ 1, /* Count of tags in the CXER map */ 1, /* Whether extensible */ (unsigned int *)asn_MAP_T2_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_T2 = { "T2", "T2", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T2_tags_1, sizeof(asn_DEF_T2_tags_1) /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */ asn_DEF_T2_tags_1, /* Same as above */ sizeof(asn_DEF_T2_tags_1) /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T2_1, 1, /* Elements count */ &asn_SPC_T2_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [T3] >>> ***/ #include #include /*** <<< DEPS [T3] >>> ***/ typedef enum T3_PR { T3_PR_NOTHING, /* No components present */ T3_PR_i, /* Extensions may appear below */ } T3_PR; /*** <<< TYPE-DECLS [T3] >>> ***/ typedef struct T3 { T3_PR present; union T3_u { INTEGER_t i; /* * This type is extensible, * possible extensions are below. */ } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T3_t; /*** <<< FUNC-DECLS [T3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T3; /*** <<< STAT-DEFS [T3] >>> ***/ static asn_TYPE_member_t asn_MBR_T3_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T3, choice.i), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "i" }, }; static asn_TYPE_tag2member_t asn_MAP_T3_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i at 16 */ }; static asn_CHOICE_specifics_t asn_SPC_T3_specs_1 = { sizeof(struct T3), offsetof(struct T3, _asn_ctx), offsetof(struct T3, present), sizeof(((struct T3 *)0)->present), asn_MAP_T3_tag2el_1, 1, /* Count of tags in the map */ .canonical_order = 0, .ext_start = 1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_T3 = { "T3", "T3", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_T3_1, 1, /* Elements count */ &asn_SPC_T3_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [T4] >>> ***/ #include #include /*** <<< DEPS [T4] >>> ***/ typedef enum T4_PR { T4_PR_NOTHING, /* No components present */ T4_PR_i, /* Extensions may appear below */ } T4_PR; /*** <<< TYPE-DECLS [T4] >>> ***/ typedef struct T4 { T4_PR present; union T4_u { INTEGER_t i; /* * This type is extensible, * possible extensions are below. */ } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T4_t; /*** <<< FUNC-DECLS [T4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T4; /*** <<< STAT-DEFS [T4] >>> ***/ static asn_TYPE_member_t asn_MBR_T4_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T4, choice.i), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "i" }, }; static asn_TYPE_tag2member_t asn_MAP_T4_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i at 17 */ }; static asn_CHOICE_specifics_t asn_SPC_T4_specs_1 = { sizeof(struct T4), offsetof(struct T4, _asn_ctx), offsetof(struct T4, present), sizeof(((struct T4 *)0)->present), asn_MAP_T4_tag2el_1, 1, /* Count of tags in the map */ .canonical_order = 0, .ext_start = 1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_T4 = { "T4", "T4", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_T4_1, 1, /* Elements count */ &asn_SPC_T4_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/70-xer-test-OK.asn1.-P0000644000000000000000000016432111461230611016741 0ustar rootroot /*** <<< INCLUDES [PDU] >>> ***/ #include "Sequence.h" #include "Set.h" #include "SequenceOf.h" #include "ExtensibleSet.h" #include "ExtensibleSequence.h" #include "ExtensibleSequence2.h" #include "SetOfNULL.h" #include "SetOfREAL.h" #include "SetOfEnums.h" #include "NamedSetOfNULL.h" #include "NamedSetOfREAL.h" #include "NamedSetOfEnums.h" #include "SeqOfZuka.h" #include "SetOfChoice.h" #include "NamedSetOfChoice.h" #include /*** <<< DEPS [PDU] >>> ***/ typedef enum PDU_PR { PDU_PR_NOTHING, /* No components present */ PDU_PR_sequence, PDU_PR_set, PDU_PR_sequenceOf, PDU_PR_extensibleSet, PDU_PR_extensibleSequence, PDU_PR_extensibleSequence2, PDU_PR_setOfNULL, PDU_PR_setOfREAL, PDU_PR_setOfEnums, PDU_PR_namedSetOfNULL, PDU_PR_namedSetOfREAL, PDU_PR_namedSetOfEnums, PDU_PR_seqOfZuka, PDU_PR_setOfChoice, PDU_PR_namedSetOfChoice, /* Extensions may appear below */ } PDU_PR; /*** <<< TYPE-DECLS [PDU] >>> ***/ typedef struct PDU { PDU_PR present; union PDU_u { Sequence_t sequence; Set_t set; SequenceOf_t sequenceOf; ExtensibleSet_t extensibleSet; ExtensibleSequence_t extensibleSequence; ExtensibleSequence2_t extensibleSequence2; SetOfNULL_t setOfNULL; SetOfREAL_t setOfREAL; SetOfEnums_t setOfEnums; NamedSetOfNULL_t namedSetOfNULL; NamedSetOfREAL_t namedSetOfREAL; NamedSetOfEnums_t namedSetOfEnums; SeqOfZuka_t seqOfZuka; SetOfChoice_t setOfChoice; NamedSetOfChoice_t namedSetOfChoice; /* * This type is extensible, * possible extensions are below. */ } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } PDU_t; /*** <<< FUNC-DECLS [PDU] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_PDU; /*** <<< STAT-DEFS [PDU] >>> ***/ static asn_TYPE_member_t asn_MBR_PDU_1[] = { { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.sequence), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "sequence" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.set), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Set, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "set" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.sequenceOf), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_SequenceOf, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "sequenceOf" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.extensibleSet), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_ExtensibleSet, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "extensibleSet" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.extensibleSequence), .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_ExtensibleSequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "extensibleSequence" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.extensibleSequence2), .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_ExtensibleSequence2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "extensibleSequence2" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.setOfNULL), .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_SetOfNULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "setOfNULL" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.setOfREAL), .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_SetOfREAL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "setOfREAL" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.setOfEnums), .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_SetOfEnums, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "setOfEnums" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.namedSetOfNULL), .tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NamedSetOfNULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "namedSetOfNULL" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.namedSetOfREAL), .tag = (ASN_TAG_CLASS_CONTEXT | (10 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NamedSetOfREAL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "namedSetOfREAL" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.namedSetOfEnums), .tag = (ASN_TAG_CLASS_CONTEXT | (11 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NamedSetOfEnums, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "namedSetOfEnums" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.seqOfZuka), .tag = (ASN_TAG_CLASS_CONTEXT | (12 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_SeqOfZuka, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "seqOfZuka" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.setOfChoice), .tag = (ASN_TAG_CLASS_CONTEXT | (13 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_SetOfChoice, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "setOfChoice" }, { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.namedSetOfChoice), .tag = (ASN_TAG_CLASS_CONTEXT | (14 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NamedSetOfChoice, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "namedSetOfChoice" }, }; static asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sequence at 19 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* set at 20 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* sequenceOf at 21 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* extensibleSet at 22 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* extensibleSequence at 23 */ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* extensibleSequence2 at 24 */ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* setOfNULL at 25 */ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* setOfREAL at 26 */ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* setOfEnums at 27 */ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* namedSetOfNULL at 28 */ { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 10, 0, 0 }, /* namedSetOfREAL at 29 */ { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 11, 0, 0 }, /* namedSetOfEnums at 30 */ { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 12, 0, 0 }, /* seqOfZuka at 31 */ { (ASN_TAG_CLASS_CONTEXT | (13 << 2)), 13, 0, 0 }, /* setOfChoice at 32 */ { (ASN_TAG_CLASS_CONTEXT | (14 << 2)), 14, 0, 0 } /* namedSetOfChoice at 33 */ }; static asn_CHOICE_specifics_t asn_SPC_PDU_specs_1 = { sizeof(struct PDU), offsetof(struct PDU, _asn_ctx), offsetof(struct PDU, present), sizeof(((struct PDU *)0)->present), asn_MAP_PDU_tag2el_1, 15, /* Count of tags in the map */ .canonical_order = 0, .ext_start = 15 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_PDU = { "PDU", "PDU", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_PDU_1, 15, /* Elements count */ &asn_SPC_PDU_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Sequence] >>> ***/ #include #include #include #include /*** <<< FWD-DECLS [Sequence] >>> ***/ struct Sequence; /*** <<< TYPE-DECLS [Sequence] >>> ***/ typedef struct Sequence { INTEGER_t integer; struct Sequence *sequence /* OPTIONAL */; BIT_STRING_t *bits /* OPTIONAL */; UTF8String_t string; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Sequence_t; /*** <<< FUNC-DECLS [Sequence] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Sequence; /*** <<< POST-INCLUDE [Sequence] >>> ***/ #include "Sequence.h" /*** <<< STAT-DEFS [Sequence] >>> ***/ static asn_TYPE_member_t asn_MBR_Sequence_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Sequence, integer), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "integer" }, { ATF_POINTER, 2, offsetof(struct Sequence, sequence), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Sequence, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "sequence" }, { ATF_POINTER, 1, offsetof(struct Sequence, bits), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_BIT_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "bits" }, { ATF_NOFLAGS, 0, offsetof(struct Sequence, string), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UTF8String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "string" }, }; static ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* integer at 38 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* sequence at 39 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* bits at 40 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* string at 41 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = { sizeof(struct Sequence), offsetof(struct Sequence, _asn_ctx), asn_MAP_Sequence_tag2el_1, 4, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Sequence = { "Sequence", "Sequence", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Sequence_tags_1, sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ asn_DEF_Sequence_tags_1, /* Same as above */ sizeof(asn_DEF_Sequence_tags_1) /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Sequence_1, 4, /* Elements count */ &asn_SPC_Sequence_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Set] >>> ***/ #include #include #include /*** <<< DEPS [Set] >>> ***/ /* * Method of determining the components presence */ typedef enum Set_PR { Set_PR_roid, /* Member roid is present */ Set_PR_opaque, /* Member opaque is present */ } Set_PR; /*** <<< TYPE-DECLS [Set] >>> ***/ typedef struct Set { RELATIVE_OID_t roid; OCTET_STRING_t *opaque /* OPTIONAL */; /* Presence bitmask: ASN_SET_ISPRESENT(pSet, Set_PR_x) */ unsigned int _presence_map [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Set_t; /*** <<< FUNC-DECLS [Set] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Set; /*** <<< STAT-DEFS [Set] >>> ***/ static asn_TYPE_member_t asn_MBR_Set_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Set, roid), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_RELATIVE_OID, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "roid" }, { ATF_POINTER, 1, offsetof(struct Set, opaque), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_OCTET_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "opaque" }, }; static ber_tlv_tag_t asn_DEF_Set_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Set_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* roid at 45 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* opaque at 46 */ }; static uint8_t asn_MAP_Set_mmap_1[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = { (1 << 7) | (0 << 6) }; static asn_SET_specifics_t asn_SPC_Set_specs_1 = { sizeof(struct Set), offsetof(struct Set, _asn_ctx), offsetof(struct Set, _presence_map), asn_MAP_Set_tag2el_1, 2, /* Count of tags in the map */ asn_MAP_Set_tag2el_1, /* Same as above */ 2, /* Count of tags in the CXER map */ 0, /* Whether extensible */ (unsigned int *)asn_MAP_Set_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_Set = { "Set", "Set", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Set_tags_1, sizeof(asn_DEF_Set_tags_1) /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */ asn_DEF_Set_tags_1, /* Same as above */ sizeof(asn_DEF_Set_tags_1) /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Set_1, 2, /* Elements count */ &asn_SPC_Set_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [ExtensibleSet] >>> ***/ #include #include #include /*** <<< DEPS [ExtensibleSet] >>> ***/ /* * Method of determining the components presence */ typedef enum ExtensibleSet_PR { ExtensibleSet_PR_string, /* Member string is present */ ExtensibleSet_PR_enum, /* Member enum is present */ } ExtensibleSet_PR; typedef enum Enum { enum_b = 0, enum_a = 1 } e_enum; /*** <<< TYPE-DECLS [ExtensibleSet] >>> ***/ typedef struct ExtensibleSet { UTF8String_t *string /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */ ENUMERATED_t *Enum; /* Presence bitmask: ASN_SET_ISPRESENT(pExtensibleSet, ExtensibleSet_PR_x) */ unsigned int _presence_map [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ExtensibleSet_t; /*** <<< FUNC-DECLS [ExtensibleSet] >>> ***/ /* extern asn_TYPE_descriptor_t asn_DEF_enum_4; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_ExtensibleSet; /*** <<< CODE [ExtensibleSet] >>> ***/ static int enum_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void enum_4_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } static void enum_4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { enum_4_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int enum_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { enum_4_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t enum_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { enum_4_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t enum_4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { enum_4_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t enum_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { enum_4_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t enum_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { enum_4_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [ExtensibleSet] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_enum_value2enum_4[] = { { 0, 1, "b" }, { 1, 1, "a" } }; static unsigned int asn_MAP_enum_enum2value_4[] = { 1, /* a(1) */ 0 /* b(0) */ }; static asn_INTEGER_specifics_t asn_SPC_enum_specs_4 = { asn_MAP_enum_value2enum_4, /* "tag" => N; sorted by tag */ asn_MAP_enum_enum2value_4, /* N => "tag"; sorted by N */ 2, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_enum_tags_4[] = { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_enum_4 = { "enum", "enum", enum_4_free, enum_4_print, enum_4_constraint, enum_4_decode_ber, enum_4_encode_der, enum_4_decode_xer, enum_4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_enum_tags_4, sizeof(asn_DEF_enum_tags_4) /sizeof(asn_DEF_enum_tags_4[0]) - 1, /* 1 */ asn_DEF_enum_tags_4, /* Same as above */ sizeof(asn_DEF_enum_tags_4) /sizeof(asn_DEF_enum_tags_4[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_enum_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_ExtensibleSet_1[] = { { ATF_POINTER, 2, offsetof(struct ExtensibleSet, string), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UTF8String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "string" }, { ATF_POINTER, 1, offsetof(struct ExtensibleSet, Enum), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_enum_4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "enum" }, }; static ber_tlv_tag_t asn_DEF_ExtensibleSet_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ExtensibleSet_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* string at 50 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* enum at 52 */ }; static uint8_t asn_MAP_ExtensibleSet_mmap_1[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = { (0 << 7) | (0 << 6) }; static asn_SET_specifics_t asn_SPC_ExtensibleSet_specs_1 = { sizeof(struct ExtensibleSet), offsetof(struct ExtensibleSet, _asn_ctx), offsetof(struct ExtensibleSet, _presence_map), asn_MAP_ExtensibleSet_tag2el_1, 2, /* Count of tags in the map */ asn_MAP_ExtensibleSet_tag2el_1, /* Same as above */ 2, /* Count of tags in the CXER map */ 1, /* Whether extensible */ (unsigned int *)asn_MAP_ExtensibleSet_mmap_1 /* Mandatory elements map */ }; asn_TYPE_descriptor_t asn_DEF_ExtensibleSet = { "ExtensibleSet", "ExtensibleSet", SET_free, SET_print, SET_constraint, SET_decode_ber, SET_encode_der, SET_decode_xer, SET_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ExtensibleSet_tags_1, sizeof(asn_DEF_ExtensibleSet_tags_1) /sizeof(asn_DEF_ExtensibleSet_tags_1[0]), /* 1 */ asn_DEF_ExtensibleSet_tags_1, /* Same as above */ sizeof(asn_DEF_ExtensibleSet_tags_1) /sizeof(asn_DEF_ExtensibleSet_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ExtensibleSet_1, 2, /* Elements count */ &asn_SPC_ExtensibleSet_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [ExtensibleSequence] >>> ***/ #include #include #include #include /*** <<< TYPE-DECLS [ExtensibleSequence] >>> ***/ typedef struct ExtensibleSequence { UTF8String_t *string /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */ INTEGER_t *integer /* OPTIONAL */; GeneralizedTime_t *gtime; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ExtensibleSequence_t; /*** <<< FUNC-DECLS [ExtensibleSequence] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_ExtensibleSequence; /*** <<< STAT-DEFS [ExtensibleSequence] >>> ***/ static asn_TYPE_member_t asn_MBR_ExtensibleSequence_1[] = { { ATF_POINTER, 3, offsetof(struct ExtensibleSequence, string), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UTF8String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "string" }, { ATF_POINTER, 2, offsetof(struct ExtensibleSequence, integer), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "integer" }, { ATF_POINTER, 1, offsetof(struct ExtensibleSequence, gtime), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_GeneralizedTime, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "gtime" }, }; static ber_tlv_tag_t asn_DEF_ExtensibleSequence_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ExtensibleSequence_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* string at 56 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* integer at 58 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* gtime at 59 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ExtensibleSequence_specs_1 = { sizeof(struct ExtensibleSequence), offsetof(struct ExtensibleSequence, _asn_ctx), asn_MAP_ExtensibleSequence_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 0, /* Start extensions */ 4 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_ExtensibleSequence = { "ExtensibleSequence", "ExtensibleSequence", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ExtensibleSequence_tags_1, sizeof(asn_DEF_ExtensibleSequence_tags_1) /sizeof(asn_DEF_ExtensibleSequence_tags_1[0]), /* 1 */ asn_DEF_ExtensibleSequence_tags_1, /* Same as above */ sizeof(asn_DEF_ExtensibleSequence_tags_1) /sizeof(asn_DEF_ExtensibleSequence_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ExtensibleSequence_1, 3, /* Elements count */ &asn_SPC_ExtensibleSequence_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [ExtensibleSequence2] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [ExtensibleSequence2] >>> ***/ typedef struct ExtensibleSequence2 { UTF8String_t *string /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */ INTEGER_t *integer /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ExtensibleSequence2_t; /*** <<< FUNC-DECLS [ExtensibleSequence2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_ExtensibleSequence2; /*** <<< STAT-DEFS [ExtensibleSequence2] >>> ***/ static asn_TYPE_member_t asn_MBR_ExtensibleSequence2_1[] = { { ATF_POINTER, 2, offsetof(struct ExtensibleSequence2, string), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_UTF8String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "string" }, { ATF_POINTER, 1, offsetof(struct ExtensibleSequence2, integer), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "integer" }, }; static ber_tlv_tag_t asn_DEF_ExtensibleSequence2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ExtensibleSequence2_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* string at 63 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* integer at 65 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ExtensibleSequence2_specs_1 = { sizeof(struct ExtensibleSequence2), offsetof(struct ExtensibleSequence2, _asn_ctx), asn_MAP_ExtensibleSequence2_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 0, /* Start extensions */ 3 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_ExtensibleSequence2 = { "ExtensibleSequence2", "ExtensibleSequence2", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ExtensibleSequence2_tags_1, sizeof(asn_DEF_ExtensibleSequence2_tags_1) /sizeof(asn_DEF_ExtensibleSequence2_tags_1[0]), /* 1 */ asn_DEF_ExtensibleSequence2_tags_1, /* Same as above */ sizeof(asn_DEF_ExtensibleSequence2_tags_1) /sizeof(asn_DEF_ExtensibleSequence2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ExtensibleSequence2_1, 2, /* Elements count */ &asn_SPC_ExtensibleSequence2_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SetOfNULL] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [SetOfNULL] >>> ***/ typedef struct SetOfNULL { A_SET_OF(NULL_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SetOfNULL_t; /*** <<< FUNC-DECLS [SetOfNULL] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SetOfNULL; /*** <<< STAT-DEFS [SetOfNULL] >>> ***/ static asn_TYPE_member_t asn_MBR_SetOfNULL_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), .tag_mode = 0, .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_SetOfNULL_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_SetOfNULL_specs_1 = { sizeof(struct SetOfNULL), offsetof(struct SetOfNULL, _asn_ctx), 1, /* XER encoding is XMLValueList */ }; asn_TYPE_descriptor_t asn_DEF_SetOfNULL = { "SetOfNULL", "SetOfNULL", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SetOfNULL_tags_1, sizeof(asn_DEF_SetOfNULL_tags_1) /sizeof(asn_DEF_SetOfNULL_tags_1[0]), /* 1 */ asn_DEF_SetOfNULL_tags_1, /* Same as above */ sizeof(asn_DEF_SetOfNULL_tags_1) /sizeof(asn_DEF_SetOfNULL_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SetOfNULL_1, 1, /* Single element */ &asn_SPC_SetOfNULL_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SetOfREAL] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [SetOfREAL] >>> ***/ typedef struct SetOfREAL { A_SET_OF(REAL_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SetOfREAL_t; /*** <<< FUNC-DECLS [SetOfREAL] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SetOfREAL; /*** <<< STAT-DEFS [SetOfREAL] >>> ***/ static asn_TYPE_member_t asn_MBR_SetOfREAL_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), .tag_mode = 0, .type = &asn_DEF_REAL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_SetOfREAL_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_SetOfREAL_specs_1 = { sizeof(struct SetOfREAL), offsetof(struct SetOfREAL, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_SetOfREAL = { "SetOfREAL", "SetOfREAL", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SetOfREAL_tags_1, sizeof(asn_DEF_SetOfREAL_tags_1) /sizeof(asn_DEF_SetOfREAL_tags_1[0]), /* 1 */ asn_DEF_SetOfREAL_tags_1, /* Same as above */ sizeof(asn_DEF_SetOfREAL_tags_1) /sizeof(asn_DEF_SetOfREAL_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SetOfREAL_1, 1, /* Single element */ &asn_SPC_SetOfREAL_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SetOfEnums] >>> ***/ #include #include #include /*** <<< DEPS [SetOfEnums] >>> ***/ typedef enum Member { Member_one = 0, Member_oneMore = 1 } e_Member; /*** <<< TYPE-DECLS [SetOfEnums] >>> ***/ typedef struct SetOfEnums { A_SET_OF(ENUMERATED_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SetOfEnums_t; /*** <<< FUNC-DECLS [SetOfEnums] >>> ***/ /* extern asn_TYPE_descriptor_t asn_DEF_Member_2; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_SetOfEnums; /*** <<< CODE [SetOfEnums] >>> ***/ static int Member_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void Member_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } static void Member_2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Member_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int Member_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Member_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t Member_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Member_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t Member_2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Member_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t Member_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Member_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t Member_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Member_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [SetOfEnums] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_Member_value2enum_2[] = { { 0, 3, "one" }, { 1, 7, "oneMore" } }; static unsigned int asn_MAP_Member_enum2value_2[] = { 0, /* one(0) */ 1 /* oneMore(1) */ }; static asn_INTEGER_specifics_t asn_SPC_Member_specs_2 = { asn_MAP_Member_value2enum_2, /* "tag" => N; sorted by tag */ asn_MAP_Member_enum2value_2, /* N => "tag"; sorted by N */ 2, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_Member_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_Member_2 = { "ENUMERATED", "ENUMERATED", Member_2_free, Member_2_print, Member_2_constraint, Member_2_decode_ber, Member_2_encode_der, Member_2_decode_xer, Member_2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Member_tags_2, sizeof(asn_DEF_Member_tags_2) /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */ asn_DEF_Member_tags_2, /* Same as above */ sizeof(asn_DEF_Member_tags_2) /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_Member_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_SetOfEnums_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), .tag_mode = 0, .type = &asn_DEF_Member_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_SetOfEnums_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_SetOfEnums_specs_1 = { sizeof(struct SetOfEnums), offsetof(struct SetOfEnums, _asn_ctx), 1, /* XER encoding is XMLValueList */ }; asn_TYPE_descriptor_t asn_DEF_SetOfEnums = { "SetOfEnums", "SetOfEnums", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SetOfEnums_tags_1, sizeof(asn_DEF_SetOfEnums_tags_1) /sizeof(asn_DEF_SetOfEnums_tags_1[0]), /* 1 */ asn_DEF_SetOfEnums_tags_1, /* Same as above */ sizeof(asn_DEF_SetOfEnums_tags_1) /sizeof(asn_DEF_SetOfEnums_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SetOfEnums_1, 1, /* Single element */ &asn_SPC_SetOfEnums_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [NamedSetOfNULL] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [NamedSetOfNULL] >>> ***/ typedef struct NamedSetOfNULL { A_SET_OF(NULL_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } NamedSetOfNULL_t; /*** <<< FUNC-DECLS [NamedSetOfNULL] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NamedSetOfNULL; /*** <<< STAT-DEFS [NamedSetOfNULL] >>> ***/ static asn_TYPE_member_t asn_MBR_NamedSetOfNULL_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), .tag_mode = 0, .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "y" }, }; static ber_tlv_tag_t asn_DEF_NamedSetOfNULL_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_NamedSetOfNULL_specs_1 = { sizeof(struct NamedSetOfNULL), offsetof(struct NamedSetOfNULL, _asn_ctx), 1, /* XER encoding is XMLValueList */ }; asn_TYPE_descriptor_t asn_DEF_NamedSetOfNULL = { "NamedSetOfNULL", "NamedSetOfNULL", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NamedSetOfNULL_tags_1, sizeof(asn_DEF_NamedSetOfNULL_tags_1) /sizeof(asn_DEF_NamedSetOfNULL_tags_1[0]), /* 1 */ asn_DEF_NamedSetOfNULL_tags_1, /* Same as above */ sizeof(asn_DEF_NamedSetOfNULL_tags_1) /sizeof(asn_DEF_NamedSetOfNULL_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_NamedSetOfNULL_1, 1, /* Single element */ &asn_SPC_NamedSetOfNULL_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [NamedSetOfREAL] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [NamedSetOfREAL] >>> ***/ typedef struct NamedSetOfREAL { A_SET_OF(REAL_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } NamedSetOfREAL_t; /*** <<< FUNC-DECLS [NamedSetOfREAL] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NamedSetOfREAL; /*** <<< STAT-DEFS [NamedSetOfREAL] >>> ***/ static asn_TYPE_member_t asn_MBR_NamedSetOfREAL_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), .tag_mode = 0, .type = &asn_DEF_REAL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "name" }, }; static ber_tlv_tag_t asn_DEF_NamedSetOfREAL_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_NamedSetOfREAL_specs_1 = { sizeof(struct NamedSetOfREAL), offsetof(struct NamedSetOfREAL, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_NamedSetOfREAL = { "NamedSetOfREAL", "NamedSetOfREAL", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NamedSetOfREAL_tags_1, sizeof(asn_DEF_NamedSetOfREAL_tags_1) /sizeof(asn_DEF_NamedSetOfREAL_tags_1[0]), /* 1 */ asn_DEF_NamedSetOfREAL_tags_1, /* Same as above */ sizeof(asn_DEF_NamedSetOfREAL_tags_1) /sizeof(asn_DEF_NamedSetOfREAL_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_NamedSetOfREAL_1, 1, /* Single element */ &asn_SPC_NamedSetOfREAL_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [NamedSetOfEnums] >>> ***/ #include #include #include /*** <<< DEPS [NamedSetOfEnums] >>> ***/ typedef enum name { name_one = 0, name_oneMore = 1 } e_name; /*** <<< TYPE-DECLS [NamedSetOfEnums] >>> ***/ typedef struct NamedSetOfEnums { A_SET_OF(ENUMERATED_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } NamedSetOfEnums_t; /*** <<< FUNC-DECLS [NamedSetOfEnums] >>> ***/ /* extern asn_TYPE_descriptor_t asn_DEF_name_2; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_NamedSetOfEnums; /*** <<< CODE [NamedSetOfEnums] >>> ***/ static int name_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void name_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } static void name_2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { name_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int name_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { name_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t name_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { name_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t name_2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { name_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t name_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { name_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t name_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { name_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NamedSetOfEnums] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_name_value2enum_2[] = { { 0, 3, "one" }, { 1, 7, "oneMore" } }; static unsigned int asn_MAP_name_enum2value_2[] = { 0, /* one(0) */ 1 /* oneMore(1) */ }; static asn_INTEGER_specifics_t asn_SPC_name_specs_2 = { asn_MAP_name_value2enum_2, /* "tag" => N; sorted by tag */ asn_MAP_name_enum2value_2, /* N => "tag"; sorted by N */ 2, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_name_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_name_2 = { "ENUMERATED", "ENUMERATED", name_2_free, name_2_print, name_2_constraint, name_2_decode_ber, name_2_encode_der, name_2_decode_xer, name_2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_name_tags_2, sizeof(asn_DEF_name_tags_2) /sizeof(asn_DEF_name_tags_2[0]), /* 1 */ asn_DEF_name_tags_2, /* Same as above */ sizeof(asn_DEF_name_tags_2) /sizeof(asn_DEF_name_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_name_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_NamedSetOfEnums_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), .tag_mode = 0, .type = &asn_DEF_name_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "name" }, }; static ber_tlv_tag_t asn_DEF_NamedSetOfEnums_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_NamedSetOfEnums_specs_1 = { sizeof(struct NamedSetOfEnums), offsetof(struct NamedSetOfEnums, _asn_ctx), 1, /* XER encoding is XMLValueList */ }; asn_TYPE_descriptor_t asn_DEF_NamedSetOfEnums = { "NamedSetOfEnums", "NamedSetOfEnums", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NamedSetOfEnums_tags_1, sizeof(asn_DEF_NamedSetOfEnums_tags_1) /sizeof(asn_DEF_NamedSetOfEnums_tags_1[0]), /* 1 */ asn_DEF_NamedSetOfEnums_tags_1, /* Same as above */ sizeof(asn_DEF_NamedSetOfEnums_tags_1) /sizeof(asn_DEF_NamedSetOfEnums_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_NamedSetOfEnums_1, 1, /* Single element */ &asn_SPC_NamedSetOfEnums_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SequenceOf] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [SequenceOf] >>> ***/ typedef struct SequenceOf { A_SEQUENCE_OF(INTEGER_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SequenceOf_t; /*** <<< FUNC-DECLS [SequenceOf] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SequenceOf; /*** <<< STAT-DEFS [SequenceOf] >>> ***/ static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "id" }, }; static ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = { sizeof(struct SequenceOf), offsetof(struct SequenceOf, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_SequenceOf = { "SequenceOf", "SequenceOf", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SequenceOf_tags_1, sizeof(asn_DEF_SequenceOf_tags_1) /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */ asn_DEF_SequenceOf_tags_1, /* Same as above */ sizeof(asn_DEF_SequenceOf_tags_1) /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SequenceOf_1, 1, /* Single element */ &asn_SPC_SequenceOf_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SeqOfZuka] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [SeqOfZuka] >>> ***/ typedef struct SeqOfZuka { A_SEQUENCE_OF(NULL_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SeqOfZuka_t; /*** <<< FUNC-DECLS [SeqOfZuka] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SeqOfZuka; /*** <<< STAT-DEFS [SeqOfZuka] >>> ***/ static asn_TYPE_member_t asn_MBR_SeqOfZuka_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), .tag_mode = 0, .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "zuka" }, }; static ber_tlv_tag_t asn_DEF_SeqOfZuka_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_SeqOfZuka_specs_1 = { sizeof(struct SeqOfZuka), offsetof(struct SeqOfZuka, _asn_ctx), 1, /* XER encoding is XMLValueList */ }; asn_TYPE_descriptor_t asn_DEF_SeqOfZuka = { "SeqOfZuka", "SeqOfZuka", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SeqOfZuka_tags_1, sizeof(asn_DEF_SeqOfZuka_tags_1) /sizeof(asn_DEF_SeqOfZuka_tags_1[0]), /* 1 */ asn_DEF_SeqOfZuka_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfZuka_tags_1) /sizeof(asn_DEF_SeqOfZuka_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SeqOfZuka_1, 1, /* Single element */ &asn_SPC_SeqOfZuka_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SetOfChoice] >>> ***/ #include #include /*** <<< FWD-DECLS [SetOfChoice] >>> ***/ struct SimpleChoice; /*** <<< TYPE-DECLS [SetOfChoice] >>> ***/ typedef struct SetOfChoice { A_SET_OF(struct SimpleChoice) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SetOfChoice_t; /*** <<< FUNC-DECLS [SetOfChoice] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SetOfChoice; /*** <<< POST-INCLUDE [SetOfChoice] >>> ***/ #include "SimpleChoice.h" /*** <<< STAT-DEFS [SetOfChoice] >>> ***/ static asn_TYPE_member_t asn_MBR_SetOfChoice_1[] = { { ATF_POINTER, 0, 0, .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_SimpleChoice, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_SetOfChoice_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_SetOfChoice_specs_1 = { sizeof(struct SetOfChoice), offsetof(struct SetOfChoice, _asn_ctx), 2, /* XER encoding is XMLValueList */ }; asn_TYPE_descriptor_t asn_DEF_SetOfChoice = { "SetOfChoice", "SetOfChoice", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SetOfChoice_tags_1, sizeof(asn_DEF_SetOfChoice_tags_1) /sizeof(asn_DEF_SetOfChoice_tags_1[0]), /* 1 */ asn_DEF_SetOfChoice_tags_1, /* Same as above */ sizeof(asn_DEF_SetOfChoice_tags_1) /sizeof(asn_DEF_SetOfChoice_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SetOfChoice_1, 1, /* Single element */ &asn_SPC_SetOfChoice_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [NamedSetOfChoice] >>> ***/ #include #include /*** <<< FWD-DECLS [NamedSetOfChoice] >>> ***/ struct SimpleChoice; /*** <<< TYPE-DECLS [NamedSetOfChoice] >>> ***/ typedef struct NamedSetOfChoice { A_SET_OF(struct SimpleChoice) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } NamedSetOfChoice_t; /*** <<< FUNC-DECLS [NamedSetOfChoice] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NamedSetOfChoice; /*** <<< POST-INCLUDE [NamedSetOfChoice] >>> ***/ #include "SimpleChoice.h" /*** <<< STAT-DEFS [NamedSetOfChoice] >>> ***/ static asn_TYPE_member_t asn_MBR_NamedSetOfChoice_1[] = { { ATF_POINTER, 0, 0, .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_SimpleChoice, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "whatever" }, }; static ber_tlv_tag_t asn_DEF_NamedSetOfChoice_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_NamedSetOfChoice_specs_1 = { sizeof(struct NamedSetOfChoice), offsetof(struct NamedSetOfChoice, _asn_ctx), 2, /* XER encoding is XMLValueList */ }; asn_TYPE_descriptor_t asn_DEF_NamedSetOfChoice = { "NamedSetOfChoice", "NamedSetOfChoice", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NamedSetOfChoice_tags_1, sizeof(asn_DEF_NamedSetOfChoice_tags_1) /sizeof(asn_DEF_NamedSetOfChoice_tags_1[0]), /* 1 */ asn_DEF_NamedSetOfChoice_tags_1, /* Same as above */ sizeof(asn_DEF_NamedSetOfChoice_tags_1) /sizeof(asn_DEF_NamedSetOfChoice_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_NamedSetOfChoice_1, 1, /* Single element */ &asn_SPC_NamedSetOfChoice_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SimpleChoice] >>> ***/ #include #include #include /*** <<< DEPS [SimpleChoice] >>> ***/ typedef enum SimpleChoice_PR { SimpleChoice_PR_NOTHING, /* No components present */ SimpleChoice_PR_a, SimpleChoice_PR_b } SimpleChoice_PR; /*** <<< TYPE-DECLS [SimpleChoice] >>> ***/ typedef struct SimpleChoice { SimpleChoice_PR present; union SimpleChoice_u { NULL_t a; INTEGER_t b; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SimpleChoice_t; /*** <<< FUNC-DECLS [SimpleChoice] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SimpleChoice; /*** <<< STAT-DEFS [SimpleChoice] >>> ***/ static asn_TYPE_member_t asn_MBR_SimpleChoice_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SimpleChoice, choice.a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct SimpleChoice, choice.b), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static asn_TYPE_tag2member_t asn_MAP_SimpleChoice_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 79 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* b at 79 */ }; static asn_CHOICE_specifics_t asn_SPC_SimpleChoice_specs_1 = { sizeof(struct SimpleChoice), offsetof(struct SimpleChoice, _asn_ctx), offsetof(struct SimpleChoice, present), sizeof(((struct SimpleChoice *)0)->present), asn_MAP_SimpleChoice_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_SimpleChoice = { "SimpleChoice", "SimpleChoice", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_SimpleChoice_1, 2, /* Elements count */ &asn_SPC_SimpleChoice_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/89-bit-string-enum-OK.asn1.-P0000644000000000000000000000346311461146446020237 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include #include /*** <<< DEPS [T] >>> ***/ typedef enum T_PR { T_PR_NOTHING, /* No components present */ T_PR_bs } T_PR; typedef enum bs { bs_a = 1, bs_b = 2 } e_bs; /*** <<< TYPE-DECLS [T] >>> ***/ typedef struct T { T_PR present; union T_u { BIT_STRING_t bs; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; /*** <<< STAT-DEFS [T] >>> ***/ static asn_TYPE_member_t asn_MBR_T_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T, choice.bs), .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), .tag_mode = 0, .type = &asn_DEF_BIT_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "bs" }, }; static asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* bs at 15 */ }; static asn_CHOICE_specifics_t asn_SPC_T_specs_1 = { sizeof(struct T), offsetof(struct T, _asn_ctx), offsetof(struct T, present), sizeof(((struct T *)0)->present), asn_MAP_T_tag2el_1, 1, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_T_1, 1, /* Elements count */ &asn_SPC_T_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/102-class-ref-SE.asn10000644000000000000000000000061611461147103016643 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .102 ModuleClassMisUse { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 102 } DEFINITIONS ::= BEGIN REF-ID ::= REF-ID2 REF-ID2 ::= REF-ID RefID ::= SEQUENCE { field REF-ID.&id, params REF-ID.&Type } END asn1c-0.9.24+dfsg/tests/11-int-SE.asn10000644000000000000000000000055311461150505015475 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .11 ModuleTestInt5 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 11 } DEFINITIONS ::= BEGIN -- recursive definition loop alpha INTEGER ::= beta beta INTEGER ::= alpha END asn1c-0.9.24+dfsg/tests/45-undefined-type-SE.asn1.-EFfknown-extern-type=KnownExt0000644000000000000000000000025511461146446025510 0ustar rootrootModuleKnownExternType { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 45 } DEFINITIONS ::= BEGIN Type ::= KnownExt END asn1c-0.9.24+dfsg/tests/99-class-sample-OK.asn10000644000000000000000000000220711461147103017307 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .99 ModuleClassSample { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 99 } DEFINITIONS ::= BEGIN SAMPLE-CLASS ::= CLASS { &id RELATIVE-OID UNIQUE, &code ENUMERATED { request, response, status } DEFAULT request, &Type OPTIONAL } WITH SYNTAX { [TYPE &Type] [WITH CODE &code] IDENTIFIED BY &id } SampleClassObjectSet SAMPLE-CLASS ::= { request-Whatever | respond-Stuff | request-Status | request-Salt } request-Whatever SAMPLE-CLASS ::= { IDENTIFIED BY request-whatever } respond-Stuff SAMPLE-CLASS ::= { WITH CODE 1 IDENTIFIED BY response-stuff } request-Status SAMPLE-CLASS ::= { TYPE SampleType WITH CODE 2 IDENTIFIED BY request-id } request-Salt SAMPLE-CLASS ::= { TYPE Salt IDENTIFIED BY request-salt } request-id RELATIVE-OID ::= { 1 1 1 } request-salt RELATIVE-OID ::= { 1 1 1 } request-whatever RELATIVE-OID ::= { 1 1 5 } response-stuff RELATIVE-OID ::= { 2 0 1 } SampleType ::= SEQUENCE { ... } Salt ::= SET { ... } END asn1c-0.9.24+dfsg/tests/59-choice-extended-OK.asn1.-P0000644000000000000000000000632711461146446020242 0ustar rootroot /*** <<< INCLUDES [Choice] >>> ***/ #include #include /*** <<< DEPS [Choice] >>> ***/ typedef enum Choice_PR { Choice_PR_NOTHING, /* No components present */ Choice_PR_a, /* Extensions may appear below */ Choice_PR_b, Choice_PR_c } Choice_PR; /*** <<< FWD-DECLS [Choice] >>> ***/ struct Choice; /*** <<< TYPE-DECLS [Choice] >>> ***/ typedef struct Choice { Choice_PR present; union Choice_u { INTEGER_t a; /* * This type is extensible, * possible extensions are below. */ INTEGER_t b; struct Choice *c; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice_t; /*** <<< FUNC-DECLS [Choice] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice; /*** <<< POST-INCLUDE [Choice] >>> ***/ #include "Choice.h" /*** <<< STAT-DEFS [Choice] >>> ***/ static asn_TYPE_member_t asn_MBR_Choice_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.b), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, { ATF_POINTER, 0, offsetof(struct Choice, choice.c), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Choice, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c" }, }; static ber_tlv_tag_t asn_DEF_Choice_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (123 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 15 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* b at 17 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* c at 19 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = { sizeof(struct Choice), offsetof(struct Choice, _asn_ctx), offsetof(struct Choice, present), sizeof(((struct Choice *)0)->present), asn_MAP_Choice_tag2el_1, 3, /* Count of tags in the map */ .canonical_order = 0, .ext_start = 1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice = { "Choice", "Choice", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, asn_DEF_Choice_tags_1, sizeof(asn_DEF_Choice_tags_1) /sizeof(asn_DEF_Choice_tags_1[0]), /* 1 */ asn_DEF_Choice_tags_1, /* Same as above */ sizeof(asn_DEF_Choice_tags_1) /sizeof(asn_DEF_Choice_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Choice_1, 3, /* Elements count */ &asn_SPC_Choice_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/125-bitstring-constraint-OK.asn1.-EF0000644000000000000000000000040211461146446021532 0ustar rootrootModuleBitStringConstraint { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 125 } DEFINITIONS ::= BEGIN T ::= BIT STRING { flag1(0), flag2(1), flag3(2) } ('000'B | '001'B | '010'B | '011'B) END asn1c-0.9.24+dfsg/tests/91-cond-int-blessSize-OK.asn10000644000000000000000000000075511461147103020375 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .91 ModuleConditionalIntegerType-with-fblessSIZE { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 91 } DEFINITIONS ::= BEGIN OK-Integer1 ::= INTEGER (SIZE(1)) OK-Integer2 ::= INTEGER (SIZE(2)) OK-Integer3 ::= INTEGER (SIZE(3)) OK-Integer4 ::= INTEGER (SIZE(4)) NO-Integer5 ::= INTEGER (SIZE(5)) END asn1c-0.9.24+dfsg/tests/60-any-OK.asn10000644000000000000000000000070311461147103015475 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .60 ModuleTestANY { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 60 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T1 ::= SEQUENCE { i INTEGER, any ANY } T2 ::= SEQUENCE { i INTEGER, any [0] ANY OPTIONAL } T3 ::= SEQUENCE { any1 ANY, any2 ANY } END asn1c-0.9.24+dfsg/tests/121-empty-imports-OK.asn10000644000000000000000000000054111461147103017615 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .121 ModuleEmptyIMPORTS { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 121 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN IMPORTS -- nothing --; Type ::= INTEGER END asn1c-0.9.24+dfsg/tests/49-real-life-OK.asn10000644000000000000000000000074611461147103016564 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .49 ModuleSetChoiceExtensibility { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 49 } DEFINITIONS ::= BEGIN /* * 0.8.17 had problem parsing this module */ EXPORTS TypeA ; IMPORTS TypeB FROM ModuleB TypeC FROM ModuleC ; Z ::= INTEGER -- Can't specify only EXPORTS & IMPOTS END asn1c-0.9.24+dfsg/tests/95-choice-per-order-OK.asn1.-Pgen-PER0000644000000000000000000002117711461146446021457 0ustar rootroot /*** <<< INCLUDES [Choice] >>> ***/ #include #include #include #include #include #include /*** <<< DEPS [Choice] >>> ***/ typedef enum Choice_PR { Choice_PR_NOTHING, /* No components present */ Choice_PR_roid, Choice_PR_bitstr, Choice_PR_ch, /* Extensions may appear below */ Choice_PR_bool } Choice_PR; typedef enum ch_PR { ch_PR_NOTHING, /* No components present */ ch_PR_null, ch_PR_int } ch_PR; /*** <<< TYPE-DECLS [Choice] >>> ***/ typedef struct Choice { Choice_PR present; union Choice_u { RELATIVE_OID_t roid; BIT_STRING_t bitstr; struct ch { ch_PR present; union Choice__ch_u { NULL_t null; INTEGER_t Int; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ch; /* * This type is extensible, * possible extensions are below. */ BOOLEAN_t bool; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice_t; /*** <<< FUNC-DECLS [Choice] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice; /*** <<< CTDEFS [Choice] >>> ***/ static asn_per_constraints_t asn_PER_type_ch_constr_4 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_type_Choice_constr_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Choice] >>> ***/ static asn_TYPE_member_t asn_MBR_ch_4[] = { { ATF_NOFLAGS, 0, offsetof(struct ch, choice.null), .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), .tag_mode = 0, .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "null" }, { ATF_NOFLAGS, 0, offsetof(struct ch, choice.Int), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "int" }, }; static int asn_MAP_ch_cmap_4[] = { 1, 0 }; static asn_TYPE_tag2member_t asn_MAP_ch_tag2el_4[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* int at 20 */ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 0, 0, 0 } /* null at 18 */ }; static asn_CHOICE_specifics_t asn_SPC_ch_specs_4 = { sizeof(struct ch), offsetof(struct ch, _asn_ctx), offsetof(struct ch, present), sizeof(((struct ch *)0)->present), asn_MAP_ch_tag2el_4, 2, /* Count of tags in the map */ .canonical_order = asn_MAP_ch_cmap_4, /* Canonically sorted */ .ext_start = -1 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_ch_4 = { "ch", "ch", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, CHOICE_decode_uper, CHOICE_encode_uper, CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ &asn_PER_type_ch_constr_4, asn_MBR_ch_4, 2, /* Elements count */ &asn_SPC_ch_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Choice_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.roid), .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), .tag_mode = 0, .type = &asn_DEF_RELATIVE_OID, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "roid" }, { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bitstr), .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), .tag_mode = 0, .type = &asn_DEF_BIT_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "bitstr" }, { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ch), .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_ch_4, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "ch" }, { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bool), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "bool" }, }; static int asn_MAP_Choice_cmap_1[] = { 2, 1, 0, 3 }; static asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool at 22 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 0 }, /* int at 20 */ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 1, 0, 0 }, /* bitstr at 16 */ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 2, 0, 0 }, /* null at 18 */ { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 } /* roid at 15 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = { sizeof(struct Choice), offsetof(struct Choice, _asn_ctx), offsetof(struct Choice, present), sizeof(((struct Choice *)0)->present), asn_MAP_Choice_tag2el_1, 5, /* Count of tags in the map */ .canonical_order = asn_MAP_Choice_cmap_1, /* Canonically sorted */ .ext_start = 3 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice = { "Choice", "Choice", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, CHOICE_decode_uper, CHOICE_encode_uper, CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ &asn_PER_type_Choice_constr_1, asn_MBR_Choice_1, 4, /* Elements count */ &asn_SPC_Choice_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Choice2] >>> ***/ #include #include #include /*** <<< DEPS [Choice2] >>> ***/ typedef enum Choice2_PR { Choice2_PR_NOTHING, /* No components present */ Choice2_PR_bitstr, Choice2_PR_roid } Choice2_PR; /*** <<< TYPE-DECLS [Choice2] >>> ***/ typedef struct Choice2 { Choice2_PR present; union Choice2_u { BIT_STRING_t bitstr; RELATIVE_OID_t roid; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Choice2_t; /*** <<< FUNC-DECLS [Choice2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Choice2; /*** <<< CTDEFS [Choice2] >>> ***/ static asn_per_constraints_t asn_PER_type_Choice2_constr_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; /*** <<< STAT-DEFS [Choice2] >>> ***/ static asn_TYPE_member_t asn_MBR_Choice2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.bitstr), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_BIT_STRING, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "bitstr" }, { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.roid), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_RELATIVE_OID, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, .name = "roid" }, }; static asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bitstr at 26 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* roid at 27 */ }; static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = { sizeof(struct Choice2), offsetof(struct Choice2, _asn_ctx), offsetof(struct Choice2, present), sizeof(((struct Choice2 *)0)->present), asn_MAP_Choice2_tag2el_1, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_Choice2 = { "Choice2", "Choice2", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, CHOICE_decode_uper, CHOICE_encode_uper, CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ &asn_PER_type_Choice2_constr_1, asn_MBR_Choice2_1, 2, /* Elements count */ &asn_SPC_Choice2_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/34-class-OK.asn1.-EFprint-class-matrix0000644000000000000000000000177011461146446022062 0ustar rootrootModuleTestClassSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 34 } DEFINITIONS IMPLICIT TAGS ::= BEGIN EXTENSION ::= CLASS { &id [PRIVATE 0] INTEGER UNIQUE, &ExtnType } WITH SYNTAX { SYNTAX &ExtnType IDENTIFIED BY &id } -- Class matrix is empty Ext1 ::= SEQUENCE { extnId EXTENSION.&id } EXTENSION-ATTRIBUTE ::= CLASS { &id INTEGER (0..256) UNIQUE, &Type ANY } WITH SYNTAX {&Type IDENTIFIED BY &id} -- Class matrix has 1 entry: -- [ &id][ &Type] -- [1] 23 TerminalType terminal-type EXTENSION-ATTRIBUTE ::= {TerminalType IDENTIFIED BY 23} TerminalType ::= INTEGER { terminal(0) } ExtensionAttribute ::= SEQUENCE { extension-attribute-type [0] IMPLICIT EXTENSION-ATTRIBUTE.&id ({ExtensionAttributeTable}), extension-attribute-value [1] EXPLICIT EXTENSION-ATTRIBUTE.&Type ({ExtensionAttributeTable}{@extension-attribute-type}) } ub-extension-attributes INTEGER ::= 256 END asn1c-0.9.24+dfsg/tests/02-garbage-NP.asn10000644000000000000000000000051611461147103016300 0ustar rootroot -- NP: Non-parseable. -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .2 ModuleTestGarbage { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 2 } DEFINITIONS ::= BEGIN -- must fail on the next line -- some garbage END asn1c-0.9.24+dfsg/tests/03-enum-OK.asn1.-P0000644000000000000000000005634212015121740016127 0ustar rootroot /*** <<< INCLUDES [Enum1] >>> ***/ #include /*** <<< DEPS [Enum1] >>> ***/ typedef enum Enum1 { Enum1_red = 0, Enum1_green = 1, Enum1_blue = 4, Enum1_alpha = 5 /* * Enumeration is extensible */ } e_Enum1; /*** <<< TYPE-DECLS [Enum1] >>> ***/ typedef ENUMERATED_t Enum1_t; /*** <<< FUNC-DECLS [Enum1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Enum1; asn_struct_free_f Enum1_free; asn_struct_print_f Enum1_print; asn_constr_check_f Enum1_constraint; ber_type_decoder_f Enum1_decode_ber; der_type_encoder_f Enum1_encode_der; xer_type_decoder_f Enum1_decode_xer; xer_type_encoder_f Enum1_encode_xer; /*** <<< CODE [Enum1] >>> ***/ int Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } void Enum1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Enum1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Enum1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Enum1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Enum1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Enum1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Enum1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Enum1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Enum1] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = { { 0, 3, "red" }, { 1, 5, "green" }, { 4, 4, "blue" }, { 5, 5, "alpha" } /* This list is extensible */ }; static unsigned int asn_MAP_Enum1_enum2value_1[] = { 3, /* alpha(5) */ 2, /* blue(4) */ 1, /* green(1) */ 0 /* red(0) */ /* This list is extensible */ }; static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = { asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */ 4, /* Number of elements in the maps */ 5, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Enum1 = { "Enum1", "Enum1", Enum1_free, Enum1_print, Enum1_constraint, Enum1_decode_ber, Enum1_encode_der, Enum1_decode_xer, Enum1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Enum1_tags_1, sizeof(asn_DEF_Enum1_tags_1) /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ asn_DEF_Enum1_tags_1, /* Same as above */ sizeof(asn_DEF_Enum1_tags_1) /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_Enum1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Enum2] >>> ***/ #include /*** <<< DEPS [Enum2] >>> ***/ typedef enum Enum2 { Enum2_red = 0, Enum2_green = 1, Enum2_blue = 45, Enum2_orange = 23, Enum2_alpha = 46, /* * Enumeration is extensible */ Enum2_beta = 12, Enum2_gamma = 103 } e_Enum2; /*** <<< TYPE-DECLS [Enum2] >>> ***/ typedef ENUMERATED_t Enum2_t; /*** <<< FUNC-DECLS [Enum2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Enum2; asn_struct_free_f Enum2_free; asn_struct_print_f Enum2_print; asn_constr_check_f Enum2_constraint; ber_type_decoder_f Enum2_decode_ber; der_type_encoder_f Enum2_encode_der; xer_type_decoder_f Enum2_decode_xer; xer_type_encoder_f Enum2_encode_xer; /*** <<< CODE [Enum2] >>> ***/ int Enum2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void Enum2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } void Enum2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Enum2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Enum2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Enum2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Enum2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Enum2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Enum2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Enum2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Enum2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Enum2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Enum2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Enum2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Enum2] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_Enum2_value2enum_1[] = { { 0, 3, "red" }, { 1, 5, "green" }, { 12, 4, "beta" }, { 23, 6, "orange" }, { 45, 4, "blue" }, { 46, 5, "alpha" }, { 103, 5, "gamma" } /* This list is extensible */ }; static unsigned int asn_MAP_Enum2_enum2value_1[] = { 5, /* alpha(46) */ 2, /* beta(12) */ 4, /* blue(45) */ 6, /* gamma(103) */ 1, /* green(1) */ 3, /* orange(23) */ 0 /* red(0) */ /* This list is extensible */ }; static asn_INTEGER_specifics_t asn_SPC_Enum2_specs_1 = { asn_MAP_Enum2_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_Enum2_enum2value_1, /* N => "tag"; sorted by N */ 7, /* Number of elements in the maps */ 6, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_Enum2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Enum2 = { "Enum2", "Enum2", Enum2_free, Enum2_print, Enum2_constraint, Enum2_decode_ber, Enum2_encode_der, Enum2_decode_xer, Enum2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Enum2_tags_1, sizeof(asn_DEF_Enum2_tags_1) /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */ asn_DEF_Enum2_tags_1, /* Same as above */ sizeof(asn_DEF_Enum2_tags_1) /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_Enum2_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Enum3] >>> ***/ #include /*** <<< DEPS [Enum3] >>> ***/ typedef enum Enum3 { Enum3_a = 0, Enum3_b = 3, /* * Enumeration is extensible */ Enum3_c = 1 } e_Enum3; /*** <<< TYPE-DECLS [Enum3] >>> ***/ typedef ENUMERATED_t Enum3_t; /*** <<< FUNC-DECLS [Enum3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Enum3; asn_struct_free_f Enum3_free; asn_struct_print_f Enum3_print; asn_constr_check_f Enum3_constraint; ber_type_decoder_f Enum3_decode_ber; der_type_encoder_f Enum3_encode_der; xer_type_decoder_f Enum3_decode_xer; xer_type_encoder_f Enum3_encode_xer; /*** <<< CODE [Enum3] >>> ***/ int Enum3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void Enum3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } void Enum3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Enum3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Enum3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Enum3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Enum3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Enum3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Enum3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Enum3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Enum3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Enum3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Enum3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Enum3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Enum3] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_Enum3_value2enum_1[] = { { 0, 1, "a" }, { 1, 1, "c" }, { 3, 1, "b" } /* This list is extensible */ }; static unsigned int asn_MAP_Enum3_enum2value_1[] = { 0, /* a(0) */ 2, /* b(3) */ 1 /* c(1) */ /* This list is extensible */ }; static asn_INTEGER_specifics_t asn_SPC_Enum3_specs_1 = { asn_MAP_Enum3_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_Enum3_enum2value_1, /* N => "tag"; sorted by N */ 3, /* Number of elements in the maps */ 3, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_Enum3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Enum3 = { "Enum3", "Enum3", Enum3_free, Enum3_print, Enum3_constraint, Enum3_decode_ber, Enum3_encode_der, Enum3_decode_xer, Enum3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Enum3_tags_1, sizeof(asn_DEF_Enum3_tags_1) /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */ asn_DEF_Enum3_tags_1, /* Same as above */ sizeof(asn_DEF_Enum3_tags_1) /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_Enum3_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Enum4] >>> ***/ #include /*** <<< DEPS [Enum4] >>> ***/ typedef enum Enum4 { Enum4_a = 0, Enum4_b = 1, /* * Enumeration is extensible */ Enum4_c = 3, Enum4_d = 4 } e_Enum4; /*** <<< TYPE-DECLS [Enum4] >>> ***/ typedef ENUMERATED_t Enum4_t; /*** <<< FUNC-DECLS [Enum4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Enum4; asn_struct_free_f Enum4_free; asn_struct_print_f Enum4_print; asn_constr_check_f Enum4_constraint; ber_type_decoder_f Enum4_decode_ber; der_type_encoder_f Enum4_encode_der; xer_type_decoder_f Enum4_decode_xer; xer_type_encoder_f Enum4_encode_xer; /*** <<< CODE [Enum4] >>> ***/ int Enum4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void Enum4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } void Enum4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Enum4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Enum4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Enum4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Enum4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Enum4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Enum4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Enum4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Enum4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Enum4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Enum4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Enum4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Enum4] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_Enum4_value2enum_1[] = { { 0, 1, "a" }, { 1, 1, "b" }, { 3, 1, "c" }, { 4, 1, "d" } /* This list is extensible */ }; static unsigned int asn_MAP_Enum4_enum2value_1[] = { 0, /* a(0) */ 1, /* b(1) */ 2, /* c(3) */ 3 /* d(4) */ /* This list is extensible */ }; static asn_INTEGER_specifics_t asn_SPC_Enum4_specs_1 = { asn_MAP_Enum4_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_Enum4_enum2value_1, /* N => "tag"; sorted by N */ 4, /* Number of elements in the maps */ 3, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_Enum4_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Enum4 = { "Enum4", "Enum4", Enum4_free, Enum4_print, Enum4_constraint, Enum4_decode_ber, Enum4_encode_der, Enum4_decode_xer, Enum4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Enum4_tags_1, sizeof(asn_DEF_Enum4_tags_1) /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */ asn_DEF_Enum4_tags_1, /* Same as above */ sizeof(asn_DEF_Enum4_tags_1) /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_Enum4_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Enum5] >>> ***/ #include /*** <<< DEPS [Enum5] >>> ***/ typedef enum Enum5 { Enum5_a = 0, Enum5_z = 25, /* * Enumeration is extensible */ Enum5_d = 26 } e_Enum5; /*** <<< TYPE-DECLS [Enum5] >>> ***/ typedef ENUMERATED_t Enum5_t; /*** <<< FUNC-DECLS [Enum5] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Enum5; asn_struct_free_f Enum5_free; asn_struct_print_f Enum5_print; asn_constr_check_f Enum5_constraint; ber_type_decoder_f Enum5_decode_ber; der_type_encoder_f Enum5_encode_der; xer_type_decoder_f Enum5_decode_xer; xer_type_encoder_f Enum5_encode_xer; /*** <<< CODE [Enum5] >>> ***/ int Enum5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void Enum5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } void Enum5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Enum5_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Enum5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Enum5_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Enum5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Enum5_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Enum5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Enum5_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Enum5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Enum5_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Enum5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Enum5_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Enum5] >>> ***/ static asn_INTEGER_enum_map_t asn_MAP_Enum5_value2enum_1[] = { { 0, 1, "a" }, { 25, 1, "z" }, { 26, 1, "d" } /* This list is extensible */ }; static unsigned int asn_MAP_Enum5_enum2value_1[] = { 0, /* a(0) */ 2, /* d(26) */ 1 /* z(25) */ /* This list is extensible */ }; static asn_INTEGER_specifics_t asn_SPC_Enum5_specs_1 = { asn_MAP_Enum5_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_Enum5_enum2value_1, /* N => "tag"; sorted by N */ 3, /* Number of elements in the maps */ 3, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_Enum5_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Enum5 = { "Enum5", "Enum5", Enum5_free, Enum5_print, Enum5_constraint, Enum5_decode_ber, Enum5_encode_der, Enum5_decode_xer, Enum5_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Enum5_tags_1, sizeof(asn_DEF_Enum5_tags_1) /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */ asn_DEF_Enum5_tags_1, /* Same as above */ sizeof(asn_DEF_Enum5_tags_1) /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_Enum5_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/125-bitstring-constraint-OK.asn1.-X0000644000000000000000000000044011461146446021451 0ustar rootroot asn1c-0.9.24+dfsg/tests/57-components-of-OK.asn10000644000000000000000000000134111461147103017502 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .57 ModuleTestComponentsOfCrossModule1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 57 1 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN SecondType ::= SEQUENCE { a IA5String, COMPONENTS OF ModuleTestComponentsOfCrossModule2.OneType, b UniversalString } END ModuleTestComponentsOfCrossModule2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 57 2 } DEFINITIONS EXPLICIT TAGS ::= BEGIN OneType ::= SEQUENCE { x T1, y T2, z T3 } T1 ::= INTEGER T2 ::= INTEGER T3 ::= INTEGER END asn1c-0.9.24+dfsg/tests/121-empty-imports-OK.asn1.-EF0000644000000000000000000000027111461146446020174 0ustar rootrootModuleEmptyIMPORTS { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 121 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN Type ::= INTEGER END asn1c-0.9.24+dfsg/tests/95-choice-per-order-OK.asn10000644000000000000000000000100211461147103020036 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .95 ModuleCHOICE-PER-Ordering { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 95 } DEFINITIONS ::= BEGIN Choice ::= CHOICE { roid RELATIVE-OID, bitstr BIT STRING, ch CHOICE { null NULL, int INTEGER }, ..., bool BOOLEAN } Choice2 ::= CHOICE { bitstr [0] BIT STRING, roid [1] RELATIVE-OID } END asn1c-0.9.24+dfsg/tests/20-constr-OK.asn1.-EF0000644000000000000000000000067211461146446016576 0ustar rootrootModuleTestConstr { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 20 } DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::= BEGIN ConstructedType1 ::= SEQUENCE { a [1] IMPLICIT INTEGER, b [2] IMPLICIT INTEGER, d UTF8String, ...!ex1, c IA5String } ConstructedType2 ::= SET { a [1] IMPLICIT INTEGER, b [2] IMPLICIT INTEGER, ... } ex1 INTEGER ::= 1 END asn1c-0.9.24+dfsg/tests/39-sequence-of-OK.asn1.-P0000644000000000000000000001404411461150505017404 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include #include #include #include /*** <<< FWD-DECLS [T] >>> ***/ struct T2; /*** <<< TYPE-DECLS [T] >>> ***/ typedef struct T { INTEGER_t Int; struct collection { A_SEQUENCE_OF(struct T2) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } collection; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; /*** <<< POST-INCLUDE [T] >>> ***/ #include "T2.h" /*** <<< STAT-DEFS [T] >>> ***/ static asn_TYPE_member_t asn_MBR_collection_3[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_T2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_collection_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_collection_specs_3 = { sizeof(struct collection), offsetof(struct collection, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_collection_3 = { "collection", "collection", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_collection_tags_3, sizeof(asn_DEF_collection_tags_3) /sizeof(asn_DEF_collection_tags_3[0]), /* 1 */ asn_DEF_collection_tags_3, /* Same as above */ sizeof(asn_DEF_collection_tags_3) /sizeof(asn_DEF_collection_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_collection_3, 1, /* Single element */ &asn_SPC_collection_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_T_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T, Int), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "int" }, { ATF_NOFLAGS, 0, offsetof(struct T, collection), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_collection_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "collection" }, }; static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int at 15 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* collection at 17 */ }; static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = { sizeof(struct T), offsetof(struct T, _asn_ctx), asn_MAP_T_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T_1, 2, /* Elements count */ &asn_SPC_T_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [T2] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [T2] >>> ***/ typedef struct T2 { BOOLEAN_t flag; UTF8String_t str; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T2_t; /*** <<< FUNC-DECLS [T2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T2; /*** <<< STAT-DEFS [T2] >>> ***/ static asn_TYPE_member_t asn_MBR_T2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T2, flag), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "flag" }, { ATF_NOFLAGS, 0, offsetof(struct T2, str), .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), .tag_mode = 0, .type = &asn_DEF_UTF8String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "str" }, }; static ber_tlv_tag_t asn_DEF_T2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T2_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* flag at 20 */ { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 } /* str at 21 */ }; static asn_SEQUENCE_specifics_t asn_SPC_T2_specs_1 = { sizeof(struct T2), offsetof(struct T2, _asn_ctx), asn_MAP_T2_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_T2 = { "T2", "T2", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T2_tags_1, sizeof(asn_DEF_T2_tags_1) /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */ asn_DEF_T2_tags_1, /* Same as above */ sizeof(asn_DEF_T2_tags_1) /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T2_1, 2, /* Elements count */ &asn_SPC_T2_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/87-old-syntax-OK.asn10000644000000000000000000000066511461147103017030 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .87 ModuleObsoleteSyntax { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 87 } DEFINITIONS ::= BEGIN Tc ::= CHOICE { INTEGER, BOOLEAN } Ts ::= SET { INTEGER, BOOLEAN, SEQUENCE { OBJECT IDENTIFIER, RELATIVE-OID, Tc } } END asn1c-0.9.24+dfsg/tests/48-real-life-OK.asn10000644000000000000000000000066111461147103016557 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .48 ModuleSetChoiceExtensibility { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 48 } DEFINITIONS ::= BEGIN /* * 0.8.14 had problem saving/reloading this object */ UserIdentifier ::= CHOICE { phoneNumber [3] EXPLICIT IA5String } END asn1c-0.9.24+dfsg/tests/Makefile.am0000644000000000000000000000002611461146446015433 0ustar rootroot EXTRA_DIST = *.asn1* asn1c-0.9.24+dfsg/tests/61-any-1-SE.asn10000644000000000000000000000052511461147103015634 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .61 ModuleTestBadANY1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 61 } DEFINITIONS ::= BEGIN T ::= SEQUENCE { i1 INTEGER OPTIONAL, any ANY } END asn1c-0.9.24+dfsg/tests/18-class-OK.asn10000644000000000000000000000146711461147103016026 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .18 ModuleTestClass { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 18 } DEFINITIONS ::= BEGIN AlphaNumeric ::= IA5String (FROM ("A".."Z"|"a".."z"|"0".."9")) FUNCTION ::= CLASS { &code INTEGER (0..MAX) UNIQUE, &Alphabet IA5String DEFAULT {AlphaNumeric}, &ArgType , &SupportedArguments &ArgType OPTIONAL, &ResultType DEFAULT NULL, &result-if-error &ResultType DEFAULT NULL, &associated-function FUNCTION OPTIONAL } operator-plus FUNCTION ::= { &ArgType Pair, &SupportedArguments { PosPair | NegPair } &ResultType INTEGER, &result-if-error 0, &code 1 } FunctionCodeType ::= FUNCTION.&code END asn1c-0.9.24+dfsg/tests/65-multi-tag-OK.asn1.-Pfnative-types0000644000000000000000000007101511461146446021625 0ustar rootroot /*** <<< INCLUDES [T1] >>> ***/ #include "T2.h" /*** <<< TYPE-DECLS [T1] >>> ***/ typedef T2_t T1_t; /*** <<< FUNC-DECLS [T1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T1; asn_struct_free_f T1_free; asn_struct_print_f T1_print; asn_constr_check_f T1_constraint; ber_type_decoder_f T1_decode_ber; der_type_encoder_f T1_encode_der; xer_type_decoder_f T1_decode_xer; xer_type_encoder_f T1_encode_xer; /*** <<< CODE [T1] >>> ***/ int T1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_T2.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using T2, * so here we adjust the DEF accordingly. */ static void T1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_T2.free_struct; td->print_struct = asn_DEF_T2.print_struct; td->ber_decoder = asn_DEF_T2.ber_decoder; td->der_encoder = asn_DEF_T2.der_encoder; td->xer_decoder = asn_DEF_T2.xer_decoder; td->xer_encoder = asn_DEF_T2.xer_encoder; td->uper_decoder = asn_DEF_T2.uper_decoder; td->uper_encoder = asn_DEF_T2.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_T2.per_constraints; td->elements = asn_DEF_T2.elements; td->elements_count = asn_DEF_T2.elements_count; td->specifics = asn_DEF_T2.specifics; } void T1_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T1_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T1_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T1_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T1_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T1_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T1_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T1_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T1] >>> ***/ static ber_tlv_tag_t asn_DEF_T1_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)) }; static ber_tlv_tag_t asn_DEF_T1_all_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (5 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T1 = { "T1", "T1", T1_free, T1_print, T1_constraint, T1_decode_ber, T1_encode_der, T1_decode_xer, T1_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T1_tags_1, sizeof(asn_DEF_T1_tags_1) /sizeof(asn_DEF_T1_tags_1[0]), /* 4 */ asn_DEF_T1_all_tags_1, sizeof(asn_DEF_T1_all_tags_1) /sizeof(asn_DEF_T1_all_tags_1[0]), /* 6 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T2] >>> ***/ #include "T3.h" /*** <<< TYPE-DECLS [T2] >>> ***/ typedef T3_t T2_t; /*** <<< FUNC-DECLS [T2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T2; asn_struct_free_f T2_free; asn_struct_print_f T2_print; asn_constr_check_f T2_constraint; ber_type_decoder_f T2_decode_ber; der_type_encoder_f T2_encode_der; xer_type_decoder_f T2_decode_xer; xer_type_encoder_f T2_encode_xer; /*** <<< CODE [T2] >>> ***/ int T2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_T3.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using T3, * so here we adjust the DEF accordingly. */ static void T2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_T3.free_struct; td->print_struct = asn_DEF_T3.print_struct; td->ber_decoder = asn_DEF_T3.ber_decoder; td->der_encoder = asn_DEF_T3.der_encoder; td->xer_decoder = asn_DEF_T3.xer_decoder; td->xer_encoder = asn_DEF_T3.xer_encoder; td->uper_decoder = asn_DEF_T3.uper_decoder; td->uper_encoder = asn_DEF_T3.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_T3.per_constraints; td->elements = asn_DEF_T3.elements; td->elements_count = asn_DEF_T3.elements_count; td->specifics = asn_DEF_T3.specifics; } void T2_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T2_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T2_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T2_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T2_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T2_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T2_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T2_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T2] >>> ***/ static ber_tlv_tag_t asn_DEF_T2_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)) }; static ber_tlv_tag_t asn_DEF_T2_all_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (5 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T2 = { "T2", "T2", T2_free, T2_print, T2_constraint, T2_decode_ber, T2_encode_der, T2_decode_xer, T2_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T2_tags_1, sizeof(asn_DEF_T2_tags_1) /sizeof(asn_DEF_T2_tags_1[0]), /* 3 */ asn_DEF_T2_all_tags_1, sizeof(asn_DEF_T2_all_tags_1) /sizeof(asn_DEF_T2_all_tags_1[0]), /* 5 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T3] >>> ***/ #include "T4.h" /*** <<< TYPE-DECLS [T3] >>> ***/ typedef T4_t T3_t; /*** <<< FUNC-DECLS [T3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T3; asn_struct_free_f T3_free; asn_struct_print_f T3_print; asn_constr_check_f T3_constraint; ber_type_decoder_f T3_decode_ber; der_type_encoder_f T3_encode_der; xer_type_decoder_f T3_decode_xer; xer_type_encoder_f T3_encode_xer; /*** <<< CODE [T3] >>> ***/ int T3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_T4.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using T4, * so here we adjust the DEF accordingly. */ static void T3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_T4.free_struct; td->print_struct = asn_DEF_T4.print_struct; td->ber_decoder = asn_DEF_T4.ber_decoder; td->der_encoder = asn_DEF_T4.der_encoder; td->xer_decoder = asn_DEF_T4.xer_decoder; td->xer_encoder = asn_DEF_T4.xer_encoder; td->uper_decoder = asn_DEF_T4.uper_decoder; td->uper_encoder = asn_DEF_T4.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_T4.per_constraints; td->elements = asn_DEF_T4.elements; td->elements_count = asn_DEF_T4.elements_count; td->specifics = asn_DEF_T4.specifics; } void T3_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T3_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T3_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T3_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T3_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T3_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T3_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T3_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T3] >>> ***/ static ber_tlv_tag_t asn_DEF_T3_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)) }; static ber_tlv_tag_t asn_DEF_T3_all_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), (ASN_TAG_CLASS_CONTEXT | (5 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T3 = { "T3", "T3", T3_free, T3_print, T3_constraint, T3_decode_ber, T3_encode_der, T3_decode_xer, T3_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T3_tags_1, sizeof(asn_DEF_T3_tags_1) /sizeof(asn_DEF_T3_tags_1[0]), /* 2 */ asn_DEF_T3_all_tags_1, sizeof(asn_DEF_T3_all_tags_1) /sizeof(asn_DEF_T3_all_tags_1[0]), /* 4 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T4] >>> ***/ #include "T5.h" /*** <<< TYPE-DECLS [T4] >>> ***/ typedef T5_t T4_t; /*** <<< FUNC-DECLS [T4] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T4; asn_struct_free_f T4_free; asn_struct_print_f T4_print; asn_constr_check_f T4_constraint; ber_type_decoder_f T4_decode_ber; der_type_encoder_f T4_encode_der; xer_type_decoder_f T4_decode_xer; xer_type_encoder_f T4_encode_xer; /*** <<< CODE [T4] >>> ***/ int T4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_T5.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using T5, * so here we adjust the DEF accordingly. */ static void T4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_T5.free_struct; td->print_struct = asn_DEF_T5.print_struct; td->ber_decoder = asn_DEF_T5.ber_decoder; td->der_encoder = asn_DEF_T5.der_encoder; td->xer_decoder = asn_DEF_T5.xer_decoder; td->xer_encoder = asn_DEF_T5.xer_encoder; td->uper_decoder = asn_DEF_T5.uper_decoder; td->uper_encoder = asn_DEF_T5.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_T5.per_constraints; td->elements = asn_DEF_T5.elements; td->elements_count = asn_DEF_T5.elements_count; td->specifics = asn_DEF_T5.specifics; } void T4_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T4_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T4_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T4_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T4_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T4_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T4_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T4_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T4] >>> ***/ static ber_tlv_tag_t asn_DEF_T4_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), (ASN_TAG_CLASS_CONTEXT | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T4 = { "T4", "T4", T4_free, T4_print, T4_constraint, T4_decode_ber, T4_encode_der, T4_decode_xer, T4_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T4_tags_1, sizeof(asn_DEF_T4_tags_1) /sizeof(asn_DEF_T4_tags_1[0]) - 1, /* 2 */ asn_DEF_T4_tags_1, /* Same as above */ sizeof(asn_DEF_T4_tags_1) /sizeof(asn_DEF_T4_tags_1[0]), /* 3 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T5] >>> ***/ #include "T6.h" /*** <<< TYPE-DECLS [T5] >>> ***/ typedef T6_t T5_t; /*** <<< FUNC-DECLS [T5] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T5; asn_struct_free_f T5_free; asn_struct_print_f T5_print; asn_constr_check_f T5_constraint; ber_type_decoder_f T5_decode_ber; der_type_encoder_f T5_encode_der; xer_type_decoder_f T5_decode_xer; xer_type_encoder_f T5_encode_xer; /*** <<< CODE [T5] >>> ***/ int T5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_T6.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using T6, * so here we adjust the DEF accordingly. */ static void T5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_T6.free_struct; td->print_struct = asn_DEF_T6.print_struct; td->ber_decoder = asn_DEF_T6.ber_decoder; td->der_encoder = asn_DEF_T6.der_encoder; td->xer_decoder = asn_DEF_T6.xer_decoder; td->xer_encoder = asn_DEF_T6.xer_encoder; td->uper_decoder = asn_DEF_T6.uper_decoder; td->uper_encoder = asn_DEF_T6.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_T6.per_constraints; td->elements = asn_DEF_T6.elements; td->elements_count = asn_DEF_T6.elements_count; td->specifics = asn_DEF_T6.specifics; } void T5_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T5_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T5_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T5_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T5_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T5_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T5_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T5_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T5] >>> ***/ static ber_tlv_tag_t asn_DEF_T5_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T5 = { "T5", "T5", T5_free, T5_print, T5_constraint, T5_decode_ber, T5_encode_der, T5_decode_xer, T5_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T5_tags_1, sizeof(asn_DEF_T5_tags_1) /sizeof(asn_DEF_T5_tags_1[0]) - 1, /* 1 */ asn_DEF_T5_tags_1, /* Same as above */ sizeof(asn_DEF_T5_tags_1) /sizeof(asn_DEF_T5_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T6] >>> ***/ #include /*** <<< TYPE-DECLS [T6] >>> ***/ typedef double T6_t; /*** <<< FUNC-DECLS [T6] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T6; asn_struct_free_f T6_free; asn_struct_print_f T6_print; asn_constr_check_f T6_constraint; ber_type_decoder_f T6_decode_ber; der_type_encoder_f T6_encode_der; xer_type_decoder_f T6_decode_xer; xer_type_encoder_f T6_encode_xer; /*** <<< CODE [T6] >>> ***/ int T6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeReal.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using NativeReal, * so here we adjust the DEF accordingly. */ static void T6_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeReal.free_struct; td->print_struct = asn_DEF_NativeReal.print_struct; td->ber_decoder = asn_DEF_NativeReal.ber_decoder; td->der_encoder = asn_DEF_NativeReal.der_encoder; td->xer_decoder = asn_DEF_NativeReal.xer_decoder; td->xer_encoder = asn_DEF_NativeReal.xer_encoder; td->uper_decoder = asn_DEF_NativeReal.uper_decoder; td->uper_encoder = asn_DEF_NativeReal.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeReal.per_constraints; td->elements = asn_DEF_NativeReal.elements; td->elements_count = asn_DEF_NativeReal.elements_count; td->specifics = asn_DEF_NativeReal.specifics; } void T6_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T6_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T6_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T6_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T6_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T6_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T6_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T6_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T6] >>> ***/ static ber_tlv_tag_t asn_DEF_T6_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T6 = { "T6", "T6", T6_free, T6_print, T6_constraint, T6_decode_ber, T6_encode_der, T6_decode_xer, T6_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T6_tags_1, sizeof(asn_DEF_T6_tags_1) /sizeof(asn_DEF_T6_tags_1[0]), /* 1 */ asn_DEF_T6_tags_1, /* Same as above */ sizeof(asn_DEF_T6_tags_1) /sizeof(asn_DEF_T6_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [T] >>> ***/ #include "Ts.h" /*** <<< TYPE-DECLS [T] >>> ***/ typedef Ts_t T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; asn_struct_free_f T_free; asn_struct_print_f T_print; asn_constr_check_f T_constraint; ber_type_decoder_f T_decode_ber; der_type_encoder_f T_encode_der; xer_type_decoder_f T_decode_xer; xer_type_encoder_f T_encode_xer; /*** <<< CODE [T] >>> ***/ int T_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Ts.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Ts, * so here we adjust the DEF accordingly. */ static void T_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Ts.free_struct; td->print_struct = asn_DEF_Ts.print_struct; td->ber_decoder = asn_DEF_Ts.ber_decoder; td->der_encoder = asn_DEF_Ts.der_encoder; td->xer_decoder = asn_DEF_Ts.xer_decoder; td->xer_encoder = asn_DEF_Ts.xer_encoder; td->uper_decoder = asn_DEF_Ts.uper_decoder; td->uper_encoder = asn_DEF_Ts.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Ts.per_constraints; td->elements = asn_DEF_Ts.elements; td->elements_count = asn_DEF_Ts.elements_count; td->specifics = asn_DEF_Ts.specifics; } void T_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { T_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int T_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t T_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { T_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t T_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t T_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { T_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t T_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { T_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [T] >>> ***/ static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), (ASN_TAG_CLASS_CONTEXT | (123 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", T_free, T_print, T_constraint, T_decode_ber, T_encode_der, T_decode_xer, T_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]) - 2, /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 3 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [Ts] >>> ***/ #include "T2.h" #include "T3.h" #include /*** <<< TYPE-DECLS [Ts] >>> ***/ typedef struct Ts { T2_t m1; T3_t *m2 /* OPTIONAL */; T3_t m3; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Ts_t; /*** <<< FUNC-DECLS [Ts] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Ts; /*** <<< STAT-DEFS [Ts] >>> ***/ static asn_TYPE_member_t asn_MBR_Ts_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Ts, m1), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_T2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m1" }, { ATF_POINTER, 1, offsetof(struct Ts, m2), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_T3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m2" }, { ATF_NOFLAGS, 0, offsetof(struct Ts, m3), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_T3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "m3" }, }; static ber_tlv_tag_t asn_DEF_Ts_tags_1[] = { (ASN_TAG_CLASS_CONTEXT | (123 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Ts_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* m1 at 24 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* m2 at 25 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 } /* m3 at 27 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Ts_specs_1 = { sizeof(struct Ts), offsetof(struct Ts, _asn_ctx), asn_MAP_Ts_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Ts = { "Ts", "Ts", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Ts_tags_1, sizeof(asn_DEF_Ts_tags_1) /sizeof(asn_DEF_Ts_tags_1[0]) - 1, /* 1 */ asn_DEF_Ts_tags_1, /* Same as above */ sizeof(asn_DEF_Ts_tags_1) /sizeof(asn_DEF_Ts_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_Ts_1, 3, /* Elements count */ &asn_SPC_Ts_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/29-tags-OK.asn10000644000000000000000000000064311461147103015654 0ustar rootroot -- OK: Everything is fin -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .29 ModuleTestTagsDistinct2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 29 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN S ::= SET { a INTEGER, b CHOICE { c IA5String, ... }, d CHOICE { e BOOLEAN, ... } } END asn1c-0.9.24+dfsg/tests/00-empty-OK.asn10000644000000000000000000000005211461147103016033 0ustar rootrootModuleTestEmpty DEFINITIONS ::= BEGIN END asn1c-0.9.24+dfsg/tests/21-tags-OK.asn10000644000000000000000000000120311461147103015635 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .21 1 -- .21 2 ModuleTestTags1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 21 1 } DEFINITIONS EXPLICIT TAGS ::= BEGIN T1 ::= CHOICE { first [0] INTEGER, second [1] INTEGER } END ModuleTestTags2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 21 2 } DEFINITIONS IMPLICIT TAGS ::= BEGIN IMPORTS T1 FROM ModuleTestTags1; T2 ::= SEQUENCE { one [0] T1, two [1] IA5String } END asn1c-0.9.24+dfsg/tests/42-real-life-OK.asn10000644000000000000000000000322511461150505016550 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .42 ModuleLAPStorage { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 42 } DEFINITIONS EXTENSIBILITY IMPLIED ::= BEGIN /* * A package representing a distinguished log line. * It contains * - a digest of that line (actually, a normalized * form with bells (\007) in place of variable components), * - one or more sets of variable parts (presumably with different * acceptability rules). */ LogLine ::= SEQUENCE { line-digest IA5String, -- Log line normal form varsets SEQUENCE SIZE(1..MAX) OF VariablePartSet } /* * This package contains a set of variable components of a log line. * Each variable component may contain one or more "value samples", * or a range between two samples. */ VariablePartSet ::= SEQUENCE { vparts SEQUENCE SIZE(0..MAX) OF VariablePart, -- {123,321} resolution ActionItem } /* * A description of a single variable part. */ VariablePart ::= CHOICE { -- A set of acceptable values vset SET SIZE(1..MAX) OF VisibleString, -- A range of acceptable values vrange SEQUENCE { from VisibleString, to VisibleString } } /* * What to do with the log line. */ ActionItem ::= SEQUENCE { accept-as ENUMERATED { unknown, -- Action yet unknown. safe, -- No action, just move on. unsafe, -- Unsafe message. Inform NOC. ... }, notify SEQUENCE { -- How to notify NOC. critical BOOLEAN, -- Emit critical message email SET OF VisibleString, -- Send emails ... } OPTIONAL } END asn1c-0.9.24+dfsg/tests/19-param-OK.asn1.-P0000644000000000000000000003735511461146446016313 0ustar rootroot /*** <<< INCLUDES [SIGNED] >>> ***/ #include #include #include #include "Name.h" #include /*** <<< TYPE-DECLS [SIGNED] >>> ***/ typedef struct SIGNED_15P0 { struct toBeSigned { INTEGER_t version; OBJECT_IDENTIFIER_t signature; Name_t issuer; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } toBeSigned; OBJECT_IDENTIFIER_t algorithm; BIT_STRING_t signature; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SIGNED_15P0_t; /*** <<< FUNC-DECLS [SIGNED] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0; /*** <<< CODE [SIGNED] >>> ***/ static int memb_signature_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(st->size > 0) { /* Size in bits */ size = 8 * st->size - (st->bits_unused & 0x07); } else { size = 0; } if((size <= 256)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [SIGNED] >>> ***/ static asn_TYPE_member_t asn_MBR_toBeSigned_2[] = { { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, version), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "version" }, { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, signature), .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), .tag_mode = 0, .type = &asn_DEF_OBJECT_IDENTIFIER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "signature" }, { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, issuer), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Name, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "issuer" }, }; static ber_tlv_tag_t asn_DEF_toBeSigned_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_toBeSigned_tag2el_2[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* version at 21 */ { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 1, 0, 0 }, /* signature at 22 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 0 } /* issuer at 24 */ }; static asn_SEQUENCE_specifics_t asn_SPC_toBeSigned_specs_2 = { sizeof(struct toBeSigned), offsetof(struct toBeSigned, _asn_ctx), asn_MAP_toBeSigned_tag2el_2, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_toBeSigned_2 = { "toBeSigned", "toBeSigned", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_toBeSigned_tags_2, sizeof(asn_DEF_toBeSigned_tags_2) /sizeof(asn_DEF_toBeSigned_tags_2[0]), /* 1 */ asn_DEF_toBeSigned_tags_2, /* Same as above */ sizeof(asn_DEF_toBeSigned_tags_2) /sizeof(asn_DEF_toBeSigned_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_toBeSigned_2, 3, /* Elements count */ &asn_SPC_toBeSigned_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_SIGNED_15P0_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, toBeSigned), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_toBeSigned_2, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "toBeSigned" }, { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, algorithm), .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), .tag_mode = 0, .type = &asn_DEF_OBJECT_IDENTIFIER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "algorithm" }, { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, signature), .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), .tag_mode = 0, .type = &asn_DEF_BIT_STRING, .memb_constraints = memb_signature_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "signature" }, }; static ber_tlv_tag_t asn_DEF_SIGNED_15P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_SIGNED_15P0_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 2, 0, 0 }, /* signature at 17 */ { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 1, 0, 0 }, /* algorithm at 16 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* toBeSigned at 21 */ }; static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_15P0_specs_1 = { sizeof(struct SIGNED_15P0), offsetof(struct SIGNED_15P0, _asn_ctx), asn_MAP_SIGNED_15P0_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0 = { "SIGNED", "SIGNED", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SIGNED_15P0_tags_1, sizeof(asn_DEF_SIGNED_15P0_tags_1) /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */ asn_DEF_SIGNED_15P0_tags_1, /* Same as above */ sizeof(asn_DEF_SIGNED_15P0_tags_1) /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SIGNED_15P0_1, 3, /* Elements count */ &asn_SPC_SIGNED_15P0_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Certificate] >>> ***/ #include "SIGNED.h" /*** <<< TYPE-DECLS [Certificate] >>> ***/ typedef SIGNED_15P0_t Certificate_t; /*** <<< FUNC-DECLS [Certificate] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Certificate; asn_struct_free_f Certificate_free; asn_struct_print_f Certificate_print; asn_constr_check_f Certificate_constraint; ber_type_decoder_f Certificate_decode_ber; der_type_encoder_f Certificate_encode_der; xer_type_decoder_f Certificate_decode_xer; xer_type_encoder_f Certificate_encode_xer; /*** <<< CODE [Certificate] >>> ***/ int Certificate_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_SIGNED_15P0.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using SIGNED_15P0, * so here we adjust the DEF accordingly. */ static void Certificate_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_SIGNED_15P0.free_struct; td->print_struct = asn_DEF_SIGNED_15P0.print_struct; td->ber_decoder = asn_DEF_SIGNED_15P0.ber_decoder; td->der_encoder = asn_DEF_SIGNED_15P0.der_encoder; td->xer_decoder = asn_DEF_SIGNED_15P0.xer_decoder; td->xer_encoder = asn_DEF_SIGNED_15P0.xer_encoder; td->uper_decoder = asn_DEF_SIGNED_15P0.uper_decoder; td->uper_encoder = asn_DEF_SIGNED_15P0.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_SIGNED_15P0.per_constraints; td->elements = asn_DEF_SIGNED_15P0.elements; td->elements_count = asn_DEF_SIGNED_15P0.elements_count; td->specifics = asn_DEF_SIGNED_15P0.specifics; } void Certificate_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { Certificate_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Certificate_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Certificate_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Certificate_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { Certificate_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Certificate_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { Certificate_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Certificate_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { Certificate_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Certificate_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { Certificate_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Certificate] >>> ***/ static ber_tlv_tag_t asn_DEF_Certificate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Certificate = { "Certificate", "Certificate", Certificate_free, Certificate_print, Certificate_constraint, Certificate_decode_ber, Certificate_encode_der, Certificate_decode_xer, Certificate_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Certificate_tags_1, sizeof(asn_DEF_Certificate_tags_1) /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */ asn_DEF_Certificate_tags_1, /* Same as above */ sizeof(asn_DEF_Certificate_tags_1) /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [Name] >>> ***/ #include #include /*** <<< FWD-DECLS [Name] >>> ***/ struct RelativeDistinguishedName; /*** <<< TYPE-DECLS [Name] >>> ***/ typedef struct Name { A_SEQUENCE_OF(struct RelativeDistinguishedName) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Name_t; /*** <<< FUNC-DECLS [Name] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Name; /*** <<< POST-INCLUDE [Name] >>> ***/ #include "RelativeDistinguishedName.h" /*** <<< STAT-DEFS [Name] >>> ***/ static asn_TYPE_member_t asn_MBR_Name_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), .tag_mode = 0, .type = &asn_DEF_RelativeDistinguishedName, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_Name_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_Name_specs_1 = { sizeof(struct Name), offsetof(struct Name, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_Name = { "Name", "Name", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Name_tags_1, sizeof(asn_DEF_Name_tags_1) /sizeof(asn_DEF_Name_tags_1[0]), /* 1 */ asn_DEF_Name_tags_1, /* Same as above */ sizeof(asn_DEF_Name_tags_1) /sizeof(asn_DEF_Name_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Name_1, 1, /* Single element */ &asn_SPC_Name_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [RelativeDistinguishedName] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [RelativeDistinguishedName] >>> ***/ typedef struct RelativeDistinguishedName { A_SET_OF(IA5String_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } RelativeDistinguishedName_t; /*** <<< FUNC-DECLS [RelativeDistinguishedName] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_RelativeDistinguishedName; /*** <<< CTABLES [RelativeDistinguishedName] >>> ***/ static int permitted_alphabet_table_2[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, /* ,-. */ 4, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, /* 0 9 */ 0, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20, /* ABCDEFGHIJKLMNO */ 21,22,23,24,25,26,27,28,29,30,31, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */ 0,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46, /* abcdefghijklmno */ 47,48,49,50,51,52,53,54,55,56,57, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ }; static int check_permitted_alphabet_2(const void *sptr) { int *table = permitted_alphabet_table_2; /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!table[cv]) return -1; } return 0; } /*** <<< CODE [RelativeDistinguishedName] >>> ***/ static int memb_IA5String_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(!check_permitted_alphabet_2(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [RelativeDistinguishedName] >>> ***/ static asn_TYPE_member_t asn_MBR_RelativeDistinguishedName_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), .tag_mode = 0, .type = &asn_DEF_IA5String, .memb_constraints = memb_IA5String_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_RelativeDistinguishedName_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_RelativeDistinguishedName_specs_1 = { sizeof(struct RelativeDistinguishedName), offsetof(struct RelativeDistinguishedName, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_RelativeDistinguishedName = { "RelativeDistinguishedName", "RelativeDistinguishedName", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_RelativeDistinguishedName_tags_1, sizeof(asn_DEF_RelativeDistinguishedName_tags_1) /sizeof(asn_DEF_RelativeDistinguishedName_tags_1[0]), /* 1 */ asn_DEF_RelativeDistinguishedName_tags_1, /* Same as above */ sizeof(asn_DEF_RelativeDistinguishedName_tags_1) /sizeof(asn_DEF_RelativeDistinguishedName_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_RelativeDistinguishedName_1, 1, /* Single element */ &asn_SPC_RelativeDistinguishedName_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/74-int-enum-constraints-OK.asn10000644000000000000000000000100611461147103021011 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .74 ModuleTestIntegerAndEnumeratedConstraints { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 74 } DEFINITIONS ::= BEGIN -- Enumeration constrained by the second choice. Enum ::= ENUMERATED { one, two } (two|one) -- Integer constrained by the only choice. Int ::= INTEGER { v1-0(123) } (v1-0) EnumRef ::= Enum (two) END asn1c-0.9.24+dfsg/tests/109-bit-string-SE.asn10000644000000000000000000000051711461147103017055 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .109 ModuleBitStringExtensibility { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 109 } DEFINITIONS ::= BEGIN T ::= BIT STRING { one(1), ... } END asn1c-0.9.24+dfsg/tests/62-any-OK.asn10000644000000000000000000000141511461147103015500 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .62 ModuleTestANYSyntax { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 62 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= CHOICE { s1 T1-ext, s2 T2, s3 T3, s4 T4 } T1-ext ::= SEQUENCE { i INTEGER OPTIONAL, any [1] ANY, -- Converted into [1] EXPLICIT ANY ... } T2 ::= [16] SEQUENCE { m1 [0] NumericString, m2 [1] BOOLEAN, m3 [3] SEQUENCE OF NumericString, o4 [4] BOOLEAN OPTIONAL, o5 [5] BOOLEAN OPTIONAL, o6 [6] BOOLEAN OPTIONAL } T3 ::= SET { m1 [0] NumericString, m2 [1] BOOLEAN } T4 ::= [53] CHOICE { m1 [1] IMPLICIT OCTET STRING } END asn1c-0.9.24+dfsg/tests/13-resolver-OK.asn10000644000000000000000000000204711461147103016550 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .13 1 -- .13 2 ModuleTestResolver1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 13 1 } DEFINITIONS ::= BEGIN IMPORTS IntegerType, beta FROM Renamed { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 13 2 }; -- external reference alpha IntegerType ::= beta alpha2 Renamed.IntegerType ::= beta -- -- The following are for post-fix checking by the check_fixer. -- It will be able to pick-up these values if the file is parseable, -- even if it contains some semantic errors. -- check-alpha INTEGER ::= 123 check-alpha2 INTEGER ::= 123 END ModuleTestResolver2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 13 2 } DEFINITIONS ::= BEGIN EXPORTS beta, IntegerType ; beta HiddenType ::= 123 HiddenType ::= INTEGER IntegerType ::= INTEGER END asn1c-0.9.24+dfsg/tests/110-param-3-OK.asn1.-P0000644000000000000000000004306611461230611016503 0ustar rootroot /*** <<< INCLUDES [Flag] >>> ***/ #include #include #include /*** <<< DEPS [Flag] >>> ***/ typedef enum field { field_red = 0, field_green = 1, field_blue = 5 } e_field; typedef enum field { field_red = 3, field_green = 4, field_blue = 5 } e_field; /*** <<< TYPE-DECLS [Flag] >>> ***/ typedef struct Flag_16P0 { INTEGER_t *field /* DEFAULT 5 */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Flag_16P0_t; typedef struct Flag_16P1 { ENUMERATED_t *field /* DEFAULT 5 */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Flag_16P1_t; /*** <<< FUNC-DECLS [Flag] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Flag_16P0; /* extern asn_TYPE_descriptor_t asn_DEF_field_7; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_Flag_16P1; /*** <<< CODE [Flag] >>> ***/ static int field_7_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_ENUMERATED.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */ static void field_7_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_ENUMERATED.free_struct; td->print_struct = asn_DEF_ENUMERATED.print_struct; td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; td->der_encoder = asn_DEF_ENUMERATED.der_encoder; td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_ENUMERATED.per_constraints; td->elements = asn_DEF_ENUMERATED.elements; td->elements_count = asn_DEF_ENUMERATED.elements_count; /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ } static void field_7_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { field_7_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int field_7_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { field_7_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t field_7_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { field_7_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t field_7_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { field_7_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t field_7_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { field_7_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t field_7_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { field_7_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [Flag] >>> ***/ static int asn_DFL_2_set_5(int set_value, void **sptr) { INTEGER_t *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { /* Install default value 5 */ return asn_long2INTEGER(st, 5); } else { /* Test default value 5 */ long value; if(asn_INTEGER2long(st, &value)) return -1; return (value == 5); } } static asn_TYPE_member_t asn_MBR_Flag_16P0_1[] = { { ATF_POINTER, 1, offsetof(struct Flag_16P0, field), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = asn_DFL_2_set_5, /* DEFAULT 5 */ .name = "field" }, }; static ber_tlv_tag_t asn_DEF_Flag_16P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Flag_16P0_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* field at 18 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Flag_16P0_specs_1 = { sizeof(struct Flag_16P0), offsetof(struct Flag_16P0, _asn_ctx), asn_MAP_Flag_16P0_tag2el_1, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Flag_16P0 = { "Flag", "Flag", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Flag_16P0_tags_1, sizeof(asn_DEF_Flag_16P0_tags_1) /sizeof(asn_DEF_Flag_16P0_tags_1[0]), /* 1 */ asn_DEF_Flag_16P0_tags_1, /* Same as above */ sizeof(asn_DEF_Flag_16P0_tags_1) /sizeof(asn_DEF_Flag_16P0_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Flag_16P0_1, 1, /* Elements count */ &asn_SPC_Flag_16P0_specs_1 /* Additional specs */ }; static int asn_DFL_7_set_5(int set_value, void **sptr) { ENUMERATED_t *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { /* Install default value 5 */ return asn_long2INTEGER(st, 5); } else { /* Test default value 5 */ long value; if(asn_INTEGER2long(st, &value)) return -1; return (value == 5); } } static asn_INTEGER_enum_map_t asn_MAP_field_value2enum_7[] = { { 3, 3, "red" }, { 4, 5, "green" }, { 5, 4, "blue" } }; static unsigned int asn_MAP_field_enum2value_7[] = { 2, /* blue(5) */ 1, /* green(4) */ 0 /* red(3) */ }; static asn_INTEGER_specifics_t asn_SPC_field_specs_7 = { asn_MAP_field_value2enum_7, /* "tag" => N; sorted by tag */ asn_MAP_field_enum2value_7, /* N => "tag"; sorted by N */ 3, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static ber_tlv_tag_t asn_DEF_field_tags_7[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_field_7 = { "field", "field", field_7_free, field_7_print, field_7_constraint, field_7_decode_ber, field_7_encode_der, field_7_decode_xer, field_7_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_field_tags_7, sizeof(asn_DEF_field_tags_7) /sizeof(asn_DEF_field_tags_7[0]), /* 1 */ asn_DEF_field_tags_7, /* Same as above */ sizeof(asn_DEF_field_tags_7) /sizeof(asn_DEF_field_tags_7[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_field_specs_7 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Flag_16P1_6[] = { { ATF_POINTER, 1, offsetof(struct Flag_16P1, field), .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), .tag_mode = 0, .type = &asn_DEF_field_7, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = asn_DFL_7_set_5, /* DEFAULT 5 */ .name = "field" }, }; static ber_tlv_tag_t asn_DEF_Flag_16P1_tags_6[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Flag_16P1_tag2el_6[] = { { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* field at 19 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Flag_16P1_specs_6 = { sizeof(struct Flag_16P1), offsetof(struct Flag_16P1, _asn_ctx), asn_MAP_Flag_16P1_tag2el_6, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Flag_16P1 = { "Flag", "Flag", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Flag_16P1_tags_6, sizeof(asn_DEF_Flag_16P1_tags_6) /sizeof(asn_DEF_Flag_16P1_tags_6[0]), /* 1 */ asn_DEF_Flag_16P1_tags_6, /* Same as above */ sizeof(asn_DEF_Flag_16P1_tags_6) /sizeof(asn_DEF_Flag_16P1_tags_6[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Flag_16P1_6, 1, /* Elements count */ &asn_SPC_Flag_16P1_specs_6 /* Additional specs */ }; /*** <<< INCLUDES [IntegerColorFlag] >>> ***/ #include "Flag.h" /*** <<< TYPE-DECLS [IntegerColorFlag] >>> ***/ typedef Flag_16P0_t IntegerColorFlag_t; /*** <<< FUNC-DECLS [IntegerColorFlag] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag; asn_struct_free_f IntegerColorFlag_free; asn_struct_print_f IntegerColorFlag_print; asn_constr_check_f IntegerColorFlag_constraint; ber_type_decoder_f IntegerColorFlag_decode_ber; der_type_encoder_f IntegerColorFlag_encode_der; xer_type_decoder_f IntegerColorFlag_decode_xer; xer_type_encoder_f IntegerColorFlag_encode_xer; /*** <<< CODE [IntegerColorFlag] >>> ***/ int IntegerColorFlag_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Flag_16P0.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Flag_16P0, * so here we adjust the DEF accordingly. */ static void IntegerColorFlag_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Flag_16P0.free_struct; td->print_struct = asn_DEF_Flag_16P0.print_struct; td->ber_decoder = asn_DEF_Flag_16P0.ber_decoder; td->der_encoder = asn_DEF_Flag_16P0.der_encoder; td->xer_decoder = asn_DEF_Flag_16P0.xer_decoder; td->xer_encoder = asn_DEF_Flag_16P0.xer_encoder; td->uper_decoder = asn_DEF_Flag_16P0.uper_decoder; td->uper_encoder = asn_DEF_Flag_16P0.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Flag_16P0.per_constraints; td->elements = asn_DEF_Flag_16P0.elements; td->elements_count = asn_DEF_Flag_16P0.elements_count; td->specifics = asn_DEF_Flag_16P0.specifics; } void IntegerColorFlag_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { IntegerColorFlag_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int IntegerColorFlag_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { IntegerColorFlag_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t IntegerColorFlag_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { IntegerColorFlag_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t IntegerColorFlag_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { IntegerColorFlag_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t IntegerColorFlag_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { IntegerColorFlag_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t IntegerColorFlag_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { IntegerColorFlag_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [IntegerColorFlag] >>> ***/ static ber_tlv_tag_t asn_DEF_IntegerColorFlag_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag = { "IntegerColorFlag", "IntegerColorFlag", IntegerColorFlag_free, IntegerColorFlag_print, IntegerColorFlag_constraint, IntegerColorFlag_decode_ber, IntegerColorFlag_encode_der, IntegerColorFlag_decode_xer, IntegerColorFlag_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_IntegerColorFlag_tags_1, sizeof(asn_DEF_IntegerColorFlag_tags_1) /sizeof(asn_DEF_IntegerColorFlag_tags_1[0]), /* 1 */ asn_DEF_IntegerColorFlag_tags_1, /* Same as above */ sizeof(asn_DEF_IntegerColorFlag_tags_1) /sizeof(asn_DEF_IntegerColorFlag_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; /*** <<< INCLUDES [EnumeratedColorFlag] >>> ***/ #include "Flag.h" /*** <<< TYPE-DECLS [EnumeratedColorFlag] >>> ***/ typedef Flag_16P1_t EnumeratedColorFlag_t; /*** <<< FUNC-DECLS [EnumeratedColorFlag] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag; asn_struct_free_f EnumeratedColorFlag_free; asn_struct_print_f EnumeratedColorFlag_print; asn_constr_check_f EnumeratedColorFlag_constraint; ber_type_decoder_f EnumeratedColorFlag_decode_ber; der_type_encoder_f EnumeratedColorFlag_encode_der; xer_type_decoder_f EnumeratedColorFlag_decode_xer; xer_type_encoder_f EnumeratedColorFlag_encode_xer; /*** <<< CODE [EnumeratedColorFlag] >>> ***/ int EnumeratedColorFlag_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Flag_16P1.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Flag_16P1, * so here we adjust the DEF accordingly. */ static void EnumeratedColorFlag_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Flag_16P1.free_struct; td->print_struct = asn_DEF_Flag_16P1.print_struct; td->ber_decoder = asn_DEF_Flag_16P1.ber_decoder; td->der_encoder = asn_DEF_Flag_16P1.der_encoder; td->xer_decoder = asn_DEF_Flag_16P1.xer_decoder; td->xer_encoder = asn_DEF_Flag_16P1.xer_encoder; td->uper_decoder = asn_DEF_Flag_16P1.uper_decoder; td->uper_encoder = asn_DEF_Flag_16P1.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Flag_16P1.per_constraints; td->elements = asn_DEF_Flag_16P1.elements; td->elements_count = asn_DEF_Flag_16P1.elements_count; td->specifics = asn_DEF_Flag_16P1.specifics; } void EnumeratedColorFlag_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int EnumeratedColorFlag_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t EnumeratedColorFlag_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t EnumeratedColorFlag_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t EnumeratedColorFlag_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t EnumeratedColorFlag_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [EnumeratedColorFlag] >>> ***/ static ber_tlv_tag_t asn_DEF_EnumeratedColorFlag_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag = { "EnumeratedColorFlag", "EnumeratedColorFlag", EnumeratedColorFlag_free, EnumeratedColorFlag_print, EnumeratedColorFlag_constraint, EnumeratedColorFlag_decode_ber, EnumeratedColorFlag_encode_der, EnumeratedColorFlag_decode_xer, EnumeratedColorFlag_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_EnumeratedColorFlag_tags_1, sizeof(asn_DEF_EnumeratedColorFlag_tags_1) /sizeof(asn_DEF_EnumeratedColorFlag_tags_1[0]), /* 1 */ asn_DEF_EnumeratedColorFlag_tags_1, /* Same as above */ sizeof(asn_DEF_EnumeratedColorFlag_tags_1) /sizeof(asn_DEF_EnumeratedColorFlag_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/113-bit-string-SE.asn10000644000000000000000000000053111461147103017044 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .113 ModuleBitStringIdentifierUniqueness { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 113 } DEFINITIONS ::= BEGIN T ::= BIT STRING { one(1), one(2) } END asn1c-0.9.24+dfsg/tests/108-param-constr-3-OK.asn1.-P0000644000000000000000000002126411461146446020030 0ustar rootroot /*** <<< INCLUDES [MinMax] >>> ***/ #include /*** <<< TYPE-DECLS [MinMax] >>> ***/ typedef INTEGER_t MinMax_16P0_t; /*** <<< FUNC-DECLS [MinMax] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_MinMax_16P0; asn_struct_free_f MinMax_16P0_free; asn_struct_print_f MinMax_16P0_print; asn_constr_check_f MinMax_16P0_constraint; ber_type_decoder_f MinMax_16P0_decode_ber; der_type_encoder_f MinMax_16P0_encode_der; xer_type_decoder_f MinMax_16P0_decode_xer; xer_type_encoder_f MinMax_16P0_encode_xer; /*** <<< CODE [MinMax] >>> ***/ int MinMax_16P0_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 3)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void MinMax_16P0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_INTEGER.free_struct; td->print_struct = asn_DEF_INTEGER.print_struct; td->ber_decoder = asn_DEF_INTEGER.ber_decoder; td->der_encoder = asn_DEF_INTEGER.der_encoder; td->xer_decoder = asn_DEF_INTEGER.xer_decoder; td->xer_encoder = asn_DEF_INTEGER.xer_encoder; td->uper_decoder = asn_DEF_INTEGER.uper_decoder; td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_INTEGER.per_constraints; td->elements = asn_DEF_INTEGER.elements; td->elements_count = asn_DEF_INTEGER.elements_count; td->specifics = asn_DEF_INTEGER.specifics; } void MinMax_16P0_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { MinMax_16P0_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int MinMax_16P0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { MinMax_16P0_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t MinMax_16P0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { MinMax_16P0_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t MinMax_16P0_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { MinMax_16P0_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t MinMax_16P0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { MinMax_16P0_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t MinMax_16P0_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { MinMax_16P0_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [MinMax] >>> ***/ static ber_tlv_tag_t asn_DEF_MinMax_16P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_MinMax_16P0 = { "MinMax", "MinMax", MinMax_16P0_free, MinMax_16P0_print, MinMax_16P0_constraint, MinMax_16P0_decode_ber, MinMax_16P0_encode_der, MinMax_16P0_decode_xer, MinMax_16P0_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_MinMax_16P0_tags_1, sizeof(asn_DEF_MinMax_16P0_tags_1) /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */ asn_DEF_MinMax_16P0_tags_1, /* Same as above */ sizeof(asn_DEF_MinMax_16P0_tags_1) /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [ThreePlus] >>> ***/ #include "MinMax.h" /*** <<< TYPE-DECLS [ThreePlus] >>> ***/ typedef MinMax_16P0_t ThreePlus_t; /*** <<< FUNC-DECLS [ThreePlus] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_ThreePlus; asn_struct_free_f ThreePlus_free; asn_struct_print_f ThreePlus_print; asn_constr_check_f ThreePlus_constraint; ber_type_decoder_f ThreePlus_decode_ber; der_type_encoder_f ThreePlus_encode_der; xer_type_decoder_f ThreePlus_decode_xer; xer_type_encoder_f ThreePlus_encode_xer; /*** <<< CODE [ThreePlus] >>> ***/ int ThreePlus_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr; long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 3)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using MinMax_16P0, * so here we adjust the DEF accordingly. */ static void ThreePlus_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_MinMax_16P0.free_struct; td->print_struct = asn_DEF_MinMax_16P0.print_struct; td->ber_decoder = asn_DEF_MinMax_16P0.ber_decoder; td->der_encoder = asn_DEF_MinMax_16P0.der_encoder; td->xer_decoder = asn_DEF_MinMax_16P0.xer_decoder; td->xer_encoder = asn_DEF_MinMax_16P0.xer_encoder; td->uper_decoder = asn_DEF_MinMax_16P0.uper_decoder; td->uper_encoder = asn_DEF_MinMax_16P0.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_MinMax_16P0.per_constraints; td->elements = asn_DEF_MinMax_16P0.elements; td->elements_count = asn_DEF_MinMax_16P0.elements_count; td->specifics = asn_DEF_MinMax_16P0.specifics; } void ThreePlus_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { ThreePlus_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int ThreePlus_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { ThreePlus_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t ThreePlus_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { ThreePlus_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t ThreePlus_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { ThreePlus_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t ThreePlus_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { ThreePlus_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t ThreePlus_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { ThreePlus_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [ThreePlus] >>> ***/ static ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_ThreePlus = { "ThreePlus", "ThreePlus", ThreePlus_free, ThreePlus_print, ThreePlus_constraint, ThreePlus_decode_ber, ThreePlus_encode_der, ThreePlus_decode_xer, ThreePlus_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ThreePlus_tags_1, sizeof(asn_DEF_ThreePlus_tags_1) /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */ asn_DEF_ThreePlus_tags_1, /* Same as above */ sizeof(asn_DEF_ThreePlus_tags_1) /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/60-any-OK.asn1.-P0000644000000000000000000001452311461146446015766 0ustar rootroot /*** <<< INCLUDES [T1] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [T1] >>> ***/ typedef struct T1 { INTEGER_t i; ANY_t any; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T1_t; /*** <<< FUNC-DECLS [T1] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T1; /*** <<< STAT-DEFS [T1] >>> ***/ static asn_TYPE_member_t asn_MBR_T1_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T1, i), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "i" }, { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct T1, any), .tag = -1 /* Ambiguous tag (ANY?) */, .tag_mode = 0, .type = &asn_DEF_ANY, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "any" }, }; static ber_tlv_tag_t asn_DEF_T1_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T1_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i at 15 */ }; static asn_SEQUENCE_specifics_t asn_SPC_T1_specs_1 = { sizeof(struct T1), offsetof(struct T1, _asn_ctx), asn_MAP_T1_tag2el_1, 1, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_T1 = { "T1", "T1", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T1_tags_1, sizeof(asn_DEF_T1_tags_1) /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */ asn_DEF_T1_tags_1, /* Same as above */ sizeof(asn_DEF_T1_tags_1) /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T1_1, 2, /* Elements count */ &asn_SPC_T1_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [T2] >>> ***/ #include #include #include /*** <<< TYPE-DECLS [T2] >>> ***/ typedef struct T2 { INTEGER_t i; ANY_t *any /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T2_t; /*** <<< FUNC-DECLS [T2] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T2; /*** <<< STAT-DEFS [T2] >>> ***/ static asn_TYPE_member_t asn_MBR_T2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T2, i), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_INTEGER, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "i" }, { ATF_POINTER, 1, offsetof(struct T2, any), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_ANY, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "any" }, }; static ber_tlv_tag_t asn_DEF_T2_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T2_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 20 */ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* any at 21 */ }; static asn_SEQUENCE_specifics_t asn_SPC_T2_specs_1 = { sizeof(struct T2), offsetof(struct T2, _asn_ctx), asn_MAP_T2_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_T2 = { "T2", "T2", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T2_tags_1, sizeof(asn_DEF_T2_tags_1) /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */ asn_DEF_T2_tags_1, /* Same as above */ sizeof(asn_DEF_T2_tags_1) /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T2_1, 2, /* Elements count */ &asn_SPC_T2_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [T3] >>> ***/ #include #include /*** <<< TYPE-DECLS [T3] >>> ***/ typedef struct T3 { ANY_t any1; ANY_t any2; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T3_t; /*** <<< FUNC-DECLS [T3] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T3; /*** <<< STAT-DEFS [T3] >>> ***/ static asn_TYPE_member_t asn_MBR_T3_1[] = { { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct T3, any1), .tag = -1 /* Ambiguous tag (ANY?) */, .tag_mode = 0, .type = &asn_DEF_ANY, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "any1" }, { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct T3, any2), .tag = -1 /* Ambiguous tag (ANY?) */, .tag_mode = 0, .type = &asn_DEF_ANY, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "any2" }, }; static ber_tlv_tag_t asn_DEF_T3_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SEQUENCE_specifics_t asn_SPC_T3_specs_1 = { sizeof(struct T3), offsetof(struct T3, _asn_ctx), 0, /* No top level tags */ 0, /* No tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_T3 = { "T3", "T3", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T3_tags_1, sizeof(asn_DEF_T3_tags_1) /sizeof(asn_DEF_T3_tags_1[0]), /* 1 */ asn_DEF_T3_tags_1, /* Same as above */ sizeof(asn_DEF_T3_tags_1) /sizeof(asn_DEF_T3_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_T3_1, 2, /* Elements count */ &asn_SPC_T3_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/127-per-long-OK.asn10000644000000000000000000000077411461230611016522 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .127 ModulePERLong { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 127 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN T ::= SEQUENCE { small32range INTEGER (-2000000000..2000000000), full32range INTEGER (-2147483648..2147483647), unsigned32 INTEGER (0..4294967295), unsplit32 INTEGER (5..500|600..4294967290) } END asn1c-0.9.24+dfsg/tests/41-int-optional-OK.asn10000644000000000000000000000100411461147103017315 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .41 ModuleTestIntOptional { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 41 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN T ::= CHOICE { seq SEQUENCE { string UTF8String, alpha INTEGER OPTIONAL, beta INTEGER OPTIONAL }, set SET { string UTF8String, alpha INTEGER OPTIONAL, beta INTEGER OPTIONAL } } END asn1c-0.9.24+dfsg/tests/106-param-constr-OK.asn10000644000000000000000000000077511461147103017406 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .106 ModuleParameterizationWithConstraints { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 106 } DEFINITIONS ::= BEGIN Narrow {Type, INTEGER:value} ::= SEQUENCE { narrow1 Type (1..5) DEFAULT value, narrow2 [0] Type (2..5), narrow3 [1] Type (3..5) OPTIONAL } NarrowInteger ::= Narrow {INTEGER (0..10), 3} END asn1c-0.9.24+dfsg/tests/25-misc-OK.asn10000644000000000000000000000075411461150505015650 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .25 ModuleTestMisc { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 25 } DEFINITIONS IMPLICIT TAGS ::= BEGIN T ::= SEQUENCE { a INTEGER, b [2] BOOLEAN, c NULL, ..., d ENUMERATED { a(1), b(2) }, e OCTET STRING, f [5] VisibleString, g BIT STRING, h [7] BIT STRING, ... } END asn1c-0.9.24+dfsg/tests/47-set-ext-OK.asn10000644000000000000000000000071311461147103016305 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .47 ModuleSetChoiceExtensibility { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 47 } DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::= BEGIN T1 ::= SET { i INTEGER } T2 ::= SET { i INTEGER, ... } T3 ::= CHOICE { i INTEGER } T4 ::= CHOICE { i INTEGER, ... } END asn1c-0.9.24+dfsg/tests/106-param-constr-OK.asn1.-P0000644000000000000000000002174511461146446017672 0ustar rootroot /*** <<< INCLUDES [Narrow] >>> ***/ #include #include /*** <<< TYPE-DECLS [Narrow] >>> ***/ typedef struct Narrow_15P0 { long *narrow1 /* DEFAULT 3 */; long narrow2; long *narrow3 /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Narrow_15P0_t; /*** <<< FUNC-DECLS [Narrow] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Narrow_15P0; /*** <<< CODE [Narrow] >>> ***/ static int memb_narrow1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= 1 && value <= 5)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_narrow2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= 2 && value <= 5)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_narrow3_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= 3 && value <= 5)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /*** <<< STAT-DEFS [Narrow] >>> ***/ static int asn_DFL_2_set_3(int set_value, void **sptr) { long *st = *sptr; if(!st) { if(!set_value) return -1; /* Not a default value */ st = (*sptr = CALLOC(1, sizeof(*st))); if(!st) return -1; } if(set_value) { /* Install default value 3 */ *st = 3; return 0; } else { /* Test default value 3 */ return (*st == 3); } } static asn_TYPE_member_t asn_MBR_Narrow_15P0_1[] = { { ATF_POINTER, 1, offsetof(struct Narrow_15P0, narrow1), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_NativeInteger, .memb_constraints = memb_narrow1_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */ .name = "narrow1" }, { ATF_NOFLAGS, 0, offsetof(struct Narrow_15P0, narrow2), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_NativeInteger, .memb_constraints = memb_narrow2_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "narrow2" }, { ATF_POINTER, 1, offsetof(struct Narrow_15P0, narrow3), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_NativeInteger, .memb_constraints = memb_narrow3_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "narrow3" }, }; static ber_tlv_tag_t asn_DEF_Narrow_15P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Narrow_15P0_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* narrow1 at 20 */ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* narrow2 at 20 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 } /* narrow3 at 20 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Narrow_15P0_specs_1 = { sizeof(struct Narrow_15P0), offsetof(struct Narrow_15P0, _asn_ctx), asn_MAP_Narrow_15P0_tag2el_1, 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Narrow_15P0 = { "Narrow", "Narrow", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Narrow_15P0_tags_1, sizeof(asn_DEF_Narrow_15P0_tags_1) /sizeof(asn_DEF_Narrow_15P0_tags_1[0]), /* 1 */ asn_DEF_Narrow_15P0_tags_1, /* Same as above */ sizeof(asn_DEF_Narrow_15P0_tags_1) /sizeof(asn_DEF_Narrow_15P0_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Narrow_15P0_1, 3, /* Elements count */ &asn_SPC_Narrow_15P0_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [NarrowInteger] >>> ***/ #include "Narrow.h" /*** <<< TYPE-DECLS [NarrowInteger] >>> ***/ typedef Narrow_15P0_t NarrowInteger_t; /*** <<< FUNC-DECLS [NarrowInteger] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_NarrowInteger; asn_struct_free_f NarrowInteger_free; asn_struct_print_f NarrowInteger_print; asn_constr_check_f NarrowInteger_constraint; ber_type_decoder_f NarrowInteger_decode_ber; der_type_encoder_f NarrowInteger_encode_der; xer_type_decoder_f NarrowInteger_decode_xer; xer_type_encoder_f NarrowInteger_encode_xer; /*** <<< CODE [NarrowInteger] >>> ***/ int NarrowInteger_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_Narrow_15P0.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* * This type is implemented using Narrow_15P0, * so here we adjust the DEF accordingly. */ static void NarrowInteger_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_Narrow_15P0.free_struct; td->print_struct = asn_DEF_Narrow_15P0.print_struct; td->ber_decoder = asn_DEF_Narrow_15P0.ber_decoder; td->der_encoder = asn_DEF_Narrow_15P0.der_encoder; td->xer_decoder = asn_DEF_Narrow_15P0.xer_decoder; td->xer_encoder = asn_DEF_Narrow_15P0.xer_encoder; td->uper_decoder = asn_DEF_Narrow_15P0.uper_decoder; td->uper_encoder = asn_DEF_Narrow_15P0.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_Narrow_15P0.per_constraints; td->elements = asn_DEF_Narrow_15P0.elements; td->elements_count = asn_DEF_Narrow_15P0.elements_count; td->specifics = asn_DEF_Narrow_15P0.specifics; } void NarrowInteger_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { NarrowInteger_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NarrowInteger_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NarrowInteger_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NarrowInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { NarrowInteger_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NarrowInteger_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { NarrowInteger_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NarrowInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { NarrowInteger_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NarrowInteger_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { NarrowInteger_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } /*** <<< STAT-DEFS [NarrowInteger] >>> ***/ static ber_tlv_tag_t asn_DEF_NarrowInteger_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NarrowInteger = { "NarrowInteger", "NarrowInteger", NarrowInteger_free, NarrowInteger_print, NarrowInteger_constraint, NarrowInteger_decode_ber, NarrowInteger_encode_der, NarrowInteger_decode_xer, NarrowInteger_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NarrowInteger_tags_1, sizeof(asn_DEF_NarrowInteger_tags_1) /sizeof(asn_DEF_NarrowInteger_tags_1[0]), /* 1 */ asn_DEF_NarrowInteger_tags_1, /* Same as above */ sizeof(asn_DEF_NarrowInteger_tags_1) /sizeof(asn_DEF_NarrowInteger_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/tests/44-choice-in-sequence-OK.asn1.-P0000644000000000000000000002264011461146446020644 0ustar rootroot /*** <<< INCLUDES [T] >>> ***/ #include #include #include /*** <<< DEPS [T] >>> ***/ typedef enum b_PR { b_PR_NOTHING, /* No components present */ b_PR_c, b_PR_d, b_PR_e, b_PR_h } b_PR; typedef enum e_PR { e_PR_NOTHING, /* No components present */ e_PR_f, e_PR_g } e_PR; typedef enum h_PR { h_PR_NOTHING, /* No components present */ h_PR_i, h_PR_j } h_PR; /*** <<< TYPE-DECLS [T] >>> ***/ typedef struct T { NULL_t a; struct b { b_PR present; union T__b_u { NULL_t c; NULL_t d; struct e { e_PR present; union T__b__e_u { NULL_t f; NULL_t g; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } e; struct h { h_PR present; union T__b__h_u { NULL_t i; NULL_t j; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } h; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } b; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } T_t; /*** <<< FUNC-DECLS [T] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_T; /*** <<< STAT-DEFS [T] >>> ***/ static asn_TYPE_member_t asn_MBR_e_6[] = { { ATF_NOFLAGS, 0, offsetof(struct e, choice.f), .tag = (ASN_TAG_CLASS_PRIVATE | (7 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "f" }, { ATF_NOFLAGS, 0, offsetof(struct e, choice.g), .tag = (ASN_TAG_CLASS_PRIVATE | (8 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "g" }, }; static asn_TYPE_tag2member_t asn_MAP_e_tag2el_6[] = { { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 0, 0, 0 }, /* f at 20 */ { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 } /* g at 21 */ }; static asn_CHOICE_specifics_t asn_SPC_e_specs_6 = { sizeof(struct e), offsetof(struct e, _asn_ctx), offsetof(struct e, present), sizeof(((struct e *)0)->present), asn_MAP_e_tag2el_6, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_e_6 = { "e", "e", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_e_6, 2, /* Elements count */ &asn_SPC_e_specs_6 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_h_9[] = { { ATF_NOFLAGS, 0, offsetof(struct h, choice.i), .tag = (ASN_TAG_CLASS_PRIVATE | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "i" }, { ATF_NOFLAGS, 0, offsetof(struct h, choice.j), .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "j" }, }; static asn_TYPE_tag2member_t asn_MAP_h_tag2el_9[] = { { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i at 24 */ { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 } /* j at 25 */ }; static asn_CHOICE_specifics_t asn_SPC_h_specs_9 = { sizeof(struct h), offsetof(struct h, _asn_ctx), offsetof(struct h, present), sizeof(((struct h *)0)->present), asn_MAP_h_tag2el_9, 2, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_h_9 = { "h", "h", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_h_9, 2, /* Elements count */ &asn_SPC_h_specs_9 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_b_3[] = { { ATF_NOFLAGS, 0, offsetof(struct b, choice.c), .tag = (ASN_TAG_CLASS_PRIVATE | (5 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "c" }, { ATF_NOFLAGS, 0, offsetof(struct b, choice.d), .tag = (ASN_TAG_CLASS_PRIVATE | (6 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "d" }, { ATF_NOFLAGS, 0, offsetof(struct b, choice.e), .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_e_6, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "e" }, { ATF_NOFLAGS, 0, offsetof(struct b, choice.h), .tag = (ASN_TAG_CLASS_PRIVATE | (9 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_h_9, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "h" }, }; static asn_TYPE_tag2member_t asn_MAP_b_tag2el_3[] = { { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c at 17 */ { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */ { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f at 20 */ { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g at 21 */ { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 } /* h at 24 */ }; static asn_CHOICE_specifics_t asn_SPC_b_specs_3 = { sizeof(struct b), offsetof(struct b, _asn_ctx), offsetof(struct b, present), sizeof(((struct b *)0)->present), asn_MAP_b_tag2el_3, 5, /* Count of tags in the map */ .canonical_order = 0, .ext_start = -1 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_b_3 = { "b", "b", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_b_3, 4, /* Elements count */ &asn_SPC_b_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_T_1[] = { { ATF_NOFLAGS, 0, offsetof(struct T, a), .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_NULL, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "a" }, { ATF_NOFLAGS, 0, offsetof(struct T, b), .tag = -1 /* Ambiguous tag (CHOICE?) */, .tag_mode = 0, .type = &asn_DEF_b_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "b" }, }; static ber_tlv_tag_t asn_DEF_T_tags_1[] = { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 0, 0, 0 }, /* a at 15 */ { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 1, 0, 0 }, /* c at 17 */ { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */ { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 1, 0, 0 }, /* f at 20 */ { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */ { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 1, 0, 0 } /* h at 24 */ }; static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = { sizeof(struct T), offsetof(struct T, _asn_ctx), asn_MAP_T_tag2el_1, 6, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_T = { "T", "T", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_T_tags_1, sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]) - 1, /* 1 */ asn_DEF_T_tags_1, /* Same as above */ sizeof(asn_DEF_T_tags_1) /sizeof(asn_DEF_T_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_T_1, 2, /* Elements count */ &asn_SPC_T_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/32-sequence-of-OK.asn1.-P0000644000000000000000000003303711461146446017411 0ustar rootroot /*** <<< INCLUDES [Programming] >>> ***/ #include #include /*** <<< FWD-DECLS [Programming] >>> ***/ struct Fault; /*** <<< TYPE-DECLS [Programming] >>> ***/ typedef struct Programming { A_SEQUENCE_OF(struct Fault) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Programming_t; /*** <<< FUNC-DECLS [Programming] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Programming; /*** <<< POST-INCLUDE [Programming] >>> ***/ #include "Fault.h" /*** <<< STAT-DEFS [Programming] >>> ***/ static asn_TYPE_member_t asn_MBR_Programming_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_Fault, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_Programming_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_Programming_specs_1 = { sizeof(struct Programming), offsetof(struct Programming, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_Programming = { "Programming", "Programming", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Programming_tags_1, sizeof(asn_DEF_Programming_tags_1) /sizeof(asn_DEF_Programming_tags_1[0]), /* 1 */ asn_DEF_Programming_tags_1, /* Same as above */ sizeof(asn_DEF_Programming_tags_1) /sizeof(asn_DEF_Programming_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Programming_1, 1, /* Single element */ &asn_SPC_Programming_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Fault] >>> ***/ #include #include /*** <<< FWD-DECLS [Fault] >>> ***/ struct Error; /*** <<< TYPE-DECLS [Fault] >>> ***/ typedef struct Fault { A_SET_OF(struct Error) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Fault_t; /*** <<< FUNC-DECLS [Fault] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Fault; /*** <<< POST-INCLUDE [Fault] >>> ***/ #include "Error.h" /*** <<< STAT-DEFS [Fault] >>> ***/ static asn_TYPE_member_t asn_MBR_Fault_1[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Error, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_Fault_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_Fault_specs_1 = { sizeof(struct Fault), offsetof(struct Fault, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_Fault = { "Fault", "Fault", SET_OF_free, SET_OF_print, SET_OF_constraint, SET_OF_decode_ber, SET_OF_encode_der, SET_OF_decode_xer, SET_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Fault_tags_1, sizeof(asn_DEF_Fault_tags_1) /sizeof(asn_DEF_Fault_tags_1[0]), /* 1 */ asn_DEF_Fault_tags_1, /* Same as above */ sizeof(asn_DEF_Fault_tags_1) /sizeof(asn_DEF_Fault_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Fault_1, 1, /* Single element */ &asn_SPC_Fault_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [Error] >>> ***/ #include /*** <<< TYPE-DECLS [Error] >>> ***/ typedef struct Error { /* * This type is extensible, * possible extensions are below. */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Error_t; /*** <<< FUNC-DECLS [Error] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Error; /*** <<< STAT-DEFS [Error] >>> ***/ static ber_tlv_tag_t asn_DEF_Error_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SEQUENCE_specifics_t asn_SPC_Error_specs_1 = { sizeof(struct Error), offsetof(struct Error, _asn_ctx), 0, /* No top level tags */ 0, /* No tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_Error = { "Error", "Error", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_Error_tags_1, sizeof(asn_DEF_Error_tags_1) /sizeof(asn_DEF_Error_tags_1[0]), /* 1 */ asn_DEF_Error_tags_1, /* Same as above */ sizeof(asn_DEF_Error_tags_1) /sizeof(asn_DEF_Error_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_Error_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SeqWithMandatory] >>> ***/ #include #include #include #include /*** <<< FWD-DECLS [SeqWithMandatory] >>> ***/ struct Error; /*** <<< TYPE-DECLS [SeqWithMandatory] >>> ***/ typedef struct SeqWithMandatory { UTF8String_t someString; struct seqOfMan { A_SEQUENCE_OF(struct Error) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } seqOfMan; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SeqWithMandatory_t; /*** <<< FUNC-DECLS [SeqWithMandatory] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SeqWithMandatory; /*** <<< POST-INCLUDE [SeqWithMandatory] >>> ***/ #include "Error.h" /*** <<< STAT-DEFS [SeqWithMandatory] >>> ***/ static asn_TYPE_member_t asn_MBR_seqOfMan_3[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Error, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_seqOfMan_tags_3[] = { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_seqOfMan_specs_3 = { sizeof(struct seqOfMan), offsetof(struct seqOfMan, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_seqOfMan_3 = { "seqOfMan", "seqOfMan", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_seqOfMan_tags_3, sizeof(asn_DEF_seqOfMan_tags_3) /sizeof(asn_DEF_seqOfMan_tags_3[0]), /* 2 */ asn_DEF_seqOfMan_tags_3, /* Same as above */ sizeof(asn_DEF_seqOfMan_tags_3) /sizeof(asn_DEF_seqOfMan_tags_3[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_seqOfMan_3, 1, /* Single element */ &asn_SPC_seqOfMan_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_SeqWithMandatory_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SeqWithMandatory, someString), .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), .tag_mode = 0, .type = &asn_DEF_UTF8String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "someString" }, { ATF_NOFLAGS, 0, offsetof(struct SeqWithMandatory, seqOfMan), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = 0, .type = &asn_DEF_seqOfMan_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "seqOfMan" }, }; static ber_tlv_tag_t asn_DEF_SeqWithMandatory_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_SeqWithMandatory_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 }, /* someString at 25 */ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* seqOfMan at 27 */ }; static asn_SEQUENCE_specifics_t asn_SPC_SeqWithMandatory_specs_1 = { sizeof(struct SeqWithMandatory), offsetof(struct SeqWithMandatory, _asn_ctx), asn_MAP_SeqWithMandatory_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_SeqWithMandatory = { "SeqWithMandatory", "SeqWithMandatory", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SeqWithMandatory_tags_1, sizeof(asn_DEF_SeqWithMandatory_tags_1) /sizeof(asn_DEF_SeqWithMandatory_tags_1[0]), /* 1 */ asn_DEF_SeqWithMandatory_tags_1, /* Same as above */ sizeof(asn_DEF_SeqWithMandatory_tags_1) /sizeof(asn_DEF_SeqWithMandatory_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SeqWithMandatory_1, 2, /* Elements count */ &asn_SPC_SeqWithMandatory_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [SeqWithOptional] >>> ***/ #include #include #include #include /*** <<< FWD-DECLS [SeqWithOptional] >>> ***/ struct Error; /*** <<< TYPE-DECLS [SeqWithOptional] >>> ***/ typedef struct SeqWithOptional { UTF8String_t someString; struct seqOfOpt { A_SEQUENCE_OF(struct Error) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } *seqOfOpt; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SeqWithOptional_t; /*** <<< FUNC-DECLS [SeqWithOptional] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_SeqWithOptional; /*** <<< POST-INCLUDE [SeqWithOptional] >>> ***/ #include "Error.h" /*** <<< STAT-DEFS [SeqWithOptional] >>> ***/ static asn_TYPE_member_t asn_MBR_seqOfOpt_3[] = { { ATF_POINTER, 0, 0, .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_Error, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "" }, }; static ber_tlv_tag_t asn_DEF_seqOfOpt_tags_3[] = { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_seqOfOpt_specs_3 = { sizeof(struct seqOfOpt), offsetof(struct seqOfOpt, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_seqOfOpt_3 = { "seqOfOpt", "seqOfOpt", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_seqOfOpt_tags_3, sizeof(asn_DEF_seqOfOpt_tags_3) /sizeof(asn_DEF_seqOfOpt_tags_3[0]), /* 2 */ asn_DEF_seqOfOpt_tags_3, /* Same as above */ sizeof(asn_DEF_seqOfOpt_tags_3) /sizeof(asn_DEF_seqOfOpt_tags_3[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_seqOfOpt_3, 1, /* Single element */ &asn_SPC_seqOfOpt_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_SeqWithOptional_1[] = { { ATF_NOFLAGS, 0, offsetof(struct SeqWithOptional, someString), .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), .tag_mode = 0, .type = &asn_DEF_UTF8String, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "someString" }, { ATF_POINTER, 1, offsetof(struct SeqWithOptional, seqOfOpt), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = 0, .type = &asn_DEF_seqOfOpt_3, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, .name = "seqOfOpt" }, }; static ber_tlv_tag_t asn_DEF_SeqWithOptional_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_SeqWithOptional_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 }, /* someString at 30 */ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* seqOfOpt at 31 */ }; static asn_SEQUENCE_specifics_t asn_SPC_SeqWithOptional_specs_1 = { sizeof(struct SeqWithOptional), offsetof(struct SeqWithOptional, _asn_ctx), asn_MAP_SeqWithOptional_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_SeqWithOptional = { "SeqWithOptional", "SeqWithOptional", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ asn_DEF_SeqWithOptional_tags_1, sizeof(asn_DEF_SeqWithOptional_tags_1) /sizeof(asn_DEF_SeqWithOptional_tags_1[0]), /* 1 */ asn_DEF_SeqWithOptional_tags_1, /* Same as above */ sizeof(asn_DEF_SeqWithOptional_tags_1) /sizeof(asn_DEF_SeqWithOptional_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_SeqWithOptional_1, 2, /* Elements count */ &asn_SPC_SeqWithOptional_specs_1 /* Additional specs */ }; asn1c-0.9.24+dfsg/tests/09-int-SE.asn10000644000000000000000000000060011461150505015475 0ustar rootroot -- SE: Semantic error -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .9 ModuleTestInt3 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 9 } DEFINITIONS ::= BEGIN Reason ::= INTEGER { value1(1), value5(5), value2-1(1) -- integers must be distinct -- } END asn1c-0.9.24+dfsg/tests/14-resolver-OK.asn1.-EF0000644000000000000000000000154611461146446017133 0ustar rootrootModuleTestResolver2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 14 1 } DEFINITIONS ::= BEGIN alpha Enumeration ::= 2 other Enumeration ::= 1 Struct ::= SEQUENCE { member1 [1] EXPLICIT ModuleTestResolver3.Enumeration OPTIONAL, member2 [2] EXPLICIT OtherModuleRenamed.Enumeration DEFAULT 2 } check-alpha INTEGER ::= 2 check-other INTEGER ::= 1 END ModuleTestResolver3 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 14 2 } DEFINITIONS ::= BEGIN beta HiddenEnum ::= 2 Enumeration ::= ENUMERATED { a(1), b(2) } END HiddenModule { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 14 3 } DEFINITIONS ::= BEGIN HiddenEnum ::= ENUMERATED { a(1), b(2) } gamma Enumeration ::= 1 END asn1c-0.9.24+dfsg/tests/80-chardefs-OK.asn10000644000000000000000000000132611461147103016471 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .80 ModuleCharacterDefinitions { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 80 } DEFINITIONS ::= BEGIN -- Elements taken from ASN1-CHARACTER-MODULE (X.680:07/2002) -- { joint-iso-itu-t asn1(1) specification(0) modules(0) iso10646(0) } nul IA5String ::= {0, 0} null BMPString ::= {0, 0, 0, 0} space BMPString ::= {0, 0, 0, 32} tilde BMPString ::= {0, 0, 0, 126} BasicLatin ::= BMPString(FROM (space..tilde)) BasicGreek ::= BMPString(FROM ({0, 0, 3, 112}..{0, 0, 3, 207})) NotSpace ::= BMPString (FROM(ALL EXCEPT space)) END asn1c-0.9.24+dfsg/tests/79-constrained-by-OK.asn1.-EF0000644000000000000000000000036011461146446020217 0ustar rootrootModuleTestConstrainedBy { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 79 } DEFINITIONS ::= BEGIN Type ::= SEQUENCE { int INTEGER, ... } (CONSTRAINED BY { -- nothing -- }) END asn1c-0.9.24+dfsg/tests/115-bit-string-OK.asn10000644000000000000000000000054311461147103017053 0ustar rootroot -- OK: Everything is fine -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) -- .115 ModuleBitStringReferencedValue { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 115 } DEFINITIONS ::= BEGIN T ::= BIT STRING { one(a) } a INTEGER ::= 123 END asn1c-0.9.24+dfsg/config.h.in0000644000000000000000000000534112121076504014254 0ustar rootroot/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mergesort' function. */ #undef HAVE_MERGESORT /* Define to 1 if you have the `mkstemps' function. */ #undef HAVE_MKSTEMPS /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtoimax' function. */ #undef HAVE_STRTOIMAX /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to `int64_t' if does not define. */ #undef intmax_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `unsigned int' if does not define. */ #undef size_t asn1c-0.9.24+dfsg/configure0000755000000000000000000162415112121076151014145 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for asn1c 0.9.24. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='asn1c' PACKAGE_TARNAME='asn1c' PACKAGE_VERSION='0.9.24' PACKAGE_STRING='asn1c 0.9.24' PACKAGE_BUGREPORT='vlm@lionet.info' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS ADD_CFLAGS LEXLIB LEX_OUTPUT_ROOT LEX YFLAGS YACC CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO RANLIB AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_shared enable_static with_pic enable_fast_install enable_dependency_tracking with_gnu_ld enable_libtool_lock enable_Werror ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP YACC YFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures asn1c 0.9.24 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/asn1c] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of asn1c 0.9.24:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --enable-Werror abort compilation after any C compiler warning Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor YACC The `Yet Another C Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF asn1c configure 0.9.24 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by asn1c $as_me 0.9.24, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 $as_echo "$as_me: error: unsafe absolute working directory name" >&2;} { (exit 1); exit 1; }; };; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 $as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} { (exit 1); exit 1; }; };; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='asn1c' VERSION='0.9.24' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" case `pwd` in *\ * | *\ *) { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.2.4' macro_revision='1.2976' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed $as_unset ac_script || ac_script= if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test "${lt_cv_path_NM+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:4382: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:4385: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:4388: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -r -f conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:$LINENO: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac { $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:$LINENO: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -r -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:$LINENO: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:$LINENO: result: ok" >&5 $as_echo "ok" >&6; } fi # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 5487 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_cc_needs_belf=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LIPO+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:$LINENO: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL64+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_ld_exported_symbols_list=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:$LINENO: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:$LINENO: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM -r conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7344: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7348: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM -r conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7668: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7672: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM -r conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7773: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7777: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM -r conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM -r conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7828: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7832: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM -r conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM -r conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM -r conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" if test "$GCC" = "yes"; then output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat >conftest.$ac_ext <<_ACEOF int foo(void) {} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM -r conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM -r conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then shlibpath_overrides_runpath=yes fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 $as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 $as_echo "$ac_cv_func_shl_load" >&6; } if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 $as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 $as_echo "$ac_cv_func_dlopen" >&6; } if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_svld_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_dld_link=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 10620 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 10720 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_YACC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:$LINENO: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LEX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:$LINENO: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { yyless (input () != 0); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { (ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if test "${ac_cv_prog_lex_root+set}" = set; then $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { $as_echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 $as_echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:$LINENO: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if test "${ac_cv_lib_lex+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_lex=$ac_lib else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_prog_lex_yytext_pointer=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_AR+set}" = set; then $as_echo_n "(cached) " >&6 else case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/ucb:/usr/ccs/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_AR" && ac_cv_path_AR="ar" ;; esac fi AR=$ac_cv_path_AR if test -n "$AR"; then { $as_echo "$as_me:$LINENO: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi case "$host_os" in cygwin) case "$target" in *mingw*) CC="$CC -mno-cygwin" esac ;; esac # Check whether --enable-Werror was given. if test "${enable_Werror+set}" = set; then enableval=$enable_Werror; enable_werror=$enableval else enable_werror=no fi if test x$enable_werror = xyes; then ADD_CFLAGS="-Werror -W -Wpointer-arith" fi case "$GCC" in yes) CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Wshadow" CFLAGS="$CFLAGS -Wcast-qual" CFLAGS="$CFLAGS -Wcast-align" CFLAGS="$CFLAGS -Wchar-subscripts" CFLAGS="$CFLAGS -Wmissing-prototypes" CFLAGS="$CFLAGS -Wmissing-declarations" ;; esac { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in sys/param.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to vlm@lionet.info ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # Check for potential -arch flags. It is not universal unless # there are some -arch flags. Note that *ppc* also matches # ppc64. This check is also rather less than ideal. case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; esac else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to _BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then # Try to guess by grepping values from an object file. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; #( no) ;; #( universal) cat >>confdefs.h <<\_ACEOF #define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF ;; #( *) { { $as_echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 $as_echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac { $as_echo "$as_me:$LINENO: checking for off_t" >&5 $as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_off_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((off_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 $as_echo "$ac_cv_type_off_t" >&6; } if test "x$ac_cv_type_off_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi { $as_echo "$as_me:$LINENO: checking for size_t" >&5 $as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_size_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((size_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for intmax_t" >&5 $as_echo_n "checking for intmax_t... " >&6; } if test "${ac_cv_type_intmax_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_intmax_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (intmax_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((intmax_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_intmax_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 $as_echo "$ac_cv_type_intmax_t" >&6; } if test "x$ac_cv_type_intmax_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define intmax_t int64_t _ACEOF fi { $as_echo "$as_me:$LINENO: checking for library containing getopt" >&5 $as_echo_n "checking for library containing getopt... " >&6; } if test "${ac_cv_search_getopt+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getopt (); int main () { return getopt (); ; return 0; } _ACEOF for ac_lib in '' iberty; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_getopt=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_getopt+set}" = set; then break fi done if test "${ac_cv_search_getopt+set}" = set; then : else ac_cv_search_getopt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_getopt" >&5 $as_echo "$ac_cv_search_getopt" >&6; } ac_res=$ac_cv_search_getopt if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi for ac_func in strtoimax strtoll do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in mergesort do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in mkstemps do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files skeletons/standard-modules/Makefile skeletons/tests/Makefile libasn1compiler/Makefile libasn1parser/Makefile libasn1print/Makefile asn1c/tests/Makefile libasn1fix/Makefile doc/docsrc/Makefile skeletons/Makefile examples/Makefile tests/Makefile asn1c/Makefile doc/Makefile asn1c.spec Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by asn1c $as_me 0.9.24, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ asn1c config.status 0.9.24 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "skeletons/standard-modules/Makefile") CONFIG_FILES="$CONFIG_FILES skeletons/standard-modules/Makefile" ;; "skeletons/tests/Makefile") CONFIG_FILES="$CONFIG_FILES skeletons/tests/Makefile" ;; "libasn1compiler/Makefile") CONFIG_FILES="$CONFIG_FILES libasn1compiler/Makefile" ;; "libasn1parser/Makefile") CONFIG_FILES="$CONFIG_FILES libasn1parser/Makefile" ;; "libasn1print/Makefile") CONFIG_FILES="$CONFIG_FILES libasn1print/Makefile" ;; "asn1c/tests/Makefile") CONFIG_FILES="$CONFIG_FILES asn1c/tests/Makefile" ;; "libasn1fix/Makefile") CONFIG_FILES="$CONFIG_FILES libasn1fix/Makefile" ;; "doc/docsrc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docsrc/Makefile" ;; "skeletons/Makefile") CONFIG_FILES="$CONFIG_FILES skeletons/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "asn1c/Makefile") CONFIG_FILES="$CONFIG_FILES asn1c/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "asn1c.spec") CONFIG_FILES="$CONFIG_FILES asn1c.spec" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM -f \"$cfgfile\"; exit 1" 1 2 15 $RM -f "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi asn1c-0.9.24+dfsg/Makefile.in0000644000000000000000000006054112121076150014276 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/asn1c.spec.in \ $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL TODO config.guess config.sub depcomp \ install-sh ltconfig ltmain.sh missing mkinstalldirs ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = asn1c.spec CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = \ libasn1parser libasn1fix \ libasn1print libasn1compiler \ skeletons examples tests \ doc asn1c docsdir = $(datadir)/doc/asn1c docs_DATA = README FAQ COPYING ChangeLog BUGS TODO EXTRA_DIST = asn1c.spec.in FAQ BUGS MANIFEST CLEANFILES = asn1c.spec all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 asn1c.spec: $(top_builddir)/config.status $(srcdir)/asn1c.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-docsDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-docsDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-docsDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-docsDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/ltmain.sh0000755000000000000000000066752512015121740014071 0ustar rootroot# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.4 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.2.4 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION=2.2.4 TIMESTAMP="" package_revision=1.2976 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/usr/bin/grep -E"} : ${FGREP="/usr/bin/grep -F"} : ${GREP="/usr/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/opt/local/bin/gsed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "X$my_tmpdir" | $Xsed } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 in # Valid mode arguments: clean) ;; compile) ;; execute) ;; finish) ;; install) ;; link) ;; relink) ;; uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } ## ----------- ## ## Main. ## ## ----------- ## $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$mode' for more information." } # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_quote_for_eval "$file" args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" $ECHO "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $ECHO "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done $ECHO $ECHO "If you ever happen to want to link against installed libraries" $ECHO "in a given directory, LIBDIR, you must either use libtool, and" $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" $ECHO "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" $ECHO " during execution" fi if test -n "$runpath_var"; then $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" $ECHO " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $ECHO $ECHO "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" $ECHO "pages." ;; *) $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin | *mingw* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; " case $host in *cygwin* | *mingw* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) symtab_cflags="$symtab_cflags $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper arg # # emit a libtool wrapper script on stdout # don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variable # set therein. # # arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the '.lib' directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # end: func_emit_wrapper # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); static const char *script_text = EOF func_emit_wrapper yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat </dev/null || echo $SHELL` case $lt_newargv0 in *.exe | *.EXE) ;; *) lt_newargv0=$lt_newargv0.exe ;; esac ;; * ) lt_newargv0=$SHELL ;; esac fi cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF } # end: func_emit_cwrapperexe_src # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because the file extensions .$libext of this argument makes me believe" $ECHO "*** that it is just a static archive that I should not use here." else $ECHO $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) temp_rpath="$temp_rpath$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $ECHO $ECHO "*** And there doesn't seem to be a static archive available" $ECHO "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $ECHO $ECHO "*** Warning: This system can not link to static lib archive $lib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $ECHO "*** But as you try to build a module library, libtool will still create " $ECHO "*** a static module, that should work as long as the dlopening application" $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) func_dirname "$deplib" "" "." dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $ECHO if test "X$deplibs_check_method" = "Xnone"; then $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $ECHO $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" $ECHO "*** a static module, that should work as long as the dlopening" $ECHO "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $ECHO "*** The inter-library dependencies that have been dropped here will be" $ECHO "*** automatically added whenever a program is linked with this library" $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $ECHO $ECHO "*** Since this library must not contain undefined symbols," $ECHO "*** because either the platform does not support them or" $ECHO "*** it was explicitly requested with -no-undefined," $ECHO "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" $ECHO 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$delfiles $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 asn1c-0.9.24+dfsg/libasn1fix/0000755000000000000000000000000012223077270014272 5ustar rootrootasn1c-0.9.24+dfsg/libasn1fix/asn1fix_enum.h0000644000000000000000000000023711472004364017041 0ustar rootroot#ifndef _ASN1FIX_ENUM_H_ #define _ASN1FIX_ENUM_H_ int asn1f_fix_enum(arg_t *); /* Enumeration ::= ENUMERATED { a(1), b(2) } */ #endif /* _ASN1FIX_ENUM_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_tags.c0000644000000000000000000001064111472004364017026 0ustar rootroot#include "asn1fix_internal.h" #define ADD_TAG(skip, newtag) do { \ void *__p; \ if(skip && !(flags & AFT_FULL_COLLECT)) { \ if(newtag.tag_mode != TM_IMPLICIT) \ skip--; \ break; \ } else { \ if(newtag.tag_mode == TM_IMPLICIT) \ skip++; \ } \ __p = realloc((*tags), \ sizeof(struct asn1p_type_tag_s) * (count + 1)); \ if(!__p) return -1; \ *tags = __p; \ (*tags)[count++] = newtag; \ if((flags & AFT_FETCH_OUTMOST)) return count; \ } while(0) /* X.691, #22.2 */ static int asn1f_fetch_minimal_choice_root_tag(arg_t *arg, struct asn1p_type_tag_s *tag, enum asn1f_aft_flags_e flags); static int asn1f_fetch_tags_impl(arg_t *arg, struct asn1p_type_tag_s **tags, int count, int skip, enum asn1f_aft_flags_e flags) { asn1p_expr_t *expr = arg->expr; DEBUG("Fetching tag from %s: meta %d, type %s", expr->Identifier, expr->meta_type, expr->expr_type); /* If this type is tagged, add this tag first */ if(expr->tag.tag_class != TC_NOCLASS) ADD_TAG(skip, expr->tag); /* REMOVE ME */ if(expr->expr_type == A1TC_EXTENSIBLE) { struct asn1p_type_tag_s tt; memset(&tt, 0, sizeof(tt)); tt.tag_class = -1; ADD_TAG(skip, tt); return count; } if(expr->meta_type == AMT_TYPE) { struct asn1p_type_tag_s tt; memset(&tt, 0, sizeof(tt)); tt.tag_class = TC_UNIVERSAL; tt.tag_value = expr_type2uclass_value[expr->expr_type]; if(tt.tag_value == 0) { if(expr->expr_type == ASN_TYPE_ANY && (flags & AFT_IMAGINARY_ANY)) tt.tag_value = -1; else if(expr->expr_type != ASN_CONSTR_CHOICE) return -1; else if(count) return count; else if((flags & AFT_CANON_CHOICE) == 0) return -1; else if(asn1f_fetch_minimal_choice_root_tag(arg, &tt, flags)) return -1; } ADD_TAG(skip, tt); return count; } if(expr->meta_type == AMT_TYPEREF) { asn1p_expr_t *nexpr; DEBUG("Following the reference %s", expr->Identifier); nexpr = asn1f_lookup_symbol(arg, expr->module, expr->rhs_pspecs, expr->reference); if(nexpr == NULL) { if(errno != EEXIST) /* -fknown-extern-type */ return -1; if(!count) return 0; /* OK */ if((*tags)[count-1].tag_mode == TM_IMPLICIT) { WARNING("Tagging mode for %s " "is IMPLICIT, assuming %s " "has exactly one tag", expr->Identifier, asn1f_printable_reference(expr->reference) ); return count; } FATAL("Tagging mode %s -> %s " "dangerously incompatible", expr->Identifier, asn1f_printable_reference(expr->reference) ); return -1; } else { arg->expr = nexpr; } if(expr->_mark & TM_RECURSION) return -1; expr->_mark |= TM_RECURSION; count = asn1f_fetch_tags_impl(arg, tags, count, skip, flags); expr->_mark &= ~TM_RECURSION; return count; } DEBUG("No tags discovered for type %d", expr->expr_type); return -1; } static int asn1f_fetch_minimal_choice_root_tag(arg_t *arg, struct asn1p_type_tag_s *tag, enum asn1f_aft_flags_e flags) { struct asn1p_type_tag_s min_tag; asn1p_expr_t *v; memset(&min_tag, 0, sizeof(min_tag)); min_tag.tag_class = TC_PRIVATE + 1; TQ_FOR(v, &(arg->expr->members), next) { arg_t tmparg = *arg; struct asn1p_type_tag_s *tags = 0; int count; if(v->expr_type == A1TC_EXTENSIBLE) break; /* Search only within extension root */ tmparg.expr = v; count = asn1f_fetch_tags_impl(&tmparg, &tags, 0, 0, flags); if(count <= 0) continue; if(tags[0].tag_class < min_tag.tag_class) min_tag = tags[0]; else if(tags[0].tag_class == min_tag.tag_class && tags[0].tag_value < min_tag.tag_value) min_tag = tags[0]; free(tags); } if(min_tag.tag_class == TC_PRIVATE + 1) return -1; else *tag = min_tag; return 0; } int asn1f_fetch_outmost_tag(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, struct asn1p_type_tag_s *tag, enum asn1f_aft_flags_e flags) { struct asn1p_type_tag_s *tags; int count; flags |= AFT_FETCH_OUTMOST; count = asn1f_fetch_tags(asn, mod, expr, &tags, flags); if(count <= 0) return count; *tag = tags[0]; free(tags); return 0; } int asn1f_fetch_tags(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, struct asn1p_type_tag_s **tags_r, enum asn1f_aft_flags_e flags) { arg_t arg; struct asn1p_type_tag_s *tags = 0; int count; memset(&arg, 0, sizeof(arg)); arg.asn = asn; arg.mod = mod; arg.expr = expr; count = asn1f_fetch_tags_impl(&arg, &tags, 0, 0, flags); if(count <= 0 && tags) { free(tags); tags = 0; } *tags_r = tags; return count; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_crange.h0000644000000000000000000000370411472004363017335 0ustar rootroot#ifndef ASN1FIX_CRANGE_H #define ASN1FIX_CRANGE_H typedef struct asn1cnst_edge_s { enum asn1cnst_range_edge { ARE_MIN, ARE_MAX, ARE_VALUE, } type; int lineno; /* Line where the corresponding token was found */ asn1c_integer_t value; /* Value when type is ARE_VALUE */ } asn1cnst_edge_t; typedef struct asn1cnst_range_s { asn1cnst_edge_t left; /* MIN from (MIN..10) */ asn1cnst_edge_t right; /* 10 from (MIN..10) */ /* If range is split in parts, these are the parts */ struct asn1cnst_range_s **elements; int el_count; int el_size; int empty_constraint; /* If yes, too bad. */ int extensible; /* Extension marker (...) is in effect. */ int incompatible; /* Constraint incompatible with argument */ int not_PER_visible; /* Contains not PER-visible components */ } asn1cnst_range_t; /* * Compute the constraint range with variable PER visibility restrictions. * * (expr_type) must have the type of the top-level parent ASN.1 type. * (required_type) must be one of ACT_EL_RANGE, ACT_CT_SIZE or ACT_CT_FROM. * (minmax) and (expectation_met) should be 0. * ERRORS: * EINVAL: Mandatory arguments missing. * ENOMEM: Memory allocation failure. * EPERM: Invalid constraint reference. */ enum cpr_flags { CPR_noflags = 0x00, CPR_strict_PER_visibility = 0x01, CPR_simulate_fbless_SIZE = 0x02, }; asn1cnst_range_t *asn1constraint_compute_PER_range(asn1p_expr_type_e expr_type, const asn1p_constraint_t *ct, enum asn1p_constraint_type_e required_type, const asn1cnst_range_t *minmax, int *expectation_met, enum cpr_flags); void asn1constraint_range_free(asn1cnst_range_t *); /* * Check that a specific constraint is compatible * with the given expression type. */ int asn1constraint_compatible(asn1p_expr_type_e expr_type, enum asn1p_constraint_type_e constr_type, int fbless_SIZE); /* * Fetch a default alphabet for this type. */ asn1cnst_range_t *asn1constraint_default_alphabet(asn1p_expr_type_e expr_type); #endif /* ASN1FIX_CRANGE_H */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_compat.h0000644000000000000000000000055311472004363017360 0ustar rootroot#ifndef _ASN1FIX_COMPAT_H_ #define _ASN1FIX_COMPAT_H_ /* * Check that the expressions given are compatible in their type. * ORDER DOES MATTER! * The compatibility is being checked as if the value of b were used * to assign it to type a. */ int asn1f_check_type_compatibility(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b); #endif /* _ASN1FIX_COMPAT_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_internal.h0000644000000000000000000000706212015121740017704 0ustar rootroot#ifndef _ASN1FIX_INTERNAL_H_ #define _ASN1FIX_INTERNAL_H_ #ifdef HAVE_CONFIG_H #include #endif /* * System headers required in various modules. */ #include #include #include #include #include /* isupper() */ #include #include #ifdef HAVE_UNISTD_H #include #endif #include /* Our lovely ASN.1 parser module */ #include "asn1fix.h" #ifdef _WIN32 #define EX_NOINPUT 66 #define EX_DATAERR 65 #define snprintf _snprintf #define strcasecmp stricmp #endif #ifndef ETOOMANYREFS #define ETOOMANYREFS 144 #endif /* * A definition of a function that will log error messages. */ typedef void (*error_logger_f)(int _is_fatal, const char *fmt, ...); /* * Universal argument. */ typedef struct arg_s { asn1p_t *asn; asn1p_module_t *mod; asn1p_expr_t *expr; error_logger_f eh; error_logger_f debug; void *key; /* The next level key */ enum asn1f_flags flags; } arg_t; /* * Functions performing normalization of various types. */ #include "asn1fix_misc.h" /* Support functions */ #include "asn1fix_value.h" /* Value processing */ #include "asn1fix_cstring.h" /* Fix cstring values */ #include "asn1fix_compat.h" /* Data compatibility */ #include "asn1fix_constr.h" /* Constructed types */ #include "asn1fix_class.h" /* CLASS support */ #include "asn1fix_cws.h" /* CLASS WITH SYNTAX support */ #include "asn1fix_param.h" /* Parameterization */ #include "asn1fix_retrieve.h" /* Data retrieval */ #include "asn1fix_enum.h" /* Process ENUMERATED */ #include "asn1fix_integer.h" /* Process INTEGER */ #include "asn1fix_bitstring.h" /* Process BIT STRING */ #include "asn1fix_dereft.h" /* Dereference types */ #include "asn1fix_derefv.h" /* Dereference values */ #include "asn1fix_tags.h" /* Tags-related stuff */ #include "asn1fix_constraint.h" /* Constraint manipulation */ #include "asn1fix_crange.h" /* Constraint groking, exportable */ #include "asn1fix_export.h" /* Exported functions */ /* * Merge the return value of the called function with the already * partially computed return value of the current function. */ #define RET2RVAL(ret,rv) do { \ int __ret = ret; \ switch(__ret) { \ case 0: break; \ case 1: if(rv) break; \ case -1: rv = __ret; break; \ default: \ assert(__ret >= -1 && __ret <= 1); \ rv = -1; \ } \ } while(0) /* * Temporary substitute module for the purposes of evaluating expression. */ #define WITH_MODULE(tmp_mod, expr) do { \ void *_saved_mod = arg->mod; \ arg->mod = tmp_mod; \ do { expr; } while(0); \ arg->mod = _saved_mod; \ } while(0) #define LOG(code, fmt, args...) do { \ int _save_errno = errno; \ if(code < 0) { \ if(arg->debug) \ arg->debug(code, \ "%s: " fmt " in %s (%s:%d)", \ __func__, ##args, \ arg->mod->source_file_name, \ __FILE__, __LINE__); \ } else if(arg->eh) { \ arg->eh(code, fmt " in %s", ##args, \ arg->mod->source_file_name); \ } \ errno = _save_errno; \ } while(0) #define DEBUG(fmt, args...) LOG(-1, fmt, ##args) #define FATAL(fmt, args...) LOG( 1, fmt, ##args) #define WARNING(fmt, args...) LOG( 0, fmt, ##args) /* * Define the symbol corresponding to the name of the current function. */ #if __STDC_VERSION__ < 199901 #if !(__GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3) #define __func__ (char *)0 /* Name of the current function */ #endif /* GNUC */ /* __func__ is supposed to be defined */ #endif #endif /* _ASN1FIX_INTERNAL_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_compat.c0000644000000000000000000000675611505405150017362 0ustar rootroot#include "asn1fix_internal.h" static int asn1f_check_same_children(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b); /* * Check that the expressions given are compatible in their type. * ORDER DOES MATTER! (See .h). */ int asn1f_check_type_compatibility(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) { asn1p_expr_type_e atype, btype; atype = a->expr_type; btype = b->expr_type; DEBUG("(%s:%x@%d, %s:%x@%d)", a->Identifier, atype, a->_lineno, b->Identifier, btype, b->_lineno); /* * Expected terminal type! */ assert(atype != A1TC_REFERENCE); assert(btype != A1TC_REFERENCE); if(a == b) return 0; /* Fairly obviously */ if(atype != btype) { /* * Limited cross-compatibility of integer types. */ if((atype == A1TC_UNIVERVAL && btype == ASN_BASIC_INTEGER) || (atype == A1TC_UNIVERVAL && btype == ASN_BASIC_ENUMERATED) ) return 0; /* Limited cross-compatibility of string types */ if((atype & ASN_STRING_MASK) && (btype & ASN_STRING_MASK)) { /* X.680, B.5 */ int akm = (atype & ASN_STRING_KM_MASK) || atype == ASN_STRING_UTF8String; int bkm = (btype & ASN_STRING_KM_MASK) || btype == ASN_STRING_UTF8String; return (akm == bkm) ? 0 : -1; } DEBUG("\t%s and %s are not compatible", a->Identifier, b->Identifier); return -1; /* Fairly obviously */ } switch(atype) { case ASN_BASIC_INTEGER: /* All integers are compatible, X.680, B.4.5 */ return 0; case ASN_BASIC_ENUMERATED: /* * Enumerations are not compatible * unless their definitions are the same. */ if(asn1f_check_same_children(arg, a, b)) { DEBUG("\tEnumerations are different %s and %s", a->Identifier, b->Identifier); return -1; } return 0; default: if((atype & ASN_STRING_MASK) && (btype & ASN_STRING_MASK)) { /* String type is compatible with the same type */ return 0; } /* Compatibility is not defined yet */ DEBUG("\tCompatibility rule is not defined for %s and %s", a->Identifier, b->Identifier); return -1; } return 0; } /* * Check that the children are exactly same. */ static int asn1f_check_same_children(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) { asn1p_expr_t *achild; asn1p_expr_t *bchild; achild = TQ_FIRST(&(a->members)); bchild = TQ_FIRST(&(b->members)); while(1) { if(achild->expr_type != bchild->expr_type) return -1; if(achild->Identifier && bchild->Identifier) { if(strcmp(achild->Identifier, bchild->Identifier)) return -1; } else if(!(!achild->Identifier && !bchild->Identifier)) { return -1; } if(achild->value && bchild->value) { if(achild->value->type != bchild->value->type) return -1; switch(achild->value->type) { case ATV_INTEGER: if(achild->value->value.v_integer != bchild->value->value.v_integer) return -1; break; case ATV_REFERENCED: default: DEBUG("Value %s at lines %d and " "%d cannot be used in " "semantical equality check", asn1f_printable_value(achild->value), achild->value->value.reference->_lineno, bchild->value->value.reference->_lineno ); return -1; } } else if(!(!achild->value && !bchild->value)) { /* One of values is defined, and another is not */ return -1; } achild = TQ_NEXT(achild, next); bchild = TQ_NEXT(bchild, next); if(achild && bchild) continue; else if(!achild && !bchild) break; else return -1; } DEBUG("\t%s:%x@%d and %s:%x@%d are semantically equivalent", a->Identifier, a->expr_type, a->_lineno, b->Identifier, b->expr_type, b->_lineno); return 0; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_misc.h0000644000000000000000000000171511472004364017032 0ustar rootroot/* * Miscellaneous functions necessary for several other modules. */ #ifndef _ASN1FIX_MISC_H_ #define _ASN1FIX_MISC_H_ /* * Recursively invoke a given function over the given expr and all its * children. */ int asn1f_recurse_expr(arg_t *arg, int (*f)(arg_t *arg)); /* * Check that every child of a given expr has unique identifier. */ int asn1f_check_unique_expr(arg_t *arg); /* * Check that every preceeding child of the given expr is not * having the name of the given one. * If opt_compare == NULL, the default comparison of the argument's * names (identifiers) will be performed. */ int asn1f_check_unique_expr_child(arg_t *arg, asn1p_expr_t *child, int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b), const char *opt_property_name); /* * Return number of children. */ int asn1f_count_children(asn1p_expr_t *parent); /* * Check if type is explicitly known. */ int asn1f_check_known_external_type(const char *); #endif /* _ASN1FIX_MISC_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_class.c0000644000000000000000000000433011472004363017172 0ustar rootroot#include "asn1fix_internal.h" asn1p_expr_t * asn1f_class_access(arg_t *arg, asn1p_module_t *mod, asn1p_expr_t *rhs_pspecs, asn1p_ref_t *ref) { asn1p_expr_t *ioclass; asn1p_expr_t *classfield; asn1p_expr_t *expr; asn1p_ref_t tmpref; assert(ref->comp_count > 1); DEBUG("ClassAccess lookup (%s) for line %d", asn1f_printable_reference(ref), ref->_lineno); /* * Fetch the first part of the reference (OBJECT or ObjectSet). * OBJECT.&... * ObjectSet.&... */ assert(isupper(ref->components[0].name[0])); tmpref = *ref; tmpref.comp_count = 1; ioclass = asn1f_lookup_symbol(arg, mod, rhs_pspecs, &tmpref); if(ioclass == NULL) { errno = ESRCH; return NULL; } if(ioclass->expr_type == A1TC_REFERENCE) { ioclass = asn1f_lookup_symbol(arg, ioclass->module, ioclass->rhs_pspecs, ioclass->reference); if(ioclass == NULL) { errno = ESRCH; return NULL; } } if(ioclass->expr_type != A1TC_CLASSDEF) { if(!(ioclass->_mark & TM_BROKEN)) { ioclass->_mark |= TM_BROKEN; FATAL("Class field %s lookup at line %d in something that is not a class: %s at line %d", asn1f_printable_reference(ref), ref->_lineno, ioclass->Identifier, ioclass->_lineno); } errno = EINVAL; return NULL; } classfield = asn1f_lookup_child(ioclass, ref->components[1].name); if(classfield == NULL) { DEBUG("CLASS %s does not contain field %s", ioclass->Identifier, ref->components[1].name); errno = ESRCH; return NULL; } assert(classfield->meta_type == AMT_OBJECTFIELD); DEBUG("CLASS %s -> %s (%d)", ioclass->Identifier, classfield->Identifier, classfield->expr_type); switch(classfield->expr_type) { case A1TC_CLASSFIELD_TFS: if(TQ_FIRST(&classfield->members)) { /* Already have something */ } else { expr = asn1p_expr_new(classfield->_lineno, mod); expr->expr_type = ASN_TYPE_ANY; expr->meta_type = AMT_TYPE; asn1p_expr_add(classfield, expr); } /* Fall through */ case A1TC_CLASSFIELD_FTVFS: expr = TQ_FIRST(&classfield->members); assert(expr); return expr; break; default: FATAL("%s.%s: field type not yet supported. " "Consider donation to the asn1c author.", ioclass->Identifier, classfield->Identifier); return NULL; } return NULL; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_cws.h0000644000000000000000000000030111472004363016660 0ustar rootroot#ifndef _ASN1FIX_CLASS_WITH_SYNTAX_H_ #define _ASN1FIX_CLASS_WITH_SYNTAX_H_ /* * Parse class objects */ int asn1f_parse_class_object(arg_t *arg); #endif /* _ASN1FIX_CLASS_WITH_SYNTAX_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_class.h0000644000000000000000000000042111472004363017174 0ustar rootroot#ifndef _ASN1FIX_CLASS_H_ #define _ASN1FIX_CLASS_H_ /* * Fetch the element from the class-related stuff (thing) by its reference. */ asn1p_expr_t *asn1f_class_access(arg_t *, asn1p_module_t *mod, asn1p_expr_t *rhs_pspecs, asn1p_ref_t *); #endif /* _ASN1FIX_CLASS_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_dereft.c0000644000000000000000000000224211472004363017336 0ustar rootroot#include "asn1fix_internal.h" int asn1f_fix_dereference_types(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *type_expr; int r_value = 0; if(expr->expr_type != A1TC_REFERENCE || expr->meta_type != AMT_TYPEREF) { //assert(expr->reference == 0); return 0; /* Just ignore it */ } DEBUG("(\"%s\":%x ::= \"%s\") for line %d", expr->Identifier, expr->expr_type, asn1f_printable_value(expr->value), expr->_lineno); assert(TQ_FIRST(&(expr->members)) == 0); assert(expr->reference); /* * Follow the reference. */ type_expr = asn1f_find_terminal_type(arg, expr); if(type_expr == NULL) { const char *type_name; asn1p_expr_t *idexpr; if(errno == EEXIST) { /* Ignore missing type * if known to be defined externally: * -fknown-extern-type= */ return 0; } type_name = asn1f_printable_reference(expr->reference); /* Avoid NULL in case of unnamed T ::= SEQUENCE OF ... */ for(idexpr = expr; !idexpr->Identifier && idexpr->parent_expr; idexpr = idexpr->parent_expr); FATAL("Unknown type \"%s\" referenced by \"%s\" at line %d", type_name, idexpr->Identifier, expr->_lineno); return -1; } return r_value; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_crange.c0000644000000000000000000005161211472004363017331 0ustar rootroot#include "asn1fix_internal.h" #include "asn1fix_constraint.h" #include "asn1fix_crange.h" #undef FATAL #define FATAL(fmt, args...) do { \ fprintf(stderr, "FATAL: "); \ fprintf(stderr, fmt, ##args); \ fprintf(stderr, "\n"); \ } while(0) void asn1constraint_range_free(asn1cnst_range_t *cr) { if(cr) { int i; if(cr->elements) { for(i = 0; i < cr->el_count; i++) asn1constraint_range_free(cr->elements[i]); free(cr->elements); } free(cr); } } #define _range_free(foo) asn1constraint_range_free(foo) static asn1cnst_range_t *_range_new() { asn1cnst_range_t *r; r = calloc(1, sizeof(*r)); if(r) { r->left.type = ARE_MIN; r->right.type = ARE_MAX; } return r; } static void _range_remove_element(asn1cnst_range_t *range, int idx) { assert(idx >= 0 && idx < range->el_count); assert(!range->elements[idx]->elements); _range_free(range->elements[idx]); memmove(&range->elements[idx], &range->elements[idx + 1], (range->el_count - idx - 1) * sizeof(range->elements[0]) ); range->el_count--; range->elements[range->el_count] = 0; /* JIC */ if(range->el_count == 0) { range->el_size = 0; free(range->elements); range->elements = 0; } } static int _range_insert(asn1cnst_range_t *into, asn1cnst_range_t *cr) { assert(!cr->elements); if(into->el_count == into->el_size) { void *p; int n = into->el_size?(into->el_size << 1):4; p = realloc(into->elements, n * sizeof(into->elements[0])); if(p) { into->el_size = n; into->elements = p; } else { assert(p); return -1; } } into->elements[into->el_count++] = cr; return 0; } static asn1cnst_range_t *_range_clone(const asn1cnst_range_t *range) { asn1cnst_range_t *clone; int i; clone = _range_new(); if(!clone) return NULL; *clone = *range; clone->elements = 0; clone->el_count = 0; clone->el_size = 0; for(i = 0; i < range->el_count; i++) { asn1cnst_range_t *r = _range_clone(range->elements[i]); if(!r || _range_insert(clone, r)) { _range_free(clone); _range_free(r); return NULL; } } return clone; } static int _edge_compare(const asn1cnst_edge_t *el, const asn1cnst_edge_t *er) { switch(el->type) { case ARE_MIN: switch(er->type) { case ARE_MIN: return 0; case ARE_MAX: return -1; case ARE_VALUE: return -1; } break; case ARE_MAX: switch(er->type) { case ARE_MIN: return 1; case ARE_MAX: return 0; case ARE_VALUE: return 1; } break; case ARE_VALUE: switch(er->type) { case ARE_MIN: return 1; case ARE_MAX: return -1; case ARE_VALUE: if(el->value < er->value) return -1; if(el->value > er->value) return 1; return 0; } break; } return 0; } static int _range_compare(const void *a, const void *b) { const asn1cnst_range_t *ra = *(const asn1cnst_range_t * const *)a; const asn1cnst_range_t *rb = *(const asn1cnst_range_t * const *)b; int ret; ret = _edge_compare(&ra->left, &rb->left); if(!ret) { ret = _edge_compare(&ra->right, &rb->right); } return ret; } static char * _edge_value(const asn1cnst_edge_t *edge) { static char buf[128]; *buf = '\0'; switch(edge->type) { case ARE_MIN: strcpy(buf, "MIN"); break; case ARE_MAX: strcpy(buf, "MAX"); break; case ARE_VALUE: snprintf(buf, sizeof(buf), "%" PRIdASN, edge->value); } return buf; } static void _range_print(const asn1cnst_range_t *range) { if(_edge_compare(&range->left, &range->right)) { printf("(%s.", _edge_value(&range->left)); printf(".%s", _edge_value(&range->right)); } else { printf("(%s", _edge_value(&range->left)); } if(range->extensible) { printf(",...)"); } else { printf(")"); } if(range->incompatible) printf("/I"); if(range->not_PER_visible) printf("/!V"); if(range->el_count) { int i; printf("-=>"); for(i = 0; i < range->el_count; i++) _range_print(range->elements[i]); } } static int _edge_is_within(const asn1cnst_range_t *range, const asn1cnst_edge_t *edge) { int i; for(i = -1; i < range->el_count; i++) { const asn1cnst_range_t *r; if(i == -1) { if(range->el_count) continue; r = range; } else { r = range->elements[i]; } if(_edge_compare(&r->left, edge) <= 0 && _edge_compare(&r->right, edge) >= 0) return 1; } return 0; } static int _check_edges_within(const asn1cnst_range_t *range, const asn1cnst_range_t *r) { if(!_edge_is_within(range, &r->left)) { FATAL("Constraint value %s at line %d " "is not within " "a parent constraint range", _edge_value(&r->left), r->left.lineno ); return -1; } if(!_edge_is_within(range, &r->right)) { FATAL("Constraint value %s at line %d " "is not within " "a parent constraint range", _edge_value(&r->right), r->right.lineno ); return -1; } return 0; } static int _range_merge_in(asn1cnst_range_t *into, asn1cnst_range_t *cr) { asn1cnst_range_t *r; int prev_count = into->el_count; int i; into->not_PER_visible |= cr->not_PER_visible; into->extensible |= cr->extensible; /* * Add the element OR all its children "into". */ for(i = -1; i < cr->el_count; i++) { if(i == -1) { if(cr->el_count) continue; r = cr; } else { r = cr->elements[i]; } if(_range_insert(into, r)) { into->el_count = prev_count; /* Undo */ return -1; } } if(cr->el_count) { cr->el_count = 0; _range_free(cr); } else { /* This range is linked into "into". */ } return 0; } static int _range_fill(asn1p_value_t *val, const asn1cnst_range_t *minmax, asn1cnst_edge_t *edge, asn1cnst_range_t *range, enum asn1p_constraint_type_e type, int lineno) { unsigned char *p, *pend; edge->lineno = lineno; switch(val->type) { case ATV_INTEGER: if(type != ACT_EL_RANGE && type != ACT_CT_SIZE) { FATAL("Integer %" PRIdASN " value invalid " "for %s constraint at line %d", val->value.v_integer, asn1p_constraint_type2str(type), lineno); return -1; } edge->type = ARE_VALUE; edge->value = val->value.v_integer; return 0; case ATV_MIN: if(type != ACT_EL_RANGE && type != ACT_CT_SIZE) { FATAL("MIN invalid for %s constraint at line %d", asn1p_constraint_type2str(type), lineno); return -1; } edge->type = ARE_MIN; if(minmax) *edge = minmax->left; edge->lineno = lineno; /* Restore lineno */ return 0; case ATV_MAX: if(type != ACT_EL_RANGE && type != ACT_CT_SIZE) { FATAL("MAX invalid for %s constraint at line %d", asn1p_constraint_type2str(type), lineno); return -1; } edge->type = ARE_MAX; if(minmax) *edge = minmax->right; edge->lineno = lineno; /* Restore lineno */ return 0; case ATV_FALSE: case ATV_TRUE: if(type != ACT_EL_RANGE) { FATAL("%s is invalid for %s constraint at line %d", val->type==ATV_TRUE?"TRUE":"FALSE", asn1p_constraint_type2str(type), lineno); return -1; } edge->type = ARE_VALUE; edge->value = (val->type==ATV_TRUE); return 0; case ATV_TUPLE: case ATV_QUADRUPLE: edge->type = ARE_VALUE; edge->value = val->value.v_integer; return 0; case ATV_STRING: if(type != ACT_CT_FROM) return 0; break; case ATV_REFERENCED: FATAL("Unresolved constraint element \"%s\" at line %d", asn1f_printable_reference(val->value.reference), lineno); return -1; default: FATAL("Unrecognized constraint element at line %d", lineno); return -1; } assert(val->type == ATV_STRING); p = val->value.string.buf; pend = p + val->value.string.size; if(p == pend) return 0; edge->type = ARE_VALUE; if(val->value.string.size == 1) { edge->value = *p; } else { /* * Else this is a set: * (FROM("abcdef")) * However, (FROM("abc".."def")) is forbidden. * See also 47.4.4. */ asn1c_integer_t vmin, vmax; vmin = vmax = *p; for(; p < pend; p++) { asn1cnst_range_t *nr = _range_new(); int ret; assert(nr); if(*p < vmin) vmin = *p; if(*p > vmax) vmax = *p; ret = _range_insert(range, nr); assert(ret == 0); nr->left.type = ARE_VALUE; nr->left.value = *p; nr->left.lineno = lineno; nr->right = nr->left; } edge->value = (edge == &range->right) ? vmin : vmax; } return 0; } /* * Check if ranges contain common elements. */ static int _range_overlap(const asn1cnst_range_t *ra, const asn1cnst_range_t *rb) { int lr, rl; const asn1cnst_edge_t *ra_l = &ra->left; const asn1cnst_edge_t *ra_r = &ra->right; const asn1cnst_edge_t *rb_l = &rb->left; const asn1cnst_edge_t *rb_r = &rb->right; assert(_edge_compare(ra_l, ra_r) <= 0); assert(_edge_compare(rb_l, rb_r) <= 0); lr = _edge_compare(ra_l, rb_r); rl = _edge_compare(ra_r, rb_l); /* * L: |---| * R: |---| */ if(lr > 0) return 0; /* * L: |---| * R: |---| */ if(rl < 0) return 0; return 1; } /* * (MIN..20) x (10..15) = (MIN..9,10..15,16..20) */ static asn1cnst_range_t * _range_split(asn1cnst_range_t *ra, const asn1cnst_range_t *rb) { asn1cnst_range_t *range, *nr; int ll, rr; assert(ra); assert(rb); assert(!ra->el_count); assert(!rb->el_count); if(!_range_overlap(ra, rb)) { errno = 0; return 0; } ll = _edge_compare(&ra->left, &rb->left); rr = _edge_compare(&ra->right, &rb->right); /* * L: |---| * R: |-------| */ if(ll >= 0 && rr <= 0) { errno = 0; return 0; } range = _range_new(); assert(range); nr = _range_new(); assert(nr); /* * L: |---... * R: |--.. */ while(ll < 0) { nr->left = ra->left; nr->right = rb->left; if(nr->right.type == ARE_VALUE) { if(nr->right.value - 1 >= nr->right.value) { /* We've hit the limit here. */ break; } nr->right.value--; } _range_insert(range, nr); nr = _range_new(); assert(nr); break; } /* * L: ...---| * R: ..--| */ while(rr > 0) { nr->left = rb->right; nr->right = ra->right; if(nr->left.type == ARE_VALUE) { if(nr->left.value + 1 <= nr->left.value) { /* We've hit the limit here. */ break; } nr->left.value++; } _range_insert(range, nr); nr = _range_new(); assert(nr); break; } /* * L: |---| * R: |-----| */ nr->left = ra->left; nr->right = ra->right; if(_edge_compare(&ra->left, &rb->left) < 0) nr->left = rb->left; if(_edge_compare(&ra->right, &rb->right) > 0) nr->right = rb->right; _range_insert(range, nr); return range; } static int _range_intersection(asn1cnst_range_t *range, const asn1cnst_range_t *with, int strict_edge_check) { int ret; int i, j; assert(!range->incompatible); /* Propagate errors */ range->extensible |= with->extensible; range->not_PER_visible |= with->not_PER_visible; range->empty_constraint |= with->empty_constraint; if(range->empty_constraint) { /* No use in intersecting empty constraints */ return 0; } /* * This is an AND operation. */ /* If this is the only element, insert it into itself as a child */ if(range->el_count == 0) { asn1cnst_range_t *r = _range_new(); r->left = range->left; r->right = range->right; _range_insert(range, r); assert(range->el_count == 1); } /* * Make sure we're dealing with sane data. * G.4.2.3 */ if(strict_edge_check) { for(j = -1; j < with->el_count; j++) { if(j == -1) { if(with->el_count) continue; if(_check_edges_within(range, with)) return -1; } else { if(_check_edges_within(range, with->elements[j])) return -1; } } } /* * Split range in pieces. */ for(i = 0; i < range->el_count; i++) { for(j = -1; j < with->el_count; j++) { const asn1cnst_range_t *wel; asn1cnst_range_t *r; if(j == -1) { if(with->el_count) continue; wel = with; } else { wel = with->elements[j]; assert(!wel->el_count); /* non-compound item! */ } r = _range_split(range->elements[i], wel); if(r) { int ec; /* Substitute the current element with a split */ _range_remove_element(range, i); assert(r->el_count); for(ec = 0; ec < r->el_count; ec++) { ret = _range_insert(range, r->elements[ec]); assert(ret == 0); } r->el_count = 0; _range_free(r); i--; break; /* Try again from this point */ } } } assert(range->el_count); /* * Remove pieces which aren't AND-compatible "with" range. */ for(i = 0; i < range->el_count; i++) { for(j = -1; j < with->el_count; j++) { const asn1cnst_range_t *wel; if(j == -1) { if(with->el_count) continue; wel = with; } else { wel = with->elements[j]; } if(_range_overlap(range->elements[i], wel)) break; } if(j == with->el_count) { _range_remove_element(range, i); i--; } } if(range->el_count == 0) range->empty_constraint = 1; return 0; } static int _range_union(asn1cnst_range_t *range) { int i; qsort(range->elements, range->el_count, sizeof(range->elements[0]), _range_compare); /* * The range is sorted by the start values. */ for(i = 1; i < range->el_count; i++) { asn1cnst_range_t *ra = range->elements[i - 1]; asn1cnst_range_t *rb = range->elements[i]; if(_range_overlap(ra, rb)) { if(_edge_compare(&ra->left, &rb->left) < 0) rb->left = ra->left; if(_edge_compare(&ra->right, &rb->right) > 0) rb->right = ra->right; } else { /* * Still, range may be joined: (1..4)(5..10). * This logic is valid only for whole numbers * (i.e., not REAL type, but REAL constraints * are not PER-visible (X.691, #9.3.12). */ if(ra->right.type == ARE_VALUE && rb->left.type == ARE_VALUE && (rb->left.value - ra->right.value) == 1) { /* (1..10) */ rb->left = ra->left; } else { continue; } } /* * Squeeze the array by removing the ra. */ _range_remove_element(range, i - 1); i--; /* Retry from the current point */ } return 0; } static int _range_canonicalize(asn1cnst_range_t *range) { if(range->el_count == 0) { /* * Switch left and right edges, make them sorted. * It might be a mild warning though. */ if(_edge_compare(&range->left, &range->right) > 0) { asn1cnst_edge_t tmp = range->left; range->left = range->right; range->right = tmp; } if(range->elements) { free(range->elements); range->elements = 0; } range->el_size = 0; return 0; } /* * Remove duplicates and overlaps by merging them in. */ _range_union(range); /* Refine the left edge of a parent */ range->left = range->elements[0]->left; /* Refine the right edge of a parent */ range->right = range->elements[range->el_count - 1]->right; /* Remove the child, if it's a single one */ if(range->el_count == 1) { _range_remove_element(range, 0); } return 0; } asn1cnst_range_t * asn1constraint_compute_PER_range(asn1p_expr_type_e expr_type, const asn1p_constraint_t *ct, enum asn1p_constraint_type_e type, const asn1cnst_range_t *minmax, int *exmet, enum cpr_flags cpr_flags) { asn1cnst_range_t *range; asn1cnst_range_t *tmp; asn1p_value_t *vmin; asn1p_value_t *vmax; int expectation_met; unsigned int i; int ret; if(!exmet) { exmet = &expectation_met; *exmet = 0; } /* * Check if the requested constraint is theoretically compatible * with the given expression type. */ if(asn1constraint_compatible(expr_type, type, cpr_flags & CPR_simulate_fbless_SIZE) != 1) { errno = EINVAL; return 0; } /* Check arguments' validity. */ switch(type) { case ACT_EL_RANGE: if(exmet == &expectation_met) *exmet = 1; break; case ACT_CT_FROM: if(!minmax) { minmax = asn1constraint_default_alphabet(expr_type); if(minmax) { break; } } /* Fall through */ case ACT_CT_SIZE: if(!minmax) { static asn1cnst_range_t mm; mm.left.type = ARE_VALUE; mm.left.value = 0; mm.right.type = ARE_MAX; minmax = &mm; } break; default: errno = EINVAL; return 0; } if(minmax) { range = _range_clone(minmax); } else { range = _range_new(); } /* * X.691, #9.3.6 * Constraints on restricter character string types * which are not known-multiplier are not PER-visible. */ if((expr_type & ASN_STRING_NKM_MASK)) range->not_PER_visible = 1; if(!ct || (range->not_PER_visible && (cpr_flags & CPR_strict_PER_visibility))) return range; switch(ct->type) { case ACT_EL_VALUE: vmin = vmax = ct->value; break; case ACT_EL_RANGE: case ACT_EL_LLRANGE: case ACT_EL_RLRANGE: case ACT_EL_ULRANGE: vmin = ct->range_start; vmax = ct->range_stop; break; case ACT_EL_EXT: if(!*exmet) { range->incompatible = 1; } else { _range_free(range); errno = ERANGE; range = 0; } return range; case ACT_CT_SIZE: case ACT_CT_FROM: if(type == ct->type) { *exmet = 1; } else { range->incompatible = 1; return range; } assert(ct->el_count == 1); tmp = asn1constraint_compute_PER_range(expr_type, ct->elements[0], type, minmax, exmet, cpr_flags); if(tmp) { _range_free(range); } else { if(errno == ERANGE) { range->empty_constraint = 1; range->extensible = 1; tmp = range; } else { _range_free(range); } } return tmp; case ACT_CA_SET: /* (10..20)(15..17) */ case ACT_CA_INT: /* SIZE(1..2) ^ FROM("ABCD") */ /* AND constraints, one after another. */ for(i = 0; i < ct->el_count; i++) { tmp = asn1constraint_compute_PER_range(expr_type, ct->elements[i], type, ct->type==ACT_CA_SET?range:minmax, exmet, cpr_flags); if(!tmp) { if(errno == ERANGE) { continue; } else { _range_free(range); return NULL; } } if(tmp->incompatible) { /* * Ignore constraints * incompatible with arguments: * SIZE(1..2) ^ FROM("ABCD") * either SIZE or FROM will be ignored. */ _range_free(tmp); continue; } if(tmp->not_PER_visible && (cpr_flags & CPR_strict_PER_visibility)) { if(ct->type == ACT_CA_SET) { /* * X.691, #9.3.18: * Ignore this separate component. */ } else { /* * X.691, #9.3.19: * Ignore not PER-visible INTERSECTION */ } _range_free(tmp); continue; } ret = _range_intersection(range, tmp, ct->type == ACT_CA_SET); _range_free(tmp); if(ret) { _range_free(range); errno = EPERM; return NULL; } _range_canonicalize(range); } return range; case ACT_CA_CSV: /* SIZE(1..2, 3..4) */ case ACT_CA_UNI: /* SIZE(1..2) | FROM("ABCD") */ /* * Grab the first valid constraint. */ tmp = 0; for(i = 0; i < ct->el_count; i++) { tmp = asn1constraint_compute_PER_range(expr_type, ct->elements[i], type, minmax, exmet, cpr_flags); if(!tmp) { if(errno == ERANGE) { range->extensible = 1; continue; } else { _range_free(range); return NULL; } } if(tmp->incompatible) { _range_free(tmp); tmp = 0; } break; } if(tmp) { tmp->extensible |= range->extensible; tmp->empty_constraint |= range->empty_constraint; _range_free(range); range = tmp; } else { range->incompatible = 1; return range; } /* * Merge with the rest of them. * Canonicalizator will do the union magic. */ for(; i < ct->el_count; i++) { tmp = asn1constraint_compute_PER_range(expr_type, ct->elements[i], type, minmax, exmet, cpr_flags); if(!tmp) { if(errno == ERANGE) { range->extensible = 1; continue; } else { _range_free(range); return NULL; } } if(tmp->incompatible) { _range_free(tmp); _range_canonicalize(range); range->incompatible = 1; return range; } if(tmp->empty_constraint) { /* * Ignore empty constraints in OR logic. */ range->extensible |= tmp->extensible; _range_free(tmp); continue; } _range_merge_in(range, tmp); } _range_canonicalize(range); if(range->extensible && type == ACT_CT_FROM) { /* * X.691, #9.3.10: * Extensible permitted alphabet constraints * are not PER-visible. */ range->not_PER_visible = 1; } if(range->not_PER_visible && (cpr_flags & CPR_strict_PER_visibility)) { /* * X.691, #9.3.19: * If not PER-visible constraint is part of UNION, * the whole resulting constraint is not PER-visible. */ _range_free(range); if(minmax) range = _range_clone(minmax); else range = _range_new(); range->not_PER_visible = 1; range->incompatible = 1; } return range; case ACT_CA_EXC: /* FROM("ABCD") EXCEPT FROM("AB") */ /* * X.691, #9.3.19: * EXCEPT and the following value set is completely ignored. */ assert(ct->el_count >= 1); _range_free(range); range = asn1constraint_compute_PER_range(expr_type, ct->elements[0], type, minmax, exmet, cpr_flags); return range; default: range->incompatible = 1; return range; } if(!*exmet) { /* * Expectation is not met. Return the default range. */ range->incompatible = 1; return range; } _range_free(range); range = _range_new(); ret = _range_fill(vmin, minmax, &range->left, range, type, ct->_lineno); if(!ret) ret = _range_fill(vmax, minmax, &range->right, range, type, ct->_lineno); if(ret) { _range_free(range); errno = EPERM; return NULL; } if(minmax) { asn1cnst_range_t *clone; clone = _range_clone(minmax); /* Constrain parent type with given data. */ ret = _range_intersection(clone, range, 1); _range_free(range); if(ret) { _range_free(clone); errno = EPERM; return NULL; } range = clone; } /* * Recompute elements's min/max, remove duplicates, etc. */ _range_canonicalize(range); return range; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_constr.h0000644000000000000000000000103411472004363017400 0ustar rootroot#ifndef _ASN1FIX_CONSTRUCTED_H_ #define _ASN1FIX_CONSTRUCTED_H_ /* * Pull in COMPONENTS OF. */ int asn1f_pull_components_of(arg_t *); /* * Fix extensions in constructed types. */ int asn1f_fix_constr_ext(arg_t *); /* * Fix tagging in constructed types. */ int asn1f_fix_constr_tag(arg_t *, int fix_top_level); /* * Check distinctive tagging in constructed types. */ int asn1f_check_constr_tags_distinct(arg_t *); /* * Perform automatic tagging. */ int asn1f_fix_constr_autotag(arg_t *); #endif /* _ASN1FIX_CONSTRUCTED_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_constraint.h0000644000000000000000000000112411472004363020254 0ustar rootroot#ifndef _ASN1FIX_CONSTRAINT_H_ #define _ASN1FIX_CONSTRAINT_H_ /* * Resolve referenced values inside constraints. */ int asn1constraint_resolve(arg_t *arg, asn1p_constraint_t *ct, asn1p_expr_type_e topmost_parent_expression_type, enum asn1p_constraint_type_e effective_constraint_type); /* * Collect all subtype constraints from all parents of this type and * the type itself, forming a full constraint structure. * Honors the constraints extensibility rules (46.8) * and does other useful transformations. */ int asn1constraint_pullup(arg_t *arg); #endif /* _ASN1FIX_CONSTRAINT_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix.c0000644000000000000000000003001711472004363016006 0ustar rootroot#include "asn1fix_internal.h" #include "asn1fix.h" /* Print everything to stderr */ static void _default_error_logger(int _severity, const char *fmt, ...); /* * Internal check functions. */ static int asn1f_fix_module__phase_1(arg_t *arg); static int asn1f_fix_module__phase_2(arg_t *arg); static int asn1f_fix_simple(arg_t *arg); /* For INTEGER/ENUMERATED */ static int asn1f_fix_constructed(arg_t *arg); /* For SEQUENCE/SET/CHOICE */ static int asn1f_resolve_constraints(arg_t *arg); /* For subtype constraints */ static int asn1f_check_constraints(arg_t *arg); /* For subtype constraints */ static int asn1f_check_duplicate(arg_t *arg); static int asn1f_apply_unique_index(arg_t *arg); static int phase_1_1(arg_t *arg, int prm2); arg_t a1f_replace_me_with_proper_interface_arg; /* * Scan every module defined here in search for inconsistences. */ int asn1f_process(asn1p_t *asn, enum asn1f_flags flags, error_logger_f error_logger) { arg_t arg; int fatals = 0; int warnings = 0; int ret; /* * Check validity of arguments. */ if(asn == NULL) { errno = EINVAL; return -1; } /* * If errors handler is not specified, default to internal one. */ if(error_logger == 0) { error_logger = _default_error_logger; } memset(&arg, 0, sizeof(arg)); arg.asn = asn; arg.eh = error_logger; if(flags & A1F_DEBUG) { arg.debug = arg.eh; arg.debug(-1, "Called %s() with flags %d", __func__, flags); flags &= ~A1F_DEBUG; } /* Allow SIZE() constraint for INTEGER and other types */ if(flags & A1F_EXTENDED_SizeConstraint) { arg.flags |= A1F_EXTENDED_SizeConstraint; flags &= ~A1F_EXTENDED_SizeConstraint; if(arg.debug) { arg.debug(-1, "Extended SizeConstraint support enabled"); } } a1f_replace_me_with_proper_interface_arg = arg; /* * Check that we haven't missed an unknown flag. */ if(flags) { errno = EINVAL; return -1; } /* * Process each module in the list. * PHASE I. */ TQ_FOR(arg.mod, &(asn->modules), mod_next) { ret = asn1f_fix_module__phase_1(&arg); /* * These lines are used for illustration purposes. * RET2RVAL() is used everywhere else. */ if(ret == -1) fatals++; if(ret == 1) warnings++; } /* PHASE II. */ TQ_FOR(arg.mod, &(asn->modules), mod_next) { ret = asn1f_fix_module__phase_2(&arg); if(ret == -1) fatals++; if(ret == 1) warnings++; } memset(&a1f_replace_me_with_proper_interface_arg, 0, sizeof(arg_t)); /* * Compute a return value. */ return fatals?-1:warnings?1:0; } /* * Check the internals of a single module. */ static int asn1f_fix_module__phase_1(arg_t *arg) { asn1p_expr_t *expr; int rvalue = 0; int ret; asn1p_module_t *omod; /* * Check that we don't have a similarly named module. */ TQ_FOR(omod, &arg->asn->modules, mod_next) { int sameNames; if(omod == arg->mod) break; sameNames = strcmp(omod->ModuleName, arg->mod->ModuleName)?0:1; if(omod->module_oid && arg->mod->module_oid) { /* Compare only the OID. */ if(asn1p_oid_compare(omod->module_oid, arg->mod->module_oid) == 0) { FATAL("ASN.1 module %s in %s " "has the same OBJECT IDENTIFIER" " as module %s", omod->ModuleName, omod->source_file_name, arg->mod->ModuleName ); RET2RVAL(-1, rvalue); } else if(sameNames) { WARNING("ASN.1 module %s is defined more than once, with different OIDs", omod->ModuleName); RET2RVAL(1, rvalue); } } else if(sameNames) { FATAL("ASN.1 module %s is defined more than once", omod->ModuleName); RET2RVAL(-1, rvalue); } } switch((arg->mod->module_flags & MSF_MASK_TAGS)) { case MSF_NOFLAGS: case MSF_EXPLICIT_TAGS: case MSF_IMPLICIT_TAGS: case MSF_AUTOMATIC_TAGS: break; default: FATAL("Module %s defined with ambiguous global tagging mode", arg->mod->ModuleName); RET2RVAL(-1, rvalue); } switch((arg->mod->module_flags & MSF_MASK_INSTRUCTIONS)) { case MSF_NOFLAGS: /* * arg->mod->module_flags |= MSF_TAG_INSTRUCTIONS; */ break; case MSF_unk_INSTRUCTIONS: WARNING("Module %s defined with unrecognized " "encoding reference", arg->mod->ModuleName); RET2RVAL(1, rvalue); /* Fall through */ case MSF_TAG_INSTRUCTIONS: case MSF_XER_INSTRUCTIONS: break; default: FATAL("Module %s defined with ambiguous encoding reference", arg->mod->ModuleName); RET2RVAL(-1, rvalue); } /* * Do various non-recursive transformations. */ TQ_FOR(expr, &(arg->mod->members), next) { arg->expr = expr; ret = phase_1_1(arg, 0); RET2RVAL(ret, rvalue); /* * Make sure everybody's behaving well. */ assert(arg->expr == expr); } TQ_FOR(expr, &(arg->mod->members), next) { arg->expr = expr; ret = phase_1_1(arg, 1); RET2RVAL(ret, rvalue); assert(arg->expr == expr); } /* * 5. Automatic tagging */ TQ_FOR(expr, &(arg->mod->members), next) { arg->expr = expr; ret = asn1f_recurse_expr(arg, asn1f_fix_constr_autotag); RET2RVAL(ret, rvalue); assert(arg->expr == expr); } /* * 8. fix BIT STRING * 9. fix spaces in cstrings */ TQ_FOR(expr, &(arg->mod->members), next) { arg->expr = expr; ret = asn1f_recurse_expr(arg, asn1f_fix_bit_string); RET2RVAL(ret, rvalue); ret = asn1f_recurse_expr(arg, asn1f_fix_cstring); RET2RVAL(ret, rvalue); assert(arg->expr == expr); } /* * ... Check for tags distinctness. */ TQ_FOR(expr, &(arg->mod->members), next) { arg->expr = expr; ret = asn1f_recurse_expr(arg, asn1f_check_constr_tags_distinct); RET2RVAL(ret, rvalue); assert(arg->expr == expr); } return rvalue; } static int asn1f_fix_module__phase_2(arg_t *arg) { asn1p_expr_t *expr; int rvalue = 0; int ret; TQ_FOR(expr, &(arg->mod->members), next) { arg->expr = expr; /* * Dereference DEFAULT values. */ ret = asn1f_recurse_expr(arg, asn1f_fix_dereference_defaults); RET2RVAL(ret, rvalue); /* * Check semantic validity of constraints. */ ret = asn1f_recurse_expr(arg, asn1f_check_constraints); RET2RVAL(ret, rvalue); /* * Uniquely tag each inner type. */ asn1f_apply_unique_index(0); ret = asn1f_recurse_expr(arg, asn1f_apply_unique_index); RET2RVAL(ret, rvalue); assert(arg->expr == expr); } return rvalue; } static int phase_1_1(arg_t *arg, int prm2) { asn1p_expr_t *expr = arg->expr; int rvalue = 0; int ret; if(expr->lhs_params && expr->spec_index == -1) { int i; if(!prm2) /* Do not process the parameterized type just yet */ return 0; for(i = 0; i < expr->specializations.pspecs_count; i++) { arg->expr = expr->specializations.pspec[i].my_clone; ret = phase_1_1(arg, 0); RET2RVAL(ret, rvalue); } arg->expr = expr; /* revert */ return rvalue; } else if(prm2) { return 0; /* Already done! */ } /* Check whether this type is a duplicate */ if(!expr->lhs_params) { ret = asn1f_check_duplicate(arg); RET2RVAL(ret, rvalue); } DEBUG("=== Now processing \"%s\" (%d/0x%x) at line %d ===", expr->Identifier, expr->meta_type, expr->expr_type, expr->_lineno); assert(expr->meta_type != AMT_INVALID); /* * 2.1 Pre-process simple types (ENUMERATED, INTEGER, etc). */ ret = asn1f_recurse_expr(arg, asn1f_fix_simple); RET2RVAL(ret, rvalue); /* * 2.5.4 */ ret = asn1f_recurse_expr(arg, asn1f_fix_dereference_types); RET2RVAL(ret, rvalue); /* * Fix tagging of top-level types. */ ret = asn1f_fix_constr_tag(arg, 1); RET2RVAL(ret, rvalue); /* * 2.[234] Process SEQUENCE/SET/CHOICE types. */ ret = asn1f_recurse_expr(arg, asn1f_fix_constructed); RET2RVAL(ret, rvalue); /* * 2.5.5 */ ret = asn1f_recurse_expr(arg, asn1f_fix_dereference_values); RET2RVAL(ret, rvalue); /* * Parse class objects and fill up the object class with data. */ ret = asn1f_parse_class_object(arg); RET2RVAL(ret, rvalue); /* * Resolve references in constraints. */ ret = asn1f_recurse_expr(arg, asn1f_resolve_constraints); RET2RVAL(ret, rvalue); /* * 6. INTEGER value processed at 2.5.4. */ return rvalue; } static int asn1f_fix_simple(arg_t *arg) { int rvalue = 0; int ret; ret = asn1f_fix_enum(arg); RET2RVAL(ret, rvalue); ret = asn1f_fix_integer(arg); RET2RVAL(ret, rvalue); return rvalue; } static int asn1f_fix_constructed(arg_t *arg) { int rvalue = 0; int ret; switch(arg->expr->expr_type) { case ASN_CONSTR_SEQUENCE: case ASN_CONSTR_SET: case ASN_CONSTR_CHOICE: break; default: return 0; } /* Check identifier distinctness */ ret = asn1f_check_unique_expr(arg); RET2RVAL(ret, rvalue); /* Fix extensibility */ ret = asn1f_fix_constr_ext(arg); RET2RVAL(ret, rvalue); /* Fix tagging */ ret = asn1f_fix_constr_tag(arg, 0); RET2RVAL(ret, rvalue); /* Import COMPONENTS OF stuff */ ret = asn1f_pull_components_of(arg); RET2RVAL(ret, rvalue); return rvalue; } static int asn1f_resolve_constraints(arg_t *arg) { asn1p_expr_t *top_parent; asn1p_expr_type_e etype; int rvalue = 0; int ret; top_parent = asn1f_find_terminal_type(arg, arg->expr); if(top_parent) etype = top_parent->expr_type; else etype = A1TC_INVALID; DEBUG("(%s)", arg->expr->Identifier); ret = asn1constraint_resolve(arg, arg->expr->constraints, etype, 0); RET2RVAL(ret, rvalue); return rvalue; } static int asn1f_check_constraints(arg_t *arg) { static enum asn1p_constraint_type_e test_types[] = { ACT_EL_RANGE, ACT_CT_SIZE, ACT_CT_FROM }; asn1p_expr_t *top_parent; asn1cnst_range_t *range; asn1p_expr_type_e etype; unsigned int i; int rvalue = 0; int ret; DEBUG("(%s{%d/%d})", arg->expr->Identifier, arg->expr->meta_type, arg->expr->expr_type); top_parent = asn1f_find_terminal_type(arg, arg->expr); if(!top_parent) return 0; etype = top_parent->expr_type; ret = asn1constraint_pullup(arg); RET2RVAL(ret, rvalue); for(i = 0; i < sizeof(test_types)/sizeof(test_types[0]); i++) { range = asn1constraint_compute_PER_range( etype, arg->expr->combined_constraints, test_types[i], 0, 0, CPR_noflags /* ignore -fbless-SIZE */); if(!range && errno == EPERM) { FATAL("This error happened for \"%s\" (meta %d) " "at line %d", arg->expr->Identifier, arg->expr->meta_type, arg->expr->_lineno); return -1; } asn1constraint_range_free(range); } return rvalue; } static int asn1f_check_duplicate(arg_t *arg) { arg_t tmparg = *arg; int rvalue = 0; /* * This is a linear scan in search of a similar type. * The linear scan is just fine for the task, no need to over-optimize. */ TQ_FOR(tmparg.mod, &arg->asn->modules, mod_next) { int critical = 1; /* FATAL */ if((arg->mod->_tags & MT_STANDARD_MODULE) != (tmparg.mod->_tags & MT_STANDARD_MODULE)) { /* Ignore clashes with standard module */ critical = 0; /* WARNING */ } TQ_FOR(tmparg.expr, &(tmparg.mod->members), next) { int diff_files; /* different files */ assert(tmparg.expr->Identifier); assert(arg->expr->Identifier); if(arg->expr->spec_index != -1) continue; if(tmparg.expr == arg->expr) break; if(strcmp(tmparg.expr->Identifier, arg->expr->Identifier)) continue; diff_files = strcmp(arg->mod->source_file_name, tmparg.mod->source_file_name) ? 1 : 0; LOG(critical, "ASN.1 expression \"%s\" at line %d of module %s\n" "clashes with expression \"%s\" at line %d of module %s" "%s%s%s.\n" "Rename or remove either instance " "to resolve the conflict", arg->expr->Identifier, arg->expr->_lineno, arg->mod->ModuleName, tmparg.expr->Identifier, tmparg.expr->_lineno, tmparg.mod->ModuleName, diff_files ? " (" : "", diff_files ? tmparg.mod->source_file_name : "", diff_files ? ")" : ""); if(critical) return -1; RET2RVAL(1, rvalue); } if(tmparg.mod == arg->mod) break; } return rvalue; } static int asn1f_apply_unique_index(arg_t *arg) { static int unique_index; if(!arg) { unique_index = 0; return 0; } arg->expr->_type_unique_index = ++unique_index; return 0; } /* * Print everything to stderr */ static void _default_error_logger(int _severity, const char *fmt, ...) { va_list ap; char *pfx = ""; switch(_severity) { case -1: pfx = "DEBUG: "; break; case 0: pfx = "WARNING: "; break; case 1: pfx = "FATAL: "; break; } fprintf(stderr, "%s", pfx); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n"); } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_bitstring.h0000644000000000000000000000020711472004363020076 0ustar rootroot#ifndef _ASN1FIX_BIT_STRING_H_ #define _ASN1FIX_BIT_STRING_H_ int asn1f_fix_bit_string(arg_t *); #endif /* _ASN1FIX_BIT_STRING_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_bitstring.c0000644000000000000000000001567411472004363020107 0ustar rootroot#include "asn1fix_internal.h" static int asn1f_fix_bit_string_type(arg_t *arg); static int asn1f_fix_bit_string_value(arg_t *arg, asn1p_expr_t *ttype); static void asn1f_BS_remove_trailing_zero_bits(asn1p_value_t *value); static int asn1f_BS_unparsed_convert(arg_t *arg, asn1p_value_t *value, asn1p_expr_t *ttype); int asn1f_fix_bit_string(arg_t *arg) { asn1p_expr_t *expr = arg->expr; int r_value = 0; int ret; if(expr->meta_type == AMT_VALUE) { asn1p_expr_t *ttype; DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno); ttype = asn1f_find_terminal_type(arg, expr); if(ttype && ttype->expr_type == ASN_BASIC_BIT_STRING) { ret = asn1f_fix_bit_string_value(arg, ttype); RET2RVAL(ret, r_value); } } if(expr->meta_type == AMT_TYPE && expr->expr_type == ASN_BASIC_BIT_STRING) { ret = asn1f_fix_bit_string_type(arg); RET2RVAL(ret, r_value); } return r_value; } static int _compare_value(asn1p_expr_t *expr1, asn1p_expr_t *expr2) { return expr2->value->value.v_integer - expr1->value->value.v_integer; } static int asn1f_fix_bit_string_type(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int r_value = 0; int ret; TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) { FATAL("Extension marker (...) is not allowed " "as a BIT STRING NamedBit at line %d ", v->_lineno); return -1; } if(v->expr_type != A1TC_UNIVERVAL) { FATAL("BIT STRING value at line %d " "is not an identifier", v->_lineno); return -1; } /* 21.1 */ if(v->value == NULL) { FATAL("BIT STRING NamedBit value at line %d " "must be explicitly specified in braces", v->_lineno); return -1; } else if(v->value->type == ATV_REFERENCED) { /* Resolve the value */ if(asn1f_value_resolve(arg, v, 0)) return -1; } if(v->value->type != ATV_INTEGER || v->value->value.v_integer < 0) { FATAL("BIT STRING NamedBit value at line %d: " "non-negative integer value expected", v->_lineno); return -1; } /* Check value uniqueness as per 21.4 */ ret = asn1f_check_unique_expr_child(arg, v, _compare_value, "value"); RET2RVAL(ret, r_value); /* Check identifier uniqueness as per 21.5 */ ret = asn1f_check_unique_expr_child(arg, v, 0, "identifier"); RET2RVAL(ret, r_value); } return r_value; } static int asn1f_fix_bit_string_value(arg_t *arg, asn1p_expr_t *ttype) { asn1p_expr_t *expr = arg->expr; int r_value = 0; DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno); switch(expr->value->type) { case ATV_UNPARSED: /* * Most definitely we have something like * value BitStringType1 ::= { a, b, c } * which could not be parsed by the LALR parser, mostly * because it requires knowledge about BitStringType1 * during the parsing. So, here's a little hack: we create * a buffer containing the full specification of a module, * which contains some pre-defined INTEGER type with the * opaque definition "{ a, b, c }" from the bit string. */ if(asn1f_BS_unparsed_convert(arg, expr->value, ttype)) { r_value = -1; break; } /* Fall through: remove trailing zero bits */ case ATV_BITVECTOR: asn1f_BS_remove_trailing_zero_bits(expr->value); break; default: break; } return r_value; } static void asn1f_BS_remove_trailing_zero_bits(asn1p_value_t *value) { int lmfb = -1; /* Last meaningful byte position */ int bits; /* Number of bits in the BIT STRING value */ int b; assert(value->type == ATV_BITVECTOR); bits = value->value.binary_vector.size_in_bits; /* * Figure out the rightmost meaningful byte. */ for(b = 0; b < ((bits + 7) >> 3); b++) { uint8_t uc = value->value.binary_vector.bits[b]; if(uc && b > lmfb) lmfb = b; } if(lmfb == -1) { bits = 0; } else { uint8_t uc; uc = value->value.binary_vector.bits[lmfb]; bits = (lmfb+1) * 8; /* * Squeeze the bit string width until the rightmost * bit is set. */ for(; uc && (uc & 1) == 0; uc >>= 1) bits--; if(uc == 0) { bits = lmfb * 8; } } value->value.binary_vector.size_in_bits = bits; } static int asn1f_BS_unparsed_convert(arg_t *arg, asn1p_value_t *value, asn1p_expr_t *ttype) { asn1p_t *asn; asn1p_module_t *mod; asn1p_expr_t *V; asn1p_expr_t *bit; asn1c_integer_t aI; uint8_t *bitbuf; int bits; int psize; char *p; int ret; int r_value = 0; assert(value->type == ATV_UNPARSED); psize = value->value.string.size + 64; p = malloc(psize); if(p == NULL) return -1; ret = snprintf(p, psize, "M DEFINITIONS ::=\nBEGIN\n" "V ::= INTEGER %s\n" "END\n", value->value.string.buf ); assert(ret < psize); psize = ret; asn = asn1p_parse_buffer(p, psize, A1P_NOFLAGS); free(p); if(asn == NULL) { FATAL("Cannot parse BIT STRING value %s " "defined as %s at line %d", arg->expr->Identifier, value->value.string.buf, arg->expr->_lineno ); return -1; } mod = TQ_FIRST(&(asn->modules)); assert(mod); V = TQ_FIRST(&(mod->members)); assert(V); assert(strcmp(V->Identifier, "V") == 0); assert(TQ_FIRST(&(V->members))); /* * Simple loop just to fetch the maximal bit position * out of the BIT STRING value defined as NamedBitList. */ aI = -1; TQ_FOR(bit, &(V->members), next) { asn1p_expr_t *bitdef; bitdef = asn1f_lookup_child(ttype, bit->Identifier); if(bitdef && bitdef->value && bitdef->value->type == ATV_INTEGER) { if(bitdef->value->value.v_integer > aI) aI = bitdef->value->value.v_integer; } } if(aI > 1024 * 1024 * 8) { /* One megabyte */ FATAL("Unsupportedly large BIT STRING value \"%s\" " "defined at line %d " "(larger than 1MByte)", arg->expr->Identifier, arg->expr->_lineno ); asn1p_delete(asn); return -1; } bits = aI + 1; /* Number of bits is more than a last bit position */ bitbuf = calloc(1, 1 + ((bits + 7) / 8)); if(bitbuf == NULL) { asn1p_delete(asn); return -1; } TQ_FOR(bit, &(V->members), next) { asn1p_expr_t *bitdef; int set_bit_pos; if(bit->value) { WARNING("Identifier \"%s\" at line %d " "must not have a value", bit->Identifier, bit->_lineno); RET2RVAL(1, r_value); } bitdef = asn1f_lookup_child(ttype, bit->Identifier); if(bitdef == NULL) { FATAL("Identifier \"%s\" at line %d is not defined " "in the \"%s\" type definition at line %d", bit->Identifier, bit->_lineno, ttype->Identifier, ttype->_lineno ); RET2RVAL(-1, r_value); continue; } if(bitdef->value == NULL || bitdef->value->type != ATV_INTEGER) { FATAL("Broken identifier " "\"%s\" at line %d " "referenced by \"%s\" at line %d", bitdef->Identifier, bitdef->_lineno, arg->expr->Identifier, arg->expr->_lineno ); RET2RVAL(-1, r_value); continue; } assert(bitdef->value->value.v_integer < bits); set_bit_pos = bitdef->value->value.v_integer; bitbuf[set_bit_pos>>3] |= 1 << (7-(set_bit_pos % 8)); } asn1p_delete(asn); free(value->value.string.buf); value->type = ATV_BITVECTOR; value->value.binary_vector.bits = bitbuf; value->value.binary_vector.size_in_bits = bits; return r_value; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_export.h0000644000000000000000000000203211472004364017411 0ustar rootroot/* * This header exports fixer procedures that are common enough to be used * in other modules. */ #ifndef _ASN1FIX_EXPORT_H_ #define _ASN1FIX_EXPORT_H_ #include "asn1fix_tags.h" /* * Create a human-readable representation of a reference and value. */ char const *asn1f_printable_reference(asn1p_ref_t *ref); char const *asn1f_printable_value(asn1p_value_t *value); /* * Exportable version of an asn1f_lookup_symbol(). */ asn1p_expr_t *asn1f_lookup_symbol_ex( asn1p_t *asn, asn1p_expr_t *expr, asn1p_ref_t *ref); /* * Exportable version of an asn1f_class_access(). */ asn1p_expr_t *asn1f_class_access_ex(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, asn1p_expr_t *rhs_rspecs, asn1p_ref_t *); /* * Exportable version of asn1f_find_terminal_type(). */ asn1p_expr_t *asn1f_find_terminal_type_ex(asn1p_t *asn, asn1p_expr_t *tc); /* * Exportable version of asn1f_fix_dereference_values(); */ int asn1f_fix_dereference_values_ex(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr); #endif /* _ASN1FIX_EXPORT_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_constraint_compat.c0000644000000000000000000001416411472004363021622 0ustar rootroot#include "asn1fix_internal.h" #include "asn1fix_crange.h" /* * Check that a specific constraint is compatible * with the given expression type. */ int asn1constraint_compatible(asn1p_expr_type_e expr_type, enum asn1p_constraint_type_e constr_type, int fbless_SIZE) { if(expr_type == ASN_BASIC_REAL) return -1; /* Not yet supported */ /* * X.680-0207, Table 9. */ switch(constr_type) { case ACT_INVALID: return 0; case ACT_EL_TYPE: return 1; case ACT_EL_VALUE: return 1; case ACT_EL_RANGE: case ACT_EL_LLRANGE: case ACT_EL_RLRANGE: case ACT_EL_ULRANGE: switch(expr_type) { case ASN_BASIC_ENUMERATED: case ASN_BASIC_BOOLEAN: /* * The ValueRange constraint is not formally * applicable to the above types. However, we * support it just fine. */ /* Fall through */ case ASN_BASIC_INTEGER: case ASN_BASIC_REAL: return 1; default: if(expr_type & ASN_STRING_MASK) return 1; } return 0; case ACT_EL_EXT: return -1; case ACT_CT_FROM: if(expr_type & ASN_STRING_MASK) return 1; return 0; case ACT_CT_SIZE: switch(expr_type) { case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: if(fbless_SIZE) return 1; break; case ASN_BASIC_BIT_STRING: case ASN_BASIC_OCTET_STRING: case ASN_BASIC_CHARACTER_STRING: case ASN_CONSTR_SEQUENCE_OF: case ASN_CONSTR_SET_OF: return 1; default: if(expr_type & ASN_STRING_MASK) return 1; } return 0; case ACT_CT_WCOMP: case ACT_CT_WCOMPS: switch(expr_type) { case A1TC_INSTANCE: case ASN_BASIC_EXTERNAL: case ASN_BASIC_EMBEDDED_PDV: case ASN_BASIC_REAL: case ASN_BASIC_CHARACTER_STRING: case ASN_CONSTR_CHOICE: case ASN_CONSTR_SEQUENCE: case ASN_CONSTR_SEQUENCE_OF: case ASN_CONSTR_SET: case ASN_CONSTR_SET_OF: return 1; default: break; } return 0; case ACT_CT_CTDBY: return 1; case ACT_CT_CTNG: /* X.682, #11 */ switch(expr_type) { case ASN_BASIC_OCTET_STRING: case ASN_BASIC_BIT_STRING: return 1; default: return 0; } case ACT_CT_PATTERN: if(expr_type & ASN_STRING_MASK) return 1; return 0; case ACT_CA_SET: case ACT_CA_CRC: case ACT_CA_CSV: case ACT_CA_UNI: case ACT_CA_INT: case ACT_CA_EXC: case ACT_CA_AEX: return 1; } return -1; } #define DECL_RANGE(foo, val1, val2, pv) \ static asn1cnst_range_t range_ ## foo = { \ { ARE_VALUE, 0, val1 }, \ { ARE_VALUE, 0, val2 }, \ 0, 0, 0, 0, 0, 0, pv } #define DECL(foo, val1, val2) DECL_RANGE(foo, val1, val2, 0) #define DECL_notPV(foo, val1, val2) DECL_RANGE(foo, val1, val2, 1) asn1cnst_range_t * asn1constraint_default_alphabet(asn1p_expr_type_e expr_type) { DECL_notPV(octstr, 0x00, 0xff); /* Not PER-visible */ DECL_notPV(utf8, 0x00, 0x7fffffff); /* Not PER-visible */ DECL(bmp, 0x00, 65533); /* 64K-2 cells */ DECL(uint7, 0x00, 0x7f); DECL(uint32, 0x00, 0xffffffff); DECL(Space, 0x20, 0x20); DECL(ApostropheAndParens, 0x27, 0x29); DECL(PlusTillColon, 0x2b, 0x3a); DECL(Equal, 0x3d, 0x3d); DECL(QuestionMark, 0x3f, 0x3f); DECL(Digits, 0x30, 0x39); DECL(AlphaCap, 0x41, 0x5a); DECL(AlphaLow, 0x61, 0x7a); DECL(PlusCommaMinusDot, 0x2b, 0x2e); DECL(Plus, 0x2b, 0x2b); DECL(MinusDot, 0x2d, 0x2e); DECL(Z, 0x5a, 0x5a); static asn1cnst_range_t *range_NumericString_array[] = { &range_Space, &range_Digits }; static asn1cnst_range_t *range_PrintableString_array[] = { &range_Space, &range_ApostropheAndParens, &range_PlusTillColon, &range_Equal, &range_QuestionMark, &range_AlphaCap, &range_AlphaLow }; static asn1cnst_range_t *range_UTCTime_array[] = { &range_Plus, &range_MinusDot, &range_Digits, &range_Z }; static asn1cnst_range_t *range_GeneralizedTime_array[] = { &range_PlusCommaMinusDot, &range_Digits, &range_Z }; static asn1cnst_range_t range_notPERVisible = { { ARE_MIN, 0, 0 }, { ARE_MAX, 0, 0 }, 0, 0, 0, 0, 0, 0, 1 }; static asn1cnst_range_t range_NumericString = { { ARE_VALUE, 0, 0x20 }, { ARE_VALUE, 0, 0x39 }, range_NumericString_array, sizeof(range_NumericString_array) /sizeof(range_NumericString_array[0]), 0, 0, 0, 0, 0 }; static asn1cnst_range_t range_PrintableString = { { ARE_VALUE, 0, 0x20 }, { ARE_VALUE, 0, 0x7a }, range_PrintableString_array, sizeof(range_PrintableString_array) /sizeof(range_PrintableString_array[0]), 0, 0, 0, 0, 0 }; static asn1cnst_range_t range_VisibleString = { { ARE_VALUE, 0, 0x20 }, { ARE_VALUE, 0, 0x7e }, 0, 0, 0, 0, 0, 0, 0 }; static asn1cnst_range_t range_UTCTime = { { ARE_VALUE, 0, 0x2b }, { ARE_VALUE, 0, 0x5a }, range_UTCTime_array, sizeof(range_UTCTime_array) /sizeof(range_UTCTime_array[0]), 0, 0, 0, 0, 1 }; static asn1cnst_range_t range_GeneralizedTime = { { ARE_VALUE, 0, 0x2b }, { ARE_VALUE, 0, 0x5a }, range_GeneralizedTime_array, sizeof(range_GeneralizedTime_array) /sizeof(range_GeneralizedTime_array[0]), 0, 0, 0, 0, 1 }; switch(expr_type) { case ASN_STRING_NumericString: return &range_NumericString; case ASN_STRING_PrintableString: return &range_PrintableString; case ASN_STRING_VisibleString: return &range_VisibleString; case ASN_STRING_IA5String: return &range_uint7; case ASN_STRING_BMPString: return &range_bmp; case ASN_STRING_UTF8String: /* * X.691, #9.3.6 * Not a known-multipler character string type. */ assert(range_utf8.not_PER_visible); return &range_utf8; case ASN_STRING_UniversalString: return &range_uint32; case ASN_BASIC_UTCTime: /* Permitted alphabet constraint is not applicable */ assert(range_UTCTime.not_PER_visible); return &range_UTCTime; case ASN_BASIC_GeneralizedTime: /* Permitted alphabet constraint is not applicable */ assert(range_GeneralizedTime.not_PER_visible); return &range_GeneralizedTime; case ASN_BASIC_OCTET_STRING: /* * Permitted alphabet constraint is not applicable * to this type. However, we support it, albeit not * in a strict PER mode. */ assert(range_octstr.not_PER_visible); return &range_octstr; default: if(!(expr_type & ASN_STRING_MASK)) break; assert(expr_type & ASN_STRING_NKM_MASK); /* * X.691, 9.3.6 * Not a known-multiplier character string. */ return &range_notPERVisible; } return NULL; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix.h0000644000000000000000000000157411472004363016021 0ustar rootroot/* * This is the public interface for the processor (fixer) of the ASN.1 tree * produced by the libasn1parser. */ #ifndef ASN1FIX_H #define ASN1FIX_H #include /* * Operation flags for the function below. */ enum asn1f_flags { A1F_NOFLAGS, A1F_DEBUG = 0x01, /* Print debugging output */ A1F_EXTENDED_SizeConstraint = 0x02, /* Enable constraint gen code */ }; /* * Perform a set of semantics checks, transformations and small fixes * on the given tree. * RETURN VALUES: * -1: Some fatal problems were encountered. * 0: No inconsistencies were found. * 1: Some warnings were issued, but no fatal problems encountered. */ int asn1f_process(asn1p_t *_asn, enum asn1f_flags, void (*error_log_callback)(int _severity, const char *fmt, ...)); /* * Explicitly mark type as known. */ int asn1f_make_known_external_type(const char *); #endif /* ASN1FIX_H */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_param.h0000644000000000000000000000033311472004364017172 0ustar rootroot#ifndef _ASN1FIX_PARAMETERIZATION_H_ #define _ASN1FIX_PARAMETERIZATION_H_ asn1p_expr_t *asn1f_parameterization_fork(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *rhs_pspecs); #endif /* _ASN1FIX_PARAMETERIZATION_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_derefv.c0000644000000000000000000000254511472004364017347 0ustar rootroot#include "asn1fix_internal.h" /* * Dereference DefinedValues: */ int asn1f_fix_dereference_values(arg_t *arg) { asn1p_expr_t *expr = arg->expr; int r_value = 0; if(expr->value && expr->meta_type == AMT_VALUE) { if(asn1f_value_resolve(arg, expr, 0)) { /* This function will emit messages */ r_value = -1; } } return r_value; } /* * Dereference DEFAULT values */ int asn1f_fix_dereference_defaults(arg_t *arg) { asn1p_expr_t *expr = arg->expr; int r_value = 0; if(expr->marker.default_value) { arg_t tmparg = *arg; asn1p_expr_t tmpexpr = *expr; switch(expr->marker.default_value->type) { default: return r_value; case ATV_REFERENCED: break; } if(expr->expr_type == A1TC_CLASSFIELD_FTVFS) { asn1p_expr_t *child = TQ_FIRST(&expr->members); int ret; assert(child); assert(child->marker.default_value == 0); tmparg.expr = child; child->marker.default_value=expr->marker.default_value; ret = asn1f_fix_dereference_defaults(&tmparg); expr->marker.default_value = child->marker.default_value; if(ret == 0) return 0; /* Finished */ } tmparg.expr = &tmpexpr; tmpexpr.meta_type = AMT_VALUE; tmpexpr.marker.default_value = 0; tmpexpr.value = expr->marker.default_value; if(asn1f_value_resolve(&tmparg, &tmpexpr, 0)) r_value = -1; expr->marker.default_value = tmpexpr.value; } return r_value; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_misc.c0000644000000000000000000002025511472004364017025 0ustar rootroot#include "asn1fix_internal.h" #include "asn1fix.h" char const * asn1f_printable_reference(asn1p_ref_t *ref) { if(ref) { asn1p_value_t v; v.type = ATV_REFERENCED; v.value.reference = ref; return asn1f_printable_value(&v); } else { return ""; } } char const * asn1f_printable_value(asn1p_value_t *v) { static char buf[128]; static char *managedptr; static size_t managedptr_len; int ret; #define ENSURE(len) do { \ size_t __len = (len); \ if(__len >= managedptr_len) { \ if(managedptr) \ free(managedptr); \ managedptr = malloc(__len + 1); \ if(managedptr) { \ managedptr_len = __len; \ } else { \ managedptr_len = 0; \ return ""; \ } \ } \ } while(0) if(v == NULL) return ""; switch(v->type) { case ATV_NOVALUE: return ""; case ATV_NULL: return "NULL"; case ATV_REAL: ret = snprintf(buf, sizeof(buf), "%f", v->value.v_double); if(ret >= (ssize_t)sizeof(buf)) memcpy(buf + sizeof(buf) - 4, "...", 4); return buf; case ATV_INTEGER: ret = snprintf(buf, sizeof(buf), "%" PRIdASN, v->value.v_integer); if(ret >= (ssize_t)sizeof(buf)) memcpy(buf + sizeof(buf) - 4, "...", 4); return buf; case ATV_MIN: return "MIN"; case ATV_MAX: return "MAX"; case ATV_FALSE: return "FALSE"; case ATV_TRUE: return "TRUE"; case ATV_TUPLE: ret = snprintf(buf, sizeof(buf), "{%d, %d}", (int)(v->value.v_integer >> 4), (int)(v->value.v_integer & 0xff)); if(ret >= (ssize_t)sizeof(buf)) memcpy(buf + sizeof(buf) - 4, "...", 4); return buf; case ATV_QUADRUPLE: ret = snprintf(buf, sizeof(buf), "{%d, %d, %d, %d}", (int)((v->value.v_integer >> 24) & 0xff), (int)((v->value.v_integer >> 16) & 0xff), (int)((v->value.v_integer >> 8) & 0xff), (int)(v->value.v_integer & 0xff)); if(ret >= (ssize_t)sizeof(buf)) memcpy(buf + sizeof(buf) - 4, "...", 4); return buf; case ATV_STRING: case ATV_UNPARSED: /* Buffer is guaranteed to be null-terminated */ assert(v->value.string.buf[v->value.string.size] == '\0'); return (char *)v->value.string.buf; case ATV_TYPE: return ""; case ATV_BITVECTOR: { uint8_t *bitvector; char *ptr; size_t len; int i; /* * Compute number of bytes necessary * to represend the binary value. */ int bits = v->value.binary_vector.size_in_bits; len = ((bits%8)?bits:(bits >> 2)) + sizeof("''H"); /* * Reallocate managed buffer */ ENSURE(len); /* * Fill the buffer. */ ptr = managedptr; bitvector = v->value.binary_vector.bits; *ptr++ = '\''; if(bits%8) { /* * Dump bit by bit. */ for(i = 0; i < bits; i++) { uint8_t uc; uc = bitvector[i>>3]; *ptr++ = ((uc >> (7-(i%8)))&1)?'1':'0'; } } else { static const char *hextable="0123456789ABCDEF"; /* * Dump byte by byte. */ for(i = 0; i < (bits >> 3); i++) { *ptr++ = hextable[bitvector[i] >> 4]; *ptr++ = hextable[bitvector[i] & 0x0f]; } } *ptr++ = '\''; *ptr++ = (bits%8)?'B':'H'; *ptr++ = 'H'; assert(len == (size_t)(ptr - managedptr)); return managedptr; } case ATV_REFERENCED: { asn1p_ref_t *ref; size_t reflen; char *ptr; int i; assert(v->value.reference); ref = v->value.reference; reflen = ref->comp_count; /* Number of dots */ for(i = 0; i < ref->comp_count; i++) reflen += strlen(ref->components[i].name); /* * Make sure we have a buffer of this size. */ ENSURE(reflen); /* * Fill-up the buffer. */ ptr = managedptr; for(i = 0; i < ref->comp_count; i++) { char *nc; if(i) *ptr++ = '.'; for(nc = ref->components[i].name; *nc; nc++) *ptr++ = *nc; } *ptr++ = '\0'; assert(reflen == (size_t)(ptr - managedptr)); return managedptr; } case ATV_VALUESET: return ""; case ATV_CHOICE_IDENTIFIER: { char *cid = v->value.choice_identifier.identifier; char const *vptr = asn1f_printable_value( v->value.choice_identifier.value); char *val; val = strdup(vptr); if(!val) return ""; ENSURE(strlen(cid) + sizeof(": ") + strlen(val)); ret = snprintf(managedptr, managedptr_len + 1, "%s: %s", cid, val); assert(ret >= 0 && (size_t)ret <= managedptr_len); free(val); return managedptr; } } return ""; } /* * Recursively invoke a given function over the given expr and all its * children. */ int asn1f_recurse_expr(arg_t *arg, int (*callback)(arg_t *arg)) { asn1p_expr_t *expr = arg->expr; int rvalue = 0; int ret; assert(expr); if(expr->lhs_params && expr->spec_index == -1) { int i; for(i = 0; i < expr->specializations.pspecs_count; i++) { arg->expr = expr->specializations.pspec[i].my_clone; ret = asn1f_recurse_expr(arg, callback); RET2RVAL(ret, rvalue); } arg->expr = expr; /* revert */ return rvalue; } /* * Invoke the callback at this very level. */ ret = callback(arg); RET2RVAL(ret, rvalue); /* * Recursively invoke myself * to iterate over each element in the tree. */ TQ_FOR(arg->expr, &(expr->members), next) { assert(arg->expr->expr_type != A1TC_INVALID); assert(arg->expr->parent_expr == expr); ret = asn1f_recurse_expr(arg, callback); RET2RVAL(ret, rvalue); } arg->expr = expr; /* Restore original position */ return rvalue; } /* * Check that every child of a given expr has unique name or does not have any. */ int asn1f_check_unique_expr(arg_t *arg) { asn1p_expr_t *expr; int rvalue = 0; TQ_FOR(expr, &(arg->expr->members), next) { if(expr->Identifier) { int ret = asn1f_check_unique_expr_child(arg, expr, 0, "identifier"); if(ret) rvalue = -1; } else { /* * No point of comparing this child with any other: * this one does not have a name. */ } } return rvalue; } /* * Check that every preceeding child of the given expr is not * having the name of the given one. */ int asn1f_check_unique_expr_child(arg_t *arg, asn1p_expr_t *child, int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b), const char *opt_property_name) { asn1p_expr_t *expr; if(!opt_property_name) opt_property_name = "property"; assert(child); assert(opt_compare || child->Identifier); TQ_FOR(expr, &(arg->expr->members), next) { int ret; if(expr == child) break; /* * Compare according to the custom rule or default * names comparisons. */ if(opt_compare) { ret = opt_compare(expr, child); } else { if(expr->Identifier == NULL || expr->expr_type == A1TC_EXTENSIBLE) continue; ret = strcasecmp(expr->Identifier, child->Identifier); } if(ret == 0) { FATAL("Clash detected: " "\"%s\" at line %d has similar %s with " "\"%s\" at line %d", expr->Identifier, expr->_lineno, opt_property_name, child->Identifier, child->_lineno ); return -1; } } return 0; } int asn1f_count_children(asn1p_expr_t *expr) { asn1p_expr_t *child; int count = 0; TQ_FOR(child, &(expr->members), next) { count++; } return count; } static char **known_types; static int known_types_count; static int known_types_size; static int _known_types_cmp(const void *ap, const void *bp) { const char *a = *(const char * const *)ap; const char *b = *(const char * const *)bp; return strcmp(a, b); } int asn1f_make_known_external_type(const char *type_name) { char *tname; /* Check for duplicates */ if(asn1f_check_known_external_type(type_name) == 0) { errno = EEXIST; return -1; } /* Ensure enough space */ if(known_types_count <= known_types_size) { int n = known_types_size ? known_types_size << 1 : 4; void *p; p = realloc(known_types, n * sizeof(known_types[0])); if(!p) return -1; known_types = p; known_types_size = n; } tname = strdup(type_name); if(!tname) return -1; known_types[known_types_count++] = tname; #ifdef HAVE_MERGESORT mergesort #else qsort #endif (known_types, known_types_count, sizeof(known_types[0]), _known_types_cmp); return 0; } int asn1f_check_known_external_type(const char *type_name) { if(known_types_count) { void *p = bsearch(&type_name, known_types, known_types_count, sizeof(known_types[0]), _known_types_cmp); if(p) return 0; } errno = ESRCH; return -1; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_constraint.c0000644000000000000000000002031711472004363020254 0ustar rootroot#include "asn1fix_internal.h" #include "asn1fix_constraint.h" #include "asn1fix_crange.h" static void _remove_extensions(arg_t *arg, asn1p_constraint_t *ct, int flast); static int constraint_type_resolve(arg_t *arg, asn1p_constraint_t *ct); static int constraint_value_resolve(arg_t *arg, asn1p_value_t **value, enum asn1p_constraint_type_e real_ctype); int asn1constraint_pullup(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *top_parent; asn1p_constraint_t *ct_parent; asn1p_constraint_t *ct_expr; int ret; if(expr->combined_constraints) return 0; /* Operation already performed earlier */ switch(expr->meta_type) { case AMT_TYPE: case AMT_TYPEREF: break; default: return 0; /* Nothing to do */ } if(expr->expr_type == A1TC_REFERENCE) { asn1p_ref_t *ref = expr->reference; asn1p_expr_t *parent_expr; assert(ref); parent_expr = asn1f_lookup_symbol(arg, expr->module, expr->rhs_pspecs, ref); if(!parent_expr) { if(errno != EEXIST) { DEBUG("\tWhile fetching parent constraints: " "type \"%s\" not found: %s", asn1f_printable_reference(ref), strerror(errno)); return -1; } else { /* * -fknown-extern-type is given. * Assume there are no constraints there. */ WARNING("External type \"%s\": " "assuming no constraints", asn1f_printable_reference(ref)); ct_parent = 0; } } else { arg->expr = parent_expr; ret = asn1constraint_pullup(arg); arg->expr = expr; if(ret) return ret; ct_parent = parent_expr->combined_constraints; } } else { ct_parent = 0; } ct_expr = expr->constraints; if(!ct_parent && !ct_expr) return 0; /* No constraints to consider */ /* * Resolve constraints, if not already resolved. */ top_parent = asn1f_find_terminal_type(arg, arg->expr); ret = asn1constraint_resolve(arg, ct_expr, top_parent ? top_parent->expr_type : A1TC_INVALID, 0); if(ret) return ret; /* * Copy parent type constraints. */ if(ct_parent) { ct_parent = asn1p_constraint_clone(ct_parent); assert(ct_parent); } /* * If the current type does not have constraints, it inherits * the constraints of a parent. */ if(ct_parent && !ct_expr) { expr->combined_constraints = ct_parent; return 0; } ct_expr = asn1p_constraint_clone(ct_expr); assert(ct_expr); /* * Now we have a set of current expression's constraints, * and an optional set of the parent expression's constraints. */ if(ct_parent) { /* * If we have a parent, remove all the extensions (46.4). */ _remove_extensions(arg, ct_parent, 0); expr->combined_constraints = ct_parent; if(ct_expr->type == ACT_CA_SET) { unsigned int i; for(i = 0; i < ct_expr->el_count; i++) { if(asn1p_constraint_insert( expr->combined_constraints, ct_expr->elements[i])) { expr->combined_constraints = 0; asn1p_constraint_free(ct_expr); asn1p_constraint_free(ct_parent); return -1; } else { ct_expr->elements[i] = 0; } } asn1p_constraint_free(ct_expr); } else { asn1p_constraint_insert(expr->combined_constraints, ct_expr); } } else { _remove_extensions(arg, ct_expr, 1); expr->combined_constraints = ct_expr; } return 0; } int asn1constraint_resolve(arg_t *arg, asn1p_constraint_t *ct, asn1p_expr_type_e etype, enum asn1p_constraint_type_e effective_type) { enum asn1p_constraint_type_e real_constraint_type; unsigned int el; int rvalue = 0; int ret; DEBUG("(\"%s\")", arg->expr->Identifier); if(!ct) return 0; /* Don't touch information object classes */ switch(ct->type) { case ACT_CT_SIZE: case ACT_CT_FROM: if(effective_type && effective_type != ct->type) { FATAL("%s at line %d: " "Incompatible nested %s within %s", arg->expr->Identifier, ct->_lineno, asn1p_constraint_type2str(ct->type), asn1p_constraint_type2str(effective_type) ); } effective_type = ct->type; break; case ACT_CT_WCOMP: case ACT_CT_WCOMPS: case ACT_CA_CRC: return 0; default: break; } real_constraint_type = effective_type ? effective_type : ct->type; if(etype != A1TC_INVALID) { ret = asn1constraint_compatible(etype, real_constraint_type, arg->flags & A1F_EXTENDED_SizeConstraint); switch(ret) { case -1: /* If unknown, assume OK. */ case 1: break; case 0: default: FATAL("%s at line %d: " "Constraint type %s is not applicable to %s", arg->expr->Identifier, ct->_lineno, asn1p_constraint_type2str(real_constraint_type), ASN_EXPR_TYPE2STR(etype) ); rvalue = -1; break; } } else { WARNING("%s at line %d: " "Constraints ignored: Unresolved parent type", arg->expr->Identifier, arg->expr->_lineno); } /* * Resolve all possible references, wherever they occur. */ if(ct->containedSubtype) { ret = constraint_type_resolve(arg, ct); RET2RVAL(ret, rvalue); } if(ct->value && ct->value->type == ATV_REFERENCED) { ret = constraint_value_resolve(arg, &ct->value, real_constraint_type); RET2RVAL(ret, rvalue); } if(ct->range_start && ct->range_start->type == ATV_REFERENCED) { ret = constraint_value_resolve(arg, &ct->range_start, real_constraint_type); RET2RVAL(ret, rvalue); } if(ct->range_stop && ct->range_stop->type == ATV_REFERENCED) { ret = constraint_value_resolve(arg, &ct->range_stop, real_constraint_type); RET2RVAL(ret, rvalue); } /* * Proceed recursively. */ for(el = 0; el < ct->el_count; el++) { ret = asn1constraint_resolve(arg, ct->elements[el], etype, effective_type); RET2RVAL(ret, rvalue); } return rvalue; } static void _remove_extensions(arg_t *arg, asn1p_constraint_t *ct, int forgive_last) { unsigned int i; if(!ct) return; for(i = 0; i < ct->el_count; i++) { if(ct->elements[i]->type == ACT_EL_EXT) break; if(forgive_last && ct->type == ACT_CA_SET && i + 1 == ct->el_count) return; _remove_extensions(arg, ct->elements[i], 0); } /* Remove the elements at and after the extensibility mark */ for(; i < ct->el_count; ct->el_count--) { asn1p_constraint_t *rm; rm = ct->elements[ct->el_count-1]; asn1p_constraint_free(rm); } if(i < ct->el_size) ct->elements[i] = 0; } static int constraint_type_resolve(arg_t *arg, asn1p_constraint_t *ct) { asn1p_constraint_t *ct_expr; int ret; DEBUG("(\"%s\")", asn1f_printable_value(ct->containedSubtype)); if(ct->containedSubtype->type == ATV_VALUESET) { ct_expr = ct->containedSubtype->value.constraint; DEBUG("Found %s in constraints", "ValueSet"); } else if(ct->containedSubtype->type == ATV_REFERENCED) { asn1p_expr_t *rtype; arg_t tmparg; rtype = asn1f_lookup_symbol(arg, arg->expr->module, arg->expr->rhs_pspecs, ct->containedSubtype->value.reference); if(!rtype) { FATAL("Cannot find type \"%s\" in constraints " "at line %d", asn1f_printable_value(ct->containedSubtype), ct->_lineno); return -1; } tmparg = *arg; tmparg.expr = rtype; tmparg.mod = rtype->module; ret = asn1constraint_pullup(&tmparg); if(ret) return ret; ct_expr = rtype->combined_constraints; if(!ct_expr) return 0; } else { FATAL("Unsupported feature at line %d", ct->_lineno); return -1; } ct_expr = asn1p_constraint_clone(ct_expr); assert(ct_expr); _remove_extensions(arg, ct_expr, 0); if(ct_expr->type == ACT_CA_SET) { unsigned int i; for(i = 0; i < ct_expr->el_count; i++) { if(asn1p_constraint_insert( ct, ct_expr->elements[i])) { asn1p_constraint_free(ct_expr); return -1; } else { ct_expr->elements[i] = 0; } } asn1p_constraint_free(ct_expr); } else { ret = asn1p_constraint_insert(ct, ct_expr); assert(ret == 0); } ct->type = ACT_CA_SET; asn1p_value_free(ct->containedSubtype); ct->containedSubtype = NULL; return 0; } static int constraint_value_resolve(arg_t *arg, asn1p_value_t **value, enum asn1p_constraint_type_e real_ctype) { asn1p_expr_t static_expr; arg_t tmp_arg; int rvalue = 0; int ret; DEBUG("(\"%s\", within <%s>)", asn1f_printable_value(*value), asn1p_constraint_type2str(real_ctype)); static_expr = *arg->expr; static_expr.value = *value; static_expr.meta_type = AMT_VALUE; tmp_arg = *arg; tmp_arg.mod = arg->expr->module; tmp_arg.expr = &static_expr; ret = asn1f_value_resolve(&tmp_arg, &static_expr, &real_ctype); RET2RVAL(ret, rvalue); assert(static_expr.value); *value = static_expr.value; return rvalue; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_value.c0000644000000000000000000001266111505405150017203 0ustar rootroot#include "asn1fix_internal.h" static int _asn1f_copy_value(arg_t *arg, asn1p_expr_t *to,asn1p_expr_t *from); int asn1f_value_resolve(arg_t *arg, asn1p_expr_t *expr, const enum asn1p_constraint_type_e *opt_constr_type) { asn1p_expr_t *val_type_expr; asn1p_expr_t *value_expr; asn1p_expr_t *type_expr; int ret; /* Make sure this IS a value assignment */ assert(expr->meta_type == AMT_VALUE); assert(expr->value); if(expr->value->type != ATV_REFERENCED) return 0; DEBUG("(=\"%s\", %x%s%s)", asn1f_printable_value(expr->value), expr->expr_type, opt_constr_type ? ", " : "", opt_constr_type ? asn1p_constraint_type2str(*opt_constr_type) : "" ); /* * 1. Find the terminal type for this assignment. */ type_expr = asn1f_find_terminal_type(arg, expr); if(type_expr == 0) { if(errno == EEXIST) { DEBUG("External type for %s at line %d", expr->Identifier, expr->_lineno); return 0; } else { FATAL("Terminal type for %s at line %d not found", expr->Identifier, expr->_lineno); return -1; } } if(asn1f_look_value_in_type(arg, type_expr, expr) == -1) { FATAL("Value not found in type for %s at line %d", expr->Identifier, expr->_lineno); return -1; } /* * 2. Find the terminal value also. */ value_expr = asn1f_find_terminal_value(arg, expr); if(value_expr) { DEBUG("Terminal value for %s->%s is %s at line %d", expr->Identifier, asn1f_printable_value(expr->value), value_expr->Identifier, value_expr->_lineno); } else { FATAL("Terminal value for %s->%s not found", expr->Identifier, asn1f_printable_value(expr->value)); return -1; } /* * 3. Find the _type_ of a _terminal value_. */ WITH_MODULE(value_expr->module, val_type_expr = asn1f_find_terminal_type(arg, value_expr)); if(val_type_expr) { DEBUG("Terminal type of value %s->%s is %s at line %d", expr->Identifier, asn1f_printable_value(expr->value), val_type_expr->Identifier, val_type_expr->_lineno); } else { FATAL("Terminal type of value %s->%s not found", expr->Identifier, asn1f_printable_value(expr->value)); return -1; } /* * 4. Check compatibility between the type of the current expression * and the type of the discovered value. */ if(opt_constr_type) ret = asn1constraint_compatible(val_type_expr->expr_type, *opt_constr_type, 0 /* must not matter here */); else ret = asn1f_check_type_compatibility(arg, type_expr, val_type_expr); if(ret == -1) { switch(type_expr->expr_type) { default: if(!(type_expr->expr_type & ASN_STRING_MASK)) break; /* Compatibility rules are not defined */ /* Fall through */ case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: FATAL("Incompatible type of \"%s\" (%s) at line %d " "with \"%s\" (%s) at line %d", type_expr->Identifier, ASN_EXPR_TYPE2STR(type_expr->expr_type), type_expr->_lineno, val_type_expr->Identifier, ASN_EXPR_TYPE2STR(val_type_expr->expr_type), val_type_expr->_lineno); return -1; case ASN_BASIC_OBJECT_IDENTIFIER: /* * Ignore this for now. * We can't deal with OIDs inheritance properly yet. */ return 0; } WARNING("Possibly incompatible type of \"%s\" (%s) at line %d " "with \"%s\" (%s) at line %d", type_expr->Identifier, ASN_EXPR_TYPE2STR(type_expr->expr_type), type_expr->_lineno, val_type_expr->Identifier, ASN_EXPR_TYPE2STR(val_type_expr->expr_type), val_type_expr->_lineno); return 1; } if(asn1f_look_value_in_type(arg, val_type_expr, expr) == -1) return -1; /* * 5. Copy value from the terminal value into the current expression. */ ret = _asn1f_copy_value(arg, expr, value_expr); if(ret == -1) { FATAL("Value %s cannot be copied from line %d to line %d", asn1f_printable_value(value_expr->value), value_expr->_lineno, expr->_lineno); return -1; } DEBUG("Final value for \"%s\" at line %d is %s", expr->Identifier, expr->_lineno, asn1f_printable_value(expr->value)); return 0; } static int _asn1f_copy_value(arg_t *arg, asn1p_expr_t *to, asn1p_expr_t *from) { asn1p_value_t *v; v = asn1p_value_clone(from->value); if(v) { asn1p_value_free(to->value); to->value = v; DEBUG("Copied value %s from \"%s\" on line %d " "to \"%s\" on line %d", asn1f_printable_value(v), from->Identifier, from->_lineno, to->Identifier, to->_lineno ); return 0; } else { return -1; } } int asn1f_look_value_in_type(arg_t *arg, asn1p_expr_t *type_expr, asn1p_expr_t *value_expr) { asn1p_expr_t *child_expr; char *identifier; if(value_expr->value->type != ATV_REFERENCED || value_expr->value->value.reference->comp_count != 1) return 0; if(type_expr->expr_type != ASN_BASIC_INTEGER && type_expr->expr_type != ASN_BASIC_ENUMERATED) return 0; DEBUG("(for %s in %s %x) for line %d", asn1f_printable_value(value_expr->value), type_expr->Identifier, type_expr->expr_type, value_expr->_lineno); /* * Look into the definitions of the type itself: * Type1 ::= INTEGER { a(1), b(2) } * value Type1 = b -- will assign 2 */ identifier = value_expr->value->value.reference->components[0].name; child_expr = asn1f_lookup_child(type_expr, identifier); DEBUG("Looking into a type %s at line %d for %s at line %d: %s", type_expr->Identifier, type_expr->_lineno, identifier, value_expr->_lineno, child_expr ? asn1f_printable_value(child_expr->value) : "" ); if(child_expr && child_expr->value) { if(_asn1f_copy_value(arg, value_expr, child_expr)) return -1; /* Fall through */ } return 0; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_export.c0000644000000000000000000000314611472004364017413 0ustar rootroot#include "asn1fix_internal.h" #include "asn1fix_export.h" extern arg_t a1f_replace_me_with_proper_interface_arg; asn1p_expr_t * asn1f_lookup_symbol_ex( asn1p_t *asn, asn1p_expr_t *expr, asn1p_ref_t *ref) { arg_t arg; memset(&arg, 0, sizeof(arg)); arg.asn = asn; arg.mod = expr->module; arg.expr = expr; arg.eh = a1f_replace_me_with_proper_interface_arg.eh; arg.debug = a1f_replace_me_with_proper_interface_arg.debug; return asn1f_lookup_symbol(&arg, expr->module, expr->rhs_pspecs, ref); } asn1p_expr_t * asn1f_class_access_ex(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, asn1p_expr_t *rhs_pspecs, asn1p_ref_t *ref) { arg_t arg; memset(&arg, 0, sizeof(arg)); arg.asn = asn; arg.mod = mod; arg.expr = expr; arg.eh = a1f_replace_me_with_proper_interface_arg.eh; arg.debug = a1f_replace_me_with_proper_interface_arg.debug; return asn1f_class_access(&arg, mod, rhs_pspecs, ref); } asn1p_expr_t * asn1f_find_terminal_type_ex(asn1p_t *asn, asn1p_expr_t *expr) { arg_t arg; memset(&arg, 0, sizeof(arg)); arg.asn = asn; arg.mod = expr->module; arg.expr = expr; arg.eh = a1f_replace_me_with_proper_interface_arg.eh; arg.debug = a1f_replace_me_with_proper_interface_arg.debug; return asn1f_find_terminal_type(&arg, expr); } int asn1f_fix_dereference_values_ex(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr) { arg_t arg; memset(&arg, 0, sizeof(arg)); arg.asn = asn; arg.mod = mod; arg.expr = expr; arg.eh = a1f_replace_me_with_proper_interface_arg.eh; arg.debug = a1f_replace_me_with_proper_interface_arg.debug; return asn1f_fix_dereference_values(&arg); } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_integer.c0000644000000000000000000000652111472004364017527 0ustar rootroot#include "asn1fix_internal.h" static int _compare_value(asn1p_expr_t *expr1, asn1p_expr_t *expr2) { if(expr2->value->type == ATV_INTEGER && expr1->value->type == ATV_INTEGER) { return expr2->value->value.v_integer - expr1->value->value.v_integer; } else { return -1; } } /* * Check the validity of an INTEGER type. */ int asn1f_fix_integer(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *iv; int rvalue = 0; int ret; if(expr->expr_type != ASN_BASIC_INTEGER) return 0; /* Just ignore it */ DEBUG("(\"%s\", %x) for line %d", expr->Identifier, expr->expr_type, expr->_lineno); /* * Scan the integer values in search for inconsistencies. */ TQ_FOR(iv, &(expr->members), next) { DEBUG("\tItem %s(%s)", iv->Identifier, asn1f_printable_value(iv->value)); /* * Found "...", check correctness. */ if(iv->expr_type == A1TC_EXTENSIBLE) { FATAL("INTEGER %s at line %d: " "Extension marker is not allowed", expr->Identifier, iv->_lineno); rvalue = -1; continue; } if(iv->Identifier == NULL || iv->expr_type != A1TC_UNIVERVAL) { FATAL("INTEGER %s at line %d: " "Unsupported enumeration element %s", expr->Identifier, iv->_lineno, iv->Identifier?iv->Identifier:"" ); rvalue = -1; continue; } if(iv->value == NULL) { FATAL("INTEGER %s at line %d: " "Value for the identifier %s " "must be set explicitly", expr->Identifier, iv->_lineno, iv->Identifier ); rvalue = -1; continue; } else if(iv->value->type == ATV_REFERENCED) { /* * Resolve the value, once and for all. */ if(asn1f_value_resolve(arg, iv, 0)) { /* This function will emit messages */ rvalue = -1; continue; } } if(iv->value->type != ATV_INTEGER) { FATAL("INTEGER %s at line %d: " "Value for the identifier %s " "is not compatible with INTEGER type", expr->Identifier, iv->_lineno); rvalue = -1; continue; } /* * Check that all identifiers are distinct. */ ret = asn1f_check_unique_expr_child(arg, iv, 0, "identifier"); RET2RVAL(ret, rvalue); /* * Check that all values are distinct. */ ret = asn1f_check_unique_expr_child(arg, iv, _compare_value, "value"); RET2RVAL(ret, rvalue); } return rvalue; } static int _asn1f_make_sure_type_is(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_type_e type) { asn1p_expr_t *next_expr; asn1p_expr_type_e expr_type; int ret; expr_type = expr->expr_type; /* * Here we're trying to make sure that the type of the given * expression is really what is expected. * This is ensured in two ways. * First, if the immediate type matches the provided one, * this is a clear hit. */ if(expr_type == type) return 0; /* * Otherwise, it must be either a reference or a different type. */ if(expr_type != A1TC_REFERENCE) { errno = EPERM; return -1; } assert(expr_type == A1TC_REFERENCE); assert(expr->reference); /* * Then, it is a reference. For a reference, try to resolve type * and try again. */ next_expr = asn1f_lookup_symbol(arg, expr->module, expr->rhs_pspecs, expr->reference); if(next_expr == NULL) { errno = ESRCH; return -1; } /* * If symbol is here, recursively check that it conforms to the type. */ WITH_MODULE(next_expr->module, ret = _asn1f_make_sure_type_is(arg, next_expr, type)); return ret; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_dereft.h0000644000000000000000000000020211472004364017336 0ustar rootroot#ifndef _ASN1FIX_DEREFT_H_ #define _ASN1FIX_DEREFT_H_ int asn1f_fix_dereference_types(arg_t *); #endif /* _ASN1FIX_DEREFT_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_enum.c0000644000000000000000000000774712015121740017041 0ustar rootroot#include "asn1fix_internal.h" /* * Check the validity of an enumeration. */ int asn1f_fix_enum(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *ev; asn1c_integer_t max_value = -1; asn1c_integer_t max_value_ext = -1; int rvalue = 0; asn1p_expr_t *ext_marker = NULL; /* "..." position */ int ret; /* Keep track of value collisions */ asn1c_integer_t *used_vals; int used_vals_sz = 50; int used_vals_next = 0; if(expr->expr_type != ASN_BASIC_ENUMERATED) return 0; /* Just ignore it */ DEBUG("(%s)", expr->Identifier); used_vals = (asn1c_integer_t *) malloc(sizeof(asn1c_integer_t) * used_vals_sz); if (!used_vals) { FATAL("Out of memory"); return -1; } /* * 1. Scan the enumeration values in search for inconsistencies. */ TQ_FOR(ev, &(expr->members), next) { asn1c_integer_t eval; if(ev->value) DEBUG("\tItem %s(%s)", ev->Identifier, asn1f_printable_value(ev->value)); else DEBUG("\tItem %s", ev->Identifier); /* * 1.1 Found an extension mark "...", check correctness. */ if(ev->expr_type == A1TC_EXTENSIBLE) { if(ext_marker) { FATAL("Enumeration %s at line %d: " "Second extension marker is not allowed", expr->Identifier, ev->_lineno); rvalue = -1; } else { /* * Remember the marker's position. */ ext_marker = ev; } continue; } else if(ev->Identifier == NULL || ev->expr_type != A1TC_UNIVERVAL) { FATAL( "Enumeration %s at line %d: " "Unsupported enumeration element %s", expr->Identifier, ev->_lineno, ev->Identifier?ev->Identifier:""); rvalue = -1; continue; } /* * 1.2 Compute the value of the enumeration element. */ if(ev->value) { switch(ev->value->type) { case ATV_INTEGER: eval = ev->value->value.v_integer; break; case ATV_REFERENCED: FATAL("HERE HERE HERE", 1); rvalue = -1; continue; break; default: FATAL("ENUMERATED type %s at line %d " "contain element %s(%s) at line %d", expr->Identifier, expr->_lineno, ev->Identifier, asn1f_printable_value(ev->value), ev->_lineno); rvalue = -1; continue; } } else { eval = max_value + 1; ev->value = asn1p_value_fromint(eval); if(ev->value == NULL) { rvalue = -1; continue; } } /* * 1.3 Check the applicability of this value. */ /* * Enumeration is allowed to be unordered * before the first marker, but after the marker * the values must be ordered. */ if (ext_marker) { if (eval > max_value_ext) { max_value_ext = eval; } else { FATAL( "Enumeration %s at line %d: " "Explicit value \"%s(%" PRIdASN ")\" " "is not greater " "than previous values (max %" PRIdASN ")", expr->Identifier, ev->_lineno, ev->Identifier, eval, max_value_ext); rvalue = -1; } } if (eval > max_value) { max_value = eval; } /* * 1.4 Check that all identifiers are unique */ int unique = 1; int uv_idx; for (uv_idx = 0; uv_idx < used_vals_next; uv_idx++) { if (used_vals[uv_idx] == eval) { FATAL( "Enumeration %s at line %d: " "Explicit value \"%s(%" PRIdASN ")\" " "collides with previous values", expr->Identifier, ev->_lineno, ev->Identifier, eval); rvalue = -1; unique = 0; } } if (unique) { /* Grow the array if needed */ if (used_vals_next >= used_vals_sz) { asn1c_integer_t *temp; int new_sz = used_vals_sz + 50; temp = (asn1c_integer_t *) realloc(used_vals, sizeof(asn1c_integer_t) * new_sz); if (!temp) return -1; used_vals = temp; used_vals_sz = new_sz; } used_vals[used_vals_next++] = eval; } /* * 1.5 Check that all identifiers before the current one * differs from it. */ ret = asn1f_check_unique_expr_child(arg, ev, 0, "identifier"); RET2RVAL(ret, rvalue); } free(used_vals); /* * 2. Reorder the first half (before optional "...") of the * identifiers alphabetically. */ // TODO return rvalue; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_integer.h0000644000000000000000000000024311472004364017527 0ustar rootroot#ifndef _ASN1FIX_INTEGER_H_ #define _ASN1FIX_INTEGER_H_ int asn1f_fix_integer(arg_t *); /* Type1 ::= INTEGER { a(1), b(2) } */ #endif /* _ASN1FIX_INTEGER_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_cws.c0000644000000000000000000001415311472004363016665 0ustar rootroot#include "asn1fix_internal.h" #include "asn1fix_cws.h" static int _asn1f_parse_class_object_data(arg_t *, asn1p_expr_t *eclass, struct asn1p_ioc_row_s *row, asn1p_wsyntx_t *syntax, uint8_t *buf, const uint8_t *bend, int optional_mode, uint8_t **newpos); static int _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row, struct asn1p_ioc_cell_s *cell, uint8_t *buf, const uint8_t *bend); int asn1f_parse_class_object(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *eclass; asn1p_ioc_row_t *row; void *new_rows_ptr; int ret; if(expr->meta_type != AMT_VALUE || expr->expr_type != A1TC_REFERENCE || !expr->value || expr->value->type != ATV_UNPARSED) return 0; /* * Find the governing class. */ eclass = asn1f_find_terminal_type(arg, expr); if(!eclass || eclass->meta_type != AMT_OBJECTCLASS || eclass->expr_type != A1TC_CLASSDEF) { return 0; } DEBUG("Value %s of CLASS %s found at line %d", expr->Identifier, eclass->Identifier, expr->_lineno); if(!eclass->with_syntax) { DEBUG("Can't process classes without %s just yet", "WITH SYNTAX"); return 0; } row = asn1p_ioc_row_new(eclass); assert(row); ret = _asn1f_parse_class_object_data(arg, eclass, row, eclass->with_syntax, expr->value->value.string.buf + 1, expr->value->value.string.buf + expr->value->value.string.size - 1, 0, 0); if(ret) { LOG((ret < 0), "Cannot parse %s of CLASS %s found at line %d", expr->Identifier, eclass->Identifier, expr->_lineno); asn1p_ioc_row_delete(row); return ret; } new_rows_ptr = realloc(eclass->object_class_matrix.row, (eclass->object_class_matrix.rows + 1) * sizeof(eclass->object_class_matrix.row[0])); assert(new_rows_ptr); eclass->object_class_matrix.row = new_rows_ptr; eclass->object_class_matrix.row[eclass->object_class_matrix.rows] = row; eclass->object_class_matrix.rows++; /* Propagate max identifier length */ if(eclass->object_class_matrix.max_identifier_length < row->max_identifier_length) eclass->object_class_matrix.max_identifier_length = row->max_identifier_length; return 0; } #define SKIPSPACES for(; buf < bend && isspace(*buf); buf++) static int _asn1f_parse_class_object_data(arg_t *arg, asn1p_expr_t *eclass, struct asn1p_ioc_row_s *row, asn1p_wsyntx_t *syntax, uint8_t *buf, const uint8_t *bend, int optional_mode, uint8_t **newpos) { struct asn1p_wsyntx_chunk_s *chunk; int ret; TQ_FOR(chunk, (&syntax->chunks), next) { switch(chunk->type) { case WC_LITERAL: { int token_len = strlen(chunk->content.token); SKIPSPACES; if(bend - buf < token_len || memcmp(buf, chunk->content.token, token_len)) { if(!optional_mode) { FATAL("While parsing object class value %s at line %d: Expected: \"%s\", found: \"%s\"", arg->expr->Identifier, arg->expr->_lineno, chunk->content.token, buf); } if(newpos) *newpos = buf; return -1; } buf += token_len; } break; case WC_WHITESPACE: break; /* Ignore whitespace */ case WC_FIELD: { struct asn1p_ioc_cell_s *cell; int lbraces = 0; uint8_t *p; SKIPSPACES; p = buf; if(p < bend && *p == '{') lbraces = 1, p++; for(; p < bend; p++) { if(lbraces) { /* Search the terminating brace */ switch(*p) { case '}': lbraces--; break; case '{': lbraces++; break; } } else if(isspace(*p)) { break; } } if(lbraces) { FATAL("Field reference %s found in class value definition for %s at line %d can not be satisfied by broken value \"%s\"", chunk->content.token, arg->expr->Identifier, arg->expr->_lineno, buf); if(newpos) *newpos = buf; return -1; } cell = asn1p_ioc_row_cell_fetch(row, chunk->content.token); if(cell == NULL) { FATAL("Field reference %s found in WITH SYNAX {} clause does not match actual field in Object Class %s", chunk->content.token, eclass->Identifier, eclass->_lineno); if(newpos) *newpos = buf; return -1; } DEBUG("Reference %s satisfied by %s (%d)", chunk->content.token, buf, p - buf); ret = _asn1f_assign_cell_value(arg, row, cell, buf, p); if(ret) return ret; buf = p; if(newpos) *newpos = buf; } break; case WC_OPTIONALGROUP: { uint8_t *np = 0; SKIPSPACES; ret = _asn1f_parse_class_object_data(arg, eclass, row, chunk->content.syntax, buf, bend, 1, &np); if(newpos) *newpos = np; if(ret && np != buf) return ret; buf = np; } break; } } if(newpos) *newpos = buf; return 0; } static int _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row, struct asn1p_ioc_cell_s *cell, uint8_t *buf, const uint8_t *bend) { asn1p_expr_t *expr; asn1p_ref_t *ref; int idLength; char *p; if((bend - buf) <= 0) { FATAL("Assignment warning: empty string is being assigned into %s for %s at line %d", cell->field->Identifier, arg->expr->Identifier, arg->expr->_lineno); return -1; } p = malloc(bend - buf + 1); assert(p); memcpy(p, buf, bend - buf); p[bend - buf] = '\0'; if(!isalpha(*p)) { if(isdigit(*p)) { asn1c_integer_t value; if(asn1p_atoi(p, &value)) { FATAL("Value %s at line %d is too large for this compiler! Contact the asn1c author.\n", p, arg->expr->_lineno); return -1; } expr = asn1p_expr_new(arg->expr->_lineno, arg->expr->module); expr->Identifier = p; expr->meta_type = AMT_VALUE; expr->expr_type = ASN_BASIC_INTEGER; expr->value = asn1p_value_fromint(value); } else { WARNING("asn1c is not yet able to parse arbitrary direct values; try converting %s at line %d to a reference.", p, arg->expr->_lineno); free(p); return 1; } } else { ref = asn1p_ref_new(arg->expr->_lineno); asn1p_ref_add_component(ref, p, RLT_UNKNOWN); assert(ref); expr = asn1f_lookup_symbol(arg, arg->mod, arg->expr->rhs_pspecs, ref); if(!expr) { FATAL("Cannot find %s referenced by %s at line %d", p, arg->expr->Identifier, arg->expr->_lineno); return -1; } } DEBUG("Field %s assignment of %s got %s", cell->field->Identifier, p, expr->Identifier); cell->value = expr; idLength = strlen(expr->Identifier); if(row->max_identifier_length < idLength) row->max_identifier_length = idLength; return 0; } asn1c-0.9.24+dfsg/libasn1fix/Makefile.in0000644000000000000000000005062612121076150016341 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = check_fixer$(EXEEXT) subdir = libasn1fix DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libasn1fix_la_LIBADD = am_libasn1fix_la_OBJECTS = asn1fix.lo asn1fix_misc.lo asn1fix_value.lo \ asn1fix_compat.lo asn1fix_constr.lo asn1fix_cstring.lo \ asn1fix_retrieve.lo asn1fix_bitstring.lo asn1fix_constraint.lo \ asn1fix_integer.lo asn1fix_crange.lo asn1fix_dereft.lo \ asn1fix_derefv.lo asn1fix_export.lo asn1fix_param.lo \ asn1fix_class.lo asn1fix_tags.lo asn1fix_enum.lo \ asn1fix_cws.lo asn1fix_constraint_compat.lo libasn1fix_la_OBJECTS = $(am_libasn1fix_la_OBJECTS) libasn1fix_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libasn1fix_la_LDFLAGS) $(LDFLAGS) -o $@ check_fixer_SOURCES = check_fixer.c check_fixer_OBJECTS = check_fixer.$(OBJEXT) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libasn1fix_la_SOURCES) check_fixer.c DIST_SOURCES = $(libasn1fix_la_SOURCES) check_fixer.c ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = @ADD_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir)/libasn1parser noinst_LTLIBRARIES = libasn1fix.la libasn1fix_la_LDFLAGS = -all-static libasn1fix_la_SOURCES = \ asn1fix.c asn1fix.h \ asn1fix_internal.h \ asn1fix_misc.c asn1fix_misc.h \ asn1fix_value.c asn1fix_value.h \ asn1fix_compat.c asn1fix_compat.h \ asn1fix_constr.c asn1fix_constr.h \ asn1fix_cstring.c asn1fix_cstring.h \ asn1fix_retrieve.c asn1fix_retrieve.h \ asn1fix_bitstring.c asn1fix_bitstring.h \ asn1fix_constraint.c asn1fix_constraint.h \ asn1fix_integer.c asn1fix_integer.h \ asn1fix_crange.c asn1fix_crange.h \ asn1fix_dereft.c asn1fix_dereft.h \ asn1fix_derefv.c asn1fix_derefv.h \ asn1fix_export.c asn1fix_export.h \ asn1fix_param.c asn1fix_param.h \ asn1fix_class.c asn1fix_class.h \ asn1fix_tags.c asn1fix_tags.h \ asn1fix_enum.c asn1fix_enum.h \ asn1fix_cws.c asn1fix_cws.h \ asn1fix_constraint_compat.c check_fixer_LDADD = $(noinst_LTLIBRARIES) \ $(top_builddir)/libasn1parser/libasn1parser.la check_fixer_DEPENDENCIES = $(check_fixer_LDADD) TESTS_ENVIRONMENT = ./check_fixer TESTS = ${top_srcdir}/tests/*.asn1 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libasn1fix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libasn1fix/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libasn1fix.la: $(libasn1fix_la_OBJECTS) $(libasn1fix_la_DEPENDENCIES) $(libasn1fix_la_LINK) $(libasn1fix_la_OBJECTS) $(libasn1fix_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list check_fixer$(EXEEXT): $(check_fixer_OBJECTS) $(check_fixer_DEPENDENCIES) @rm -f check_fixer$(EXEEXT) $(LINK) $(check_fixer_OBJECTS) $(check_fixer_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_bitstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_class.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_compat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_constr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_constraint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_constraint_compat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_crange.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_cstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_cws.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_dereft.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_derefv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_enum.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_export.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_integer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_param.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_retrieve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_tags.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1fix_value.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_fixer.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/libasn1fix/asn1fix_value.h0000644000000000000000000000156211472004364017213 0ustar rootroot/* * Functions related with processing values. */ #ifndef _ASN1FIX_VALUE_H_ #define _ASN1FIX_VALUE_H_ /* * Resolve the value given by reference. * This function also takes a parameter which specifies the desired * value's type. * * RETURN VALUES: * 0: Value resolved successfully. * -1/EPERM: Recursive looping detected. * -1/EEXIST: Reference is not compatible with the desired type. * -1/ESRCH: Cannot find the terminal reference. */ int asn1f_value_resolve(arg_t *arg, asn1p_expr_t *tc, const enum asn1p_constraint_type_e *opt_constr_type); /* * Check if a value in value_expr refers to the enumeration or integer element * within the type provided. If yes, it will replace referenced value with * the appropriate inline value. */ int asn1f_look_value_in_type(arg_t *arg, asn1p_expr_t *type_expr, asn1p_expr_t *value_expr); #endif /* _ASN1FIX_VALUE_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_cstring.h0000644000000000000000000000017311472004363017544 0ustar rootroot#ifndef _ASN1FIX_CSTRING_H_ #define _ASN1FIX_CSTRING_H_ int asn1f_fix_cstring(arg_t *); #endif /* _ASN1FIX_CSTRING_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_cstring.c0000644000000000000000000000261011472004363017535 0ustar rootroot#include "asn1fix_internal.h" struct _cstring_pattern { char *start; size_t length; }; static int _asn1f_cstring_find_line_pattern(char *s, struct _cstring_pattern *); int asn1f_fix_cstring(arg_t *arg) { asn1p_expr_t *expr = arg->expr; int r_value = 0; if(expr->value && expr->value->type == ATV_STRING) { struct _cstring_pattern cp; char *buf = (char *)expr->value->value.string.buf; int buflen = expr->value->value.string.size; int start = 0; DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno); while(_asn1f_cstring_find_line_pattern(buf + start, &cp)) { assert(cp.length); memmove(cp.start, cp.start + cp.length, buflen - ((cp.start + cp.length) - buf)); buflen -= cp.length; start = cp.start - buf; buf[buflen] = '\0'; } } return r_value; } /* * If a string has a newline, the tabulation and spaces before and * after it must be eliminated. */ static int _asn1f_cstring_find_line_pattern(char *s, struct _cstring_pattern *cp) { int newline_found = 0; cp->start = NULL; for(;;s++) { switch(*s) { case '\r': case '\n': newline_found = 1; /* Fall through */ case ' ': case '\t': if(cp->start == NULL) cp->start = s; continue; case '\0': default: if(newline_found) { cp->length = (size_t)(s - cp->start); return 1; } cp->start = NULL; if(*s == '\0') break; continue; } break; } return 0; } asn1c-0.9.24+dfsg/libasn1fix/Makefile.am0000644000000000000000000000235111461150505016323 0ustar rootroot AM_CFLAGS = @ADD_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir)/libasn1parser noinst_LTLIBRARIES = libasn1fix.la libasn1fix_la_LDFLAGS = -all-static libasn1fix_la_SOURCES = \ asn1fix.c asn1fix.h \ asn1fix_internal.h \ asn1fix_misc.c asn1fix_misc.h \ asn1fix_value.c asn1fix_value.h \ asn1fix_compat.c asn1fix_compat.h \ asn1fix_constr.c asn1fix_constr.h \ asn1fix_cstring.c asn1fix_cstring.h \ asn1fix_retrieve.c asn1fix_retrieve.h \ asn1fix_bitstring.c asn1fix_bitstring.h \ asn1fix_constraint.c asn1fix_constraint.h \ asn1fix_integer.c asn1fix_integer.h \ asn1fix_crange.c asn1fix_crange.h \ asn1fix_dereft.c asn1fix_dereft.h \ asn1fix_derefv.c asn1fix_derefv.h \ asn1fix_export.c asn1fix_export.h \ asn1fix_param.c asn1fix_param.h \ asn1fix_class.c asn1fix_class.h \ asn1fix_tags.c asn1fix_tags.h \ asn1fix_enum.c asn1fix_enum.h \ asn1fix_cws.c asn1fix_cws.h \ asn1fix_constraint_compat.c check_PROGRAMS = check_fixer check_fixer_LDADD = $(noinst_LTLIBRARIES) \ $(top_builddir)/libasn1parser/libasn1parser.la check_fixer_DEPENDENCIES = $(check_fixer_LDADD) TESTS_ENVIRONMENT= ./check_fixer TESTS = ${top_srcdir}/tests/*.asn1 ## TESTS = ${check_PROGRAMS} # This is an alternate form of testing asn1c-0.9.24+dfsg/libasn1fix/asn1fix_tags.h0000644000000000000000000000175411472004364017040 0ustar rootroot#ifndef _ASN1FIX_TAGS_H_ #define _ASN1FIX_TAGS_H_ enum asn1f_aft_flags_e { AFT_IMAGINARY_ANY = 0x01, /* Treat ANY tag as [IMAGINARY ANY] */ AFT_FETCH_OUTMOST = 0x02, /* Fetch only outmost tag */ AFT_FULL_COLLECT = 0x04, /* Collect all tags */ AFT_CANON_CHOICE = 0x08, /* Fetch the minimal CHOICE root tag */ }; /* * Allocate and return an array of tags for the given type. * Type1 ::= [2] EXPLICIT Type2 * Type2 ::= [3] IMPLICIT Type3 * Type3 ::= [4] EXPLICIT SEQUENCE { ... } * Will return [2][3][UNIVERSAL 16] for the Type1. */ int asn1f_fetch_tags(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, struct asn1p_type_tag_s **tags, enum asn1f_aft_flags_e flags); /* * Fetch the outmost tag of the given type. * Type1 ::= Type2 * Type2 ::= [2] Type3 * Type3 ::= SEQUENCE { ... } * Will yield [2] for Type1. */ int asn1f_fetch_outmost_tag(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, struct asn1p_type_tag_s *tag, enum asn1f_aft_flags_e); #endif /* _ASN1FIX_TAGS_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_derefv.h0000644000000000000000000000026111472004364017345 0ustar rootroot#ifndef _ASN1FIX_DEREFV_H_ #define _ASN1FIX_DEREFV_H_ int asn1f_fix_dereference_values(arg_t *); int asn1f_fix_dereference_defaults(arg_t *); #endif /* _ASN1FIX_DEREFV_H_ */ asn1c-0.9.24+dfsg/libasn1fix/check_fixer.c0000644000000000000000000001667112015121740016712 0ustar rootroot#undef NDEBUG #include "asn1fix_internal.h" #ifdef _WIN32 #include #include #define chdir _chdir #else #include #include #endif #include #include "asn1fix.h" static int check(const char *fname, enum asn1p_flags parser_flags, enum asn1f_flags fixer_flags); static int post_fix_check(asn1p_t *asn); static int post_fix_check_element(asn1p_module_t *mod, asn1p_expr_t *expr); int main(int ac, char **av) { #ifdef _WIN32 intptr_t dir; struct _finddata_t c_file; #else struct dirent *dp; DIR *dir; #endif int failed = 0; int completed = 0; enum asn1p_flags parser_flags = A1P_NOFLAGS; enum asn1f_flags fixer_flags = A1F_NOFLAGS; const char *filename; size_t len; int ret; /* * Just in case when one decides that some flags better be * enabled during `ASN1_FIXER_FLAGS=1 make check` or some * similar usage. */ if(getenv("ASN1_PARSER_FLAGS")) parser_flags = atoi(getenv("ASN1_PARSER_FLAGS")); if(getenv("ASN1_FIXER_FLAGS")) fixer_flags = atoi(getenv("ASN1_FIXER_FLAGS")); /* * Go into a directory with tests. */ if(ac <= 1) { fprintf(stderr, "Testing in ./tests...\n"); ret = chdir("../tests"); assert(ret == 0); #ifdef _WIN32 dir = _findfirst("*.asn1", &c_file); assert(dir != -1L); #else dir = opendir("."); assert(dir); #endif /* _WIN32 */ } else { dir = 0; } /* * Scan every *.asn1 file and try to parse and fix it. */ if(dir) { #ifdef _WIN32 do { filename = c_file.name; #else while((dp = readdir(dir))) { filename = dp->d_name; #endif /* _WIN32 */ len = strlen(filename); if(len <= 5 || strcmp(filename + len - 5, ".asn1")) continue; ret = check(filename, parser_flags, fixer_flags); if(ret) { fprintf(stderr, "FAILED: %s\n", filename); failed++; } completed++; #ifdef _WIN32 } while(_findnext(dir, &c_file) == 0); _findclose(dir); #else } closedir(dir); #endif /* _WIN32 */ fprintf(stderr, "Tests COMPLETED: %d\n" "Tests FAILED: %d\n" , completed, failed ); } else { int i; for(i = 1; i < ac; i++) { ret = check(av[i], parser_flags, fixer_flags); if(ret) { fprintf(stderr, "FAILED: %s\n", av[i]); failed++; } completed++; } } if(completed == 0) { fprintf(stderr, "No tests defined?!\n"); exit(EX_NOINPUT); } if(failed) exit(EX_DATAERR); return 0; } static int check(const char *fname, enum asn1p_flags parser_flags, enum asn1f_flags fixer_flags) { asn1p_t *asn; int expected_parseable; /* Is it expected to be parseable? */ int expected_fix_code; /* What code a fixer must return */ int r_value = 0; /* * Figure out how the processing should go by inferring * expectations from the file name. */ if(strstr(fname, "-OK.")) { expected_parseable = 1; expected_fix_code = 0; } else if(strstr(fname, "-NP.")) { expected_parseable = 0; expected_fix_code = 123; /* Does not matter */ } else if(strstr(fname, "-SE.")) { expected_parseable = 1; expected_fix_code = -1; /* Semantically incorrect */ } else if(strstr(fname, "-SW.")) { expected_parseable = 1; expected_fix_code = 1; /* Semantically suspicious */ } else { fprintf(stderr, "%s: Invalid file name format\n", fname); return -1; } /* Flag modifiers */ if(strstr(fname, "-blessSize-")) fixer_flags |= A1F_EXTENDED_SizeConstraint; fprintf(stderr, "[=> %s]\n", fname); /* * Perform low-level parsing. */ if(!expected_parseable) fprintf(stderr, "Expecting error...\n"); asn = asn1p_parse_file(fname, parser_flags); if(asn == NULL) { if(expected_parseable) { fprintf(stderr, "Cannot parse file \"%s\"\n", fname); r_value = -1; } else { fprintf(stderr, "Previous error is EXPECTED, no worry\n"); } } else if(!expected_parseable) { fprintf(stderr, "The file \"%s\" is not expected to be parseable, " "yet parsing was successfull!\n", fname); r_value = -1; } if(!asn) return r_value; if(r_value == 0) { asn1p_t *std_asn; std_asn = asn1p_parse_file("../skeletons/standard-modules/ASN1C-UsefulInformationObjectClasses.asn1", A1P_NOFLAGS); if(std_asn) { asn1p_module_t *mod; while((mod = TQ_REMOVE(&(std_asn->modules), mod_next))) { mod->_tags |= MT_STANDARD_MODULE; TQ_ADD(&(asn->modules), mod, mod_next); } asn1p_delete(std_asn); } } /* * Perform semantical checks and fixes. */ if(r_value == 0) { int ret; if(expected_fix_code) fprintf(stderr, "Expecting some problems...\n"); ret = asn1f_process(asn, fixer_flags, 0); if(ret) { if(ret == expected_fix_code) { fprintf(stderr, "Previous error is EXPECTED, " "no worry\n"); } else { fprintf(stderr, "Cannot process file \"%s\": %d\n", fname, ret); r_value = -1; } } else if(ret != expected_fix_code) { fprintf(stderr, "File \"%s\" is expected " "to be semantically incorrect, " "yet processing was successful!\n", fname); r_value = -1; } } /* * Check validity of some values, if grammar has special * instructions for that. */ if(r_value == 0) { if(post_fix_check(asn)) r_value = -1; } /* * Destroy the asn. */ #ifdef CLEAN_EVERYTHING asn1p_delete(asn); #endif return r_value; } static int post_fix_check(asn1p_t *asn) { asn1p_module_t *mod; asn1p_expr_t *expr; int r_value = 0; TQ_FOR(mod, &(asn->modules), mod_next) { TQ_FOR(expr, &(mod->members), next) { assert(expr->Identifier); if(strncmp(expr->Identifier, "check-", 6) == 0) { if(post_fix_check_element(mod, expr)) r_value = -1; } } } return r_value; } static int post_fix_check_element(asn1p_module_t *mod, asn1p_expr_t *check_expr) { asn1p_expr_t *expr = NULL; char *name; asn1p_value_t *value; if(check_expr->expr_type != ASN_BASIC_INTEGER || check_expr->meta_type != AMT_VALUE) { fprintf(stderr, "CHECKER: Unsupported type of \"%s\" value: " "%d at line %d of %s\n", check_expr->Identifier, check_expr->expr_type, check_expr->_lineno, mod->source_file_name ); return -1; } assert(check_expr->meta_type == AMT_VALUE); value = check_expr->value; if(value == NULL || value->type != ATV_INTEGER) { fprintf(stderr, "CHECKER: Unsupported value type of \"%s\": " "%d at line %d of %s\n", check_expr->Identifier, value?(signed)value->type:-1, expr->_lineno, mod->source_file_name ); return -1; } name = check_expr->Identifier + sizeof("check-") - 1; /* * Scan in search for the original. */ TQ_FOR(expr, &(mod->members), next) { if(strcmp(expr->Identifier, name) == 0) break; } if(expr == NULL) { fprintf(stderr, "CHECKER: Value \"%s\" requested by " "\"check-%s\" at line %d of %s is not found!\n", name, name, check_expr->_lineno, mod->source_file_name ); return -1; } if(0 && expr->expr_type != check_expr->expr_type) { fprintf(stderr, "CHECKER: Value type of \"%s\" (=%d) at line %d " "does not have desired type %d as requested by " "\"check-%s\" in %s\n", expr->Identifier, expr->expr_type, expr->_lineno, check_expr->expr_type, name, mod->source_file_name ); return -1; } if(expr->value == NULL || expr->value->type != value->type) { fprintf(stderr, "CHECKER: Value of \"%s\" (\"%s\", type=%d) at line %d " "does not have desired type %d as requested by " "\"check-%s\" in %s\n", expr->Identifier, asn1f_printable_value(expr->value), expr->value->type, expr->_lineno, value->type, name, mod->source_file_name ); return -1; } assert(value->type = ATV_INTEGER); return 0; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_param.c0000644000000000000000000001247211472004364017174 0ustar rootroot#include "asn1fix_internal.h" typedef struct resolver_arg { asn1p_expr_t *(*resolver)(asn1p_expr_t *, void *arg); arg_t *arg; asn1p_expr_t *original_expr; asn1p_paramlist_t *lhs_params; asn1p_expr_t *rhs_pspecs; } resolver_arg_t; static asn1p_expr_t *resolve_expr(asn1p_expr_t *, void *resolver_arg); static int compare_specializations(arg_t *, asn1p_expr_t *a, asn1p_expr_t *b); static asn1p_expr_t *find_target_specialization_byref(resolver_arg_t *rarg, asn1p_ref_t *ref); static asn1p_expr_t *find_target_specialization_bystr(resolver_arg_t *rarg, char *str); asn1p_expr_t * asn1f_parameterization_fork(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *rhs_pspecs) { resolver_arg_t rarg; /* resolver argument */ asn1p_expr_t *exc; /* expr clone */ asn1p_expr_t *rpc; /* rhs_pspecs clone */ void *p; struct asn1p_pspec_s *pspec; int npspecs; assert(rhs_pspecs); assert(expr->lhs_params); assert(expr->parent_expr == 0); DEBUG("Forking parameterization at %d for %s (%d alr)", rhs_pspecs->_lineno, expr->Identifier, expr->specializations.pspecs_count); /* * Find if this exact specialization has been used already. */ for(npspecs = 0; npspecs < expr->specializations.pspecs_count; npspecs++) { if(compare_specializations(arg, rhs_pspecs, expr->specializations.pspec[npspecs].rhs_pspecs) == 0) { DEBUG("Reused parameterization for %s", expr->Identifier); return expr->specializations.pspec[npspecs].my_clone; } } rarg.resolver = resolve_expr; rarg.arg = arg; rarg.original_expr = expr; rarg.lhs_params = expr->lhs_params; rarg.rhs_pspecs = rhs_pspecs; exc = asn1p_expr_clone_with_resolver(expr, resolve_expr, &rarg); if(!exc) return NULL; rpc = asn1p_expr_clone(rhs_pspecs, 0); assert(rpc); /* * Create a new specialization. */ npspecs = expr->specializations.pspecs_count; p = realloc(expr->specializations.pspec, (npspecs + 1) * sizeof(expr->specializations.pspec[0])); assert(p); expr->specializations.pspec = p; pspec = &expr->specializations.pspec[npspecs]; memset(pspec, 0, sizeof *pspec); pspec->rhs_pspecs = rpc; pspec->my_clone = exc; exc->spec_index = npspecs; DEBUG("Forked new parameterization for %s", expr->Identifier); /* Commit */ expr->specializations.pspecs_count = npspecs + 1; return exc; } static int compare_specializations(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) { asn1p_expr_t *ac = TQ_FIRST(&a->members); asn1p_expr_t *bc = TQ_FIRST(&b->members); for(;ac && bc; ac = TQ_NEXT(ac, next), bc = TQ_NEXT(bc, next)) { retry: if(ac == bc) continue; if(ac->meta_type != bc->meta_type) break; if(ac->expr_type != bc->expr_type) break; if(!ac->reference && !bc->reference) continue; if(ac->reference) { ac = asn1f_lookup_symbol(arg, ac->module, ac->rhs_pspecs, ac->reference); if(!ac) break; } if(bc->reference) { bc = asn1f_lookup_symbol(arg, bc->module, bc->rhs_pspecs, bc->reference); if(!bc) break; } goto retry; } if(ac || bc) /* Specializations do not match: different size option sets */ return -1; return 0; } static asn1p_expr_t * resolve_expr(asn1p_expr_t *expr_to_resolve, void *resolver_arg) { resolver_arg_t *rarg = resolver_arg; arg_t *arg = rarg->arg; asn1p_expr_t *expr; asn1p_expr_t *nex; DEBUG("Resolving %s (meta %d)", expr_to_resolve->Identifier, expr_to_resolve->meta_type); if(expr_to_resolve->meta_type == AMT_TYPEREF) { expr = find_target_specialization_byref(rarg, expr_to_resolve->reference); if(!expr) return NULL; } else if(expr_to_resolve->meta_type == AMT_VALUE) { assert(expr_to_resolve->value); expr = find_target_specialization_bystr(rarg, expr_to_resolve->Identifier); if(!expr) return NULL; } else { errno = ESRCH; return NULL; } DEBUG("Found target %s (%d/%x)", expr->Identifier, expr->meta_type, expr->expr_type); if(expr->meta_type == AMT_TYPE || expr->meta_type == AMT_VALUE || expr->meta_type == AMT_TYPEREF || expr->meta_type == AMT_VALUESET) { DEBUG("Target is a simple type %s", ASN_EXPR_TYPE2STR(expr->expr_type)); nex = asn1p_expr_clone(expr, 0); free(nex->Identifier); nex->Identifier = expr_to_resolve->Identifier ? strdup(expr_to_resolve->Identifier) : 0; return nex; } else { FATAL("Feature not implemented for %s (%d/%x), " "please contact the asn1c author", rarg->original_expr->Identifier, expr->meta_type, expr->expr_type); errno = EPERM; return NULL; } return NULL; } static asn1p_expr_t * find_target_specialization_byref(resolver_arg_t *rarg, asn1p_ref_t *ref) { char *refstr; if(!ref || ref->comp_count != 1) { errno = ESRCH; return NULL; } refstr = ref->components[0].name; /* T */ return find_target_specialization_bystr(rarg, refstr); } static asn1p_expr_t * find_target_specialization_bystr(resolver_arg_t *rarg, char *refstr) { arg_t *arg = rarg->arg; asn1p_expr_t *target; int i; target = TQ_FIRST(&rarg->rhs_pspecs->members); for(i = 0; i < rarg->lhs_params->params_count; i++, target = TQ_NEXT(target, next)) { struct asn1p_param_s *param = &rarg->lhs_params->params[i]; if(!target) break; if(strcmp(param->argument, refstr)) continue; return target; } if(i != rarg->lhs_params->params_count) { FATAL("Parameterization of %s failed: " "parameters number mismatch", rarg->original_expr->Identifier); errno = EPERM; return NULL; } errno = ESRCH; return NULL; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_constr.c0000644000000000000000000002656311472004363017411 0ustar rootroot#include "asn1fix_internal.h" static int _asn1f_check_if_tag_must_be_explicit(arg_t *arg, asn1p_expr_t *v); static int _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b); static int _asn1f_fix_type_tag(arg_t *arg, asn1p_expr_t *expr); int asn1f_pull_components_of(arg_t *arg) { TQ_HEAD(asn1p_expr_t) list; asn1p_expr_t *expr = arg->expr; asn1p_expr_t *memb; int r_value = 0; switch(expr->expr_type) { case ASN_CONSTR_SEQUENCE: case ASN_CONSTR_SET: break; default: return 0; } TQ_INIT(&list); /* * Look into */ while((memb = TQ_REMOVE(&(expr->members), next))) { asn1p_expr_t *coft; /* COMPONENTS OF thing itself */ asn1p_expr_t *terminal; /* Terminal of the referenced type */ if(memb->expr_type != A1TC_COMPONENTS_OF) { TQ_ADD(&list, memb, next); continue; } coft = TQ_FIRST(&memb->members); assert(coft); assert(!TQ_NEXT(coft, next)); /* * Find the referenced type. */ terminal = asn1f_find_terminal_type(arg, coft); if(!terminal || (terminal->expr_type != expr->expr_type)) { FATAL("COMPONENTS OF at line %d " "must reference a %s type", coft->_lineno, expr->expr_type==ASN_CONSTR_SET ? "SET" : "SEQUENCE" ); TQ_ADD(&list, memb, next); r_value = -1; continue; } /* * Clone the final structure. */ coft = asn1p_expr_clone(terminal, 1 /* Skip extensions */); if(!coft) return -1; /* ENOMEM */ if(0) { asn1p_expr_free(memb); /* Don't need it anymore*/ } else { /* Actual removal clashes with constraints... skip. */ } /* * Move all components of the cloned structure * into the current one. */ while((memb = TQ_REMOVE(&(coft->members), next))) { TQ_ADD(&list, memb, next); memb->parent_expr = expr; } asn1p_expr_free(coft); /* Remove wrapper */ } /* Move the stuff back */ TQ_MOVE(&(expr->members), &list); return r_value; } /* * Fix extensibility parts inside constructed types (SEQUENCE, SET, CHOICE). */ int asn1f_fix_constr_ext(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; TQ_HEAD(asn1p_expr_t) root_list; TQ_HEAD(asn1p_expr_t) ext_list; TQ_HEAD(asn1p_expr_t) *cur_list; int r_value = 0; int ext_count = 0; switch(expr->expr_type) { case ASN_CONSTR_SEQUENCE: case ASN_CONSTR_SET: case ASN_CONSTR_CHOICE: break; default: return 0; } DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno); TQ_INIT(&root_list); TQ_INIT(&ext_list); cur_list = (void *)&root_list; /* * Split the set of fields into two lists, the root list * and the extensions list. */ while((v = TQ_REMOVE(&(expr->members), next))) { if(v->expr_type == A1TC_EXTENSIBLE) { ext_count++; switch(ext_count) { case 1: cur_list = (void *)&ext_list; break; case 2: cur_list = (void *)&root_list; if(v->value) { FATAL("Optional extension marker " "must not contain " "an exception mark " "at line %d", v->_lineno); r_value = -1; } asn1p_expr_free(v); continue; case 3: FATAL("Third extension marker " "is not allowed at line %d", v->_lineno); default: r_value = -1; } } TQ_ADD(cur_list, v, next); } /* * Copy the root list and extension list back into the main list. */ TQ_MOVE(&(expr->members), &root_list); while((v = TQ_REMOVE(&ext_list, next))) TQ_ADD(&(expr->members), v, next); if(arg->mod->module_flags & MSF_EXTENSIBILITY_IMPLIED && ext_count == 0) { v = asn1p_expr_new(0, arg->mod); if(v) { v->Identifier = strdup("..."); v->expr_type = A1TC_EXTENSIBLE; v->meta_type = AMT_TYPE; v->_lineno = expr->_lineno; /* The best we can do */ if(v->Identifier == NULL) { asn1p_expr_free(v); r_value = -1; } else { asn1p_expr_add(expr, v); } } else { r_value = -1; } } return r_value; } int asn1f_fix_constr_tag(arg_t *arg, int fix_top_level) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int root_tagged = 0; /* The root component is manually tagged */ int ext_tagged = 0; /* The extensions are manually tagged */ int component_number = 0; int r_value = 0; DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno); /* * Fix the top-level type itself first. */ if(fix_top_level) { if(expr->tag.tag_class == TC_NOCLASS) return r_value; if(_asn1f_fix_type_tag(arg, expr)) r_value = -1; return r_value; } switch(expr->expr_type) { case ASN_CONSTR_SEQUENCE: case ASN_CONSTR_SET: case ASN_CONSTR_CHOICE: break; default: return 0; } TQ_FOR(v, &(expr->members), next) { if(v->expr_type == A1TC_EXTENSIBLE) { component_number++; continue; } if(v->tag.tag_class == TC_NOCLASS) { continue; } switch(component_number) { case 0: case 2: root_tagged = 1; break; default: ext_tagged = 1; break; } if(_asn1f_fix_type_tag(arg, v)) r_value = -1; } if((arg->mod->module_flags & MSF_AUTOMATIC_TAGS) && !root_tagged) { if(ext_tagged) { /* X.690: 28.4 */ FATAL("In %s at line %d: " "extensions are tagged " "but root components are not", expr->Identifier, expr->_lineno); r_value = -1; } else { /* Make a decision on automatic tagging */ expr->auto_tags_OK = 1; } } return r_value; } static int _asn1f_fix_type_tag(arg_t *arg, asn1p_expr_t *expr) { int must_explicit = _asn1f_check_if_tag_must_be_explicit(arg, expr); int module_impl_tags = (arg->mod->module_flags & (MSF_IMPLICIT_TAGS | MSF_AUTOMATIC_TAGS)); int r_value = 0; if(expr->tag.tag_mode == TM_DEFAULT) { if(must_explicit || module_impl_tags == 0) expr->tag.tag_mode = TM_EXPLICIT; else expr->tag.tag_mode = TM_IMPLICIT; } /* * Perform a final sanity check. */ if(must_explicit) { if(expr->tag.tag_mode == TM_IMPLICIT) { FATAL("%s tagged in IMPLICIT mode " "but must be EXPLICIT at line %d", expr->Identifier, expr->_lineno); r_value = -1; } else { expr->tag.tag_mode = TM_EXPLICIT; } } return r_value; } int asn1f_fix_constr_autotag(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; asn1c_integer_t tag_value = 0; int r_value = 0; switch(expr->expr_type) { case ASN_CONSTR_SEQUENCE: case ASN_CONSTR_SET: case ASN_CONSTR_CHOICE: if(expr->auto_tags_OK) break; /* Automatic tagging is not applicable */ /* Fall through */ default: return 0; } DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno); TQ_FOR(v, &(expr->members), next) { int must_explicit; if(v->expr_type == A1TC_EXTENSIBLE) { /* 28.5, d) */ continue; } if(0) { /* This may be not true in case COMPONENTS OF */ assert(v->tag.tag_class == TC_NOCLASS); } must_explicit = _asn1f_check_if_tag_must_be_explicit(arg, v); v->tag.tag_class = TC_CONTEXT_SPECIFIC; v->tag.tag_mode = must_explicit ? TM_EXPLICIT : TM_IMPLICIT; v->tag.tag_value = tag_value++; } return r_value; } /* * Check that tags are distinct. */ int asn1f_check_constr_tags_distinct(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int r_value = 0; switch(expr->expr_type) { case ASN_CONSTR_SEQUENCE: case ASN_CONSTR_SET: case ASN_CONSTR_CHOICE: break; default: return 0; } TQ_FOR(v, &(expr->members), next) { /* * In every series of non-mandatory components, * the tags must be distinct from each other AND the * tag of the following mandatory component. * For SET and CHOICE treat everything as a big set of * non-mandatory components. */ if(expr->expr_type != ASN_CONSTR_SEQUENCE || v->marker.flags) { asn1p_expr_t *nv; for(nv = v; (nv = TQ_NEXT(nv, next));) { DEBUG("S/C comparing tags %s s. %s", v->Identifier, nv->Identifier); if(_asn1f_compare_tags(arg, v, nv)) r_value = -1; if(expr->expr_type == ASN_CONSTR_SEQUENCE && !nv->marker.flags) break; } } } return r_value; } static int _asn1f_check_if_tag_must_be_explicit(arg_t *arg, asn1p_expr_t *v) { struct asn1p_type_tag_s tag; struct asn1p_type_tag_s save_tag; asn1p_expr_t *reft; int ret; /* * Fetch the _next_ tag for this type. */ save_tag = v->tag; /* Save existing tag */ memset(&v->tag, 0, sizeof(v->tag)); /* Remove it temporarily */ ret = asn1f_fetch_outmost_tag(arg->asn, arg->mod, v, &tag, 0); v->tag = save_tag; /* Restore the tag back */ if(ret == 0) return 0; /* If found tag, it's okay */ reft = asn1f_find_terminal_type(arg, v); if(reft) { switch(reft->expr_type) { case ASN_TYPE_ANY: case ASN_CONSTR_CHOICE: return 1; default: return 0; } } return 0; } /* * Check that the tags are distinct. */ static int _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) { struct asn1p_type_tag_s ta, tb; int ra, rb; int ret; ra = asn1f_fetch_outmost_tag(arg->asn, arg->mod, a, &ta, AFT_IMAGINARY_ANY); rb = asn1f_fetch_outmost_tag(arg->asn, arg->mod, b, &tb, AFT_IMAGINARY_ANY); /* * If both tags are explicitly or implicitly given, use them. */ DEBUG("Fetching outmost tags: %d, %d", ra, rb); if(ra == 0 && rb == 0) { /* * Simple case: fetched both tags. */ if((ta.tag_value == tb.tag_value && ta.tag_class == tb.tag_class) || ta.tag_value == -1 /* Spread IMAGINARY ANY tag... */ || tb.tag_value == -1 /* ...it is an evil virus, fear it! */ ) { char tagbuf[2][TAG2STRING_BUFFER_SIZE]; char *p = (a->expr_type == A1TC_EXTENSIBLE) ?"potentially ":""; FATAL("Processing %s at line %d: component \"%s\" at line %d %shas the same tag " "as component \"%s\" at line %d", arg->expr->Identifier, arg->expr->_lineno, a->Identifier, a->_lineno, p, b->Identifier, b->_lineno ); FATAL("Consider adding AUTOMATIC TAGS " "after module %s DEFINITIONS, " "or manually tag components", arg->expr->module->ModuleName); DEBUG("Tags: %s %s vs. %s %s", asn1p_tag2string(&ta, tagbuf[0]), a->Identifier, asn1p_tag2string(&tb, tagbuf[1]), b->Identifier ); if((arg->mod->module_flags & MSF_EXTENSIBILITY_IMPLIED) && (a->expr_type == A1TC_EXTENSIBLE) && (b->expr_type == A1TC_EXTENSIBLE)) { FATAL("The previous error is due to " "improper use of " "EXTENSIBILITY IMPLIED flag " "of module %s", arg->mod->ModuleName); } return -1; } else { /* Tags are distinct */ return 0; } } /********************************************************** * Now we must perform some very funny recursion to check * multiple components of CHOICE type, etc. */ DEBUG("Comparing tags %s:%x <-> %s:%x", a->Identifier, a->expr_type, b->Identifier, b->expr_type); if(ra && a->meta_type == AMT_TYPEREF) { DEBUG(" %s is a type reference", a->Identifier); a = asn1f_lookup_symbol(arg, a->module, a->rhs_pspecs, a->reference); if(!a) return 0; /* Already FATAL()'ed somewhere else */ WITH_MODULE(a->module, ret = _asn1f_compare_tags(arg, a, b)); return ret; } if(ra && a->expr_type == ASN_CONSTR_CHOICE) { asn1p_expr_t *v; DEBUG(" %s is a choice type (%d)", a->Identifier, a->_mark); /* * Iterate over members of CHOICE. */ //if(a->_mark & TM_RECURSION) return 0; TQ_FOR(v, &(a->members), next) { //a->_mark |= TM_RECURSION; ret = _asn1f_compare_tags(arg, v, b); //a->_mark &= ~TM_RECURSION; if(ret) return ret; } return 0; } if(rb && b->expr_type == ASN_CONSTR_CHOICE) { return _asn1f_compare_tags(arg, b, a); } if(a->_mark & TM_RECURSION) return 0; if(b->_mark & TM_RECURSION) return 0; a->_mark |= TM_RECURSION; b->_mark |= TM_RECURSION; ret = _asn1f_compare_tags(arg, b, a); a->_mark &= ~TM_RECURSION; b->_mark &= ~TM_RECURSION; return ret; } asn1c-0.9.24+dfsg/libasn1fix/asn1fix_retrieve.h0000644000000000000000000000420611472004364017722 0ustar rootroot/* * Miscellaneous functions necessary for several other modules. */ #ifndef _ASN1FIX_RETRIEVE_H_ #define _ASN1FIX_RETRIEVE_H_ /* * Simple search for the label in the descendants of the given node. * ERRORS: * NULL/ESRCH */ asn1p_expr_t *asn1f_lookup_child(asn1p_expr_t *tc, const char *name); /* * Return a module which contain a specified name, as stated in appropriate * IMPORTS section of the current module (arg->mod). * * RETURN VALUES: * NULL/ESRCH: The name was not found in IMPORTS section. * NULL/EPERM: The name was not found in EXPORTS section of the source module. * Also, NULL with errno values defined by asn1f_lookup_module(). */ asn1p_module_t *asn1f_lookup_in_imports(arg_t *arg, asn1p_module_t *mod, const char *name); /* * Return a module by its name or optional OID. * * RETURN VALUES: * NULL/ENOENT: No module was found by the specified name and oid * NULL/ETOOMANYREFS: Several modules are matching the specified name and oid */ asn1p_module_t *asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *module_oid); /* * Return the reference to a destination of the given reference, * symbol lookup. Not a recursive function. */ asn1p_expr_t *asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_expr_t *rhs_pspecs, asn1p_ref_t *ref); /* * Recursively find the original type for the given expression. * i.e.: * If the original specification defines * v Type1 ::= 5 * Type1 ::= Type2 (1..5) * Type3 ::= Type4 (2..7) * Type4 ::= INTEGER (1..10) * Then this function, given the the first expression as an argument, * would return an expression for Type4. * WARNING: No attempts are made to honor constraints at this moment. */ asn1p_expr_t *asn1f_find_terminal_type(arg_t *arg, asn1p_expr_t *tc); /* * Recursively find the original value for the given expression. * i.e.: * If the original specification defines * v Type1 ::= value * value Type2 ::= value2 * value2 Type3 ::= 3 * Then this function will return the expression for value2 if given * the v as an argment. */ asn1p_expr_t *asn1f_find_terminal_value(arg_t *arg, asn1p_expr_t *tc); #endif /* _ASN1FIX_RETRIEVE_H_ */ asn1c-0.9.24+dfsg/libasn1fix/asn1fix_retrieve.c0000644000000000000000000002751311505405150017716 0ustar rootroot#include "asn1fix_internal.h" enum ftt_what { FTT_TYPE, /* Find the type of the given expression */ FTT_VALUE, /* Find the value of the given expression */ }; static asn1p_expr_t *asn1f_find_terminal_thing(arg_t *arg, asn1p_expr_t *expr, enum ftt_what); static int asn1f_compatible_with_exports(arg_t *arg, asn1p_module_t *mod, const char *name); /* * Lookup a child by its name. */ asn1p_expr_t * asn1f_lookup_child(asn1p_expr_t *tc, const char *name) { asn1p_expr_t *child_tc; TQ_FOR(child_tc, &(tc->members), next) { if(child_tc->Identifier && strcmp(child_tc->Identifier, name) == 0) { return child_tc; } } errno = ESRCH; return NULL; } asn1p_module_t * asn1f_lookup_in_imports(arg_t *arg, asn1p_module_t *mod, const char *name) { asn1p_xports_t *xp; asn1p_expr_t *tc; /* * Search in which exactly module this name is defined. */ TQ_FOR(xp, &(mod->imports), xp_next) { TQ_FOR(tc, &(xp->members), next) { if(strcmp(name, tc->Identifier) == 0) break; } if(tc) break; } if(xp == NULL) { errno = ESRCH; return NULL; } /* * Okay, right now we have a module name and, hopefully, an OID. * Search the arg->asn for the specified module. */ mod = asn1f_lookup_module(arg, xp->fromModuleName, xp->identifier.oid); if(mod == NULL) { /* Conditional debug */ if(!(arg->expr->_mark & TM_BROKEN)) { arg->expr->_mark |= TM_BROKEN; FATAL("Cannot find external module \"%s\" " "mentioned for " "\"%s\" at line %d. " "Obtain this module and instruct compiler to process it too.", xp->fromModuleName, name, arg->expr->_lineno); } /* ENOENT/ETOOMANYREFS */ return NULL; } /* * Check that the EXPORTS section of this module contains * the symbol we care about, or it is EXPORTS ALL. */ if(asn1f_compatible_with_exports(arg, mod, name)) { errno = EPERM; return NULL; } return mod; } asn1p_module_t * asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) { asn1p_module_t *mod; assert(module_name); /* * If OID is given, the module_name is unused. * If OID is not given, the module_name may mean * either the real module's name, or the symbol which is the * result of renaming. Check this first. */ if(oid == 0) { asn1p_xports_t *xp; /* * Check inside the IMPORTS section for possible renaming. * Renaming practically means that a module_name is mentioned * somewhere in the IMPORTS section AND OID is given. */ TQ_FOR(xp, &(arg->mod->imports), xp_next) { if(strcmp(module_name, xp->fromModuleName)) continue; if(oid) { FATAL("Ambiguous reference: " "%s " "matches several modules", module_name); errno = ETOOMANYREFS; return NULL; } /* * Yes, there is a renaming. * Make lookup use OID instead. */ oid = xp->identifier.oid; } } /* * Perform lookup using OID or module_name. */ TQ_FOR(mod, &(arg->asn->modules), mod_next) { if(oid) { if(mod->module_oid) { if(asn1p_oid_compare(oid, mod->module_oid)) { continue; } else { /* Match! Even if name doesn't. */ return mod; } } else { /* Not match, even if name is the same. */ continue; } } if(strcmp(module_name, mod->ModuleName) == 0) return mod; } DEBUG("\tModule \"%s\" not found", module_name); errno = ENOENT; return NULL; } static asn1p_expr_t * asn1f_lookup_symbol_impl(arg_t *arg, asn1p_module_t *mod, asn1p_expr_t *rhs_pspecs, asn1p_ref_t *ref, int recursion_depth) { asn1p_expr_t *ref_tc; /* Referenced tc */ asn1p_module_t *imports_from; char *modulename; char *identifier; /* * First of all, a reference to a symbol may be specified * using several possible forms: * a) simple identifier * v INTEGER ::= value * b) external reference * v INTEGER ::= Module1.value * c) class-related stuff (the most complex stuff) * v ::= <[A-Z][A-Z0-9a-z-]*>.&<[A-Z0-9a-z-]+>. * All other forms are not implemented at this moment. */ DEBUG("(%s) in %s for line %d", asn1f_printable_reference(ref), mod->ModuleName, ref->_lineno); if(recursion_depth++ > 30 /* Arbitrary constant */) { FATAL("Excessive circular referencing detected in module %s for %s at line %d", mod->ModuleName, asn1f_printable_reference(ref), ref->_lineno); errno = ETOOMANYREFS; return NULL; } if(ref->comp_count == 1) { modulename = NULL; identifier = ref->components[0].name; } else if(ref->comp_count == 2 && ref->components[1].name[0] != '&') { modulename = ref->components[0].name; identifier = ref->components[1].name; } else if(ref->comp_count > 1 && isupper(ref->components[0].name[0]) && ref->components[1].name[0] == '&') { asn1p_expr_t *extract; /* * This is a reference to a CLASS-related stuff. * Employ a separate function for that. */ extract = asn1f_class_access(arg, mod, rhs_pspecs, ref); return extract; } else { DEBUG("\tToo many components: %d", ref->comp_count); errno = EINVAL; return NULL; } /* * If module name is specified explicitly * OR the current module's IMPORTS clause contains the identifier, * fetch that module. */ if(modulename) { imports_from = asn1f_lookup_module(arg, modulename, 0); if(imports_from == NULL) { FATAL("Module \"%s\" " "mentioned at line %d is not found", modulename, ref->_lineno); return NULL; } /* * Check that the EXPORTS section of this module contains * the symbol we care about, or it is EXPORTS ALL. */ if(asn1f_compatible_with_exports(arg,imports_from,identifier)) { errno = EPERM; return NULL; } } else { /* Search inside the IMPORTS section of the current module */ imports_from = asn1f_lookup_in_imports(arg, mod, identifier); if(imports_from == NULL && errno != ESRCH) { /* * Return only of the name was not found. * If module was not found or more serious error * encountered, just return preserving the errno. */ return NULL; } } /* * The symbol is being imported from another module. */ importing: if(imports_from) { asn1p_ref_t tmpref = *ref; asn1p_expr_t *expr; if(modulename) { /* * The modulename is specified inside this reference. * To avoid recursion, reformat the reference * as it were local to that module. */ tmpref.components++; /* Hide the first element */ tmpref.comp_count--; assert(tmpref.comp_count > 0); } expr = asn1f_lookup_symbol_impl(arg, imports_from, rhs_pspecs, &tmpref, recursion_depth); if(!expr && !(arg->expr->_mark & TM_BROKEN) && !(imports_from->_tags & MT_STANDARD_MODULE)) { arg->expr->_mark |= TM_BROKEN; if(modulename) { FATAL("Module %s referred by %s in module %s " "does not contain the requested symbol", imports_from->ModuleName, asn1f_printable_reference(ref), mod->ModuleName); } else { FATAL("Module %s referred in IMPORTS section " "for %s of module %s does not contain " "the requested symbol", imports_from->ModuleName, asn1f_printable_reference(ref), mod->ModuleName); } } return expr; } /* * Now we know where to search for a value: in the current module. */ TQ_FOR(ref_tc, &(mod->members), next) { if(ref_tc->Identifier) if(strcmp(ref_tc->Identifier, identifier) == 0) break; } if(ref_tc) { if(rhs_pspecs && !ref_tc->lhs_params) { FATAL("Parameterized type %s expected " "for %s at line %d", ref_tc->Identifier, asn1f_printable_reference(ref), ref->_lineno); errno = EPERM; return NULL; } if(!rhs_pspecs && ref_tc->lhs_params) { FATAL("Type %s expects specialization " "from %s at line %d", ref_tc->Identifier, asn1f_printable_reference(ref), ref->_lineno); errno = EPERM; return NULL; } if(rhs_pspecs && ref_tc->lhs_params) { /* Specialize the target */ ref_tc = asn1f_parameterization_fork(arg, ref_tc, rhs_pspecs); } return ref_tc; } /* * Not found in the current module. * Search in our default standard module. */ { /* Search inside standard module */ static asn1p_oid_t *uioc_oid; if(!uioc_oid) { asn1p_oid_arc_t arcs[] = { { 1, "iso" }, { 3, "org" }, { 6, "dod" }, { 1, "internet" }, { 4, "private" }, { 1, "enterprise" }, { 9363, "spelio" }, { 1, "software" }, { 5, "asn1c" }, { 3, "standard-modules" }, { 0, "auto-imported" }, { 1, 0 } }; uioc_oid = asn1p_oid_construct(arcs, sizeof(arcs)/sizeof(arcs[0])); } if(!imports_from && (!mod->module_oid || asn1p_oid_compare(mod->module_oid, uioc_oid))) { imports_from = asn1f_lookup_module(arg, "ASN1C-UsefulInformationObjectClasses", uioc_oid); if(imports_from) goto importing; } } DEBUG("Module \"%s\" does not contain \"%s\" " "mentioned at line %d: %s", mod->ModuleName, identifier, ref->_lineno, strerror(errno)); if(asn1f_check_known_external_type(identifier) == 0) { errno = EEXIST; /* Exists somewhere */ } else { errno = ESRCH; } return NULL; } asn1p_expr_t * asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_expr_t *rhs_pspecs, asn1p_ref_t *ref) { return asn1f_lookup_symbol_impl(arg, mod, rhs_pspecs, ref, 0); } asn1p_expr_t * asn1f_find_terminal_type(arg_t *arg, asn1p_expr_t *expr) { return asn1f_find_terminal_thing(arg, expr, FTT_TYPE); } asn1p_expr_t * asn1f_find_terminal_value(arg_t *arg, asn1p_expr_t *expr) { return asn1f_find_terminal_thing(arg, expr, FTT_VALUE); } static asn1p_expr_t * asn1f_find_terminal_thing(arg_t *arg, asn1p_expr_t *expr, enum ftt_what what) { asn1p_ref_t *ref = 0; asn1p_expr_t *tc; switch(what) { case FTT_TYPE: /* Expression may be a terminal type itself */ if(expr->expr_type != A1TC_REFERENCE) return expr; ref = expr->reference; break; case FTT_VALUE: assert(expr->meta_type == AMT_VALUE); assert(expr->value); /* Expression may be a terminal type itself */ if(expr->value->type != ATV_REFERENCED) return expr; ref = expr->value->value.reference; break; } DEBUG("%s(%s->%s) for line %d", (what == FTT_VALUE)?"VALUE":"TYPE", expr->Identifier, asn1f_printable_reference(ref), expr->_lineno); assert(ref); /* * Lookup inside the type itself (ENUMERATED, INTEGER, etc). */ if(what == FTT_VALUE) { asn1p_expr_t *val_type_tc; val_type_tc = asn1f_find_terminal_type(arg, expr); if(val_type_tc && asn1f_look_value_in_type(arg, val_type_tc, expr)) return NULL; if(expr->value->type != ATV_REFERENCED) { return expr; } assert(ref == expr->value->value.reference); ref = expr->value->value.reference; } /* * Lookup inside the default module and its IMPORTS section. */ tc = asn1f_lookup_symbol(arg, expr->module, expr->rhs_pspecs, ref); if(tc == NULL) { DEBUG("\tSymbol \"%s\" not found: %s", asn1f_printable_reference(ref), strerror(errno)); return NULL; } /* * Recursive loops detection. */ if(tc->_mark & TM_RECURSION) { DEBUG("Recursion loop detected for %s at line %d", asn1f_printable_reference(ref), ref->_lineno); errno = EPERM; return NULL; } tc->_type_referenced = 1; tc->_mark |= TM_RECURSION; WITH_MODULE(tc->module, expr = asn1f_find_terminal_thing(arg, tc, what)); tc->_mark &= ~TM_RECURSION; return expr; } /* * Make sure that the specified name is present or otherwise does * not contradict with the EXPORTS clause of the specified module. */ static int asn1f_compatible_with_exports(arg_t *arg, asn1p_module_t *mod, const char *name) { asn1p_xports_t *exports; asn1p_expr_t *item; assert(mod); assert(name); exports = TQ_FIRST(&(mod->exports)); if(exports == NULL) { /* No EXPORTS section or EXPORTS ALL; */ return 0; } TQ_FOR(item, &(exports->members), next) { if(strcmp(item->Identifier, name) == 0) return 0; } /* Conditional debug */ if(!(arg->expr->_mark & TM_BROKEN)) { arg->expr->_mark |= TM_BROKEN; FATAL("EXPORTS section of module %s in %s " "does not mention %s at line %d", mod->ModuleName, mod->source_file_name, name, arg->expr->_lineno); } errno = ESRCH; return -1; } asn1c-0.9.24+dfsg/Makefile.am0000644000000000000000000000044712015121740014262 0ustar rootroot ACLOCAL_AMFLAGS = -I m4 SUBDIRS = \ libasn1parser libasn1fix \ libasn1print libasn1compiler \ skeletons examples tests \ doc asn1c docsdir = $(datadir)/doc/asn1c docs_DATA = README FAQ COPYING ChangeLog BUGS TODO EXTRA_DIST = asn1c.spec.in FAQ BUGS MANIFEST CLEANFILES = asn1c.spec asn1c-0.9.24+dfsg/skeletons/0000755000000000000000000000000012223077270014241 5ustar rootrootasn1c-0.9.24+dfsg/skeletons/constr_SEQUENCE.h0000644000000000000000000000276411502527550017223 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _CONSTR_SEQUENCE_H_ #define _CONSTR_SEQUENCE_H_ #include #ifdef __cplusplus extern "C" { #endif typedef struct asn_SEQUENCE_specifics_s { /* * Target structure description. */ int struct_size; /* Size of the target structure. */ int ctx_offset; /* Offset of the asn_struct_ctx_t member */ /* * Tags to members mapping table (sorted). */ asn_TYPE_tag2member_t *tag2el; int tag2el_count; /* * Optional members of the extensions root (roms) or additions (aoms). * Meaningful for PER. */ int *oms; /* Optional MemberS */ int roms_count; /* Root optional members count */ int aoms_count; /* Additions optional members count */ /* * Description of an extensions group. */ int ext_after; /* Extensions start after this member */ int ext_before; /* Extensions stop before this member */ } asn_SEQUENCE_specifics_t; /* * A set specialized functions dealing with the SEQUENCE type. */ asn_struct_free_f SEQUENCE_free; asn_struct_print_f SEQUENCE_print; asn_constr_check_f SEQUENCE_constraint; ber_type_decoder_f SEQUENCE_decode_ber; der_type_encoder_f SEQUENCE_encode_der; xer_type_decoder_f SEQUENCE_decode_xer; xer_type_encoder_f SEQUENCE_encode_xer; per_type_decoder_f SEQUENCE_decode_uper; per_type_encoder_f SEQUENCE_encode_uper; #ifdef __cplusplus } #endif #endif /* _CONSTR_SEQUENCE_H_ */ asn1c-0.9.24+dfsg/skeletons/OCTET_STRING.h0000644000000000000000000000540311502527550016360 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _OCTET_STRING_H_ #define _OCTET_STRING_H_ #include #ifdef __cplusplus extern "C" { #endif typedef struct OCTET_STRING { uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ int size; /* Size of the buffer */ asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ } OCTET_STRING_t; extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; asn_struct_free_f OCTET_STRING_free; asn_struct_print_f OCTET_STRING_print; asn_struct_print_f OCTET_STRING_print_utf8; ber_type_decoder_f OCTET_STRING_decode_ber; der_type_encoder_f OCTET_STRING_encode_der; xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ xer_type_encoder_f OCTET_STRING_encode_xer; xer_type_encoder_f OCTET_STRING_encode_xer_utf8; per_type_decoder_f OCTET_STRING_decode_uper; per_type_encoder_f OCTET_STRING_encode_uper; /****************************** * Handy conversion routines. * ******************************/ /* * This function clears the previous value of the OCTET STRING (if any) * and then allocates a new memory with the specified content (str/size). * If size = -1, the size of the original string will be determined * using strlen(str). * If str equals to NULL, the function will silently clear the * current contents of the OCTET STRING. * Returns 0 if it was possible to perform operation, -1 otherwise. */ int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); /* Handy conversion from the C string into the OCTET STRING. */ #define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) /* * Allocate and fill the new OCTET STRING and return a pointer to the newly * allocated object. NULL is permitted in str: the function will just allocate * empty OCTET STRING. */ OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, const char *str, int size); /**************************** * Internally useful stuff. * ****************************/ typedef struct asn_OCTET_STRING_specifics_s { /* * Target structure description. */ int struct_size; /* Size of the structure */ int ctx_offset; /* Offset of the asn_struct_ctx_t member */ enum asn_OS_Subvariant { ASN_OSUBV_ANY, /* The open type (ANY) */ ASN_OSUBV_BIT, /* BIT STRING */ ASN_OSUBV_STR, /* String types, not {BMP,Universal}String */ ASN_OSUBV_U16, /* 16-bit character (BMPString) */ ASN_OSUBV_U32 /* 32-bit character (UniversalString) */ } subvariant; } asn_OCTET_STRING_specifics_t; #ifdef __cplusplus } #endif #endif /* _OCTET_STRING_H_ */ asn1c-0.9.24+dfsg/skeletons/constr_SEQUENCE_OF.h0000644000000000000000000000164211502527550017601 0ustar rootroot/*- * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _CONSTR_SEQUENCE_OF_H_ #define _CONSTR_SEQUENCE_OF_H_ #include #include /* Implemented using SET OF */ #ifdef __cplusplus extern "C" { #endif /* * A set specialized functions dealing with the SEQUENCE OF type. * Generally implemented using SET OF. */ #define SEQUENCE_OF_free SET_OF_free #define SEQUENCE_OF_print SET_OF_print #define SEQUENCE_OF_constraint SET_OF_constraint #define SEQUENCE_OF_decode_ber SET_OF_decode_ber #define SEQUENCE_OF_decode_xer SET_OF_decode_xer #define SEQUENCE_OF_decode_uper SET_OF_decode_uper der_type_encoder_f SEQUENCE_OF_encode_der; xer_type_encoder_f SEQUENCE_OF_encode_xer; per_type_encoder_f SEQUENCE_OF_encode_uper; #ifdef __cplusplus } #endif #endif /* _CONSTR_SET_OF_H_ */ asn1c-0.9.24+dfsg/skeletons/constr_SET_OF.c0000644000000000000000000005600012015121740017004 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * Number of bytes left for this structure. * (ctx->left) indicates the number of bytes _transferred_ for the structure. * (size) contains the number of bytes in the buffer passed. */ #define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) /* * If the subprocessor function returns with an indication that it wants * more data, it may well be a fatal decoding problem, because the * size is constrained by the 's L, even if the buffer size allows * reading more data. * For example, consider the buffer containing the following TLVs: * ... * The TLV length clearly indicates that one byte is expected in V, but * if the V processor returns with "want more data" even if the buffer * contains way more data than the V processor have seen. */ #define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) /* * This macro "eats" the part of the buffer which is definitely "consumed", * i.e. was correctly converted into local representation or rightfully skipped. */ #undef ADVANCE #define ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ ptr = ((const char *)ptr) + num;\ size -= num; \ if(ctx->left >= 0) \ ctx->left -= num; \ consumed_myself += num; \ } while(0) /* * Switch to the next phase of parsing. */ #undef NEXT_PHASE #undef PHASE_OUT #define NEXT_PHASE(ctx) do { \ ctx->phase++; \ ctx->step = 0; \ } while(0) #define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) /* * Return a standardized complex structure. */ #undef RETURN #define RETURN(_code) do { \ rval.code = _code; \ rval.consumed = consumed_myself;\ return rval; \ } while(0) /* * The decoder of the SET OF type. */ asn_dec_rval_t SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **struct_ptr, const void *ptr, size_t size, int tag_mode) { /* * Bring closer parts of structure description. */ asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; asn_TYPE_member_t *elm = td->elements; /* Single one */ /* * Parts of the structure being constructed. */ void *st = *struct_ptr; /* Target structure. */ asn_struct_ctx_t *ctx; /* Decoder context */ ber_tlv_tag_t tlv_tag; /* T from TLV */ asn_dec_rval_t rval; /* Return code from subparsers */ ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ ASN_DEBUG("Decoding %s as SET OF", td->name); /* * Create the target structure if it is not present already. */ if(st == 0) { st = *struct_ptr = CALLOC(1, specs->struct_size); if(st == 0) { RETURN(RC_FAIL); } } /* * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); /* * Start to parse where left previously */ switch(ctx->phase) { case 0: /* * PHASE 0. * Check that the set of tags associated with given structure * perfectly fits our expectations. */ rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, tag_mode, 1, &ctx->left, 0); if(rval.code != RC_OK) { ASN_DEBUG("%s tagging check failed: %d", td->name, rval.code); return rval; } if(ctx->left >= 0) ctx->left += rval.consumed; /* ?Substracted below! */ ADVANCE(rval.consumed); ASN_DEBUG("Structure consumes %ld bytes, " "buffer %ld", (long)ctx->left, (long)size); NEXT_PHASE(ctx); /* Fall through */ case 1: /* * PHASE 1. * From the place where we've left it previously, * try to decode the next item. */ for(;; ctx->step = 0) { ssize_t tag_len; /* Length of TLV's T */ if(ctx->step & 1) goto microphase2; /* * MICROPHASE 1: Synchronize decoding. */ if(ctx->left == 0) { ASN_DEBUG("End of SET OF %s", td->name); /* * No more things to decode. * Exit out of here. */ PHASE_OUT(ctx); RETURN(RC_OK); } /* * Fetch the T from TLV. */ tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); switch(tag_len) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { if(LEFT < 2) { if(SIZE_VIOLATION) RETURN(RC_FAIL); else RETURN(RC_WMORE); } else if(((const uint8_t *)ptr)[1] == 0) { /* * Found the terminator of the * indefinite length structure. */ break; } } /* Outmost tag may be unknown and cannot be fetched/compared */ if(elm->tag != (ber_tlv_tag_t)-1) { if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) { /* * The new list member of expected type has arrived. */ } else { ASN_DEBUG("Unexpected tag %s fixed SET OF %s", ber_tlv_tag_string(tlv_tag), td->name); ASN_DEBUG("%s SET OF has tag %s", td->name, ber_tlv_tag_string(elm->tag)); RETURN(RC_FAIL); } } /* * MICROPHASE 2: Invoke the member-specific decoder. */ ctx->step |= 1; /* Confirm entering next microphase */ microphase2: /* * Invoke the member fetch routine according to member's type */ rval = elm->type->ber_decoder(opt_codec_ctx, elm->type, &ctx->ptr, ptr, LEFT, 0); ASN_DEBUG("In %s SET OF %s code %d consumed %d", td->name, elm->type->name, rval.code, (int)rval.consumed); switch(rval.code) { case RC_OK: { asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); if(ASN_SET_ADD(list, ctx->ptr) != 0) RETURN(RC_FAIL); else ctx->ptr = 0; } break; case RC_WMORE: /* More data expected */ if(!SIZE_VIOLATION) { ADVANCE(rval.consumed); RETURN(RC_WMORE); } /* Fall through */ case RC_FAIL: /* Fatal error */ ASN_STRUCT_FREE(*elm->type, ctx->ptr); ctx->ptr = 0; RETURN(RC_FAIL); } /* switch(rval) */ ADVANCE(rval.consumed); } /* for(all list members) */ NEXT_PHASE(ctx); case 2: /* * Read in all "end of content" TLVs. */ while(ctx->left < 0) { if(LEFT < 2) { if(LEFT > 0 && ((const char *)ptr)[0] != 0) { /* Unexpected tag */ RETURN(RC_FAIL); } else { RETURN(RC_WMORE); } } if(((const char *)ptr)[0] == 0 && ((const char *)ptr)[1] == 0) { ADVANCE(2); ctx->left++; } else { RETURN(RC_FAIL); } } PHASE_OUT(ctx); } RETURN(RC_OK); } /* * Internally visible buffer holding a single encoded element. */ struct _el_buffer { uint8_t *buf; size_t length; size_t size; }; /* Append bytes to the above structure */ static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) { struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr; if(el_buf->length + size > el_buf->size) return -1; memcpy(el_buf->buf + el_buf->length, buffer, size); el_buf->length += size; return 0; } static int _el_buf_cmp(const void *ap, const void *bp) { const struct _el_buffer *a = (const struct _el_buffer *)ap; const struct _el_buffer *b = (const struct _el_buffer *)bp; int ret; size_t common_len; if(a->length < b->length) common_len = a->length; else common_len = b->length; ret = memcmp(a->buf, b->buf, common_len); if(ret == 0) { if(a->length < b->length) ret = -1; else if(a->length > b->length) ret = 1; } return ret; } /* * The DER encoder of the SET OF type. */ asn_enc_rval_t SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { asn_TYPE_member_t *elm = td->elements; asn_TYPE_descriptor_t *elm_type = elm->type; der_type_encoder_f *der_encoder = elm_type->der_encoder; asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); size_t computed_size = 0; ssize_t encoding_size = 0; struct _el_buffer *encoded_els; ssize_t eels_count = 0; size_t max_encoded_len = 1; asn_enc_rval_t erval; int ret; int edx; ASN_DEBUG("Estimating size for SET OF %s", td->name); /* * Gather the length of the underlying members sequence. */ for(edx = 0; edx < list->count; edx++) { void *memb_ptr = list->array[edx]; if(!memb_ptr) continue; erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, 0, 0); if(erval.encoded == -1) return erval; computed_size += erval.encoded; /* Compute maximum encoding's size */ if(max_encoded_len < (size_t)erval.encoded) max_encoded_len = erval.encoded; } /* * Encode the TLV for the sequence itself. */ encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key); if(encoding_size == -1) { erval.encoded = -1; erval.failed_type = td; erval.structure_ptr = ptr; return erval; } computed_size += encoding_size; if(!cb || list->count == 0) { erval.encoded = computed_size; _ASN_ENCODED_OK(erval); } /* * DER mandates dynamic sorting of the SET OF elements * according to their encodings. Build an array of the * encoded elements. */ encoded_els = (struct _el_buffer *)MALLOC( list->count * sizeof(encoded_els[0])); if(encoded_els == NULL) { erval.encoded = -1; erval.failed_type = td; erval.structure_ptr = ptr; return erval; } ASN_DEBUG("Encoding members of %s SET OF", td->name); /* * Encode all members. */ for(edx = 0; edx < list->count; edx++) { void *memb_ptr = list->array[edx]; struct _el_buffer *encoded_el = &encoded_els[eels_count]; if(!memb_ptr) continue; /* * Prepare space for encoding. */ encoded_el->buf = (uint8_t *)MALLOC(max_encoded_len); if(encoded_el->buf) { encoded_el->length = 0; encoded_el->size = max_encoded_len; } else { for(edx--; edx >= 0; edx--) FREEMEM(encoded_els[edx].buf); FREEMEM(encoded_els); erval.encoded = -1; erval.failed_type = td; erval.structure_ptr = ptr; return erval; } /* * Encode the member into the prepared space. */ erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, _el_addbytes, encoded_el); if(erval.encoded == -1) { for(; edx >= 0; edx--) FREEMEM(encoded_els[edx].buf); FREEMEM(encoded_els); return erval; } encoding_size += erval.encoded; eels_count++; } /* * Sort the encoded elements according to their encoding. */ qsort(encoded_els, eels_count, sizeof(encoded_els[0]), _el_buf_cmp); /* * Report encoded elements to the application. * Dispose of temporary sorted members table. */ ret = 0; for(edx = 0; edx < eels_count; edx++) { struct _el_buffer *encoded_el = &encoded_els[edx]; /* Report encoded chunks to the application */ if(ret == 0 && cb(encoded_el->buf, encoded_el->length, app_key) < 0) ret = -1; FREEMEM(encoded_el->buf); } FREEMEM(encoded_els); if(ret || computed_size != (size_t)encoding_size) { /* * Standard callback failed, or * encoded size is not equal to the computed size. */ erval.encoded = -1; erval.failed_type = td; erval.structure_ptr = ptr; } else { erval.encoded = computed_size; } _ASN_ENCODED_OK(erval); } #undef XER_ADVANCE #define XER_ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ buf_ptr = ((const char *)buf_ptr) + num;\ size -= num; \ consumed_myself += num; \ } while(0) /* * Decode the XER (XML) data. */ asn_dec_rval_t SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **struct_ptr, const char *opt_mname, const void *buf_ptr, size_t size) { /* * Bring closer parts of structure description. */ asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; asn_TYPE_member_t *element = td->elements; const char *elm_tag; const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; /* * ... and parts of the structure being constructed. */ void *st = *struct_ptr; /* Target structure. */ asn_struct_ctx_t *ctx; /* Decoder context */ asn_dec_rval_t rval; /* Return value from a decoder */ ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ /* * Create the target structure if it is not present already. */ if(st == 0) { st = *struct_ptr = CALLOC(1, specs->struct_size); if(st == 0) RETURN(RC_FAIL); } /* Which tag is expected for the downstream */ if(specs->as_XMLValueList) { elm_tag = (specs->as_XMLValueList == 1) ? 0 : ""; } else { elm_tag = (*element->name) ? element->name : element->type->xml_tag; } /* * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); /* * Phases of XER/XML processing: * Phase 0: Check that the opening tag matches our expectations. * Phase 1: Processing body and reacting on closing tag. * Phase 2: Processing inner type. */ for(; ctx->phase <= 2;) { pxer_chunk_type_e ch_type; /* XER chunk type */ ssize_t ch_size; /* Chunk size */ xer_check_tag_e tcv; /* Tag check value */ /* * Go inside the inner member of a set. */ if(ctx->phase == 2) { asn_dec_rval_t tmprval; /* Invoke the inner type decoder, m.b. multiple times */ ASN_DEBUG("XER/SET OF element [%s]", elm_tag); tmprval = element->type->xer_decoder(opt_codec_ctx, element->type, &ctx->ptr, elm_tag, buf_ptr, size); if(tmprval.code == RC_OK) { asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); if(ASN_SET_ADD(list, ctx->ptr) != 0) RETURN(RC_FAIL); ctx->ptr = 0; XER_ADVANCE(tmprval.consumed); } else { XER_ADVANCE(tmprval.consumed); RETURN(tmprval.code); } ctx->phase = 1; /* Back to body processing */ ASN_DEBUG("XER/SET OF phase => %d", ctx->phase); /* Fall through */ } /* * Get the next part of the XML stream. */ ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type); switch(ch_size) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); default: switch(ch_type) { case PXER_COMMENT: /* Got XML comment */ case PXER_TEXT: /* Ignore free-standing text */ XER_ADVANCE(ch_size); /* Skip silently */ continue; case PXER_TAG: break; /* Check the rest down there */ } } tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s", tcv, ctx->phase, xml_tag); switch(tcv) { case XCT_CLOSING: if(ctx->phase == 0) break; ctx->phase = 0; /* Fall through */ case XCT_BOTH: if(ctx->phase == 0) { /* No more things to decode */ XER_ADVANCE(ch_size); ctx->phase = 3; /* Phase out */ RETURN(RC_OK); } /* Fall through */ case XCT_OPENING: if(ctx->phase == 0) { XER_ADVANCE(ch_size); ctx->phase = 1; /* Processing body phase */ continue; } /* Fall through */ case XCT_UNKNOWN_OP: case XCT_UNKNOWN_BO: ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase); if(ctx->phase == 1) { /* * Process a single possible member. */ ctx->phase = 2; continue; } /* Fall through */ default: break; } ASN_DEBUG("Unexpected XML tag in SET OF"); break; } ctx->phase = 3; /* "Phase out" on hard failure */ RETURN(RC_FAIL); } typedef struct xer_tmp_enc_s { void *buffer; size_t offset; size_t size; } xer_tmp_enc_t; static int SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) { xer_tmp_enc_t *t = (xer_tmp_enc_t *)key; if(t->offset + size >= t->size) { size_t newsize = (t->size << 2) + size; void *p = REALLOC(t->buffer, newsize); if(!p) return -1; t->buffer = p; t->size = newsize; } memcpy((char *)t->buffer + t->offset, buffer, size); t->offset += size; return 0; } static int SET_OF_xer_order(const void *aptr, const void *bptr) { const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr; const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr; size_t minlen = a->offset; int ret; if(b->offset < minlen) minlen = b->offset; /* Well-formed UTF-8 has this nice lexicographical property... */ ret = memcmp(a->buffer, b->buffer, minlen); if(ret != 0) return ret; if(a->offset == b->offset) return 0; if(a->offset == minlen) return -1; return 1; } asn_enc_rval_t SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; asn_TYPE_member_t *elm = td->elements; asn_anonymous_set_ *list = _A_SET_FROM_VOID(sptr); const char *mname = specs->as_XMLValueList ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); size_t mlen = mname ? strlen(mname) : 0; int xcan = (flags & XER_F_CANONICAL); xer_tmp_enc_t *encs = 0; size_t encs_count = 0; void *original_app_key = app_key; asn_app_consume_bytes_f *original_cb = cb; int i; if(!sptr) _ASN_ENCODE_FAILED; if(xcan) { encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0])); if(!encs) _ASN_ENCODE_FAILED; cb = SET_OF_encode_xer_callback; } er.encoded = 0; for(i = 0; i < list->count; i++) { asn_enc_rval_t tmper; void *memb_ptr = list->array[i]; if(!memb_ptr) continue; if(encs) { memset(&encs[encs_count], 0, sizeof(encs[0])); app_key = &encs[encs_count]; encs_count++; } if(mname) { if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel); _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); } if(!xcan && specs->as_XMLValueList == 1) _i_ASN_TEXT_INDENT(1, ilevel + 1); tmper = elm->type->xer_encoder(elm->type, memb_ptr, ilevel + (specs->as_XMLValueList != 2), flags, cb, app_key); if(tmper.encoded == -1) { td = tmper.failed_type; sptr = tmper.structure_ptr; goto cb_failed; } if(tmper.encoded == 0 && specs->as_XMLValueList) { const char *name = elm->type->xml_tag; size_t len = strlen(name); _ASN_CALLBACK3("<", 1, name, len, "/>", 2); } if(mname) { _ASN_CALLBACK3("", 1); er.encoded += 5; } er.encoded += (2 * mlen) + tmper.encoded; } if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1); if(encs) { xer_tmp_enc_t *enc = encs; xer_tmp_enc_t *end = encs + encs_count; ssize_t control_size = 0; cb = original_cb; app_key = original_app_key; qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order); for(; enc < end; enc++) { _ASN_CALLBACK(enc->buffer, enc->offset); FREEMEM(enc->buffer); enc->buffer = 0; control_size += enc->offset; } assert(control_size == er.encoded); } goto cleanup; cb_failed: er.encoded = -1; er.failed_type = td; er.structure_ptr = sptr; cleanup: if(encs) { while(encs_count-- > 0) { if(encs[encs_count].buffer) FREEMEM(encs[encs_count].buffer); } FREEMEM(encs); } _ASN_ENCODED_OK(er); } int SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { asn_TYPE_member_t *elm = td->elements; const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); int ret; int i; if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; /* Dump preamble */ if(cb(td->name, strlen(td->name), app_key) < 0 || cb(" ::= {", 6, app_key) < 0) return -1; for(i = 0; i < list->count; i++) { const void *memb_ptr = list->array[i]; if(!memb_ptr) continue; _i_INDENT(1); ret = elm->type->print_struct(elm->type, memb_ptr, ilevel + 1, cb, app_key); if(ret) return ret; } ilevel--; _i_INDENT(1); return (cb("}", 1, app_key) < 0) ? -1 : 0; } void SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { if(td && ptr) { asn_SET_OF_specifics_t *specs; asn_TYPE_member_t *elm = td->elements; asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); asn_struct_ctx_t *ctx; /* Decoder context */ int i; /* * Could not use set_of_empty() because of (*free) * incompatibility. */ for(i = 0; i < list->count; i++) { void *memb_ptr = list->array[i]; if(memb_ptr) ASN_STRUCT_FREE(*elm->type, memb_ptr); } list->count = 0; /* No meaningful elements left */ asn_set_empty(list); /* Remove (list->array) */ specs = (asn_SET_OF_specifics_t *)td->specifics; ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset); if(ctx->ptr) { ASN_STRUCT_FREE(*elm->type, ctx->ptr); ctx->ptr = 0; } if(!contents_only) { FREEMEM(ptr); } } } int SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { asn_TYPE_member_t *elm = td->elements; asn_constr_check_f *constr; const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); int i; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } constr = elm->memb_constraints; if(!constr) constr = elm->type->check_constraints; /* * Iterate over the members of an array. * Validate each in turn, until one fails. */ for(i = 0; i < list->count; i++) { const void *memb_ptr = list->array[i]; int ret; if(!memb_ptr) continue; ret = constr(elm->type, memb_ptr, ctfailcb, app_key); if(ret) return ret; } /* * Cannot inherit it eralier: * need to make sure we get the updated version. */ if(!elm->memb_constraints) elm->memb_constraints = elm->type->check_constraints; return 0; } asn_dec_rval_t SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv; asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; asn_TYPE_member_t *elm = td->elements; /* Single one */ void *st = *sptr; asn_anonymous_set_ *list; asn_per_constraint_t *ct; int repeat = 0; ssize_t nelems; if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) _ASN_DECODE_FAILED; /* * Create the target structure if it is not present already. */ if(!st) { st = *sptr = CALLOC(1, specs->struct_size); if(!st) _ASN_DECODE_FAILED; } list = _A_SET_FROM_VOID(st); /* Figure out which constraints to use */ if(constraints) ct = &constraints->size; else if(td->per_constraints) ct = &td->per_constraints->size; else ct = 0; if(ct && ct->flags & APC_EXTENSIBLE) { int value = per_get_few_bits(pd, 1); if(value < 0) _ASN_DECODE_STARVED; if(value) ct = 0; /* Not restricted! */ } if(ct && ct->effective_bits >= 0) { /* X.691, #19.5: No length determinant */ nelems = per_get_few_bits(pd, ct->effective_bits); ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s", (long)nelems, ct->lower_bound, td->name); if(nelems < 0) _ASN_DECODE_STARVED; nelems += ct->lower_bound; } else { nelems = -1; } do { int i; if(nelems < 0) { nelems = uper_get_length(pd, ct ? ct->effective_bits : -1, &repeat); ASN_DEBUG("Got to decode %d elements (eff %d)", (int)nelems, (int)(ct ? ct->effective_bits : -1)); if(nelems < 0) _ASN_DECODE_STARVED; } for(i = 0; i < nelems; i++) { void *ptr = 0; ASN_DEBUG("SET OF %s decoding", elm->type->name); rv = elm->type->uper_decoder(opt_codec_ctx, elm->type, elm->per_constraints, &ptr, pd); ASN_DEBUG("%s SET OF %s decoded %d, %p", td->name, elm->type->name, rv.code, ptr); if(rv.code == RC_OK) { if(ASN_SET_ADD(list, ptr) == 0) continue; ASN_DEBUG("Failed to add element into %s", td->name); /* Fall through */ rv.code = RC_FAIL; } else { ASN_DEBUG("Failed decoding %s of %s (SET OF)", elm->type->name, td->name); } if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); return rv; } nelems = -1; /* Allow uper_get_length() */ } while(repeat); ASN_DEBUG("Decoded %s as SET OF", td->name); rv.code = RC_OK; rv.consumed = 0; return rv; } asn1c-0.9.24+dfsg/skeletons/IA5String.c0000644000000000000000000000406411502527550016156 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * IA5String basic type description. */ static ber_tlv_tag_t asn_DEF_IA5String_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), /* [UNIVERSAL 22] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; static asn_per_constraints_t asn_DEF_IA5String_constraints = { { APC_CONSTRAINED, 7, 7, 0, 0x7f }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ 0, 0 }; asn_TYPE_descriptor_t asn_DEF_IA5String = { "IA5String", "IA5String", OCTET_STRING_free, OCTET_STRING_print_utf8, /* ASCII subset */ IA5String_constraint, /* Constraint on the alphabet */ OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_utf8, OCTET_STRING_encode_xer_utf8, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_IA5String_tags, sizeof(asn_DEF_IA5String_tags) / sizeof(asn_DEF_IA5String_tags[0]) - 1, asn_DEF_IA5String_tags, sizeof(asn_DEF_IA5String_tags) / sizeof(asn_DEF_IA5String_tags[0]), &asn_DEF_IA5String_constraints, 0, 0, /* No members */ 0 /* No specifics */ }; int IA5String_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; if(st && st->buf) { uint8_t *buf = st->buf; uint8_t *end = buf + st->size; /* * IA5String is generally equivalent to 7bit ASCII. * ISO/ITU-T T.50, 1963. */ for(; buf < end; buf++) { if(*buf > 0x7F) { _ASN_CTFAIL(app_key, td, sptr, "%s: value byte %ld out of range: " "%d > 127 (%s:%d)", td->name, (long)((buf - st->buf) + 1), *buf, __FILE__, __LINE__); return -1; } } } else { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } return 0; } asn1c-0.9.24+dfsg/skeletons/constr_SET.c0000644000000000000000000005657511501114213016435 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005, 2006 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* Check that all the mandatory members are present */ static int _SET_is_populated(asn_TYPE_descriptor_t *td, void *st); /* * Number of bytes left for this structure. * (ctx->left) indicates the number of bytes _transferred_ for the structure. * (size) contains the number of bytes in the buffer passed. */ #define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) /* * If the subprocessor function returns with an indication that it wants * more data, it may well be a fatal decoding problem, because the * size is constrained by the 's L, even if the buffer size allows * reading more data. * For example, consider the buffer containing the following TLVs: * ... * The TLV length clearly indicates that one byte is expected in V, but * if the V processor returns with "want more data" even if the buffer * contains way more data than the V processor have seen. */ #define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) /* * This macro "eats" the part of the buffer which is definitely "consumed", * i.e. was correctly converted into local representation or rightfully skipped. */ #undef ADVANCE #define ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ ptr = ((const char *)ptr) + num;\ size -= num; \ if(ctx->left >= 0) \ ctx->left -= num; \ consumed_myself += num; \ } while(0) /* * Switch to the next phase of parsing. */ #undef NEXT_PHASE #define NEXT_PHASE(ctx) do { \ ctx->phase++; \ ctx->step = 0; \ } while(0) /* * Return a standardized complex structure. */ #undef RETURN #define RETURN(_code) do { \ rval.code = _code; \ rval.consumed = consumed_myself;\ return rval; \ } while(0) /* * Tags are canonically sorted in the tag2element map. */ static int _t2e_cmp(const void *ap, const void *bp) { const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap; const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp; int a_class = BER_TAG_CLASS(a->el_tag); int b_class = BER_TAG_CLASS(b->el_tag); if(a_class == b_class) { ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag); ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag); if(a_value == b_value) return 0; else if(a_value < b_value) return -1; else return 1; } else if(a_class < b_class) { return -1; } else { return 1; } } /* * The decoder of the SET type. */ asn_dec_rval_t SET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **struct_ptr, const void *ptr, size_t size, int tag_mode) { /* * Bring closer parts of structure description. */ asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics; asn_TYPE_member_t *elements = td->elements; /* * Parts of the structure being constructed. */ void *st = *struct_ptr; /* Target structure. */ asn_struct_ctx_t *ctx; /* Decoder context */ ber_tlv_tag_t tlv_tag; /* T from TLV */ asn_dec_rval_t rval; /* Return code from subparsers */ ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ int edx; /* SET element's index */ ASN_DEBUG("Decoding %s as SET", td->name); if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) _ASN_DECODE_FAILED; /* * Create the target structure if it is not present already. */ if(st == 0) { st = *struct_ptr = CALLOC(1, specs->struct_size); if(st == 0) { RETURN(RC_FAIL); } } /* * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); /* * Start to parse where left previously */ switch(ctx->phase) { case 0: /* * PHASE 0. * Check that the set of tags associated with given structure * perfectly fits our expectations. */ rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, tag_mode, 1, &ctx->left, 0); if(rval.code != RC_OK) { ASN_DEBUG("%s tagging check failed: %d", td->name, rval.code); return rval; } if(ctx->left >= 0) ctx->left += rval.consumed; /* ?Substracted below! */ ADVANCE(rval.consumed); NEXT_PHASE(ctx); ASN_DEBUG("Structure advertised %ld bytes, " "buffer contains %ld", (long)ctx->left, (long)size); /* Fall through */ case 1: /* * PHASE 1. * From the place where we've left it previously, * try to decode the next member from the list of * this structure's elements. * Note that elements in BER may arrive out of * order, yet DER mandates that they shall arive in the * canonical order of their tags. So, there is a room * for optimization. */ for(;; ctx->step = 0) { asn_TYPE_tag2member_t *t2m; asn_TYPE_tag2member_t key; void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ ssize_t tag_len; /* Length of TLV's T */ if(ctx->step & 1) { edx = ctx->step >> 1; goto microphase2; } /* * MICROPHASE 1: Synchronize decoding. */ if(ctx->left == 0) /* * No more things to decode. * Exit out of here and check whether all mandatory * elements have been received (in the next phase). */ break; /* * Fetch the T from TLV. */ tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); switch(tag_len) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { if(LEFT < 2) { if(SIZE_VIOLATION) RETURN(RC_FAIL); else RETURN(RC_WMORE); } else if(((const uint8_t *)ptr)[1] == 0) { /* * Found the terminator of the * indefinite length structure. * Invoke the generic finalization function. */ goto phase3; } } key.el_tag = tlv_tag; t2m = (asn_TYPE_tag2member_t *)bsearch(&key, specs->tag2el, specs->tag2el_count, sizeof(specs->tag2el[0]), _t2e_cmp); if(t2m) { /* * Found the element corresponding to the tag. */ edx = t2m->el_no; ctx->step = (edx << 1) + 1; ASN_DEBUG("Got tag %s (%s), edx %d", ber_tlv_tag_string(tlv_tag), td->name, edx); } else if(specs->extensible == 0) { ASN_DEBUG("Unexpected tag %s " "in non-extensible SET %s", ber_tlv_tag_string(tlv_tag), td->name); RETURN(RC_FAIL); } else { /* Skip this tag */ ssize_t skip; ASN_DEBUG("Skipping unknown tag %s", ber_tlv_tag_string(tlv_tag)); skip = ber_skip_length(opt_codec_ctx, BER_TLV_CONSTRUCTED(ptr), (const char *)ptr + tag_len, LEFT - tag_len); switch(skip) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } ADVANCE(skip + tag_len); continue; /* Try again with the next tag */ } /* * MICROPHASE 2: Invoke the member-specific decoder. */ microphase2: /* * Check for duplications: must not overwrite * already decoded elements. */ if(ASN_SET_ISPRESENT2((char *)st + specs->pres_offset, edx)) { ASN_DEBUG("SET %s: Duplicate element %s (%d)", td->name, elements[edx].name, edx); RETURN(RC_FAIL); } /* * Compute the position of the member inside a structure, * and also a type of containment (it may be contained * as pointer or using inline inclusion). */ if(elements[edx].flags & ATF_POINTER) { /* Member is a pointer to another structure */ memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset); } else { /* * A pointer to a pointer * holding the start of the structure */ memb_ptr = (char *)st + elements[edx].memb_offset; memb_ptr2 = &memb_ptr; } /* * Invoke the member fetch routine according to member's type */ rval = elements[edx].type->ber_decoder(opt_codec_ctx, elements[edx].type, memb_ptr2, ptr, LEFT, elements[edx].tag_mode); switch(rval.code) { case RC_OK: ASN_SET_MKPRESENT((char *)st + specs->pres_offset, edx); break; case RC_WMORE: /* More data expected */ if(!SIZE_VIOLATION) { ADVANCE(rval.consumed); RETURN(RC_WMORE); } /* Fail through */ case RC_FAIL: /* Fatal error */ RETURN(RC_FAIL); } /* switch(rval) */ ADVANCE(rval.consumed); } /* for(all structure members) */ phase3: ctx->phase = 3; /* Fall through */ case 3: case 4: /* Only 00 is expected */ ASN_DEBUG("SET %s Leftover: %ld, size = %ld", td->name, (long)ctx->left, (long)size); /* * Skip everything until the end of the SET. */ while(ctx->left) { ssize_t tl, ll; tl = ber_fetch_tag(ptr, LEFT, &tlv_tag); switch(tl) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } /* * If expected <0><0>... */ if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { if(LEFT < 2) { if(SIZE_VIOLATION) RETURN(RC_FAIL); else RETURN(RC_WMORE); } else if(((const uint8_t *)ptr)[1] == 0) { /* * Correctly finished with <0><0>. */ ADVANCE(2); ctx->left++; ctx->phase = 4; continue; } } if(specs->extensible == 0 || ctx->phase == 4) { ASN_DEBUG("Unexpected continuation " "of a non-extensible type %s " "(ptr=%02x)", td->name, *(const uint8_t *)ptr); RETURN(RC_FAIL); } ll = ber_skip_length(opt_codec_ctx, BER_TLV_CONSTRUCTED(ptr), (const char *)ptr + tl, LEFT - tl); switch(ll) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } ADVANCE(tl + ll); } ctx->phase = 5; case 5: /* Check that all mandatory elements are present. */ if(!_SET_is_populated(td, st)) RETURN(RC_FAIL); NEXT_PHASE(ctx); } RETURN(RC_OK); } static int _SET_is_populated(asn_TYPE_descriptor_t *td, void *st) { asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics; int edx; /* * Check that all mandatory elements are present. */ for(edx = 0; edx < td->elements_count; edx += (8 * sizeof(specs->_mandatory_elements[0]))) { unsigned int midx, pres, must; midx = edx/(8 * sizeof(specs->_mandatory_elements[0])); pres = ((unsigned int *)((char *)st+specs->pres_offset))[midx]; must = sys_ntohl(specs->_mandatory_elements[midx]); if((pres & must) == must) { /* * Yes, everything seems to be in place. */ } else { ASN_DEBUG("One or more mandatory elements " "of a SET %s %d (%08x.%08x)=%08x " "are not present", td->name, midx, pres, must, (~(pres & must) & must) ); return 0; } } return 1; } /* * The DER encoder of the SET type. */ asn_enc_rval_t SET_encode_der(asn_TYPE_descriptor_t *td, void *sptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics; size_t computed_size = 0; asn_enc_rval_t er; int t2m_build_own = (specs->tag2el_count != td->elements_count); asn_TYPE_tag2member_t *t2m; int t2m_count; ssize_t ret; int edx; /* * Use existing, or build our own tags map. */ if(t2m_build_own) { t2m = (asn_TYPE_tag2member_t *)alloca( td->elements_count * sizeof(t2m[0])); if(!t2m) _ASN_ENCODE_FAILED; /* There are such platforms */ t2m_count = 0; } else { /* * There is no untagged CHOICE in this SET. * Employ existing table. */ t2m = specs->tag2el; t2m_count = specs->tag2el_count; } /* * Gather the length of the underlying members sequence. */ for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; asn_enc_rval_t tmper; void *memb_ptr; /* * Compute the length of the encoding of this member. */ if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)sptr + elm->memb_offset); if(!memb_ptr) { if(!elm->optional) /* Mandatory elements missing */ _ASN_ENCODE_FAILED; if(t2m_build_own) { t2m[t2m_count].el_no = edx; t2m[t2m_count].el_tag = 0; t2m_count++; } continue; } } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); } tmper = elm->type->der_encoder(elm->type, memb_ptr, elm->tag_mode, elm->tag, 0, 0); if(tmper.encoded == -1) return tmper; computed_size += tmper.encoded; /* * Remember the outmost tag of this member. */ if(t2m_build_own) { t2m[t2m_count].el_no = edx; t2m[t2m_count].el_tag = asn_TYPE_outmost_tag( elm->type, memb_ptr, elm->tag_mode, elm->tag); t2m_count++; } else { /* * No dynamic sorting is necessary. */ } } /* * Finalize order of the components. */ assert(t2m_count == td->elements_count); if(t2m_build_own) { /* * Sort the underlying members according to their * canonical tags order. DER encoding mandates it. */ qsort(t2m, t2m_count, sizeof(specs->tag2el[0]), _t2e_cmp); } else { /* * Tags are already sorted by the compiler. */ } /* * Encode the TLV for the sequence itself. */ ret = der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key); if(ret == -1) _ASN_ENCODE_FAILED; er.encoded = computed_size + ret; if(!cb) _ASN_ENCODED_OK(er); /* * Encode all members. */ for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm; asn_enc_rval_t tmper; void *memb_ptr; /* Encode according to the tag order */ elm = &td->elements[t2m[edx].el_no]; if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)sptr + elm->memb_offset); if(!memb_ptr) continue; } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); } tmper = elm->type->der_encoder(elm->type, memb_ptr, elm->tag_mode, elm->tag, cb, app_key); if(tmper.encoded == -1) return tmper; computed_size -= tmper.encoded; } if(computed_size != 0) { /* * Encoded size is not equal to the computed size. */ _ASN_ENCODE_FAILED; } _ASN_ENCODED_OK(er); } #undef XER_ADVANCE #define XER_ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ buf_ptr = ((const char *)buf_ptr) + num;\ size -= num; \ consumed_myself += num; \ } while(0) /* * Decode the XER (XML) data. */ asn_dec_rval_t SET_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **struct_ptr, const char *opt_mname, const void *buf_ptr, size_t size) { /* * Bring closer parts of structure description. */ asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics; asn_TYPE_member_t *elements = td->elements; const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; /* * ... and parts of the structure being constructed. */ void *st = *struct_ptr; /* Target structure. */ asn_struct_ctx_t *ctx; /* Decoder context */ asn_dec_rval_t rval; /* Return value from a decoder */ ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ int edx; /* Element index */ /* * Create the target structure if it is not present already. */ if(st == 0) { st = *struct_ptr = CALLOC(1, specs->struct_size); if(st == 0) RETURN(RC_FAIL); } /* * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); /* * Phases of XER/XML processing: * Phase 0: Check that the opening tag matches our expectations. * Phase 1: Processing body and reacting on closing tag. * Phase 2: Processing inner type. * Phase 3: Skipping unknown extensions. * Phase 4: PHASED OUT */ for(edx = ctx->step; ctx->phase <= 3;) { pxer_chunk_type_e ch_type; /* XER chunk type */ ssize_t ch_size; /* Chunk size */ xer_check_tag_e tcv; /* Tag check value */ asn_TYPE_member_t *elm; /* * Go inside the inner member of a set. */ if(ctx->phase == 2) { asn_dec_rval_t tmprval; void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ if(ASN_SET_ISPRESENT2((char *)st + specs->pres_offset, edx)) { ASN_DEBUG("SET %s: Duplicate element %s (%d)", td->name, elements[edx].name, edx); RETURN(RC_FAIL); } elm = &elements[edx]; if(elm->flags & ATF_POINTER) { /* Member is a pointer to another structure */ memb_ptr2 = (void **)((char *)st + elm->memb_offset); } else { memb_ptr = (char *)st + elm->memb_offset; memb_ptr2 = &memb_ptr; } /* Invoke the inner type decoder, m.b. multiple times */ tmprval = elm->type->xer_decoder(opt_codec_ctx, elm->type, memb_ptr2, elm->name, buf_ptr, size); XER_ADVANCE(tmprval.consumed); if(tmprval.code != RC_OK) RETURN(tmprval.code); ctx->phase = 1; /* Back to body processing */ ASN_SET_MKPRESENT((char *)st + specs->pres_offset, edx); ASN_DEBUG("XER/SET phase => %d", ctx->phase); /* Fall through */ } /* * Get the next part of the XML stream. */ ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type); switch(ch_size) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); default: switch(ch_type) { case PXER_COMMENT: /* Got XML comment */ case PXER_TEXT: /* Ignore free-standing text */ XER_ADVANCE(ch_size); /* Skip silently */ continue; case PXER_TAG: break; /* Check the rest down there */ } } tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); ASN_DEBUG("XER/SET: tcv = %d, ph=%d", tcv, ctx->phase); /* Skip the extensions section */ if(ctx->phase == 3) { switch(xer_skip_unknown(tcv, &ctx->left)) { case -1: ctx->phase = 4; RETURN(RC_FAIL); case 1: ctx->phase = 1; /* Fall through */ case 0: XER_ADVANCE(ch_size); continue; case 2: ctx->phase = 1; break; } } switch(tcv) { case XCT_CLOSING: if(ctx->phase == 0) break; ctx->phase = 0; /* Fall through */ case XCT_BOTH: if(ctx->phase == 0) { if(_SET_is_populated(td, st)) { XER_ADVANCE(ch_size); ctx->phase = 4; /* Phase out */ RETURN(RC_OK); } else { ASN_DEBUG("Premature end of XER SET"); RETURN(RC_FAIL); } } /* Fall through */ case XCT_OPENING: if(ctx->phase == 0) { XER_ADVANCE(ch_size); ctx->phase = 1; /* Processing body phase */ continue; } /* Fall through */ case XCT_UNKNOWN_OP: case XCT_UNKNOWN_BO: ASN_DEBUG("XER/SET: tcv=%d, ph=%d", tcv, ctx->phase); if(ctx->phase != 1) break; /* Really unexpected */ /* * Search which member corresponds to this tag. */ for(edx = 0; edx < td->elements_count; edx++) { switch(xer_check_tag(buf_ptr, ch_size, elements[edx].name)) { case XCT_BOTH: case XCT_OPENING: /* * Process this member. */ ctx->step = edx; ctx->phase = 2; break; case XCT_UNKNOWN_OP: case XCT_UNKNOWN_BO: continue; default: edx = td->elements_count; break; /* Phase out */ } break; } if(edx != td->elements_count) continue; /* It is expected extension */ if(specs->extensible) { ASN_DEBUG("Got anticipated extension"); /* * Check for (XCT_BOTH or XCT_UNKNOWN_BO) * By using a mask. Only record a pure * tags. */ if(tcv & XCT_CLOSING) { /* Found without body */ } else { ctx->left = 1; ctx->phase = 3; /* Skip ...'s */ } XER_ADVANCE(ch_size); continue; } /* Fall through */ default: break; } ASN_DEBUG("Unexpected XML tag in SET, expected \"%s\"", xml_tag); break; } ctx->phase = 4; /* "Phase out" on hard failure */ RETURN(RC_FAIL); } asn_enc_rval_t SET_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics; asn_enc_rval_t er; int xcan = (flags & XER_F_CANONICAL); asn_TYPE_tag2member_t *t2m = specs->tag2el_cxer; int t2m_count = specs->tag2el_cxer_count; int edx; if(!sptr) _ASN_ENCODE_FAILED; assert(t2m_count == td->elements_count); er.encoded = 0; for(edx = 0; edx < t2m_count; edx++) { asn_enc_rval_t tmper; asn_TYPE_member_t *elm; void *memb_ptr; const char *mname; unsigned int mlen; elm = &td->elements[t2m[edx].el_no]; mname = elm->name; mlen = strlen(elm->name); if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)sptr + elm->memb_offset); if(!memb_ptr) { if(elm->optional) continue; /* Mandatory element missing */ _ASN_ENCODE_FAILED; } } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); } if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel); _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); /* Print the member itself */ tmper = elm->type->xer_encoder(elm->type, memb_ptr, ilevel + 1, flags, cb, app_key); if(tmper.encoded == -1) return tmper; _ASN_CALLBACK3("", 1); er.encoded += 5 + (2 * mlen) + tmper.encoded; } if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1); _ASN_ENCODED_OK(er); cb_failed: _ASN_ENCODE_FAILED; } int SET_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { int edx; int ret; if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; /* Dump preamble */ if(cb(td->name, strlen(td->name), app_key) < 0 || cb(" ::= {", 6, app_key) < 0) return -1; for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; const void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); if(!memb_ptr) { if(elm->optional) continue; /* Print line */ /* Fall through */ } } else { memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); } _i_INDENT(1); /* Print the member's name and stuff */ if(cb(elm->name, strlen(elm->name), app_key) < 0 || cb(": ", 2, app_key) < 0) return -1; /* Print the member itself */ ret = elm->type->print_struct(elm->type, memb_ptr, ilevel + 1, cb, app_key); if(ret) return ret; } ilevel--; _i_INDENT(1); return (cb("}", 1, app_key) < 0) ? -1 : 0; } void SET_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { int edx; if(!td || !ptr) return; ASN_DEBUG("Freeing %s as SET", td->name); for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)ptr + elm->memb_offset); if(memb_ptr) ASN_STRUCT_FREE(*elm->type, memb_ptr); } else { memb_ptr = (void *)((char *)ptr + elm->memb_offset); ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr); } } if(!contents_only) { FREEMEM(ptr); } } int SET_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { int edx; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } /* * Iterate over structure members and check their validity. */ for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; const void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); if(!memb_ptr) { if(elm->optional) continue; _ASN_CTFAIL(app_key, td, sptr, "%s: mandatory element %s absent (%s:%d)", td->name, elm->name, __FILE__, __LINE__); return -1; } } else { memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); } if(elm->memb_constraints) { int ret = elm->memb_constraints(elm->type, memb_ptr, ctfailcb, app_key); if(ret) return ret; } else { int ret = elm->type->check_constraints(elm->type, memb_ptr, ctfailcb, app_key); if(ret) return ret; /* * Cannot inherit it earlier: * need to make sure we get the updated version. */ elm->memb_constraints = elm->type->check_constraints; } } return 0; } asn1c-0.9.24+dfsg/skeletons/constr_SEQUENCE_OF.c0000644000000000000000000001240511502527550017573 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2006 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * The DER encoder of the SEQUENCE OF type. */ asn_enc_rval_t SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { asn_TYPE_member_t *elm = td->elements; asn_anonymous_sequence_ *list = _A_SEQUENCE_FROM_VOID(ptr); size_t computed_size = 0; ssize_t encoding_size = 0; asn_enc_rval_t erval; int edx; ASN_DEBUG("Estimating size of SEQUENCE OF %s", td->name); /* * Gather the length of the underlying members sequence. */ for(edx = 0; edx < list->count; edx++) { void *memb_ptr = list->array[edx]; if(!memb_ptr) continue; erval = elm->type->der_encoder(elm->type, memb_ptr, 0, elm->tag, 0, 0); if(erval.encoded == -1) return erval; computed_size += erval.encoded; } /* * Encode the TLV for the sequence itself. */ encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key); if(encoding_size == -1) { erval.encoded = -1; erval.failed_type = td; erval.structure_ptr = ptr; return erval; } computed_size += encoding_size; if(!cb) { erval.encoded = computed_size; _ASN_ENCODED_OK(erval); } ASN_DEBUG("Encoding members of SEQUENCE OF %s", td->name); /* * Encode all members. */ for(edx = 0; edx < list->count; edx++) { void *memb_ptr = list->array[edx]; if(!memb_ptr) continue; erval = elm->type->der_encoder(elm->type, memb_ptr, 0, elm->tag, cb, app_key); if(erval.encoded == -1) return erval; encoding_size += erval.encoded; } if(computed_size != (size_t)encoding_size) { /* * Encoded size is not equal to the computed size. */ erval.encoded = -1; erval.failed_type = td; erval.structure_ptr = ptr; } else { erval.encoded = computed_size; erval.structure_ptr = 0; erval.failed_type = 0; } return erval; } asn_enc_rval_t SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; asn_TYPE_member_t *elm = td->elements; asn_anonymous_sequence_ *list = _A_SEQUENCE_FROM_VOID(sptr); const char *mname = specs->as_XMLValueList ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); unsigned int mlen = mname ? strlen(mname) : 0; int xcan = (flags & XER_F_CANONICAL); int i; if(!sptr) _ASN_ENCODE_FAILED; er.encoded = 0; for(i = 0; i < list->count; i++) { asn_enc_rval_t tmper; void *memb_ptr = list->array[i]; if(!memb_ptr) continue; if(mname) { if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel); _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); } tmper = elm->type->xer_encoder(elm->type, memb_ptr, ilevel + 1, flags, cb, app_key); if(tmper.encoded == -1) return tmper; if(tmper.encoded == 0 && specs->as_XMLValueList) { const char *name = elm->type->xml_tag; size_t len = strlen(name); if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel + 1); _ASN_CALLBACK3("<", 1, name, len, "/>", 2); } if(mname) { _ASN_CALLBACK3("", 1); er.encoded += 5; } er.encoded += (2 * mlen) + tmper.encoded; } if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1); _ASN_ENCODED_OK(er); cb_failed: _ASN_ENCODE_FAILED; } asn_enc_rval_t SEQUENCE_OF_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_anonymous_sequence_ *list; asn_per_constraint_t *ct; asn_enc_rval_t er; asn_TYPE_member_t *elm = td->elements; int seq; if(!sptr) _ASN_ENCODE_FAILED; list = _A_SEQUENCE_FROM_VOID(sptr); er.encoded = 0; ASN_DEBUG("Encoding %s as SEQUENCE OF (%d)", td->name, list->count); if(constraints) ct = &constraints->size; else if(td->per_constraints) ct = &td->per_constraints->size; else ct = 0; /* If extensible constraint, check if size is in root */ if(ct) { int not_in_root = (list->count < ct->lower_bound || list->count > ct->upper_bound); ASN_DEBUG("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound, ct->flags & APC_EXTENSIBLE ? "ext" : "fix"); if(ct->flags & APC_EXTENSIBLE) { /* Declare whether size is in extension root */ if(per_put_few_bits(po, not_in_root, 1)) _ASN_ENCODE_FAILED; if(not_in_root) ct = 0; } else if(not_in_root && ct->effective_bits >= 0) _ASN_ENCODE_FAILED; } if(ct && ct->effective_bits >= 0) { /* X.691, #19.5: No length determinant */ if(per_put_few_bits(po, list->count - ct->lower_bound, ct->effective_bits)) _ASN_ENCODE_FAILED; } for(seq = -1; seq < list->count;) { ssize_t mayEncode; if(seq < 0) seq = 0; if(ct && ct->effective_bits >= 0) { mayEncode = list->count; } else { mayEncode = uper_put_length(po, list->count - seq); if(mayEncode < 0) _ASN_ENCODE_FAILED; } while(mayEncode--) { void *memb_ptr = list->array[seq++]; if(!memb_ptr) _ASN_ENCODE_FAILED; er = elm->type->uper_encoder(elm->type, elm->per_constraints, memb_ptr, po); if(er.encoded == -1) _ASN_ENCODE_FAILED; } } _ASN_ENCODED_OK(er); } asn1c-0.9.24+dfsg/skeletons/NativeEnumerated.c0000644000000000000000000001342611502527550017653 0ustar rootroot/*- * Copyright (c) 2004, 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * Read the NativeInteger.h for the explanation wrt. differences between * INTEGER and NativeInteger. * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this * implementation deals with the standard (machine-specific) representation * of them instead of using the platform-independent buffer. */ #include #include /* * NativeEnumerated basic type description. */ static ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = { "ENUMERATED", /* The ASN.1 type is still ENUMERATED */ "ENUMERATED", NativeInteger_free, NativeInteger_print, asn_generic_no_constraint, NativeInteger_decode_ber, NativeInteger_encode_der, NativeInteger_decode_xer, NativeEnumerated_encode_xer, NativeEnumerated_decode_uper, NativeEnumerated_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NativeEnumerated_tags, sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]), asn_DEF_NativeEnumerated_tags, /* Same as above */ sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn_enc_rval_t NativeEnumerated_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_enc_rval_t er; const long *native = (const long *)sptr; const asn_INTEGER_enum_map_t *el; (void)ilevel; (void)flags; if(!native) _ASN_ENCODE_FAILED; el = INTEGER_map_value2enum(specs, *native); if(el) { size_t srcsize = el->enum_len + 5; char *src = (char *)alloca(srcsize); er.encoded = snprintf(src, srcsize, "<%s/>", el->enum_name); assert(er.encoded > 0 && (size_t)er.encoded < srcsize); if(cb(src, er.encoded, app_key) < 0) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } else { ASN_DEBUG("ASN.1 forbids dealing with " "unknown value of ENUMERATED type"); _ASN_ENCODE_FAILED; } } asn_dec_rval_t NativeEnumerated_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics; asn_dec_rval_t rval = { RC_OK, 0 }; long *native = (long *)*sptr; asn_per_constraint_t *ct; long value; (void)opt_codec_ctx; if(constraints) ct = &constraints->value; else if(td->per_constraints) ct = &td->per_constraints->value; else _ASN_DECODE_FAILED; /* Mandatory! */ if(!specs) _ASN_DECODE_FAILED; if(!native) { native = (long *)(*sptr = CALLOC(1, sizeof(*native))); if(!native) _ASN_DECODE_FAILED; } ASN_DEBUG("Decoding %s as NativeEnumerated", td->name); if(ct->flags & APC_EXTENSIBLE) { int inext = per_get_few_bits(pd, 1); if(inext < 0) _ASN_DECODE_STARVED; if(inext) ct = 0; } if(ct && ct->range_bits >= 0) { value = per_get_few_bits(pd, ct->range_bits); if(value < 0) _ASN_DECODE_STARVED; if(value >= (specs->extension ? specs->extension - 1 : specs->map_count)) _ASN_DECODE_FAILED; } else { if(!specs->extension) _ASN_DECODE_FAILED; /* * X.691, #10.6: normally small non-negative whole number; */ value = uper_get_nsnnwn(pd); if(value < 0) _ASN_DECODE_STARVED; value += specs->extension - 1; if(value >= specs->map_count) _ASN_DECODE_FAILED; } *native = specs->value2enum[value].nat_value; ASN_DEBUG("Decoded %s = %ld", td->name, *native); return rval; } static int NativeEnumerated__compar_value2enum(const void *ap, const void *bp) { const asn_INTEGER_enum_map_t *a = ap; const asn_INTEGER_enum_map_t *b = bp; if(a->nat_value == b->nat_value) return 0; if(a->nat_value < b->nat_value) return -1; return 1; } asn_enc_rval_t NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics; asn_enc_rval_t er; long native, value; asn_per_constraint_t *ct; int inext = 0; asn_INTEGER_enum_map_t key; asn_INTEGER_enum_map_t *kf; if(!sptr) _ASN_ENCODE_FAILED; if(!specs) _ASN_ENCODE_FAILED; if(constraints) ct = &constraints->value; else if(td->per_constraints) ct = &td->per_constraints->value; else _ASN_ENCODE_FAILED; /* Mandatory! */ ASN_DEBUG("Encoding %s as NativeEnumerated", td->name); er.encoded = 0; native = *(long *)sptr; if(native < 0) _ASN_ENCODE_FAILED; key.nat_value = native; kf = bsearch(&key, specs->value2enum, specs->map_count, sizeof(key), NativeEnumerated__compar_value2enum); if(!kf) { ASN_DEBUG("No element corresponds to %ld", native); _ASN_ENCODE_FAILED; } value = kf - specs->value2enum; if(ct->range_bits >= 0) { int cmpWith = specs->extension ? specs->extension - 1 : specs->map_count; if(value >= cmpWith) inext = 1; } if(ct->flags & APC_EXTENSIBLE) { if(per_put_few_bits(po, inext, 1)) _ASN_ENCODE_FAILED; if(inext) ct = 0; } else if(inext) { _ASN_ENCODE_FAILED; } if(ct && ct->range_bits >= 0) { if(per_put_few_bits(po, value, ct->range_bits)) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } if(!specs->extension) _ASN_ENCODE_FAILED; /* * X.691, #10.6: normally small non-negative whole number; */ ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld", value, specs->extension, inext, value - (inext ? (specs->extension - 1) : 0)); if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0))) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } asn1c-0.9.24+dfsg/skeletons/converter-sample.c0000644000000000000000000005371612035270037017704 0ustar rootroot/* * Generic converter template for a selected ASN.1 type. * Copyright (c) 2005, 2006, 2007 Lev Walkin . * All rights reserved. * * To compile with your own ASN.1 type, please redefine the PDU as shown: * * cc -DPDU=MyCustomType -o myDecoder.o -c converter-sample.c */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* for atoi(3) */ #include /* for getopt(3) */ #include /* for strerror(3) */ #include /* for EX_* exit codes */ #include /* for errno */ #include #include /* for _ASN_DEFAULT_STACK_MAX */ /* Convert "Type" defined by -DPDU into "asn_DEF_Type" */ #define ASN_DEF_PDU(t) asn_DEF_ ## t #define DEF_PDU_Type(t) ASN_DEF_PDU(t) #define PDU_Type DEF_PDU_Type(PDU) extern asn_TYPE_descriptor_t PDU_Type; /* ASN.1 type to be decoded */ #ifdef ASN_PDU_COLLECTION /* Generated by asn1c: -pdu=... */ extern asn_TYPE_descriptor_t *asn_pdu_collection[]; #endif /* * Open file and parse its contens. */ static void *data_decode_from_file(asn_TYPE_descriptor_t *asnTypeOfPDU, FILE *file, const char *name, ssize_t suggested_bufsize, int first_pdu); static int write_out(const void *buffer, size_t size, void *key); static FILE *argument_to_file(char *av[], int idx); static char *argument_to_name(char *av[], int idx); int opt_debug; /* -d (or -dd) */ static int opt_check; /* -c (constraints checking) */ static int opt_stack; /* -s (maximum stack size) */ static int opt_nopad; /* -per-nopad (PER input is not padded) */ static int opt_onepdu; /* -1 (decode single PDU) */ /* Input data format selector */ static enum input_format { INP_BER, /* -iber: BER input */ INP_XER, /* -ixer: XER input */ INP_PER /* -iper: Unaligned PER input */ } iform; /* -i */ /* Output data format selector */ static enum output_format { OUT_XER, /* -oxer: XER (XML) output */ OUT_DER, /* -oder: DER (BER) output */ OUT_PER, /* -oper: Unaligned PER output */ OUT_TEXT, /* -otext: semi-structured text */ OUT_NULL /* -onull: No pretty-printing */ } oform; /* -o */ #ifdef JUNKTEST /* Enable -J */ #define JUNKOPT "J:" static double opt_jprob; /* Junk bit probability */ static int junk_failures; static void junk_bytes_with_probability(uint8_t *, size_t, double prob); #else #define JUNKOPT #endif /* Debug output function */ static inline void DEBUG(const char *fmt, ...) { va_list ap; if(!opt_debug) return; fprintf(stderr, "AD: "); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n"); } int main(int ac, char *av[]) { static asn_TYPE_descriptor_t *pduType = &PDU_Type; ssize_t suggested_bufsize = 8192; /* close or equal to stdio buffer */ int number_of_iterations = 1; int num; int ch; /* Figure out if Unaligned PER needs to be default */ if(pduType->uper_decoder) iform = INP_PER; /* * Pocess the command-line argments. */ while((ch = getopt(ac, av, "i:o:1b:cdn:p:hs:" JUNKOPT)) != -1) switch(ch) { case 'i': if(optarg[0] == 'b') { iform = INP_BER; break; } if(optarg[0] == 'x') { iform = INP_XER; break; } if(pduType->uper_decoder && optarg[0] == 'p') { iform = INP_PER; break; } fprintf(stderr, "-i: '%s': improper format selector\n", optarg); exit(EX_UNAVAILABLE); case 'o': if(optarg[0] == 'd') { oform = OUT_DER; break; } if(pduType->uper_encoder && optarg[0] == 'p') { oform = OUT_PER; break; } if(optarg[0] == 'x') { oform = OUT_XER; break; } if(optarg[0] == 't') { oform = OUT_TEXT; break; } if(optarg[0] == 'n') { oform = OUT_NULL; break; } fprintf(stderr, "-o: '%s': improper format selector\n", optarg); exit(EX_UNAVAILABLE); case '1': opt_onepdu = 1; break; case 'b': suggested_bufsize = atoi(optarg); if(suggested_bufsize < 1 || suggested_bufsize > 16 * 1024 * 1024) { fprintf(stderr, "-b %s: Improper buffer size (1..16M)\n", optarg); exit(EX_UNAVAILABLE); } break; case 'c': opt_check = 1; break; case 'd': opt_debug++; /* Double -dd means ASN.1 debug */ break; case 'n': number_of_iterations = atoi(optarg); if(number_of_iterations < 1) { fprintf(stderr, "-n %s: Improper iterations count\n", optarg); exit(EX_UNAVAILABLE); } break; case 'p': if(strcmp(optarg, "er-nopad") == 0) { opt_nopad = 1; break; } #ifdef ASN_PDU_COLLECTION if(strcmp(optarg, "list") == 0) { asn_TYPE_descriptor_t **pdu = asn_pdu_collection; fprintf(stderr, "Available PDU types:\n"); for(; *pdu; pdu++) printf("%s\n", (*pdu)->name); exit(0); } else if(optarg[0] >= 'A' && optarg[0] <= 'Z') { asn_TYPE_descriptor_t **pdu = asn_pdu_collection; while(*pdu && strcmp((*pdu)->name, optarg)) pdu++; if(*pdu) { pduType = *pdu; break; } fprintf(stderr, "-p %s: Unrecognized PDU\n", optarg); } #endif /* ASN_PDU_COLLECTION */ fprintf(stderr, "-p %s: Unrecognized option\n", optarg); exit(EX_UNAVAILABLE); case 's': opt_stack = atoi(optarg); if(opt_stack < 0) { fprintf(stderr, "-s %s: Non-negative value expected\n", optarg); exit(EX_UNAVAILABLE); } break; #ifdef JUNKTEST case 'J': opt_jprob = strtod(optarg, 0); if(opt_jprob <= 0.0 || opt_jprob > 1.0) { fprintf(stderr, "-J %s: Probability range 0..1 expected \n", optarg); exit(EX_UNAVAILABLE); } break; #endif /* JUNKTEST */ case 'h': default: #ifdef ASN_CONVERTER_TITLE #define _AXS(x) #x #define _ASX(x) _AXS(x) fprintf(stderr, "%s\n", _ASX(ASN_CONVERTER_TITLE)); #endif fprintf(stderr, "Usage: %s [options] ...\n", av[0]); fprintf(stderr, "Where options are:\n"); if(pduType->uper_decoder) fprintf(stderr, " -iper Input is in Unaligned PER (Packed Encoding Rules) (DEFAULT)\n"); fprintf(stderr, " -iber Input is in BER (Basic Encoding Rules)%s\n", iform == INP_PER ? "" : " (DEFAULT)"); fprintf(stderr, " -ixer Input is in XER (XML Encoding Rules)\n"); if(pduType->uper_encoder) fprintf(stderr, " -oper Output in Unaligned PER (Packed Encoding Rules)\n"); fprintf(stderr, " -oder Output in DER (Distinguished Encoding Rules)\n" " -oxer Output in XER (XML Encoding Rules) (DEFAULT)\n" " -otext Output in plain semi-structured text (dump)\n" " -onull Verify (decode) input, but do not output\n"); if(pduType->uper_decoder) fprintf(stderr, " -per-nopad Assume PER PDUs are not padded (-iper)\n"); #ifdef ASN_PDU_COLLECTION fprintf(stderr, " -p Specify PDU type to decode\n" " -p list List available PDUs\n"); #endif /* ASN_PDU_COLLECTION */ fprintf(stderr, " -1 Decode only the first PDU in file\n" " -b Set the i/o buffer size (default is %ld)\n" " -c Check ASN.1 constraints after decoding\n" " -d Enable debugging (-dd is even better)\n" " -n Process files times\n" " -s Set the stack usage limit (default is %d)\n" #ifdef JUNKTEST " -J Set random junk test bit garbaging probability\n" #endif , (long)suggested_bufsize, _ASN_DEFAULT_STACK_MAX); exit(EX_USAGE); } ac -= optind; av += optind; if(ac < 1) { fprintf(stderr, "%s: No input files specified. " "Try '-h' for more information\n", av[-optind]); exit(EX_USAGE); } setvbuf(stdout, 0, _IOLBF, 0); for(num = 0; num < number_of_iterations; num++) { int ac_i; /* * Process all files in turn. */ for(ac_i = 0; ac_i < ac; ac_i++) { asn_enc_rval_t erv; void *structure; /* Decoded structure */ FILE *file = argument_to_file(av, ac_i); char *name = argument_to_name(av, ac_i); int first_pdu; for(first_pdu = 1; first_pdu || !opt_onepdu; first_pdu = 0) { /* * Decode the encoded structure from file. */ structure = data_decode_from_file(pduType, file, name, suggested_bufsize, first_pdu); if(!structure) { if(errno) { /* Error message is already printed */ exit(EX_DATAERR); } else { /* EOF */ break; } } /* Check ASN.1 constraints */ if(opt_check) { char errbuf[128]; size_t errlen = sizeof(errbuf); if(asn_check_constraints(pduType, structure, errbuf, &errlen)) { fprintf(stderr, "%s: ASN.1 constraint " "check failed: %s\n", name, errbuf); exit(EX_DATAERR); } } switch(oform) { case OUT_NULL: #ifdef JUNKTEST if(opt_jprob == 0.0) #endif fprintf(stderr, "%s: decoded successfully\n", name); break; case OUT_TEXT: /* -otext */ asn_fprint(stdout, pduType, structure); break; case OUT_XER: /* -oxer */ if(xer_fprint(stdout, pduType, structure)) { fprintf(stderr, "%s: Cannot convert %s into XML\n", name, pduType->name); exit(EX_UNAVAILABLE); } break; case OUT_DER: erv = der_encode(pduType, structure, write_out, stdout); if(erv.encoded < 0) { fprintf(stderr, "%s: Cannot convert %s into DER\n", name, pduType->name); exit(EX_UNAVAILABLE); } DEBUG("Encoded in %ld bytes of DER", (long)erv.encoded); break; case OUT_PER: erv = uper_encode(pduType, structure, write_out, stdout); if(erv.encoded < 0) { fprintf(stderr, "%s: Cannot convert %s into Unaligned PER\n", name, pduType->name); exit(EX_UNAVAILABLE); } DEBUG("Encoded in %ld bits of UPER", (long)erv.encoded); break; } ASN_STRUCT_FREE(*pduType, structure); } if(file && file != stdin) fclose(file); } } #ifdef JUNKTEST if(opt_jprob > 0.0) { fprintf(stderr, "Junked %f OK (%d/%d)\n", opt_jprob, junk_failures, number_of_iterations); } #endif /* JUNKTEST */ return 0; } static struct dynamic_buffer { uint8_t *data; /* Pointer to the data bytes */ size_t offset; /* Offset from the start */ size_t length; /* Length of meaningful contents */ size_t unbits; /* Unused bits in the last byte */ size_t allocated; /* Allocated memory for data */ int nreallocs; /* Number of data reallocations */ off_t bytes_shifted; /* Number of bytes ever shifted */ } DynamicBuffer; static void buffer_dump() { uint8_t *p = DynamicBuffer.data + DynamicBuffer.offset; uint8_t *e = p + DynamicBuffer.length - (DynamicBuffer.unbits ? 1 : 0); if(!opt_debug) return; DEBUG("Buffer: { d=%p, o=%ld, l=%ld, u=%ld, a=%ld, s=%ld }", DynamicBuffer.data, (long)DynamicBuffer.offset, (long)DynamicBuffer.length, (long)DynamicBuffer.unbits, (long)DynamicBuffer.allocated, (long)DynamicBuffer.bytes_shifted); for(; p < e; p++) { fprintf(stderr, " %c%c%c%c%c%c%c%c", ((*p >> 7) & 1) ? '1' : '0', ((*p >> 6) & 1) ? '1' : '0', ((*p >> 5) & 1) ? '1' : '0', ((*p >> 4) & 1) ? '1' : '0', ((*p >> 3) & 1) ? '1' : '0', ((*p >> 2) & 1) ? '1' : '0', ((*p >> 1) & 1) ? '1' : '0', ((*p >> 0) & 1) ? '1' : '0'); } if(DynamicBuffer.unbits) { unsigned int shift; fprintf(stderr, " "); for(shift = 7; shift >= DynamicBuffer.unbits; shift--) fprintf(stderr, "%c", ((*p >> shift) & 1) ? '1' : '0'); fprintf(stderr, " %ld:%ld\n", (long)DynamicBuffer.length - 1, (long)8 - DynamicBuffer.unbits); } else { fprintf(stderr, " %ld\n", (long)DynamicBuffer.length); } } /* * Move the buffer content left N bits, possibly joining it with * preceeding content. */ static void buffer_shift_left(size_t offset, int bits) { uint8_t *ptr = DynamicBuffer.data + DynamicBuffer.offset + offset; uint8_t *end = DynamicBuffer.data + DynamicBuffer.offset + DynamicBuffer.length - 1; if(!bits) return; DEBUG("Shifting left %d bits off %ld (o=%ld, u=%ld, l=%ld)", bits, (long)offset, (long)DynamicBuffer.offset, (long)DynamicBuffer.unbits, (long)DynamicBuffer.length); if(offset) { int right; right = ptr[0] >> (8 - bits); DEBUG("oleft: %c%c%c%c%c%c%c%c", ((ptr[-1] >> 7) & 1) ? '1' : '0', ((ptr[-1] >> 6) & 1) ? '1' : '0', ((ptr[-1] >> 5) & 1) ? '1' : '0', ((ptr[-1] >> 4) & 1) ? '1' : '0', ((ptr[-1] >> 3) & 1) ? '1' : '0', ((ptr[-1] >> 2) & 1) ? '1' : '0', ((ptr[-1] >> 1) & 1) ? '1' : '0', ((ptr[-1] >> 0) & 1) ? '1' : '0'); DEBUG("oriht: %c%c%c%c%c%c%c%c", ((ptr[0] >> 7) & 1) ? '1' : '0', ((ptr[0] >> 6) & 1) ? '1' : '0', ((ptr[0] >> 5) & 1) ? '1' : '0', ((ptr[0] >> 4) & 1) ? '1' : '0', ((ptr[0] >> 3) & 1) ? '1' : '0', ((ptr[0] >> 2) & 1) ? '1' : '0', ((ptr[0] >> 1) & 1) ? '1' : '0', ((ptr[0] >> 0) & 1) ? '1' : '0'); DEBUG("mriht: %c%c%c%c%c%c%c%c", ((right >> 7) & 1) ? '1' : '0', ((right >> 6) & 1) ? '1' : '0', ((right >> 5) & 1) ? '1' : '0', ((right >> 4) & 1) ? '1' : '0', ((right >> 3) & 1) ? '1' : '0', ((right >> 2) & 1) ? '1' : '0', ((right >> 1) & 1) ? '1' : '0', ((right >> 0) & 1) ? '1' : '0'); ptr[-1] = (ptr[-1] & (0xff << bits)) | right; DEBUG("after: %c%c%c%c%c%c%c%c", ((ptr[-1] >> 7) & 1) ? '1' : '0', ((ptr[-1] >> 6) & 1) ? '1' : '0', ((ptr[-1] >> 5) & 1) ? '1' : '0', ((ptr[-1] >> 4) & 1) ? '1' : '0', ((ptr[-1] >> 3) & 1) ? '1' : '0', ((ptr[-1] >> 2) & 1) ? '1' : '0', ((ptr[-1] >> 1) & 1) ? '1' : '0', ((ptr[-1] >> 0) & 1) ? '1' : '0'); } buffer_dump(); for(; ptr < end; ptr++) { int right = ptr[1] >> (8 - bits); *ptr = (*ptr << bits) | right; } *ptr <<= bits; DEBUG("Unbits [%d=>", (int)DynamicBuffer.unbits); if(DynamicBuffer.unbits == 0) { DynamicBuffer.unbits += bits; } else { DynamicBuffer.unbits += bits; if(DynamicBuffer.unbits > 7) { DynamicBuffer.unbits -= 8; DynamicBuffer.length--; DynamicBuffer.bytes_shifted++; } } DEBUG("Unbits =>%d]", (int)DynamicBuffer.unbits); buffer_dump(); DEBUG("Shifted. Now (o=%ld, u=%ld l=%ld)", (long)DynamicBuffer.offset, (long)DynamicBuffer.unbits, (long)DynamicBuffer.length); } /* * Ensure that the buffer contains at least this amount of free space. */ static void add_bytes_to_buffer(const void *data2add, size_t bytes) { if(bytes == 0) return; DEBUG("=> add_bytes(%ld) { o=%ld l=%ld u=%ld, s=%ld }", (long)bytes, (long)DynamicBuffer.offset, (long)DynamicBuffer.length, (long)DynamicBuffer.unbits, (long)DynamicBuffer.allocated); if(DynamicBuffer.allocated >= (DynamicBuffer.offset + DynamicBuffer.length + bytes)) { DEBUG("\tNo buffer reallocation is necessary"); } else if(bytes <= DynamicBuffer.offset) { DEBUG("\tContents shifted by %ld", DynamicBuffer.offset); /* Shift the buffer contents */ memmove(DynamicBuffer.data, DynamicBuffer.data + DynamicBuffer.offset, DynamicBuffer.length); DynamicBuffer.bytes_shifted += DynamicBuffer.offset; DynamicBuffer.offset = 0; } else { size_t newsize = (DynamicBuffer.allocated << 2) + bytes; void *p = MALLOC(newsize); if(!p) { perror("malloc()"); exit(EX_OSERR); } memcpy(p, DynamicBuffer.data + DynamicBuffer.offset, DynamicBuffer.length); FREEMEM(DynamicBuffer.data); DynamicBuffer.data = (uint8_t *)p; DynamicBuffer.offset = 0; DynamicBuffer.allocated = newsize; DynamicBuffer.nreallocs++; DEBUG("\tBuffer reallocated to %ld (%d time)", newsize, DynamicBuffer.nreallocs); } memcpy(DynamicBuffer.data + DynamicBuffer.offset + DynamicBuffer.length, data2add, bytes); DynamicBuffer.length += bytes; if(DynamicBuffer.unbits) { int bits = DynamicBuffer.unbits; DynamicBuffer.unbits = 0; buffer_shift_left(DynamicBuffer.length - bytes, bits); } DEBUG("<= add_bytes(%ld) { o=%ld l=%ld u=%ld, s=%ld }", (long)bytes, (long)DynamicBuffer.offset, (long)DynamicBuffer.length, (long)DynamicBuffer.unbits, (long)DynamicBuffer.allocated); } static void * data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *name, ssize_t suggested_bufsize, int on_first_pdu) { static uint8_t *fbuf; static ssize_t fbuf_size; static asn_codec_ctx_t s_codec_ctx; asn_codec_ctx_t *opt_codec_ctx = 0; void *structure = 0; asn_dec_rval_t rval; size_t old_offset; size_t new_offset; int tolerate_eof; size_t rd; if(!file) { fprintf(stderr, "%s: %s\n", name, strerror(errno)); errno = EINVAL; return 0; } if(opt_stack) { s_codec_ctx.max_stack_size = opt_stack; opt_codec_ctx = &s_codec_ctx; } DEBUG("Processing %s", name); /* prepare the file buffer */ if(fbuf_size != suggested_bufsize) { fbuf = (uint8_t *)REALLOC(fbuf, suggested_bufsize); if(!fbuf) { perror("realloc()"); exit(EX_OSERR); } fbuf_size = suggested_bufsize; } if(on_first_pdu) { DynamicBuffer.offset = 0; DynamicBuffer.length = 0; DynamicBuffer.unbits = 0; DynamicBuffer.allocated = 0; DynamicBuffer.bytes_shifted = 0; DynamicBuffer.nreallocs = 0; } old_offset = DynamicBuffer.bytes_shifted + DynamicBuffer.offset; /* Pretend immediate EOF */ rval.code = RC_WMORE; rval.consumed = 0; for(tolerate_eof = 1; /* Allow EOF first time buffer is non-empty */ (rd = fread(fbuf, 1, fbuf_size, file)) || feof(file) == 0 || (tolerate_eof && DynamicBuffer.length) ;) { int ecbits = 0; /* Extra consumed bits in case of PER */ uint8_t *i_bptr; size_t i_size; /* * Copy the data over, or use the original buffer. */ if(DynamicBuffer.allocated) { /* Append new data into the existing dynamic buffer */ add_bytes_to_buffer(fbuf, rd); i_bptr = DynamicBuffer.data + DynamicBuffer.offset; i_size = DynamicBuffer.length; } else { i_bptr = fbuf; i_size = rd; } DEBUG("Decoding %ld bytes", (long)i_size); #ifdef JUNKTEST junk_bytes_with_probability(i_bptr, i_size, opt_jprob); #endif switch(iform) { case INP_BER: rval = ber_decode(opt_codec_ctx, pduType, (void **)&structure, i_bptr, i_size); break; case INP_XER: rval = xer_decode(opt_codec_ctx, pduType, (void **)&structure, i_bptr, i_size); break; case INP_PER: if(opt_nopad) rval = uper_decode(opt_codec_ctx, pduType, (void **)&structure, i_bptr, i_size, 0, DynamicBuffer.unbits); else rval = uper_decode_complete(opt_codec_ctx, pduType, (void **)&structure, i_bptr, i_size); switch(rval.code) { case RC_OK: /* Fall through */ case RC_FAIL: if(opt_nopad) { /* uper_decode() returns bits! */ /* Extra bits */ ecbits = rval.consumed % 8; /* Convert into bytes! */ rval.consumed /= 8; } break; case RC_WMORE: /* PER does not support restartability */ ASN_STRUCT_FREE(*pduType, structure); structure = 0; rval.consumed = 0; /* Continue accumulating data */ break; } break; } DEBUG("decode(%ld) consumed %ld+%db (%ld), code %d", (long)DynamicBuffer.length, (long)rval.consumed, ecbits, (long)i_size, rval.code); if(DynamicBuffer.allocated == 0) { /* * Flush remainder into the intermediate buffer. */ if(rval.code != RC_FAIL && rval.consumed < rd) { add_bytes_to_buffer(fbuf + rval.consumed, rd - rval.consumed); buffer_shift_left(0, ecbits); DynamicBuffer.bytes_shifted = rval.consumed; rval.consumed = 0; ecbits = 0; } } /* * Adjust position inside the source buffer. */ if(DynamicBuffer.allocated) { DynamicBuffer.offset += rval.consumed; DynamicBuffer.length -= rval.consumed; } else { DynamicBuffer.bytes_shifted += rval.consumed; } switch(rval.code) { case RC_OK: if(ecbits) buffer_shift_left(0, ecbits); DEBUG("RC_OK, finishing up with %ld+%d", (long)rval.consumed, ecbits); return structure; case RC_WMORE: DEBUG("RC_WMORE, continuing read=%ld, cons=%ld " " with %ld..%ld-%ld..%ld", (long)rd, (long)rval.consumed, (long)DynamicBuffer.offset, (long)DynamicBuffer.length, (long)DynamicBuffer.unbits, (long)DynamicBuffer.allocated); if(!rd) tolerate_eof--; continue; case RC_FAIL: break; } break; } DEBUG("Clean up partially decoded structure"); ASN_STRUCT_FREE(*pduType, structure); new_offset = DynamicBuffer.bytes_shifted + DynamicBuffer.offset; /* * Print a message and return failure only if not EOF, * unless this is our first PDU (empty file). */ if(on_first_pdu || DynamicBuffer.length || new_offset - old_offset > ((iform == INP_XER)?sizeof("\r\n")-1:0) ) { #ifdef JUNKTEST /* * Nothing's wrong with being unable to decode junk. * Simulate EOF. */ if(opt_jprob != 0.0) { junk_failures++; errno = 0; return 0; } #endif DEBUG("ofp %d, no=%ld, oo=%ld, dbl=%ld", on_first_pdu, (long)new_offset, (long)old_offset, (long)DynamicBuffer.length); fprintf(stderr, "%s: " "Decode failed past byte %ld: %s\n", name, (long)new_offset, (rval.code == RC_WMORE) ? "Unexpected end of input" : "Input processing error"); #ifndef ENOMSG #define ENOMSG EINVAL #endif #ifndef EBADMSG #define EBADMSG EINVAL #endif errno = (rval.code == RC_WMORE) ? ENOMSG : EBADMSG; } else { /* Got EOF after a few successful PDUs */ errno = 0; } return 0; } /* Dump the buffer out to the specified FILE */ static int write_out(const void *buffer, size_t size, void *key) { FILE *fp = (FILE *)key; return (fwrite(buffer, 1, size, fp) == size) ? 0 : -1; } static int argument_is_stdin(char *av[], int idx) { if(strcmp(av[idx], "-")) { return 0; /* Certainly not */ } else { /* This might be , unless `./program -- -` */ if(strcmp(av[-1], "--")) return 1; else return 0; } } static FILE *argument_to_file(char *av[], int idx) { return argument_is_stdin(av, idx) ? stdin : fopen(av[idx], "rb"); } static char *argument_to_name(char *av[], int idx) { return argument_is_stdin(av, idx) ? "standard input" : av[idx]; } #ifdef JUNKTEST /* * Fill bytes with some garbage with specified probability (more or less). */ static void junk_bytes_with_probability(uint8_t *buf, size_t size, double prob) { static int junkmode; uint8_t *ptr; uint8_t *end; if(opt_jprob <= 0.0) return; for(ptr = buf, end = ptr + size; ptr < end; ptr++) { int byte = *ptr; if(junkmode++ & 1) { if((((double)random() / RAND_MAX) < prob)) byte = random() & 0xff; } else { #define BPROB(b) ((((double)random() / RAND_MAX) < prob) ? b : 0) byte ^= BPROB(0x80); byte ^= BPROB(0x40); byte ^= BPROB(0x20); byte ^= BPROB(0x10); byte ^= BPROB(0x08); byte ^= BPROB(0x04); byte ^= BPROB(0x02); byte ^= BPROB(0x01); } if(byte != *ptr) { DEBUG("Junk buf[%d] %02x -> %02x", ptr - buf, *ptr, byte); *ptr = byte; } } } #endif /* JUNKTEST */ asn1c-0.9.24+dfsg/skeletons/README0000644000000000000000000000044611461150505015121 0ustar rootrootThis directory contains encoder/decoder code for various encoding rules (PER, DER, BER, XER) that work with the tables constructed by the compiler. The compiler itself does not generate much code. It creates parsing tables and then copies (links) over these files which contain generic codecs. asn1c-0.9.24+dfsg/skeletons/RELATIVE-OID.c0000644000000000000000000001326212021474006016227 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include #include /* Encoder and decoder of a primitive type */ #include /* for CHAR_BIT */ #include /* * RELATIVE-OID basic type description. */ static ber_tlv_tag_t asn_DEF_RELATIVE_OID_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)) }; asn_TYPE_descriptor_t asn_DEF_RELATIVE_OID = { "RELATIVE-OID", "RELATIVE_OID", ASN__PRIMITIVE_TYPE_free, RELATIVE_OID_print, asn_generic_no_constraint, ber_decode_primitive, der_encode_primitive, RELATIVE_OID_decode_xer, RELATIVE_OID_encode_xer, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_RELATIVE_OID_tags, sizeof(asn_DEF_RELATIVE_OID_tags) / sizeof(asn_DEF_RELATIVE_OID_tags[0]), asn_DEF_RELATIVE_OID_tags, /* Same as above */ sizeof(asn_DEF_RELATIVE_OID_tags) / sizeof(asn_DEF_RELATIVE_OID_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; static ssize_t RELATIVE_OID__dump_body(const RELATIVE_OID_t *st, asn_app_consume_bytes_f *cb, void *app_key) { ssize_t wrote = 0; ssize_t ret; int startn; int i; for(i = 0, startn = 0; i < st->size; i++) { uint8_t b = st->buf[i]; if((b & 0x80)) /* Continuation expected */ continue; if(startn) { /* Separate arcs */ if(cb(".", 1, app_key) < 0) return -1; wrote++; } ret = OBJECT_IDENTIFIER__dump_arc(&st->buf[startn], i - startn + 1, 0, cb, app_key); if(ret < 0) return -1; wrote += ret; startn = i + 1; } return wrote; } int RELATIVE_OID_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const RELATIVE_OID_t *st = (const RELATIVE_OID_t *)sptr; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(!st || !st->buf) return (cb("", 8, app_key) < 0) ? -1 : 0; /* Dump preamble */ if(cb("{ ", 2, app_key) < 0) return -1; if(RELATIVE_OID__dump_body(st, cb, app_key) < 0) return -1; return (cb(" }", 2, app_key) < 0) ? -1 : 0; } static enum xer_pbd_rval RELATIVE_OID__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_buf, size_t chunk_size) { RELATIVE_OID_t *st = (RELATIVE_OID_t *)sptr; const char *chunk_end = (const char *)chunk_buf + chunk_size; const char *endptr; long s_arcs[6]; long *arcs = s_arcs; int arcs_count; int ret; (void)td; arcs_count = OBJECT_IDENTIFIER_parse_arcs( (const char *)chunk_buf, chunk_size, arcs, sizeof(s_arcs)/sizeof(s_arcs[0]), &endptr); if(arcs_count < 0) { /* Expecting at least one arc arcs */ return XPBD_BROKEN_ENCODING; } else if(arcs_count == 0) { return XPBD_NOT_BODY_IGNORE; } assert(endptr == chunk_end); if((size_t)arcs_count > sizeof(s_arcs)/sizeof(s_arcs[0])) { arcs = (long *)MALLOC(arcs_count * sizeof(long)); if(!arcs) return XPBD_SYSTEM_FAILURE; ret = OBJECT_IDENTIFIER_parse_arcs( (const char *)chunk_buf, chunk_size, arcs, arcs_count, &endptr); if(ret != arcs_count) return XPBD_SYSTEM_FAILURE; /* assert?.. */ } /* * Convert arcs into BER representation. */ ret = RELATIVE_OID_set_arcs(st, arcs, sizeof(*arcs), arcs_count); if(arcs != s_arcs) FREEMEM(arcs); return ret ? XPBD_SYSTEM_FAILURE : XPBD_BODY_CONSUMED; } asn_dec_rval_t RELATIVE_OID_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { return xer_decode_primitive(opt_codec_ctx, td, sptr, sizeof(RELATIVE_OID_t), opt_mname, buf_ptr, size, RELATIVE_OID__xer_body_decode); } asn_enc_rval_t RELATIVE_OID_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { RELATIVE_OID_t *st = (RELATIVE_OID_t *)sptr; asn_enc_rval_t er; (void)ilevel; /* Unused argument */ (void)flags; /* Unused argument */ if(!st || !st->buf) _ASN_ENCODE_FAILED; er.encoded = RELATIVE_OID__dump_body(st, cb, app_key); if(er.encoded < 0) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } int RELATIVE_OID_get_arcs(RELATIVE_OID_t *roid, void *arcs, unsigned int arc_type_size, unsigned int arc_slots) { void *arcs_end = (char *)arcs + (arc_slots * arc_type_size); int num_arcs = 0; int startn = 0; int i; if(!roid || !roid->buf) { errno = EINVAL; return -1; } for(i = 0; i < roid->size; i++) { uint8_t b = roid->buf[i]; if((b & 0x80)) /* Continuation expected */ continue; if(arcs < arcs_end) { if(OBJECT_IDENTIFIER_get_single_arc( &roid->buf[startn], i - startn + 1, 0, arcs, arc_type_size)) return -1; arcs = ((char *)arcs) + arc_type_size; num_arcs++; } startn = i + 1; } return num_arcs; } int RELATIVE_OID_set_arcs(RELATIVE_OID_t *roid, void *arcs, unsigned int arc_type_size, unsigned int arcs_slots) { uint8_t *buf; uint8_t *bp; unsigned int size; unsigned int i; if(roid == NULL || arcs == NULL || arc_type_size < 1) { errno = EINVAL; return -1; } /* * Roughly estimate the maximum size necessary to encode these arcs. */ size = ((arc_type_size * CHAR_BIT + 6) / 7) * arcs_slots; bp = buf = (uint8_t *)MALLOC(size + 1); if(!buf) { /* ENOMEM */ return -1; } /* * Encode the arcs. */ for(i = 0; i < arcs_slots; i++, arcs = ((char *)arcs) + arc_type_size) { bp += OBJECT_IDENTIFIER_set_single_arc(bp, arcs, arc_type_size, 0); } assert((unsigned)(bp - buf) <= size); /* * Replace buffer. */ roid->size = (int)(bp - buf); bp = roid->buf; roid->buf = buf; if(bp) FREEMEM(bp); return 0; } asn1c-0.9.24+dfsg/skeletons/UTF8String.c0000644000000000000000000001123611502527550016325 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2006 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * UTF8String basic type description. */ static ber_tlv_tag_t asn_DEF_UTF8String_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), /* [UNIVERSAL 12] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), /* ... OCTET STRING */ }; asn_TYPE_descriptor_t asn_DEF_UTF8String = { "UTF8String", "UTF8String", OCTET_STRING_free, UTF8String_print, UTF8String_constraint, /* Check for invalid codes, etc. */ OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_utf8, OCTET_STRING_encode_xer_utf8, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_UTF8String_tags, sizeof(asn_DEF_UTF8String_tags) / sizeof(asn_DEF_UTF8String_tags[0]) - 1, asn_DEF_UTF8String_tags, sizeof(asn_DEF_UTF8String_tags) / sizeof(asn_DEF_UTF8String_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /* * This is the table of length expectations. * The second half of this table is only applicable to the long sequences. */ static int UTF8String_ht[2][16] = { { /* 0x0 ... 0x7 */ /* 0000..0111 */ 1, 1, 1, 1, 1, 1, 1, 1, /* 1000..1011(0), 1100..1101(2), 1110(3), 1111(-1) */ 0, 0, 0, 0, 2, 2, 3, -1 }, { /* 0xF0 .. 0xF7 */ /* 11110000..11110111 */ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, -1, -1 } }; static int32_t UTF8String_mv[7] = { 0, 0, 0x00000080, 0x00000800, 0x00010000, 0x00200000, 0x04000000 }; /* Internal aliases for return codes */ #define U8E_TRUNC -1 /* UTF-8 sequence truncated */ #define U8E_ILLSTART -2 /* Illegal UTF-8 sequence start */ #define U8E_NOTCONT -3 /* Continuation expectation failed */ #define U8E_NOTMIN -4 /* Not minimal length encoding */ #define U8E_EINVAL -5 /* Invalid arguments */ int UTF8String_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { ssize_t len = UTF8String_length((const UTF8String_t *)sptr); switch(len) { case U8E_EINVAL: _ASN_CTFAIL(app_key, td, sptr, "%s: value not given", td->name); break; case U8E_TRUNC: _ASN_CTFAIL(app_key, td, sptr, "%s: truncated UTF-8 sequence (%s:%d)", td->name, __FILE__, __LINE__); break; case U8E_ILLSTART: _ASN_CTFAIL(app_key, td, sptr, "%s: UTF-8 illegal start of encoding (%s:%d)", td->name, __FILE__, __LINE__); break; case U8E_NOTCONT: _ASN_CTFAIL(app_key, td, sptr, "%s: UTF-8 not continuation (%s:%d)", td->name, __FILE__, __LINE__); break; case U8E_NOTMIN: _ASN_CTFAIL(app_key, td, sptr, "%s: UTF-8 not minimal sequence (%s:%d)", td->name, __FILE__, __LINE__); break; } return (len < 0) ? -1 : 0; } static ssize_t UTF8String__process(const UTF8String_t *st, uint32_t *dst, size_t dstlen) { size_t length; uint8_t *buf = st->buf; uint8_t *end = buf + st->size; uint32_t *dstend = dst + dstlen; for(length = 0; buf < end; length++) { int ch = *buf; uint8_t *cend; int32_t value; int want; /* Compute the sequence length */ want = UTF8String_ht[0][ch >> 4]; switch(want) { case -1: /* Second half of the table, long sequence */ want = UTF8String_ht[1][ch & 0x0F]; if(want != -1) break; /* Fall through */ case 0: return U8E_ILLSTART; } /* assert(want >= 1 && want <= 6) */ /* Check character sequence length */ if(buf + want > end) return U8E_TRUNC; value = ch & (0xff >> want); cend = buf + want; for(buf++; buf < cend; buf++) { ch = *buf; if(ch < 0x80 || ch > 0xbf) return U8E_NOTCONT; value = (value << 6) | (ch & 0x3F); } if(value < UTF8String_mv[want]) return U8E_NOTMIN; if(dst < dstend) *dst++ = value; /* Record value */ } if(dst < dstend) *dst = 0; /* zero-terminate */ return length; } ssize_t UTF8String_length(const UTF8String_t *st) { if(st && st->buf) { return UTF8String__process(st, 0, 0); } else { return U8E_EINVAL; } } size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen) { if(st && st->buf) { ssize_t ret = UTF8String__process(st, dst, dstlen); return (ret < 0) ? 0 : ret; } else { return 0; } } int UTF8String_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(st && st->buf) { return (cb(st->buf, st->size, app_key) < 0) ? -1 : 0; } else { return (cb("", 8, app_key) < 0) ? -1 : 0; } } asn1c-0.9.24+dfsg/skeletons/NativeReal.c0000644000000000000000000001755612015121740016444 0ustar rootroot/*- * Copyright (c) 2004, 2006 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * Read the NativeReal.h for the explanation wrt. differences between * REAL and NativeReal. * Basically, both are decoders and encoders of ASN.1 REAL type, but this * implementation deals with the standard (machine-specific) representation * of them instead of using the platform-independent buffer. */ #include #include #include #include /* * NativeReal basic type description. */ static ber_tlv_tag_t asn_DEF_NativeReal_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NativeReal = { "REAL", /* The ASN.1 type is still REAL */ "REAL", NativeReal_free, NativeReal_print, asn_generic_no_constraint, NativeReal_decode_ber, NativeReal_encode_der, NativeReal_decode_xer, NativeReal_encode_xer, NativeReal_decode_uper, NativeReal_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NativeReal_tags, sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]), asn_DEF_NativeReal_tags, /* Same as above */ sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /* * Decode REAL type. */ asn_dec_rval_t NativeReal_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **dbl_ptr, const void *buf_ptr, size_t size, int tag_mode) { double *Dbl = (double *)*dbl_ptr; asn_dec_rval_t rval; ber_tlv_len_t length; /* * If the structure is not there, allocate it. */ if(Dbl == NULL) { *dbl_ptr = CALLOC(1, sizeof(*Dbl)); Dbl = (double *)*dbl_ptr; if(Dbl == NULL) { rval.code = RC_FAIL; rval.consumed = 0; return rval; } } ASN_DEBUG("Decoding %s as REAL (tm=%d)", td->name, tag_mode); /* * Check tags. */ rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, tag_mode, 0, &length, 0); if(rval.code != RC_OK) return rval; ASN_DEBUG("%s length is %d bytes", td->name, (int)length); /* * Make sure we have this length. */ buf_ptr = ((const char *)buf_ptr) + rval.consumed; size -= rval.consumed; if(length > (ber_tlv_len_t)size) { rval.code = RC_WMORE; rval.consumed = 0; return rval; } /* * ASN.1 encoded REAL: buf_ptr, length * Fill the Dbl, at the same time checking for overflow. * If overflow occured, return with RC_FAIL. */ { REAL_t tmp; union { const void *constbuf; void *nonconstbuf; } unconst_buf; double d; unconst_buf.constbuf = buf_ptr; tmp.buf = (uint8_t *)unconst_buf.nonconstbuf; tmp.size = length; if(length < (ber_tlv_len_t)size) { int ret; uint8_t saved_byte = tmp.buf[tmp.size]; tmp.buf[tmp.size] = '\0'; ret = asn_REAL2double(&tmp, &d); tmp.buf[tmp.size] = saved_byte; if(ret) { rval.code = RC_FAIL; rval.consumed = 0; return rval; } } else if(length < 48 /* Enough for longish %f value. */) { tmp.buf = alloca(length + 1); tmp.size = length; memcpy(tmp.buf, buf_ptr, length); tmp.buf[tmp.size] = '\0'; if(asn_REAL2double(&tmp, &d)) { rval.code = RC_FAIL; rval.consumed = 0; return rval; } } else { /* This should probably never happen: impractically long value */ tmp.buf = CALLOC(1, length + 1); tmp.size = length; if(tmp.buf) memcpy(tmp.buf, buf_ptr, length); if(!tmp.buf || asn_REAL2double(&tmp, &d)) { FREEMEM(tmp.buf); rval.code = RC_FAIL; rval.consumed = 0; return rval; } FREEMEM(tmp.buf); } *Dbl = d; } rval.code = RC_OK; rval.consumed += length; ASN_DEBUG("Took %ld/%ld bytes to encode %s (%f)", (long)rval.consumed, (long)length, td->name, *Dbl); return rval; } /* * Encode the NativeReal using the standard REAL type DER encoder. */ asn_enc_rval_t NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { double Dbl = *(const double *)ptr; asn_enc_rval_t erval; REAL_t tmp; /* Prepare a temporary clean structure */ memset(&tmp, 0, sizeof(tmp)); if(asn_double2REAL(&tmp, Dbl)) { erval.encoded = -1; erval.failed_type = td; erval.structure_ptr = ptr; return erval; } /* Encode a fake REAL */ erval = der_encode_primitive(td, &tmp, tag_mode, tag, cb, app_key); if(erval.encoded == -1) { assert(erval.structure_ptr == &tmp); erval.structure_ptr = ptr; } /* Free possibly allocated members of the temporary structure */ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp); return erval; } /* * Decode REAL type using PER. */ asn_dec_rval_t NativeReal_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **dbl_ptr, asn_per_data_t *pd) { double *Dbl = (double *)*dbl_ptr; asn_dec_rval_t rval; REAL_t tmp; void *ptmp = &tmp; int ret; (void)constraints; /* * If the structure is not there, allocate it. */ if(Dbl == NULL) { *dbl_ptr = CALLOC(1, sizeof(*Dbl)); Dbl = (double *)*dbl_ptr; if(Dbl == NULL) _ASN_DECODE_FAILED; } memset(&tmp, 0, sizeof(tmp)); rval = OCTET_STRING_decode_uper(opt_codec_ctx, td, NULL, &ptmp, pd); if(rval.code != RC_OK) { ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp); return rval; } ret = asn_REAL2double(&tmp, Dbl); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp); if(ret) _ASN_DECODE_FAILED; return rval; } /* * Encode the NativeReal using the OCTET STRING PER encoder. */ asn_enc_rval_t NativeReal_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { double Dbl = *(const double *)sptr; asn_enc_rval_t erval; REAL_t tmp; (void)constraints; /* Prepare a temporary clean structure */ memset(&tmp, 0, sizeof(tmp)); if(asn_double2REAL(&tmp, Dbl)) _ASN_ENCODE_FAILED; /* Encode a DER REAL */ erval = OCTET_STRING_encode_uper(td, NULL, &tmp, po); if(erval.encoded == -1) erval.structure_ptr = sptr; /* Free possibly allocated members of the temporary structure */ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp); return erval; } /* * Decode the chunk of XML text encoding REAL. */ asn_dec_rval_t NativeReal_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { asn_dec_rval_t rval; REAL_t *st = 0; REAL_t **stp = &st; double *Dbl = (double *)*sptr; if(!Dbl) { *sptr = CALLOC(1, sizeof(double)); Dbl = (double *)*sptr; if(!Dbl) { rval.code = RC_FAIL; rval.consumed = 0; return rval; } } rval = REAL_decode_xer(opt_codec_ctx, td, (void **)stp, opt_mname, buf_ptr, size); if(rval.code == RC_OK) { if(asn_REAL2double(st, Dbl)) { rval.code = RC_FAIL; rval.consumed = 0; } } else { rval.consumed = 0; } ASN_STRUCT_FREE(asn_DEF_REAL, st); return rval; } asn_enc_rval_t NativeReal_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { const double *Dbl = (const double *)sptr; asn_enc_rval_t er; (void)ilevel; if(!Dbl) _ASN_ENCODE_FAILED; er.encoded = REAL__dump(*Dbl, flags & XER_F_CANONICAL, cb, app_key); if(er.encoded < 0) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } /* * REAL specific human-readable output. */ int NativeReal_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const double *Dbl = (const double *)sptr; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(!Dbl) return (cb("", 8, app_key) < 0) ? -1 : 0; return (REAL__dump(*Dbl, 0, cb, app_key) < 0) ? -1 : 0; } void NativeReal_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { if(!td || !ptr) return; ASN_DEBUG("Freeing %s as REAL (%d, %p, Native)", td->name, contents_only, ptr); if(!contents_only) { FREEMEM(ptr); } } asn1c-0.9.24+dfsg/skeletons/asn_SEQUENCE_OF.h0000644000000000000000000000273511472004364017055 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef ASN_SEQUENCE_OF_H #define ASN_SEQUENCE_OF_H #include #ifdef __cplusplus extern "C" { #endif /* * SEQUENCE OF is the same as SET OF with a tiny difference: * the delete operation preserves the initial order of elements * and thus MAY operate in non-constant time. */ #define A_SEQUENCE_OF(type) A_SET_OF(type) #define ASN_SEQUENCE_ADD(headptr, ptr) \ asn_sequence_add((headptr), (ptr)) /*********************************************** * Implementation of the SEQUENCE OF structure. */ #define asn_sequence_add asn_set_add #define asn_sequence_empty asn_set_empty /* * Delete the element from the set by its number (base 0). * This is NOT a constant-time operation. * The order of elements is preserved. * If _do_free is given AND the (*free) is initialized, the element * will be freed using the custom (*free) function as well. */ void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free); /* * Cope with different conversions requirements to/from void in C and C++. * This is mostly useful for support library. */ typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_; #define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr)) #define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr)) #ifdef __cplusplus } #endif #endif /* ASN_SEQUENCE_OF_H */ asn1c-0.9.24+dfsg/skeletons/per_support.c0000644000000000000000000002332112015121740016757 0ustar rootroot/* * Copyright (c) 2005, 2006, 2007 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include char * per_data_string(asn_per_data_t *pd) { static char buf[2][32]; static int n; n = (n+1) % 2; snprintf(buf[n], sizeof(buf), "{m=%ld span %+ld[%d..%d] (%d)}", (long)pd->moved, (((long)pd->buffer) & 0xf), (int)pd->nboff, (int)pd->nbits, (int)(pd->nbits - pd->nboff)); return buf[n]; } void per_get_undo(asn_per_data_t *pd, int nbits) { if((ssize_t)pd->nboff < nbits) { assert((ssize_t)pd->nboff < nbits); } else { pd->nboff -= nbits; pd->moved -= nbits; } } /* * Extract a small number of bits (<= 31) from the specified PER data pointer. */ int32_t per_get_few_bits(asn_per_data_t *pd, int nbits) { size_t off; /* Next after last bit offset */ ssize_t nleft; /* Number of bits left in this stream */ uint32_t accum; const uint8_t *buf; if(nbits < 0) return -1; nleft = pd->nbits - pd->nboff; if(nbits > nleft) { int32_t tailv, vhead; if(!pd->refill || nbits > 31) return -1; /* Accumulate unused bytes before refill */ ASN_DEBUG("Obtain the rest %d bits (want %d)", (int)nleft, (int)nbits); tailv = per_get_few_bits(pd, nleft); if(tailv < 0) return -1; /* Refill (replace pd contents with new data) */ if(pd->refill(pd)) return -1; nbits -= nleft; vhead = per_get_few_bits(pd, nbits); /* Combine the rest of previous pd with the head of new one */ tailv = (tailv << nbits) | vhead; /* Could == -1 */ return tailv; } /* * Normalize position indicator. */ if(pd->nboff >= 8) { pd->buffer += (pd->nboff >> 3); pd->nbits -= (pd->nboff & ~0x07); pd->nboff &= 0x07; } pd->moved += nbits; pd->nboff += nbits; off = pd->nboff; buf = pd->buffer; /* * Extract specified number of bits. */ if(off <= 8) accum = nbits ? (buf[0]) >> (8 - off) : 0; else if(off <= 16) accum = ((buf[0] << 8) + buf[1]) >> (16 - off); else if(off <= 24) accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off); else if(off <= 31) accum = ((buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + (buf[3])) >> (32 - off); else if(nbits <= 31) { asn_per_data_t tpd = *pd; /* Here are we with our 31-bits limit plus 1..7 bits offset. */ per_get_undo(&tpd, nbits); /* The number of available bits in the stream allow * for the following operations to take place without * invoking the ->refill() function */ accum = per_get_few_bits(&tpd, nbits - 24) << 24; accum |= per_get_few_bits(&tpd, 24); } else { per_get_undo(pd, nbits); return -1; } accum &= (((uint32_t)1 << nbits) - 1); ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]", (int)nbits, (int)nleft, (int)pd->moved, (((long)pd->buffer) & 0xf), (int)pd->nboff, (int)pd->nbits, pd->buffer[0], (int)(pd->nbits - pd->nboff), (int)accum); return accum; } /* * Extract a large number of bits from the specified PER data pointer. */ int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int alright, int nbits) { int32_t value; if(alright && (nbits & 7)) { /* Perform right alignment of a first few bits */ value = per_get_few_bits(pd, nbits & 0x07); if(value < 0) return -1; *dst++ = value; /* value is already right-aligned */ nbits &= ~7; } while(nbits) { if(nbits >= 24) { value = per_get_few_bits(pd, 24); if(value < 0) return -1; *(dst++) = value >> 16; *(dst++) = value >> 8; *(dst++) = value; nbits -= 24; } else { value = per_get_few_bits(pd, nbits); if(value < 0) return -1; if(nbits & 7) { /* implies left alignment */ value <<= 8 - (nbits & 7), nbits += 8 - (nbits & 7); if(nbits > 24) *dst++ = value >> 24; } if(nbits > 16) *dst++ = value >> 16; if(nbits > 8) *dst++ = value >> 8; *dst++ = value; break; } } return 0; } /* * Get the length "n" from the stream. */ ssize_t uper_get_length(asn_per_data_t *pd, int ebits, int *repeat) { ssize_t value; *repeat = 0; if(ebits >= 0) return per_get_few_bits(pd, ebits); value = per_get_few_bits(pd, 8); if(value < 0) return -1; if((value & 128) == 0) /* #10.9.3.6 */ return (value & 0x7F); if((value & 64) == 0) { /* #10.9.3.7 */ value = ((value & 63) << 8) | per_get_few_bits(pd, 8); if(value < 0) return -1; return value; } value &= 63; /* this is "m" from X.691, #10.9.3.8 */ if(value < 1 || value > 4) return -1; *repeat = 1; return (16384 * value); } /* * Get the normally small length "n". * This procedure used to decode length of extensions bit-maps * for SET and SEQUENCE types. */ ssize_t uper_get_nslength(asn_per_data_t *pd) { ssize_t length; ASN_DEBUG("Getting normally small length"); if(per_get_few_bits(pd, 1) == 0) { length = per_get_few_bits(pd, 6) + 1; if(length <= 0) return -1; ASN_DEBUG("l=%d", (int)length); return length; } else { int repeat; length = uper_get_length(pd, -1, &repeat); if(length >= 0 && !repeat) return length; return -1; /* Error, or do not support >16K extensions */ } } /* * Get the normally small non-negative whole number. * X.691, #10.6 */ ssize_t uper_get_nsnnwn(asn_per_data_t *pd) { ssize_t value; value = per_get_few_bits(pd, 7); if(value & 64) { /* implicit (value < 0) */ value &= 63; value <<= 2; value |= per_get_few_bits(pd, 2); if(value & 128) /* implicit (value < 0) */ return -1; if(value == 0) return 0; if(value >= 3) return -1; value = per_get_few_bits(pd, 8 * value); return value; } return value; } /* * Put the normally small non-negative whole number. * X.691, #10.6 */ int uper_put_nsnnwn(asn_per_outp_t *po, int n) { int bytes; if(n <= 63) { if(n < 0) return -1; return per_put_few_bits(po, n, 7); } if(n < 256) bytes = 1; else if(n < 65536) bytes = 2; else if(n < 256 * 65536) bytes = 3; else return -1; /* This is not a "normally small" value */ if(per_put_few_bits(po, bytes, 8)) return -1; return per_put_few_bits(po, n, 8 * bytes); } /* * Put a small number of bits (<= 31). */ int per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) { size_t off; /* Next after last bit offset */ size_t omsk; /* Existing last byte meaningful bits mask */ uint8_t *buf; if(obits <= 0 || obits >= 32) return obits ? -1 : 0; ASN_DEBUG("[PER put %d bits %x to %p+%d bits]", obits, (int)bits, po->buffer, (int)po->nboff); /* * Normalize position indicator. */ if(po->nboff >= 8) { po->buffer += (po->nboff >> 3); po->nbits -= (po->nboff & ~0x07); po->nboff &= 0x07; } /* * Flush whole-bytes output, if necessary. */ if(po->nboff + obits > po->nbits) { int complete_bytes = (po->buffer - po->tmpspace); ASN_DEBUG("[PER output %ld complete + %ld]", (long)complete_bytes, (long)po->flushed_bytes); if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0) return -1; if(po->nboff) po->tmpspace[0] = po->buffer[0]; po->buffer = po->tmpspace; po->nbits = 8 * sizeof(po->tmpspace); po->flushed_bytes += complete_bytes; } /* * Now, due to sizeof(tmpspace), we are guaranteed large enough space. */ buf = po->buffer; omsk = ~((1 << (8 - po->nboff)) - 1); off = (po->nboff + obits); /* Clear data of debris before meaningful bits */ bits &= (((uint32_t)1 << obits) - 1); ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits, (int)bits, (int)bits, (int)po->nboff, (int)off, buf[0], (int)(omsk&0xff), (int)(buf[0] & omsk)); if(off <= 8) /* Completely within 1 byte */ po->nboff = off, bits <<= (8 - off), buf[0] = (buf[0] & omsk) | bits; else if(off <= 16) po->nboff = off, bits <<= (16 - off), buf[0] = (buf[0] & omsk) | (bits >> 8), buf[1] = bits; else if(off <= 24) po->nboff = off, bits <<= (24 - off), buf[0] = (buf[0] & omsk) | (bits >> 16), buf[1] = bits >> 8, buf[2] = bits; else if(off <= 31) po->nboff = off, bits <<= (32 - off), buf[0] = (buf[0] & omsk) | (bits >> 24), buf[1] = bits >> 16, buf[2] = bits >> 8, buf[3] = bits; else { per_put_few_bits(po, bits >> (obits - 24), 24); per_put_few_bits(po, bits, obits - 24); } ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]", (int)bits, (int)bits, buf[0], (long)(po->buffer - po->tmpspace)); return 0; } /* * Output a large number of bits. */ int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int nbits) { while(nbits) { uint32_t value; if(nbits >= 24) { value = (src[0] << 16) | (src[1] << 8) | src[2]; src += 3; nbits -= 24; if(per_put_few_bits(po, value, 24)) return -1; } else { value = src[0]; if(nbits > 8) value = (value << 8) | src[1]; if(nbits > 16) value = (value << 8) | src[2]; if(nbits & 0x07) value >>= (8 - (nbits & 0x07)); if(per_put_few_bits(po, value, nbits)) return -1; break; } } return 0; } /* * Put the length "n" (or part of it) into the stream. */ ssize_t uper_put_length(asn_per_outp_t *po, size_t length) { if(length <= 127) /* #10.9.3.6 */ return per_put_few_bits(po, length, 8) ? -1 : (ssize_t)length; else if(length < 16384) /* #10.9.3.7 */ return per_put_few_bits(po, length|0x8000, 16) ? -1 : (ssize_t)length; length >>= 14; if(length > 4) length = 4; return per_put_few_bits(po, 0xC0 | length, 8) ? -1 : (ssize_t)(length << 14); } /* * Put the normally small length "n" into the stream. * This procedure used to encode length of extensions bit-maps * for SET and SEQUENCE types. */ int uper_put_nslength(asn_per_outp_t *po, size_t length) { if(length <= 64) { /* #10.9.3.4 */ if(length == 0) return -1; return per_put_few_bits(po, length-1, 7) ? -1 : 0; } else { if(uper_put_length(po, length) != (ssize_t)length) { /* This might happen in case of >16K extensions */ return -1; } } return 0; } asn1c-0.9.24+dfsg/skeletons/UTCTime.h0000644000000000000000000000161611472004364015667 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _UTCTime_H_ #define _UTCTime_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t UTCTime_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_UTCTime; asn_struct_print_f UTCTime_print; asn_constr_check_f UTCTime_constraint; xer_type_encoder_f UTCTime_encode_xer; /*********************** * Some handy helpers. * ***********************/ struct tm; /* */ /* See asn_GT2time() in GeneralizedTime.h */ time_t asn_UT2time(const UTCTime_t *, struct tm *_optional_tm4fill, int as_gmt); /* See asn_time2GT() in GeneralizedTime.h */ UTCTime_t *asn_time2UT(UTCTime_t *__opt_ut, const struct tm *, int force_gmt); #ifdef __cplusplus } #endif #endif /* _UTCTime_H_ */ asn1c-0.9.24+dfsg/skeletons/xer_decoder.h0000644000000000000000000000641612021515043016673 0ustar rootroot/*- * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _XER_DECODER_H_ #define _XER_DECODER_H_ #include #ifdef __cplusplus extern "C" { #endif struct asn_TYPE_descriptor_s; /* Forward declaration */ /* * The XER decoder of any ASN.1 type. May be invoked by the application. */ asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, /* Pointer to a target structure's pointer */ const void *buffer, /* Data to be decoded */ size_t size /* Size of data buffer */ ); /* * Type of the type-specific XER decoder function. */ typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, const char *opt_mname, /* Member name */ const void *buf_ptr, size_t size ); /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ /* * Generalized function for decoding the primitive values. * Used by more specialized functions, such as OCTET_STRING_decode_xer_utf8 * and others. This function should not be used by applications, as its API * is subject to changes. */ asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx, /* Type decoder context */ void *struct_key, /* Treated as opaque pointer */ const char *xml_tag, /* Expected XML tag name */ const void *buf_ptr, size_t size, int (*opt_unexpected_tag_decoder) (void *struct_key, const void *chunk_buf, size_t chunk_size), ssize_t (*body_receiver) (void *struct_key, const void *chunk_buf, size_t chunk_size, int have_more) ); /* * Fetch the next XER (XML) token from the stream. * The function returns the number of bytes occupied by the chunk type, * returned in the _ch_type. The _ch_type is only set (and valid) when * the return value is greater than 0. */ typedef enum pxer_chunk_type { PXER_TAG, /* Complete XER tag */ PXER_TEXT, /* Plain text between XER tags */ PXER_COMMENT /* A comment, may be part of */ } pxer_chunk_type_e; ssize_t xer_next_token(int *stateContext, const void *buffer, size_t size, pxer_chunk_type_e *_ch_type); /* * This function checks the buffer against the tag name is expected to occur. */ typedef enum xer_check_tag { XCT_BROKEN = 0, /* The tag is broken */ XCT_OPENING = 1, /* This is the tag */ XCT_CLOSING = 2, /* This is the tag */ XCT_BOTH = 3, /* This is the tag */ XCT__UNK__MASK = 4, /* Mask of everything unexpected */ XCT_UNKNOWN_OP = 5, /* Unexpected tag */ XCT_UNKNOWN_CL = 6, /* Unexpected tag */ XCT_UNKNOWN_BO = 7 /* Unexpected tag */ } xer_check_tag_e; xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, const char *need_tag); /* * Get the number of bytes consisting entirely of XER whitespace characters. * RETURN VALUES: * >=0: Number of whitespace characters in the string. */ size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size); /* * Skip the series of anticipated extensions. */ int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth); #ifdef __cplusplus } #endif #endif /* _XER_DECODER_H_ */ asn1c-0.9.24+dfsg/skeletons/constr_CHOICE.h0000644000000000000000000000256611502527550016745 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _CONSTR_CHOICE_H_ #define _CONSTR_CHOICE_H_ #include #ifdef __cplusplus extern "C" { #endif typedef struct asn_CHOICE_specifics_s { /* * Target structure description. */ int struct_size; /* Size of the target structure. */ int ctx_offset; /* Offset of the asn_codec_ctx_t member */ int pres_offset; /* Identifier of the present member */ int pres_size; /* Size of the identifier (enum) */ /* * Tags to members mapping table. */ asn_TYPE_tag2member_t *tag2el; int tag2el_count; /* Canonical ordering of CHOICE elements, for PER */ int *canonical_order; /* * Extensions-related stuff. */ int ext_start; /* First member of extensions, or -1 */ } asn_CHOICE_specifics_t; /* * A set specialized functions dealing with the CHOICE type. */ asn_struct_free_f CHOICE_free; asn_struct_print_f CHOICE_print; asn_constr_check_f CHOICE_constraint; ber_type_decoder_f CHOICE_decode_ber; der_type_encoder_f CHOICE_encode_der; xer_type_decoder_f CHOICE_decode_xer; xer_type_encoder_f CHOICE_encode_xer; per_type_decoder_f CHOICE_decode_uper; per_type_encoder_f CHOICE_encode_uper; asn_outmost_tag_f CHOICE_outmost_tag; #ifdef __cplusplus } #endif #endif /* _CONSTR_CHOICE_H_ */ asn1c-0.9.24+dfsg/skeletons/VideotexString.c0000644000000000000000000000234311502527550017365 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * VideotexString basic type description. */ static ber_tlv_tag_t asn_DEF_VideotexString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (21 << 2)), /* [UNIVERSAL 21] IMPLICIT */ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; asn_TYPE_descriptor_t asn_DEF_VideotexString = { "VideotexString", "VideotexString", OCTET_STRING_free, OCTET_STRING_print, /* non-ascii string */ asn_generic_unknown_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_hex, OCTET_STRING_encode_xer, OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_VideotexString_tags, sizeof(asn_DEF_VideotexString_tags) / sizeof(asn_DEF_VideotexString_tags[0]) - 1, asn_DEF_VideotexString_tags, sizeof(asn_DEF_VideotexString_tags) / sizeof(asn_DEF_VideotexString_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/skeletons/UniversalString.h0000644000000000000000000000120611472004364017547 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _UniversalString_H_ #define _UniversalString_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t UniversalString_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_UniversalString; asn_struct_print_f UniversalString_print; /* Human-readable output */ xer_type_decoder_f UniversalString_decode_xer; xer_type_encoder_f UniversalString_encode_xer; #ifdef __cplusplus } #endif #endif /* _UniversalString_H_ */ asn1c-0.9.24+dfsg/skeletons/NumericString.h0000644000000000000000000000077611472004364017214 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _NumericString_H_ #define _NumericString_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t NumericString_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_NumericString; asn_constr_check_f NumericString_constraint; #ifdef __cplusplus } #endif #endif /* _NumericString_H_ */ asn1c-0.9.24+dfsg/skeletons/per_opentype.c0000644000000000000000000002244112015121740017110 0ustar rootroot/* * Copyright (c) 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include #include typedef struct uper_ugot_key { asn_per_data_t oldpd; /* Old per data source */ size_t unclaimed; size_t ot_moved; /* Number of bits moved by OT processing */ int repeat; } uper_ugot_key; static int uper_ugot_refill(asn_per_data_t *pd); static int per_skip_bits(asn_per_data_t *pd, int skip_nbits); static asn_dec_rval_t uper_sot_suck(asn_codec_ctx_t *, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); /* * Encode an "open type field". * #10.1, #10.2 */ int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { void *buf; void *bptr; ssize_t size; size_t toGo; ASN_DEBUG("Open type put %s ...", td->name); size = uper_encode_to_new_buffer(td, constraints, sptr, &buf); if(size <= 0) return -1; for(bptr = buf, toGo = size; toGo;) { ssize_t maySave = uper_put_length(po, toGo); ASN_DEBUG("Prepending length %d to %s and allowing to save %d", (int)size, td->name, (int)maySave); if(maySave < 0) break; if(per_put_many_bits(po, bptr, maySave * 8)) break; bptr = (char *)bptr + maySave; toGo -= maySave; } FREEMEM(buf); if(toGo) return -1; ASN_DEBUG("Open type put %s of length %ld + overhead (1byte?)", td->name, (long)size); return 0; } static asn_dec_rval_t uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv; ssize_t chunk_bytes; int repeat; uint8_t *buf = 0; size_t bufLen = 0; size_t bufSize = 0; asn_per_data_t spd; size_t padding; _ASN_STACK_OVERFLOW_CHECK(ctx); ASN_DEBUG("Getting open type %s...", td->name); do { chunk_bytes = uper_get_length(pd, -1, &repeat); if(chunk_bytes < 0) { FREEMEM(buf); _ASN_DECODE_STARVED; } if(bufLen + chunk_bytes > bufSize) { void *ptr; bufSize = chunk_bytes + (bufSize << 2); ptr = REALLOC(buf, bufSize); if(!ptr) { FREEMEM(buf); _ASN_DECODE_FAILED; } buf = ptr; } if(per_get_many_bits(pd, buf + bufLen, 0, chunk_bytes << 3)) { FREEMEM(buf); _ASN_DECODE_STARVED; } bufLen += chunk_bytes; } while(repeat); ASN_DEBUG("Getting open type %s encoded in %ld bytes", td->name, (long)bufLen); memset(&spd, 0, sizeof(spd)); spd.buffer = buf; spd.nbits = bufLen << 3; ASN_DEBUG_INDENT_ADD(+4); rv = td->uper_decoder(ctx, td, constraints, sptr, &spd); ASN_DEBUG_INDENT_ADD(-4); if(rv.code == RC_OK) { /* Check padding validity */ padding = spd.nbits - spd.nboff; if ((padding < 8 || /* X.691#10.1.3 */ (spd.nboff == 0 && spd.nbits == 8 && spd.buffer == buf)) && per_get_few_bits(&spd, padding) == 0) { /* Everything is cool */ FREEMEM(buf); return rv; } FREEMEM(buf); if(padding >= 8) { ASN_DEBUG("Too large padding %d in open type", (int)padding); _ASN_DECODE_FAILED; } else { ASN_DEBUG("Non-zero padding"); _ASN_DECODE_FAILED; } } else { FREEMEM(buf); /* rv.code could be RC_WMORE, nonsense in this context */ rv.code = RC_FAIL; /* Noone would give us more */ } return rv; } static asn_dec_rval_t GCC_NOTUSED uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { uper_ugot_key arg; asn_dec_rval_t rv; ssize_t padding; _ASN_STACK_OVERFLOW_CHECK(ctx); ASN_DEBUG("Getting open type %s from %s", td->name, per_data_string(pd)); arg.oldpd = *pd; arg.unclaimed = 0; arg.ot_moved = 0; arg.repeat = 1; pd->refill = uper_ugot_refill; pd->refill_key = &arg; pd->nbits = pd->nboff; /* 0 good bits at this point, will refill */ pd->moved = 0; /* This now counts the open type size in bits */ ASN_DEBUG_INDENT_ADD(+4); rv = td->uper_decoder(ctx, td, constraints, sptr, pd); ASN_DEBUG_INDENT_ADD(-4); #define UPDRESTOREPD do { \ /* buffer and nboff are valid, preserve them. */ \ pd->nbits = arg.oldpd.nbits - (pd->moved - arg.ot_moved); \ pd->moved = arg.oldpd.moved + (pd->moved - arg.ot_moved); \ pd->refill = arg.oldpd.refill; \ pd->refill_key = arg.oldpd.refill_key; \ } while(0) if(rv.code != RC_OK) { UPDRESTOREPD; return rv; } ASN_DEBUG("OpenType %s pd%s old%s unclaimed=%d, repeat=%d", td->name, per_data_string(pd), per_data_string(&arg.oldpd), (int)arg.unclaimed, (int)arg.repeat); padding = pd->moved % 8; if(padding) { int32_t pvalue; if(padding > 7) { ASN_DEBUG("Too large padding %d in open type", (int)padding); rv.code = RC_FAIL; UPDRESTOREPD; return rv; } padding = 8 - padding; ASN_DEBUG("Getting padding of %d bits", (int)padding); pvalue = per_get_few_bits(pd, padding); switch(pvalue) { case -1: ASN_DEBUG("Padding skip failed"); UPDRESTOREPD; _ASN_DECODE_STARVED; case 0: break; default: ASN_DEBUG("Non-blank padding (%d bits 0x%02x)", (int)padding, (int)pvalue); UPDRESTOREPD; _ASN_DECODE_FAILED; } } if(pd->nboff != pd->nbits) { ASN_DEBUG("Open type %s overhead pd%s old%s", td->name, per_data_string(pd), per_data_string(&arg.oldpd)); if(1) { UPDRESTOREPD; _ASN_DECODE_FAILED; } else { arg.unclaimed += pd->nbits - pd->nboff; } } /* Adjust pd back so it points to original data */ UPDRESTOREPD; /* Skip data not consumed by the decoder */ if(arg.unclaimed) { ASN_DEBUG("Getting unclaimed %d", (int)arg.unclaimed); switch(per_skip_bits(pd, arg.unclaimed)) { case -1: ASN_DEBUG("Claim of %d failed", (int)arg.unclaimed); _ASN_DECODE_STARVED; case 0: ASN_DEBUG("Got claim of %d", (int)arg.unclaimed); break; default: /* Padding must be blank */ ASN_DEBUG("Non-blank unconsumed padding"); _ASN_DECODE_FAILED; } arg.unclaimed = 0; } if(arg.repeat) { ASN_DEBUG("Not consumed the whole thing"); rv.code = RC_FAIL; return rv; } return rv; } asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { return uper_open_type_get_simple(ctx, td, constraints, sptr, pd); } int uper_open_type_skip(asn_codec_ctx_t *ctx, asn_per_data_t *pd) { asn_TYPE_descriptor_t s_td; asn_dec_rval_t rv; s_td.name = ""; s_td.uper_decoder = uper_sot_suck; rv = uper_open_type_get(ctx, &s_td, 0, 0, pd); if(rv.code != RC_OK) return -1; else return 0; } /* * Internal functions. */ static asn_dec_rval_t uper_sot_suck(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv; (void)ctx; (void)td; (void)constraints; (void)sptr; while(per_get_few_bits(pd, 24) >= 0); rv.code = RC_OK; rv.consumed = pd->moved; return rv; } static int uper_ugot_refill(asn_per_data_t *pd) { uper_ugot_key *arg = pd->refill_key; ssize_t next_chunk_bytes, next_chunk_bits; ssize_t avail; asn_per_data_t *oldpd = &arg->oldpd; ASN_DEBUG("REFILLING pd->moved=%ld, oldpd->moved=%ld", (long)pd->moved, (long)oldpd->moved); /* Advance our position to where pd is */ oldpd->buffer = pd->buffer; oldpd->nboff = pd->nboff; oldpd->nbits -= pd->moved - arg->ot_moved; oldpd->moved += pd->moved - arg->ot_moved; arg->ot_moved = pd->moved; if(arg->unclaimed) { /* Refill the container */ if(per_get_few_bits(oldpd, 1)) return -1; if(oldpd->nboff == 0) { assert(0); return -1; } pd->buffer = oldpd->buffer; pd->nboff = oldpd->nboff - 1; pd->nbits = oldpd->nbits; ASN_DEBUG("UNCLAIMED <- return from (pd->moved=%ld)", (long)pd->moved); return 0; } if(!arg->repeat) { ASN_DEBUG("Want more but refill doesn't have it"); return -1; } next_chunk_bytes = uper_get_length(oldpd, -1, &arg->repeat); ASN_DEBUG("Open type LENGTH %ld bytes at off %ld, repeat %ld", (long)next_chunk_bytes, (long)oldpd->moved, (long)arg->repeat); if(next_chunk_bytes < 0) return -1; if(next_chunk_bytes == 0) { pd->refill = 0; /* No more refills, naturally */ assert(!arg->repeat); /* Implementation guarantee */ } next_chunk_bits = next_chunk_bytes << 3; avail = oldpd->nbits - oldpd->nboff; if(avail >= next_chunk_bits) { pd->nbits = oldpd->nboff + next_chunk_bits; arg->unclaimed = 0; ASN_DEBUG("!+Parent frame %ld bits, alloting %ld [%ld..%ld] (%ld)", (long)next_chunk_bits, (long)oldpd->moved, (long)oldpd->nboff, (long)oldpd->nbits, (long)(oldpd->nbits - oldpd->nboff)); } else { pd->nbits = oldpd->nbits; arg->unclaimed = next_chunk_bits - avail; ASN_DEBUG("!-Parent frame %ld, require %ld, will claim %ld", (long)avail, (long)next_chunk_bits, (long)arg->unclaimed); } pd->buffer = oldpd->buffer; pd->nboff = oldpd->nboff; ASN_DEBUG("Refilled pd%s old%s", per_data_string(pd), per_data_string(oldpd)); return 0; } static int per_skip_bits(asn_per_data_t *pd, int skip_nbits) { int hasNonZeroBits = 0; while(skip_nbits > 0) { int skip; if(skip_nbits < skip) skip = skip_nbits; else skip = 24; skip_nbits -= skip; switch(per_get_few_bits(pd, skip)) { case -1: return -1; /* Starving */ case 0: continue; /* Skipped empty space */ default: hasNonZeroBits = 1; continue; } } return hasNonZeroBits; } asn1c-0.9.24+dfsg/skeletons/ber_tlv_length.c0000644000000000000000000000731011472004364017403 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, ber_tlv_len_t *len_r) { const uint8_t *buf = (const uint8_t *)bufptr; unsigned oct; if(size == 0) return 0; /* Want more */ oct = *(const uint8_t *)buf; if((oct & 0x80) == 0) { /* * Short definite length. */ *len_r = oct; /* & 0x7F */ return 1; } else { ber_tlv_len_t len; size_t skipped; if(_is_constructed && oct == 0x80) { *len_r = -1; /* Indefinite length */ return 1; } if(oct == 0xff) { /* Reserved in standard for future use. */ return -1; } oct &= 0x7F; /* Leave only the 7 LS bits */ for(len = 0, buf++, skipped = 1; oct && (++skipped <= size); buf++, oct--) { len = (len << 8) | *buf; if(len < 0 || (len >> ((8 * sizeof(len)) - 8) && oct > 1)) { /* * Too large length value. */ return -1; } } if(oct == 0) { ber_tlv_len_t lenplusepsilon = (size_t)len + 1024; /* * Here length may be very close or equal to 2G. * However, the arithmetics used in some decoders * may add some (small) quantities to the length, * to check the resulting value against some limits. * This may result in integer wrap-around, which * we try to avoid by checking it earlier here. */ if(lenplusepsilon < 0) { /* Too large length value */ return -1; } *len_r = len; return skipped; } return 0; /* Want more */ } } ssize_t ber_skip_length(asn_codec_ctx_t *opt_codec_ctx, int _is_constructed, const void *ptr, size_t size) { ber_tlv_len_t vlen; /* Length of V in TLV */ ssize_t tl; /* Length of L in TLV */ ssize_t ll; /* Length of L in TLV */ size_t skip; /* * Make sure we didn't exceed the maximum stack size. */ if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) return -1; /* * Determine the size of L in TLV. */ ll = ber_fetch_length(_is_constructed, ptr, size, &vlen); if(ll <= 0) return ll; /* * Definite length. */ if(vlen >= 0) { skip = ll + vlen; if(skip > size) return 0; /* Want more */ return skip; } /* * Indefinite length! */ ASN_DEBUG("Skipping indefinite length"); for(skip = ll, ptr = ((const char *)ptr) + ll, size -= ll;;) { ber_tlv_tag_t tag; /* Fetch the tag */ tl = ber_fetch_tag(ptr, size, &tag); if(tl <= 0) return tl; ll = ber_skip_length(opt_codec_ctx, BER_TLV_CONSTRUCTED(ptr), ((const char *)ptr) + tl, size - tl); if(ll <= 0) return ll; skip += tl + ll; /* * This may be the end of the indefinite length structure, * two consecutive 0 octets. * Check if it is true. */ if(((const uint8_t *)ptr)[0] == 0 && ((const uint8_t *)ptr)[1] == 0) return skip; ptr = ((const char *)ptr) + tl + ll; size -= tl + ll; } /* UNREACHABLE */ } size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufp, size_t size) { size_t required_size; /* Size of len encoding */ uint8_t *buf = (uint8_t *)bufp; uint8_t *end; size_t i; if(len <= 127) { /* Encoded in 1 octet */ if(size) *buf = (uint8_t)len; return 1; } /* * Compute the size of the subsequent bytes. */ for(required_size = 1, i = 8; i < 8 * sizeof(len); i += 8) { if(len >> i) required_size++; else break; } if(size <= required_size) return required_size + 1; *buf++ = (uint8_t)(0x80 | required_size); /* Length of the encoding */ /* * Produce the len encoding, space permitting. */ end = buf + required_size; for(i -= 8; buf < end; i -= 8, buf++) *buf = (uint8_t)(len >> i); return required_size + 1; } asn1c-0.9.24+dfsg/skeletons/PrintableString.h0000644000000000000000000000101311472004364017513 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _PrintableString_H_ #define _PrintableString_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t PrintableString_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_PrintableString; asn_constr_check_f PrintableString_constraint; #ifdef __cplusplus } #endif #endif /* _PrintableString_H_ */ asn1c-0.9.24+dfsg/skeletons/ENUMERATED.c0000644000000000000000000000412411502527550016037 0ustar rootroot/*- * Copyright (c) 2003, 2005, 2006 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include #include /* Encoder and decoder of a primitive type */ /* * ENUMERATED basic type description. */ static ber_tlv_tag_t asn_DEF_ENUMERATED_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_ENUMERATED = { "ENUMERATED", "ENUMERATED", ASN__PRIMITIVE_TYPE_free, INTEGER_print, /* Implemented in terms of INTEGER */ asn_generic_no_constraint, ber_decode_primitive, INTEGER_encode_der, /* Implemented in terms of INTEGER */ INTEGER_decode_xer, /* This is temporary! */ INTEGER_encode_xer, ENUMERATED_decode_uper, /* Unaligned PER decoder */ ENUMERATED_encode_uper, /* Unaligned PER encoder */ 0, /* Use generic outmost tag fetcher */ asn_DEF_ENUMERATED_tags, sizeof(asn_DEF_ENUMERATED_tags) / sizeof(asn_DEF_ENUMERATED_tags[0]), asn_DEF_ENUMERATED_tags, /* Same as above */ sizeof(asn_DEF_ENUMERATED_tags) / sizeof(asn_DEF_ENUMERATED_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn_dec_rval_t ENUMERATED_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rval; ENUMERATED_t *st = (ENUMERATED_t *)*sptr; long value; void *vptr = &value; if(!st) { st = (ENUMERATED_t *)(*sptr = CALLOC(1, sizeof(*st))); if(!st) _ASN_DECODE_FAILED; } rval = NativeEnumerated_decode_uper(opt_codec_ctx, td, constraints, (void **)&vptr, pd); if(rval.code == RC_OK) if(asn_long2INTEGER(st, value)) rval.code = RC_FAIL; return rval; } asn_enc_rval_t ENUMERATED_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { ENUMERATED_t *st = (ENUMERATED_t *)sptr; long value; if(asn_INTEGER2long(st, &value)) _ASN_ENCODE_FAILED; return NativeEnumerated_encode_uper(td, constraints, &value, po); } asn1c-0.9.24+dfsg/skeletons/asn_internal.h0000644000000000000000000000735412021053777017102 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005, 2007 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * Declarations internally useful for the ASN.1 support code. */ #ifndef _ASN_INTERNAL_H_ #define _ASN_INTERNAL_H_ #include "asn_application.h" /* Application-visible API */ #ifndef __NO_ASSERT_H__ /* Include assert.h only for internal use. */ #include /* for assert() macro */ #endif #ifdef __cplusplus extern "C" { #endif /* Environment version might be used to avoid running with the old library */ #define ASN1C_ENVIRONMENT_VERSION 923 /* Compile-time version */ int get_asn1c_environment_version(void); /* Run-time version */ #define CALLOC(nmemb, size) calloc(nmemb, size) #define MALLOC(size) malloc(size) #define REALLOC(oldptr, size) realloc(oldptr, size) #define FREEMEM(ptr) free(ptr) #define asn_debug_indent 0 #define ASN_DEBUG_INDENT_ADD(i) do{}while(0) /* * A macro for debugging the ASN.1 internals. * You may enable or override it. */ #ifndef ASN_DEBUG /* If debugging code is not defined elsewhere... */ #if EMIT_ASN_DEBUG == 1 /* And it was asked to emit this code... */ #ifdef __GNUC__ #ifdef ASN_THREAD_SAFE /* Thread safety requires sacrifice in output indentation: * Retain empty definition of ASN_DEBUG_INDENT_ADD. */ #else /* !ASN_THREAD_SAFE */ #undef ASN_DEBUG_INDENT_ADD #undef asn_debug_indent int asn_debug_indent; #define ASN_DEBUG_INDENT_ADD(i) do { asn_debug_indent += i; } while(0) #endif /* ASN_THREAD_SAFE */ #define ASN_DEBUG(fmt, args...) do { \ int adi = asn_debug_indent; \ while(adi--) fprintf(stderr, " "); \ fprintf(stderr, fmt, ##args); \ fprintf(stderr, " (%s:%d)\n", \ __FILE__, __LINE__); \ } while(0) #else /* !__GNUC__ */ void ASN_DEBUG_f(const char *fmt, ...); #define ASN_DEBUG ASN_DEBUG_f #endif /* __GNUC__ */ #else /* EMIT_ASN_DEBUG != 1 */ static inline void ASN_DEBUG(const char *fmt, ...) { (void)fmt; } #endif /* EMIT_ASN_DEBUG */ #endif /* ASN_DEBUG */ /* * Invoke the application-supplied callback and fail, if something is wrong. */ #define __ASN_E_cbc(buf, size) (cb((buf), (size), app_key) < 0) #define _ASN_E_CALLBACK(foo) do { \ if(foo) goto cb_failed; \ } while(0) #define _ASN_CALLBACK(buf, size) \ _ASN_E_CALLBACK(__ASN_E_cbc(buf, size)) #define _ASN_CALLBACK2(buf1, size1, buf2, size2) \ _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) || __ASN_E_cbc(buf2, size2)) #define _ASN_CALLBACK3(buf1, size1, buf2, size2, buf3, size3) \ _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) \ || __ASN_E_cbc(buf2, size2) \ || __ASN_E_cbc(buf3, size3)) #define _i_ASN_TEXT_INDENT(nl, level) do { \ int __level = (level); \ int __nl = ((nl) != 0); \ int __i; \ if(__nl) _ASN_CALLBACK("\n", 1); \ if(__level < 0) __level = 0; \ for(__i = 0; __i < __level; __i++) \ _ASN_CALLBACK(" ", 4); \ er.encoded += __nl + 4 * __level; \ } while(0) #define _i_INDENT(nl) do { \ int __i; \ if((nl) && cb("\n", 1, app_key) < 0) return -1; \ for(__i = 0; __i < ilevel; __i++) \ if(cb(" ", 4, app_key) < 0) return -1; \ } while(0) /* * Check stack against overflow, if limit is set. */ #define _ASN_DEFAULT_STACK_MAX (30000) static inline int _ASN_STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) { if(ctx && ctx->max_stack_size) { /* ctx MUST be allocated on the stack */ ptrdiff_t usedstack = ((char *)ctx - (char *)&ctx); if(usedstack > 0) usedstack = -usedstack; /* grows up! */ /* double negative required to avoid int wrap-around */ if(usedstack < -(ptrdiff_t)ctx->max_stack_size) { ASN_DEBUG("Stack limit %ld reached", (long)ctx->max_stack_size); return -1; } } return 0; } #ifdef __cplusplus } #endif #endif /* _ASN_INTERNAL_H_ */ asn1c-0.9.24+dfsg/skeletons/xer_support.c0000644000000000000000000001265511472004365017010 0ustar rootroot/* * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com. * Copyright (c) 2003, 2004, 2005 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* Parser states */ typedef enum { ST_TEXT, ST_TAG_START, ST_TAG_BODY, ST_TAG_QUOTE_WAIT, ST_TAG_QUOTED_STRING, ST_TAG_UNQUOTED_STRING, ST_COMMENT_WAIT_DASH1, /* ""[0] */ ST_COMMENT_CLO_RT /* "-->"[1] */ } pstate_e; static pxml_chunk_type_e final_chunk_type[] = { PXML_TEXT, PXML_TAG_END, PXML_COMMENT_END, PXML_TAG_END, PXML_COMMENT_END, }; static int _charclass[256] = { 0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 2,2,2,2,2,2,2,2, 2,2,0,0,0,0,0,0, /* 01234567 89 */ 0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, /* ABCDEFG HIJKLMNO */ 3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0, /* PQRSTUVW XYZ */ 0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, /* abcdefg hijklmno */ 3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0 /* pqrstuvw xyz */ }; #define WHITESPACE(c) (_charclass[(unsigned char)(c)] == 1) #define ALNUM(c) (_charclass[(unsigned char)(c)] >= 2) #define ALPHA(c) (_charclass[(unsigned char)(c)] == 3) /* Aliases for characters, ASCII/UTF-8 */ #define EXCLAM 0x21 /* '!' */ #define CQUOTE 0x22 /* '"' */ #define CDASH 0x2d /* '-' */ #define CSLASH 0x2f /* '/' */ #define LANGLE 0x3c /* '<' */ #define CEQUAL 0x3d /* '=' */ #define RANGLE 0x3e /* '>' */ #define CQUEST 0x3f /* '?' */ /* Invoke token callback */ #define TOKEN_CB_CALL(type, _ns, _current_too, _final) do { \ int _ret; \ pstate_e ns = _ns; \ ssize_t _sz = (p - chunk_start) + _current_too; \ if (!_sz) { \ /* Shortcut */ \ state = _ns; \ break; \ } \ _ret = cb(type, chunk_start, _sz, key); \ if(_ret < _sz) { \ if(_current_too && _ret == -1) \ state = ns; \ goto finish; \ } \ chunk_start = p + _current_too; \ state = ns; \ } while(0) #define TOKEN_CB(_type, _ns, _current_too) \ TOKEN_CB_CALL(_type, _ns, _current_too, 0) #define TOKEN_CB_FINAL(_type, _ns, _current_too) \ TOKEN_CB_CALL(final_chunk_type[_type], _ns, _current_too, 1) /* * Parser itself */ ssize_t pxml_parse(int *stateContext, const void *xmlbuf, size_t size, pxml_callback_f *cb, void *key) { pstate_e state = (pstate_e)*stateContext; const char *chunk_start = (const char *)xmlbuf; const char *p = chunk_start; const char *end = p + size; for(; p < end; p++) { int C = *(const unsigned char *)p; switch(state) { case ST_TEXT: /* * Initial state: we're in the middle of some text, * or just have started. */ if (C == LANGLE) /* We're now in the tag, probably */ TOKEN_CB(PXML_TEXT, ST_TAG_START, 0); break; case ST_TAG_START: if (ALPHA(C) || (C == CSLASH)) state = ST_TAG_BODY; else if (C == EXCLAM) state = ST_COMMENT_WAIT_DASH1; else /* * Not characters and not whitespace. * Must be something like "3 < 4". */ TOKEN_CB(PXML_TEXT, ST_TEXT, 1);/* Flush as data */ break; case ST_TAG_BODY: switch(C) { case RANGLE: /* End of the tag */ TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); break; case LANGLE: /* * The previous tag wasn't completed, but still * recognized as valid. (Mozilla-compatible) */ TOKEN_CB_FINAL(PXML_TAG, ST_TAG_START, 0); break; case CEQUAL: state = ST_TAG_QUOTE_WAIT; break; } break; case ST_TAG_QUOTE_WAIT: /* * State after the equal sign ("=") in the tag. */ switch(C) { case CQUOTE: state = ST_TAG_QUOTED_STRING; break; case RANGLE: /* End of the tag */ TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); break; default: if(!WHITESPACE(C)) /* Unquoted string value */ state = ST_TAG_UNQUOTED_STRING; } break; case ST_TAG_QUOTED_STRING: /* * Tag attribute's string value in quotes. */ if(C == CQUOTE) { /* Return back to the tag state */ state = ST_TAG_BODY; } break; case ST_TAG_UNQUOTED_STRING: if(C == RANGLE) { /* End of the tag */ TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); } else if(WHITESPACE(C)) { /* Return back to the tag state */ state = ST_TAG_BODY; } break; case ST_COMMENT_WAIT_DASH1: if(C == CDASH) { state = ST_COMMENT_WAIT_DASH2; } else { /* Some ordinary tag. */ state = ST_TAG_BODY; } break; case ST_COMMENT_WAIT_DASH2: if(C == CDASH) { /* Seen "<--" */ state = ST_COMMENT; } else { /* Some ordinary tag */ state = ST_TAG_BODY; } break; case ST_COMMENT: if(C == CDASH) { state = ST_COMMENT_CLO_DASH2; } break; case ST_COMMENT_CLO_DASH2: if(C == CDASH) { state = ST_COMMENT_CLO_RT; } else { /* This is not an end of a comment */ state = ST_COMMENT; } break; case ST_COMMENT_CLO_RT: if(C == RANGLE) { TOKEN_CB_FINAL(PXML_COMMENT, ST_TEXT, 1); } else if(C == CDASH) { /* Maintain current state, still waiting for '>' */ } else { state = ST_COMMENT; } break; } /* switch(*ptr) */ } /* for() */ /* * Flush the partially processed chunk, state permitting. */ if(p - chunk_start) { switch (state) { case ST_COMMENT: TOKEN_CB(PXML_COMMENT, state, 0); break; case ST_TEXT: TOKEN_CB(PXML_TEXT, state, 0); break; default: break; /* a no-op */ } } finish: *stateContext = (int)state; return chunk_start - (const char *)xmlbuf; } asn1c-0.9.24+dfsg/skeletons/xer_encoder.c0000644000000000000000000000300511472004365016700 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * The XER encoder of any type. May be invoked by the application. */ asn_enc_rval_t xer_encode(asn_TYPE_descriptor_t *td, void *sptr, enum xer_encoder_flags_e xer_flags, asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er, tmper; const char *mname; size_t mlen; int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2; if(!td || !sptr) goto cb_failed; mname = td->xml_tag; mlen = strlen(mname); _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); tmper = td->xer_encoder(td, sptr, 1, xer_flags, cb, app_key); if(tmper.encoded == -1) return tmper; _ASN_CALLBACK3("\n", xcan); er.encoded = 4 + xcan + (2 * mlen) + tmper.encoded; _ASN_ENCODED_OK(er); cb_failed: _ASN_ENCODE_FAILED; } /* * This is a helper function for xer_fprint, which directs all incoming data * into the provided file descriptor. */ static int xer__print2fp(const void *buffer, size_t size, void *app_key) { FILE *stream = (FILE *)app_key; if(fwrite(buffer, 1, size, stream) != size) return -1; return 0; } int xer_fprint(FILE *stream, asn_TYPE_descriptor_t *td, void *sptr) { asn_enc_rval_t er; if(!stream) stream = stdout; if(!td || !sptr) return -1; er = xer_encode(td, sptr, XER_F_BASIC, xer__print2fp, stream); if(er.encoded == -1) return -1; return fflush(stream); } asn1c-0.9.24+dfsg/skeletons/ber_tlv_tag.h0000644000000000000000000000345411472004365016710 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _BER_TLV_TAG_H_ #define _BER_TLV_TAG_H_ #ifdef __cplusplus extern "C" { #endif enum asn_tag_class { ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ }; typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ /* * Tag class is encoded together with tag value for optimization purposes. */ #define BER_TAG_CLASS(tag) ((tag) & 0x3) #define BER_TAG_VALUE(tag) ((tag) >> 2) #define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr)&0x20)?1:0) #define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) /* * Several functions for printing the TAG in the canonical form * (i.e. "[PRIVATE 0]"). * Return values correspond to their libc counterparts (if any). */ ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); char *ber_tlv_tag_string(ber_tlv_tag_t tag); /* * This function tries to fetch the tag from the input stream. * RETURN VALUES: * 0: More data expected than bufptr contains. * -1: Fatal error deciphering tag. * >0: Number of bytes used from bufptr. tag_r will contain the tag. */ ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); /* * This function serializes the tag (T from TLV) in BER format. * It always returns number of bytes necessary to represent the tag, * it is a caller's responsibility to check the return value * against the supplied buffer's size. */ size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); #ifdef __cplusplus } #endif #endif /* _BER_TLV_TAG_H_ */ asn1c-0.9.24+dfsg/skeletons/GeneralizedTime.h0000644000000000000000000000424111472004364017462 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _GeneralizedTime_H_ #define _GeneralizedTime_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t GeneralizedTime_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_GeneralizedTime; asn_struct_print_f GeneralizedTime_print; asn_constr_check_f GeneralizedTime_constraint; der_type_encoder_f GeneralizedTime_encode_der; xer_type_encoder_f GeneralizedTime_encode_xer; /*********************** * Some handy helpers. * ***********************/ struct tm; /* */ /* * Convert a GeneralizedTime structure into time_t * and optionally into struct tm. * If as_gmt is given, the resulting _optional_tm4fill will have a GMT zone, * instead of default local one. * On error returns -1 and errno set to EINVAL */ time_t asn_GT2time(const GeneralizedTime_t *, struct tm *_optional_tm4fill, int as_gmt); /* A version of the above function also returning the fractions of seconds */ time_t asn_GT2time_frac(const GeneralizedTime_t *, int *frac_value, int *frac_digits, /* (value / (10 ^ digits)) */ struct tm *_optional_tm4fill, int as_gmt); /* * Another version returning fractions with defined precision * For example, parsing of the time ending with ".1" seconds * with frac_digits=3 (msec) would yield frac_value = 100. */ time_t asn_GT2time_prec(const GeneralizedTime_t *, int *frac_value, int frac_digits, struct tm *_optional_tm4fill, int as_gmt); /* * Convert a struct tm into GeneralizedTime. * If _optional_gt is not given, this function will try to allocate one. * If force_gmt is given, the resulting GeneralizedTime will be forced * into a GMT time zone (encoding ends with a "Z"). * On error, this function returns 0 and sets errno. */ GeneralizedTime_t *asn_time2GT(GeneralizedTime_t *_optional_gt, const struct tm *, int force_gmt); GeneralizedTime_t *asn_time2GT_frac(GeneralizedTime_t *_optional_gt, const struct tm *, int frac_value, int frac_digits, int force_gmt); #ifdef __cplusplus } #endif #endif /* _GeneralizedTime_H_ */ asn1c-0.9.24+dfsg/skeletons/NULL.c0000644000000000000000000000656612021516134015165 0ustar rootroot/*- * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include #include /* Implemented in terms of BOOLEAN type */ /* * NULL basic type description. */ static ber_tlv_tag_t asn_DEF_NULL_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NULL = { "NULL", "NULL", BOOLEAN_free, NULL_print, asn_generic_no_constraint, BOOLEAN_decode_ber, /* Implemented in terms of BOOLEAN */ NULL_encode_der, /* Special handling of DER encoding */ NULL_decode_xer, NULL_encode_xer, NULL_decode_uper, /* Unaligned PER decoder */ NULL_encode_uper, /* Unaligned PER encoder */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NULL_tags, sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]), asn_DEF_NULL_tags, /* Same as above */ sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn_enc_rval_t NULL_encode_der(asn_TYPE_descriptor_t *td, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t erval; erval.encoded = der_write_tags(td, 0, tag_mode, 0, tag, cb, app_key); if(erval.encoded == -1) { erval.failed_type = td; erval.structure_ptr = ptr; } _ASN_ENCODED_OK(erval); } asn_enc_rval_t NULL_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; (void)td; (void)sptr; (void)ilevel; (void)flags; (void)cb; (void)app_key; /* XMLNullValue is empty */ er.encoded = 0; _ASN_ENCODED_OK(er); } static enum xer_pbd_rval NULL__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_buf, size_t chunk_size) { (void)td; (void)sptr; /* * There must be no content in self-terminating tag. */ if(chunk_size) return XPBD_BROKEN_ENCODING; else return XPBD_BODY_CONSUMED; } asn_dec_rval_t NULL_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { return xer_decode_primitive(opt_codec_ctx, td, sptr, sizeof(NULL_t), opt_mname, buf_ptr, size, NULL__xer_body_decode); } int NULL_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(sptr) { return (cb("", 9, app_key) < 0) ? -1 : 0; } else { return (cb("", 8, app_key) < 0) ? -1 : 0; } } asn_dec_rval_t NULL_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv; (void)opt_codec_ctx; (void)td; (void)constraints; (void)pd; if(!*sptr) { *sptr = MALLOC(sizeof(NULL_t)); if(*sptr) { *(NULL_t *)*sptr = 0; } else { _ASN_DECODE_FAILED; } } /* * NULL type does not have content octets. */ rv.code = RC_OK; rv.consumed = 0; return rv; } asn_enc_rval_t NULL_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er; (void)td; (void)constraints; (void)sptr; (void)po; er.encoded = 0; _ASN_ENCODED_OK(er); } asn1c-0.9.24+dfsg/skeletons/constraints.h0000644000000000000000000000365711472004365016774 0ustar rootroot/*- * Copyright (c) 2004, 2006 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _ASN1_CONSTRAINTS_VALIDATOR_H_ #define _ASN1_CONSTRAINTS_VALIDATOR_H_ #include /* Platform-dependent types */ #ifdef __cplusplus extern "C" { #endif struct asn_TYPE_descriptor_s; /* Forward declaration */ /* * Validate the structure according to the ASN.1 constraints. * If errbuf and errlen are given, they shall be pointing to the appropriate * buffer space and its length before calling this function. Alternatively, * they could be passed as NULL's. If constraints validation fails, * errlen will contain the actual number of bytes taken from the errbuf * to encode an error message (properly 0-terminated). * * RETURN VALUES: * This function returns 0 in case all ASN.1 constraints are met * and -1 if one or more constraints were failed. */ int asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, /* Target language's structure */ char *errbuf, /* Returned error description */ size_t *errlen /* Length of the error description */ ); /* * Generic type for constraint checking callback, * associated with every type descriptor. */ typedef int (asn_constr_check_f)( struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, asn_app_constraint_failed_f *optional_callback, /* Log the error */ void *optional_app_key /* Opaque key passed to a callback */ ); /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ /* * Invoke the callback with a complete error message. */ #define _ASN_CTFAIL if(ctfailcb) ctfailcb #ifdef __cplusplus } #endif #endif /* _ASN1_CONSTRAINTS_VALIDATOR_H_ */ asn1c-0.9.24+dfsg/skeletons/xer_encoder.h0000644000000000000000000000324111472004365016707 0ustar rootroot/*- * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _XER_ENCODER_H_ #define _XER_ENCODER_H_ #include #ifdef __cplusplus extern "C" { #endif struct asn_TYPE_descriptor_s; /* Forward declaration */ /* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ enum xer_encoder_flags_e { /* Mode of encoding */ XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ }; /* * The XER encoder of any type. May be invoked by the application. */ asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, void *struct_ptr, /* Structure to be encoded */ enum xer_encoder_flags_e xer_flags, asn_app_consume_bytes_f *consume_bytes_cb, void *app_key /* Arbitrary callback argument */ ); /* * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) * output into the chosen file pointer. * RETURN VALUES: * 0: The structure is printed. * -1: Problem printing the structure. * WARNING: No sensible errno value is returned. */ int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); /* * Type of the generic XER encoder. */ typedef asn_enc_rval_t (xer_type_encoder_f)( struct asn_TYPE_descriptor_s *type_descriptor, void *struct_ptr, /* Structure to be encoded */ int ilevel, /* Level of indentation */ enum xer_encoder_flags_e xer_flags, asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ void *app_key /* Arbitrary callback argument */ ); #ifdef __cplusplus } #endif #endif /* _XER_ENCODER_H_ */ asn1c-0.9.24+dfsg/skeletons/VisibleString.c0000644000000000000000000000427511502527550017201 0ustar rootroot/*- * Copyright (c) 2003, 2006 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * VisibleString basic type description. */ static ber_tlv_tag_t asn_DEF_VisibleString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; static asn_per_constraints_t asn_DEF_VisibleString_constraints = { { APC_CONSTRAINED, 7, 7, 0x20, 0x7e }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ 0, 0 }; asn_TYPE_descriptor_t asn_DEF_VisibleString = { "VisibleString", "VisibleString", OCTET_STRING_free, OCTET_STRING_print_utf8, /* ASCII subset */ VisibleString_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_utf8, OCTET_STRING_encode_xer_utf8, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_VisibleString_tags, sizeof(asn_DEF_VisibleString_tags) / sizeof(asn_DEF_VisibleString_tags[0]) - 1, asn_DEF_VisibleString_tags, sizeof(asn_DEF_VisibleString_tags) / sizeof(asn_DEF_VisibleString_tags[0]), &asn_DEF_VisibleString_constraints, 0, 0, /* No members */ 0 /* No specifics */ }; int VisibleString_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const VisibleString_t *st = (const VisibleString_t *)sptr; if(st && st->buf) { uint8_t *buf = st->buf; uint8_t *end = buf + st->size; /* * Check the alphabet of the VisibleString. * ISO646, ISOReg#6 * The alphabet is a subset of ASCII between the space * and "~" (tilde). */ for(; buf < end; buf++) { if(*buf < 0x20 || *buf > 0x7e) { _ASN_CTFAIL(app_key, td, sptr, "%s: value byte %ld (%d) " "not in VisibleString alphabet (%s:%d)", td->name, (long)((buf - st->buf) + 1), *buf, __FILE__, __LINE__); return -1; } } } else { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } return 0; } asn1c-0.9.24+dfsg/skeletons/per_support.h0000644000000000000000000000754111472004365017003 0ustar rootroot/* * Copyright (c) 2005, 2006, 2007 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _PER_SUPPORT_H_ #define _PER_SUPPORT_H_ #include /* Platform-specific types */ #ifdef __cplusplus extern "C" { #endif /* * Pre-computed PER constraints. */ typedef struct asn_per_constraint_s { enum asn_per_constraint_flags { APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */ APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */ APC_CONSTRAINED = 0x2, /* Fully constrained */ APC_EXTENSIBLE = 0x4 /* May have extension */ } flags; int range_bits; /* Full number of bits in the range */ int effective_bits; /* Effective bits */ long lower_bound; /* "lb" value */ long upper_bound; /* "ub" value */ } asn_per_constraint_t; typedef struct asn_per_constraints_s { asn_per_constraint_t value; asn_per_constraint_t size; int (*value2code)(unsigned int value); int (*code2value)(unsigned int code); } asn_per_constraints_t; /* * This structure describes a position inside an incoming PER bit stream. */ typedef struct asn_per_data_s { const uint8_t *buffer; /* Pointer to the octet stream */ size_t nboff; /* Bit offset to the meaningful bit */ size_t nbits; /* Number of bits in the stream */ size_t moved; /* Number of bits moved through this bit stream */ int (*refill)(struct asn_per_data_s *); void *refill_key; } asn_per_data_t; /* * Extract a small number of bits (<= 31) from the specified PER data pointer. * This function returns -1 if the specified number of bits could not be * extracted due to EOD or other conditions. */ int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits); /* Undo the immediately preceeding "get_few_bits" operation */ void per_get_undo(asn_per_data_t *per_data, int get_nbits); /* * Extract a large number of bits from the specified PER data pointer. * This function returns -1 if the specified number of bits could not be * extracted due to EOD or other conditions. */ int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align, int get_nbits); /* * Get the length "n" from the Unaligned PER stream. */ ssize_t uper_get_length(asn_per_data_t *pd, int effective_bound_bits, int *repeat); /* * Get the normally small length "n". */ ssize_t uper_get_nslength(asn_per_data_t *pd); /* * Get the normally small non-negative whole number. */ ssize_t uper_get_nsnnwn(asn_per_data_t *pd); /* Non-thread-safe debugging function, don't use it */ char *per_data_string(asn_per_data_t *pd); /* * This structure supports forming PER output. */ typedef struct asn_per_outp_s { uint8_t *buffer; /* Pointer into the (tmpspace) */ size_t nboff; /* Bit offset to the meaningful bit */ size_t nbits; /* Number of bits left in (tmpspace) */ uint8_t tmpspace[32]; /* Preliminary storage to hold data */ int (*outper)(const void *data, size_t size, void *op_key); void *op_key; /* Key for (outper) data callback */ size_t flushed_bytes; /* Bytes already flushed through (outper) */ } asn_per_outp_t; /* Output a small number of bits (<= 31) */ int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits); /* Output a large number of bits */ int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits); /* * Put the length "n" to the Unaligned PER stream. * This function returns the number of units which may be flushed * in the next units saving iteration. */ ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length); /* * Put the normally small length "n" to the Unaligned PER stream. * Returns 0 or -1. */ int uper_put_nslength(asn_per_outp_t *po, size_t length); /* * Put the normally small non-negative whole number. */ int uper_put_nsnnwn(asn_per_outp_t *po, int n); #ifdef __cplusplus } #endif #endif /* _PER_SUPPORT_H_ */ asn1c-0.9.24+dfsg/skeletons/IA5String.h0000644000000000000000000000102211472004364016151 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _IA5String_H_ #define _IA5String_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t IA5String_t; /* Implemented via OCTET STRING */ /* * IA5String ASN.1 type definition. */ extern asn_TYPE_descriptor_t asn_DEF_IA5String; asn_constr_check_f IA5String_constraint; #ifdef __cplusplus } #endif #endif /* _IA5String_H_ */ asn1c-0.9.24+dfsg/skeletons/T61String.h0000644000000000000000000000067411472004364016161 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _T61String_H_ #define _T61String_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t T61String_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_T61String; #ifdef __cplusplus } #endif #endif /* _T61String_H_ */ asn1c-0.9.24+dfsg/skeletons/ber_tlv_tag.c0000644000000000000000000000615611472004365016705 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include ssize_t ber_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) { ber_tlv_tag_t val; ber_tlv_tag_t tclass; size_t skipped; if(size == 0) return 0; val = *(const uint8_t *)ptr; tclass = (val >> 6); if((val &= 0x1F) != 0x1F) { /* * Simple form: everything encoded in a single octet. * Tag Class is encoded using two least significant bits. */ *tag_r = (val << 2) | tclass; return 1; } /* * Each octet contains 7 bits of useful information. * The MSB is 0 if it is the last octet of the tag. */ for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2; skipped <= size; ptr = ((const char *)ptr) + 1, skipped++) { unsigned int oct = *(const uint8_t *)ptr; if(oct & 0x80) { val = (val << 7) | (oct & 0x7F); /* * Make sure there are at least 9 bits spare * at the MS side of a value. */ if(val >> ((8 * sizeof(val)) - 9)) { /* * We would not be able to accomodate * any more tag bits. */ return -1; } } else { val = (val << 7) | oct; *tag_r = (val << 2) | tclass; return skipped; } } return 0; /* Want more */ } ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *f) { char buf[sizeof("[APPLICATION ]") + 32]; ssize_t ret; ret = ber_tlv_tag_snprint(tag, buf, sizeof(buf)); if(ret >= (ssize_t)sizeof(buf) || ret < 2) { errno = EPERM; return -1; } return fwrite(buf, 1, ret, f); } ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t size) { char *type = 0; int ret; switch(tag & 0x3) { case ASN_TAG_CLASS_UNIVERSAL: type = "UNIVERSAL "; break; case ASN_TAG_CLASS_APPLICATION: type = "APPLICATION "; break; case ASN_TAG_CLASS_CONTEXT: type = ""; break; case ASN_TAG_CLASS_PRIVATE: type = "PRIVATE "; break; } ret = snprintf(buf, size, "[%s%u]", type, ((unsigned)tag) >> 2); if(ret <= 0 && size) buf[0] = '\0'; /* against broken libc's */ return ret; } char * ber_tlv_tag_string(ber_tlv_tag_t tag) { static char buf[sizeof("[APPLICATION ]") + 32]; (void)ber_tlv_tag_snprint(tag, buf, sizeof(buf)); return buf; } size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufp, size_t size) { int tclass = BER_TAG_CLASS(tag); ber_tlv_tag_t tval = BER_TAG_VALUE(tag); uint8_t *buf = (uint8_t *)bufp; uint8_t *end; size_t required_size; size_t i; if(tval <= 30) { /* Encoded in 1 octet */ if(size) buf[0] = (tclass << 6) | tval; return 1; } else if(size) { *buf++ = (tclass << 6) | 0x1F; size--; } /* * Compute the size of the subsequent bytes. */ for(required_size = 1, i = 7; i < 8 * sizeof(tval); i += 7) { if(tval >> i) required_size++; else break; } if(size < required_size) return required_size + 1; /* * Fill in the buffer, space permitting. */ end = buf + required_size - 1; for(i -= 7; buf < end; i -= 7, buf++) *buf = 0x80 | ((tval >> i) & 0x7F); *buf = (tval & 0x7F); /* Last octet without high bit */ return required_size + 1; } asn1c-0.9.24+dfsg/skeletons/xer_support.h0000644000000000000000000000342411472004365017007 0ustar rootroot/* * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com. * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _XER_SUPPORT_H_ #define _XER_SUPPORT_H_ #include /* Platform-specific types */ #ifdef __cplusplus extern "C" { #endif /* * Types of data transferred to the application. */ typedef enum { PXML_TEXT, /* Plain text between XML tags. */ PXML_TAG, /* A tag, starting with '<'. */ PXML_COMMENT, /* An XML comment, including "". */ /* * The following chunk types are reported if the chunk * terminates the specified XML element. */ PXML_TAG_END, /* Tag ended */ PXML_COMMENT_END /* Comment ended */ } pxml_chunk_type_e; /* * Callback function that is called by the parser when parsed data is * available. The _opaque is the pointer to a field containing opaque user * data specified in pxml_create() call. The chunk type is _type and the text * data is the piece of buffer identified by _bufid (as supplied to * pxml_feed() call) starting at offset _offset and of _size bytes size. * The chunk is NOT '\0'-terminated. */ typedef int (pxml_callback_f)(pxml_chunk_type_e _type, const void *_chunk_data, size_t _chunk_size, void *_key); /* * Parse the given buffer as it were a chunk of XML data. * Invoke the specified callback each time the meaninful data is found. * This function returns number of bytes consumed from the bufer. * It will always be lesser than or equal to the specified _size. * The next invocation of this function must account the difference. */ ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, pxml_callback_f *cb, void *_key); #ifdef __cplusplus } #endif #endif /* _XER_SUPPORT_H_ */ asn1c-0.9.24+dfsg/skeletons/TeletexString.h0000644000000000000000000000072011472004364017211 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _TeletexString_H_ #define _TeletexString_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t TeletexString_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_TeletexString; #ifdef __cplusplus } #endif #endif /* _TeletexString_H_ */ asn1c-0.9.24+dfsg/skeletons/per_encoder.h0000644000000000000000000000417711472004365016710 0ustar rootroot/*- * Copyright (c) 2006, 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _PER_ENCODER_H_ #define _PER_ENCODER_H_ #include #include #ifdef __cplusplus extern "C" { #endif struct asn_TYPE_descriptor_s; /* Forward declaration */ /* * Unaligned PER encoder of any ASN.1 type. May be invoked by the application. * WARNING: This function returns the number of encoded bits in the .encoded * field of the return value. Use the following formula to convert to bytes: * bytes = ((.encoded + 7) / 8) */ asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, void *struct_ptr, /* Structure to be encoded */ asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ void *app_key /* Arbitrary callback argument */ ); /* * A variant of uper_encode() which encodes data into the existing buffer * WARNING: This function returns the number of encoded bits in the .encoded * field of the return value. */ asn_enc_rval_t uper_encode_to_buffer( struct asn_TYPE_descriptor_s *type_descriptor, void *struct_ptr, /* Structure to be encoded */ void *buffer, /* Pre-allocated buffer */ size_t buffer_size /* Initial buffer size (max) */ ); /* * A variant of uper_encode_to_buffer() which allocates buffer itself. * Returns the number of bytes in the buffer or -1 in case of failure. * WARNING: This function produces a "Production of the complete encoding", * with length of at least one octet. Contrast this to precise bit-packing * encoding of uper_encode() and uper_encode_to_buffer(). */ ssize_t uper_encode_to_new_buffer( struct asn_TYPE_descriptor_s *type_descriptor, asn_per_constraints_t *constraints, void *struct_ptr, /* Structure to be encoded */ void **buffer_r /* Buffer allocated and returned */ ); /* * Type of the generic PER encoder function. */ typedef asn_enc_rval_t (per_type_encoder_f)( struct asn_TYPE_descriptor_s *type_descriptor, asn_per_constraints_t *constraints, void *struct_ptr, asn_per_outp_t *per_output ); #ifdef __cplusplus } #endif #endif /* _PER_ENCODER_H_ */ asn1c-0.9.24+dfsg/skeletons/BMPString.h0000644000000000000000000000112611472004364016216 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _BMPString_H_ #define _BMPString_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t BMPString_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_BMPString; asn_struct_print_f BMPString_print; /* Human-readable output */ xer_type_decoder_f BMPString_decode_xer; xer_type_encoder_f BMPString_encode_xer; #ifdef __cplusplus } #endif #endif /* _BMPString_H_ */ asn1c-0.9.24+dfsg/skeletons/constr_SET.h0000644000000000000000000000441311501114213016422 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _CONSTR_SET_H_ #define _CONSTR_SET_H_ #include #ifdef __cplusplus extern "C" { #endif typedef struct asn_SET_specifics_s { /* * Target structure description. */ int struct_size; /* Size of the target structure. */ int ctx_offset; /* Offset of the asn_struct_ctx_t member */ int pres_offset; /* Offset of _presence_map member */ /* * Tags to members mapping table (sorted). * Sometimes suitable for DER encoding (untagged CHOICE is present); * if so, tag2el_count will be greater than td->elements_count. */ asn_TYPE_tag2member_t *tag2el; int tag2el_count; /* * Tags to members mapping table, second edition. * Suitable for CANONICAL-XER encoding. */ asn_TYPE_tag2member_t *tag2el_cxer; int tag2el_cxer_count; /* * Extensions-related stuff. */ int extensible; /* Whether SET is extensible */ unsigned int *_mandatory_elements; /* Bitmask of mandatory ones */ } asn_SET_specifics_t; /* * A set specialized functions dealing with the SET type. */ asn_struct_free_f SET_free; asn_struct_print_f SET_print; asn_constr_check_f SET_constraint; ber_type_decoder_f SET_decode_ber; der_type_encoder_f SET_encode_der; xer_type_decoder_f SET_decode_xer; xer_type_encoder_f SET_encode_xer; per_type_decoder_f SET_decode_uper; per_type_encoder_f SET_encode_uper; /*********************** * Some handy helpers. * ***********************/ /* * Figure out whether the SET member indicated by PR_x has already been decoded. * It is very simple bitfield test, despite its visual complexity. */ #define ASN_SET_ISPRESENT(set_ptr, PR_x) \ ASN_SET_ISPRESENT2(&((set_ptr)->_presence_map), PR_x) #define ASN_SET_ISPRESENT2(map_ptr, PR_x) \ (((unsigned int *)(map_ptr)) \ [(PR_x) / (8 * sizeof(unsigned int))] \ & (1 << ((8 * sizeof(unsigned int)) - 1 \ - ((PR_x) % (8 * sizeof(unsigned int)))))) #define ASN_SET_MKPRESENT(map_ptr, PR_x) \ (((unsigned int *)(map_ptr)) \ [(PR_x) / (8 * sizeof(unsigned int))] \ |= (1 << ((8 * sizeof(unsigned int)) - 1 \ - ((PR_x) % (8 * sizeof(unsigned int)))))) #ifdef __cplusplus } #endif #endif /* _CONSTR_SET_H_ */ asn1c-0.9.24+dfsg/skeletons/ANY.h0000644000000000000000000000255611472004364015050 0ustar rootroot/*- * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef ASN_TYPE_ANY_H #define ASN_TYPE_ANY_H #include /* Implemented via OCTET STRING type */ #ifdef __cplusplus extern "C" { #endif typedef struct ANY { uint8_t *buf; /* BER-encoded ANY contents */ int size; /* Size of the above buffer */ asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ } ANY_t; extern asn_TYPE_descriptor_t asn_DEF_ANY; asn_struct_free_f ANY_free; asn_struct_print_f ANY_print; ber_type_decoder_f ANY_decode_ber; der_type_encoder_f ANY_encode_der; xer_type_encoder_f ANY_encode_xer; /****************************** * Handy conversion routines. * ******************************/ /* Convert another ASN.1 type into the ANY. This implies DER encoding. */ int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr); ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr); /* Convert the contents of the ANY type into the specified type. */ int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr); #define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size)) #define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \ &asn_DEF_ANY, (buf), (size)) #ifdef __cplusplus } #endif #endif /* ASN_TYPE_ANY_H */ asn1c-0.9.24+dfsg/skeletons/INTEGER.h0000644000000000000000000000561312121065272015510 0ustar rootroot/*- * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _INTEGER_H_ #define _INTEGER_H_ #include #include #ifdef __cplusplus extern "C" { #endif typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; extern asn_TYPE_descriptor_t asn_DEF_INTEGER; /* Map with to integer value association */ typedef struct asn_INTEGER_enum_map_s { long nat_value; /* associated native integer value */ size_t enum_len; /* strlen("tag") */ const char *enum_name; /* "tag" */ } asn_INTEGER_enum_map_t; /* This type describes an enumeration for INTEGER and ENUMERATED types */ typedef struct asn_INTEGER_specifics_s { asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ unsigned int *enum2value; /* "tag" => N; sorted by tag */ int map_count; /* Elements in either map */ int extension; /* This map is extensible */ int strict_enumeration; /* Enumeration set is fixed */ int field_width; /* Size of native integer */ int field_unsigned; /* Signed=0, unsigned=1 */ } asn_INTEGER_specifics_t; asn_struct_print_f INTEGER_print; ber_type_decoder_f INTEGER_decode_ber; der_type_encoder_f INTEGER_encode_der; xer_type_decoder_f INTEGER_decode_xer; xer_type_encoder_f INTEGER_encode_xer; per_type_decoder_f INTEGER_decode_uper; per_type_encoder_f INTEGER_encode_uper; /*********************************** * Some handy conversion routines. * ***********************************/ /* * Returns 0 if it was possible to convert, -1 otherwise. * -1/EINVAL: Mandatory argument missing * -1/ERANGE: Value encoded is out of range for long representation * -1/ENOMEM: Memory allocation failed (in asn_long2INTEGER()). */ int asn_INTEGER2long(const INTEGER_t *i, long *l); int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); int asn_long2INTEGER(INTEGER_t *i, long l); int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); /* A a reified version of strtol(3) with nicer error reporting. */ enum asn_strtol_result_e { ASN_STRTOL_ERROR_RANGE = -3, /* Input outside of numeric range for long type */ ASN_STRTOL_ERROR_INVAL = -2, /* Invalid data encountered (e.g., "+-") */ ASN_STRTOL_EXPECT_MORE = -1, /* More data expected (e.g. "+") */ ASN_STRTOL_OK = 0, /* Conversion succeded, number ends at (*end) */ ASN_STRTOL_EXTRA_DATA = 1, /* Conversion succeded, but the string has extra stuff */ }; enum asn_strtol_result_e asn_strtol_lim(const char *str, const char **end, long *l); /* The asn_strtol is going to be DEPRECATED soon */ enum asn_strtol_result_e asn_strtol(const char *str, const char *end, long *l); /* * Convert the integer value into the corresponding enumeration map entry. */ const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(asn_INTEGER_specifics_t *specs, long value); #ifdef __cplusplus } #endif #endif /* _INTEGER_H_ */ asn1c-0.9.24+dfsg/skeletons/ObjectDescriptor.c0000644000000000000000000000235211502527550017654 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * ObjectDescriptor basic type description. */ static ber_tlv_tag_t asn_DEF_ObjectDescriptor_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (7 << 2)), /* [UNIVERSAL 7] IMPLICIT ... */ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; asn_TYPE_descriptor_t asn_DEF_ObjectDescriptor = { "ObjectDescriptor", "ObjectDescriptor", OCTET_STRING_free, OCTET_STRING_print_utf8, /* Treat as ASCII subset (it's not) */ asn_generic_unknown_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_utf8, OCTET_STRING_encode_xer_utf8, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_ObjectDescriptor_tags, sizeof(asn_DEF_ObjectDescriptor_tags) / sizeof(asn_DEF_ObjectDescriptor_tags[0]) - 1, asn_DEF_ObjectDescriptor_tags, sizeof(asn_DEF_ObjectDescriptor_tags) / sizeof(asn_DEF_ObjectDescriptor_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/skeletons/PrintableString.c0000644000000000000000000000664311502527550017525 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2006 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * ASN.1:1984 (X.409) */ static int _PrintableString_alphabet[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9, /* . '() +,-./ */ 10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22, /* 0123456789: = ? */ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37, /* ABCDEFGHIJKLMNO */ 38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, /* abcdefghijklmno */ 64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ }; static int _PrintableString_code2value[74] = { 32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54, 55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74, 75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90, 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112, 113,114,115,116,117,118,119,120,121,122}; /* * PrintableString basic type description. */ static ber_tlv_tag_t asn_DEF_PrintableString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (19 << 2)), /* [UNIVERSAL 19] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; static int asn_DEF_PrintableString_v2c(unsigned int value) { return _PrintableString_alphabet[value > 255 ? 0 : value] - 1; } static int asn_DEF_PrintableString_c2v(unsigned int code) { if(code < 74) return _PrintableString_code2value[code]; return -1; } static asn_per_constraints_t asn_DEF_PrintableString_constraints = { { APC_CONSTRAINED, 4, 4, 0x20, 0x39 }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ asn_DEF_PrintableString_v2c, asn_DEF_PrintableString_c2v }; asn_TYPE_descriptor_t asn_DEF_PrintableString = { "PrintableString", "PrintableString", OCTET_STRING_free, OCTET_STRING_print_utf8, /* ASCII subset */ PrintableString_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_utf8, OCTET_STRING_encode_xer_utf8, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_PrintableString_tags, sizeof(asn_DEF_PrintableString_tags) / sizeof(asn_DEF_PrintableString_tags[0]) - 1, asn_DEF_PrintableString_tags, sizeof(asn_DEF_PrintableString_tags) / sizeof(asn_DEF_PrintableString_tags[0]), &asn_DEF_PrintableString_constraints, 0, 0, /* No members */ 0 /* No specifics */ }; int PrintableString_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const PrintableString_t *st = (const PrintableString_t *)sptr; if(st && st->buf) { uint8_t *buf = st->buf; uint8_t *end = buf + st->size; /* * Check the alphabet of the PrintableString. * ASN.1:1984 (X.409) */ for(; buf < end; buf++) { if(!_PrintableString_alphabet[*buf]) { _ASN_CTFAIL(app_key, td, sptr, "%s: value byte %ld (%d) " "not in PrintableString alphabet " "(%s:%d)", td->name, (long)((buf - st->buf) + 1), *buf, __FILE__, __LINE__); return -1; } } } else { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } return 0; } asn1c-0.9.24+dfsg/skeletons/UTCTime.c0000644000000000000000000001066111502527550015663 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include #include #ifdef __CYGWIN__ #include "/usr/include/time.h" #else #include #endif /* __CYGWIN__ */ #ifndef __ASN_INTERNAL_TEST_MODE__ /* * UTCTime basic type description. */ static ber_tlv_tag_t asn_DEF_UTCTime_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (23 << 2)), /* [UNIVERSAL 23] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; static asn_per_constraints_t asn_DEF_UTCTime_constraints = { { APC_CONSTRAINED, 7, 7, 0x20, 0x7e }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ 0, 0 }; asn_TYPE_descriptor_t asn_DEF_UTCTime = { "UTCTime", "UTCTime", OCTET_STRING_free, UTCTime_print, UTCTime_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, /* Implemented in terms of OCTET STRING */ OCTET_STRING_decode_xer_utf8, UTCTime_encode_xer, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_UTCTime_tags, sizeof(asn_DEF_UTCTime_tags) / sizeof(asn_DEF_UTCTime_tags[0]) - 2, asn_DEF_UTCTime_tags, sizeof(asn_DEF_UTCTime_tags) / sizeof(asn_DEF_UTCTime_tags[0]), &asn_DEF_UTCTime_constraints, 0, 0, /* No members */ 0 /* No specifics */ }; #endif /* __ASN_INTERNAL_TEST_MODE__ */ /* * Check that the time looks like the time. */ int UTCTime_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTCTime_t *st = (const UTCTime_t *)sptr; time_t tloc; errno = EPERM; /* Just an unlikely error code */ tloc = asn_UT2time(st, 0, 0); if(tloc == -1 && errno != EPERM) { _ASN_CTFAIL(app_key, td, sptr, "%s: Invalid time format: %s (%s:%d)", td->name, strerror(errno), __FILE__, __LINE__); return -1; } return 0; } #ifndef __ASN_INTERNAL_TEST_MODE__ asn_enc_rval_t UTCTime_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { if(flags & XER_F_CANONICAL) { asn_enc_rval_t rv; UTCTime_t *ut; struct tm tm; errno = EPERM; if(asn_UT2time((UTCTime_t *)sptr, &tm, 1) == -1 && errno != EPERM) _ASN_ENCODE_FAILED; /* Fractions are not allowed in UTCTime */ ut = asn_time2GT(0, 0, 1); if(!ut) _ASN_ENCODE_FAILED; rv = OCTET_STRING_encode_xer_utf8(td, sptr, ilevel, flags, cb, app_key); OCTET_STRING_free(&asn_DEF_UTCTime, ut, 0); return rv; } else { return OCTET_STRING_encode_xer_utf8(td, sptr, ilevel, flags, cb, app_key); } } #endif /* __ASN_INTERNAL_TEST_MODE__ */ int UTCTime_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const UTCTime_t *st = (const UTCTime_t *)sptr; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(st && st->buf) { char buf[32]; struct tm tm; int ret; errno = EPERM; if(asn_UT2time(st, &tm, 1) == -1 && errno != EPERM) return (cb("", 11, app_key) < 0) ? -1 : 0; ret = snprintf(buf, sizeof(buf), "%04d-%02d-%02d %02d:%02d:%02d (GMT)", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); assert(ret > 0 && ret < (int)sizeof(buf)); return (cb(buf, ret, app_key) < 0) ? -1 : 0; } else { return (cb("", 8, app_key) < 0) ? -1 : 0; } } time_t asn_UT2time(const UTCTime_t *st, struct tm *_tm, int as_gmt) { char buf[24]; /* "AAMMJJhhmmss+hhmm" + cushion */ GeneralizedTime_t gt; if(!st || !st->buf || st->size < 11 || st->size >= ((int)sizeof(buf) - 2)) { errno = EINVAL; return -1; } gt.buf = (unsigned char *)buf; gt.size = st->size + 2; memcpy(gt.buf + 2, st->buf, st->size); if(st->buf[0] > 0x35) { /* 19xx */ gt.buf[0] = 0x31; gt.buf[1] = 0x39; } else { /* 20xx */ gt.buf[0] = 0x32; gt.buf[1] = 0x30; } return asn_GT2time(>, _tm, as_gmt); } UTCTime_t * asn_time2UT(UTCTime_t *opt_ut, const struct tm *tm, int force_gmt) { GeneralizedTime_t *gt = (GeneralizedTime_t *)opt_ut; gt = asn_time2GT(gt, tm, force_gmt); if(gt == 0) return 0; assert(gt->size >= 2); gt->size -= 2; memmove(gt->buf, gt->buf + 2, gt->size + 1); return (UTCTime_t *)gt; } asn1c-0.9.24+dfsg/skeletons/asn_application.h0000644000000000000000000000271611472004364017563 0ustar rootroot/*- * Copyright (c) 2004, 2006 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * Application-level ASN.1 callbacks. */ #ifndef _ASN_APPLICATION_H_ #define _ASN_APPLICATION_H_ #include "asn_system.h" /* for platform-dependent types */ #include "asn_codecs.h" /* for ASN.1 codecs specifics */ #ifdef __cplusplus extern "C" { #endif /* * Generic type of an application-defined callback to return various * types of data to the application. * EXPECTED RETURN VALUES: * -1: Failed to consume bytes. Abort the mission. * Non-negative return values indicate success, and ignored. */ typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size, void *application_specific_key); /* * A callback of this type is called whenever constraint validation fails * on some ASN.1 type. See "constraints.h" for more details on constraint * validation. * This callback specifies a descriptor of the ASN.1 type which failed * the constraint check, as well as human readable message on what * particular constraint has failed. */ typedef void (asn_app_constraint_failed_f)(void *application_specific_key, struct asn_TYPE_descriptor_s *type_descriptor_which_failed, const void *structure_which_failed_ptr, const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5); #ifdef __cplusplus } #endif #include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */ #endif /* _ASN_APPLICATION_H_ */ asn1c-0.9.24+dfsg/skeletons/constr_CHOICE.c0000644000000000000000000006764611502527550016752 0ustar rootroot/* * Copyright (c) 2003, 2004, 2005, 2006, 2007 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * Number of bytes left for this structure. * (ctx->left) indicates the number of bytes _transferred_ for the structure. * (size) contains the number of bytes in the buffer passed. */ #define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) /* * If the subprocessor function returns with an indication that it wants * more data, it may well be a fatal decoding problem, because the * size is constrained by the 's L, even if the buffer size allows * reading more data. * For example, consider the buffer containing the following TLVs: * ... * The TLV length clearly indicates that one byte is expected in V, but * if the V processor returns with "want more data" even if the buffer * contains way more data than the V processor have seen. */ #define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) /* * This macro "eats" the part of the buffer which is definitely "consumed", * i.e. was correctly converted into local representation or rightfully skipped. */ #undef ADVANCE #define ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ ptr = ((const char *)ptr) + num;\ size -= num; \ if(ctx->left >= 0) \ ctx->left -= num; \ consumed_myself += num; \ } while(0) /* * Switch to the next phase of parsing. */ #undef NEXT_PHASE #define NEXT_PHASE(ctx) do { \ ctx->phase++; \ ctx->step = 0; \ } while(0) /* * Return a standardized complex structure. */ #undef RETURN #define RETURN(_code) do { \ rval.code = _code; \ rval.consumed = consumed_myself;\ return rval; \ } while(0) /* * See the definitions. */ static int _fetch_present_idx(const void *struct_ptr, int off, int size); static void _set_present_idx(void *sptr, int offset, int size, int pres); /* * Tags are canonically sorted in the tag to member table. */ static int _search4tag(const void *ap, const void *bp) { const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap; const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp; int a_class = BER_TAG_CLASS(a->el_tag); int b_class = BER_TAG_CLASS(b->el_tag); if(a_class == b_class) { ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag); ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag); if(a_value == b_value) return 0; else if(a_value < b_value) return -1; else return 1; } else if(a_class < b_class) { return -1; } else { return 1; } } /* * The decoder of the CHOICE type. */ asn_dec_rval_t CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **struct_ptr, const void *ptr, size_t size, int tag_mode) { /* * Bring closer parts of structure description. */ asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; asn_TYPE_member_t *elements = td->elements; /* * Parts of the structure being constructed. */ void *st = *struct_ptr; /* Target structure. */ asn_struct_ctx_t *ctx; /* Decoder context */ ber_tlv_tag_t tlv_tag; /* T from TLV */ ssize_t tag_len; /* Length of TLV's T */ asn_dec_rval_t rval; /* Return code from subparsers */ ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ ASN_DEBUG("Decoding %s as CHOICE", td->name); /* * Create the target structure if it is not present already. */ if(st == 0) { st = *struct_ptr = CALLOC(1, specs->struct_size); if(st == 0) { RETURN(RC_FAIL); } } /* * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); /* * Start to parse where left previously */ switch(ctx->phase) { case 0: /* * PHASE 0. * Check that the set of tags associated with given structure * perfectly fits our expectations. */ if(tag_mode || td->tags_count) { rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, tag_mode, -1, &ctx->left, 0); if(rval.code != RC_OK) { ASN_DEBUG("%s tagging check failed: %d", td->name, rval.code); return rval; } if(ctx->left >= 0) { /* ?Substracted below! */ ctx->left += rval.consumed; } ADVANCE(rval.consumed); } else { ctx->left = -1; } NEXT_PHASE(ctx); ASN_DEBUG("Structure consumes %ld bytes, buffer %ld", (long)ctx->left, (long)size); /* Fall through */ case 1: /* * Fetch the T from TLV. */ tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); ASN_DEBUG("In %s CHOICE tag length %d", td->name, (int)tag_len); switch(tag_len) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } do { asn_TYPE_tag2member_t *t2m; asn_TYPE_tag2member_t key; key.el_tag = tlv_tag; t2m = (asn_TYPE_tag2member_t *)bsearch(&key, specs->tag2el, specs->tag2el_count, sizeof(specs->tag2el[0]), _search4tag); if(t2m) { /* * Found the element corresponding to the tag. */ NEXT_PHASE(ctx); ctx->step = t2m->el_no; break; } else if(specs->ext_start == -1) { ASN_DEBUG("Unexpected tag %s " "in non-extensible CHOICE %s", ber_tlv_tag_string(tlv_tag), td->name); RETURN(RC_FAIL); } else { /* Skip this tag */ ssize_t skip; ASN_DEBUG("Skipping unknown tag %s", ber_tlv_tag_string(tlv_tag)); skip = ber_skip_length(opt_codec_ctx, BER_TLV_CONSTRUCTED(ptr), (const char *)ptr + tag_len, LEFT - tag_len); switch(skip) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } ADVANCE(skip + tag_len); RETURN(RC_OK); } } while(0); case 2: /* * PHASE 2. * Read in the element. */ do { asn_TYPE_member_t *elm;/* CHOICE's element */ void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ elm = &elements[ctx->step]; /* * Compute the position of the member inside a structure, * and also a type of containment (it may be contained * as pointer or using inline inclusion). */ if(elm->flags & ATF_POINTER) { /* Member is a pointer to another structure */ memb_ptr2 = (void **)((char *)st + elm->memb_offset); } else { /* * A pointer to a pointer * holding the start of the structure */ memb_ptr = (char *)st + elm->memb_offset; memb_ptr2 = &memb_ptr; } /* Set presence to be able to free it properly at any time */ _set_present_idx(st, specs->pres_offset, specs->pres_size, ctx->step + 1); /* * Invoke the member fetch routine according to member's type */ rval = elm->type->ber_decoder(opt_codec_ctx, elm->type, memb_ptr2, ptr, LEFT, elm->tag_mode); switch(rval.code) { case RC_OK: break; case RC_WMORE: /* More data expected */ if(!SIZE_VIOLATION) { ADVANCE(rval.consumed); RETURN(RC_WMORE); } RETURN(RC_FAIL); case RC_FAIL: /* Fatal error */ RETURN(rval.code); } /* switch(rval) */ ADVANCE(rval.consumed); } while(0); NEXT_PHASE(ctx); /* Fall through */ case 3: ASN_DEBUG("CHOICE %s Leftover: %ld, size = %ld, tm=%d, tc=%d", td->name, (long)ctx->left, (long)size, tag_mode, td->tags_count); if(ctx->left > 0) { /* * The type must be fully decoded * by the CHOICE member-specific decoder. */ RETURN(RC_FAIL); } if(ctx->left == -1 && !(tag_mode || td->tags_count)) { /* * This is an untagged CHOICE. * It doesn't contain nothing * except for the member itself, including all its tags. * The decoding is completed. */ NEXT_PHASE(ctx); break; } /* * Read in the "end of data chunks"'s. */ while(ctx->left < 0) { ssize_t tl; tl = ber_fetch_tag(ptr, LEFT, &tlv_tag); switch(tl) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } /* * Expected <0><0>... */ if(((const uint8_t *)ptr)[0] == 0) { if(LEFT < 2) { if(SIZE_VIOLATION) RETURN(RC_FAIL); else RETURN(RC_WMORE); } else if(((const uint8_t *)ptr)[1] == 0) { /* * Correctly finished with <0><0>. */ ADVANCE(2); ctx->left++; continue; } } else { ASN_DEBUG("Unexpected continuation in %s", td->name); RETURN(RC_FAIL); } /* UNREACHABLE */ } NEXT_PHASE(ctx); case 4: /* No meaningful work here */ break; } RETURN(RC_OK); } asn_enc_rval_t CHOICE_encode_der(asn_TYPE_descriptor_t *td, void *sptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; asn_TYPE_member_t *elm; /* CHOICE element */ asn_enc_rval_t erval; void *memb_ptr; size_t computed_size = 0; int present; if(!sptr) _ASN_ENCODE_FAILED; ASN_DEBUG("%s %s as CHOICE", cb?"Encoding":"Estimating", td->name); present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size); /* * If the structure was not initialized, it cannot be encoded: * can't deduce what to encode in the choice type. */ if(present <= 0 || present > td->elements_count) { if(present == 0 && td->elements_count == 0) { /* The CHOICE is empty?! */ erval.encoded = 0; _ASN_ENCODED_OK(erval); } _ASN_ENCODE_FAILED; } /* * Seek over the present member of the structure. */ elm = &td->elements[present-1]; if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)sptr + elm->memb_offset); if(memb_ptr == 0) { if(elm->optional) { erval.encoded = 0; _ASN_ENCODED_OK(erval); } /* Mandatory element absent */ _ASN_ENCODE_FAILED; } } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); } /* * If the CHOICE itself is tagged EXPLICIT: * T ::= [2] EXPLICIT CHOICE { ... } * Then emit the appropriate tags. */ if(tag_mode == 1 || td->tags_count) { /* * For this, we need to pre-compute the member. */ ssize_t ret; /* Encode member with its tag */ erval = elm->type->der_encoder(elm->type, memb_ptr, elm->tag_mode, elm->tag, 0, 0); if(erval.encoded == -1) return erval; /* Encode CHOICE with parent or my own tag */ ret = der_write_tags(td, erval.encoded, tag_mode, 1, tag, cb, app_key); if(ret == -1) _ASN_ENCODE_FAILED; computed_size += ret; } /* * Encode the single underlying member. */ erval = elm->type->der_encoder(elm->type, memb_ptr, elm->tag_mode, elm->tag, cb, app_key); if(erval.encoded == -1) return erval; ASN_DEBUG("Encoded CHOICE member in %ld bytes (+%ld)", (long)erval.encoded, (long)computed_size); erval.encoded += computed_size; return erval; } ber_tlv_tag_t CHOICE_outmost_tag(asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber_tlv_tag_t tag) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; int present; assert(tag_mode == 0); (void)tag_mode; assert(tag == 0); (void)tag; /* * Figure out which CHOICE element is encoded. */ present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size); if(present > 0 || present <= td->elements_count) { asn_TYPE_member_t *elm = &td->elements[present-1]; const void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(const void * const *) ((const char *)ptr + elm->memb_offset); } else { memb_ptr = (const void *) ((const char *)ptr + elm->memb_offset); } return asn_TYPE_outmost_tag(elm->type, memb_ptr, elm->tag_mode, elm->tag); } else { return (ber_tlv_tag_t)-1; } } int CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; int present; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } /* * Figure out which CHOICE element is encoded. */ present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size); if(present > 0 && present <= td->elements_count) { asn_TYPE_member_t *elm = &td->elements[present-1]; const void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); if(!memb_ptr) { if(elm->optional) return 0; _ASN_CTFAIL(app_key, td, sptr, "%s: mandatory CHOICE element %s absent (%s:%d)", td->name, elm->name, __FILE__, __LINE__); return -1; } } else { memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); } if(elm->memb_constraints) { return elm->memb_constraints(elm->type, memb_ptr, ctfailcb, app_key); } else { int ret = elm->type->check_constraints(elm->type, memb_ptr, ctfailcb, app_key); /* * Cannot inherit it eralier: * need to make sure we get the updated version. */ elm->memb_constraints = elm->type->check_constraints; return ret; } } else { _ASN_CTFAIL(app_key, td, sptr, "%s: no CHOICE element given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } #undef XER_ADVANCE #define XER_ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ buf_ptr = ((const char *)buf_ptr) + num;\ size -= num; \ consumed_myself += num; \ } while(0) /* * Decode the XER (XML) data. */ asn_dec_rval_t CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **struct_ptr, const char *opt_mname, const void *buf_ptr, size_t size) { /* * Bring closer parts of structure description. */ asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; /* * Parts of the structure being constructed. */ void *st = *struct_ptr; /* Target structure. */ asn_struct_ctx_t *ctx; /* Decoder context */ asn_dec_rval_t rval; /* Return value of a decoder */ ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ int edx; /* Element index */ /* * Create the target structure if it is not present already. */ if(st == 0) { st = *struct_ptr = CALLOC(1, specs->struct_size); if(st == 0) RETURN(RC_FAIL); } /* * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); if(ctx->phase == 0 && !*xml_tag) ctx->phase = 1; /* Skip the outer tag checking phase */ /* * Phases of XER/XML processing: * Phase 0: Check that the opening tag matches our expectations. * Phase 1: Processing body and reacting on closing tag. * Phase 2: Processing inner type. * Phase 3: Only waiting for closing tag. * Phase 4: Skipping unknown extensions. * Phase 5: PHASED OUT */ for(edx = ctx->step; ctx->phase <= 4;) { pxer_chunk_type_e ch_type; /* XER chunk type */ ssize_t ch_size; /* Chunk size */ xer_check_tag_e tcv; /* Tag check value */ asn_TYPE_member_t *elm; /* * Go inside the member. */ if(ctx->phase == 2) { asn_dec_rval_t tmprval; void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ elm = &td->elements[edx]; if(elm->flags & ATF_POINTER) { /* Member is a pointer to another structure */ memb_ptr2 = (void **)((char *)st + elm->memb_offset); } else { memb_ptr = (char *)st + elm->memb_offset; memb_ptr2 = &memb_ptr; } /* Start/Continue decoding the inner member */ tmprval = elm->type->xer_decoder(opt_codec_ctx, elm->type, memb_ptr2, elm->name, buf_ptr, size); XER_ADVANCE(tmprval.consumed); ASN_DEBUG("XER/CHOICE: itdf: [%s] code=%d", elm->type->name, tmprval.code); if(tmprval.code != RC_OK) RETURN(tmprval.code); assert(_fetch_present_idx(st, specs->pres_offset, specs->pres_size) == 0); /* Record what we've got */ _set_present_idx(st, specs->pres_offset, specs->pres_size, edx + 1); ctx->phase = 3; /* Fall through */ } /* No need to wait for closing tag; special mode. */ if(ctx->phase == 3 && !*xml_tag) { ctx->phase = 5; /* Phase out */ RETURN(RC_OK); } /* * Get the next part of the XML stream. */ ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type); switch(ch_size) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); default: switch(ch_type) { case PXER_COMMENT: /* Got XML comment */ case PXER_TEXT: /* Ignore free-standing text */ XER_ADVANCE(ch_size); /* Skip silently */ continue; case PXER_TAG: break; /* Check the rest down there */ } } tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); ASN_DEBUG("XER/CHOICE checked [%c%c%c%c] vs [%s], tcv=%d", ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', xml_tag, tcv); /* Skip the extensions section */ if(ctx->phase == 4) { ASN_DEBUG("skip_unknown(%d, %ld)", tcv, (long)ctx->left); switch(xer_skip_unknown(tcv, &ctx->left)) { case -1: ctx->phase = 5; RETURN(RC_FAIL); continue; case 1: ctx->phase = 3; /* Fall through */ case 0: XER_ADVANCE(ch_size); continue; case 2: ctx->phase = 3; break; } } switch(tcv) { case XCT_BOTH: break; /* No CHOICE? */ case XCT_CLOSING: if(ctx->phase != 3) break; XER_ADVANCE(ch_size); ctx->phase = 5; /* Phase out */ RETURN(RC_OK); case XCT_OPENING: if(ctx->phase == 0) { XER_ADVANCE(ch_size); ctx->phase = 1; /* Processing body phase */ continue; } /* Fall through */ case XCT_UNKNOWN_OP: case XCT_UNKNOWN_BO: if(ctx->phase != 1) break; /* Really unexpected */ /* * Search which inner member corresponds to this tag. */ for(edx = 0; edx < td->elements_count; edx++) { elm = &td->elements[edx]; tcv = xer_check_tag(buf_ptr,ch_size,elm->name); switch(tcv) { case XCT_BOTH: case XCT_OPENING: /* * Process this member. */ ctx->step = edx; ctx->phase = 2; break; case XCT_UNKNOWN_OP: case XCT_UNKNOWN_BO: continue; default: edx = td->elements_count; break; /* Phase out */ } break; } if(edx != td->elements_count) continue; /* It is expected extension */ if(specs->ext_start != -1) { ASN_DEBUG("Got anticipated extension"); /* * Check for (XCT_BOTH or XCT_UNKNOWN_BO) * By using a mask. Only record a pure * tags. */ if(tcv & XCT_CLOSING) { /* Found without body */ ctx->phase = 3; /* Terminating */ } else { ctx->left = 1; ctx->phase = 4; /* Skip ...'s */ } XER_ADVANCE(ch_size); continue; } /* Fall through */ default: break; } ASN_DEBUG("Unexpected XML tag [%c%c%c%c] in CHOICE [%s]" " (ph=%d, tag=%s)", ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', td->name, ctx->phase, xml_tag); break; } ctx->phase = 5; /* Phase out, just in case */ RETURN(RC_FAIL); } asn_enc_rval_t CHOICE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { asn_CHOICE_specifics_t *specs=(asn_CHOICE_specifics_t *)td->specifics; asn_enc_rval_t er; int present; if(!sptr) _ASN_ENCODE_FAILED; /* * Figure out which CHOICE element is encoded. */ present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size); if(present <= 0 || present > td->elements_count) { _ASN_ENCODE_FAILED; } else { asn_enc_rval_t tmper; asn_TYPE_member_t *elm = &td->elements[present-1]; void *memb_ptr; const char *mname = elm->name; unsigned int mlen = strlen(mname); if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)sptr + elm->memb_offset); if(!memb_ptr) _ASN_ENCODE_FAILED; } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); } er.encoded = 0; if(!(flags & XER_F_CANONICAL)) _i_ASN_TEXT_INDENT(1, ilevel); _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); tmper = elm->type->xer_encoder(elm->type, memb_ptr, ilevel + 1, flags, cb, app_key); if(tmper.encoded == -1) return tmper; _ASN_CALLBACK3("", 1); er.encoded += 5 + (2 * mlen) + tmper.encoded; } if(!(flags & XER_F_CANONICAL)) _i_ASN_TEXT_INDENT(1, ilevel - 1); _ASN_ENCODED_OK(er); cb_failed: _ASN_ENCODE_FAILED; } asn_dec_rval_t CHOICE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; asn_dec_rval_t rv; asn_per_constraint_t *ct; asn_TYPE_member_t *elm; /* CHOICE's element */ void *memb_ptr; void **memb_ptr2; void *st = *sptr; int value; if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) _ASN_DECODE_FAILED; /* * Create the target structure if it is not present already. */ if(!st) { st = *sptr = CALLOC(1, specs->struct_size); if(!st) _ASN_DECODE_FAILED; } if(constraints) ct = &constraints->value; else if(td->per_constraints) ct = &td->per_constraints->value; else ct = 0; if(ct && ct->flags & APC_EXTENSIBLE) { value = per_get_few_bits(pd, 1); if(value < 0) _ASN_DECODE_STARVED; if(value) ct = 0; /* Not restricted */ } if(ct && ct->range_bits >= 0) { value = per_get_few_bits(pd, ct->range_bits); if(value < 0) _ASN_DECODE_STARVED; ASN_DEBUG("CHOICE %s got index %d in range %d", td->name, value, ct->range_bits); if(value > ct->upper_bound) _ASN_DECODE_FAILED; } else { if(specs->ext_start == -1) _ASN_DECODE_FAILED; value = uper_get_nsnnwn(pd); if(value < 0) _ASN_DECODE_STARVED; value += specs->ext_start; if(value >= td->elements_count) _ASN_DECODE_FAILED; } /* Adjust if canonical order is different from natural order */ if(specs->canonical_order) value = specs->canonical_order[value]; /* Set presence to be able to free it later */ _set_present_idx(st, specs->pres_offset, specs->pres_size, value + 1); elm = &td->elements[value]; if(elm->flags & ATF_POINTER) { /* Member is a pointer to another structure */ memb_ptr2 = (void **)((char *)st + elm->memb_offset); } else { memb_ptr = (char *)st + elm->memb_offset; memb_ptr2 = &memb_ptr; } ASN_DEBUG("Discovered CHOICE %s encodes %s", td->name, elm->name); if(ct && ct->range_bits >= 0) { rv = elm->type->uper_decoder(opt_codec_ctx, elm->type, elm->per_constraints, memb_ptr2, pd); } else { rv = uper_open_type_get(opt_codec_ctx, elm->type, elm->per_constraints, memb_ptr2, pd); } if(rv.code != RC_OK) ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d", elm->name, td->name, rv.code); return rv; } asn_enc_rval_t CHOICE_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; asn_TYPE_member_t *elm; /* CHOICE's element */ asn_per_constraint_t *ct; void *memb_ptr; int present; if(!sptr) _ASN_ENCODE_FAILED; ASN_DEBUG("Encoding %s as CHOICE", td->name); if(constraints) ct = &constraints->value; else if(td->per_constraints) ct = &td->per_constraints->value; else ct = 0; present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size); /* * If the structure was not initialized properly, it cannot be encoded: * can't deduce what to encode in the choice type. */ if(present <= 0 || present > td->elements_count) _ASN_ENCODE_FAILED; else present--; /* Adjust if canonical order is different from natural order */ if(specs->canonical_order) present = specs->canonical_order[present]; ASN_DEBUG("Encoding %s CHOICE element %d", td->name, present); if(ct && ct->range_bits >= 0) { if(present < ct->lower_bound || present > ct->upper_bound) { if(ct->flags & APC_EXTENSIBLE) { if(per_put_few_bits(po, 1, 1)) _ASN_ENCODE_FAILED; } else { _ASN_ENCODE_FAILED; } ct = 0; } } if(ct && ct->flags & APC_EXTENSIBLE) if(per_put_few_bits(po, 0, 1)) _ASN_ENCODE_FAILED; elm = &td->elements[present]; if(elm->flags & ATF_POINTER) { /* Member is a pointer to another structure */ memb_ptr = *(void **)((char *)sptr + elm->memb_offset); if(!memb_ptr) _ASN_ENCODE_FAILED; } else { memb_ptr = (char *)sptr + elm->memb_offset; } if(ct && ct->range_bits >= 0) { if(per_put_few_bits(po, present, ct->range_bits)) _ASN_ENCODE_FAILED; return elm->type->uper_encoder(elm->type, elm->per_constraints, memb_ptr, po); } else { asn_enc_rval_t rval; if(specs->ext_start == -1) _ASN_ENCODE_FAILED; if(uper_put_nsnnwn(po, present - specs->ext_start)) _ASN_ENCODE_FAILED; if(uper_open_type_put(elm->type, elm->per_constraints, memb_ptr, po)) _ASN_ENCODE_FAILED; rval.encoded = 0; _ASN_ENCODED_OK(rval); } } int CHOICE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; int present; if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; /* * Figure out which CHOICE element is encoded. */ present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size); /* * Print that element. */ if(present > 0 && present <= td->elements_count) { asn_TYPE_member_t *elm = &td->elements[present-1]; const void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); if(!memb_ptr) return (cb("", 8, app_key) < 0) ? -1 : 0; } else { memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); } /* Print member's name and stuff */ if(0) { if(cb(elm->name, strlen(elm->name), app_key) < 0 || cb(": ", 2, app_key) < 0) return -1; } return elm->type->print_struct(elm->type, memb_ptr, ilevel, cb, app_key); } else { return (cb("", 8, app_key) < 0) ? -1 : 0; } } void CHOICE_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; int present; if(!td || !ptr) return; ASN_DEBUG("Freeing %s as CHOICE", td->name); /* * Figure out which CHOICE element is encoded. */ present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size); /* * Free that element. */ if(present > 0 && present <= td->elements_count) { asn_TYPE_member_t *elm = &td->elements[present-1]; void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)ptr + elm->memb_offset); if(memb_ptr) ASN_STRUCT_FREE(*elm->type, memb_ptr); } else { memb_ptr = (void *)((char *)ptr + elm->memb_offset); ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr); } } if(!contents_only) { FREEMEM(ptr); } } /* * The following functions functions offer protection against -fshort-enums, * compatible with little- and big-endian machines. * If assertion is triggered, either disable -fshort-enums, or add an entry * here with the ->pres_size of your target stracture. * Unless the target structure is packed, the ".present" member * is guaranteed to be aligned properly. ASN.1 compiler itself does not * produce packed code. */ static int _fetch_present_idx(const void *struct_ptr, int pres_offset, int pres_size) { const void *present_ptr; int present; present_ptr = ((const char *)struct_ptr) + pres_offset; switch(pres_size) { case sizeof(int): present = *(const int *)present_ptr; break; case sizeof(short): present = *(const short *)present_ptr; break; case sizeof(char): present = *(const char *)present_ptr; break; default: /* ANSI C mandates enum to be equivalent to integer */ assert(pres_size != sizeof(int)); return 0; /* If not aborted, pass back safe value */ } return present; } static void _set_present_idx(void *struct_ptr, int pres_offset, int pres_size, int present) { void *present_ptr; present_ptr = ((char *)struct_ptr) + pres_offset; switch(pres_size) { case sizeof(int): *(int *)present_ptr = present; break; case sizeof(short): *(short *)present_ptr = present; break; case sizeof(char): *(char *)present_ptr = present; break; default: /* ANSI C mandates enum to be equivalent to integer */ assert(pres_size != sizeof(int)); } } asn1c-0.9.24+dfsg/skeletons/NativeEnumerated.h0000644000000000000000000000160111472004364017647 0ustar rootroot/*- * Copyright (c) 2004, 2005, 2006 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * This type differs from the standard ENUMERATED in that it is modelled using * the fixed machine type (long, int, short), so it can hold only values of * limited length. There is no type (i.e., NativeEnumerated_t, any integer type * will do). * This type may be used when integer range is limited by subtype constraints. */ #ifndef _NativeEnumerated_H_ #define _NativeEnumerated_H_ #include #ifdef __cplusplus extern "C" { #endif extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; xer_type_encoder_f NativeEnumerated_encode_xer; per_type_decoder_f NativeEnumerated_decode_uper; per_type_encoder_f NativeEnumerated_encode_uper; #ifdef __cplusplus } #endif #endif /* _NativeEnumerated_H_ */ asn1c-0.9.24+dfsg/skeletons/constr_SEQUENCE.c0000644000000000000000000010725412015121740017205 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005, 2006, 2007 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * Number of bytes left for this structure. * (ctx->left) indicates the number of bytes _transferred_ for the structure. * (size) contains the number of bytes in the buffer passed. */ #define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) /* * If the subprocessor function returns with an indication that it wants * more data, it may well be a fatal decoding problem, because the * size is constrained by the 's L, even if the buffer size allows * reading more data. * For example, consider the buffer containing the following TLVs: * ... * The TLV length clearly indicates that one byte is expected in V, but * if the V processor returns with "want more data" even if the buffer * contains way more data than the V processor have seen. */ #define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) /* * This macro "eats" the part of the buffer which is definitely "consumed", * i.e. was correctly converted into local representation or rightfully skipped. */ #undef ADVANCE #define ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ ptr = ((const char *)ptr) + num;\ size -= num; \ if(ctx->left >= 0) \ ctx->left -= num; \ consumed_myself += num; \ } while(0) /* * Switch to the next phase of parsing. */ #undef NEXT_PHASE #undef PHASE_OUT #define NEXT_PHASE(ctx) do { \ ctx->phase++; \ ctx->step = 0; \ } while(0) #define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) /* * Return a standardized complex structure. */ #undef RETURN #define RETURN(_code) do { \ rval.code = _code; \ rval.consumed = consumed_myself;\ return rval; \ } while(0) /* * Check whether we are inside the extensions group. */ #define IN_EXTENSION_GROUP(specs, memb_idx) \ ( ((memb_idx) > (specs)->ext_after) \ &&((memb_idx) < (specs)->ext_before)) /* * Tags are canonically sorted in the tag2element map. */ static int _t2e_cmp(const void *ap, const void *bp) { const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap; const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp; int a_class = BER_TAG_CLASS(a->el_tag); int b_class = BER_TAG_CLASS(b->el_tag); if(a_class == b_class) { ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag); ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag); if(a_value == b_value) { if(a->el_no > b->el_no) return 1; /* * Important: we do not check * for a->el_no <= b->el_no! */ return 0; } else if(a_value < b_value) return -1; else return 1; } else if(a_class < b_class) { return -1; } else { return 1; } } /* * The decoder of the SEQUENCE type. */ asn_dec_rval_t SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **struct_ptr, const void *ptr, size_t size, int tag_mode) { /* * Bring closer parts of structure description. */ asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics; asn_TYPE_member_t *elements = td->elements; /* * Parts of the structure being constructed. */ void *st = *struct_ptr; /* Target structure. */ asn_struct_ctx_t *ctx; /* Decoder context */ ber_tlv_tag_t tlv_tag; /* T from TLV */ asn_dec_rval_t rval; /* Return code from subparsers */ ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ int edx; /* SEQUENCE element's index */ ASN_DEBUG("Decoding %s as SEQUENCE", td->name); /* * Create the target structure if it is not present already. */ if(st == 0) { st = *struct_ptr = CALLOC(1, specs->struct_size); if(st == 0) { RETURN(RC_FAIL); } } /* * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); /* * Start to parse where left previously */ switch(ctx->phase) { case 0: /* * PHASE 0. * Check that the set of tags associated with given structure * perfectly fits our expectations. */ rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, tag_mode, 1, &ctx->left, 0); if(rval.code != RC_OK) { ASN_DEBUG("%s tagging check failed: %d", td->name, rval.code); return rval; } if(ctx->left >= 0) ctx->left += rval.consumed; /* ?Substracted below! */ ADVANCE(rval.consumed); NEXT_PHASE(ctx); ASN_DEBUG("Structure consumes %ld bytes, buffer %ld", (long)ctx->left, (long)size); /* Fall through */ case 1: /* * PHASE 1. * From the place where we've left it previously, * try to decode the next member from the list of * this structure's elements. * (ctx->step) stores the member being processed * between invocations and the microphase {0,1} of parsing * that member: * step = ( * 2 + ). */ for(edx = (ctx->step >> 1); edx < td->elements_count; edx++, ctx->step = (ctx->step & ~1) + 2) { void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ ssize_t tag_len; /* Length of TLV's T */ int opt_edx_end; /* Next non-optional element */ int use_bsearch; int n; if(ctx->step & 1) goto microphase2; /* * MICROPHASE 1: Synchronize decoding. */ ASN_DEBUG("In %s SEQUENCE left %d, edx=%d flags=%d" " opt=%d ec=%d", td->name, (int)ctx->left, edx, elements[edx].flags, elements[edx].optional, td->elements_count); if(ctx->left == 0 /* No more stuff is expected */ && ( /* Explicit OPTIONAL specification reaches the end */ (edx + elements[edx].optional == td->elements_count) || /* All extensions are optional */ (IN_EXTENSION_GROUP(specs, edx) && specs->ext_before > td->elements_count) ) ) { ASN_DEBUG("End of SEQUENCE %s", td->name); /* * Found the legitimate end of the structure. */ PHASE_OUT(ctx); RETURN(RC_OK); } /* * Fetch the T from TLV. */ tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); ASN_DEBUG("Current tag in %s SEQUENCE for element %d " "(%s) is %s encoded in %d bytes, of frame %ld", td->name, edx, elements[edx].name, ber_tlv_tag_string(tlv_tag), (int)tag_len, (long)LEFT); switch(tag_len) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { if(LEFT < 2) { if(SIZE_VIOLATION) RETURN(RC_FAIL); else RETURN(RC_WMORE); } else if(((const uint8_t *)ptr)[1] == 0) { ASN_DEBUG("edx = %d, opt = %d, ec=%d", edx, elements[edx].optional, td->elements_count); if((edx + elements[edx].optional == td->elements_count) || (IN_EXTENSION_GROUP(specs, edx) && specs->ext_before > td->elements_count)) { /* * Yeah, baby! Found the terminator * of the indefinite length structure. */ /* * Proceed to the canonical * finalization function. * No advancing is necessary. */ goto phase3; } } } /* * Find the next available type with this tag. */ use_bsearch = 0; opt_edx_end = edx + elements[edx].optional + 1; if(opt_edx_end > td->elements_count) opt_edx_end = td->elements_count; /* Cap */ else if(opt_edx_end - edx > 8) { /* Limit the scope of linear search... */ opt_edx_end = edx + 8; use_bsearch = 1; /* ... and resort to bsearch() */ } for(n = edx; n < opt_edx_end; n++) { if(BER_TAGS_EQUAL(tlv_tag, elements[n].tag)) { /* * Found element corresponding to the tag * being looked at. * Reposition over the right element. */ edx = n; ctx->step = 1 + 2 * edx; /* Remember! */ goto microphase2; } else if(elements[n].flags & ATF_OPEN_TYPE) { /* * This is the ANY type, which may bear * any flag whatsoever. */ edx = n; ctx->step = 1 + 2 * edx; /* Remember! */ goto microphase2; } else if(elements[n].tag == (ber_tlv_tag_t)-1) { use_bsearch = 1; break; } } if(use_bsearch) { /* * Resort to a binary search over * sorted array of tags. */ asn_TYPE_tag2member_t *t2m; asn_TYPE_tag2member_t key; key.el_tag = tlv_tag; key.el_no = edx; t2m = (asn_TYPE_tag2member_t *)bsearch(&key, specs->tag2el, specs->tag2el_count, sizeof(specs->tag2el[0]), _t2e_cmp); if(t2m) { asn_TYPE_tag2member_t *best = 0; asn_TYPE_tag2member_t *t2m_f, *t2m_l; int edx_max = edx + elements[edx].optional; /* * Rewind to the first element with that tag, * `cause bsearch() does not guarantee order. */ t2m_f = t2m + t2m->toff_first; t2m_l = t2m + t2m->toff_last; for(t2m = t2m_f; t2m <= t2m_l; t2m++) { if(t2m->el_no > edx_max) break; if(t2m->el_no < edx) continue; best = t2m; } if(best) { edx = best->el_no; ctx->step = 1 + 2 * edx; goto microphase2; } } n = opt_edx_end; } if(n == opt_edx_end) { /* * If tag is unknown, it may be either * an unknown (thus, incorrect) tag, * or an extension (...), * or an end of the indefinite-length structure. */ if(!IN_EXTENSION_GROUP(specs, edx + elements[edx].optional)) { ASN_DEBUG("Unexpected tag %s (at %d)", ber_tlv_tag_string(tlv_tag), edx); ASN_DEBUG("Expected tag %s (%s)%s", ber_tlv_tag_string(elements[edx].tag), elements[edx].name, elements[edx].optional ?" or alternatives":""); RETURN(RC_FAIL); } else { /* Skip this tag */ ssize_t skip; edx += elements[edx].optional; ASN_DEBUG("Skipping unexpected %s (at %d)", ber_tlv_tag_string(tlv_tag), edx); skip = ber_skip_length(opt_codec_ctx, BER_TLV_CONSTRUCTED(ptr), (const char *)ptr + tag_len, LEFT - tag_len); ASN_DEBUG("Skip length %d in %s", (int)skip, td->name); switch(skip) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } ADVANCE(skip + tag_len); ctx->step -= 2; edx--; continue; /* Try again with the next tag */ } } /* * MICROPHASE 2: Invoke the member-specific decoder. */ ctx->step |= 1; /* Confirm entering next microphase */ microphase2: ASN_DEBUG("Inside SEQUENCE %s MF2", td->name); /* * Compute the position of the member inside a structure, * and also a type of containment (it may be contained * as pointer or using inline inclusion). */ if(elements[edx].flags & ATF_POINTER) { /* Member is a pointer to another structure */ memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset); } else { /* * A pointer to a pointer * holding the start of the structure */ memb_ptr = (char *)st + elements[edx].memb_offset; memb_ptr2 = &memb_ptr; } /* * Invoke the member fetch routine according to member's type */ rval = elements[edx].type->ber_decoder(opt_codec_ctx, elements[edx].type, memb_ptr2, ptr, LEFT, elements[edx].tag_mode); ASN_DEBUG("In %s SEQUENCE decoded %d %s of %d " "in %d bytes rval.code %d, size=%d", td->name, edx, elements[edx].type->name, (int)LEFT, (int)rval.consumed, rval.code, (int)size); switch(rval.code) { case RC_OK: break; case RC_WMORE: /* More data expected */ if(!SIZE_VIOLATION) { ADVANCE(rval.consumed); RETURN(RC_WMORE); } ASN_DEBUG("Size violation (c->l=%ld <= s=%ld)", (long)ctx->left, (long)size); /* Fall through */ case RC_FAIL: /* Fatal error */ RETURN(RC_FAIL); } /* switch(rval) */ ADVANCE(rval.consumed); } /* for(all structure members) */ phase3: ctx->phase = 3; case 3: /* 00 and other tags expected */ case 4: /* only 00's expected */ ASN_DEBUG("SEQUENCE %s Leftover: %ld, size = %ld", td->name, (long)ctx->left, (long)size); /* * Skip everything until the end of the SEQUENCE. */ while(ctx->left) { ssize_t tl, ll; tl = ber_fetch_tag(ptr, LEFT, &tlv_tag); switch(tl) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } /* * If expected <0><0>... */ if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { if(LEFT < 2) { if(SIZE_VIOLATION) RETURN(RC_FAIL); else RETURN(RC_WMORE); } else if(((const uint8_t *)ptr)[1] == 0) { /* * Correctly finished with <0><0>. */ ADVANCE(2); ctx->left++; ctx->phase = 4; continue; } } if(!IN_EXTENSION_GROUP(specs, td->elements_count) || ctx->phase == 4) { ASN_DEBUG("Unexpected continuation " "of a non-extensible type " "%s (SEQUENCE): %s", td->name, ber_tlv_tag_string(tlv_tag)); RETURN(RC_FAIL); } ll = ber_skip_length(opt_codec_ctx, BER_TLV_CONSTRUCTED(ptr), (const char *)ptr + tl, LEFT - tl); switch(ll) { case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ case -1: RETURN(RC_FAIL); } ADVANCE(tl + ll); } PHASE_OUT(ctx); } RETURN(RC_OK); } /* * The DER encoder of the SEQUENCE type. */ asn_enc_rval_t SEQUENCE_encode_der(asn_TYPE_descriptor_t *td, void *sptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { size_t computed_size = 0; asn_enc_rval_t erval; ssize_t ret; int edx; ASN_DEBUG("%s %s as SEQUENCE", cb?"Encoding":"Estimating", td->name); /* * Gather the length of the underlying members sequence. */ for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)sptr + elm->memb_offset); if(!memb_ptr) { if(elm->optional) continue; /* Mandatory element is missing */ _ASN_ENCODE_FAILED; } } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); } erval = elm->type->der_encoder(elm->type, memb_ptr, elm->tag_mode, elm->tag, 0, 0); if(erval.encoded == -1) return erval; computed_size += erval.encoded; ASN_DEBUG("Member %d %s estimated %ld bytes", edx, elm->name, (long)erval.encoded); } /* * Encode the TLV for the sequence itself. */ ret = der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key); ASN_DEBUG("Wrote tags: %ld (+%ld)", (long)ret, (long)computed_size); if(ret == -1) _ASN_ENCODE_FAILED; erval.encoded = computed_size + ret; if(!cb) _ASN_ENCODED_OK(erval); /* * Encode all members. */ for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; asn_enc_rval_t tmperval; void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)sptr + elm->memb_offset); if(!memb_ptr) continue; } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); } tmperval = elm->type->der_encoder(elm->type, memb_ptr, elm->tag_mode, elm->tag, cb, app_key); if(tmperval.encoded == -1) return tmperval; computed_size -= tmperval.encoded; ASN_DEBUG("Member %d %s of SEQUENCE %s encoded in %ld bytes", edx, elm->name, td->name, (long)tmperval.encoded); } if(computed_size != 0) /* * Encoded size is not equal to the computed size. */ _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(erval); } #undef XER_ADVANCE #define XER_ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ buf_ptr = ((const char *)buf_ptr) + num;\ size -= num; \ consumed_myself += num; \ } while(0) /* * Decode the XER (XML) data. */ asn_dec_rval_t SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **struct_ptr, const char *opt_mname, const void *buf_ptr, size_t size) { /* * Bring closer parts of structure description. */ asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics; asn_TYPE_member_t *elements = td->elements; const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; /* * ... and parts of the structure being constructed. */ void *st = *struct_ptr; /* Target structure. */ asn_struct_ctx_t *ctx; /* Decoder context */ asn_dec_rval_t rval; /* Return value from a decoder */ ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ int edx; /* Element index */ int edx_end; /* * Create the target structure if it is not present already. */ if(st == 0) { st = *struct_ptr = CALLOC(1, specs->struct_size); if(st == 0) RETURN(RC_FAIL); } /* * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); /* * Phases of XER/XML processing: * Phase 0: Check that the opening tag matches our expectations. * Phase 1: Processing body and reacting on closing tag. * Phase 2: Processing inner type. * Phase 3: Skipping unknown extensions. * Phase 4: PHASED OUT */ for(edx = ctx->step; ctx->phase <= 3;) { pxer_chunk_type_e ch_type; /* XER chunk type */ ssize_t ch_size; /* Chunk size */ xer_check_tag_e tcv; /* Tag check value */ asn_TYPE_member_t *elm; int n; /* * Go inside the inner member of a sequence. */ if(ctx->phase == 2) { asn_dec_rval_t tmprval; void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ elm = &td->elements[edx]; if(elm->flags & ATF_POINTER) { /* Member is a pointer to another structure */ memb_ptr2 = (void **)((char *)st + elm->memb_offset); } else { memb_ptr = (char *)st + elm->memb_offset; memb_ptr2 = &memb_ptr; } /* Invoke the inner type decoder, m.b. multiple times */ tmprval = elm->type->xer_decoder(opt_codec_ctx, elm->type, memb_ptr2, elm->name, buf_ptr, size); XER_ADVANCE(tmprval.consumed); if(tmprval.code != RC_OK) RETURN(tmprval.code); ctx->phase = 1; /* Back to body processing */ ctx->step = ++edx; ASN_DEBUG("XER/SEQUENCE phase => %d, step => %d", ctx->phase, ctx->step); /* Fall through */ } /* * Get the next part of the XML stream. */ ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type); switch(ch_size) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); default: switch(ch_type) { case PXER_COMMENT: /* Got XML comment */ case PXER_TEXT: /* Ignore free-standing text */ XER_ADVANCE(ch_size); /* Skip silently */ continue; case PXER_TAG: break; /* Check the rest down there */ } } tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); ASN_DEBUG("XER/SEQUENCE: tcv = %d, ph=%d [%s]", tcv, ctx->phase, xml_tag); /* Skip the extensions section */ if(ctx->phase == 3) { switch(xer_skip_unknown(tcv, &ctx->left)) { case -1: ctx->phase = 4; RETURN(RC_FAIL); case 0: XER_ADVANCE(ch_size); continue; case 1: XER_ADVANCE(ch_size); ctx->phase = 1; continue; case 2: ctx->phase = 1; break; } } switch(tcv) { case XCT_CLOSING: if(ctx->phase == 0) break; ctx->phase = 0; /* Fall through */ case XCT_BOTH: if(ctx->phase == 0) { if(edx >= td->elements_count || /* Explicit OPTIONAL specs reaches the end */ (edx + elements[edx].optional == td->elements_count) || /* All extensions are optional */ (IN_EXTENSION_GROUP(specs, edx) && specs->ext_before > td->elements_count) ) { XER_ADVANCE(ch_size); ctx->phase = 4; /* Phase out */ RETURN(RC_OK); } else { ASN_DEBUG("Premature end of XER SEQUENCE"); RETURN(RC_FAIL); } } /* Fall through */ case XCT_OPENING: if(ctx->phase == 0) { XER_ADVANCE(ch_size); ctx->phase = 1; /* Processing body phase */ continue; } /* Fall through */ case XCT_UNKNOWN_OP: case XCT_UNKNOWN_BO: ASN_DEBUG("XER/SEQUENCE: tcv=%d, ph=%d, edx=%d", tcv, ctx->phase, edx); if(ctx->phase != 1) { break; /* Really unexpected */ } if(edx < td->elements_count) { /* * Search which member corresponds to this tag. */ edx_end = edx + elements[edx].optional + 1; if(edx_end > td->elements_count) edx_end = td->elements_count; for(n = edx; n < edx_end; n++) { elm = &td->elements[n]; tcv = xer_check_tag(buf_ptr, ch_size, elm->name); switch(tcv) { case XCT_BOTH: case XCT_OPENING: /* * Process this member. */ ctx->step = edx = n; ctx->phase = 2; break; case XCT_UNKNOWN_OP: case XCT_UNKNOWN_BO: continue; default: n = edx_end; break; /* Phase out */ } break; } if(n != edx_end) continue; } else { ASN_DEBUG("Out of defined members: %d/%d", edx, td->elements_count); } /* It is expected extension */ if(IN_EXTENSION_GROUP(specs, edx + (edx < td->elements_count ? elements[edx].optional : 0))) { ASN_DEBUG("Got anticipated extension at %d", edx); /* * Check for (XCT_BOTH or XCT_UNKNOWN_BO) * By using a mask. Only record a pure * tags. */ if(tcv & XCT_CLOSING) { /* Found without body */ } else { ctx->left = 1; ctx->phase = 3; /* Skip ...'s */ } XER_ADVANCE(ch_size); continue; } /* Fall through */ default: break; } ASN_DEBUG("Unexpected XML tag in SEQUENCE [%c%c%c%c%c%c]", size>0?((const char *)buf_ptr)[0]:'.', size>1?((const char *)buf_ptr)[1]:'.', size>2?((const char *)buf_ptr)[2]:'.', size>3?((const char *)buf_ptr)[3]:'.', size>4?((const char *)buf_ptr)[4]:'.', size>5?((const char *)buf_ptr)[5]:'.'); break; } ctx->phase = 4; /* "Phase out" on hard failure */ RETURN(RC_FAIL); } asn_enc_rval_t SEQUENCE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; int xcan = (flags & XER_F_CANONICAL); int edx; if(!sptr) _ASN_ENCODE_FAILED; er.encoded = 0; for(edx = 0; edx < td->elements_count; edx++) { asn_enc_rval_t tmper; asn_TYPE_member_t *elm = &td->elements[edx]; void *memb_ptr; const char *mname = elm->name; unsigned int mlen = strlen(mname); if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)sptr + elm->memb_offset); if(!memb_ptr) { if(elm->optional) continue; /* Mandatory element is missing */ _ASN_ENCODE_FAILED; } } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); } if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel); _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); /* Print the member itself */ tmper = elm->type->xer_encoder(elm->type, memb_ptr, ilevel + 1, flags, cb, app_key); if(tmper.encoded == -1) return tmper; _ASN_CALLBACK3("", 1); er.encoded += 5 + (2 * mlen) + tmper.encoded; } if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1); _ASN_ENCODED_OK(er); cb_failed: _ASN_ENCODE_FAILED; } int SEQUENCE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { int edx; int ret; if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; /* Dump preamble */ if(cb(td->name, strlen(td->name), app_key) < 0 || cb(" ::= {", 6, app_key) < 0) return -1; for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; const void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); if(!memb_ptr) { if(elm->optional) continue; /* Print line */ /* Fall through */ } } else { memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); } /* Indentation */ _i_INDENT(1); /* Print the member's name and stuff */ if(cb(elm->name, strlen(elm->name), app_key) < 0 || cb(": ", 2, app_key) < 0) return -1; /* Print the member itself */ ret = elm->type->print_struct(elm->type, memb_ptr, ilevel + 1, cb, app_key); if(ret) return ret; } ilevel--; _i_INDENT(1); return (cb("}", 1, app_key) < 0) ? -1 : 0; } void SEQUENCE_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) { int edx; if(!td || !sptr) return; ASN_DEBUG("Freeing %s as SEQUENCE", td->name); for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(void **)((char *)sptr + elm->memb_offset); if(memb_ptr) ASN_STRUCT_FREE(*elm->type, memb_ptr); } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr); } } if(!contents_only) { FREEMEM(sptr); } } int SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { int edx; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } /* * Iterate over structure members and check their validity. */ for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; const void *memb_ptr; if(elm->flags & ATF_POINTER) { memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset); if(!memb_ptr) { if(elm->optional) continue; _ASN_CTFAIL(app_key, td, sptr, "%s: mandatory element %s absent (%s:%d)", td->name, elm->name, __FILE__, __LINE__); return -1; } } else { memb_ptr = (const void *)((const char *)sptr + elm->memb_offset); } if(elm->memb_constraints) { int ret = elm->memb_constraints(elm->type, memb_ptr, ctfailcb, app_key); if(ret) return ret; } else { int ret = elm->type->check_constraints(elm->type, memb_ptr, ctfailcb, app_key); if(ret) return ret; /* * Cannot inherit it earlier: * need to make sure we get the updated version. */ elm->memb_constraints = elm->type->check_constraints; } } return 0; } asn_dec_rval_t SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics; void *st = *sptr; /* Target structure. */ int extpresent; /* Extension additions are present */ uint8_t *opres; /* Presence of optional root members */ asn_per_data_t opmd; asn_dec_rval_t rv; int edx; (void)constraints; if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) _ASN_DECODE_FAILED; if(!st) { st = *sptr = CALLOC(1, specs->struct_size); if(!st) _ASN_DECODE_FAILED; } ASN_DEBUG("Decoding %s as SEQUENCE (UPER)", td->name); /* Handle extensions */ if(specs->ext_before >= 0) { extpresent = per_get_few_bits(pd, 1); if(extpresent < 0) _ASN_DECODE_STARVED; } else { extpresent = 0; } /* Prepare a place and read-in the presence bitmap */ memset(&opmd, 0, sizeof(opmd)); if(specs->roms_count) { opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1); if(!opres) _ASN_DECODE_FAILED; /* Get the presence map */ if(per_get_many_bits(pd, opres, 0, specs->roms_count)) { FREEMEM(opres); _ASN_DECODE_STARVED; } opmd.buffer = opres; opmd.nbits = specs->roms_count; ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)", td->name, specs->roms_count, *opres); } else { opres = 0; } /* * Get the sequence ROOT elements. */ for(edx = 0; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ if(IN_EXTENSION_GROUP(specs, edx)) continue; /* Fetch the pointer to this member */ if(elm->flags & ATF_POINTER) { memb_ptr2 = (void **)((char *)st + elm->memb_offset); } else { memb_ptr = (char *)st + elm->memb_offset; memb_ptr2 = &memb_ptr; } /* Deal with optionality */ if(elm->optional) { int present = per_get_few_bits(&opmd, 1); ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)", td->name, elm->name, present, (int)opmd.nboff, (int)opmd.nbits); if(present == 0) { /* This element is not present */ if(elm->default_value) { /* Fill-in DEFAULT */ if(elm->default_value(1, memb_ptr2)) { FREEMEM(opres); _ASN_DECODE_FAILED; } ASN_DEBUG("Filled-in default"); } /* The member is just not present */ continue; } /* Fall through */ } /* Fetch the member from the stream */ ASN_DEBUG("Decoding member %s in %s", elm->name, td->name); rv = elm->type->uper_decoder(opt_codec_ctx, elm->type, elm->per_constraints, memb_ptr2, pd); if(rv.code != RC_OK) { ASN_DEBUG("Failed decode %s in %s", elm->name, td->name); FREEMEM(opres); return rv; } } /* Optionality map is not needed anymore */ FREEMEM(opres); /* * Deal with extensions. */ if(extpresent) { ssize_t bmlength; uint8_t *epres; /* Presence of extension members */ asn_per_data_t epmd; bmlength = uper_get_nslength(pd); if(bmlength < 0) _ASN_DECODE_STARVED; ASN_DEBUG("Extensions %ld present in %s", (long)bmlength, td->name); epres = (uint8_t *)MALLOC((bmlength + 15) >> 3); if(!epres) _ASN_DECODE_STARVED; /* Get the extensions map */ if(per_get_many_bits(pd, epres, 0, bmlength)) _ASN_DECODE_STARVED; memset(&epmd, 0, sizeof(epmd)); epmd.buffer = epres; epmd.nbits = bmlength; ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)", td->name, (long)bmlength, *epres); /* Go over extensions and read them in */ for(edx = specs->ext_after + 1; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ int present; if(!IN_EXTENSION_GROUP(specs, edx)) { ASN_DEBUG("%d is not extension", edx); continue; } /* Fetch the pointer to this member */ if(elm->flags & ATF_POINTER) { memb_ptr2 = (void **)((char *)st + elm->memb_offset); } else { memb_ptr = (void *)((char *)st + elm->memb_offset); memb_ptr2 = &memb_ptr; } present = per_get_few_bits(&epmd, 1); if(present <= 0) { if(present < 0) break; /* No more extensions */ continue; } ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name, *memb_ptr2); rv = uper_open_type_get(opt_codec_ctx, elm->type, elm->per_constraints, memb_ptr2, pd); if(rv.code != RC_OK) { FREEMEM(epres); return rv; } } /* Skip over overflow extensions which aren't present * in this system's version of the protocol */ for(;;) { ASN_DEBUG("Getting overflow extensions"); switch(per_get_few_bits(&epmd, 1)) { case -1: break; case 0: continue; default: if(uper_open_type_skip(opt_codec_ctx, pd)) { FREEMEM(epres); _ASN_DECODE_STARVED; } } break; } FREEMEM(epres); } /* Fill DEFAULT members in extensions */ for(edx = specs->roms_count; edx < specs->roms_count + specs->aoms_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; void **memb_ptr2; /* Pointer to member pointer */ if(!elm->default_value) continue; /* Fetch the pointer to this member */ if(elm->flags & ATF_POINTER) { memb_ptr2 = (void **)((char *)st + elm->memb_offset); if(*memb_ptr2) continue; } else { continue; /* Extensions are all optionals */ } /* Set default value */ if(elm->default_value(1, memb_ptr2)) { _ASN_DECODE_FAILED; } } rv.consumed = 0; rv.code = RC_OK; return rv; } static int SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr, asn_per_outp_t *po1, asn_per_outp_t *po2) { asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics; int exts_present = 0; int exts_count = 0; int edx; if(specs->ext_before < 0) return 0; /* Find out which extensions are present */ for(edx = specs->ext_after + 1; edx < td->elements_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ int present; if(!IN_EXTENSION_GROUP(specs, edx)) { ASN_DEBUG("%s (@%d) is not extension", elm->type->name, edx); continue; } /* Fetch the pointer to this member */ if(elm->flags & ATF_POINTER) { memb_ptr2 = (void **)((char *)sptr + elm->memb_offset); present = (*memb_ptr2 != 0); } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); memb_ptr2 = &memb_ptr; present = 1; } ASN_DEBUG("checking %s (@%d) present => %d", elm->type->name, edx, present); exts_count++; exts_present += present; /* Encode as presence marker */ if(po1 && per_put_few_bits(po1, present, 1)) return -1; /* Encode as open type field */ if(po2 && present && uper_open_type_put(elm->type, elm->per_constraints, *memb_ptr2, po2)) return -1; } return exts_present ? exts_count : 0; } asn_enc_rval_t SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics; asn_enc_rval_t er; int n_extensions; int edx; int i; (void)constraints; if(!sptr) _ASN_ENCODE_FAILED; er.encoded = 0; ASN_DEBUG("Encoding %s as SEQUENCE (UPER)", td->name); /* * X.691#18.1 Whether structure is extensible * and whether to encode extensions */ if(specs->ext_before >= 0) { n_extensions = SEQUENCE_handle_extensions(td, sptr, 0, 0); per_put_few_bits(po, n_extensions ? 1 : 0, 1); } else { n_extensions = 0; /* There are no extensions to encode */ } /* Encode a presence bitmap */ for(i = 0; i < specs->roms_count; i++) { asn_TYPE_member_t *elm; void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ int present; edx = specs->oms[i]; elm = &td->elements[edx]; /* Fetch the pointer to this member */ if(elm->flags & ATF_POINTER) { memb_ptr2 = (void **)((char *)sptr + elm->memb_offset); present = (*memb_ptr2 != 0); } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); memb_ptr2 = &memb_ptr; present = 1; } /* Eliminate default values */ if(present && elm->default_value && elm->default_value(0, memb_ptr2) == 1) present = 0; ASN_DEBUG("Element %s %s %s->%s is %s", elm->flags & ATF_POINTER ? "ptr" : "inline", elm->default_value ? "def" : "wtv", td->name, elm->name, present ? "present" : "absent"); if(per_put_few_bits(po, present, 1)) _ASN_ENCODE_FAILED; } /* * Encode the sequence ROOT elements. */ ASN_DEBUG("ext_after = %d, ec = %d, eb = %d", specs->ext_after, td->elements_count, specs->ext_before); for(edx = 0; edx < ((specs->ext_after < 0) ? td->elements_count : specs->ext_before - 1); edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; void *memb_ptr; /* Pointer to the member */ void **memb_ptr2; /* Pointer to that pointer */ if(IN_EXTENSION_GROUP(specs, edx)) continue; ASN_DEBUG("About to encode %s", elm->type->name); /* Fetch the pointer to this member */ if(elm->flags & ATF_POINTER) { memb_ptr2 = (void **)((char *)sptr + elm->memb_offset); if(!*memb_ptr2) { ASN_DEBUG("Element %s %d not present", elm->name, edx); if(elm->optional) continue; /* Mandatory element is missing */ _ASN_ENCODE_FAILED; } } else { memb_ptr = (void *)((char *)sptr + elm->memb_offset); memb_ptr2 = &memb_ptr; } /* Eliminate default values */ if(elm->default_value && elm->default_value(0, memb_ptr2) == 1) continue; ASN_DEBUG("Encoding %s->%s", td->name, elm->name); er = elm->type->uper_encoder(elm->type, elm->per_constraints, *memb_ptr2, po); if(er.encoded == -1) return er; } /* No extensions to encode */ if(!n_extensions) _ASN_ENCODED_OK(er); ASN_DEBUG("Length of %d bit-map", n_extensions); /* #18.8. Write down the presence bit-map length. */ if(uper_put_nslength(po, n_extensions)) _ASN_ENCODE_FAILED; ASN_DEBUG("Bit-map of %d elements", n_extensions); /* #18.7. Encoding the extensions presence bit-map. */ /* TODO: act upon NOTE in #18.7 for canonical PER */ if(SEQUENCE_handle_extensions(td, sptr, po, 0) != n_extensions) _ASN_ENCODE_FAILED; ASN_DEBUG("Writing %d extensions", n_extensions); /* #18.9. Encode extensions as open type fields. */ if(SEQUENCE_handle_extensions(td, sptr, 0, po) != n_extensions) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } asn1c-0.9.24+dfsg/skeletons/ObjectDescriptor.h0000644000000000000000000000075111472004364017661 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _ObjectDescriptor_H_ #define _ObjectDescriptor_H_ #include #ifdef __cplusplus extern "C" { #endif typedef GraphicString_t ObjectDescriptor_t; /* Implemented via GraphicString */ extern asn_TYPE_descriptor_t asn_DEF_ObjectDescriptor; #ifdef __cplusplus } #endif #endif /* _ObjectDescriptor_H_ */ asn1c-0.9.24+dfsg/skeletons/GraphicString.h0000644000000000000000000000072011472004364017154 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _GraphicString_H_ #define _GraphicString_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t GraphicString_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_GraphicString; #ifdef __cplusplus } #endif #endif /* _GraphicString_H_ */ asn1c-0.9.24+dfsg/skeletons/file-dependencies0000644000000000000000000000513312021062523017520 0ustar rootroot# This file contains dependency information for the asn1c compiler's skeletons. # Feel free to edit this file. # The format is like this: # ... # # $Id$ # ANY.h ANY.c BMPString.h BMPString.c UTF8String.h BOOLEAN.h BOOLEAN.c ENUMERATED.h ENUMERATED.c INTEGER.h NativeEnumerated.h GeneralString.h GeneralString.c GeneralizedTime.h GeneralizedTime.c GraphicString.h GraphicString.c IA5String.h IA5String.c INTEGER.h INTEGER.c ISO646String.h ISO646String.c NULL.h NULL.c BOOLEAN.h NativeEnumerated.h NativeEnumerated.c NativeInteger.h NativeInteger.h NativeInteger.c INTEGER.h NativeReal.h NativeReal.c REAL.h NumericString.h NumericString.c OBJECT_IDENTIFIER.h OBJECT_IDENTIFIER.c INTEGER.h ObjectDescriptor.h ObjectDescriptor.c GraphicString.h PrintableString.h PrintableString.c REAL.h REAL.c INTEGER.h RELATIVE-OID.h RELATIVE-OID.c OBJECT_IDENTIFIER.h T61String.h T61String.c TeletexString.h TeletexString.c UTCTime.h UTCTime.c GeneralizedTime.h UTF8String.h UTF8String.c UniversalString.h UniversalString.c UTF8String.h VideotexString.h VideotexString.c VisibleString.h VisibleString.c asn_SEQUENCE_OF.h asn_SEQUENCE_OF.c asn_SET_OF.h asn_SET_OF.h asn_SET_OF.c constr_CHOICE.h constr_CHOICE.c constr_SEQUENCE.h constr_SEQUENCE.c constr_SEQUENCE_OF.h constr_SEQUENCE_OF.c asn_SEQUENCE_OF.h constr_SET_OF.h constr_SET.h constr_SET.c constr_SET_OF.h constr_SET_OF.c asn_SET_OF.h COMMON-FILES: # THIS IS A SPECIAL SECTION asn_application.h # Applications should include this file asn_system.h # Platform-dependent types asn_codecs.h # Return types of encoders and decoders asn_internal.h # Internal stuff OCTET_STRING.h OCTET_STRING.c # This one is used too widely BIT_STRING.h BIT_STRING.c # This one is necessary for the above one asn_codecs_prim.c asn_codecs_prim.h # enc/decoders for primitive types ber_tlv_length.h ber_tlv_length.c # BER TLV L (length) ber_tlv_tag.h ber_tlv_tag.c # BER TLV T (tag) ber_decoder.h ber_decoder.c # BER decoder support code der_encoder.h der_encoder.c # DER encoder support code constr_TYPE.h constr_TYPE.c # Description of a type constraints.h constraints.c # Subtype constraints support xer_support.h xer_support.c # XML parsing xer_decoder.h xer_decoder.c # XER decoding support xer_encoder.h xer_encoder.c # XER encoding support per_support.h per_support.c # PER parsing per_decoder.h per_decoder.c # PER decoding support per_encoder.h per_encoder.c # PER encoding support per_opentype.h per_opentype.c # PER "open type" handling CONVERTER: # THIS IS A SPECIAL SECTION converter-sample.c # A default name for sample transcoder CODEC-PER: # THIS IS A SPECIAL SECTION asn1c-0.9.24+dfsg/skeletons/REAL.c0000644000000000000000000004202212015121740015117 0ustar rootroot/*- * Copyright (c) 2004, 2006 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #if defined(__alpha) #define _ISOC99_SOURCE /* For quiet NAN, through bits/nan.h */ #define _BSD_SOURCE /* To reintroduce finite(3) */ #include /* For INFINITY */ #endif #include #include /* for strtod(3) */ #include #include #include #include #undef INT_MAX #define INT_MAX ((int)(((unsigned int)-1) >> 1)) #if !(defined(NAN) || defined(INFINITY)) static volatile double real_zero GCC_NOTUSED = 0.0; #endif #ifndef NAN #define NAN (real_zero/real_zero) #endif #ifndef INFINITY #define INFINITY (1.0/real_zero) #endif /* * REAL basic type description. */ static ber_tlv_tag_t asn_DEF_REAL_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) }; asn_TYPE_descriptor_t asn_DEF_REAL = { "REAL", "REAL", ASN__PRIMITIVE_TYPE_free, REAL_print, asn_generic_no_constraint, ber_decode_primitive, der_encode_primitive, REAL_decode_xer, REAL_encode_xer, REAL_decode_uper, REAL_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_REAL_tags, sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]), asn_DEF_REAL_tags, /* Same as above */ sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; typedef enum specialRealValue { SRV__NOT_A_NUMBER, SRV__MINUS_INFINITY, SRV__PLUS_INFINITY } specialRealValue_e; static struct specialRealValue_s { char *string; size_t length; long dv; } specialRealValue[] = { #define SRV_SET(foo, val) { foo, sizeof(foo) - 1, val } SRV_SET("", 0), SRV_SET("", -1), SRV_SET("", 1), #undef SRV_SET }; ssize_t REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key) { char local_buf[64]; char *buf = local_buf; ssize_t buflen = sizeof(local_buf); const char *fmt = canonical?"%.15E":"%.15f"; ssize_t ret; /* * Check whether it is a special value. */ /* fpclassify(3) is not portable yet */ if(isnan(d)) { buf = specialRealValue[SRV__NOT_A_NUMBER].string; buflen = specialRealValue[SRV__NOT_A_NUMBER].length; return (cb(buf, buflen, app_key) < 0) ? -1 : buflen; } else if(!finite(d)) { if(copysign(1.0, d) < 0.0) { buf = specialRealValue[SRV__MINUS_INFINITY].string; buflen = specialRealValue[SRV__MINUS_INFINITY].length; } else { buf = specialRealValue[SRV__PLUS_INFINITY].string; buflen = specialRealValue[SRV__PLUS_INFINITY].length; } return (cb(buf, buflen, app_key) < 0) ? -1 : buflen; } else if(ilogb(d) <= -INT_MAX) { if(copysign(1.0, d) < 0.0) { buf = "-0"; buflen = 2; } else { buf = "0"; buflen = 1; } return (cb(buf, buflen, app_key) < 0) ? -1 : buflen; } /* * Use the libc's double printing, hopefully they got it right. */ do { ret = snprintf(buf, buflen, fmt, d); if(ret < 0) { buflen <<= 1; } else if(ret >= buflen) { buflen = ret + 1; } else { buflen = ret; break; } if(buf != local_buf) FREEMEM(buf); buf = (char *)MALLOC(buflen); if(!buf) return -1; } while(1); if(canonical) { /* * Transform the "[-]d.dddE+-dd" output into "[-]d.dddE[-]d" * Check that snprintf() constructed the output correctly. */ char *dot, *E; char *end = buf + buflen; char *last_zero; dot = (buf[0] == 0x2d /* '-' */) ? (buf + 2) : (buf + 1); if(*dot >= 0x30) { if(buf != local_buf) FREEMEM(buf); errno = EINVAL; return -1; /* Not a dot, really */ } *dot = 0x2e; /* Replace possible comma */ for(last_zero = dot + 2, E = dot; dot < end; E++) { if(*E == 0x45) { char *expptr = ++E; char *s = expptr; int sign; if(*expptr == 0x2b /* '+' */) { /* Skip the "+" */ buflen -= 1; sign = 0; } else { sign = 1; s++; } expptr++; if(expptr > end) { if(buf != local_buf) FREEMEM(buf); errno = EINVAL; return -1; } if(*expptr == 0x30) { buflen--; expptr++; } if(*last_zero == 0x30) { *last_zero = 0x45; /* E */ buflen -= s - (last_zero + 1); s = last_zero + 1; if(sign) { *s++ = 0x2d /* '-' */; buflen++; } } for(; expptr <= end; s++, expptr++) *s = *expptr; break; } else if(*E == 0x30) { if(*last_zero != 0x30) last_zero = E; } } if(E == end) { if(buf != local_buf) FREEMEM(buf); errno = EINVAL; return -1; /* No promised E */ } } else { /* * Remove trailing zeros. */ char *end = buf + buflen; char *last_zero = end; int stoplooking = 0; char *z; for(z = end - 1; z > buf; z--) { switch(*z) { case 0x30: if(!stoplooking) last_zero = z; continue; case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: stoplooking = 1; continue; default: /* Catch dot and other separators */ /* * Replace possible comma (which may even * be not a comma at all: locale-defined). */ *z = 0x2e; if(last_zero == z + 1) { /* leave x.0 */ last_zero++; } buflen = last_zero - buf; *last_zero = '\0'; break; } break; } } ret = cb(buf, buflen, app_key); if(buf != local_buf) FREEMEM(buf); return (ret < 0) ? -1 : buflen; } int REAL_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const REAL_t *st = (const REAL_t *)sptr; ssize_t ret; double d; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(!st || !st->buf) ret = cb("", 8, app_key); else if(asn_REAL2double(st, &d)) ret = cb("", 7, app_key); else ret = REAL__dump(d, 0, cb, app_key); return (ret < 0) ? -1 : 0; } asn_enc_rval_t REAL_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { REAL_t *st = (REAL_t *)sptr; asn_enc_rval_t er; double d; (void)ilevel; if(!st || !st->buf || asn_REAL2double(st, &d)) _ASN_ENCODE_FAILED; er.encoded = REAL__dump(d, flags & XER_F_CANONICAL, cb, app_key); if(er.encoded < 0) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } /* * Decode the chunk of XML text encoding REAL. */ static enum xer_pbd_rval REAL__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_buf, size_t chunk_size) { REAL_t *st = (REAL_t *)sptr; double value; const char *xerdata = (const char *)chunk_buf; char *endptr = 0; char *b; (void)td; if(!chunk_size) return XPBD_BROKEN_ENCODING; /* * Decode an XMLSpecialRealValue: , etc. */ if(xerdata[0] == 0x3c /* '<' */) { size_t i; for(i = 0; i < sizeof(specialRealValue) / sizeof(specialRealValue[0]); i++) { struct specialRealValue_s *srv = &specialRealValue[i]; double dv; if(srv->length != chunk_size || memcmp(srv->string, chunk_buf, chunk_size)) continue; /* * It could've been done using * (double)srv->dv / real_zero, * but it summons fp exception on some platforms. */ switch(srv->dv) { case -1: dv = - INFINITY; break; case 0: dv = NAN; break; case 1: dv = INFINITY; break; default: return XPBD_SYSTEM_FAILURE; } if(asn_double2REAL(st, dv)) return XPBD_SYSTEM_FAILURE; return XPBD_BODY_CONSUMED; } ASN_DEBUG("Unknown XMLSpecialRealValue"); return XPBD_BROKEN_ENCODING; } /* * Copy chunk into the nul-terminated string, and run strtod. */ b = (char *)MALLOC(chunk_size + 1); if(!b) return XPBD_SYSTEM_FAILURE; memcpy(b, chunk_buf, chunk_size); b[chunk_size] = 0; /* nul-terminate */ value = strtod(b, &endptr); FREEMEM(b); if(endptr == b) return XPBD_BROKEN_ENCODING; if(asn_double2REAL(st, value)) return XPBD_SYSTEM_FAILURE; return XPBD_BODY_CONSUMED; } asn_dec_rval_t REAL_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { return xer_decode_primitive(opt_codec_ctx, td, sptr, sizeof(REAL_t), opt_mname, buf_ptr, size, REAL__xer_body_decode); } asn_dec_rval_t REAL_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { (void)constraints; /* No PER visible constraints */ return OCTET_STRING_decode_uper(opt_codec_ctx, td, 0, sptr, pd); } asn_enc_rval_t REAL_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { (void)constraints; /* No PER visible constraints */ return OCTET_STRING_encode_uper(td, 0, sptr, po); } int asn_REAL2double(const REAL_t *st, double *dbl_value) { unsigned int octv; if(!st || !st->buf) { errno = EINVAL; return -1; } if(st->size == 0) { *dbl_value = 0; return 0; } octv = st->buf[0]; /* unsigned byte */ switch(octv & 0xC0) { case 0x40: /* X.690: 8.5.6 a) => 8.5.9 */ /* "SpecialRealValue" */ /* Be liberal in what you accept... * http://en.wikipedia.org/wiki/Robustness_principle if(st->size != 1) ... */ switch(st->buf[0]) { case 0x40: /* 01000000: PLUS-INFINITY */ *dbl_value = INFINITY; return 0; case 0x41: /* 01000001: MINUS-INFINITY */ *dbl_value = - INFINITY; return 0; case 0x42: /* 01000010: NOT-A-NUMBER */ *dbl_value = NAN; return 0; case 0x43: /* 01000011: minus zero */ *dbl_value = -0.0; return 0; } errno = EINVAL; return -1; case 0x00: { /* X.690: 8.5.7 */ /* * Decimal. NR{1,2,3} format from ISO 6093. * NR1: [ ]*[+-]?[0-9]+ * NR2: [ ]*[+-]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+) * NR3: [ ]*[+-]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)[Ee][+-]?[0-9]+ */ double d; char *buf; char *endptr; int used_malloc = 0; if(octv == 0 || (octv & 0x3C)) { /* Remaining values of bits 6 to 1 are Reserved. */ errno = EINVAL; return -1; } /* 1. By contract, an input buffer should be null-terminated. * OCTET STRING decoder ensures that, as is asn_double2REAL(). * 2. ISO 6093 specifies COMMA as a possible decimal separator. * However, strtod() can't always deal with COMMA. * So her we fix both by reallocating, copying and fixing. */ if(st->buf[st->size] || memchr(st->buf, ',', st->size)) { uint8_t *p, *end; char *b; if(st->size > 100) { /* Avoid malicious stack overflow in alloca() */ buf = (char *)MALLOC(st->size); if(!buf) return -1; used_malloc = 1; } else { buf = alloca(st->size); } b = buf; /* Copy without the first byte and with 0-termination */ for(p = st->buf + 1, end = st->buf + st->size; p < end; b++, p++) *b = (*p == ',') ? '.' : *p; *b = '\0'; } else { buf = (char *)&st->buf[1]; } endptr = buf; d = strtod(buf, &endptr); if(*endptr != '\0') { /* Format is not consistent with ISO 6093 */ if(used_malloc) FREEMEM(buf); errno = EINVAL; return -1; } if(used_malloc) FREEMEM(buf); if(finite(d)) { *dbl_value = d; return 0; } else { errno = ERANGE; return -1; } } } /* * Binary representation. */ { double m; int expval; /* exponent value */ unsigned int elen; /* exponent value length, in octets */ unsigned int scaleF; unsigned int baseF; uint8_t *ptr; uint8_t *end; int sign; switch((octv & 0x30) >> 4) { case 0x00: baseF = 1; break; /* base 2 */ case 0x01: baseF = 3; break; /* base 8 */ case 0x02: baseF = 4; break; /* base 16 */ default: /* Reserved field, can't parse now. */ errno = EINVAL; return -1; } sign = (octv & 0x40); /* bit 7 */ scaleF = (octv & 0x0C) >> 2; /* bits 4 to 3 */ if(st->size <= (int)(1 + (octv & 0x03))) { errno = EINVAL; return -1; } elen = (octv & 0x03); /* bits 2 to 1; 8.5.6.4 */ if(elen == 0x03) { /* bits 2 to 1 = 11; 8.5.6.4, case d) */ elen = st->buf[1]; /* unsigned binary number */ if(elen == 0 || st->size <= (int)(2 + elen)) { errno = EINVAL; return -1; } /* FIXME: verify constraints of case d) */ ptr = &st->buf[2]; } else { ptr = &st->buf[1]; } /* Fetch the multibyte exponent */ expval = (int)(*(int8_t *)ptr); end = ptr + elen + 1; for(ptr++; ptr < end; ptr++) expval = (expval * 256) + *ptr; m = 0.0; /* Initial mantissa value */ /* Okay, the exponent is here. Now, what about mantissa? */ end = st->buf + st->size; for(; ptr < end; ptr++) m = ldexp(m, 8) + *ptr; if(0) ASN_DEBUG("m=%.10f, scF=%d, bF=%d, expval=%d, ldexp()=%f, ldexp()=%f\n", m, scaleF, baseF, expval, ldexp(m, expval * baseF + scaleF), ldexp(m, scaleF) * pow(pow(2, baseF), expval) ); /* * (S * N * 2^F) * B^E * Essentially: m = ldexp(m, scaleF) * pow(pow(2, base), expval); */ m = ldexp(m, expval * baseF + scaleF); if(finite(m)) { *dbl_value = sign ? -m : m; } else { errno = ERANGE; return -1; } } /* if(binary_format) */ return 0; } /* * Assume IEEE 754 floating point: standard 64 bit double. * [1 bit sign] [11 bits exponent] [52 bits mantissa] */ int asn_double2REAL(REAL_t *st, double dbl_value) { #ifdef WORDS_BIGENDIAN /* Known to be big-endian */ int littleEndian = 0; #else /* need to test: have no explicit information */ unsigned int LE = 1; int littleEndian = *(unsigned char *)&LE; #endif uint8_t buf[16]; /* More than enough for 8-byte dbl_value */ uint8_t dscr[sizeof(dbl_value)]; /* double value scratch pad */ /* Assertion guards: won't even compile, if unexpected double size */ char assertion_buffer1[9 - sizeof(dbl_value)] GCC_NOTUSED; char assertion_buffer2[sizeof(dbl_value) - 7] GCC_NOTUSED; uint8_t *ptr = buf; uint8_t *mstop; /* Last byte of mantissa */ unsigned int mval; /* Value of the last byte of mantissa */ unsigned int bmsign; /* binary mask with sign */ unsigned int buflen; unsigned int accum; int expval; if(!st) { errno = EINVAL; return -1; } /* * ilogb(+-0) returns -INT_MAX or INT_MIN (platform-dependent) * ilogb(+-inf) returns INT_MAX, logb(+-inf) returns +inf * ilogb(NaN) returns INT_MIN or INT_MAX (platform-dependent) */ expval = ilogb(dbl_value); if(expval <= -INT_MAX /* Also catches +-0 and maybe isnan() */ || expval == INT_MAX /* catches isfin() and maybe isnan() */ ) { if(!st->buf || st->size < 2) { ptr = (uint8_t *)MALLOC(2); if(!ptr) return -1; st->buf = ptr; } /* fpclassify(3) is not portable yet */ if(isnan(dbl_value)) { st->buf[0] = 0x42; /* NaN */ st->buf[1] = 0; st->size = 1; } else if(!finite(dbl_value)) { if(copysign(1.0, dbl_value) < 0.0) { st->buf[0] = 0x41; /* MINUS-INFINITY */ } else { st->buf[0] = 0x40; /* PLUS-INFINITY */ } st->buf[1] = 0; st->size = 1; } else { if(copysign(1.0, dbl_value) >= 0.0) { /* no content octets: positive zero */ st->buf[0] = 0; /* JIC */ st->size = 0; } else { /* Negative zero. #8.5.3, 8.5.9 */ st->buf[0] = 0x43; st->size = 1; } } return 0; } if(littleEndian) { uint8_t *s = ((uint8_t *)&dbl_value) + sizeof(dbl_value) - 2; uint8_t *start = ((uint8_t *)&dbl_value); uint8_t *d; bmsign = 0x80 | ((s[1] >> 1) & 0x40); /* binary mask & - */ for(mstop = d = dscr; s >= start; d++, s--) { *d = *s; if(*d) mstop = d; } } else { uint8_t *s = ((uint8_t *)&dbl_value) + 1; uint8_t *end = ((uint8_t *)&dbl_value) + sizeof(double); uint8_t *d; bmsign = 0x80 | ((s[-1] >> 1) & 0x40); /* binary mask & - */ for(mstop = d = dscr; s < end; d++, s++) { *d = *s; if(*d) mstop = d; } } /* Remove parts of the exponent, leave mantissa and explicit 1. */ dscr[0] = 0x10 | (dscr[0] & 0x0f); /* Adjust exponent in a very unobvious way */ expval -= 8 * ((mstop - dscr) + 1) - 4; /* This loop ensures DER conformance by forcing mantissa odd: 11.3.1 */ mval = *mstop; if(mval && !(mval & 1)) { unsigned int shift_count = 1; unsigned int ishift; uint8_t *mptr; /* * Figure out what needs to be done to make mantissa odd. */ if(!(mval & 0x0f)) /* Speed-up a little */ shift_count = 4; while(((mval >> shift_count) & 1) == 0) shift_count++; ishift = 8 - shift_count; accum = 0; /* Go over the buffer, shifting it shift_count bits right. */ for(mptr = dscr; mptr <= mstop; mptr++) { mval = *mptr; *mptr = accum | (mval >> shift_count); accum = mval << ishift; } /* Adjust exponent appropriately. */ expval += shift_count; } if(expval < 0) { if((expval >> 7) == -1) { *ptr++ = bmsign | 0x00; *ptr++ = expval; } else if((expval >> 15) == -1) { *ptr++ = bmsign | 0x01; *ptr++ = expval >> 8; *ptr++ = expval; } else { *ptr++ = bmsign | 0x02; *ptr++ = expval >> 16; *ptr++ = expval >> 8; *ptr++ = expval; } } else if(expval <= 0x7f) { *ptr++ = bmsign | 0x00; *ptr++ = expval; } else if(expval <= 0x7fff) { *ptr++ = bmsign | 0x01; *ptr++ = expval >> 8; *ptr++ = expval; } else { assert(expval <= 0x7fffff); *ptr++ = bmsign | 0x02; *ptr++ = expval >> 16; *ptr++ = expval >> 8; *ptr++ = expval; } buflen = (mstop - dscr) + 1; memcpy(ptr, dscr, buflen); ptr += buflen; buflen = ptr - buf; ptr = (uint8_t *)MALLOC(buflen + 1); if(!ptr) return -1; memcpy(ptr, buf, buflen); buf[buflen] = 0; /* JIC */ if(st->buf) FREEMEM(st->buf); st->buf = ptr; st->size = buflen; return 0; } asn1c-0.9.24+dfsg/skeletons/standard-modules/0000755000000000000000000000000012223077270017507 5ustar rootrootasn1c-0.9.24+dfsg/skeletons/standard-modules/ASN1C-UsefulInformationObjectClasses.asn10000644000000000000000000000161311461145256027220 0ustar rootroot/* * This specification contains pervasive ASN.1 information object classes. * These classes are defined as "useful", and are available in any module * without the necessity for explicit import. */ ASN1C-UsefulInformationObjectClasses { iso(1) org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) standard-modules(3) auto-imported(0) 1 } DEFINITIONS ::= BEGIN /* * X.681-0207, Annex A * The TYPE-IDENTIFIER information object class */ TYPE-IDENTIFIER ::= CLASS { &id OBJECT IDENTIFIER UNIQUE, &Type } WITH SYNTAX { &Type IDENTIFIED BY &id } /* * X.681-0207, Annex B * The ABSTRACT-SYNTAX information object class */ ABSTRACT-SYNTAX ::= CLASS { &id OBJECT IDENTIFIER UNIQUE, &Type, &property BIT STRING { handles-invalid-encodings(0) } DEFAULT {} } WITH SYNTAX { &Type IDENTIFIED BY &id [HAS PROPERTY &property] } END asn1c-0.9.24+dfsg/skeletons/standard-modules/README0000644000000000000000000000020111461145256020363 0ustar rootrootAll *.asn1 files in this directory will be automatically picked up by the asn1c during compilation of any user specified module. asn1c-0.9.24+dfsg/skeletons/standard-modules/Makefile.in0000644000000000000000000002707212121076150021555 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = skeletons/standard-modules DIST_COMMON = README $(dist_smods_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(smodsdir)" DATA = $(dist_smods_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ smodsdir = $(pkgdatadir)/standard-modules dist_smods_DATA = \ $(srcdir)/*.asn1 \ $(srcdir)/README all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign skeletons/standard-modules/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign skeletons/standard-modules/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_smodsDATA: $(dist_smods_DATA) @$(NORMAL_INSTALL) test -z "$(smodsdir)" || $(MKDIR_P) "$(DESTDIR)$(smodsdir)" @list='$(dist_smods_DATA)'; test -n "$(smodsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(smodsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(smodsdir)" || exit $$?; \ done uninstall-dist_smodsDATA: @$(NORMAL_UNINSTALL) @list='$(dist_smods_DATA)'; test -n "$(smodsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(smodsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(smodsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(smodsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_smodsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_smodsDATA uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dist_smodsDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-dist_smodsDATA \ uninstall-local uninstall-local: -@echo -n " " -rm -f -r $(DESTDIR)$(smodsdir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/skeletons/standard-modules/ASN1-Object-Identifier-Module.asn10000644000000000000000000000431311461145256025510 0ustar rootrootASN1-Object-Identifier-Module { joint-iso-itu-t asn1(1) specification(0) modules(0) object-identifiers(1) } DEFINITIONS ::= BEGIN -- NumericString ASN.1 type (see 37.3) -- numericString OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) specification(0) characterStrings(1) numericString(0) } -- PrintableString ASN.1 type (see 37.5) -- printableString OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) specification(0) characterStrings(1) printableString(1) } -- ASN.1 Character Module (see 38.1) -- asn1CharacterModule OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) specification(0) modules(0) iso10646(0) } -- ASN.1 Object Identifier Module (this module) -- asn1ObjectIdentifierModule OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) specification(0) modules(0) object-identifiers(1) } -- BER encoding of a single ASN.1 type -- ber OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) basic-encoding(1) } -- CER encoding of a single ASN.1 type -- cer OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) ber-derived(2) canonical-encoding(0) } -- DER encoding of a single ASN.1 type -- der OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) ber-derived(2) distinguished-encoding(1) } -- PER encoding of a single ASN.1 type (basic aligned) -- perBasicAligned OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) packed-encoding(3) basic(0) aligned(0) } -- PER encoding of a single ASN.1 type (basic unaligned) -- perBasicUnaligned OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) packed-encoding(3) basic(0) unaligned(1) } -- PER encoding of a single ASN.1 type (canonical aligned) -- perCanonicalAligned OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) packed-encoding(3) canonical(1) aligned(0) } -- PER encoding of a single ASN.1 type (canonical unaligned) -- perCanonicalUnaligned OBJECT IDENTIFIER ::= { joint-iso-itu-t asn1(1) packed-encoding(3) canonical(1) unaligned(1) } -- XER encoding of a single ASN.1 type (basic) -- xerBasic OBJECT IDENTIFIER ::= {joint-iso-itu-t asn1(1) xml-encoding(5) basic(0) } -- XER encoding of a single ASN.1 type (canonical) -- xerCanonical OBJECT IDENTIFIER ::= {joint-iso-itu-t asn1(1) xml-encoding(5) canonical(1) } END -- ASN1-Object-Identifier-Module -- asn1c-0.9.24+dfsg/skeletons/standard-modules/Makefile.am0000644000000000000000000000025611461145256021551 0ustar rootroot smodsdir = $(pkgdatadir)/standard-modules dist_smods_DATA = \ $(srcdir)/*.asn1 \ $(srcdir)/README uninstall-local: -@echo -n " " -rm -f -r $(DESTDIR)$(smodsdir) asn1c-0.9.24+dfsg/skeletons/constr_TYPE.h0000644000000000000000000001505611502527550016572 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005, 2006 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * This file contains the declaration structure called "ASN.1 Type Definition", * which holds all information necessary for encoding and decoding routines. * This structure even contains pointer to these encoding and decoding routines * for each defined ASN.1 type. */ #ifndef _CONSTR_TYPE_H_ #define _CONSTR_TYPE_H_ #include #include #ifdef __cplusplus extern "C" { #endif struct asn_TYPE_descriptor_s; /* Forward declaration */ struct asn_TYPE_member_s; /* Forward declaration */ /* * This type provides the context information for various ASN.1 routines, * primarily ones doing decoding. A member _asn_ctx of this type must be * included into certain target language's structures, such as compound types. */ typedef struct asn_struct_ctx_s { short phase; /* Decoding phase */ short step; /* Elementary step of a phase */ int context; /* Other context information */ void *ptr; /* Decoder-specific stuff (stack elements) */ ber_tlv_len_t left; /* Number of bytes left, -1 for indefinite */ } asn_struct_ctx_t; #include /* Basic Encoding Rules decoder */ #include /* Distinguished Encoding Rules encoder */ #include /* Decoder of XER (XML, text) */ #include /* Encoder into XER (XML, text) */ #include /* Packet Encoding Rules decoder */ #include /* Packet Encoding Rules encoder */ #include /* Subtype constraints support */ /* * Free the structure according to its specification. * If (free_contents_only) is set, the wrapper structure itself (struct_ptr) * will not be freed. (It may be useful in case the structure is allocated * statically or arranged on the stack, yet its elements are allocated * dynamically.) */ typedef void (asn_struct_free_f)( struct asn_TYPE_descriptor_s *type_descriptor, void *struct_ptr, int free_contents_only); #define ASN_STRUCT_FREE(asn_DEF, ptr) (asn_DEF).free_struct(&(asn_DEF),ptr,0) #define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \ (asn_DEF).free_struct(&(asn_DEF),ptr,1) /* * Print the structure according to its specification. */ typedef int (asn_struct_print_f)( struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, int level, /* Indentation level */ asn_app_consume_bytes_f *callback, void *app_key); /* * Return the outmost tag of the type. * If the type is untagged CHOICE, the dynamic operation is performed. * NOTE: This function pointer type is only useful internally. * Do not use it in your application. */ typedef ber_tlv_tag_t (asn_outmost_tag_f)( struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag); /* The instance of the above function type; used internally. */ asn_outmost_tag_f asn_TYPE_outmost_tag; /* * The definitive description of the destination language's structure. */ typedef struct asn_TYPE_descriptor_s { char *name; /* A name of the ASN.1 type. "" in some cases. */ char *xml_tag; /* Name used in XML tag */ /* * Generalized functions for dealing with the specific type. * May be directly invoked by applications. */ asn_struct_free_f *free_struct; /* Free the structure */ asn_struct_print_f *print_struct; /* Human readable output */ asn_constr_check_f *check_constraints; /* Constraints validator */ ber_type_decoder_f *ber_decoder; /* Generic BER decoder */ der_type_encoder_f *der_encoder; /* Canonical DER encoder */ xer_type_decoder_f *xer_decoder; /* Generic XER decoder */ xer_type_encoder_f *xer_encoder; /* [Canonical] XER encoder */ per_type_decoder_f *uper_decoder; /* Unaligned PER decoder */ per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */ /*********************************************************************** * Internally useful members. Not to be used by applications directly. * **********************************************************************/ /* * Tags that are expected to occur. */ asn_outmost_tag_f *outmost_tag; /* */ ber_tlv_tag_t *tags; /* Effective tags sequence for this type */ int tags_count; /* Number of tags which are expected */ ber_tlv_tag_t *all_tags;/* Every tag for BER/containment */ int all_tags_count; /* Number of tags */ asn_per_constraints_t *per_constraints; /* PER compiled constraints */ /* * An ASN.1 production type members (members of SEQUENCE, SET, CHOICE). */ struct asn_TYPE_member_s *elements; int elements_count; /* * Additional information describing the type, used by appropriate * functions above. */ void *specifics; } asn_TYPE_descriptor_t; /* * This type describes an element of the constructed type, * i.e. SEQUENCE, SET, CHOICE, etc. */ enum asn_TYPE_flags_e { ATF_NOFLAGS, ATF_POINTER = 0x01, /* Represented by the pointer */ ATF_OPEN_TYPE = 0x02 /* ANY type, without meaningful tag */ }; typedef struct asn_TYPE_member_s { enum asn_TYPE_flags_e flags; /* Element's presentation flags */ int optional; /* Following optional members, including current */ int memb_offset; /* Offset of the element */ ber_tlv_tag_t tag; /* Outmost (most immediate) tag */ int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */ asn_TYPE_descriptor_t *type; /* Member type descriptor */ asn_constr_check_f *memb_constraints; /* Constraints validator */ asn_per_constraints_t *per_constraints; /* PER compiled constraints */ int (*default_value)(int setval, void **sptr); /* DEFAULT */ char *name; /* ASN.1 identifier of the element */ } asn_TYPE_member_t; /* * BER tag to element number mapping. */ typedef struct asn_TYPE_tag2member_s { ber_tlv_tag_t el_tag; /* Outmost tag of the member */ int el_no; /* Index of the associated member, base 0 */ int toff_first; /* First occurence of the el_tag, relative */ int toff_last; /* Last occurence of the el_tag, relatvie */ } asn_TYPE_tag2member_t; /* * This function is a wrapper around (td)->print_struct, which prints out * the contents of the target language's structure (struct_ptr) into the * file pointer (stream) in human readable form. * RETURN VALUES: * 0: The structure is printed. * -1: Problem dumping the structure. * (See also xer_fprint() in xer_encoder.h) */ int asn_fprint(FILE *stream, /* Destination stream descriptor */ asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */ const void *struct_ptr); /* Structure to be printed */ #ifdef __cplusplus } #endif #endif /* _CONSTR_TYPE_H_ */ asn1c-0.9.24+dfsg/skeletons/T61String.c0000644000000000000000000000217411502527550016152 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * T61String basic type description. */ static ber_tlv_tag_t asn_DEF_T61String_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (20 << 2)), /* [UNIVERSAL 20] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; asn_TYPE_descriptor_t asn_DEF_T61String = { "T61String", "T61String", OCTET_STRING_free, OCTET_STRING_print, /* non-ascii string */ asn_generic_unknown_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_hex, OCTET_STRING_encode_xer, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_T61String_tags, sizeof(asn_DEF_T61String_tags) / sizeof(asn_DEF_T61String_tags[0]) - 1, asn_DEF_T61String_tags, sizeof(asn_DEF_T61String_tags) / sizeof(asn_DEF_T61String_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/skeletons/OBJECT_IDENTIFIER.c0000644000000000000000000004601412121074316017055 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include #include #include /* for CHAR_BIT */ #include /* * OBJECT IDENTIFIER basic type description. */ static ber_tlv_tag_t asn_DEF_OBJECT_IDENTIFIER_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)) }; asn_TYPE_descriptor_t asn_DEF_OBJECT_IDENTIFIER = { "OBJECT IDENTIFIER", "OBJECT_IDENTIFIER", ASN__PRIMITIVE_TYPE_free, OBJECT_IDENTIFIER_print, OBJECT_IDENTIFIER_constraint, ber_decode_primitive, der_encode_primitive, OBJECT_IDENTIFIER_decode_xer, OBJECT_IDENTIFIER_encode_xer, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_OBJECT_IDENTIFIER_tags, sizeof(asn_DEF_OBJECT_IDENTIFIER_tags) / sizeof(asn_DEF_OBJECT_IDENTIFIER_tags[0]), asn_DEF_OBJECT_IDENTIFIER_tags, /* Same as above */ sizeof(asn_DEF_OBJECT_IDENTIFIER_tags) / sizeof(asn_DEF_OBJECT_IDENTIFIER_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; int OBJECT_IDENTIFIER_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr; if(st && st->buf) { if(st->size < 1) { _ASN_CTFAIL(app_key, td, sptr, "%s: at least one numerical value " "expected (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } else { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } return 0; } int OBJECT_IDENTIFIER_get_single_arc(uint8_t *arcbuf, unsigned int arclen, signed int add, void *rvbufp, unsigned int rvsize) { unsigned LE GCC_NOTUSED = 1; /* Little endian (x86) */ uint8_t *arcend = arcbuf + arclen; /* End of arc */ unsigned int cache = 0; /* No more than 14 significant bits */ unsigned char *rvbuf = (unsigned char *)rvbufp; unsigned char *rvstart = rvbuf; /* Original start of the value buffer */ int inc; /* Return value growth direction */ rvsize *= CHAR_BIT; /* bytes to bits */ arclen *= 7; /* bytes to bits */ /* * The arc has the number of bits * cannot be represented using supplied return value type. */ if(arclen > rvsize) { if(arclen > (rvsize + CHAR_BIT)) { errno = ERANGE; /* Overflow */ return -1; } else { /* * Even if the number of bits in the arc representation * is higher than the width of supplied * return value * type, there is still possible to fit it when there * are few unused high bits in the arc value * representaion. * * Moreover, there is a possibility that the * number could actually fit the arc space, given * that add is negative, but we don't handle * such "temporary lack of precision" situation here. * May be considered as a bug. */ uint8_t mask = (0xff << (7-(arclen - rvsize))) & 0x7f; if((*arcbuf & mask)) { errno = ERANGE; /* Overflow */ return -1; } /* Fool the routine computing unused bits */ arclen -= 7; cache = *arcbuf & 0x7f; arcbuf++; } } /* Faster path for common size */ if(rvsize == (CHAR_BIT * sizeof(unsigned long))) { unsigned long accum; /* Gather all bits into the accumulator */ for(accum = cache; arcbuf < arcend; arcbuf++) accum = (accum << 7) | (*arcbuf & ~0x80); if(accum < (unsigned)-add) { errno = ERANGE; /* Overflow */ return -1; } *(unsigned long *)rvbuf = accum + add; /* alignment OK! */ return 0; } #ifndef WORDS_BIGENDIAN if(*(unsigned char *)&LE) { /* Little endian (x86) */ /* "Convert" to big endian */ rvbuf += rvsize / CHAR_BIT - 1; rvstart--; inc = -1; /* Descending */ } else #endif /* !WORDS_BIGENDIAN */ inc = +1; /* Big endian is known [at compile time] */ { int bits; /* typically no more than 3-4 bits */ /* Clear the high unused bits */ for(bits = rvsize - arclen; bits > CHAR_BIT; rvbuf += inc, bits -= CHAR_BIT) *rvbuf = 0; /* Fill the body of a value */ for(; arcbuf < arcend; arcbuf++) { cache = (cache << 7) | (*arcbuf & 0x7f); bits += 7; if(bits >= CHAR_BIT) { bits -= CHAR_BIT; *rvbuf = (cache >> bits); rvbuf += inc; } } if(bits) { *rvbuf = cache; rvbuf += inc; } } if(add) { for(rvbuf -= inc; rvbuf != rvstart; rvbuf -= inc) { int v = add + *rvbuf; if(v & (-1 << CHAR_BIT)) { *rvbuf = (unsigned char)(v + (1 << CHAR_BIT)); add = -1; } else { *rvbuf = v; break; } } if(rvbuf == rvstart) { /* No space to carry over */ errno = ERANGE; /* Overflow */ return -1; } } return 0; } ssize_t OBJECT_IDENTIFIER__dump_arc(uint8_t *arcbuf, int arclen, int add, asn_app_consume_bytes_f *cb, void *app_key) { char scratch[64]; /* Conservative estimate */ unsigned long accum; /* Bits accumulator */ char *p; /* Position in the scratch buffer */ if(OBJECT_IDENTIFIER_get_single_arc(arcbuf, arclen, add, &accum, sizeof(accum))) return -1; if(accum) { ssize_t len; /* Fill the scratch buffer in reverse. */ p = scratch + sizeof(scratch); for(; accum; accum /= 10) *(--p) = (char)(accum % 10) + 0x30; /* Put a digit */ len = sizeof(scratch) - (p - scratch); if(cb(p, len, app_key) < 0) return -1; return len; } else { *scratch = 0x30; if(cb(scratch, 1, app_key) < 0) return -1; return 1; } } int OBJECT_IDENTIFIER_print_arc(uint8_t *arcbuf, int arclen, int add, asn_app_consume_bytes_f *cb, void *app_key) { if(OBJECT_IDENTIFIER__dump_arc(arcbuf, arclen, add, cb, app_key) < 0) return -1; return 0; } static ssize_t OBJECT_IDENTIFIER__dump_body(const OBJECT_IDENTIFIER_t *st, asn_app_consume_bytes_f *cb, void *app_key) { ssize_t wrote_len = 0; int startn; int add = 0; int i; for(i = 0, startn = 0; i < st->size; i++) { uint8_t b = st->buf[i]; if((b & 0x80)) /* Continuation expected */ continue; if(startn == 0) { /* * First two arcs are encoded through the backdoor. */ if(i) { add = -80; if(cb("2", 1, app_key) < 0) return -1; } else if(b <= 39) { add = 0; if(cb("0", 1, app_key) < 0) return -1; } else if(b < 79) { add = -40; if(cb("1", 1, app_key) < 0) return -1; } else { add = -80; if(cb("2", 1, app_key) < 0) return -1; } wrote_len += 1; } if(cb(".", 1, app_key) < 0) /* Separate arcs */ return -1; add = OBJECT_IDENTIFIER__dump_arc(&st->buf[startn], i - startn + 1, add, cb, app_key); if(add < 0) return -1; wrote_len += 1 + add; startn = i + 1; add = 0; } return wrote_len; } static enum xer_pbd_rval OBJECT_IDENTIFIER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_buf, size_t chunk_size) { OBJECT_IDENTIFIER_t *st = (OBJECT_IDENTIFIER_t *)sptr; const char *chunk_end = (const char *)chunk_buf + chunk_size; const char *endptr; long s_arcs[10]; long *arcs = s_arcs; int arcs_count; int ret; (void)td; arcs_count = OBJECT_IDENTIFIER_parse_arcs( (const char *)chunk_buf, chunk_size, arcs, sizeof(s_arcs)/sizeof(s_arcs[0]), &endptr); if(arcs_count < 0) { /* Expecting more than zero arcs */ return XPBD_BROKEN_ENCODING; } else if(arcs_count == 0) { return XPBD_NOT_BODY_IGNORE; } assert(endptr == chunk_end); if((size_t)arcs_count > sizeof(s_arcs)/sizeof(s_arcs[0])) { arcs = (long *)MALLOC(arcs_count * sizeof(long)); if(!arcs) return XPBD_SYSTEM_FAILURE; ret = OBJECT_IDENTIFIER_parse_arcs( (const char *)chunk_buf, chunk_size, arcs, arcs_count, &endptr); if(ret != arcs_count) return XPBD_SYSTEM_FAILURE; /* assert?.. */ } /* * Convert arcs into BER representation. */ ret = OBJECT_IDENTIFIER_set_arcs(st, arcs, sizeof(*arcs), arcs_count); if(arcs != s_arcs) FREEMEM(arcs); return ret ? XPBD_SYSTEM_FAILURE : XPBD_BODY_CONSUMED; } asn_dec_rval_t OBJECT_IDENTIFIER_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { return xer_decode_primitive(opt_codec_ctx, td, sptr, sizeof(OBJECT_IDENTIFIER_t), opt_mname, buf_ptr, size, OBJECT_IDENTIFIER__xer_body_decode); } asn_enc_rval_t OBJECT_IDENTIFIER_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr; asn_enc_rval_t er; (void)ilevel; (void)flags; if(!st || !st->buf) _ASN_ENCODE_FAILED; er.encoded = OBJECT_IDENTIFIER__dump_body(st, cb, app_key); if(er.encoded < 0) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } int OBJECT_IDENTIFIER_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(!st || !st->buf) return (cb("", 8, app_key) < 0) ? -1 : 0; /* Dump preamble */ if(cb("{ ", 2, app_key) < 0) return -1; if(OBJECT_IDENTIFIER__dump_body(st, cb, app_key) < 0) return -1; return (cb(" }", 2, app_key) < 0) ? -1 : 0; } int OBJECT_IDENTIFIER_get_arcs(OBJECT_IDENTIFIER_t *oid, void *arcs, unsigned int arc_type_size, unsigned int arc_slots) { void *arcs_end = (char *)arcs + (arc_type_size * arc_slots); int num_arcs = 0; int startn = 0; int add = 0; int i; if(!oid || !oid->buf || (arc_slots && arc_type_size <= 1)) { errno = EINVAL; return -1; } for(i = 0; i < oid->size; i++) { uint8_t b = oid->buf[i]; if((b & 0x80)) /* Continuation expected */ continue; if(num_arcs == 0) { /* * First two arcs are encoded through the backdoor. */ unsigned LE = 1; /* Little endian */ int first_arc; num_arcs++; if(!arc_slots) { num_arcs++; continue; } if(i) first_arc = 2; else if(b <= 39) first_arc = 0; else if(b < 79) first_arc = 1; else first_arc = 2; add = -40 * first_arc; memset(arcs, 0, arc_type_size); *(unsigned char *)((char *)arcs + ((*(char *)&LE)?0:(arc_type_size - 1))) = first_arc; arcs = ((char *)arcs) + arc_type_size; } /* Decode, if has space */ if(arcs < arcs_end) { if(OBJECT_IDENTIFIER_get_single_arc(&oid->buf[startn], i - startn + 1, add, arcs, arc_type_size)) return -1; startn = i + 1; arcs = ((char *)arcs) + arc_type_size; add = 0; } num_arcs++; } return num_arcs; } /* * Save the single value as an object identifier arc. */ int OBJECT_IDENTIFIER_set_single_arc(uint8_t *arcbuf, const void *arcval, unsigned int arcval_size, int prepared_order) { /* * The following conditions must hold: * assert(arcval); * assert(arcval_size > 0); * assert(arcval_size <= 16); * assert(arcbuf); */ #ifdef WORDS_BIGENDIAN const unsigned isLittleEndian = 0; #else unsigned LE = 1; unsigned isLittleEndian = *(char *)&LE; #endif const uint8_t *tend, *tp; unsigned int cache; uint8_t *bp = arcbuf; int bits; uint8_t buffer[16]; if(isLittleEndian && !prepared_order) { const uint8_t *a = (const unsigned char *)arcval + arcval_size - 1; const uint8_t *aend = (const uint8_t *)arcval; uint8_t *msb = buffer + arcval_size - 1; uint8_t *tb; for(tb = buffer; a >= aend; tb++, a--) if((*tb = *a) && (tb < msb)) msb = tb; tend = &buffer[arcval_size]; tp = msb; /* Most significant non-zero byte */ } else { /* Look for most significant non-zero byte */ tend = (const unsigned char *)arcval + arcval_size; for(tp = (const uint8_t *)arcval; tp < tend - 1; tp++) if(*tp) break; } /* * Split the value in 7-bits chunks. */ bits = ((tend - tp) * CHAR_BIT) % 7; if(bits) { cache = *tp >> (CHAR_BIT - bits); if(cache) { *bp++ = cache | 0x80; cache = *tp++; bits = CHAR_BIT - bits; } else { bits = -bits; } } else { cache = 0; } for(; tp < tend; tp++) { cache = (cache << CHAR_BIT) + *tp; bits += CHAR_BIT; while(bits >= 7) { bits -= 7; *bp++ = 0x80 | (cache >> bits); } } if(bits) *bp++ = cache; bp[-1] &= 0x7f; /* Clear the last bit */ return bp - arcbuf; } int OBJECT_IDENTIFIER_set_arcs(OBJECT_IDENTIFIER_t *oid, const void *arcs, unsigned int arc_type_size, unsigned int arc_slots) { uint8_t *buf; uint8_t *bp; unsigned LE = 1; /* Little endian (x86) */ unsigned isLittleEndian = *((char *)&LE); unsigned int arc0; unsigned int arc1; unsigned size; unsigned i; if(!oid || !arcs || arc_type_size < 1 || arc_type_size > 16 || arc_slots < 2) { errno = EINVAL; return -1; } switch(arc_type_size) { case sizeof(char): arc0 = ((const unsigned char *)arcs)[0]; arc1 = ((const unsigned char *)arcs)[1]; break; case sizeof(short): arc0 = ((const unsigned short *)arcs)[0]; arc1 = ((const unsigned short *)arcs)[1]; break; case sizeof(int): arc0 = ((const unsigned int *)arcs)[0]; arc1 = ((const unsigned int *)arcs)[1]; break; default: arc1 = arc0 = 0; if(isLittleEndian) { /* Little endian (x86) */ const unsigned char *ps, *pe; /* If more significant bytes are present, * make them > 255 quick */ for(ps = (const unsigned char *)arcs + 1, pe = ps+arc_type_size; ps < pe; ps++) arc0 |= *ps, arc1 |= *(ps + arc_type_size); arc0 <<= CHAR_BIT, arc1 <<= CHAR_BIT; arc0 = *((const unsigned char *)arcs + 0); arc1 = *((const unsigned char *)arcs + arc_type_size); } else { const unsigned char *ps, *pe; /* If more significant bytes are present, * make them > 255 quick */ for(ps = (const unsigned char *)arcs, pe = ps+arc_type_size - 1; ps < pe; ps++) arc0 |= *ps, arc1 |= *(ps + arc_type_size); arc0 = *((const unsigned char *)arcs + arc_type_size - 1); arc1 = *((const unsigned char *)arcs +(arc_type_size<< 1)-1); } } /* * The previous chapter left us with the first and the second arcs. * The values are not precise (that is, they are valid only if * they're less than 255), but OK for the purposes of making * the sanity test below. */ if(arc0 <= 1) { if(arc1 >= 39) { /* 8.19.4: At most 39 subsequent values (including 0) */ errno = ERANGE; return -1; } } else if(arc0 > 2) { /* 8.19.4: Only three values are allocated from the root node */ errno = ERANGE; return -1; } /* * After above tests it is known that the value of arc0 is completely * trustworthy (0..2). However, the arc1's value is still meaningless. */ /* * Roughly estimate the maximum size necessary to encode these arcs. * This estimation implicitly takes in account the following facts, * that cancel each other: * * the first two arcs are encoded in a single value. * * the first value may require more space (+1 byte) * * the value of the first arc which is in range (0..2) */ size = ((arc_type_size * CHAR_BIT + 6) / 7) * arc_slots; bp = buf = (uint8_t *)MALLOC(size + 1); if(!buf) { /* ENOMEM */ return -1; } /* * Encode the first two arcs. * These require special treatment. */ { uint8_t *tp; uint8_t first_value[1 + 16]; /* of two arcs */ uint8_t *fv = first_value; /* * Simulate first_value = arc0 * 40 + arc1; */ /* Copy the second (1'st) arcs[1] into the first_value */ *fv++ = 0; arcs = ((const char *)arcs) + arc_type_size; if(isLittleEndian) { const uint8_t *aend = (const unsigned char *)arcs - 1; const uint8_t *a1 = (const unsigned char *)arcs + arc_type_size - 1; for(; a1 > aend; fv++, a1--) *fv = *a1; } else { const uint8_t *a1 = (const uint8_t *)arcs; const uint8_t *aend = a1 + arc_type_size; for(; a1 < aend; fv++, a1++) *fv = *a1; } /* Increase the first_value by arc0 */ arc0 *= 40; /* (0..80) */ for(tp = first_value + arc_type_size; tp >= first_value; tp--) { unsigned int v = *tp; v += arc0; *tp = v; if(v >= (1 << CHAR_BIT)) arc0 = v >> CHAR_BIT; else break; } assert(tp >= first_value); bp += OBJECT_IDENTIFIER_set_single_arc(bp, first_value, fv - first_value, 1); } /* * Save the rest of arcs. */ for(arcs = ((const char *)arcs) + arc_type_size, i = 2; i < arc_slots; i++, arcs = ((const char *)arcs) + arc_type_size) { bp += OBJECT_IDENTIFIER_set_single_arc(bp, arcs, arc_type_size, 0); } assert((unsigned)(bp - buf) <= size); /* * Replace buffer. */ oid->size = bp - buf; bp = oid->buf; oid->buf = buf; if(bp) FREEMEM(bp); return 0; } int OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length, long *arcs, unsigned int arcs_slots, const char **opt_oid_text_end) { unsigned int arcs_count = 0; const char *oid_end; enum { ST_LEADSPACE, ST_TAILSPACE, ST_AFTERVALUE, /* Next character ought to be '.' or a space */ ST_WAITDIGITS, /* Next character is expected to be a digit */ } state = ST_LEADSPACE; if(!oid_text || oid_txt_length < -1 || (arcs_slots && !arcs)) { if(opt_oid_text_end) *opt_oid_text_end = oid_text; errno = EINVAL; return -1; } if(oid_txt_length == -1) oid_txt_length = strlen(oid_text); #define _OID_CAPTURE_ARC(oid_text, oid_end) do { \ const char *endp = oid_end; \ long value; \ switch(asn_strtol_lim(oid_text, &endp, &value)) { \ case ASN_STRTOL_EXTRA_DATA: \ case ASN_STRTOL_OK: \ if(arcs_count < arcs_slots) \ arcs[arcs_count] = value; \ arcs_count++; \ oid_text = endp - 1; \ break; \ case ASN_STRTOL_ERROR_RANGE: \ if(opt_oid_text_end) \ *opt_oid_text_end = oid_text; \ errno = ERANGE; \ return -1; \ case ASN_STRTOL_ERROR_INVAL: \ case ASN_STRTOL_EXPECT_MORE: \ if(opt_oid_text_end) \ *opt_oid_text_end = oid_text; \ errno = EINVAL; \ return -1; \ } \ } while(0) for(oid_end = oid_text + oid_txt_length; oid_text broken OID */ return -1; case ST_LEADSPACE: case ST_WAITDIGITS: _OID_CAPTURE_ARC(oid_text, oid_end); state = ST_AFTERVALUE; continue; } break; default: /* Unexpected symbols */ state = ST_WAITDIGITS; break; } /* switch() */ break; } /* for() */ if(opt_oid_text_end) *opt_oid_text_end = oid_text; /* Finalize last arc */ switch(state) { case ST_LEADSPACE: return 0; /* No OID found in input data */ case ST_WAITDIGITS: errno = EINVAL; /* Broken OID */ return -1; case ST_AFTERVALUE: case ST_TAILSPACE: return arcs_count; } errno = EINVAL; /* Broken OID */ return -1; } asn1c-0.9.24+dfsg/skeletons/ANY.c0000644000000000000000000000613011502527550015034 0ustar rootroot/*- * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include static asn_OCTET_STRING_specifics_t asn_DEF_ANY_specs = { sizeof(ANY_t), offsetof(ANY_t, _asn_ctx), ASN_OSUBV_ANY }; asn_TYPE_descriptor_t asn_DEF_ANY = { "ANY", "ANY", OCTET_STRING_free, OCTET_STRING_print, asn_generic_no_constraint, OCTET_STRING_decode_ber, OCTET_STRING_encode_der, OCTET_STRING_decode_xer_hex, ANY_encode_xer, 0, 0, 0, /* Use generic outmost tag fetcher */ 0, 0, 0, 0, 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_DEF_ANY_specs, }; asn_enc_rval_t ANY_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { if(flags & XER_F_CANONICAL) { /* * Canonical XER-encoding of ANY type is not supported. */ _ASN_ENCODE_FAILED; } /* Dump as binary */ return OCTET_STRING_encode_xer(td, sptr, ilevel, flags, cb, app_key); } struct _callback_arg { uint8_t *buffer; size_t offset; size_t size; }; static int ANY__consume_bytes(const void *buffer, size_t size, void *key); int ANY_fromType(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) { struct _callback_arg arg; asn_enc_rval_t erval; if(!st || !td) { errno = EINVAL; return -1; } if(!sptr) { if(st->buf) FREEMEM(st->buf); st->size = 0; return 0; } arg.offset = arg.size = 0; arg.buffer = 0; erval = der_encode(td, sptr, ANY__consume_bytes, &arg); if(erval.encoded == -1) { if(arg.buffer) FREEMEM(arg.buffer); return -1; } assert((size_t)erval.encoded == arg.offset); if(st->buf) FREEMEM(st->buf); st->buf = arg.buffer; st->size = arg.offset; return 0; } ANY_t * ANY_new_fromType(asn_TYPE_descriptor_t *td, void *sptr) { ANY_t tmp; ANY_t *st; if(!td || !sptr) { errno = EINVAL; return 0; } memset(&tmp, 0, sizeof(tmp)); if(ANY_fromType(&tmp, td, sptr)) return 0; st = (ANY_t *)CALLOC(1, sizeof(ANY_t)); if(st) { *st = tmp; return st; } else { FREEMEM(tmp.buf); return 0; } } int ANY_to_type(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) { asn_dec_rval_t rval; void *newst = 0; if(!st || !td || !struct_ptr) { errno = EINVAL; return -1; } if(st->buf == 0) { /* Nothing to convert, make it empty. */ *struct_ptr = (void *)0; return 0; } rval = ber_decode(0, td, (void **)&newst, st->buf, st->size); if(rval.code == RC_OK) { *struct_ptr = newst; return 0; } else { /* Remove possibly partially decoded data. */ ASN_STRUCT_FREE(*td, newst); return -1; } } static int ANY__consume_bytes(const void *buffer, size_t size, void *key) { struct _callback_arg *arg = (struct _callback_arg *)key; if((arg->offset + size) >= arg->size) { size_t nsize = (arg->size ? arg->size << 2 : 16) + size; void *p = REALLOC(arg->buffer, nsize); if(!p) return -1; arg->buffer = (uint8_t *)p; arg->size = nsize; } memcpy(arg->buffer + arg->offset, buffer, size); arg->offset += size; assert(arg->offset < arg->size); return 0; } asn1c-0.9.24+dfsg/skeletons/GeneralizedTime.c0000644000000000000000000003607412021472367017471 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #define _POSIX_PTHREAD_SEMANTICS /* for Sun */ #define _REENTRANT /* for Sun */ #include #include #include #ifdef __CYGWIN__ #include "/usr/include/time.h" #else #include #endif /* __CYGWIN__ */ #if defined(_WIN32) #pragma message( "PLEASE STOP AND READ!") #pragma message( " localtime_r is implemented via localtime(), which may be not thread-safe.") #pragma message( " gmtime_r is implemented via gmtime(), which may be not thread-safe.") #pragma message( " ") #pragma message( " You must fix the code by inserting appropriate locking") #pragma message( " if you want to use asn_GT2time() or asn_UT2time().") #pragma message( "PLEASE STOP AND READ!") static struct tm *localtime_r(const time_t *tloc, struct tm *result) { struct tm *tm; if((tm = localtime(tloc))) return memcpy(result, tm, sizeof(struct tm)); return 0; } static struct tm *gmtime_r(const time_t *tloc, struct tm *result) { struct tm *tm; if((tm = gmtime(tloc))) return memcpy(result, tm, sizeof(struct tm)); return 0; } #define tzset() _tzset() #define putenv(c) _putenv(c) #define _EMULATE_TIMEGM #endif /* _WIN32 */ #if defined(sun) || defined(_sun_) || defined(__solaris__) #define _EMULATE_TIMEGM #endif /* * Where to look for offset from GMT, Phase I. * Several platforms are known. */ #if defined(__FreeBSD__) \ || (defined(__GNUC__) && defined(__APPLE_CC__)) \ || (defined __GLIBC__ && __GLIBC__ >= 2) #undef HAVE_TM_GMTOFF #define HAVE_TM_GMTOFF #endif /* BSDs and newer glibc */ /* * Where to look for offset from GMT, Phase II. */ #ifdef HAVE_TM_GMTOFF #define GMTOFF(tm) ((tm).tm_gmtoff) #else /* HAVE_TM_GMTOFF */ #define GMTOFF(tm) (-timezone) #endif /* HAVE_TM_GMTOFF */ #if (defined(_EMULATE_TIMEGM) || !defined(HAVE_TM_GMTOFF)) #warning "PLEASE STOP AND READ!" #warning " timegm() is implemented via getenv(\"TZ\")/setenv(\"TZ\"), which may be not thread-safe." #warning " " #warning " You must fix the code by inserting appropriate locking" #warning " if you want to use asn_GT2time() or asn_UT2time()." #warning "PLEASE STOP AND READ!" #endif /* _EMULATE_TIMEGM */ /* * Override our GMTOFF decision for other known platforms. */ #ifdef __CYGWIN__ #undef GMTOFF static long GMTOFF(struct tm a){ struct tm *lt; time_t local_time, gmt_time; long zone; tzset(); gmt_time = time (NULL); lt = gmtime(&gmt_time); local_time = mktime(lt); return (gmt_time - local_time); } #define _EMULATE_TIMEGM #endif /* __CYGWIN__ */ #define ATZVARS do { \ char tzoldbuf[64]; \ char *tzold #define ATZSAVETZ do { \ tzold = getenv("TZ"); \ if(tzold) { \ size_t tzlen = strlen(tzold); \ if(tzlen < sizeof(tzoldbuf)) { \ tzold = memcpy(tzoldbuf, tzold, tzlen + 1); \ } else { \ char *dupptr = tzold; \ tzold = MALLOC(tzlen + 1); \ if(tzold) memcpy(tzold, dupptr, tzlen + 1); \ } \ setenv("TZ", "UTC", 1); \ } \ tzset(); \ } while(0) #define ATZOLDTZ do { \ if (tzold) { \ setenv("TZ", tzold, 1); \ *tzoldbuf = 0; \ if(tzold != tzoldbuf) \ FREEMEM(tzold); \ } else { \ unsetenv("TZ"); \ } \ tzset(); \ } while(0); } while(0); #ifdef _EMULATE_TIMEGM static time_t timegm(struct tm *tm) { time_t tloc; ATZVARS; ATZSAVETZ; tloc = mktime(tm); ATZOLDTZ; return tloc; } #endif /* _EMULATE_TIMEGM */ #ifndef __ASN_INTERNAL_TEST_MODE__ /* * GeneralizedTime basic type description. */ static ber_tlv_tag_t asn_DEF_GeneralizedTime_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (24 << 2)), /* [UNIVERSAL 24] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; static asn_per_constraints_t asn_DEF_GeneralizedTime_constraints = { { APC_CONSTRAINED, 7, 7, 0x20, 0x7e }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ 0, 0 }; asn_TYPE_descriptor_t asn_DEF_GeneralizedTime = { "GeneralizedTime", "GeneralizedTime", OCTET_STRING_free, GeneralizedTime_print, GeneralizedTime_constraint, /* Check validity of time */ OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ GeneralizedTime_encode_der, OCTET_STRING_decode_xer_utf8, GeneralizedTime_encode_xer, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_GeneralizedTime_tags, sizeof(asn_DEF_GeneralizedTime_tags) / sizeof(asn_DEF_GeneralizedTime_tags[0]) - 2, asn_DEF_GeneralizedTime_tags, sizeof(asn_DEF_GeneralizedTime_tags) / sizeof(asn_DEF_GeneralizedTime_tags[0]), &asn_DEF_GeneralizedTime_constraints, 0, 0, /* No members */ 0 /* No specifics */ }; #endif /* __ASN_INTERNAL_TEST_MODE__ */ /* * Check that the time looks like the time. */ int GeneralizedTime_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const GeneralizedTime_t *st = (const GeneralizedTime_t *)sptr; time_t tloc; errno = EPERM; /* Just an unlikely error code */ tloc = asn_GT2time(st, 0, 0); if(tloc == -1 && errno != EPERM) { _ASN_CTFAIL(app_key, td, sptr, "%s: Invalid time format: %s (%s:%d)", td->name, strerror(errno), __FILE__, __LINE__); return -1; } return 0; } asn_enc_rval_t GeneralizedTime_encode_der(asn_TYPE_descriptor_t *td, void *sptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { GeneralizedTime_t *st = (GeneralizedTime_t *)sptr; asn_enc_rval_t erval; int fv, fd; /* seconds fraction value and number of digits */ struct tm tm; time_t tloc; /* * Encode as a canonical DER. */ errno = EPERM; tloc = asn_GT2time_frac(st, &fv, &fd, &tm, 1); /* Recognize time */ if(tloc == -1 && errno != EPERM) /* Failed to recognize time. Fail completely. */ _ASN_ENCODE_FAILED; st = asn_time2GT_frac(0, &tm, fv, fd, 1); /* Save time canonically */ if(!st) _ASN_ENCODE_FAILED; /* Memory allocation failure. */ erval = OCTET_STRING_encode_der(td, st, tag_mode, tag, cb, app_key); FREEMEM(st->buf); FREEMEM(st); return erval; } #ifndef __ASN_INTERNAL_TEST_MODE__ asn_enc_rval_t GeneralizedTime_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { if(flags & XER_F_CANONICAL) { GeneralizedTime_t *gt; asn_enc_rval_t rv; int fv, fd; /* fractional parts */ struct tm tm; errno = EPERM; if(asn_GT2time_frac((GeneralizedTime_t *)sptr, &fv, &fd, &tm, 1) == -1 && errno != EPERM) _ASN_ENCODE_FAILED; gt = asn_time2GT_frac(0, &tm, fv, fd, 1); if(!gt) _ASN_ENCODE_FAILED; rv = OCTET_STRING_encode_xer_utf8(td, sptr, ilevel, flags, cb, app_key); ASN_STRUCT_FREE(asn_DEF_GeneralizedTime, gt); return rv; } else { return OCTET_STRING_encode_xer_utf8(td, sptr, ilevel, flags, cb, app_key); } } #endif /* __ASN_INTERNAL_TEST_MODE__ */ int GeneralizedTime_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const GeneralizedTime_t *st = (const GeneralizedTime_t *)sptr; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(st && st->buf) { char buf[32]; struct tm tm; int ret; errno = EPERM; if(asn_GT2time(st, &tm, 1) == -1 && errno != EPERM) return (cb("", 11, app_key) < 0) ? -1 : 0; ret = snprintf(buf, sizeof(buf), "%04d-%02d-%02d %02d:%02d:%02d (GMT)", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); assert(ret > 0 && ret < (int)sizeof(buf)); return (cb(buf, ret, app_key) < 0) ? -1 : 0; } else { return (cb("", 8, app_key) < 0) ? -1 : 0; } } time_t asn_GT2time(const GeneralizedTime_t *st, struct tm *ret_tm, int as_gmt) { return asn_GT2time_frac(st, 0, 0, ret_tm, as_gmt); } time_t asn_GT2time_prec(const GeneralizedTime_t *st, int *frac_value, int frac_digits, struct tm *ret_tm, int as_gmt) { time_t tloc; int fv, fd = 0; if(frac_value) tloc = asn_GT2time_frac(st, &fv, &fd, ret_tm, as_gmt); else return asn_GT2time_frac(st, 0, 0, ret_tm, as_gmt); if(fd == 0 || frac_digits <= 0) { *frac_value = 0; } else { while(fd > frac_digits) fv /= 10, fd--; while(fd < frac_digits) { if(fv < INT_MAX / 10) { fv *= 10; fd++; } else { /* Too long precision request */ fv = 0; break; } } *frac_value = fv; } return tloc; } time_t asn_GT2time_frac(const GeneralizedTime_t *st, int *frac_value, int *frac_digits, struct tm *ret_tm, int as_gmt) { struct tm tm_s; uint8_t *buf; uint8_t *end; int gmtoff_h = 0; int gmtoff_m = 0; int gmtoff = 0; /* h + m */ int offset_specified = 0; int fvalue = 0; int fdigits = 0; time_t tloc; if(!st || !st->buf) { errno = EINVAL; return -1; } else { buf = st->buf; end = buf + st->size; } if(st->size < 10) { errno = EINVAL; return -1; } /* * Decode first 10 bytes: "AAAAMMJJhh" */ memset(&tm_s, 0, sizeof(tm_s)); #undef B2F #undef B2T #define B2F(var) do { \ unsigned ch = *buf; \ if(ch < 0x30 || ch > 0x39) { \ errno = EINVAL; \ return -1; \ } else { \ var = var * 10 + (ch - 0x30); \ buf++; \ } \ } while(0) #define B2T(var) B2F(tm_s.var) B2T(tm_year); /* 1: A */ B2T(tm_year); /* 2: A */ B2T(tm_year); /* 3: A */ B2T(tm_year); /* 4: A */ B2T(tm_mon); /* 5: M */ B2T(tm_mon); /* 6: M */ B2T(tm_mday); /* 7: J */ B2T(tm_mday); /* 8: J */ B2T(tm_hour); /* 9: h */ B2T(tm_hour); /* 0: h */ if(buf == end) goto local_finish; /* * Parse [mm[ss[(.|,)ffff]]] * ^^ */ switch(*buf) { case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: tm_s.tm_min = (*buf++) - 0x30; if(buf == end) { errno = EINVAL; return -1; } B2T(tm_min); break; case 0x2B: case 0x2D: /* +, - */ goto offset; case 0x5A: /* Z */ goto utc_finish; default: errno = EINVAL; return -1; } if(buf == end) goto local_finish; /* * Parse [mm[ss[(.|,)ffff]]] * ^^ */ switch(*buf) { case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: tm_s.tm_sec = (*buf++) - 0x30; if(buf == end) { errno = EINVAL; return -1; } B2T(tm_sec); break; case 0x2B: case 0x2D: /* +, - */ goto offset; case 0x5A: /* Z */ goto utc_finish; default: errno = EINVAL; return -1; } if(buf == end) goto local_finish; /* * Parse [mm[ss[(.|,)ffff]]] * ^ ^ */ switch(*buf) { case 0x2C: case 0x2E: /* (.|,) */ /* * Process fractions of seconds. */ for(buf++; buf < end; buf++) { int v = *buf; /* GCC 4.x is being too smart without volatile */ switch(v) { case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: if(fvalue < INT_MAX/10) { fvalue = fvalue * 10 + (v - 0x30); fdigits++; } else { /* Not enough precision, ignore */ } continue; default: break; } break; } } if(buf == end) goto local_finish; switch(*buf) { case 0x2B: case 0x2D: /* +, - */ goto offset; case 0x5A: /* Z */ goto utc_finish; default: errno = EINVAL; return -1; } offset: if(end - buf < 3) { errno = EINVAL; return -1; } buf++; B2F(gmtoff_h); B2F(gmtoff_h); if(buf[-3] == 0x2D) /* Negative */ gmtoff = -1; else gmtoff = 1; if((end - buf) == 2) { B2F(gmtoff_m); B2F(gmtoff_m); } else if(end != buf) { errno = EINVAL; return -1; } gmtoff = gmtoff * (3600 * gmtoff_h + 60 * gmtoff_m); /* Fall through */ utc_finish: offset_specified = 1; /* Fall through */ local_finish: /* * Validation. */ if((tm_s.tm_mon > 12 || tm_s.tm_mon < 1) || (tm_s.tm_mday > 31 || tm_s.tm_mday < 1) || (tm_s.tm_hour > 23) || (tm_s.tm_sec > 60) ) { errno = EINVAL; return -1; } /* Canonicalize */ tm_s.tm_mon -= 1; /* 0 - 11 */ tm_s.tm_year -= 1900; tm_s.tm_isdst = -1; tm_s.tm_sec -= gmtoff; /*** AT THIS POINT tm_s is either GMT or local (unknown) ****/ if(offset_specified) { tloc = timegm(&tm_s); } else { /* * Without an offset (or "Z"), * we can only guess that it is a local zone. * Interpret it in this fashion. */ tloc = mktime(&tm_s); } if(tloc == -1) { errno = EINVAL; return -1; } if(ret_tm) { if(as_gmt) { if(offset_specified) { *ret_tm = tm_s; } else { if(gmtime_r(&tloc, ret_tm) == 0) { errno = EINVAL; return -1; } } } else { if(localtime_r(&tloc, ret_tm) == 0) { errno = EINVAL; return -1; } } } /* Fractions of seconds */ if(frac_value) *frac_value = fvalue; if(frac_digits) *frac_digits = fdigits; return tloc; } GeneralizedTime_t * asn_time2GT(GeneralizedTime_t *opt_gt, const struct tm *tm, int force_gmt) { return asn_time2GT_frac(opt_gt, tm, 0, 0, force_gmt); } GeneralizedTime_t * asn_time2GT_frac(GeneralizedTime_t *opt_gt, const struct tm *tm, int frac_value, int frac_digits, int force_gmt) { struct tm tm_s; long gmtoff; const unsigned int buf_size = 4 + 2 + 2 /* yyyymmdd */ + 2 + 2 + 2 /* hhmmss */ + 1 + 6 /* .ffffff */ + 1 + 4 /* +hhmm */ + 1 /* '\0' */ ; char *buf; char *p; int size; /* Check arguments */ if(!tm) { errno = EINVAL; return 0; } /* Pre-allocate a buffer of sufficient yet small length */ buf = (char *)MALLOC(buf_size); if(!buf) return 0; gmtoff = GMTOFF(*tm); if(force_gmt && gmtoff) { tm_s = *tm; tm_s.tm_sec -= gmtoff; timegm(&tm_s); /* Fix the time */ tm = &tm_s; #ifdef HAVE_TM_GMTOFF assert(!GMTOFF(tm_s)); /* Will fix itself */ #else /* !HAVE_TM_GMTOFF */ gmtoff = 0; #endif } size = snprintf(buf, buf_size, "%04d%02d%02d%02d%02d%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec ); if(size != 14) { /* Could be assert(size == 14); */ FREEMEM(buf); errno = EINVAL; return 0; } p = buf + size; /* * Deal with fractions. */ if(frac_value > 0 && frac_digits > 0) { char *end = p + 1 + 6; /* '.' + maximum 6 digits */ char *z = p; long fbase; *z++ = '.'; /* Place bounds on precision */ while(frac_digits-- > 6) frac_value /= 10; /* emulate fbase = pow(10, frac_digits) */ for(fbase = 1; frac_digits--;) fbase *= 10; do { int digit = frac_value / fbase; if(digit > 9) { z = 0; break; } *z++ = digit + 0x30; frac_value %= fbase; fbase /= 10; } while(fbase > 0 && frac_value > 0 && z < end); if(z) { for(--z; *z == 0x30; --z); /* Strip zeroes */ p = z + (*z != '.'); size = p - buf; } } if(force_gmt) { *p++ = 0x5a; /* "Z" */ *p++ = 0; size++; } else { int ret; gmtoff %= 86400; ret = snprintf(p, buf_size - size, "%+03ld%02ld", gmtoff / 3600, labs(gmtoff % 3600) / 60); if(ret != 5) { FREEMEM(buf); errno = EINVAL; return 0; } size += ret; } if(opt_gt) { if(opt_gt->buf) FREEMEM(opt_gt->buf); } else { opt_gt = (GeneralizedTime_t *)CALLOC(1, sizeof *opt_gt); if(!opt_gt) { FREEMEM(buf); return 0; } } opt_gt->buf = (unsigned char *)buf; opt_gt->size = size; return opt_gt; } asn1c-0.9.24+dfsg/skeletons/per_opentype.h0000644000000000000000000000123211472004365017121 0ustar rootroot/* * Copyright (c) 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _PER_OPENTYPE_H_ #define _PER_OPENTYPE_H_ #ifdef __cplusplus extern "C" { #endif asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd); int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po); #ifdef __cplusplus } #endif #endif /* _PER_OPENTYPE_H_ */ asn1c-0.9.24+dfsg/skeletons/asn_codecs.h0000644000000000000000000000654511702613657016533 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _ASN_CODECS_H_ #define _ASN_CODECS_H_ #ifdef __cplusplus extern "C" { #endif struct asn_TYPE_descriptor_s; /* Forward declaration */ /* * This structure defines a set of parameters that may be passed * to every ASN.1 encoder or decoder function. * WARNING: if max_stack_size member is set, and you are calling the * function pointers of the asn_TYPE_descriptor_t directly, * this structure must be ALLOCATED ON THE STACK! * If you can't always satisfy this requirement, use ber_decode(), * xer_decode() and uper_decode() functions instead. */ typedef struct asn_codec_ctx_s { /* * Limit the decoder routines to use no (much) more stack than a given * number of bytes. Most of decoders are stack-based, and this * would protect against stack overflows if the number of nested * encodings is high. * The OCTET STRING, BIT STRING and ANY BER decoders are heap-based, * and are safe from this kind of overflow. * A value from getrlimit(RLIMIT_STACK) may be used to initialize * this variable. Be careful in multithreaded environments, as the * stack size is rather limited. */ size_t max_stack_size; /* 0 disables stack bounds checking */ } asn_codec_ctx_t; /* * Type of the return value of the encoding functions (der_encode, xer_encode). */ typedef struct asn_enc_rval_s { /* * Number of bytes encoded. * -1 indicates failure to encode the structure. * In this case, the members below this one are meaningful. */ ssize_t encoded; /* * Members meaningful when (encoded == -1), for post mortem analysis. */ /* Type which cannot be encoded */ struct asn_TYPE_descriptor_s *failed_type; /* Pointer to the structure of that type */ void *structure_ptr; } asn_enc_rval_t; #define _ASN_ENCODE_FAILED do { \ asn_enc_rval_t tmp_error; \ tmp_error.encoded = -1; \ tmp_error.failed_type = td; \ tmp_error.structure_ptr = sptr; \ ASN_DEBUG("Failed to encode element %s", td->name); \ return tmp_error; \ } while(0) #define _ASN_ENCODED_OK(rval) do { \ rval.structure_ptr = 0; \ rval.failed_type = 0; \ return rval; \ } while(0) /* * Type of the return value of the decoding functions (ber_decode, xer_decode) * * Please note that the number of consumed bytes is ALWAYS meaningful, * even if code==RC_FAIL. This is to indicate the number of successfully * decoded bytes, hence providing a possibility to fail with more diagnostics * (i.e., print the offending remainder of the buffer). */ enum asn_dec_rval_code_e { RC_OK, /* Decoded successfully */ RC_WMORE, /* More data expected, call again */ RC_FAIL /* Failure to decode data */ }; typedef struct asn_dec_rval_s { enum asn_dec_rval_code_e code; /* Result code */ size_t consumed; /* Number of bytes consumed */ } asn_dec_rval_t; #define _ASN_DECODE_FAILED do { \ asn_dec_rval_t tmp_error; \ tmp_error.code = RC_FAIL; \ tmp_error.consumed = 0; \ ASN_DEBUG("Failed to decode element %s", td->name); \ return tmp_error; \ } while(0) #define _ASN_DECODE_STARVED do { \ asn_dec_rval_t tmp_error; \ tmp_error.code = RC_WMORE; \ tmp_error.consumed = 0; \ return tmp_error; \ } while(0) #ifdef __cplusplus } #endif #endif /* _ASN_CODECS_H_ */ asn1c-0.9.24+dfsg/skeletons/asn_codecs_prim.c0000644000000000000000000001633012121075210017525 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * Decode an always-primitive type. */ asn_dec_rval_t ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buf_ptr, size_t size, int tag_mode) { ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr; asn_dec_rval_t rval; ber_tlv_len_t length; /* * If the structure is not there, allocate it. */ if(st == NULL) { st = (ASN__PRIMITIVE_TYPE_t *)CALLOC(1, sizeof(*st)); if(st == NULL) _ASN_DECODE_FAILED; *sptr = (void *)st; } ASN_DEBUG("Decoding %s as plain primitive (tm=%d)", td->name, tag_mode); /* * Check tags and extract value length. */ rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, tag_mode, 0, &length, 0); if(rval.code != RC_OK) return rval; ASN_DEBUG("%s length is %d bytes", td->name, (int)length); /* * Make sure we have this length. */ buf_ptr = ((const char *)buf_ptr) + rval.consumed; size -= rval.consumed; if(length > (ber_tlv_len_t)size) { rval.code = RC_WMORE; rval.consumed = 0; return rval; } st->size = (int)length; /* The following better be optimized away. */ if(sizeof(st->size) != sizeof(length) && (ber_tlv_len_t)st->size != length) { st->size = 0; _ASN_DECODE_FAILED; } st->buf = (uint8_t *)MALLOC(length + 1); if(!st->buf) { st->size = 0; _ASN_DECODE_FAILED; } memcpy(st->buf, buf_ptr, length); st->buf[length] = '\0'; /* Just in case */ rval.code = RC_OK; rval.consumed += length; ASN_DEBUG("Took %ld/%ld bytes to encode %s", (long)rval.consumed, (long)length, td->name); return rval; } /* * Encode an always-primitive type using DER. */ asn_enc_rval_t der_encode_primitive(asn_TYPE_descriptor_t *td, void *sptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t erval; ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)sptr; ASN_DEBUG("%s %s as a primitive type (tm=%d)", cb?"Encoding":"Estimating", td->name, tag_mode); erval.encoded = der_write_tags(td, st->size, tag_mode, 0, tag, cb, app_key); ASN_DEBUG("%s wrote tags %d", td->name, (int)erval.encoded); if(erval.encoded == -1) { erval.failed_type = td; erval.structure_ptr = sptr; return erval; } if(cb && st->buf) { if(cb(st->buf, st->size, app_key) < 0) { erval.encoded = -1; erval.failed_type = td; erval.structure_ptr = sptr; return erval; } } else { assert(st->buf || st->size == 0); } erval.encoded += st->size; _ASN_ENCODED_OK(erval); } void ASN__PRIMITIVE_TYPE_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) { ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)sptr; if(!td || !sptr) return; ASN_DEBUG("Freeing %s as a primitive type", td->name); if(st->buf) FREEMEM(st->buf); if(!contents_only) FREEMEM(st); } /* * Local internal type passed around as an argument. */ struct xdp_arg_s { asn_TYPE_descriptor_t *type_descriptor; void *struct_key; xer_primitive_body_decoder_f *prim_body_decoder; int decoded_something; int want_more; }; /* * Since some kinds of primitive values can be encoded using value-specific * tags (, , etc), the primitive decoder must * be supplied with such tags to parse them as needed. */ static int xer_decode__unexpected_tag(void *key, const void *chunk_buf, size_t chunk_size) { struct xdp_arg_s *arg = (struct xdp_arg_s *)key; enum xer_pbd_rval bret; /* * The chunk_buf is guaranteed to start at '<'. */ assert(chunk_size && ((const char *)chunk_buf)[0] == 0x3c); /* * Decoding was performed once already. Prohibit doing it again. */ if(arg->decoded_something) return -1; bret = arg->prim_body_decoder(arg->type_descriptor, arg->struct_key, chunk_buf, chunk_size); switch(bret) { case XPBD_SYSTEM_FAILURE: case XPBD_DECODER_LIMIT: case XPBD_BROKEN_ENCODING: break; case XPBD_BODY_CONSUMED: /* Tag decoded successfully */ arg->decoded_something = 1; /* Fall through */ case XPBD_NOT_BODY_IGNORE: /* Safe to proceed further */ return 0; } return -1; } static ssize_t xer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size, int have_more) { struct xdp_arg_s *arg = (struct xdp_arg_s *)key; enum xer_pbd_rval bret; size_t lead_wsp_size; if(arg->decoded_something) { if(xer_whitespace_span(chunk_buf, chunk_size) == chunk_size) { /* * Example: * "123 " * ^- chunk_buf position. */ return chunk_size; } /* * Decoding was done once already. Prohibit doing it again. */ return -1; } if(!have_more) { /* * If we've received something like "1", we can't really * tell whether it is really `1` or `123`, until we know * that there is no more data coming. * The have_more argument will be set to 1 once something * like this is available to the caller of this callback: * "1want_more = 1; return -1; } lead_wsp_size = xer_whitespace_span(chunk_buf, chunk_size); chunk_buf += lead_wsp_size; chunk_size -= lead_wsp_size; bret = arg->prim_body_decoder(arg->type_descriptor, arg->struct_key, chunk_buf, chunk_size); switch(bret) { case XPBD_SYSTEM_FAILURE: case XPBD_DECODER_LIMIT: case XPBD_BROKEN_ENCODING: break; case XPBD_BODY_CONSUMED: /* Tag decoded successfully */ arg->decoded_something = 1; /* Fall through */ case XPBD_NOT_BODY_IGNORE: /* Safe to proceed further */ return lead_wsp_size + chunk_size; } return -1; } asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size, xer_primitive_body_decoder_f *prim_body_decoder ) { const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; asn_struct_ctx_t s_ctx; struct xdp_arg_s s_arg; asn_dec_rval_t rc; /* * Create the structure if does not exist. */ if(!*sptr) { *sptr = CALLOC(1, struct_size); if(!*sptr) _ASN_DECODE_FAILED; } memset(&s_ctx, 0, sizeof(s_ctx)); s_arg.type_descriptor = td; s_arg.struct_key = *sptr; s_arg.prim_body_decoder = prim_body_decoder; s_arg.decoded_something = 0; s_arg.want_more = 0; rc = xer_decode_general(opt_codec_ctx, &s_ctx, &s_arg, xml_tag, buf_ptr, size, xer_decode__unexpected_tag, xer_decode__primitive_body); switch(rc.code) { case RC_OK: if(!s_arg.decoded_something) { char ch; ASN_DEBUG("Primitive body is not recognized, " "supplying empty one"); /* * Decoding opportunity has come and gone. * Where's the result? * Try to feed with empty body, see if it eats it. */ if(prim_body_decoder(s_arg.type_descriptor, s_arg.struct_key, &ch, 0) != XPBD_BODY_CONSUMED) { /* * This decoder does not like empty stuff. */ _ASN_DECODE_FAILED; } } break; case RC_WMORE: /* * Redo the whole thing later. * We don't have a context to save intermediate parsing state. */ rc.consumed = 0; break; case RC_FAIL: rc.consumed = 0; if(s_arg.want_more) rc.code = RC_WMORE; else _ASN_DECODE_FAILED; break; } return rc; } asn1c-0.9.24+dfsg/skeletons/NativeInteger.c0000644000000000000000000002110512015121740017137 0ustar rootroot/*- * Copyright (c) 2004, 2005, 2006 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * Read the NativeInteger.h for the explanation wrt. differences between * INTEGER and NativeInteger. * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this * implementation deals with the standard (machine-specific) representation * of them instead of using the platform-independent buffer. */ #include #include /* * NativeInteger basic type description. */ static ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NativeInteger = { "INTEGER", /* The ASN.1 type is still INTEGER */ "INTEGER", NativeInteger_free, NativeInteger_print, asn_generic_no_constraint, NativeInteger_decode_ber, NativeInteger_encode_der, NativeInteger_decode_xer, NativeInteger_encode_xer, NativeInteger_decode_uper, /* Unaligned PER decoder */ NativeInteger_encode_uper, /* Unaligned PER encoder */ 0, /* Use generic outmost tag fetcher */ asn_DEF_NativeInteger_tags, sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), asn_DEF_NativeInteger_tags, /* Same as above */ sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /* * Decode INTEGER type. */ asn_dec_rval_t NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; long *native = (long *)*nint_ptr; asn_dec_rval_t rval; ber_tlv_len_t length; /* * If the structure is not there, allocate it. */ if(native == NULL) { native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); if(native == NULL) { rval.code = RC_FAIL; rval.consumed = 0; return rval; } } ASN_DEBUG("Decoding %s as INTEGER (tm=%d)", td->name, tag_mode); /* * Check tags. */ rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, tag_mode, 0, &length, 0); if(rval.code != RC_OK) return rval; ASN_DEBUG("%s length is %d bytes", td->name, (int)length); /* * Make sure we have this length. */ buf_ptr = ((const char *)buf_ptr) + rval.consumed; size -= rval.consumed; if(length > (ber_tlv_len_t)size) { rval.code = RC_WMORE; rval.consumed = 0; return rval; } /* * ASN.1 encoded INTEGER: buf_ptr, length * Fill the native, at the same time checking for overflow. * If overflow occured, return with RC_FAIL. */ { INTEGER_t tmp; union { const void *constbuf; void *nonconstbuf; } unconst_buf; long l; unconst_buf.constbuf = buf_ptr; tmp.buf = (uint8_t *)unconst_buf.nonconstbuf; tmp.size = length; if((specs&&specs->field_unsigned) ? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */ : asn_INTEGER2long(&tmp, &l)) { rval.code = RC_FAIL; rval.consumed = 0; return rval; } *native = l; } rval.code = RC_OK; rval.consumed += length; ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)", (long)rval.consumed, (long)length, td->name, (long)*native); return rval; } /* * Encode the NativeInteger using the standard INTEGER type DER encoder. */ asn_enc_rval_t NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { unsigned long native = *(unsigned long *)ptr; /* Disable sign ext. */ asn_enc_rval_t erval; INTEGER_t tmp; #ifdef WORDS_BIGENDIAN /* Opportunistic optimization */ tmp.buf = (uint8_t *)&native; tmp.size = sizeof(native); #else /* Works even if WORDS_BIGENDIAN is not set where should've been */ uint8_t buf[sizeof(native)]; uint8_t *p; /* Prepare a fake INTEGER */ for(p = buf + sizeof(buf) - 1; p >= buf; p--, native >>= 8) *p = (uint8_t)native; tmp.buf = buf; tmp.size = sizeof(buf); #endif /* WORDS_BIGENDIAN */ /* Encode fake INTEGER */ erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key); if(erval.encoded == -1) { assert(erval.structure_ptr == &tmp); erval.structure_ptr = ptr; } return erval; } /* * Decode the chunk of XML text encoding INTEGER. */ asn_dec_rval_t NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_dec_rval_t rval; INTEGER_t st; void *st_ptr = (void *)&st; long *native = (long *)*sptr; if(!native) { native = (long *)(*sptr = CALLOC(1, sizeof(*native))); if(!native) _ASN_DECODE_FAILED; } memset(&st, 0, sizeof(st)); rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, opt_mname, buf_ptr, size); if(rval.code == RC_OK) { long l; if((specs&&specs->field_unsigned) ? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */ : asn_INTEGER2long(&st, &l)) { rval.code = RC_FAIL; rval.consumed = 0; } else { *native = l; } } else { /* * Cannot restart from the middle; * there is no place to save state in the native type. * Request a continuation from the very beginning. */ rval.consumed = 0; } ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st); return rval; } asn_enc_rval_t NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; char scratch[32]; /* Enough for 64-bit int */ asn_enc_rval_t er; const long *native = (const long *)sptr; (void)ilevel; (void)flags; if(!native) _ASN_ENCODE_FAILED; er.encoded = snprintf(scratch, sizeof(scratch), (specs && specs->field_unsigned) ? "%lu" : "%ld", *native); if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch) || cb(scratch, er.encoded, app_key) < 0) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } asn_dec_rval_t NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_dec_rval_t rval; long *native = (long *)*sptr; INTEGER_t tmpint; void *tmpintptr = &tmpint; (void)opt_codec_ctx; ASN_DEBUG("Decoding NativeInteger %s (UPER)", td->name); if(!native) { native = (long *)(*sptr = CALLOC(1, sizeof(*native))); if(!native) _ASN_DECODE_FAILED; } memset(&tmpint, 0, sizeof tmpint); rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints, &tmpintptr, pd); if(rval.code == RC_OK) { if((specs&&specs->field_unsigned) ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) : asn_INTEGER2long(&tmpint, native)) rval.code = RC_FAIL; else ASN_DEBUG("NativeInteger %s got value %ld", td->name, *native); } ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); return rval; } asn_enc_rval_t NativeInteger_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_enc_rval_t er; long native; INTEGER_t tmpint; if(!sptr) _ASN_ENCODE_FAILED; native = *(long *)sptr; ASN_DEBUG("Encoding NativeInteger %s %ld (UPER)", td->name, native); memset(&tmpint, 0, sizeof(tmpint)); if((specs&&specs->field_unsigned) ? asn_ulong2INTEGER(&tmpint, native) : asn_long2INTEGER(&tmpint, native)) _ASN_ENCODE_FAILED; er = INTEGER_encode_uper(td, constraints, &tmpint, po); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); return er; } /* * INTEGER specific human-readable output. */ int NativeInteger_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; const long *native = (const long *)sptr; char scratch[32]; /* Enough for 64-bit int */ int ret; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(native) { ret = snprintf(scratch, sizeof(scratch), (specs && specs->field_unsigned) ? "%lu" : "%ld", *native); assert(ret > 0 && (size_t)ret < sizeof(scratch)); return (cb(scratch, ret, app_key) < 0) ? -1 : 0; } else { return (cb("", 8, app_key) < 0) ? -1 : 0; } } void NativeInteger_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { if(!td || !ptr) return; ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)", td->name, contents_only, ptr); if(!contents_only) { FREEMEM(ptr); } } asn1c-0.9.24+dfsg/skeletons/per_encoder.c0000644000000000000000000000716512015121740016672 0ustar rootroot#include #include #include static asn_enc_rval_t uper_encode_internal(asn_TYPE_descriptor_t *td, asn_per_constraints_t *, void *sptr, asn_app_consume_bytes_f *cb, void *app_key); asn_enc_rval_t uper_encode(asn_TYPE_descriptor_t *td, void *sptr, asn_app_consume_bytes_f *cb, void *app_key) { return uper_encode_internal(td, 0, sptr, cb, app_key); } /* * Argument type and callback necessary for uper_encode_to_buffer(). */ typedef struct enc_to_buf_arg { void *buffer; size_t left; } enc_to_buf_arg; static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) { enc_to_buf_arg *arg = (enc_to_buf_arg *)key; if(arg->left < size) return -1; /* Data exceeds the available buffer size */ memcpy(arg->buffer, buffer, size); arg->buffer = ((char *)arg->buffer) + size; arg->left -= size; return 0; } asn_enc_rval_t uper_encode_to_buffer(asn_TYPE_descriptor_t *td, void *sptr, void *buffer, size_t buffer_size) { enc_to_buf_arg key; key.buffer = buffer; key.left = buffer_size; if(td) ASN_DEBUG("Encoding \"%s\" using UNALIGNED PER", td->name); return uper_encode_internal(td, 0, sptr, encode_to_buffer_cb, &key); } typedef struct enc_dyn_arg { void *buffer; size_t length; size_t allocated; } enc_dyn_arg; static int encode_dyn_cb(const void *buffer, size_t size, void *key) { enc_dyn_arg *arg = key; if(arg->length + size >= arg->allocated) { void *p; arg->allocated = arg->allocated ? (arg->allocated << 2) : size; p = REALLOC(arg->buffer, arg->allocated); if(!p) { FREEMEM(arg->buffer); memset(arg, 0, sizeof(*arg)); return -1; } arg->buffer = p; } memcpy(((char *)arg->buffer) + arg->length, buffer, size); arg->length += size; return 0; } ssize_t uper_encode_to_new_buffer(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, void **buffer_r) { asn_enc_rval_t er; enc_dyn_arg key; memset(&key, 0, sizeof(key)); er = uper_encode_internal(td, constraints, sptr, encode_dyn_cb, &key); switch(er.encoded) { case -1: FREEMEM(key.buffer); return -1; case 0: FREEMEM(key.buffer); key.buffer = MALLOC(1); if(key.buffer) { *(char *)key.buffer = '\0'; *buffer_r = key.buffer; return 1; } else { return -1; } default: *buffer_r = key.buffer; ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded); return ((er.encoded + 7) >> 3); } } /* * Internally useful functions. */ /* Flush partially filled buffer */ static int _uper_encode_flush_outp(asn_per_outp_t *po) { uint8_t *buf; if(po->nboff == 0 && po->buffer == po->tmpspace) return 0; buf = po->buffer + (po->nboff >> 3); /* Make sure we account for the last, partially filled */ if(po->nboff & 0x07) { buf[0] &= 0xff << (8 - (po->nboff & 0x07)); buf++; } return po->outper(po->tmpspace, buf - po->tmpspace, po->op_key); } static asn_enc_rval_t uper_encode_internal(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_app_consume_bytes_f *cb, void *app_key) { asn_per_outp_t po; asn_enc_rval_t er; /* * Invoke type-specific encoder. */ if(!td || !td->uper_encoder) _ASN_ENCODE_FAILED; /* PER is not compiled in */ po.buffer = po.tmpspace; po.nboff = 0; po.nbits = 8 * sizeof(po.tmpspace); po.outper = cb; po.op_key = app_key; po.flushed_bytes = 0; er = td->uper_encoder(td, constraints, sptr, &po); if(er.encoded != -1) { size_t bits_to_flush; bits_to_flush = ((po.buffer - po.tmpspace) << 3) + po.nboff; /* Set number of bits encoded to a firm value */ er.encoded = (po.flushed_bytes << 3) + bits_to_flush; if(_uper_encode_flush_outp(&po)) _ASN_ENCODE_FAILED; } return er; } asn1c-0.9.24+dfsg/skeletons/RELATIVE-OID.h0000644000000000000000000000210511505405150016226 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _RELATIVE_OID_H_ #define _RELATIVE_OID_H_ #include #ifdef __cplusplus extern "C" { #endif /* Implemented via OBJECT IDENTIFIER */ typedef OBJECT_IDENTIFIER_t RELATIVE_OID_t; extern asn_TYPE_descriptor_t asn_DEF_RELATIVE_OID; asn_struct_print_f RELATIVE_OID_print; xer_type_decoder_f RELATIVE_OID_decode_xer; xer_type_encoder_f RELATIVE_OID_encode_xer; /********************************** * Some handy conversion routines * **********************************/ /* See OBJECT_IDENTIFIER_get_arcs() function in OBJECT_IDENTIFIER.h */ int RELATIVE_OID_get_arcs(RELATIVE_OID_t *_roid, void *arcs, unsigned int arc_type_size, unsigned int arc_slots); /* See OBJECT_IDENTIFIER_set_arcs() function in OBJECT_IDENTIFIER.h */ int RELATIVE_OID_set_arcs(RELATIVE_OID_t *_roid, void *arcs, unsigned int arc_type_size, unsigned int arcs_slots); #ifdef __cplusplus } #endif #endif /* _RELATIVE_OID_H_ */ asn1c-0.9.24+dfsg/skeletons/BMPString.c0000644000000000000000000001124611502527550016216 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * BMPString basic type description. */ static ber_tlv_tag_t asn_DEF_BMPString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (30 << 2)), /* [UNIVERSAL 30] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; static asn_OCTET_STRING_specifics_t asn_DEF_BMPString_specs = { sizeof(BMPString_t), offsetof(BMPString_t, _asn_ctx), ASN_OSUBV_U16 /* 16-bits character */ }; static asn_per_constraints_t asn_DEF_BMPString_constraints = { { APC_CONSTRAINED, 16, 16, 0, 65535 }, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, 0, 0 }; asn_TYPE_descriptor_t asn_DEF_BMPString = { "BMPString", "BMPString", OCTET_STRING_free, /* Implemented in terms of OCTET STRING */ BMPString_print, asn_generic_no_constraint, /* No constraint by default */ OCTET_STRING_decode_ber, OCTET_STRING_encode_der, BMPString_decode_xer, /* Convert from UTF-8 */ BMPString_encode_xer, /* Convert to UTF-8 */ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_BMPString_tags, sizeof(asn_DEF_BMPString_tags) / sizeof(asn_DEF_BMPString_tags[0]) - 1, asn_DEF_BMPString_tags, sizeof(asn_DEF_BMPString_tags) / sizeof(asn_DEF_BMPString_tags[0]), &asn_DEF_BMPString_constraints, 0, 0, /* No members */ &asn_DEF_BMPString_specs }; /* * BMPString specific contents printer. */ static ssize_t BMPString__dump(const BMPString_t *st, asn_app_consume_bytes_f *cb, void *app_key) { char scratch[128]; /* Scratchpad buffer */ char *p = scratch; ssize_t wrote = 0; uint8_t *ch; uint8_t *end; ch = st->buf; end = (st->buf + st->size); for(end--; ch < end; ch += 2) { uint16_t wc = (ch[0] << 8) | ch[1]; /* 2 bytes */ if(sizeof(scratch) - (p - scratch) < 3) { wrote += p - scratch; if(cb(scratch, p - scratch, app_key) < 0) return -1; p = scratch; } if(wc < 0x80) { *p++ = (char)wc; } else if(wc < 0x800) { *p++ = 0xc0 | ((wc >> 6)); *p++ = 0x80 | ((wc & 0x3f)); } else { *p++ = 0xe0 | ((wc >> 12)); *p++ = 0x80 | ((wc >> 6) & 0x3f); *p++ = 0x80 | ((wc & 0x3f)); } } wrote += p - scratch; if(cb(scratch, p - scratch, app_key) < 0) return -1; return wrote; } asn_dec_rval_t BMPString_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { asn_dec_rval_t rc; rc = OCTET_STRING_decode_xer_utf8(opt_codec_ctx, td, sptr, opt_mname, buf_ptr, size); if(rc.code == RC_OK) { /* * Now we have a whole string in UTF-8 format. * Convert it into UCS-2. */ uint32_t *wcs; size_t wcs_len; UTF8String_t *st; assert(*sptr); st = (UTF8String_t *)*sptr; assert(st->buf); wcs_len = UTF8String_to_wcs(st, 0, 0); wcs = (uint32_t *)MALLOC(4 * (wcs_len + 1)); if(wcs == 0 || UTF8String_to_wcs(st, wcs, wcs_len) != wcs_len) { rc.code = RC_FAIL; rc.consumed = 0; return rc; } else { wcs[wcs_len] = 0; /* nul-terminate */ } if(1) { /* Swap byte order and trim encoding to 2 bytes */ uint32_t *wc = wcs; uint32_t *wc_end = wcs + wcs_len; uint16_t *dstwc = (uint16_t *)wcs; for(; wc < wc_end; wc++, dstwc++) { uint32_t wch = *wc; if(wch > 0xffff) { FREEMEM(wcs); rc.code = RC_FAIL; rc.consumed = 0; return rc; } *((uint8_t *)dstwc + 0) = wch >> 8; *((uint8_t *)dstwc + 1) = wch; } dstwc = (uint16_t *)REALLOC(wcs, 2 * (wcs_len + 1)); if(!dstwc) { FREEMEM(wcs); rc.code = RC_FAIL; rc.consumed = 0; return rc; } else { dstwc[wcs_len] = 0; /* nul-terminate */ wcs = (uint32_t *)dstwc; } } FREEMEM(st->buf); st->buf = (uint8_t *)wcs; st->size = 2 * wcs_len; } return rc; } asn_enc_rval_t BMPString_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { const BMPString_t *st = (const BMPString_t *)sptr; asn_enc_rval_t er; (void)ilevel; (void)flags; if(!st || !st->buf) _ASN_ENCODE_FAILED; er.encoded = BMPString__dump(st, cb, app_key); if(er.encoded < 0) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } int BMPString_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const BMPString_t *st = (const BMPString_t *)sptr; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(!st || !st->buf) return (cb("", 8, app_key) < 0) ? -1 : 0; if(BMPString__dump(st, cb, app_key) < 0) return -1; return 0; } asn1c-0.9.24+dfsg/skeletons/BIT_STRING.h0000644000000000000000000000147011502527550016120 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _BIT_STRING_H_ #define _BIT_STRING_H_ #include /* Some help from OCTET STRING */ #ifdef __cplusplus extern "C" { #endif typedef struct BIT_STRING_s { uint8_t *buf; /* BIT STRING body */ int size; /* Size of the above buffer */ int bits_unused;/* Unused trailing bits in the last octet (0..7) */ asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ } BIT_STRING_t; extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; asn_struct_print_f BIT_STRING_print; /* Human-readable output */ asn_constr_check_f BIT_STRING_constraint; xer_type_encoder_f BIT_STRING_encode_xer; #ifdef __cplusplus } #endif #endif /* _BIT_STRING_H_ */ asn1c-0.9.24+dfsg/skeletons/NativeReal.h0000644000000000000000000000175311472004364016451 0ustar rootroot/*- * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * This type differs from the standard REAL in that it is modelled using * the fixed machine type (double), so it can hold only values of * limited precision. There is no explicit type (i.e., NativeReal_t). * Use of this type is normally enabled by -fnative-types. */ #ifndef ASN_TYPE_NativeReal_H #define ASN_TYPE_NativeReal_H #include #ifdef __cplusplus extern "C" { #endif extern asn_TYPE_descriptor_t asn_DEF_NativeReal; asn_struct_free_f NativeReal_free; asn_struct_print_f NativeReal_print; ber_type_decoder_f NativeReal_decode_ber; der_type_encoder_f NativeReal_encode_der; xer_type_decoder_f NativeReal_decode_xer; xer_type_encoder_f NativeReal_encode_xer; per_type_decoder_f NativeReal_decode_uper; per_type_encoder_f NativeReal_encode_uper; #ifdef __cplusplus } #endif #endif /* ASN_TYPE_NativeReal_H */ asn1c-0.9.24+dfsg/skeletons/ENUMERATED.h0000644000000000000000000000102011472004364016033 0ustar rootroot/*- * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _ENUMERATED_H_ #define _ENUMERATED_H_ #include #ifdef __cplusplus extern "C" { #endif typedef INTEGER_t ENUMERATED_t; /* Implemented via INTEGER */ extern asn_TYPE_descriptor_t asn_DEF_ENUMERATED; per_type_decoder_f ENUMERATED_decode_uper; per_type_encoder_f ENUMERATED_encode_uper; #ifdef __cplusplus } #endif #endif /* _ENUMERATED_H_ */ asn1c-0.9.24+dfsg/skeletons/UTF8String.h0000644000000000000000000000242111472004364016325 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _UTF8String_H_ #define _UTF8String_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t UTF8String_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_UTF8String; asn_struct_print_f UTF8String_print; asn_constr_check_f UTF8String_constraint; /* * Returns length of the given UTF-8 string in characters, * or a negative error code: * -1: UTF-8 sequence truncated * -2: Illegal UTF-8 sequence start * -3: Continuation expectation failed * -4: Not minimal length encoding * -5: Invalid arguments */ ssize_t UTF8String_length(const UTF8String_t *st); /* * Convert the UTF-8 string into a sequence of wide characters. * Returns the number of characters necessary. * Returned value might be greater than dstlen. * In case of conversion error, 0 is returned. * * If st points to a valid UTF-8 string, calling * UTF8String_to_wcs(st, 0, 0); * is equivalent to * UTF8String_length(const UTF8String_t *st); */ size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen); #ifdef __cplusplus } #endif #endif /* _UTF8String_H_ */ asn1c-0.9.24+dfsg/skeletons/NativeInteger.h0000644000000000000000000000210411502527550017153 0ustar rootroot/*- * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * This type differs from the standard INTEGER in that it is modelled using * the fixed machine type (long, int, short), so it can hold only values of * limited length. There is no type (i.e., NativeInteger_t, any integer type * will do). * This type may be used when integer range is limited by subtype constraints. */ #ifndef _NativeInteger_H_ #define _NativeInteger_H_ #include #include #ifdef __cplusplus extern "C" { #endif extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; asn_struct_free_f NativeInteger_free; asn_struct_print_f NativeInteger_print; ber_type_decoder_f NativeInteger_decode_ber; der_type_encoder_f NativeInteger_encode_der; xer_type_decoder_f NativeInteger_decode_xer; xer_type_encoder_f NativeInteger_encode_xer; per_type_decoder_f NativeInteger_decode_uper; per_type_encoder_f NativeInteger_encode_uper; #ifdef __cplusplus } #endif #endif /* _NativeInteger_H_ */ asn1c-0.9.24+dfsg/skeletons/ISO646String.c0000644000000000000000000000252011502527550016465 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * ISO646String basic type description. */ static ber_tlv_tag_t asn_DEF_ISO646String_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; static asn_per_constraints_t asn_DEF_ISO646String_constraints = { { APC_CONSTRAINED, 7, 7, 0x20, 0x7e }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ 0, 0 }; asn_TYPE_descriptor_t asn_DEF_ISO646String = { "ISO646String", "ISO646String", OCTET_STRING_free, OCTET_STRING_print_utf8, /* ASCII subset */ VisibleString_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_utf8, OCTET_STRING_encode_xer_utf8, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_ISO646String_tags, sizeof(asn_DEF_ISO646String_tags) / sizeof(asn_DEF_ISO646String_tags[0]) - 1, asn_DEF_ISO646String_tags, sizeof(asn_DEF_ISO646String_tags) / sizeof(asn_DEF_ISO646String_tags[0]), &asn_DEF_ISO646String_constraints, 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/skeletons/asn_system.h0000644000000000000000000000643312015121740016574 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2007 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * Miscellaneous system-dependent types. */ #ifndef _ASN_SYSTEM_H_ #define _ASN_SYSTEM_H_ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* For snprintf(3) */ #include /* For *alloc(3) */ #include /* For memcpy(3) */ #include /* For size_t */ #include /* For LONG_MAX */ #include /* For va_start */ #include /* for offsetof and ptrdiff_t */ #ifdef _WIN32 #include #define snprintf _snprintf #define vsnprintf _vsnprintf /* To avoid linking with ws2_32.lib, here's the definition of ntohl() */ #define sys_ntohl(l) ((((l) << 24) & 0xff000000) \ | (((l) << 16) & 0xff0000) \ | (((l) << 8) & 0xff00) \ | ((l) & 0xff)) #ifdef _MSC_VER /* MSVS.Net */ #ifndef __cplusplus #define inline __inline #endif #ifndef ASSUMESTDTYPES /* Standard types have been defined elsewhere */ #define ssize_t SSIZE_T typedef char int8_t; typedef short int16_t; typedef int int32_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #endif /* ASSUMESTDTYPES */ #define WIN32_LEAN_AND_MEAN #include #include #define isnan _isnan #define finite _finite #define copysign _copysign #define ilogb _logb #else /* !_MSC_VER */ #include #endif /* _MSC_VER */ #else /* !_WIN32 */ #if defined(__vxworks) #include #else /* !defined(__vxworks) */ #include /* C99 specifies this file */ /* * 1. Earlier FreeBSD version didn't have , * but was present. * 2. Sun Solaris requires for alloca(3), * but does not have . */ #if (!defined(__FreeBSD__) || !defined(_SYS_INTTYPES_H_)) #if defined(sun) #include /* For alloca(3) */ #include /* for finite(3) */ #elif defined(__hpux) #ifdef __GNUC__ #include /* For alloca(3) */ #else /* !__GNUC__ */ #define inline #endif /* __GNUC__ */ #else #include /* SUSv2+ and C99 specify this file, for uintXX_t */ #endif /* defined(sun) */ #endif #include /* for ntohl() */ #define sys_ntohl(foo) ntohl(foo) #endif /* defined(__vxworks) */ #endif /* _WIN32 */ #if __GNUC__ >= 3 #ifndef GCC_PRINTFLIKE #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) #endif #ifndef GCC_NOTUSED #define GCC_NOTUSED __attribute__((unused)) #endif #else #ifndef GCC_PRINTFLIKE #define GCC_PRINTFLIKE(fmt,var) /* nothing */ #endif #ifndef GCC_NOTUSED #define GCC_NOTUSED #endif #endif /* Figure out if thread safety is requested */ #if !defined(ASN_THREAD_SAFE) && (defined(THREAD_SAFE) || defined(_REENTRANT)) #define ASN_THREAD_SAFE #endif /* Thread safety */ #ifndef offsetof /* If not defined by */ #define offsetof(s, m) ((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0)) #endif /* offsetof */ #ifndef MIN /* Suitable for comparing primitive types (integers) */ #if defined(__GNUC__) #define MIN(a,b) ({ __typeof a _a = a; __typeof b _b = b; \ ((_a)<(_b)?(_a):(_b)); }) #else /* !__GNUC__ */ #define MIN(a,b) ((a)<(b)?(a):(b)) /* Unsafe variant */ #endif /* __GNUC__ */ #endif /* MIN */ #endif /* _ASN_SYSTEM_H_ */ asn1c-0.9.24+dfsg/skeletons/BIT_STRING.c0000644000000000000000000001074011502527550016113 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * BIT STRING basic type description. */ static ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)) }; static asn_OCTET_STRING_specifics_t asn_DEF_BIT_STRING_specs = { sizeof(BIT_STRING_t), offsetof(BIT_STRING_t, _asn_ctx), ASN_OSUBV_BIT }; asn_TYPE_descriptor_t asn_DEF_BIT_STRING = { "BIT STRING", "BIT_STRING", OCTET_STRING_free, /* Implemented in terms of OCTET STRING */ BIT_STRING_print, BIT_STRING_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, /* Implemented in terms of OCTET STRING */ OCTET_STRING_decode_xer_binary, BIT_STRING_encode_xer, OCTET_STRING_decode_uper, /* Unaligned PER decoder */ OCTET_STRING_encode_uper, /* Unaligned PER encoder */ 0, /* Use generic outmost tag fetcher */ asn_DEF_BIT_STRING_tags, sizeof(asn_DEF_BIT_STRING_tags) / sizeof(asn_DEF_BIT_STRING_tags[0]), asn_DEF_BIT_STRING_tags, /* Same as above */ sizeof(asn_DEF_BIT_STRING_tags) / sizeof(asn_DEF_BIT_STRING_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_DEF_BIT_STRING_specs }; /* * BIT STRING generic constraint. */ int BIT_STRING_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; if(st && st->buf) { if((st->size == 0 && st->bits_unused) || st->bits_unused < 0 || st->bits_unused > 7) { _ASN_CTFAIL(app_key, td, sptr, "%s: invalid padding byte (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } else { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } return 0; } static char *_bit_pattern[16] = { "0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111" }; asn_enc_rval_t BIT_STRING_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; char scratch[128]; char *p = scratch; char *scend = scratch + (sizeof(scratch) - 10); const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; int xcan = (flags & XER_F_CANONICAL); uint8_t *buf; uint8_t *end; if(!st || !st->buf) _ASN_ENCODE_FAILED; er.encoded = 0; buf = st->buf; end = buf + st->size - 1; /* Last byte is special */ /* * Binary dump */ for(; buf < end; buf++) { int v = *buf; int nline = xcan?0:(((buf - st->buf) % 8) == 0); if(p >= scend || nline) { er.encoded += p - scratch; _ASN_CALLBACK(scratch, p - scratch); p = scratch; if(nline) _i_ASN_TEXT_INDENT(1, ilevel); } memcpy(p + 0, _bit_pattern[v >> 4], 4); memcpy(p + 4, _bit_pattern[v & 0x0f], 4); p += 8; } if(!xcan && ((buf - st->buf) % 8) == 0) _i_ASN_TEXT_INDENT(1, ilevel); er.encoded += p - scratch; _ASN_CALLBACK(scratch, p - scratch); p = scratch; if(buf == end) { int v = *buf; int ubits = st->bits_unused; int i; for(i = 7; i >= ubits; i--) *p++ = (v & (1 << i)) ? 0x31 : 0x30; er.encoded += p - scratch; _ASN_CALLBACK(scratch, p - scratch); } if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1); _ASN_ENCODED_OK(er); cb_failed: _ASN_ENCODE_FAILED; } /* * BIT STRING specific contents printer. */ int BIT_STRING_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { static const char *h2c = "0123456789ABCDEF"; char scratch[64]; const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; uint8_t *buf; uint8_t *end; char *p = scratch; (void)td; /* Unused argument */ if(!st || !st->buf) return (cb("", 8, app_key) < 0) ? -1 : 0; ilevel++; buf = st->buf; end = buf + st->size; /* * Hexadecimal dump. */ for(; buf < end; buf++) { if((buf - st->buf) % 16 == 0 && (st->size > 16) && buf != st->buf) { _i_INDENT(1); /* Dump the string */ if(cb(scratch, p - scratch, app_key) < 0) return -1; p = scratch; } *p++ = h2c[*buf >> 4]; *p++ = h2c[*buf & 0x0F]; *p++ = 0x20; } if(p > scratch) { p--; /* Eat the tailing space */ if((st->size > 16)) { _i_INDENT(1); } /* Dump the incomplete 16-bytes row */ if(cb(scratch, p - scratch, app_key) < 0) return -1; } return 0; } asn1c-0.9.24+dfsg/skeletons/per_decoder.h0000644000000000000000000000330011472004365016661 0ustar rootroot/*- * Copyright (c) 2005, 2007 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _PER_DECODER_H_ #define _PER_DECODER_H_ #include #include #ifdef __cplusplus extern "C" { #endif struct asn_TYPE_descriptor_s; /* Forward declaration */ /* * Unaligned PER decoder of a "complete encoding" as per X.691#10.1. * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3. */ asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ void **struct_ptr, /* Pointer to a target structure's pointer */ const void *buffer, /* Data to be decoded */ size_t size /* Size of data buffer */ ); /* * Unaligned PER decoder of any ASN.1 type. May be invoked by the application. * WARNING: This call returns the number of BITS read from the stream. Beware. */ asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ void **struct_ptr, /* Pointer to a target structure's pointer */ const void *buffer, /* Data to be decoded */ size_t size, /* Size of data buffer */ int skip_bits, /* Number of unused leading bits, 0..7 */ int unused_bits /* Number of unused tailing bits, 0..7 */ ); /* * Type of the type-specific PER decoder function. */ typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, struct asn_TYPE_descriptor_s *type_descriptor, asn_per_constraints_t *constraints, void **struct_ptr, asn_per_data_t *per_data ); #ifdef __cplusplus } #endif #endif /* _PER_DECODER_H_ */ asn1c-0.9.24+dfsg/skeletons/ber_tlv_length.h0000644000000000000000000000277511472004364017422 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _BER_TLV_LENGTH_H_ #define _BER_TLV_LENGTH_H_ #ifdef __cplusplus extern "C" { #endif typedef ssize_t ber_tlv_len_t; /* * This function tries to fetch the length of the BER TLV value and place it * in *len_r. * RETURN VALUES: * 0: More data expected than bufptr contains. * -1: Fatal error deciphering length. * >0: Number of bytes used from bufptr. * On return with >0, len_r is constrained as -1..MAX, where -1 mean * that the value is of indefinite length. */ ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, ber_tlv_len_t *len_r); /* * This function expects bufptr to be positioned over L in TLV. * It returns number of bytes occupied by L and V together, suitable * for skipping. The function properly handles indefinite length. * RETURN VALUES: * Standard {-1,0,>0} convention. */ ssize_t ber_skip_length( struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ int _is_constructed, const void *bufptr, size_t size); /* * This function serializes the length (L from TLV) in DER format. * It always returns number of bytes necessary to represent the length, * it is a caller's responsibility to check the return value * against the supplied buffer's size. */ size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); #ifdef __cplusplus } #endif #endif /* _BER_TLV_LENGTH_H_ */ asn1c-0.9.24+dfsg/skeletons/INTEGER.c0000644000000000000000000006200612121074203015474 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005, 2006, 2007 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* Encoder and decoder of a primitive type */ #include /* * INTEGER basic type description. */ static ber_tlv_tag_t asn_DEF_INTEGER_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_INTEGER = { "INTEGER", "INTEGER", ASN__PRIMITIVE_TYPE_free, INTEGER_print, asn_generic_no_constraint, ber_decode_primitive, INTEGER_encode_der, INTEGER_decode_xer, INTEGER_encode_xer, #ifdef ASN_DISABLE_PER_SUPPORT 0, 0, #else INTEGER_decode_uper, /* Unaligned PER decoder */ INTEGER_encode_uper, /* Unaligned PER encoder */ #endif /* ASN_DISABLE_PER_SUPPORT */ 0, /* Use generic outmost tag fetcher */ asn_DEF_INTEGER_tags, sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]), asn_DEF_INTEGER_tags, /* Same as above */ sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /* * Encode INTEGER type using DER. */ asn_enc_rval_t INTEGER_encode_der(asn_TYPE_descriptor_t *td, void *sptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { INTEGER_t *st = (INTEGER_t *)sptr; ASN_DEBUG("%s %s as INTEGER (tm=%d)", cb?"Encoding":"Estimating", td->name, tag_mode); /* * Canonicalize integer in the buffer. * (Remove too long sign extension, remove some first 0x00 bytes) */ if(st->buf) { uint8_t *buf = st->buf; uint8_t *end1 = buf + st->size - 1; int shift; /* Compute the number of superfluous leading bytes */ for(; buf < end1; buf++) { /* * If the contents octets of an integer value encoding * consist of more than one octet, then the bits of the * first octet and bit 8 of the second octet: * a) shall not all be ones; and * b) shall not all be zero. */ switch(*buf) { case 0x00: if((buf[1] & 0x80) == 0) continue; break; case 0xff: if((buf[1] & 0x80)) continue; break; } break; } /* Remove leading superfluous bytes from the integer */ shift = buf - st->buf; if(shift) { uint8_t *nb = st->buf; uint8_t *end; st->size -= shift; /* New size, minus bad bytes */ end = nb + st->size; for(; nb < end; nb++, buf++) *nb = *buf; } } /* if(1) */ return der_encode_primitive(td, sptr, tag_mode, tag, cb, app_key); } static const asn_INTEGER_enum_map_t *INTEGER_map_enum2value(asn_INTEGER_specifics_t *specs, const char *lstart, const char *lstop); /* * INTEGER specific human-readable output. */ static ssize_t INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_bytes_f *cb, void *app_key, int plainOrXER) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; char scratch[32]; /* Enough for 64-bit integer */ uint8_t *buf = st->buf; uint8_t *buf_end = st->buf + st->size; signed long accum; ssize_t wrote = 0; char *p; int ret; /* * Advance buf pointer until the start of the value's body. * This will make us able to process large integers using simple case, * when the actual value is small * (0x0000000000abcdef would yield a fine 0x00abcdef) */ /* Skip the insignificant leading bytes */ for(; buf < buf_end-1; buf++) { switch(*buf) { case 0x00: if((buf[1] & 0x80) == 0) continue; break; case 0xff: if((buf[1] & 0x80) != 0) continue; break; } break; } /* Simple case: the integer size is small */ if((size_t)(buf_end - buf) <= sizeof(accum)) { const asn_INTEGER_enum_map_t *el; size_t scrsize; char *scr; if(buf == buf_end) { accum = 0; } else { accum = (*buf & 0x80) ? -1 : 0; for(; buf < buf_end; buf++) accum = (accum << 8) | *buf; } el = INTEGER_map_value2enum(specs, accum); if(el) { scrsize = el->enum_len + 32; scr = (char *)alloca(scrsize); if(plainOrXER == 0) ret = snprintf(scr, scrsize, "%ld (%s)", accum, el->enum_name); else ret = snprintf(scr, scrsize, "<%s/>", el->enum_name); } else if(plainOrXER && specs && specs->strict_enumeration) { ASN_DEBUG("ASN.1 forbids dealing with " "unknown value of ENUMERATED type"); errno = EPERM; return -1; } else { scrsize = sizeof(scratch); scr = scratch; ret = snprintf(scr, scrsize, (specs && specs->field_unsigned) ?"%lu":"%ld", accum); } assert(ret > 0 && (size_t)ret < scrsize); return (cb(scr, ret, app_key) < 0) ? -1 : ret; } else if(plainOrXER && specs && specs->strict_enumeration) { /* * Here and earlier, we cannot encode the ENUMERATED values * if there is no corresponding identifier. */ ASN_DEBUG("ASN.1 forbids dealing with " "unknown value of ENUMERATED type"); errno = EPERM; return -1; } /* Output in the long xx:yy:zz... format */ /* TODO: replace with generic algorithm (Knuth TAOCP Vol 2, 4.3.1) */ for(p = scratch; buf < buf_end; buf++) { static const char *h2c = "0123456789ABCDEF"; if((p - scratch) >= (ssize_t)(sizeof(scratch) - 4)) { /* Flush buffer */ if(cb(scratch, p - scratch, app_key) < 0) return -1; wrote += p - scratch; p = scratch; } *p++ = h2c[*buf >> 4]; *p++ = h2c[*buf & 0x0F]; *p++ = 0x3a; /* ":" */ } if(p != scratch) p--; /* Remove the last ":" */ wrote += p - scratch; return (cb(scratch, p - scratch, app_key) < 0) ? -1 : wrote; } /* * INTEGER specific human-readable output. */ int INTEGER_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; ssize_t ret; (void)td; (void)ilevel; if(!st || !st->buf) ret = cb("", 8, app_key); else ret = INTEGER__dump(td, st, cb, app_key, 0); return (ret < 0) ? -1 : 0; } struct e2v_key { const char *start; const char *stop; asn_INTEGER_enum_map_t *vemap; unsigned int *evmap; }; static int INTEGER__compar_enum2value(const void *kp, const void *am) { const struct e2v_key *key = (const struct e2v_key *)kp; const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am; const char *ptr, *end, *name; /* Remap the element (sort by different criterion) */ el = key->vemap + key->evmap[el - key->vemap]; /* Compare strings */ for(ptr = key->start, end = key->stop, name = el->enum_name; ptr < end; ptr++, name++) { if(*ptr != *name) return *(const unsigned char *)ptr - *(const unsigned char *)name; } return name[0] ? -1 : 0; } static const asn_INTEGER_enum_map_t * INTEGER_map_enum2value(asn_INTEGER_specifics_t *specs, const char *lstart, const char *lstop) { asn_INTEGER_enum_map_t *el_found; int count = specs ? specs->map_count : 0; struct e2v_key key; const char *lp; if(!count) return NULL; /* Guaranteed: assert(lstart < lstop); */ /* Figure out the tag name */ for(lstart++, lp = lstart; lp < lstop; lp++) { switch(*lp) { case 9: case 10: case 11: case 12: case 13: case 32: /* WSP */ case 0x2f: /* '/' */ case 0x3e: /* '>' */ break; default: continue; } break; } if(lp == lstop) return NULL; /* No tag found */ lstop = lp; key.start = lstart; key.stop = lstop; key.vemap = specs->value2enum; key.evmap = specs->enum2value; el_found = (asn_INTEGER_enum_map_t *)bsearch(&key, specs->value2enum, count, sizeof(specs->value2enum[0]), INTEGER__compar_enum2value); if(el_found) { /* Remap enum2value into value2enum */ el_found = key.vemap + key.evmap[el_found - key.vemap]; } return el_found; } static int INTEGER__compar_value2enum(const void *kp, const void *am) { long a = *(const long *)kp; const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am; long b = el->nat_value; if(a < b) return -1; else if(a == b) return 0; else return 1; } const asn_INTEGER_enum_map_t * INTEGER_map_value2enum(asn_INTEGER_specifics_t *specs, long value) { int count = specs ? specs->map_count : 0; if(!count) return 0; return (asn_INTEGER_enum_map_t *)bsearch(&value, specs->value2enum, count, sizeof(specs->value2enum[0]), INTEGER__compar_value2enum); } static int INTEGER_st_prealloc(INTEGER_t *st, int min_size) { void *p = MALLOC(min_size + 1); if(p) { void *b = st->buf; st->size = 0; st->buf = p; FREEMEM(b); return 0; } else { return -1; } } /* * Decode the chunk of XML text encoding INTEGER. */ static enum xer_pbd_rval INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_buf, size_t chunk_size) { INTEGER_t *st = (INTEGER_t *)sptr; long dec_value; long hex_value; const char *lp; const char *lstart = (const char *)chunk_buf; const char *lstop = lstart + chunk_size; enum { ST_LEADSPACE, ST_SKIPSPHEX, ST_WAITDIGITS, ST_DIGITS, ST_DIGITS_TRAILSPACE, ST_HEXDIGIT1, ST_HEXDIGIT2, ST_HEXDIGITS_TRAILSPACE, ST_HEXCOLON, ST_END_ENUM, ST_UNEXPECTED } state = ST_LEADSPACE; const char *dec_value_start = 0; /* INVARIANT: always !0 in ST_DIGITS */ const char *dec_value_end = 0; if(chunk_size) ASN_DEBUG("INTEGER body %ld 0x%2x..0x%2x", (long)chunk_size, *lstart, lstop[-1]); if(INTEGER_st_prealloc(st, (chunk_size/3) + 1)) return XPBD_SYSTEM_FAILURE; /* * We may have received a tag here. It will be processed inline. * Use strtoul()-like code and serialize the result. */ for(lp = lstart; lp < lstop; lp++) { int lv = *lp; switch(lv) { case 0x09: case 0x0a: case 0x0d: case 0x20: switch(state) { case ST_LEADSPACE: case ST_DIGITS_TRAILSPACE: case ST_HEXDIGITS_TRAILSPACE: case ST_SKIPSPHEX: continue; case ST_DIGITS: dec_value_end = lp; state = ST_DIGITS_TRAILSPACE; continue; case ST_HEXCOLON: state = ST_HEXDIGITS_TRAILSPACE; continue; default: break; } break; case 0x2d: /* '-' */ if(state == ST_LEADSPACE) { dec_value = 0; dec_value_start = lp; state = ST_WAITDIGITS; continue; } break; case 0x2b: /* '+' */ if(state == ST_LEADSPACE) { dec_value = 0; dec_value_start = lp; state = ST_WAITDIGITS; continue; } break; case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: switch(state) { case ST_DIGITS: continue; case ST_SKIPSPHEX: /* Fall through */ case ST_HEXDIGIT1: hex_value = (lv - 0x30) << 4; state = ST_HEXDIGIT2; continue; case ST_HEXDIGIT2: hex_value += (lv - 0x30); state = ST_HEXCOLON; st->buf[st->size++] = (uint8_t)hex_value; continue; case ST_HEXCOLON: return XPBD_BROKEN_ENCODING; case ST_LEADSPACE: dec_value = 0; dec_value_start = lp; /* FALL THROUGH */ case ST_WAITDIGITS: state = ST_DIGITS; continue; default: break; } break; case 0x3c: /* '<', start of XML encoded enumeration */ if(state == ST_LEADSPACE) { const asn_INTEGER_enum_map_t *el; el = INTEGER_map_enum2value( (asn_INTEGER_specifics_t *) td->specifics, lstart, lstop); if(el) { ASN_DEBUG("Found \"%s\" => %ld", el->enum_name, el->nat_value); dec_value = el->nat_value; state = ST_END_ENUM; lp = lstop - 1; continue; } ASN_DEBUG("Unknown identifier for INTEGER"); } return XPBD_BROKEN_ENCODING; case 0x3a: /* ':' */ if(state == ST_HEXCOLON) { /* This colon is expected */ state = ST_HEXDIGIT1; continue; } else if(state == ST_DIGITS) { /* The colon here means that we have * decoded the first two hexadecimal * places as a decimal value. * Switch decoding mode. */ ASN_DEBUG("INTEGER re-evaluate as hex form"); state = ST_SKIPSPHEX; dec_value_start = 0; lp = lstart - 1; continue; } else { ASN_DEBUG("state %d at %ld", state, (long)(lp - lstart)); break; } /* [A-Fa-f] */ case 0x41:case 0x42:case 0x43:case 0x44:case 0x45:case 0x46: case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:case 0x66: switch(state) { case ST_SKIPSPHEX: case ST_LEADSPACE: /* Fall through */ case ST_HEXDIGIT1: hex_value = lv - ((lv < 0x61) ? 0x41 : 0x61); hex_value += 10; hex_value <<= 4; state = ST_HEXDIGIT2; continue; case ST_HEXDIGIT2: hex_value += lv - ((lv < 0x61) ? 0x41 : 0x61); hex_value += 10; st->buf[st->size++] = (uint8_t)hex_value; state = ST_HEXCOLON; continue; case ST_DIGITS: ASN_DEBUG("INTEGER re-evaluate as hex form"); state = ST_SKIPSPHEX; dec_value_start = 0; lp = lstart - 1; continue; default: break; } break; } /* Found extra non-numeric stuff */ ASN_DEBUG("INTEGER :: Found non-numeric 0x%2x at %ld", lv, (long)(lp - lstart)); state = ST_UNEXPECTED; break; } switch(state) { case ST_END_ENUM: /* Got a complete and valid enumeration encoded as a tag. */ break; case ST_DIGITS: dec_value_end = lstop; /* FALL THROUGH */ case ST_DIGITS_TRAILSPACE: /* The last symbol encountered was a digit. */ switch(asn_strtol_lim(dec_value_start, &dec_value_end, &dec_value)) { case ASN_STRTOL_OK: break; case ASN_STRTOL_ERROR_RANGE: return XPBD_DECODER_LIMIT; case ASN_STRTOL_ERROR_INVAL: case ASN_STRTOL_EXPECT_MORE: case ASN_STRTOL_EXTRA_DATA: return XPBD_BROKEN_ENCODING; } break; case ST_HEXCOLON: case ST_HEXDIGITS_TRAILSPACE: st->buf[st->size] = 0; /* Just in case termination */ return XPBD_BODY_CONSUMED; case ST_HEXDIGIT1: case ST_HEXDIGIT2: case ST_SKIPSPHEX: return XPBD_BROKEN_ENCODING; case ST_LEADSPACE: /* Content not found */ return XPBD_NOT_BODY_IGNORE; case ST_WAITDIGITS: case ST_UNEXPECTED: ASN_DEBUG("INTEGER: No useful digits (state %d)", state); return XPBD_BROKEN_ENCODING; /* No digits */ } /* * Convert the result of parsing of enumeration or a straight * decimal value into a BER representation. */ if(asn_long2INTEGER(st, dec_value)) return XPBD_SYSTEM_FAILURE; return XPBD_BODY_CONSUMED; } asn_dec_rval_t INTEGER_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { return xer_decode_primitive(opt_codec_ctx, td, sptr, sizeof(INTEGER_t), opt_mname, buf_ptr, size, INTEGER__xer_body_decode); } asn_enc_rval_t INTEGER_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; asn_enc_rval_t er; (void)ilevel; (void)flags; if(!st || !st->buf) _ASN_ENCODE_FAILED; er.encoded = INTEGER__dump(td, st, cb, app_key, 1); if(er.encoded < 0) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } #ifndef ASN_DISABLE_PER_SUPPORT asn_dec_rval_t INTEGER_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_dec_rval_t rval = { RC_OK, 0 }; INTEGER_t *st = (INTEGER_t *)*sptr; asn_per_constraint_t *ct; int repeat; (void)opt_codec_ctx; if(!st) { st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st))); if(!st) _ASN_DECODE_FAILED; } if(!constraints) constraints = td->per_constraints; ct = constraints ? &constraints->value : 0; if(ct && ct->flags & APC_EXTENSIBLE) { int inext = per_get_few_bits(pd, 1); if(inext < 0) _ASN_DECODE_STARVED; if(inext) ct = 0; } FREEMEM(st->buf); st->buf = 0; st->size = 0; if(ct) { if(ct->flags & APC_SEMI_CONSTRAINED) { st->buf = (uint8_t *)CALLOC(1, 2); if(!st->buf) _ASN_DECODE_FAILED; st->size = 1; } else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) { size_t size = (ct->range_bits + 7) >> 3; st->buf = (uint8_t *)MALLOC(1 + size + 1); if(!st->buf) _ASN_DECODE_FAILED; st->size = size; } } /* X.691, #12.2.2 */ if(ct && ct->flags != APC_UNCONSTRAINED) { /* #10.5.6 */ ASN_DEBUG("Integer with range %d bits", ct->range_bits); if(ct->range_bits >= 0) { long value; if(ct->range_bits == 32) { long lhalf; value = per_get_few_bits(pd, 16); if(value < 0) _ASN_DECODE_STARVED; lhalf = per_get_few_bits(pd, 16); if(lhalf < 0) _ASN_DECODE_STARVED; value = (value << 16) | lhalf; } else { value = per_get_few_bits(pd, ct->range_bits); if(value < 0) _ASN_DECODE_STARVED; } ASN_DEBUG("Got value %ld + low %ld", value, ct->lower_bound); value += ct->lower_bound; if((specs && specs->field_unsigned) ? asn_ulong2INTEGER(st, value) : asn_long2INTEGER(st, value)) _ASN_DECODE_FAILED; return rval; } } else { ASN_DEBUG("Decoding unconstrained integer %s", td->name); } /* X.691, #12.2.3, #12.2.4 */ do { ssize_t len; void *p; int ret; /* Get the PER length */ len = uper_get_length(pd, -1, &repeat); if(len < 0) _ASN_DECODE_STARVED; p = REALLOC(st->buf, st->size + len + 1); if(!p) _ASN_DECODE_FAILED; st->buf = (uint8_t *)p; ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len); if(ret < 0) _ASN_DECODE_STARVED; st->size += len; } while(repeat); st->buf[st->size] = 0; /* JIC */ /* #12.2.3 */ if(ct && ct->lower_bound) { /* * TODO: replace by in-place arithmetics. */ long value; if(asn_INTEGER2long(st, &value)) _ASN_DECODE_FAILED; if(asn_long2INTEGER(st, value + ct->lower_bound)) _ASN_DECODE_FAILED; } return rval; } asn_enc_rval_t INTEGER_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_enc_rval_t er; INTEGER_t *st = (INTEGER_t *)sptr; const uint8_t *buf; const uint8_t *end; asn_per_constraint_t *ct; long value = 0; if(!st || st->size == 0) _ASN_ENCODE_FAILED; if(!constraints) constraints = td->per_constraints; ct = constraints ? &constraints->value : 0; er.encoded = 0; if(ct) { int inext = 0; if(specs && specs->field_unsigned) { unsigned long uval; if(asn_INTEGER2ulong(st, &uval)) _ASN_ENCODE_FAILED; /* Check proper range */ if(ct->flags & APC_SEMI_CONSTRAINED) { if(uval < (unsigned long)ct->lower_bound) inext = 1; } else if(ct->range_bits >= 0) { if(uval < (unsigned long)ct->lower_bound || uval > (unsigned long)ct->upper_bound) inext = 1; } ASN_DEBUG("Value %lu (%02x/%d) lb %lu ub %lu %s", uval, st->buf[0], st->size, ct->lower_bound, ct->upper_bound, inext ? "ext" : "fix"); value = uval; } else { if(asn_INTEGER2long(st, &value)) _ASN_ENCODE_FAILED; /* Check proper range */ if(ct->flags & APC_SEMI_CONSTRAINED) { if(value < ct->lower_bound) inext = 1; } else if(ct->range_bits >= 0) { if(value < ct->lower_bound || value > ct->upper_bound) inext = 1; } ASN_DEBUG("Value %ld (%02x/%d) lb %ld ub %ld %s", value, st->buf[0], st->size, ct->lower_bound, ct->upper_bound, inext ? "ext" : "fix"); } if(ct->flags & APC_EXTENSIBLE) { if(per_put_few_bits(po, inext, 1)) _ASN_ENCODE_FAILED; if(inext) ct = 0; } else if(inext) { _ASN_ENCODE_FAILED; } } /* X.691, #12.2.2 */ if(ct && ct->range_bits >= 0) { /* #10.5.6 */ ASN_DEBUG("Encoding integer with range %d bits", ct->range_bits); if(ct->range_bits == 32) { /* TODO: extend to >32 bits */ long v = value - ct->lower_bound; if(per_put_few_bits(po, v >> 1, 31) || per_put_few_bits(po, v, 1)) _ASN_ENCODE_FAILED; } else { if(per_put_few_bits(po, value - ct->lower_bound, ct->range_bits)) _ASN_ENCODE_FAILED; } _ASN_ENCODED_OK(er); } if(ct && ct->lower_bound) { ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound); /* TODO: adjust lower bound */ _ASN_ENCODE_FAILED; } for(buf = st->buf, end = st->buf + st->size; buf < end;) { ssize_t mayEncode = uper_put_length(po, end - buf); if(mayEncode < 0) _ASN_ENCODE_FAILED; if(per_put_many_bits(po, buf, 8 * mayEncode)) _ASN_ENCODE_FAILED; buf += mayEncode; } _ASN_ENCODED_OK(er); } #endif /* ASN_DISABLE_PER_SUPPORT */ int asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) { uint8_t *b, *end; size_t size; long l; /* Sanity checking */ if(!iptr || !iptr->buf || !lptr) { errno = EINVAL; return -1; } /* Cache the begin/end of the buffer */ b = iptr->buf; /* Start of the INTEGER buffer */ size = iptr->size; end = b + size; /* Where to stop */ if(size > sizeof(long)) { uint8_t *end1 = end - 1; /* * Slightly more advanced processing, * able to >sizeof(long) bytes, * when the actual value is small * (0x0000000000abcdef would yield a fine 0x00abcdef) */ /* Skip out the insignificant leading bytes */ for(; b < end1; b++) { switch(*b) { case 0x00: if((b[1] & 0x80) == 0) continue; break; case 0xff: if((b[1] & 0x80) != 0) continue; break; } break; } size = end - b; if(size > sizeof(long)) { /* Still cannot fit the long */ errno = ERANGE; return -1; } } /* Shortcut processing of a corner case */ if(end == b) { *lptr = 0; return 0; } /* Perform the sign initialization */ /* Actually l = -(*b >> 7); gains nothing, yet unreadable! */ if((*b >> 7)) l = -1; else l = 0; /* Conversion engine */ for(; b < end; b++) l = (l << 8) | *b; *lptr = l; return 0; } int asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *lptr) { uint8_t *b, *end; unsigned long l; size_t size; if(!iptr || !iptr->buf || !lptr) { errno = EINVAL; return -1; } b = iptr->buf; size = iptr->size; end = b + size; /* If all extra leading bytes are zeroes, ignore them */ for(; size > sizeof(unsigned long); b++, size--) { if(*b) { /* Value won't fit unsigned long */ errno = ERANGE; return -1; } } /* Conversion engine */ for(l = 0; b < end; b++) l = (l << 8) | *b; *lptr = l; return 0; } int asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) { uint8_t *buf; uint8_t *end; uint8_t *b; int shr; if(value <= LONG_MAX) return asn_long2INTEGER(st, value); buf = (uint8_t *)MALLOC(1 + sizeof(value)); if(!buf) return -1; end = buf + (sizeof(value) + 1); buf[0] = 0; for(b = buf + 1, shr = (sizeof(long)-1)*8; b < end; shr -= 8, b++) *b = (uint8_t)(value >> shr); if(st->buf) FREEMEM(st->buf); st->buf = buf; st->size = 1 + sizeof(value); return 0; } int asn_long2INTEGER(INTEGER_t *st, long value) { uint8_t *buf, *bp; uint8_t *p; uint8_t *pstart; uint8_t *pend1; int littleEndian = 1; /* Run-time detection */ int add; if(!st) { errno = EINVAL; return -1; } buf = (uint8_t *)MALLOC(sizeof(value)); if(!buf) return -1; if(*(char *)&littleEndian) { pstart = (uint8_t *)&value + sizeof(value) - 1; pend1 = (uint8_t *)&value; add = -1; } else { pstart = (uint8_t *)&value; pend1 = pstart + sizeof(value) - 1; add = 1; } /* * If the contents octet consists of more than one octet, * then bits of the first octet and bit 8 of the second octet: * a) shall not all be ones; and * b) shall not all be zero. */ for(p = pstart; p != pend1; p += add) { switch(*p) { case 0x00: if((*(p+add) & 0x80) == 0) continue; break; case 0xff: if((*(p+add) & 0x80)) continue; break; } break; } /* Copy the integer body */ for(pstart = p, bp = buf, pend1 += add; p != pend1; p += add) *bp++ = *p; if(st->buf) FREEMEM(st->buf); st->buf = buf; st->size = bp - buf; return 0; } /* * This function is going to be DEPRECATED soon. */ enum asn_strtol_result_e asn_strtol(const char *str, const char *end, long *lp) { const char *endp = end; switch(asn_strtol_lim(str, &endp, lp)) { case ASN_STRTOL_ERROR_RANGE: return ASN_STRTOL_ERROR_RANGE; case ASN_STRTOL_ERROR_INVAL: return ASN_STRTOL_ERROR_INVAL; case ASN_STRTOL_EXPECT_MORE: return ASN_STRTOL_ERROR_INVAL; /* Retain old behavior */ case ASN_STRTOL_OK: return ASN_STRTOL_OK; case ASN_STRTOL_EXTRA_DATA: return ASN_STRTOL_ERROR_INVAL; /* Retain old behavior */ } return ASN_STRTOL_ERROR_INVAL; /* Retain old behavior */ } /* * Parse the number in the given string until the given *end position, * returning the position after the last parsed character back using the * same (*end) pointer. * WARNING: This behavior is different from the standard strtol(3). */ enum asn_strtol_result_e asn_strtol_lim(const char *str, const char **end, long *lp) { int sign = 1; long l; const long upper_boundary = LONG_MAX / 10; long last_digit_max = LONG_MAX % 10; if(str >= *end) return ASN_STRTOL_ERROR_INVAL; switch(*str) { case '-': last_digit_max++; sign = -1; case '+': str++; if(str >= *end) { *end = str; return ASN_STRTOL_EXPECT_MORE; } } for(l = 0; str < (*end); str++) { switch(*str) { case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: { int d = *str - '0'; if(l < upper_boundary) { l = l * 10 + d; } else if(l == upper_boundary) { if(d <= last_digit_max) { if(sign > 0) { l = l * 10 + d; } else { sign = 1; l = -l * 10 - d; } } else { *end = str; return ASN_STRTOL_ERROR_RANGE; } } else { *end = str; return ASN_STRTOL_ERROR_RANGE; } } continue; default: *end = str; *lp = sign * l; return ASN_STRTOL_EXTRA_DATA; } } *end = str; *lp = sign * l; return ASN_STRTOL_OK; } asn1c-0.9.24+dfsg/skeletons/VideotexString.h0000644000000000000000000000072611472004364017374 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _VideotexString_H_ #define _VideotexString_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t VideotexString_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_VideotexString; #ifdef __cplusplus } #endif #endif /* _VideotexString_H_ */ asn1c-0.9.24+dfsg/skeletons/tests/0000755000000000000000000000000012223077270015403 5ustar rootrootasn1c-0.9.24+dfsg/skeletons/tests/check-OIDs.c0000644000000000000000000002572112121075014017416 0ustar rootroot#include #include #include #include #include static int _print(const void *buffer, size_t size, void *app_key) { (void)app_key; fwrite(buffer, size, 1, stdout); return 0; } static void check_OID(uint8_t *buf, size_t len, int *ck_buf, int ck_len) { OBJECT_IDENTIFIER_t *oid; asn_dec_rval_t rval; unsigned long arcs[10]; int alen; int i; printf("Checking {"); for(i = 0; i < (int)len; i++) { printf("%s%02x", i?" ":"", buf[i]); } printf("} against {"); for(i = 0; i < ck_len; i++) { printf("%s%d", i?" ":"", ck_buf[i]); } printf("}\n"); oid = NULL; rval = ber_decode(0, &asn_DEF_OBJECT_IDENTIFIER, (void *)&oid, buf, len); assert(rval.code == RC_OK); assert(oid->size == (ssize_t)len - 2); /* * Print the contents for visual debugging. */ printf("OBJECT_IDENTIFIER_print() => "); OBJECT_IDENTIFIER_print(&asn_DEF_OBJECT_IDENTIFIER, oid, 0, _print, 0); printf("\n"); memset(arcs, 'A', sizeof(arcs)); alen = OBJECT_IDENTIFIER_get_arcs(oid, arcs, sizeof(arcs[0]), sizeof(arcs)/sizeof(arcs[0])); assert(alen > 0); printf("OBJECT_IDENTIFIER_get_arcs() => {"); /* * Make sure they are equivalent. */ for(i = 0; i < alen; i++) { printf(" %lu", arcs[i]); if(alen == ck_len) { assert(arcs[i] == (unsigned long)ck_buf[i]); } } printf(" }\n"); assert(alen == ck_len); } static void check_ROID(uint8_t *buf, size_t len, int *ck_buf, int ck_len) { RELATIVE_OID_t *oid; asn_dec_rval_t rval; unsigned long arcs[10]; int alen; int i; printf("Checking {"); for(i = 0; i < (ssize_t)len; i++) { printf("%s%02x", i?" ":"", buf[i]); } printf("} against {"); for(i = 0; i < ck_len; i++) { printf("%s%d", i?" ":"", ck_buf[i]); } printf("}\n"); oid = NULL; rval = ber_decode(0, &asn_DEF_RELATIVE_OID, (void *)&oid, buf, len); assert(rval.code == RC_OK); assert(oid->size == (ssize_t)len - 2); /* * Print the contents for visual debugging. */ printf("RELATIVE_OID_print() => "); RELATIVE_OID_print(&asn_DEF_RELATIVE_OID, oid, 0, _print, 0); printf("\n"); memset(arcs, 'A', sizeof(arcs)); alen = RELATIVE_OID_get_arcs(oid, arcs, sizeof(arcs[0]), sizeof(arcs)/sizeof(arcs[0])); assert(alen > 0); assert(alen == ck_len); /* * Make sure they are equivalent. */ printf("RELATIVE_OID_get_arcs() => {"); for(i = 0; i < alen; i++) { printf(" %lu", (unsigned long)arcs[i]); assert(arcs[i] == (unsigned long)ck_buf[i]); } printf(" }\n"); } /* * Encode the specified array of arcs as RELATIVE-OID, decode it and compare. */ static void check_REGEN(int *arcs, int acount) { static RELATIVE_OID_t oid; unsigned long tmp_arcs[10]; int tmp_alen = 10; int alen; int ret; int i; if(0) { fprintf(stderr, "Encoding (R) {"); for(i = 0; i < acount; i++) { fprintf(stderr, " %u", arcs[i]); } fprintf(stderr, " }\n"); } ret = RELATIVE_OID_set_arcs(&oid, arcs, sizeof(arcs[0]), acount); assert(ret == 0); memset(tmp_arcs, 'A', sizeof(tmp_arcs)); alen = RELATIVE_OID_get_arcs(&oid, tmp_arcs, sizeof(tmp_arcs[0]), tmp_alen); assert(alen >= 0); assert(alen <= tmp_alen); assert(alen == acount); if(0) { fprintf(stderr, "Encoded (R) { "); for(i = 0; i < alen; i++) { fprintf(stderr, "%lu ", tmp_arcs[i]); fflush(stdout); assert(arcs[i] == (int)tmp_arcs[i]); } fprintf(stderr, "}\n"); } } /* * Encode the specified array of arcs as OBJECT IDENTIFIER, * decode it and compare. */ static void check_REGEN_OID(int *arcs, int acount) { static OBJECT_IDENTIFIER_t oid; unsigned long tmp_arcs[10]; int tmp_alen = 10; int alen; int ret; int i; if(0) { fprintf(stderr, "Encoding (O) {"); for(i = 0; i < acount; i++) { fprintf(stderr, " %u", arcs[i]); } fprintf(stderr, " }\n"); } ret = OBJECT_IDENTIFIER_set_arcs(&oid, arcs, sizeof(arcs[0]), acount); assert(ret == 0); memset(tmp_arcs, 'A', sizeof(tmp_arcs)); alen = OBJECT_IDENTIFIER_get_arcs(&oid, tmp_arcs, sizeof(tmp_arcs[0]), tmp_alen); assert(alen >= 0); assert(alen <= tmp_alen); assert(alen == acount); if(0) { fprintf(stderr, "Encoded (O) { "); for(i = 0; i < alen; i++) { fprintf(stderr, "%lu ", tmp_arcs[i]); fflush(stdout); assert(arcs[i] == (int)tmp_arcs[i]); } fprintf(stderr, "}\n"); } } static int check_speed() { uint8_t buf[] = { 0x80 | 7, 0x80 | 2, 0x80 | 3, 0x80 | 4, 13 }; int ret = 0; int cycles = 100000000; double a, b, c; struct timeval tv; unsigned long value; int i; ret = OBJECT_IDENTIFIER_get_single_arc(buf, sizeof(buf), 0, &value, sizeof(value)); assert(ret == 0); assert(value == 0x7040c20d); gettimeofday(&tv, 0); a = tv.tv_sec + tv.tv_usec / 1000000.0; for(i = 0; i < cycles; i++) { ret = OBJECT_IDENTIFIER_get_single_arc(buf, sizeof(buf), 0, &value, sizeof(value)); } assert(ret == 0); assert(value == 0x7040c20d); gettimeofday(&tv, 0); b = tv.tv_sec + tv.tv_usec / 1000000.0; for(i = 0; i < cycles; i++) { ret = OBJECT_IDENTIFIER_get_single_arc(buf, sizeof(buf), 0, &value, sizeof(value)); } assert(ret == 0); assert(value == 0x7040c20d); gettimeofday(&tv, 0); c = tv.tv_sec + tv.tv_usec / 1000000.0; a = b - a; b = c - b; printf("Time for single_arc(): %f\n", a); printf("Time for get_arc_l(): %f\n", b); return 0; } static void check_parse(const char *oid_txt, int retval) { int ret; long l[2]; const char *p = oid_txt - 13; assert(p < oid_txt); ret = OBJECT_IDENTIFIER_parse_arcs(oid_txt, -1, l, 2, &p); printf("[%s] => %d == %d\n", oid_txt, ret, retval); assert(ret == retval); assert(p >= oid_txt); } static void check_xer(int expect_arcs, char *xer) { asn_dec_rval_t rc; RELATIVE_OID_t *st = 0; RELATIVE_OID_t **stp = &st; long arcs[10]; int ret; int i; printf("[%s] => ", xer); fflush(stdout); rc = asn_DEF_RELATIVE_OID.xer_decoder(0, &asn_DEF_RELATIVE_OID, (void **)stp, "t", xer, strlen(xer)); if(expect_arcs == -1) { if(rc.code != RC_OK) { printf("-1\n"); return; } } assert(rc.code == RC_OK); ret = RELATIVE_OID_get_arcs(st, arcs, sizeof(arcs[0]), sizeof(arcs)/sizeof(arcs[0])); assert(ret < 10); if(expect_arcs == -1) { assert(ret == -1); return; } for(i = 0; i < ret; i++) { if(i) printf("."); printf("%ld", arcs[i]); if(arcs[i] != i + 1) printf(" != %d\n", i + 1); assert(arcs[i] == i + 1); } printf(": %d == %d\n", ret, expect_arcs); assert(ret == expect_arcs); } #define CHECK_OID(n) check_OID(buf ## n, sizeof(buf ## n), \ buf ## n ## _check, \ sizeof(buf ## n ## _check)/sizeof(buf ## n ## _check[0])) #define CHECK_ROID(n) check_ROID(buf ## n, sizeof(buf ## n), \ buf ## n ## _check, \ sizeof(buf ## n ## _check)/sizeof(buf ## n ## _check[0])) #define CHECK_REGEN(n) check_REGEN(buf ## n ## _check, \ sizeof(buf ## n ## _check)/sizeof(buf ## n ## _check[0])) #define CHECK_REGEN_OID(n) check_REGEN_OID(buf ## n ## _check, \ sizeof(buf ## n ## _check)/sizeof(buf ## n ## _check[0])) int main() { int i; /* {joint-iso-itu-t 230 3} */ uint8_t buf1[] = { 0x06, /* OBJECT IDENTIFIER */ 0x03, /* Length */ 0x82, 0x36, 0x03 }; int buf1_check[] = { 2, 230, 3 }; /* {8571 3 2} */ uint8_t buf2[] = { 0x0D, /* RELATIVE-OID */ 0x04, /* Length */ 0xC2, 0x7B, 0x03, 0x02 }; int buf2_check[] = { 8571, 3, 2 }; /* {joint-iso-itu-t 42 } */ uint8_t buf3[] = { 0x06, /* OBJECT IDENTIFIER */ 0x01, /* Length */ 0x7A }; int buf3_check[] = { 2, 42 }; /* {joint-iso-itu-t 25957 } */ uint8_t buf4[] = { 0x06, /* OBJECT IDENTIFIER */ 0x03, /* Length */ 0x81, 0x80 + 0x4B, 0x35 }; int buf4_check[] = { 2, 25957 }; int buf5_check[] = { 0 }; int buf6_check[] = { 1 }; int buf7_check[] = { 80, 40 }; int buf8_check[] = { 127 }; int buf9_check[] = { 128 }; int buf10_check[] = { 65535, 65536 }; int buf11_check[] = { 100000, 0x20000, 1234, 256, 127, 128 }; int buf12_check[] = { 0, 0xffffffff, 0xff00ff00, 0 }; int buf13_check[] = { 0, 1, 2 }; int buf14_check[] = { 1, 38, 3 }; int buf15_check[] = { 0, 0, 0xf000 }; int buf16_check[] = { 0, 0, 0, 1, 0 }; int buf17_check[] = { 2, 0xffffffAf, 0xff00ff00, 0 }; int buf18_check[] = { 2, 2, 1, 1 }; /* { joint-iso-itu-t 2 1 1 } */ uint8_t buf19[] = { 0x06, /* OBJECT IDENTIFIER */ 0x03, /* Length */ 0x52, 0x01, 0x01 }; int buf19_check[] = { 2, 2, 1, 1 }; /* { joint-iso-itu-t 2 1 0 1 } */ uint8_t buf20[] = { 0x06, /* OBJECT IDENTIFIER */ 0x04, /* Length */ 0x52, 0x01, 0x00, 0x01 }; int buf20_check[] = { 2, 2, 1, 0, 1 }; CHECK_OID(1); /* buf1, buf1_check */ CHECK_ROID(2); /* buf2, buf2_check */ CHECK_OID(3); /* buf3, buf3_check */ CHECK_OID(4); /* buf4, buf4_check */ CHECK_OID(19); /* buf19, buf19_check */ CHECK_OID(20); /* buf20, buf20_check */ CHECK_REGEN(5); /* Regenerate RELATIVE-OID */ CHECK_REGEN(6); CHECK_REGEN(7); CHECK_REGEN(8); CHECK_REGEN(9); CHECK_REGEN(10); CHECK_REGEN(11); CHECK_REGEN(12); CHECK_REGEN(13); CHECK_REGEN(14); CHECK_REGEN(15); CHECK_REGEN(16); CHECK_REGEN(17); CHECK_REGEN_OID(1); /* Regenerate OBJECT IDENTIFIER */ CHECK_REGEN_OID(3); /* Regenerate OBJECT IDENTIFIER */ CHECK_REGEN_OID(4); /* Regenerate OBJECT IDENTIFIER */ CHECK_REGEN_OID(13); CHECK_REGEN_OID(14); CHECK_REGEN_OID(15); CHECK_REGEN_OID(16); CHECK_REGEN_OID(17); CHECK_REGEN_OID(18); CHECK_REGEN_OID(19); CHECK_REGEN_OID(20); check_parse("", 0); check_parse(" ", 0); check_parse(".", -1); check_parse(" .", -1); check_parse(".1", -1); check_parse("1.", -1); check_parse("1. ", -1); check_parse(".1. ", -1); check_parse(" .1. ", -1); check_parse(" 1", 1); check_parse(" 1.2", 2); check_parse(" 1.", -1); check_parse(" 1. ", -1); check_parse("1. ", -1); check_parse("1.2", 2); check_parse("1.2 ", 2); check_parse("1.2 ", 2); check_parse(" 1.2 ", 2); check_parse("1. 2", -1); check_parse("1 .2", -1); check_parse(" 1 .2", -1); check_parse(" 1 .2 ", -1); check_parse("1 .2 ", -1); check_parse("1.+1", -1); check_parse("10.30.234.234", 4); check_parse("10.30.234.234 ", 4); check_parse("10.30.234. 234 ", -1); check_parse("10.30.234.234.", -1); check_parse("1.2000000000.3", 3); check_parse("1.2147483647.3", 3); if(sizeof(long) == 4) { check_parse("1.2147483648.3", -1); /* overflow on ILP32 */ check_parse("1.2147483649.3", -1); /* overflow on ILP32 */ check_parse("1.3000000000.3", -1); check_parse("1.4000000000.3", -1); check_parse("1.5000000000.3", -1); check_parse("1.6000000000.3", -1); check_parse("1.9000000000.3", -1); } else if(sizeof(long) == 8) { check_parse("1.2147483648.3", 3); check_parse("1.9223372036854775807.3", 3); check_parse("1.9223372036854775808.3", -1); } check_parse("1.900a0000000.3", -1); check_parse("1.900a.3", -1); check_xer(-1, ""); check_xer(2, "1.2"); check_xer(3, "1.2.3"); check_xer(3, " 1.2.3 "); check_xer(-1, "1.2.3 1"); for(i = 0; i < 100000; i++) { int bufA_check[3] = { 2, i, rand() }; int bufB_check[2] = { rand(), i * 121 }; CHECK_REGEN(A); CHECK_REGEN_OID(A); CHECK_REGEN(B); if(i > 100) i++; if(i > 500) i++; if(i > 1000) i += 3; if(i > 5000) i += 151; } if(getenv("CHECK_SPEED")) { /* Useful for developers only */ check_speed(); } return 0; } asn1c-0.9.24+dfsg/skeletons/tests/check-INTEGER.c0000644000000000000000000002165112021044205017710 0ustar rootroot#include #include #include static char *shared_scratch_start; static int _print2buf(const void *buf, size_t size, void *key) { (void)key; memcpy(shared_scratch_start, buf, size); shared_scratch_start += size; *shared_scratch_start = '\0'; /* 0-termination */ return 0; } static void check(uint8_t *buf, int size, long check_long, int check_ret) { char scratch[128]; char verify[32]; INTEGER_t val; uint8_t *buf_end = buf + size; int ret; long rlong = 123; assert(buf); assert(size >= 0); val.buf = buf; val.size = size; printf("Testing: ["); for(; buf < buf_end; buf++) { if(buf != val.buf) printf(":"); printf("%02x", *buf); } printf("]: "); ret = asn_INTEGER2long(&val, &rlong); printf(" (%ld, %d) vs (%ld, %d)\n", rlong, ret, check_long, check_ret); assert(ret == check_ret); printf("%ld %ld\n", rlong, check_long); assert(rlong == check_long); if(check_ret == 0) { INTEGER_t val2; long rlong2; val2.buf = 0; val2.size = 0; ret = asn_long2INTEGER(&val2, rlong); assert(ret == 0); assert(val2.buf); assert(val2.size <= val.size); /* At least as compact */ ret = asn_INTEGER2long(&val, &rlong2); assert(ret == 0); assert(rlong == rlong2); } shared_scratch_start = scratch; ret = INTEGER_print(&asn_DEF_INTEGER, &val, 0, _print2buf, scratch); assert(shared_scratch_start < scratch + sizeof(scratch)); assert(ret == 0); ret = snprintf(verify, sizeof(verify), "%ld", check_long); assert(ret < sizeof(verify)); ret = strcmp(scratch, verify); printf(" [%s] vs [%s]: %d%s\n", scratch, verify, ret, (check_ret == -1)?" (expected to fail)":"" ); if(check_ret == -1) { assert(strcmp(scratch, verify)); } else { assert(strcmp(scratch, verify) == 0); } } static void check_unsigned(uint8_t *buf, int size, unsigned long check_long, int check_ret) { char scratch[128]; char verify[32]; INTEGER_t val; uint8_t *buf_end = buf + size; int ret; unsigned long rlong = 123; assert(buf); assert(size >= 0); val.buf = buf; val.size = size; printf("Testing: ["); for(; buf < buf_end; buf++) { if(buf != val.buf) printf(":"); printf("%02x", *buf); } printf("]: "); ret = asn_INTEGER2ulong(&val, &rlong); printf(" (%lu, %d) vs (%lu, %d)\n", rlong, ret, check_long, check_ret); assert(ret == check_ret); assert(rlong == check_long); if(check_ret == 0) { INTEGER_t val2; unsigned long rlong2; val2.buf = 0; val2.size = 0; ret = asn_ulong2INTEGER(&val2, rlong); assert(ret == 0); assert(val2.buf); if(val2.size > val.size) { /* At least as compact */ printf("val2.size=%d, val.size=%d\n", (int)val2.size, (int)val.size); assert(val2.size <= val.size); } ret = asn_INTEGER2ulong(&val, &rlong2); assert(ret == 0); assert(rlong == rlong2); } return; shared_scratch_start = scratch; ret = INTEGER_print(&asn_DEF_INTEGER, &val, 0, _print2buf, scratch); assert(shared_scratch_start < scratch + sizeof(scratch)); assert(ret == 0); ret = snprintf(verify, sizeof(verify), "%lu", check_long); assert(ret < sizeof(verify)); ret = strcmp(scratch, verify); printf(" [%s] vs [%s]: %d%s\n", scratch, verify, ret, (check_ret == -1)?" (expected to fail)":"" ); if(check_ret == -1) { assert(strcmp(scratch, verify)); } else { assert(strcmp(scratch, verify) == 0); } } static void check_xer(int tofail, char *xmldata, long orig_value) { INTEGER_t *st = 0; asn_dec_rval_t rc; long value; int ret; printf("[%s] vs %ld: ", xmldata, orig_value); rc = xer_decode(0, &asn_DEF_INTEGER, (void *)&st, xmldata, strlen(xmldata)); if(rc.code != RC_OK) { assert(tofail); printf("\tfailed, as expected\n"); return; } assert(!tofail); ret = asn_INTEGER2long(st, &value); assert(ret == 0); printf("\t%ld\n", value); assert(value == orig_value); asn_DEF_INTEGER.free_struct(&asn_DEF_INTEGER, st, 0); } int main(int ac, char **av) { uint8_t buf1[] = { 1 }; uint8_t buf2[] = { 0xff }; uint8_t buf3[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; uint8_t buf4[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0 }; uint8_t buf5[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 }; uint8_t buf6[] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; uint8_t buf7[] = { 0xff, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; uint8_t buf8[] = { 0x7f, 0x7e, 0x7d, 0x7c }; uint8_t buf9[] = { 0, 0x7f, 0x7e, 0x7d, 0x7c }; uint8_t buf10[] = { 0, 0, 0, 0, 0, 0, 0x7f, 0x7e, 0x7d, 0x7c }; uint8_t buf11[] = { 0x80, 0, 0, 0 }; uint8_t buf12[] = { 0x80, 0 }; uint8_t buf13[] = { 0x80 }; uint8_t buf14[] = { 0x00, 0x80, 0x00, 0x00 }; uint8_t buf15[] = { 0x00, 0x80, 0x00, 0x00, 0x00 }; uint8_t buf16[] = { 0x00, 0xff, 0xff, 0x00, 0x00 }; #define UCHECK(buf, val, ret) check_unsigned(buf, sizeof(buf), val, ret) #define CHECK(buf, val, ret) check(buf, sizeof(buf), val, ret) CHECK(buf1, 1, 0); CHECK(buf2, -1, 0); CHECK(buf3, -1, 0); CHECK(buf4, -16, 0); CHECK(buf5, 257, 0); CHECK(buf6, 123, -1); CHECK(buf7, 123, -1); CHECK(buf8, 0x7F7E7D7C, 0); CHECK(buf9, 0x7F7E7D7C, 0); CHECK(buf10, 0x7F7E7D7C, 0); UCHECK(buf10, 0x7F7E7D7C, 0); CHECK(buf11, -2147483647-1, 0); /* 0x80000000 */ CHECK(buf12, -32768, 0); CHECK(buf13, -128, 0); UCHECK(buf14, 0x800000, 0); UCHECK(buf15, 0x80000000UL, 0); UCHECK(buf16, 0xffff0000UL, 0); check_xer(-1, "", 0); check_xer(-1, "", 0); check_xer(-1, " ", 0); check_xer(-1, "-", 0); check_xer(-1, "+", 0); check_xer(-1, "+-", 0); check_xer(-1, " -", 0); check_xer(-1, " +", 0); check_xer(-1, " +-", 0); check_xer(-1, "- ", 0); check_xer(-1, "+ ", 0); check_xer(-1, "+- ", 0); check_xer(-1, " - ", 0); check_xer(-1, " + ", 0); check_xer(-1, " +- ", 0); check_xer(0, "+0", 0); check_xer(0, "-0", 0); check_xer(0, "+1", 1); check_xer(0, "-1", -1); check_xer(0, "1", 1); check_xer(0, "-15", -15); check_xer(0, "+15", 15); check_xer(0, "15", 15); check_xer(0, " 15", 15); check_xer(0, " 15 ", 15); check_xer(0, "15 ", 15); check_xer(0, " +15 ", 15); check_xer(-1, " +15 -", 0); check_xer(-1, " +15 1", 0); check_xer(-1, "+ 15", 0); check_xer(-1, "1234", 0); check_xer(-1, "12 34", 0); check_xer(-1, "12 ", 0); check_xer(0, "1234", 1234); check_xer(-1, "1234 5678", 0); check_xer(0, "-2147483647", -2147483647); check_xer(0, "-2147483648", -2147483647-1); check_xer(0, "+2147483647", 2147483647); check_xer(0, "2147483647", 2147483647); if(sizeof(long) == 4) { check_xer( 0, "-2147483648", -2147483648); check_xer(-1, "-2147483649", 0); check_xer(-1, "2147483648", 0); check_xer(-1, "2147483649", 0); check_xer(-1, "3147483649", 0); check_xer(-1, "4147483649", 0); check_xer(-1, "5147483649", 0); /* special */ check_xer(-1, "9147483649", 0); check_xer(-1, "9999999999", 0); check_xer(-1, "-5147483649", 0);/* special */ check_xer(-1, "-9147483649", 0); check_xer(-1, "-9999999999", 0); } if(sizeof(long) == 8) { check_xer(0, "2147483648", 2147483648); check_xer(0, "2147483649", 2147483649); check_xer(0, "3147483649", 3147483649); check_xer(0, "4147483649", 4147483649); check_xer(0, "5147483649", 5147483649); check_xer(0, "9147483649", 9147483649); check_xer(0, "9999999999", 9999999999); check_xer(0, "9223372036854775807", 9223372036854775807); check_xer(-1, "9223372036854775808", 0); check_xer(-1, "10223372036854775807", 0); check_xer(-1, "50223372036854775807", 0); check_xer(-1, "100223372036854775807", 0); check_xer(-1, "500223372036854775807", 0); check_xer(0, "-9223372036854775808", -9223372036854775808); check_xer(-1, "-9223372036854775809", 0); check_xer(-1, "-10223372036854775807", 0); check_xer(-1, "-50223372036854775807", 0); check_xer(-1, "-100223372036854775807", 0); check_xer(-1, "-500223372036854775807", 0); } return 0; } asn1c-0.9.24+dfsg/skeletons/tests/check-OCTET_STRING.c0000644000000000000000000000750311472004365020573 0ustar rootroot#include #include #include #include #define EMIT_ASN_DEBUG 1 #include #include enum encoding_type { HEX, BINARY, UTF8 }; static void check(enum encoding_type type, char *tagname, char *xmlbuf, char *verify) { int xmllen = strlen(xmlbuf); int verlen = verify ? strlen(verify) : 0; asn_TYPE_descriptor_t *td = &asn_DEF_OCTET_STRING; OCTET_STRING_t *st = 0; OCTET_STRING_t **stp = &st; asn_dec_rval_t rc; xer_type_decoder_f *decoder = 0; switch(type) { case HEX: decoder = OCTET_STRING_decode_xer_hex; break; case BINARY: td = &asn_DEF_BIT_STRING; decoder = OCTET_STRING_decode_xer_binary; break; case UTF8: decoder = OCTET_STRING_decode_xer_utf8; break; } rc = decoder(0, td, (void **)stp, tagname, xmlbuf, xmllen); printf("[%s] => [%s]:%d vs [%s]:%d, code %d\n", xmlbuf, st ? (const char *)st->buf : "", st ? st->size : 0, verify ? verify : "", verlen, rc.code); if(verify) { assert(rc.code == RC_OK); assert(st); assert(st->buf); assert(st->size == verlen); assert(!memcmp(st->buf, verify, verlen)); } else { assert(rc.code != RC_OK); } } static char buf[1024]; static int write_buf(const void *buffer, size_t size, void *key) { size_t *off = key; assert(*off + size < sizeof(buf)); memcpy(buf + *off, buffer, size); *off += size; return 0; } static void encode(char *orig, char *encoded) { OCTET_STRING_t os; size_t written = 0; asn_enc_rval_t er; memset(&os, 0, sizeof(os)); OCTET_STRING_fromString(&os, orig); er = OCTET_STRING_encode_xer_utf8(&asn_DEF_OCTET_STRING, &os, 0, 0, write_buf, &written); assert(er.encoded >= 0); buf[er.encoded] = '\0'; printf("Orig: [%s], encoded: [%s], check [%s]\n", orig, buf, encoded); assert(strcmp(buf, encoded) == 0); } int main() { check(HEX, 0, "41424", "AB@"); check(HEX, 0, "\n" "41424", "AB@"); check(HEX, 0, " 4 1 4 2 4 5 44 ", "ABED"); /* Some hard cases */ check(HEX, "z", "40", "@"); check(HEX, "z", "40", "@"); check(HEX, "z", ">40", 0); check(HEX, "z", "40", "@"); check(HEX, "z", ">40", 0); check(HEX, "z", "ignored40stuff", "@"); check(HEX, "tag", "4", "@"); check(HEX, "a-z", "7 375 73 6c6 96 b", "suslik"); /* This one has a comment in a not-yet-supported place */ /* check(HEX, "a-z", "73 75 73 6c 69 6b", "suslik"); */ check(BINARY, "tag", "", ""); check(BINARY, "tag", "blah", 0); check(BINARY, "tag", "01000001", "A"); check(BINARY, "tag", "01000 00 101 00001", "AB"); check(UTF8, 0, "one, two, three", "one, two, three"); check(UTF8, "z", "", ""); check(UTF8, "z", "<&>", "<&>"); check(UTF8, "z", "a<b&c>d", "ad"); check(UTF8, "z", "a<", "a<"); check(UTF8, "z", "a&sdfsdfsdf;b", "a&sdfsdfsdf;b"); check(UTF8, "z", "a b", "a b"); check(UTF8, "z", "a b", "a b"); check(UTF8, "z", "a繃b", "a\347\271\203b"); check(UTF8, "z", "a�b", "a�b"); check(UTF8, "z", "a�b", "a�b"); check(UTF8, "z", "", "aĬ"); check(UTF8, "z", "a&#-300;", "a&#-300;"); check(UTF8, "z", "ab", "a\014b"); check(UTF8, "z", "ab", "a\001b"); check(UTF8, "z", "a", "a\007"); encode("", ""); encode("a", "a"); encode("a\nb", "a\nb"); encode("a\bc", "ac"); encode("ab\01c\ndef\r\n", "abc\ndef\r\n"); return 0; } asn1c-0.9.24+dfsg/skeletons/tests/check-GeneralizedTime.c0000644000000000000000000001646511472004365021706 0ustar rootroot#include #include #include #include #include /* for pow(3) */ static void recognize(char *time_str, time_t expect, int as_gmt) { GeneralizedTime_t gt; struct tm tm; time_t tloc; int fv, fp; gt.buf = (uint8_t *)time_str; gt.size = strlen(time_str); tloc = asn_GT2time_frac(>, &fv, &fp, &tm, as_gmt); printf("%s: [%s] -> %ld == %ld\n", as_gmt?"GMT":"ofs", time_str, (long)tloc, (long)expect); if(tloc != -1) { printf("\t%04d-%02d-%02dT%02d:%02d:%02d.%f(%d/%d)%+03ld%02ld\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, (double)fv * pow(0.1, fp), fv, fp, (GMTOFF(tm) / 3600), labs(GMTOFF(tm) % 3600) ); } assert(tloc == expect); #ifdef HAVE_TM_GMTOFF assert(tloc == -1 || as_gmt == 0 || GMTOFF(tm) == 0); #endif if(!as_gmt) recognize(time_str, expect, 1); } static void encode(time_t tloc, const char *expect, int force_gmt) { GeneralizedTime_t *gt; struct tm tm, *tmp; tmp = localtime_r(&tloc, &tm); assert(tmp); gt = asn_time2GT(0, &tm, force_gmt); if(gt) { assert(expect); printf("[%s] vs [%s] (%d)\n", gt->buf, expect, force_gmt); assert(gt->size == (int)strlen((char *)gt->buf)); assert(!strcmp((char *)gt->buf, expect)); } else { assert(!expect); } } #define RECODE(foo, bar) recode(__LINE__, foo, bar) static void recode(int lineno, char *time_str, const char *expect) { int frac_value, frac_digits; GeneralizedTime_t gt; struct tm tm; time_t tloc; char *tz; gt.buf = (uint8_t *)time_str; gt.size = strlen(time_str); tloc = asn_GT2time_frac(>, &frac_value, &frac_digits, &tm, 1); assert(tloc != -1); gt.buf = 0; asn_time2GT_frac(>, &tm, frac_value, frac_digits, 1); assert(gt.buf); tz = getenv("TZ"); printf("%d: [%s] (%ld) => [%s] == [%s] (%d, %d) (TZ=%s)\n", lineno, time_str, (long)tloc, gt.buf, expect, frac_value, frac_digits, tz ? tz : ""); assert(strcmp((char *)gt.buf, expect) == 0); FREEMEM(gt.buf); } static void check_fractions() { GeneralizedTime_t *gt = 0; struct tm tm; int fv, fd; time_t tloc; memset(&tm, 0, sizeof tm); tm.tm_year = 70; tm.tm_mday = 1; gt = asn_time2GT_frac(gt, &tm, -1, -1, 1); assert(gt); printf("[%s]\n", gt->buf); assert(strcmp((char *)gt->buf, "19700101000000Z") == 0); gt = asn_time2GT_frac(gt, &tm, 0, 0, 1); assert(gt); printf("[%s]\n", gt->buf); assert(strcmp((char *)gt->buf, "19700101000000Z") == 0); gt = asn_time2GT_frac(gt, &tm, 0, -1, 1); assert(gt); printf("[%s]\n", gt->buf); assert(strcmp((char *)gt->buf, "19700101000000Z") == 0); gt = asn_time2GT_frac(gt, &tm, -1, 0, 1); assert(gt); printf("[%s]\n", gt->buf); assert(strcmp((char *)gt->buf, "19700101000000Z") == 0); gt = asn_time2GT_frac(gt, &tm, 10, 0, 1); assert(gt); printf("[%s]\n", gt->buf); assert(strcmp((char *)gt->buf, "19700101000000Z") == 0); /* Normalization should happen prior to calling the _frac() */ gt = asn_time2GT_frac(gt, &tm, 55, 2, 1); assert(gt); printf("[%s]\n", gt->buf); assert(strcmp((char *)gt->buf, "19700101000000.55Z") == 0); gt = asn_time2GT_frac(gt, &tm, 5, 2, 1); assert(gt); printf("[%s]\n", gt->buf); assert(strcmp((char *)gt->buf, "19700101000000.05Z") == 0); /* Normalization should happen prior calling the _frac() */ gt = asn_time2GT_frac(gt, &tm, 900, 2, 1); assert(gt); printf("[%s]\n", gt->buf); assert(strcmp((char *)gt->buf, "19700101000000Z") == 0); gt = asn_time2GT_frac(gt, &tm, 90, 2, 1); assert(gt); printf("[%s]\n", gt->buf); assert(strcmp((char *)gt->buf, "19700101000000.9Z") == 0); tloc = asn_GT2time_prec(gt, &fv, 0, 0, 1); assert(tloc == 0); assert(fv == 0); tloc = asn_GT2time_prec(gt, &fv, 1, 0, 1); assert(tloc == 0); assert(fv == 9); tloc = asn_GT2time_prec(gt, &fv, 2, 0, 1); assert(tloc == 0); assert(fv == 90); tloc = asn_GT2time_frac(gt, &fv, &fd, 0, 1); assert(tloc == 0); assert(fv == 9); assert(fd == 1); gt->buf[gt->size-1] = '0'; gt->buf[gt->size++] = 'Z'; gt->buf[gt->size] = '\0'; tloc = asn_GT2time_frac(gt, &fv, &fd, 0, 1); assert(tloc == 0); assert(fd == 2); assert(fv == 90); tloc = asn_GT2time_prec(gt, &fv, 1, 0, 1); assert(tloc == 0); assert(fv == 9); tloc = asn_GT2time_prec(gt, &fv, 100, 0, 1); assert(tloc == 0); assert(fv == 0); FREEMEM(gt->buf); FREEMEM(gt); } int main(int ac, char **av) { char *tz = getenv("TZ"); (void)av; printf("TZ = [%s]\n", tz ? tz : ""); check_fractions(); recognize("200401250", -1, 0); recognize("2004012509300", -1, 0); recognize("20040125093000-", -1, 0); recognize("20040125093007-0", -1, 0); recognize("20040125093007-080", -1, 0); recognize("200401250930.01Z", -1, 0); /* These six are from X.690:11.7.5 */ recognize("19920520240000Z", -1, 0); /* midnight represented incorrectly */ recognize("19920622123421.0Z", 709216461, 0); /* spurious trailing zeros */ recognize("19920722132100.30Z", 711811260, 0); /* spurious trailing zeros */ recognize("19920521000000Z", 706406400, 0); recognize("19920622123421Z", 709216461, 0); recognize("19920722132100.3Z", 711811260, 0); recognize("20040125093007Z", 1075023007, 0); recognize("20040125093007+00", 1075023007, 0); recognize("20040125093007.01+0000", 1075023007, 0); recognize("20040125093007,1+0000", 1075023007, 0); recognize("20040125093007-0800", 1075051807, 0); recognize("19920722132100.123000123Z", 711811260, 0); recognize("19920722132100.1230000123Z", 711811260, 0); recognize("19920722132100.12300000123Z", 711811260, 0); encode(1075023007, "20040125093007Z", 1); if(ac > 1) { /* These will be valid only inside PST time zone */ recognize("20040125093007", 1075051807, 0); recognize("200401250930", 1075051800, 0); recognize("20040125093000,01", 1075051800, 0); recognize("20040125093000,1234", 1075051800, 0); encode(1075023007, "20040125013007-0800", 0); RECODE("20050702123312", "20050702193312Z"); } #if defined(sun) || defined(__sun) || defined(_sun_) || defined(__solaris__) printf("Solaris does not have a decent timegm() function.\n"); #else /* !solaris */ RECODE("20050702123312Z", "20050702123312Z"); RECODE("20050702123312+01", "20050702113312Z"); RECODE("20050702123312,0+01", "20050702113312Z"); RECODE("20050702123312,1+01", "20050702113312.1Z"); RECODE("20050702123312.01+01", "20050702113312.01Z"); RECODE("20050702123312.00+01", "20050702113312Z"); RECODE("20050702123312.30+01", "20050702113312.3Z"); RECODE("20050702123312,30000+01", "20050702113312.3Z"); RECODE("20050702123312,300000000+01", "20050702113312.3Z"); RECODE("20050702123312.123456+01", "20050702113312.123456Z"); RECODE("20050702123312.1234567+01", "20050702113312.123456Z"); RECODE("20050702123312.12345678+01", "20050702113312.123456Z"); RECODE("20050702123312.123456789+01", "20050702113312.123456Z"); RECODE("20050702123312.2000000000+01", "20050702113312.2Z"); RECODE("20050702123312.3000000000+01", "20050702113312.3Z"); RECODE("20050702123312.4000000000+01", "20050702113312.4Z"); RECODE("20050702123312.5000000000+01", "20050702113312.5Z"); RECODE("20050702123312.5000000001+01", "20050702113312.5Z"); RECODE("20050702123312.5000010001+01", "20050702113312.500001Z"); RECODE("20050702123312.5000001001+01", "20050702113312.5Z"); RECODE("20050702123312.000001+01", "20050702113312.000001Z"); RECODE("20050702123312.0000001Z", "20050702123312Z"); RECODE("20050702123312.0080010+1056", "20050702013712.008001Z"); #endif return 0; } asn1c-0.9.24+dfsg/skeletons/tests/check-XER.c0000644000000000000000000000450111472004365017260 0ustar rootroot#include #include #include #include static void check(char *tag, char *name, xer_check_tag_e value) { xer_check_tag_e xct; xct = xer_check_tag(tag, strlen(tag), name); printf("[%s] vs [%s]: %d == %d\n", tag, name, xct, value); assert(xct == value); } static void check_next(char *xerbuf, int expected_chunk_size, pxer_chunk_type_e expected_chunk_type) { int xerbuf_len = strlen(xerbuf); pxer_chunk_type_e ch_type; ssize_t ch_size; int state = 0; if(expected_chunk_size == -1) expected_chunk_size = xerbuf_len; ch_size = xer_next_token(&state, xerbuf, xerbuf_len, &ch_type); printf("[%s]:%d\n", xerbuf, xerbuf_len); printf("chunk sizes: %ld vs %ld, chunk types: %d vs %ld\n", (long)ch_size, (long)expected_chunk_size, ch_type, (long)expected_chunk_type ); if(expected_chunk_type == -1) { assert(ch_size == 0); } else { assert(ch_size == expected_chunk_size); assert(ch_type == expected_chunk_type); } } int main() { check("", "", XCT_BROKEN); check("<", "", XCT_BROKEN); check(">", "", XCT_BROKEN); check("", "", XCT_BROKEN); check("<>", "", XCT_UNKNOWN_OP); check("", "", XCT_UNKNOWN_CL); check("", "a", XCT_BROKEN); check("<>", "a", XCT_UNKNOWN_OP); check("", "a", XCT_UNKNOWN_CL); check("a", "a", XCT_BROKEN); check("", "a", XCT_OPENING); check("", "a", XCT_CLOSING); check("", "a", XCT_BROKEN); check("", "a", XCT_BOTH); check("", "a", XCT_OPENING); check("", "a", XCT_CLOSING); check("", "a", XCT_BROKEN); check("", "a", XCT_BOTH); check("", "a", XCT_UNKNOWN_OP); check("", "tag", XCT_OPENING); check("", "tag", XCT_CLOSING); check("", "tag", XCT_BROKEN); check("", "tag", XCT_BOTH); check("", "ta", XCT_UNKNOWN_OP); check("", "ta", XCT_UNKNOWN_CL); check("", "ta", XCT_BROKEN); check("", "ta", XCT_UNKNOWN_BO); check("", "tag", XCT_BOTH); check_next("", -1, PXER_TAG); check_next("la", 5, PXER_TAG); check_next("", -1, PXER_COMMENT); return 0; } asn1c-0.9.24+dfsg/skeletons/tests/check-REAL.c0000644000000000000000000006007712015121740017346 0ustar rootroot#include #include #include #define EMIT_ASN_DEBUG 1 #include static char reconstructed[2][512]; static int reconstr_lens[2]; static int callback(const void *buffer, size_t size, void *app_key) { char *buf = reconstructed[app_key ? 1 : 0]; int *len = &reconstr_lens[app_key ? 1 : 0]; if(*len + size >= sizeof(reconstructed[0])) return -1; memcpy(buf + *len, buffer, size); *len += size; return 0; } static char * d2s(double d, int canonical, const char *str) { ssize_t s; reconstr_lens[canonical] = 0; s = REAL__dump(d, canonical, callback, (void *)(ptrdiff_t)canonical); assert(s < sizeof(reconstructed[canonical])); assert(s == reconstr_lens[canonical]); reconstructed[canonical][s] = '\0'; // ASCIIZ return reconstructed[canonical]; } /* * Verify that a string representation of a given floating point value * is as given in the (sample) and (canonical_sample) arguments. */ static void check_str_representation(double d, const char *sample, const char *canonical_sample, int lineno) { char *s0, *s1; s0 = d2s(d, 0, sample); s1 = d2s(d, 1, canonical_sample); if(sample) { printf("%03d: Checking %f->[\"%s\"] against [\"%s\"]%s\n", lineno, d, s0, sample, canonical_sample ? " (canonical follows...)" : "" ); assert(!strcmp(s0, sample)); } if(canonical_sample) { printf("%03d: Checking %f->[\"%s\"] against [\"%s\"] (canonical)\n", lineno, d, s1, canonical_sample); assert(!strcmp(s1, canonical_sample)); } } #define check(rn, d, str1, str2) \ check_impl(rn, d, str1, str2, __LINE__) static void check_impl(REAL_t *rn, double orig_dbl, const char *sample, const char *canonical_sample, int lineno) { double val; uint8_t *p, *end; int ret; printf("Line %d: double value %.12f [", lineno, orig_dbl); for(p = (uint8_t *)&orig_dbl, end = p + sizeof(double); p < end ; p++) printf("%02x", *p); printf("] (ilogb %d)\n", ilogb(orig_dbl)); val = frexp(orig_dbl, &ret); printf("frexp(%f, %d): [", val, ret); for(p = (uint8_t *)&val, end = p + sizeof(double); p < end ; p++) printf("%02x", *p); printf("]\n"); ret = asn_double2REAL(rn, orig_dbl); assert(ret == 0); printf("converted into ["); for(p = rn->buf, end = p + rn->size; p < end; p++) printf("%02x", *p); printf("]: %d\n", rn->size); ret = asn_REAL2double(rn, &val); assert(ret == 0); printf("and back to double: ["); for(p = (uint8_t *)&val, end = p + sizeof(double); p < end ; p++) printf("%02x", *p); printf("] (ilogb %d)\n", ilogb(val)); printf("%.12f vs %.12f\n", val, orig_dbl); assert((isnan(orig_dbl) && isnan(val)) || val == orig_dbl); printf("OK\n"); check_str_representation(val, sample, canonical_sample, lineno); } static void check_xer(int fuzzy, double orig_value) { asn_enc_rval_t er; asn_dec_rval_t rc; REAL_t st; REAL_t *newst0 = 0; REAL_t *newst1 = 0; REAL_t **newst0p = &newst0; REAL_t **newst1p = &newst1; double value0, value1; int ret; memset(&st, 0, sizeof(st)); ret = asn_double2REAL(&st, orig_value); assert(ret == 0); reconstr_lens[0] = 0; reconstr_lens[1] = 0; er = xer_encode(&asn_DEF_REAL, &st, XER_F_BASIC, callback, 0); assert(er.encoded == reconstr_lens[0]); er = xer_encode(&asn_DEF_REAL, &st, XER_F_CANONICAL, callback, (void *)1); assert(er.encoded == reconstr_lens[1]); reconstructed[0][reconstr_lens[0]] = 0; reconstructed[1][reconstr_lens[1]] = 0; printf("%f vs (%d)[%s] & (%d)%s", orig_value, reconstr_lens[1], reconstructed[1], reconstr_lens[0], reconstructed[0] ); rc = xer_decode(0, &asn_DEF_REAL, (void **)newst0p, reconstructed[0], reconstr_lens[0]); assert(rc.code == RC_OK); assert(rc.consumed < reconstr_lens[0]); rc = xer_decode(0, &asn_DEF_REAL, (void **)newst1p, reconstructed[1], reconstr_lens[1]); assert(rc.code == RC_OK); assert(rc.consumed == reconstr_lens[1]); ret = asn_REAL2double(newst0, &value0); assert(ret == 0); ret = asn_REAL2double(newst1, &value1); assert(ret == 0); assert((isnan(value0) && isnan(orig_value)) || value0 == orig_value || fuzzy); assert((isnan(value1) && isnan(orig_value)) || value1 == orig_value); assert(newst0->size == st.size || fuzzy); assert(newst1->size == st.size); assert(fuzzy || memcmp(newst0->buf, st.buf, st.size) == 0); assert(memcmp(newst1->buf, st.buf, st.size) == 0); } static void check_ber_buffer_twoway(double d, const char *sample, const char *canonical_sample, uint8_t *inbuf, size_t insize, uint8_t *outbuf, size_t outsize, int lineno) { REAL_t rn; double val; int ret; /* * Decode our expected buffer and check that it matches the given (d). */ rn.buf = inbuf; rn.size = insize; asn_REAL2double(&rn, &val); if(isnan(val)) assert(isnan(d)); if(isnan(d)) assert(isnan(val)); if(!isnan(val) && !isnan(d)) { assert(copysign(1.0, d) == copysign(1.0, val)); assert(d == val); } /* * Encode value and check that it matches our expected buffer. */ memset(&rn, 0, sizeof(rn)); ret = asn_double2REAL(&rn, d); assert(ret == 0); if(rn.size != outsize) { printf("Encoded %f into %d expected %ld\n", d, (int)rn.size, outsize); assert(rn.size == outsize); } assert(memcmp(rn.buf, outbuf, rn.size) == 0); check_str_representation(d, sample, canonical_sample, lineno); } static void check_ber_buffer_oneway(double d, const char *sample, const char *canonical_sample, uint8_t *buf, size_t bufsize, int lineno) { REAL_t rn; double val; uint8_t *p, *end; int ret; memset(&rn, 0, sizeof(rn)); printf("verify double value %.12f [", d); for(p = (uint8_t *)&d, end = p + sizeof(double); p < end ; p++) printf("%02x", *p); printf("] (ilogb %d)\n", ilogb(d)); ret = asn_double2REAL(&rn, d); assert(ret == 0); printf("canonical DER: ["); for(p = rn.buf, end = p + rn.size; p < end; p++) printf("%02x", *p); printf("]\n"); rn.buf = buf; rn.size = bufsize; printf("received as: ["); for(p = rn.buf, end = p + rn.size; p < end; p++) printf("%02x", *p); printf("]\n"); ret = asn_REAL2double(&rn, &val); assert(ret == 0); printf("%.12f vs %.12f\n", d, val); assert(val == d); check_str_representation(val, sample, canonical_sample, lineno); } /* * 8.5.7 Verify binary encoding, two-way. */ static void check_ber_857_encoding(int base, int sign, int scaling_factor, int exponent, int mantissa) { uint8_t buf[100]; uint8_t *b = buf; int explen, mantlen; REAL_t rn; static REAL_t rn_check; double d; double verify; int baseF = 0; int ret; #define BIT(b) (1<<(b - 1)) switch(base) { case 0: baseF = 1; break; case 1: baseF = 3; break; case 2: baseF = 4; break; default: assert(base >= 0 && base <= 2); } if(exponent >= -128 && exponent <= 127) { explen = 1; } else { assert(exponent > -60000 && exponent < 60000); explen = 2; } if(mantissa == 0) { mantlen = 0; } else if(mantissa >= 0 && mantissa <= 255) { mantlen = 1; } else if(mantissa >= 0 && mantissa <= 65535) { mantlen = 2; } else { assert(mantissa >= 0 && mantissa <= 256 * 65536); mantlen = 3; } *b = BIT(8) | (sign ? BIT(7) : 0); *b |= (base & 0x03) << 4; /* 8.5.7.2 */ *b |= (scaling_factor & 0x03) << 2; /* 8.5.7.3 */ *b |= ((explen - 1) & 0x03); /* 8.5.7.4 */ b++; switch(explen) { case 2: *b++ = (int8_t)(exponent >> 8); case 1: *b++ = (int8_t)exponent; } switch(mantlen) { case 3: *b++ = (mantissa >> 16) & 0xff; case 2: *b++ = (mantissa >> 8) & 0xff; case 1: *b++ = (mantissa & 0xff); } verify = (sign ? -1.0 : 1.0) * ldexp(mantissa, exponent * baseF + scaling_factor); /* Verify than encoding of this double value round-trips */ if(!isinf(verify)) { d = verify; verify = 0.0; ret = asn_double2REAL(&rn_check, d); assert(ret == 0); ret = asn_REAL2double(&rn_check, &verify); assert(ret == 0); assert(d == verify); /* Verify with a slight non-friendly offset. Not too easy. */ d = verify - 0.13; verify = 0.0; ret = asn_double2REAL(&rn_check, d); assert(ret == 0); ret = asn_REAL2double(&rn_check, &verify); assert(ret == 0); assert(ret == 0); assert(d == verify); } verify = (sign ? -1.0 : 1.0) * ldexp(mantissa, exponent * baseF + scaling_factor); rn.buf = buf; rn.size = b - buf; ret = asn_REAL2double(&rn, &d); if(!isinf(verify) && (ret != 0 || d != verify)) { printf("Converting B=%d, S=%d, F=%d, E=%d/%d, M=%d/%d\n", (1 << baseF), sign, scaling_factor, exponent, explen, mantissa, mantlen); printf("Verify: %e\n", verify); uint8_t *p; printf("received as: ["); for(p = buf; p < b; p++) printf("%02x", *p); printf("]\n"); assert(ret == 0); printf("Converted: %e\n", d); assert(d == verify); } } static void check_ber_encoding() { static const double zero = 0.0; #define CHECK_BER_STRICT(v, nocan, can, inbuf, outbuf) \ check_ber_buffer_twoway(v, nocan, can, inbuf, sizeof(inbuf), \ outbuf, sizeof(outbuf), __LINE__) #define CHECK_BER_NONSTRICT(v, nocan, can, buf) \ check_ber_buffer_oneway(v, nocan, can, buf, sizeof(buf), __LINE__) /* * X.690 8.4 Encoding of an enumerated value. */ /* 8.5.2 If the real value is the value plus zero, * there shall be no contents octet in the encoding */ { uint8_t b_0[] = {}; CHECK_BER_STRICT(0.0, "0", "0", b_0, b_0); } /* 8.5.3 When -0 is to be encoded, there shall be only one contents octet */ { uint8_t b_m0[] = { 0x43 }; CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0, b_m0); } /* Old way of encoding -0.0: 8.5.6 a) */ { uint8_t b_m0[] = { 0x43 }; uint8_t b_m0_856a[] = { 0xC0, 0x00 }; /* #8.5.6 a) */ uint8_t b_m0_856a_1[] = { 0xC0, 0x00, 0x00 }; uint8_t b_m0_856a_2[] = { 0xC0, 0x00, 0x00, 0x00 }; uint8_t b_m0_856a_3[] = { 0xC0, 0x00, 0x00, 0x00, 0x00 }; CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0_856a, b_m0); CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0_856a_1, b_m0); CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0_856a_2, b_m0); CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0_856a_3, b_m0); } /* 8.5.6 c) => 8.5.9 SpecialRealValue */ { uint8_t b_pinf[] = { 0x40 }; uint8_t b_minf[] = { 0x41 }; uint8_t b_nan[] = { 0x42 }; CHECK_BER_STRICT(1.0/zero, "", "", b_pinf, b_pinf); CHECK_BER_STRICT(-1.0/zero, "", "", b_minf, b_minf); CHECK_BER_STRICT(zero/zero, "", "", b_nan, b_nan); } /* 8.5.6 b) => 8.5.8 Decimal encoding is used; NR1 form */ { uint8_t b_0_nr1[] = { 0x01, '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_0_nr1, b_0); } { uint8_t b_0_nr1[] = { 0x01, '0', '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_0_nr1, b_0); } { uint8_t b_0_nr1[] = { 0x01, ' ', '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_0_nr1, b_0); } { uint8_t b_p0_nr1[] = { 0x01, '+', '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_p0_nr1, b_0); } { uint8_t b_p0_nr1[] = { 0x01, ' ', '+', '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_p0_nr1, b_0); } { uint8_t b_m0_nr1[] = { 0x01, '-', '0' }; uint8_t b_m0[] = { 0x43 }; CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0_nr1, b_m0); } { uint8_t b_m0_nr1[] = { 0x01, ' ', '-', '0' }; uint8_t b_m0[] = { 0x43 }; CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0_nr1, b_m0); } { uint8_t b_1_nr1[] = { 0x01, '1' }; uint8_t b_1[] = { 0x80, 0x00, 0x01 }; CHECK_BER_STRICT(1.0, "1.0", "1.0E0", b_1_nr1, b_1); } { uint8_t b_1_nr1[] = { 0x01, '0', '1' }; uint8_t b_1[] = { 0x80, 0x00, 0x01 }; CHECK_BER_STRICT(1.0, "1.0", "1.0E0", b_1_nr1, b_1); } { uint8_t b_1_nr1[] = { 0x01, ' ', '1' }; uint8_t b_1[] = { 0x80, 0x00, 0x01 }; CHECK_BER_STRICT(1.0, "1.0", "1.0E0", b_1_nr1, b_1); } { uint8_t b_p1_nr1[] = { 0x01, '+', '1' }; uint8_t b_1[] = { 0x80, 0x00, 0x01 }; CHECK_BER_STRICT(1.0, "1.0", "1.0E0", b_p1_nr1, b_1); } { uint8_t b_p1_nr1[] = { 0x01, ' ', '+', '1' }; uint8_t b_1[] = { 0x80, 0x00, 0x01 }; CHECK_BER_STRICT(1.0, "1.0", "1.0E0", b_p1_nr1, b_1); } { uint8_t b_m1_nr1[] = { 0x01, '-', '1' }; uint8_t b_m1[] = { 0xC0, 0x00, 0x01 }; CHECK_BER_STRICT(-1.0, "-1.0", "-1.0E0", b_m1_nr1, b_m1); } { uint8_t b_m1_nr1[] = { 0x01, ' ', '-', '1' }; uint8_t b_m1[] = { 0xC0, 0x00, 0x01 }; CHECK_BER_STRICT(-1.0, "-1.0", "-1.0E0", b_m1_nr1, b_m1); } { uint8_t comma_symbol[] = { '.', ',' }; int csi; for(csi = 0; csi < 2; csi++) { uint8_t CS = comma_symbol[csi]; /* 8.5.6 b) => 8.5.8 Decimal encoding is used; NR2 form */ { uint8_t b_0_nr2[] = { 0x02, '0', CS, '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_0_nr2, b_0); } { uint8_t b_0_nr2[] = { 0x02, '0', '0', CS, '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_0_nr2, b_0); } { uint8_t b_0_nr2[] = { 0x02, ' ', '0', CS, '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_0_nr2, b_0); } { uint8_t b_p0_nr2[] = { 0x02, '+', '0', CS, '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_p0_nr2, b_0); } { uint8_t b_p0_nr2[] = { 0x02, ' ', '+', '0', CS, '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_p0_nr2, b_0); } { uint8_t b_m0_nr2[] = { 0x02, '-', '0', CS, '0' }; uint8_t b_m0[] = { 0x43 }; CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0_nr2, b_m0); } { uint8_t b_m0_nr2[] = { 0x02, ' ', '-', '0', CS, '0' }; uint8_t b_m0[] = { 0x43 }; CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0_nr2, b_m0); } /* 8.5.6 b) => 8.5.8 NR2 "1." */ { uint8_t b_1_nr2[] = { 0x02, '1', CS }; uint8_t b_1[] = { 0x80, 0x00, 0x01 }; CHECK_BER_STRICT(1.0, "1.0", "1.0E0", b_1_nr2, b_1); } { uint8_t b_1_nr2[] = { 0x02, '0', '1', CS }; uint8_t b_1[] = { 0x80, 0x00, 0x01 }; CHECK_BER_STRICT(1.0, "1.0", "1.0E0", b_1_nr2, b_1); } { uint8_t b_1_nr2[] = { 0x02, ' ', '1', CS }; uint8_t b_1[] = { 0x80, 0x00, 0x01 }; CHECK_BER_STRICT(1.0, "1.0", "1.0E0", b_1_nr2, b_1); } { uint8_t b_p1_nr2[] = { 0x02, '+', '1', CS }; uint8_t b_1[] = { 0x80, 0x00, 0x01 }; CHECK_BER_STRICT(1.0, "1.0", "1.0E0", b_p1_nr2, b_1); } { uint8_t b_p1_nr2[] = { 0x02, ' ', '+', '1', CS }; uint8_t b_1[] = { 0x80, 0x00, 0x01 }; CHECK_BER_STRICT(1.0, "1.0", "1.0E0", b_p1_nr2, b_1); } { uint8_t b_m1_nr2[] = { 0x02, '-', '1', CS }; uint8_t b_m1[] = { 0xC0, 0x00, 0x01 }; CHECK_BER_STRICT(-1.0, "-1.0", "-1.0E0", b_m1_nr2, b_m1); } { uint8_t b_m1_nr2[] = { 0x02, ' ', '-', '1', CS }; uint8_t b_m1[] = { 0xC0, 0x00, 0x01 }; CHECK_BER_STRICT(-1.0, "-1.0", "-1.0E0", b_m1_nr2, b_m1); } /* 8.5.6 b) => 8.5.8 NR2 ".5" */ { uint8_t b_05_nr2[] = { 0x02, CS, '5' }; uint8_t b_05[] = { 0x80, 0xff, 0x01 }; CHECK_BER_STRICT(0.5, "0.5", "5.0E-1", b_05_nr2, b_05); } { uint8_t b_05_nr2[] = { 0x02, '0', CS, '5' }; uint8_t b_05[] = { 0x80, 0xff, 0x01 }; CHECK_BER_STRICT(0.5, "0.5", "5.0E-1", b_05_nr2, b_05); } { uint8_t b_05_nr2[] = { 0x02, ' ', CS, '5' }; uint8_t b_05[] = { 0x80, 0xff, 0x01 }; CHECK_BER_STRICT(0.5, "0.5", "5.0E-1", b_05_nr2, b_05); } { uint8_t b_p1_nr2[] = { 0x02, '+', CS, '5' }; uint8_t b_05[] = { 0x80, 0xff, 0x01 }; CHECK_BER_STRICT(0.5, "0.5", "5.0E-1", b_p1_nr2, b_05); } { uint8_t b_p1_nr2[] = { 0x02, ' ', '+', CS, '5' }; uint8_t b_05[] = { 0x80, 0xff, 0x01 }; CHECK_BER_STRICT(0.5, "0.5", "5.0E-1", b_p1_nr2, b_05); } { uint8_t b_m05_nr2[] = { 0x02, '-', CS, '5' }; uint8_t b_m05[] = { 0xC0, 0xff, 0x01 }; CHECK_BER_STRICT(-0.5, "-0.5", "-5.0E-1", b_m05_nr2, b_m05); } { uint8_t b_m05_nr2[] = { 0x02, ' ', '-', CS, '5' }; uint8_t b_m05[] = { 0xC0, 0xff, 0x01 }; CHECK_BER_STRICT(-0.5, "-0.5", "-5.0E-1", b_m05_nr2, b_m05); } /* 8.5.6 b) => 8.5.8 Decimal encoding is used; NR3 form */ { uint8_t b_0_nr3[] = { 0x03, '0', CS, '0', 'e', '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_0_nr3, b_0); } { uint8_t b_0_nr3[] = { 0x03, '0', '0', CS, '0', 'E', '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_0_nr3, b_0); } { uint8_t b_0_nr3[] = { 0x03, ' ', '0', CS, '0', 'e', '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_0_nr3, b_0); } { uint8_t b_p0_nr3[] = { 0x03, '+', '0', CS, '0', 'E', '+', '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_p0_nr3, b_0); } { uint8_t b_p0_nr3[] = { 0x03, ' ', '+', '0', CS, '0', 'e', '+', '0' }; uint8_t b_0[] = { }; CHECK_BER_STRICT(0.0, "0", "0", b_p0_nr3, b_0); } { uint8_t b_m0_nr3[] = { 0x03, '-', '0', CS, '0', 'E', '-', '0' }; uint8_t b_m0[] = { 0x43 }; CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0_nr3, b_m0); } { uint8_t b_m0_nr3[] = { 0x03, ' ', '-', '0', CS, '0', 'e', '-', '0' }; uint8_t b_m0[] = { 0x43 }; CHECK_BER_STRICT(-0.0, "-0", "-0", b_m0_nr3, b_m0); } /* 8.5.6 b) => 8.5.8 NR3 "5.e-1" */ { uint8_t b_5_nr3[] = { 0x03, '5', CS, 'e', '-', '1' }; uint8_t b_5[] = { 0x80, 0xff, 0x01 }; CHECK_BER_STRICT(0.5, "0.5", "5.0E-1", b_5_nr3, b_5); } { uint8_t b_5_nr3[] = { 0x03, '0', '5', CS, 'E', '-', '1' }; uint8_t b_5[] = { 0x80, 0xff, 0x01 }; CHECK_BER_STRICT(0.5, "0.5", "5.0E-1", b_5_nr3, b_5); } { uint8_t b_5_nr3[] = { 0x03, ' ', '5', CS, 'e', '-', '1' }; uint8_t b_5[] = { 0x80, 0xff, 0x01 }; CHECK_BER_STRICT(0.5, "0.5", "5.0E-1", b_5_nr3, b_5); } { uint8_t b_p5_nr3[] = { 0x03, '+', '5', CS, 'E', '-', '1' }; uint8_t b_5[] = { 0x80, 0xff, 0x01 }; CHECK_BER_STRICT(0.5, "0.5", "5.0E-1", b_p5_nr3, b_5); } { uint8_t b_p5_nr3[] = { 0x03, ' ', '+', '5', CS, 'e', '-', '1' }; uint8_t b_5[] = { 0x80, 0xff, 0x01 }; CHECK_BER_STRICT(0.5, "0.5", "5.0E-1", b_p5_nr3, b_5); } { uint8_t b_m5_nr3[] = { 0x03, '-', '5', CS, 'E', '-', '1' }; uint8_t b_m5[] = { 0xC0, 0xff, 0x01 }; CHECK_BER_STRICT(-0.5, "-0.5", "-5.0E-1", b_m5_nr3, b_m5); } { uint8_t b_m5_nr3[] = { 0x03, ' ', '-', '5', CS, 'e', '-', '1' }; uint8_t b_m5[] = { 0xC0, 0xff, 0x01 }; CHECK_BER_STRICT(-0.5, "-0.5", "-5.0E-1", b_m5_nr3, b_m5); } /* 8.5.6 b) => 8.5.8 NR3 ".5e1" */ { uint8_t b_05_nr3[] = { 0x03, CS, '5', 'e', '+', '1' }; uint8_t b_05[] = { 0x80, 0x00, 0x05 }; CHECK_BER_STRICT(5.0, "5.0", "5.0E0", b_05_nr3, b_05); } { uint8_t b_05_nr3[] = { 0x03, '0', CS, '5', 'E', '+', '1'}; uint8_t b_05[] = { 0x80, 0x00, 0x05 }; CHECK_BER_STRICT(5.0, "5.0", "5.0E0", b_05_nr3, b_05); } { uint8_t b_05_nr3[] = { 0x03, ' ', CS, '5', 'e', '1'}; uint8_t b_05[] = { 0x80, 0x00, 0x05 }; CHECK_BER_STRICT(5.0, "5.0", "5.0E0", b_05_nr3, b_05); } { uint8_t b_p1_nr3[] = { 0x03, '+', CS, '5', 'E', '1' }; uint8_t b_05[] = { 0x80, 0x00, 0x05 }; CHECK_BER_STRICT(5.0, "5.0", "5.0E0", b_p1_nr3, b_05); } { uint8_t b_p1_nr3[] = { 0x03, ' ', '+', CS, '5', 'e', '+', '1' }; uint8_t b_05[] = { 0x80, 0x00, 0x05 }; CHECK_BER_STRICT(5.0, "5.0", "5.0E0", b_p1_nr3, b_05); } { uint8_t b_m05_nr3[] = { 0x03, '-', CS, '5', 'E', '+', '1' }; uint8_t b_m05[] = { 0xC0, 0x00, 0x05 }; CHECK_BER_STRICT(-5.0, "-5.0", "-5.0E0", b_m05_nr3, b_m05); } { uint8_t b_m05_nr3[] = { 0x03, ' ', '-', CS, '5', 'e', '1' }; uint8_t b_m05[] = { 0xC0, 0x00, 0x05 }; CHECK_BER_STRICT(-5.0, "-5.0", "-5.0E0", b_m05_nr3, b_m05); } } /* for(comma symbol) */ } /* Scan through the range of bits, construct the valid base-2 numbers, and * try two-way conversion with them */ { int base, sign, scaling_factor, exponent, mantissa; for(base = 0; base <= 2; base++) { for(sign = 0; sign <= 1; sign++) { for(scaling_factor = 0; scaling_factor <= 3; scaling_factor++) { for(exponent = -1000; exponent < 1000; exponent += (exponent > -990 && exponent < 990) ? 100 : 1) { for(mantissa = 0; mantissa < 66000; mantissa += (mantissa > 300 && mantissa < 65400) ? 100 : 1) { check_ber_857_encoding(base, sign, scaling_factor, exponent, mantissa); } } } } } } { uint8_t b_1_0[] = { 0x80, 0xcc, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; uint8_t b_1_1[] = { 0x80, 0xcc, 0x11, 0x99, 0x99, 0x99, 0x99, 0x99, 0x9a }; uint8_t b_3_14[] = { 0x80, 0xcd, 0x19, 0x1e, 0xb8, 0x51, 0xeb, 0x85, 0x1f }; uint8_t b_3_14_mo1[] = { 0xC0, 0xc5, 0x19, 0x1e, 0xb8, 0x51, 0xeb, 0x85, 0x1f,3}; uint8_t b_3_14_mo2[] = { 0x80, 0xbd, 0x19, 0x1e, 0xb8, 0x51, 0xeb, 0x85, 0x1f,3,2}; CHECK_BER_NONSTRICT(1.0, "1.0", "1.0E0", b_1_0); CHECK_BER_NONSTRICT(1.1, "1.1", "1.1E0", b_1_1); CHECK_BER_NONSTRICT(3.14, "3.14", "3.14E0", b_3_14); /* These two are very interesting! They check mantissa overflow! */ CHECK_BER_NONSTRICT(-3.14, "-3.14", "-3.14E0", b_3_14_mo1); CHECK_BER_NONSTRICT(3.14, "3.14", "3.14E0", b_3_14_mo2); } } int main() { REAL_t rn; static const double zero = 0.0; memset(&rn, 0, sizeof(rn)); check_ber_encoding(); check(&rn, 0.0, "0", "0"); check(&rn, -0.0, "-0", "-0"); /* minus-zero */ check(&rn, zero/zero, "", ""); check(&rn, 1.0/zero, "", ""); check(&rn, -1.0/zero, "", ""); check(&rn, 1.0, "1.0", "1.0E0"); check(&rn, -1.0, "-1.0", "-1.0E0"); check(&rn, 0.1, "0.1", "1.0E-1"); check(&rn, 0.01, "0.01", "1.0E-2"); check(&rn, 0.02, "0.02", "2.0E-2"); check(&rn, 0.09, "0.09", "9.0E-2"); check(&rn, 1.5, "1.5", "1.5E0"); check(&rn, 0.33333, "0.33333", "3.3333E-1"); check(&rn, 2, "2.0", "2.0E0"); check(&rn, 2.1, "2.1", "2.1E0"); check(&rn, 3, "3.0", "3.0E0"); check(&rn, 3.1, "3.1", "3.1E0"); check(&rn, 3.14, "3.14", "3.14E0"); check(&rn, 3.1415, "3.1415", "3.1415E0"); check(&rn, 3.141592, "3.141592", "3.141592E0"); check(&rn, 3.14159265, "3.14159265", "3.14159265E0"); check(&rn, -3.14159265, "-3.14159265", "-3.14159265E0"); check(&rn, 14159265.0, "14159265.0", "1.4159265E7"); check(&rn, -123456789123456789.0, "-123456789123456784.0", "-1.234567891234568E17"); check(&rn, 0.00000000001, "0.00000000001", "9.999999999999999E-12"); check(&rn, 0.00000000002, "0.00000000002", "2.0E-11"); check(&rn, 0.00000000009, "0.00000000009", "9.0E-11"); check(&rn, 0.000000000002, "0.000000000002", "2.0E-12"); check(&rn, 0.0000000000002, "0.0000000000002", "2.0E-13"); check(&rn, 0.00000000000002, "0.00000000000002", "2.0E-14"); check(&rn, 0.000000000000002, "0.000000000000002", "2.0E-15"); check(&rn, 0.0000000000000002, "0.0", "2.0E-16"); check(&rn, 0.0000000000000000000001, "0.0", "1.0E-22"); check(&rn, 0.000000000000000000000000000001, "0.0", "1.0E-30"); /* proved 2B a problem */ check(&rn,-0.000000000000000000000000000001, "-0.0", "-1.0E-30"); /* proved 2B a problem */ check(&rn, 0.0000000000010000000001000000000001, 0, 0); check(&rn, 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, 0, 0); check(&rn, 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, 0, 0); check(&rn,-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, 0, 0); check(&rn,-3.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333, 0, 0); check(&rn, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000033333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333, 0, 0); check(&rn, -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, 0, 0); #ifdef NAN check_xer(0, NAN); /* "" */ #else check_xer(0, zero/zero); /* "" */ #endif #ifdef INFINITY check_xer(0, INFINITY); /* "" */ check_xer(0, -INFINITY); /* "" */ #else check_xer(0, 1.0/zero); /* "" */ check_xer(0, -1.0/zero); /* "" */ #endif check_xer(0, 1.0); check_xer(0, -1.0); check_xer(0, 1.5); check_xer(0, 123); check_xer(1, 0.0000000000000000000001); check_xer(1, -0.0000000000000000000001); return 0; } asn1c-0.9.24+dfsg/skeletons/tests/check-UTCTime.c0000644000000000000000000000245111472004365020076 0ustar rootroot#include #include #include #include #include static void check(char *time_str, time_t sample, int as_gmt) { UTCTime_t gt; struct tm tm; time_t tloc; gt.buf = (uint8_t *)time_str; gt.size = strlen(time_str); tloc = asn_UT2time(>, &tm, as_gmt); printf("[%s] -> %ld == %ld\n", time_str, (long)tloc, (long)sample); if(tloc != -1) printf("\t%d-%d-%dT%02d:%02d:%02d %ld\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, GMTOFF(tm) ); assert(tloc == sample); assert(tloc == -1 || as_gmt == 0 || GMTOFF(tm) == 0); if(as_gmt) check(time_str, sample, as_gmt); } int main(int ac, char **av) { (void)av; check("0401250", -1, 0); check("0401250930", -1, 0); /* "Z" or "(+|-)hhmm" required */ check("04012509300", -1, 0); check("040125093000-", -1, 0); check("040125093007-0", -1, 0); check("040125093007-080", -1, 0); check("0401250930.01Z", -1, 0); check("040125093007Z", 1075023007, 0); check("040125093007+00", 1075023007, 0); check("040125093007-0800", 1075051807, 0); if(ac > 1) { /* These will be valid only inside PST time zone */ check("040125093007", 1075051807, 0); check("040125093000,01", 1075051800, 0); check("040125093000,1234", 1075051800, 0); } return 0; } asn1c-0.9.24+dfsg/skeletons/tests/check-PER.c0000644000000000000000000002024612015121740017243 0ustar rootroot#include #include #include static void check_per_decoding() { uint8_t buf[] = { 0xB7, 0x19, 0x2F, 0xEE, 0xAD }; uint8_t tmpbuf[10]; int32_t z; asn_per_data_t pos; memset(&pos, 0, sizeof(pos)); pos.buffer = buf; pos.nboff = 0; pos.nbits = sizeof(buf) * 8; z = per_get_few_bits(&pos, 32); assert(z == -1); assert(pos.nbits == sizeof(buf) * 8); z = per_get_few_bits(&pos, 0); assert(z == 0); assert(pos.nboff == 0); assert(pos.nbits == sizeof(buf) * 8); z = per_get_few_bits(&pos, 1); assert(z == 1); assert(pos.nboff == 1); assert(pos.nbits == sizeof(buf) * 8); z = per_get_few_bits(&pos, 2); assert(z == 1); assert(pos.nboff == 3); assert(pos.nbits == sizeof(buf) * 8); z = per_get_few_bits(&pos, 2); assert(z == 2); assert(pos.nboff == 5); assert(pos.nbits == sizeof(buf) * 8); z = per_get_few_bits(&pos, 3); assert(z == 7); assert(pos.nboff == 8); assert(pos.nbits == sizeof(buf) * 8); z = per_get_few_bits(&pos, 8); assert(z == 0x19); assert(pos.nboff == 8); assert(pos.nbits == (sizeof(buf) - 1) * 8); z = per_get_few_bits(&pos, 1); assert(z == 0); assert(pos.nboff == 1); assert(pos.nbits == (sizeof(buf) - 2) * 8); z = per_get_few_bits(&pos, 3); assert(z == 2); assert(pos.nboff == 4); assert(pos.nbits == (sizeof(buf) - 2) * 8); z = per_get_few_bits(&pos, 8); assert(z == 254); assert(pos.nboff == 12); pos.buffer = buf; pos.nboff = 2; pos.nbits = sizeof(buf) * 8; z = per_get_few_bits(&pos, 24); assert(z == 14443711); /* Get full 31-bit range */ pos.buffer = buf; pos.nboff = 7; pos.nbits = sizeof(buf) * 8; z = per_get_few_bits(&pos, 31); assert(z == 1179384747); /* Get a bit shifted range */ pos.buffer = buf; pos.nboff = 6; pos.nbits = sizeof(buf) * 8; z = per_get_few_bits(&pos, 31); assert(z == 1663434197); pos.buffer = buf; pos.nboff = 0; pos.nbits = sizeof(buf) * 8; z = per_get_many_bits(&pos, tmpbuf, 0, sizeof(buf) * 8); assert(z == 0); assert(buf[0] == tmpbuf[0]); assert(buf[1] == tmpbuf[1]); assert(buf[2] == tmpbuf[2]); assert(buf[3] == tmpbuf[3]); assert(buf[4] == tmpbuf[4]); pos.buffer = buf; pos.nboff = 1; pos.nbits = sizeof(buf) * 8; z = per_get_many_bits(&pos, tmpbuf, 0, sizeof(buf) * 8); assert(z == -1); pos.buffer = buf; pos.nboff = 1; pos.nbits = sizeof(buf) * 8; z = per_get_many_bits(&pos, tmpbuf, 0, sizeof(buf) * 8 - 1); assert(z == 0); assert(tmpbuf[0] == 110); assert(tmpbuf[1] == 50); assert(tmpbuf[2] == 95); assert(tmpbuf[3] == 221); assert(tmpbuf[4] == 90); pos.buffer = buf; pos.nboff = 1; pos.nbits = sizeof(buf) * 8; z = per_get_many_bits(&pos, tmpbuf, 1, sizeof(buf) * 8 - 1); assert(z == 0); assert(tmpbuf[0] == 55); assert(tmpbuf[0] != buf[0]); assert(tmpbuf[1] == buf[1]); assert(tmpbuf[2] == buf[2]); assert(tmpbuf[3] == buf[3]); assert(tmpbuf[4] == buf[4]); } static int Ignore(const void *data, size_t size, void *op_key) { return 0; } static void check_per_encoding() { asn_per_outp_t po; int ret; po.buffer = po.tmpspace; po.nboff = 0; po.nbits = 0; po.outper = Ignore; po.op_key = 0; po.tmpspace[0] = 0xff; ret = per_put_few_bits(&po, 0, 0); assert(ret == 0); assert(po.nboff == 0); assert(po.buffer == po.tmpspace); assert(po.tmpspace[0] == 0xff); ret = per_put_few_bits(&po, 0, 1); assert(ret == 0); assert(po.nboff == 1); assert(po.nbits == 8 * sizeof(po.tmpspace)); assert(po.buffer == po.tmpspace); assert(po.tmpspace[0] == 0x00); ret = per_put_few_bits(&po, 1, 1); assert(ret == 0); assert(po.nboff == 2); assert(po.nbits == 8 * sizeof(po.tmpspace)); assert(po.buffer == po.tmpspace); assert(po.tmpspace[0] == 0x40); ret = per_put_few_bits(&po, 1, 1); assert(ret == 0); assert(po.nboff == 3); assert(po.nbits == 8 * sizeof(po.tmpspace)); assert(po.buffer == po.tmpspace); assert(po.tmpspace[0] == 0x60); ret = per_put_few_bits(&po, 15, 5); assert(ret == 0); assert(po.nboff == 8); assert(po.nbits == 8 * sizeof(po.tmpspace)); assert(po.buffer == po.tmpspace); assert(po.tmpspace[0] == 0x6F); ret = per_put_few_bits(&po, 0xf0ff, 16); assert(ret == 0); assert(po.nboff == 16); assert(po.nbits == 8 * sizeof(po.tmpspace) - 8); assert(po.buffer == po.tmpspace + 1); assert(po.tmpspace[0] == 0x6F); assert(po.tmpspace[1] == 0xf0); assert(po.tmpspace[2] == 0xff); po.nboff--; ret = per_put_few_bits(&po, 2, 1); assert(ret == 0); assert(po.nboff == 8); assert(po.nbits == 8 * sizeof(po.tmpspace) - 16); assert(po.buffer == po.tmpspace + 2); assert(po.tmpspace[0] == 0x6F); assert(po.tmpspace[1] == 0xf0); assert(po.tmpspace[2] == 0xfe); ret = per_put_few_bits(&po, 2, 32); assert(ret == -1); ret = per_put_few_bits(&po, 2, -1); assert(ret == -1); ret = per_put_few_bits(&po, -1, 31); assert(ret == 0); assert(po.nboff == 31); assert(po.nbits == 8 * sizeof(po.tmpspace) - 24); assert(po.buffer == po.tmpspace + 3); assert(po.tmpspace[0] == 0x6F); assert(po.tmpspace[1] == 0xf0); assert(po.tmpspace[2] == 0xfe); assert(po.tmpspace[3] == 0xff); assert(po.tmpspace[4] == 0xff); assert(po.tmpspace[5] == 0xff); assert(po.tmpspace[6] == 0xfe); } /* * Add N bits after P bits. Should result in N+P bits added. */ static void check_per_encoding_auto() { int prior, next; int ret, i; for(prior = 0; prior <= 31; prior++) { for(next = 0; next <= 31; next++) { asn_per_outp_t po; po.buffer = po.tmpspace; po.nboff = 0; po.nbits = 0; po.outper = Ignore; po.op_key = 0; po.tmpspace[0] = 0xff; ret = per_put_few_bits(&po, -1, prior); assert(ret == 0); fprintf(stderr, " (out{nboff=%d,nbits=%d,buf_offset=%d})\n", (int)po.nboff, (int)po.nbits, (int)(po.buffer - po.tmpspace)); ret = per_put_few_bits(&po, -1, next); assert(ret == 0); fprintf(stderr, " (out{nboff=%d,nbits=%d,buf_offset=%d})\n", (int)po.nboff, (int)po.nbits, (int)(po.buffer - po.tmpspace)); fprintf(stderr, "Putting %d + %d bits (%d/%d), got %d bytes and %d bits\n", prior, next, (prior + next) / 8, (prior + next) % 8, (int)(po.buffer - po.tmpspace), (int)po.nboff); assert((po.buffer - po.tmpspace) * 8 + po.nboff == prior + next); for(i = 0; i < (po.buffer - po.tmpspace); i++) assert(po.tmpspace[0] == (unsigned char)-1); } } } static void check_per_encoding_sweep_with(uint8_t buf[], int already_bits, int add_bits) { size_t buf_size = 8; asn_per_data_t pos; asn_per_outp_t out; int32_t d_already; int32_t d_add; int32_t d_left; int left_bits; int i; memset(&pos, 0, sizeof(pos)); pos.buffer = buf; pos.nboff = 0; pos.nbits = buf_size * 8; memset(&out, 0, sizeof(out)); out.buffer = out.tmpspace; out.nbits = 8 * sizeof(out.tmpspace); assert(sizeof(out.tmpspace) >= buf_size); memcpy(out.buffer, buf, buf_size); d_already = per_get_few_bits(&pos, already_bits); d_add = per_get_few_bits(&pos, add_bits); per_put_few_bits(&out, d_already, already_bits); per_put_few_bits(&out, d_add, add_bits); if(out.nboff % 8) { left_bits = 8 - (out.nboff % 8); d_left = per_get_few_bits(&pos, left_bits); } else { left_bits = 0; d_left = 0; } per_put_few_bits(&out, d_left, left_bits); assert(0 == (out.nboff % 8)); if(0 != memcmp(out.tmpspace, buf, buf_size)) { printf("IN: "); for(i = 0; i < buf_size; i++) printf(" %02x", buf[i]); printf("\nOUT:"); for(i = 0; i < buf_size; i++) printf(" %02x", out.tmpspace[i]); printf(" (out{nboff=%d,left=%d,%02x})\n", (int)out.nboff, left_bits, (int)d_left); assert(0 == memcmp(out.tmpspace, buf, buf_size)); } } static void check_per_encoding_sweep() { uint8_t buf[3][8] = { { 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA }, { 0xB7, 0x19, 0x2F, 0xEE, 0xAD, 0x11, 0xAA, 0x55 }, { 0xEE, 0xAD, 0x11, 0xAA, 0x55, 0xB7, 0x19, 0x2F } }; int already_bits; int add_bits; int buf_idx; for(buf_idx = 0; buf_idx < 3; buf_idx++) { for(already_bits = 0; already_bits < 24; already_bits++) { for(add_bits = 0; add_bits <= 31; add_bits++) { /*fprintf(stderr, "PER %d += %d\n", already_bits, add_bits);*/ check_per_encoding_sweep_with(buf[buf_idx], already_bits, add_bits); } } } } int main() { check_per_decoding(); check_per_encoding(); check_per_encoding_auto(); check_per_encoding_sweep(); return 0; } asn1c-0.9.24+dfsg/skeletons/tests/Makefile.in0000644000000000000000000005244412121076150017452 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = check-ber_tlv_tag$(EXEEXT) check-length$(EXEEXT) \ check-OIDs$(EXEEXT) check-GeneralizedTime$(EXEEXT) \ check-OCTET_STRING$(EXEEXT) check-UTF8String$(EXEEXT) \ check-UTCTime$(EXEEXT) check-INTEGER$(EXEEXT) \ check-REAL$(EXEEXT) check-XER$(EXEEXT) check-PER$(EXEEXT) subdir = skeletons/tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = check_GeneralizedTime_SOURCES = check-GeneralizedTime.c check_GeneralizedTime_OBJECTS = check-GeneralizedTime.$(OBJEXT) check_GeneralizedTime_LDADD = $(LDADD) check_GeneralizedTime_DEPENDENCIES = check_INTEGER_SOURCES = check-INTEGER.c check_INTEGER_OBJECTS = check-INTEGER.$(OBJEXT) check_INTEGER_LDADD = $(LDADD) check_INTEGER_DEPENDENCIES = check_OCTET_STRING_SOURCES = check-OCTET_STRING.c check_OCTET_STRING_OBJECTS = check-OCTET_STRING.$(OBJEXT) check_OCTET_STRING_LDADD = $(LDADD) check_OCTET_STRING_DEPENDENCIES = check_OIDs_SOURCES = check-OIDs.c check_OIDs_OBJECTS = check-OIDs.$(OBJEXT) check_OIDs_LDADD = $(LDADD) check_OIDs_DEPENDENCIES = check_PER_SOURCES = check-PER.c check_PER_OBJECTS = check-PER.$(OBJEXT) check_PER_LDADD = $(LDADD) check_PER_DEPENDENCIES = check_REAL_SOURCES = check-REAL.c check_REAL_OBJECTS = check-REAL.$(OBJEXT) check_REAL_LDADD = $(LDADD) check_REAL_DEPENDENCIES = check_UTCTime_SOURCES = check-UTCTime.c check_UTCTime_OBJECTS = check-UTCTime.$(OBJEXT) check_UTCTime_LDADD = $(LDADD) check_UTCTime_DEPENDENCIES = check_UTF8String_SOURCES = check-UTF8String.c check_UTF8String_OBJECTS = check-UTF8String.$(OBJEXT) check_UTF8String_LDADD = $(LDADD) check_UTF8String_DEPENDENCIES = check_XER_SOURCES = check-XER.c check_XER_OBJECTS = check-XER.$(OBJEXT) check_XER_LDADD = $(LDADD) check_XER_DEPENDENCIES = check_ber_tlv_tag_SOURCES = check-ber_tlv_tag.c check_ber_tlv_tag_OBJECTS = check-ber_tlv_tag.$(OBJEXT) check_ber_tlv_tag_LDADD = $(LDADD) check_ber_tlv_tag_DEPENDENCIES = check_length_SOURCES = check-length.c check_length_OBJECTS = check-length.$(OBJEXT) check_length_LDADD = $(LDADD) check_length_DEPENDENCIES = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = check-GeneralizedTime.c check-INTEGER.c check-OCTET_STRING.c \ check-OIDs.c check-PER.c check-REAL.c check-UTCTime.c \ check-UTF8String.c check-XER.c check-ber_tlv_tag.c \ check-length.c DIST_SOURCES = check-GeneralizedTime.c check-INTEGER.c \ check-OCTET_STRING.c check-OIDs.c check-PER.c check-REAL.c \ check-UTCTime.c check-UTF8String.c check-XER.c \ check-ber_tlv_tag.c check-length.c ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/skeletons AM_LDFLAGS = $(top_srcdir)/skeletons/libasn1cskeletons.la LDADD = -lm TESTS = $(check_PROGRAMS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign skeletons/tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign skeletons/tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list check-GeneralizedTime$(EXEEXT): $(check_GeneralizedTime_OBJECTS) $(check_GeneralizedTime_DEPENDENCIES) @rm -f check-GeneralizedTime$(EXEEXT) $(LINK) $(check_GeneralizedTime_OBJECTS) $(check_GeneralizedTime_LDADD) $(LIBS) check-INTEGER$(EXEEXT): $(check_INTEGER_OBJECTS) $(check_INTEGER_DEPENDENCIES) @rm -f check-INTEGER$(EXEEXT) $(LINK) $(check_INTEGER_OBJECTS) $(check_INTEGER_LDADD) $(LIBS) check-OCTET_STRING$(EXEEXT): $(check_OCTET_STRING_OBJECTS) $(check_OCTET_STRING_DEPENDENCIES) @rm -f check-OCTET_STRING$(EXEEXT) $(LINK) $(check_OCTET_STRING_OBJECTS) $(check_OCTET_STRING_LDADD) $(LIBS) check-OIDs$(EXEEXT): $(check_OIDs_OBJECTS) $(check_OIDs_DEPENDENCIES) @rm -f check-OIDs$(EXEEXT) $(LINK) $(check_OIDs_OBJECTS) $(check_OIDs_LDADD) $(LIBS) check-PER$(EXEEXT): $(check_PER_OBJECTS) $(check_PER_DEPENDENCIES) @rm -f check-PER$(EXEEXT) $(LINK) $(check_PER_OBJECTS) $(check_PER_LDADD) $(LIBS) check-REAL$(EXEEXT): $(check_REAL_OBJECTS) $(check_REAL_DEPENDENCIES) @rm -f check-REAL$(EXEEXT) $(LINK) $(check_REAL_OBJECTS) $(check_REAL_LDADD) $(LIBS) check-UTCTime$(EXEEXT): $(check_UTCTime_OBJECTS) $(check_UTCTime_DEPENDENCIES) @rm -f check-UTCTime$(EXEEXT) $(LINK) $(check_UTCTime_OBJECTS) $(check_UTCTime_LDADD) $(LIBS) check-UTF8String$(EXEEXT): $(check_UTF8String_OBJECTS) $(check_UTF8String_DEPENDENCIES) @rm -f check-UTF8String$(EXEEXT) $(LINK) $(check_UTF8String_OBJECTS) $(check_UTF8String_LDADD) $(LIBS) check-XER$(EXEEXT): $(check_XER_OBJECTS) $(check_XER_DEPENDENCIES) @rm -f check-XER$(EXEEXT) $(LINK) $(check_XER_OBJECTS) $(check_XER_LDADD) $(LIBS) check-ber_tlv_tag$(EXEEXT): $(check_ber_tlv_tag_OBJECTS) $(check_ber_tlv_tag_DEPENDENCIES) @rm -f check-ber_tlv_tag$(EXEEXT) $(LINK) $(check_ber_tlv_tag_OBJECTS) $(check_ber_tlv_tag_LDADD) $(LIBS) check-length$(EXEEXT): $(check_length_OBJECTS) $(check_length_DEPENDENCIES) @rm -f check-length$(EXEEXT) $(LINK) $(check_length_OBJECTS) $(check_length_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-GeneralizedTime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-INTEGER.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-OCTET_STRING.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-OIDs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-PER.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-REAL.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-UTCTime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-UTF8String.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-XER.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-ber_tlv_tag.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-length.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/skeletons/tests/check-length.c0000644000000000000000000000547311472004365020114 0ustar rootroot#include #include #include #include #include #include #include uint8_t *buf; size_t buf_size; size_t buf_off; static int write_to_buf(const void *buffer, size_t size, void *key) { (void)key; if(buf_off + size > buf_size) { size_t n = buf_size?:16; while(n < buf_off + size) n <<= 2; buf = realloc(buf, n); assert(buf); buf_size = n; } memcpy(buf + buf_off, buffer, size); buf_off += size; return 0; } static void check(int size) { OCTET_STRING_t *os; OCTET_STRING_t *nos = 0; OCTET_STRING_t **nosp = &nos; asn_enc_rval_t erval; asn_dec_rval_t rval; int i; os = OCTET_STRING_new_fromBuf(&asn_DEF_OCTET_STRING, 0, size); assert(os); assert(os->size == 0); os->buf = malloc(size); assert(os->buf); os->size = size; for(i = 0; i < size; i++) { os->buf[i] = i; } buf_off = 0; erval = der_encode(&asn_DEF_OCTET_STRING, os, write_to_buf, 0); assert(erval.encoded == buf_off); assert(buf_off > size); rval = ber_decode(0, &asn_DEF_OCTET_STRING, (void **)nosp, buf, buf_off); assert(rval.code == RC_OK); assert(rval.consumed == buf_off); assert(os->size == nos->size); for(i = 0; i < size; i++) { assert(os->buf[i] == nos->buf[i]); } if(0) { fprintf(stderr, "new(%d):", size); for(i = 0; i < (buf_off<10?buf_off:10); i++) fprintf(stderr, " %02x", buf[i]); printf("\n"); } asn_DEF_OCTET_STRING.free_struct(&asn_DEF_OCTET_STRING, os, 0); asn_DEF_OCTET_STRING.free_struct(&asn_DEF_OCTET_STRING, nos, 0); } int main() { uint8_t buf1[] = { 0x85, 0x00, 0x01, 0x02, 0x03, 0x04 }; uint8_t buf2[] = { 0x85, 0x00, 0x7f, 0xff, 0x03, 0x04 }; uint8_t buf3[] = { 0x85, 0x00, 0x7f, 0xff, 0xff, 0x04 }; uint8_t buf4[] = { 0x89, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04 }; ber_tlv_len_t tlv_len; ssize_t ret; int i; for(i = 0; i < 66000; i++) { if(i == 4500) i = 64000; /* Jump */ check(i); } ret = ber_fetch_length(0, buf1, sizeof(buf1), &tlv_len); printf("ret=%ld, len=%ld\n", (long)ret, (long)tlv_len); assert(ret == sizeof(buf1)); assert(tlv_len == 0x01020304); ret = ber_fetch_length(0, buf2, sizeof(buf2), &tlv_len); printf("ret=%ld, len=%ld\n", (long)ret, (long)tlv_len); assert(ret == sizeof(buf2)); assert(tlv_len == 0x7fff0304); /* * Here although tlv_len is not greater than 2^31, * we ought to hit an embedded length exploitation preventive check. */ printf("sizeof(tlv_len) = %d\n", (int)sizeof(tlv_len)); if(sizeof(tlv_len) <= 4) { ret = ber_fetch_length(0, buf3, sizeof(buf3), &tlv_len); printf("ret=%ld\n", (long)ret); printf("len=0x%x\n", (unsigned int)tlv_len); assert(ret == -1); } if(sizeof(tlv_len) <= 8) { ret = ber_fetch_length(0, buf4, sizeof(buf4), &tlv_len); printf("ret=%lld\n", (long long)ret); assert(ret == -1); } return 0; } asn1c-0.9.24+dfsg/skeletons/tests/Makefile.am0000644000000000000000000000054211461150505017434 0ustar rootrootAM_CPPFLAGS = -I$(top_srcdir)/skeletons check_PROGRAMS = \ check-ber_tlv_tag \ check-length \ check-OIDs \ check-GeneralizedTime \ check-OCTET_STRING \ check-UTF8String \ check-UTCTime \ check-INTEGER \ check-REAL \ check-XER \ check-PER AM_LDFLAGS = $(top_srcdir)/skeletons/libasn1cskeletons.la LDADD = -lm TESTS = $(check_PROGRAMS) asn1c-0.9.24+dfsg/skeletons/tests/check-ber_tlv_tag.c0000644000000000000000000000732311472004365021117 0ustar rootroot#include #include #include #include #include struct tag_control_s { int taglen; uint8_t tagbuf[8]; int correctly_decodable; int tclass; /* Tag class */ ber_tlv_tag_t tvalue; /* Tag value */ int constr; /* Is it constructed? */ } control[] = { { 1, { 0x2 << 6 }, 1, ASN_TAG_CLASS_CONTEXT, 0, 0 }, { 1, { 0x2 << 6 | 32 | 1 }, 1, ASN_TAG_CLASS_CONTEXT, 1, 1 }, { 1, { 0x3 << 6 | 30 }, 1, ASN_TAG_CLASS_PRIVATE, 30, 0 }, { 1, { 29 }, 1, ASN_TAG_CLASS_UNIVERSAL, 29, 0 }, { 1, { 0xbf, 31 }, 0, ASN_TAG_CLASS_CONTEXT, 31, 1 }, { 2, { 0xbf, 31 }, 1, ASN_TAG_CLASS_CONTEXT, 31, 1 }, { 2, { 0xbf, 83 }, 1, ASN_TAG_CLASS_CONTEXT, 83, 1 }, { 2, { 0xbf, 127 }, 1, ASN_TAG_CLASS_CONTEXT, 127, 1 }, { 2, { 0xbf, 129 }, 0, ASN_TAG_CLASS_CONTEXT, 127, 1 }, { 3, { 0xbf, 129, 0 }, 1, ASN_TAG_CLASS_CONTEXT, 128, 1 }, { 3, { 0xbf, 129, 1 }, 1, ASN_TAG_CLASS_CONTEXT, 129, 1 }, { 3, { 0xbf, 130, 0 }, 1, ASN_TAG_CLASS_CONTEXT, 256, 1 }, { 3, { 0xbf, 130, 1 }, 1, ASN_TAG_CLASS_CONTEXT, 257, 1 }, { 3, { 0xbf, 130, 0x81 }, 0, 0, 0, 0 }, { 4, { 0xbf, 130, 0x81, 2 }, 1, ASN_TAG_CLASS_CONTEXT, 32898, 1 }, { 4, { 0xbf, 130, 0x81, 0x82 }, 0, ASN_TAG_CLASS_CONTEXT, 32898, 1 }, { 5, { 0x1f, 130, 0x81, 0x82, 1 }, 1, 0, 4210945, 0 }, { 5, { 0x1f, 130, 0x81, 0x82, 2 }, 1, 0, 4210946, 0 }, { 5, { 0x1f, 0xff, 0x81, 0x82, 2 }, 1, 0, 266354946, 0 }, { 6, { 0x1f, 0xff, 0xff, 0x82, 0x80, 1 }, -1, 0, 266354946, 0 }, { 7, { 0x1f, 0x8E, 0x87, 0xAA, 0x95, 0x99, 3}, -1, 0, 4000000000UL, 0 }, }; static void check_decode(struct tag_control_s *ctrl); static void check_encode(struct tag_control_s *ctrl); int main() { size_t i; for(i = 0; i < sizeof(control) / sizeof(control[0]); i++) { check_decode(&control[i]); check_encode(&control[i]); } return 0; } static void check_decode(struct tag_control_s *ctrl) { ber_tlv_tag_t tag = 123; ber_tlv_tag_t tag1 = 124; ber_tlv_tag_t tag2 = 125; ssize_t size; if(ctrl->correctly_decodable < 1) { size = ber_fetch_tag(ctrl->tagbuf, ctrl->taglen, &tag1); assert(size == ctrl->correctly_decodable); return; } printf("Expecting "); tag = (ctrl->tvalue << 2) | ctrl->tclass; ber_tlv_tag_fwrite(tag, stdout); printf(", got "); size = ber_fetch_tag(ctrl->tagbuf, 0, &tag1); assert(size == 0); size = ber_fetch_tag(ctrl->tagbuf, ctrl->taglen, &tag1); assert(size == ctrl->taglen); size = ber_fetch_tag(ctrl->tagbuf, ctrl->taglen + 10, &tag2); assert(size == ctrl->taglen); ber_tlv_tag_fwrite(tag1, stdout); printf("\n"); assert(tag1 == tag2); assert(tag == tag1); assert(ctrl->constr == BER_TLV_CONSTRUCTED(ctrl->tagbuf)); } static void check_encode(struct tag_control_s *ctrl) { uint8_t buf[16]; ber_tlv_tag_t tag; int Filler = 0xDA; ssize_t size; ssize_t i; tag = ctrl->tvalue << 2 | ctrl->tclass; /* * Testing buffer overruns. */ for(i = 0; i < (int)sizeof(buf); i++) { int j; memset(buf, Filler, sizeof(buf)); size = ber_tlv_tag_serialize(tag, buf, i); assert(size < (int)sizeof(buf)); if(size <= i) { for(j = 0; j < size; j++) assert(buf[j] != Filler); } else { j = i; } for(; j < (int)sizeof(buf); j++) assert(buf[j] == Filler); } memset(buf, Filler, sizeof(buf)); size = ber_tlv_tag_serialize(tag, buf, sizeof(buf)); assert(size < (int)sizeof(buf)); for(i = 0; i < size; i++) assert(buf[i] != Filler); for(; i < (int)sizeof(buf); i++) assert(buf[i] == Filler); if(ctrl->correctly_decodable == 1) { assert(size == ctrl->taglen); } if(ctrl->constr) *buf |= 0x20; ber_tlv_tag_fwrite(tag, stdout); printf(":"); for(i = 0; i < size; i++) { printf(" %02x", buf[i]); if(ctrl->correctly_decodable == 1) { assert(ctrl->tagbuf[i] == buf[i]); } } printf("\n"); } asn1c-0.9.24+dfsg/skeletons/tests/check-UTF8String.c0000644000000000000000000000355511472004365020547 0ustar rootroot#include #include #include #include static void check(int expect_length, char *buf, int buflen) { UTF8String_t st; int ret; if(buflen < 0) buflen = strlen(buf); st.buf = (uint8_t *)buf; st.size = buflen; printf("["); for(ret = 0; ret < buflen; ret++) printf("%c", buf[ret]); ret = UTF8String_length(&st); printf("]: size=%d, expect=%d, got=%d\n", buflen, expect_length, ret); assert(ret == expect_length); } static int check_speed() { int cycles = 1000000; double start, stop; struct timeval tv; UTF8String_t st; char long_test[] = "a\303\237a\303\237a\303\237a\303\237" "a\303\237a\303\237a\303\237a\303\237" "a\303\237a\303\237a\303\237a\303\237" "a\303\237a\303\237a\303\237a\303\237" "a\303\237a\303\237a\303\237a\303\237"; int ret; int i; st.buf = (uint8_t *)long_test; st.size = sizeof(long_test) - 1; ret = UTF8String_length(&st); assert(ret == 40); printf("Now wait a bit...\n"); gettimeofday(&tv, 0); start = tv.tv_sec + tv.tv_usec / 1000000.0; for(i = 0; i < cycles; i++) { ret += UTF8String_length(&st); } gettimeofday(&tv, 0); stop = tv.tv_sec + tv.tv_usec / 1000000.0; printf("%d cycles in %.3fms\n", cycles, stop - start); return ret; } int main() { check(0, "", 0); check(1, "\0", 1); check(1, "a", 1); check(2, "ab", 2); check(3, "abc", 3); assert(sizeof("a\303\237cd") == 6); check(4, "a\303\237cd", 5); check(3, "a\370\211\200\201\257c", 7); check(3, "\320\273\320\265\320\262", 6); check(-1, "a\303", 2); /* Truncated */ check(-2, "\377", 1); /* Invalid UTF-8 sequence start */ check(-2, "\200", 1); check(-2, "\320\273\265\320\262", 5); check(-3, "\320c", 2); /* Not continuation */ check(-3, "a\370\200\200\200c", 6); check(-4, "a\370\200\200\200\257c", 7); check(-4, "\320\273\320\265\340\200\262", 7); check(-5, 0, 0); check_speed(); return 0; } asn1c-0.9.24+dfsg/skeletons/Makefile.in0000644000000000000000000006725712121076150016320 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = skeletons DIST_COMMON = README $(dist_pkgdata_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = libasn1cskeletons_la_LIBADD = am_libasn1cskeletons_la_OBJECTS = ANY.lo BIT_STRING.lo BMPString.lo \ BOOLEAN.lo ENUMERATED.lo GeneralString.lo GeneralizedTime.lo \ GraphicString.lo IA5String.lo INTEGER.lo ISO646String.lo \ NULL.lo NativeEnumerated.lo NativeInteger.lo NativeReal.lo \ NumericString.lo OBJECT_IDENTIFIER.lo OCTET_STRING.lo \ ObjectDescriptor.lo PrintableString.lo REAL.lo RELATIVE-OID.lo \ T61String.lo TeletexString.lo UTCTime.lo UTF8String.lo \ UniversalString.lo VideotexString.lo VisibleString.lo \ asn_SEQUENCE_OF.lo asn_SET_OF.lo asn_codecs_prim.lo \ ber_decoder.lo ber_tlv_length.lo ber_tlv_tag.lo \ constr_CHOICE.lo constr_SEQUENCE.lo constr_SEQUENCE_OF.lo \ constr_SET.lo constr_SET_OF.lo constr_TYPE.lo constraints.lo \ der_encoder.lo per_decoder.lo per_encoder.lo per_opentype.lo \ per_support.lo xer_decoder.lo xer_encoder.lo xer_support.lo libasn1cskeletons_la_OBJECTS = $(am_libasn1cskeletons_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libasn1cskeletons_la_SOURCES) DIST_SOURCES = $(libasn1cskeletons_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkgdatadir)" DATA = $(dist_pkgdata_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = . standard-modules tests dist_pkgdata_DATA = \ $(srcdir)/README \ $(srcdir)/*.[ch] \ $(srcdir)/file-dependencies check_LTLIBRARIES = libasn1cskeletons.la libasn1cskeletons_la_SOURCES = \ ANY.c ANY.h \ BIT_STRING.c BIT_STRING.h \ BMPString.c BMPString.h \ BOOLEAN.c BOOLEAN.h \ ENUMERATED.c ENUMERATED.h \ GeneralString.c GeneralString.h \ GeneralizedTime.c GeneralizedTime.h \ GraphicString.c GraphicString.h \ IA5String.c IA5String.h \ INTEGER.c INTEGER.h \ ISO646String.c ISO646String.h \ NULL.c NULL.h \ NativeEnumerated.c NativeEnumerated.h \ NativeInteger.c NativeInteger.h \ NativeReal.c NativeReal.h \ NumericString.c NumericString.h \ OBJECT_IDENTIFIER.c OBJECT_IDENTIFIER.h \ OCTET_STRING.c OCTET_STRING.h \ ObjectDescriptor.c ObjectDescriptor.h \ PrintableString.c PrintableString.h \ REAL.c REAL.h \ RELATIVE-OID.c RELATIVE-OID.h \ T61String.c T61String.h \ TeletexString.c TeletexString.h \ UTCTime.c UTCTime.h \ UTF8String.c UTF8String.h \ UniversalString.c UniversalString.h \ VideotexString.c VideotexString.h \ VisibleString.c VisibleString.h \ asn_SEQUENCE_OF.c asn_SEQUENCE_OF.h \ asn_SET_OF.c asn_SET_OF.h \ asn_application.h asn_codecs.h \ asn_codecs_prim.c asn_codecs_prim.h \ asn_internal.h asn_system.h \ ber_decoder.c ber_decoder.h \ ber_tlv_length.c ber_tlv_length.h \ ber_tlv_tag.c ber_tlv_tag.h \ constr_CHOICE.c constr_CHOICE.h \ constr_SEQUENCE.c constr_SEQUENCE.h \ constr_SEQUENCE_OF.c constr_SEQUENCE_OF.h \ constr_SET.c constr_SET.h \ constr_SET_OF.c constr_SET_OF.h \ constr_TYPE.c constr_TYPE.h \ constraints.c constraints.h \ der_encoder.c der_encoder.h \ per_decoder.c per_decoder.h \ per_encoder.c per_encoder.h \ per_opentype.c per_opentype.h \ per_support.c per_support.h \ xer_decoder.c xer_decoder.h \ xer_encoder.c xer_encoder.h \ xer_support.c xer_support.h all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign skeletons/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign skeletons/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libasn1cskeletons.la: $(libasn1cskeletons_la_OBJECTS) $(libasn1cskeletons_la_DEPENDENCIES) $(LINK) $(libasn1cskeletons_la_OBJECTS) $(libasn1cskeletons_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ANY.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BIT_STRING.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BMPString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BOOLEAN.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ENUMERATED.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GeneralString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GeneralizedTime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GraphicString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IA5String.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/INTEGER.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ISO646String.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NULL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NativeEnumerated.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NativeInteger.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NativeReal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NumericString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OBJECT_IDENTIFIER.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OCTET_STRING.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ObjectDescriptor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PrintableString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/REAL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RELATIVE-OID.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/T61String.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TeletexString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UTCTime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UTF8String.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UniversalString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VideotexString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VisibleString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn_SEQUENCE_OF.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn_SET_OF.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn_codecs_prim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_decoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_tlv_length.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_tlv_tag.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constr_CHOICE.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constr_SEQUENCE.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constr_SEQUENCE_OF.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constr_SET.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constr_SET_OF.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constr_TYPE.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constraints.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/der_encoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/per_decoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/per_encoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/per_opentype.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/per_support.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xer_decoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xer_encoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xer_support.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-dist_pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_pkgdataDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_pkgdataDATA uninstall-local .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-checkLTLIBRARIES \ clean-generic clean-libtool ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_pkgdataDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-dist_pkgdataDATA uninstall-local uninstall-local: -@echo -n " " -rm -f -r $(DESTDIR)$(pkgdatadir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/skeletons/constr_SET_OF.h0000644000000000000000000000204611501114213017006 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _CONSTR_SET_OF_H_ #define _CONSTR_SET_OF_H_ #include #ifdef __cplusplus extern "C" { #endif typedef struct asn_SET_OF_specifics_s { /* * Target structure description. */ int struct_size; /* Size of the target structure. */ int ctx_offset; /* Offset of the asn_struct_ctx_t member */ /* XER-specific stuff */ int as_XMLValueList; /* The member type must be encoded like this */ } asn_SET_OF_specifics_t; /* * A set specialized functions dealing with the SET OF type. */ asn_struct_free_f SET_OF_free; asn_struct_print_f SET_OF_print; asn_constr_check_f SET_OF_constraint; ber_type_decoder_f SET_OF_decode_ber; der_type_encoder_f SET_OF_encode_der; xer_type_decoder_f SET_OF_decode_xer; xer_type_encoder_f SET_OF_encode_xer; per_type_decoder_f SET_OF_decode_uper; per_type_encoder_f SET_OF_encode_uper; #ifdef __cplusplus } #endif #endif /* _CONSTR_SET_OF_H_ */ asn1c-0.9.24+dfsg/skeletons/per_decoder.c0000644000000000000000000000477612015121740016665 0ustar rootroot#include #include #include /* * Decode a "Production of a complete encoding", X.691#10.1. * The complete encoding contains at least one byte, and is an integral * multiple of 8 bytes. */ asn_dec_rval_t uper_decode_complete(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size) { asn_dec_rval_t rval; rval = uper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0); if(rval.consumed) { /* * We've always given 8-aligned data, * so convert bits to integral bytes. */ rval.consumed += 7; rval.consumed >>= 3; } else if(rval.code == RC_OK) { if(size) { if(((const uint8_t *)buffer)[0] == 0) { rval.consumed = 1; /* 1 byte */ } else { ASN_DEBUG("Expecting single zeroed byte"); rval.code = RC_FAIL; } } else { /* Must contain at least 8 bits. */ rval.code = RC_WMORE; } } return rval; } asn_dec_rval_t uper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size, int skip_bits, int unused_bits) { asn_codec_ctx_t s_codec_ctx; asn_dec_rval_t rval; asn_per_data_t pd; if(skip_bits < 0 || skip_bits > 7 || unused_bits < 0 || unused_bits > 7 || (unused_bits > 0 && !size)) _ASN_DECODE_FAILED; /* * Stack checker requires that the codec context * must be allocated on the stack. */ if(opt_codec_ctx) { if(opt_codec_ctx->max_stack_size) { s_codec_ctx = *opt_codec_ctx; opt_codec_ctx = &s_codec_ctx; } } else { /* If context is not given, be security-conscious anyway */ memset(&s_codec_ctx, 0, sizeof(s_codec_ctx)); s_codec_ctx.max_stack_size = _ASN_DEFAULT_STACK_MAX; opt_codec_ctx = &s_codec_ctx; } /* Fill in the position indicator */ memset(&pd, 0, sizeof(pd)); pd.buffer = (const uint8_t *)buffer; pd.nboff = skip_bits; pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from */ if(pd.nboff > pd.nbits) _ASN_DECODE_FAILED; /* * Invoke type-specific decoder. */ if(!td->uper_decoder) _ASN_DECODE_FAILED; /* PER is not compiled in */ rval = td->uper_decoder(opt_codec_ctx, td, 0, sptr, &pd); if(rval.code == RC_OK) { /* Return the number of consumed bits */ rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3) + pd.nboff - skip_bits; ASN_DEBUG("PER decoding consumed %ld, counted %ld", (long)rval.consumed, (long)pd.moved); assert(rval.consumed == pd.moved); } else { /* PER codec is not a restartable */ rval.consumed = 0; } return rval; } asn1c-0.9.24+dfsg/skeletons/GeneralString.c0000644000000000000000000000233211502527550017151 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * GeneralString basic type description. */ static ber_tlv_tag_t asn_DEF_GeneralString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (27 << 2)), /* [UNIVERSAL 27] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; asn_TYPE_descriptor_t asn_DEF_GeneralString = { "GeneralString", "GeneralString", OCTET_STRING_free, OCTET_STRING_print, /* non-ascii string */ asn_generic_unknown_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_hex, OCTET_STRING_encode_xer, OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_GeneralString_tags, sizeof(asn_DEF_GeneralString_tags) / sizeof(asn_DEF_GeneralString_tags[0]) - 1, asn_DEF_GeneralString_tags, sizeof(asn_DEF_GeneralString_tags) / sizeof(asn_DEF_GeneralString_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/skeletons/constraints.c0000644000000000000000000000425711472004365016764 0ustar rootroot#include "asn_internal.h" #include "constraints.h" int asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { (void)type_descriptor; /* Unused argument */ (void)struct_ptr; /* Unused argument */ (void)cb; /* Unused argument */ (void)key; /* Unused argument */ /* Nothing to check */ return 0; } int asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { (void)type_descriptor; /* Unused argument */ (void)struct_ptr; /* Unused argument */ (void)cb; /* Unused argument */ (void)key; /* Unused argument */ /* Unknown how to check */ return 0; } struct errbufDesc { asn_TYPE_descriptor_t *failed_type; const void *failed_struct_ptr; char *errbuf; size_t errlen; }; static void _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) { struct errbufDesc *arg = key; va_list ap; ssize_t vlen; ssize_t maxlen; arg->failed_type = td; arg->failed_struct_ptr = sptr; maxlen = arg->errlen; if(maxlen <= 0) return; va_start(ap, fmt); vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); va_end(ap); if(vlen >= maxlen) { arg->errbuf[maxlen-1] = '\0'; /* Ensuring libc correctness */ arg->errlen = maxlen - 1; /* Not counting termination */ return; } else if(vlen >= 0) { arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */ arg->errlen = vlen; /* Not counting termination */ } else { /* * The libc on this system is broken. */ vlen = sizeof("") - 1; maxlen--; arg->errlen = vlen < maxlen ? vlen : maxlen; memcpy(arg->errbuf, "", arg->errlen); arg->errbuf[arg->errlen] = 0; } return; } int asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr, char *errbuf, size_t *errlen) { struct errbufDesc arg; int ret; arg.failed_type = 0; arg.failed_struct_ptr = 0; arg.errbuf = errbuf; arg.errlen = errlen ? *errlen : 0; ret = type_descriptor->check_constraints(type_descriptor, struct_ptr, _asn_i_ctfailcb, &arg); if(ret == -1 && errlen) *errlen = arg.errlen; return ret; } asn1c-0.9.24+dfsg/skeletons/asn_codecs_prim.h0000644000000000000000000000313511502527550017544 0ustar rootroot/*- * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef ASN_CODECS_PRIM_H #define ASN_CODECS_PRIM_H #include #ifdef __cplusplus extern "C" { #endif typedef struct ASN__PRIMITIVE_TYPE_s { uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ int size; /* Size of the buffer */ } ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ asn_struct_free_f ASN__PRIMITIVE_TYPE_free; ber_type_decoder_f ber_decode_primitive; der_type_encoder_f der_encode_primitive; /* * A callback specification for the xer_decode_primitive() function below. */ enum xer_pbd_rval { XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ XPBD_BODY_CONSUMED /* Body is recognized and consumed */ }; typedef enum xer_pbd_rval (xer_primitive_body_decoder_f) (asn_TYPE_descriptor_t *td, void *struct_ptr, const void *chunk_buf, size_t chunk_size); /* * Specific function to decode simple primitive types. * Also see xer_decode_general() in xer_decoder.h */ asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr, size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size, xer_primitive_body_decoder_f *prim_body_decoder ); #ifdef __cplusplus } #endif #endif /* ASN_CODECS_PRIM_H */ asn1c-0.9.24+dfsg/skeletons/asn_SEQUENCE_OF.c0000644000000000000000000000156011472004364017043 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include typedef A_SEQUENCE_OF(void) asn_sequence; void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) { asn_sequence *as = (asn_sequence *)asn_sequence_of_x; if(as) { void *ptr; int n; if(number < 0 || number >= as->count) return; /* Nothing to delete */ if(_do_free && as->free) { ptr = as->array[number]; } else { ptr = 0; } /* * Shift all elements to the left to hide the gap. */ --as->count; for(n = number; n < as->count; n++) as->array[n] = as->array[n+1]; /* * Invoke the third-party function only when the state * of the parent structure is consistent. */ if(ptr) as->free(ptr); } } asn1c-0.9.24+dfsg/skeletons/der_encoder.h0000644000000000000000000000363111472004365016666 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _DER_ENCODER_H_ #define _DER_ENCODER_H_ #include #ifdef __cplusplus extern "C" { #endif struct asn_TYPE_descriptor_s; /* Forward declaration */ /* * The DER encoder of any type. May be invoked by the application. * The ber_decode() function (ber_decoder.h) is an opposite of der_encode(). */ asn_enc_rval_t der_encode(struct asn_TYPE_descriptor_s *type_descriptor, void *struct_ptr, /* Structure to be encoded */ asn_app_consume_bytes_f *consume_bytes_cb, void *app_key /* Arbitrary callback argument */ ); /* A variant of der_encode() which encodes data into the pre-allocated buffer */ asn_enc_rval_t der_encode_to_buffer( struct asn_TYPE_descriptor_s *type_descriptor, void *struct_ptr, /* Structure to be encoded */ void *buffer, /* Pre-allocated buffer */ size_t buffer_size /* Initial buffer size (maximum) */ ); /* * Type of the generic DER encoder. */ typedef asn_enc_rval_t (der_type_encoder_f)( struct asn_TYPE_descriptor_s *type_descriptor, void *struct_ptr, /* Structure to be encoded */ int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ ber_tlv_tag_t tag, asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ void *app_key /* Arbitrary callback argument */ ); /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ /* * Write out leading TL[v] sequence according to the type definition. */ ssize_t der_write_tags( struct asn_TYPE_descriptor_s *type_descriptor, size_t struct_length, int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ int last_tag_form, /* {0,!0}: prim, constructed */ ber_tlv_tag_t tag, asn_app_consume_bytes_f *consume_bytes_cb, void *app_key ); #ifdef __cplusplus } #endif #endif /* _DER_ENCODER_H_ */ asn1c-0.9.24+dfsg/skeletons/ISO646String.h0000644000000000000000000000076311472004364016500 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _ISO646String_H_ #define _ISO646String_H_ #include #include #ifdef __cplusplus extern "C" { #endif typedef VisibleString_t ISO646String_t; /* Implemented using VisibleString */ extern asn_TYPE_descriptor_t asn_DEF_ISO646String; #ifdef __cplusplus } #endif #endif /* _ISO646String_H_ */ asn1c-0.9.24+dfsg/skeletons/BOOLEAN.h0000644000000000000000000000157311472004364015476 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _BOOLEAN_H_ #define _BOOLEAN_H_ #include #ifdef __cplusplus extern "C" { #endif /* * The underlying integer may contain various values, but everything * non-zero is capped to 0xff by the DER encoder. The BER decoder may * yield non-zero values different from 1, beware. */ typedef int BOOLEAN_t; extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; asn_struct_free_f BOOLEAN_free; asn_struct_print_f BOOLEAN_print; ber_type_decoder_f BOOLEAN_decode_ber; der_type_encoder_f BOOLEAN_encode_der; xer_type_decoder_f BOOLEAN_decode_xer; xer_type_encoder_f BOOLEAN_encode_xer; per_type_decoder_f BOOLEAN_decode_uper; per_type_encoder_f BOOLEAN_encode_uper; #ifdef __cplusplus } #endif #endif /* _BOOLEAN_H_ */ asn1c-0.9.24+dfsg/skeletons/REAL.h0000644000000000000000000000215111472004364015133 0ustar rootroot/*- * Copyright (c) 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef ASN_TYPE_REAL_H #define ASN_TYPE_REAL_H #include #include #ifdef __cplusplus extern "C" { #endif typedef ASN__PRIMITIVE_TYPE_t REAL_t; extern asn_TYPE_descriptor_t asn_DEF_REAL; asn_struct_print_f REAL_print; xer_type_decoder_f REAL_decode_xer; xer_type_encoder_f REAL_encode_xer; per_type_decoder_f REAL_decode_uper; per_type_encoder_f REAL_encode_uper; /*********************************** * Some handy conversion routines. * ***********************************/ ssize_t REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key); /* * Convert between native double type and REAL representation (DER). * RETURN VALUES: * 0: Value converted successfully * -1: An error occured while converting the value: invalid format. */ int asn_REAL2double(const REAL_t *real_ptr, double *d); int asn_double2REAL(REAL_t *real_ptr, double d); #ifdef __cplusplus } #endif #endif /* ASN_TYPE_REAL_H */ asn1c-0.9.24+dfsg/skeletons/constr_TYPE.c0000644000000000000000000000334211472004365016560 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * Version of the ASN.1 infrastructure shipped with compiler. */ int get_asn1c_environment_version() { return ASN1C_ENVIRONMENT_VERSION; } static asn_app_consume_bytes_f _print2fp; /* * Return the outmost tag of the type. */ ber_tlv_tag_t asn_TYPE_outmost_tag(asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) { if(tag_mode) return tag; if(type_descriptor->tags_count) return type_descriptor->tags[0]; return type_descriptor->outmost_tag(type_descriptor, struct_ptr, 0, 0); } /* * Print the target language's structure in human readable form. */ int asn_fprint(FILE *stream, asn_TYPE_descriptor_t *td, const void *struct_ptr) { if(!stream) stream = stdout; if(!td || !struct_ptr) { errno = EINVAL; return -1; } /* Invoke type-specific printer */ if(td->print_struct(td, struct_ptr, 1, _print2fp, stream)) return -1; /* Terminate the output */ if(_print2fp("\n", 1, stream)) return -1; return fflush(stream); } /* Dump the data into the specified stdio stream */ static int _print2fp(const void *buffer, size_t size, void *app_key) { FILE *stream = (FILE *)app_key; if(fwrite(buffer, 1, size, stream) != size) return -1; return 0; } /* * Some compilers do not support variable args macros. * This function is a replacement of ASN_DEBUG() macro. */ void ASN_DEBUG_f(const char *fmt, ...); void ASN_DEBUG_f(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); va_end(ap); } asn1c-0.9.24+dfsg/skeletons/NumericString.c0000644000000000000000000000530211502527550017176 0ustar rootroot/*- * Copyright (c) 2003, 2006 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * NumericString basic type description. */ static ber_tlv_tag_t asn_DEF_NumericString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (18 << 2)), /* [UNIVERSAL 18] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; static int asn_DEF_NumericString_v2c(unsigned int value) { switch(value) { case 0x20: return 0; case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: return value - (0x30 - 1); } return -1; } static int asn_DEF_NumericString_c2v(unsigned int code) { if(code > 0) { if(code <= 10) return code + (0x30 - 1); else return -1; } else { return 0x20; } } static asn_per_constraints_t asn_DEF_NumericString_constraints = { { APC_CONSTRAINED, 4, 4, 0x20, 0x39 }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ asn_DEF_NumericString_v2c, asn_DEF_NumericString_c2v }; asn_TYPE_descriptor_t asn_DEF_NumericString = { "NumericString", "NumericString", OCTET_STRING_free, OCTET_STRING_print_utf8, /* ASCII subset */ NumericString_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_utf8, OCTET_STRING_encode_xer_utf8, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_NumericString_tags, sizeof(asn_DEF_NumericString_tags) / sizeof(asn_DEF_NumericString_tags[0]) - 1, asn_DEF_NumericString_tags, sizeof(asn_DEF_NumericString_tags) / sizeof(asn_DEF_NumericString_tags[0]), &asn_DEF_NumericString_constraints, 0, 0, /* No members */ 0 /* No specifics */ }; int NumericString_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const NumericString_t *st = (const NumericString_t *)sptr; if(st && st->buf) { uint8_t *buf = st->buf; uint8_t *end = buf + st->size; /* * Check the alphabet of the NumericString. * ASN.1:1984 (X.409) */ for(; buf < end; buf++) { switch(*buf) { case 0x20: case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: continue; } _ASN_CTFAIL(app_key, td, sptr, "%s: value byte %ld (%d) " "not in NumericString alphabet (%s:%d)", td->name, (long)((buf - st->buf) + 1), *buf, __FILE__, __LINE__); return -1; } } else { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } return 0; } asn1c-0.9.24+dfsg/skeletons/GeneralString.h0000644000000000000000000000072011472004364017154 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _GeneralString_H_ #define _GeneralString_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t GeneralString_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_GeneralString; #ifdef __cplusplus } #endif #endif /* _GeneralString_H_ */ asn1c-0.9.24+dfsg/skeletons/ber_decoder.c0000644000000000000000000001677011472004364016654 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #undef ADVANCE #define ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ ptr = ((const char *)ptr) + num; \ size -= num; \ consumed_myself += num; \ } while(0) #undef RETURN #define RETURN(_code) do { \ asn_dec_rval_t rval; \ rval.code = _code; \ if(opt_ctx) opt_ctx->step = step; /* Save context */ \ if(_code == RC_OK || opt_ctx) \ rval.consumed = consumed_myself; \ else \ rval.consumed = 0; /* Context-free */ \ return rval; \ } while(0) /* * The BER decoder of any type. */ asn_dec_rval_t ber_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr, const void *ptr, size_t size) { asn_codec_ctx_t s_codec_ctx; /* * Stack checker requires that the codec context * must be allocated on the stack. */ if(opt_codec_ctx) { if(opt_codec_ctx->max_stack_size) { s_codec_ctx = *opt_codec_ctx; opt_codec_ctx = &s_codec_ctx; } } else { /* If context is not given, be security-conscious anyway */ memset(&s_codec_ctx, 0, sizeof(s_codec_ctx)); s_codec_ctx.max_stack_size = _ASN_DEFAULT_STACK_MAX; opt_codec_ctx = &s_codec_ctx; } /* * Invoke type-specific decoder. */ return type_descriptor->ber_decoder(opt_codec_ctx, type_descriptor, struct_ptr, /* Pointer to the destination structure */ ptr, size, /* Buffer and its size */ 0 /* Default tag mode is 0 */ ); } /* * Check the set of >> tags matches the definition. */ asn_dec_rval_t ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx, const void *ptr, size_t size, int tag_mode, int last_tag_form, ber_tlv_len_t *last_length, int *opt_tlv_form) { ssize_t consumed_myself = 0; ssize_t tag_len; ssize_t len_len; ber_tlv_tag_t tlv_tag; ber_tlv_len_t tlv_len; ber_tlv_len_t limit_len = -1; int expect_00_terminators = 0; int tlv_constr = -1; /* If CHOICE, opt_tlv_form is not given */ int step = opt_ctx ? opt_ctx->step : 0; /* Where we left previously */ int tagno; /* * Make sure we didn't exceed the maximum stack size. */ if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) RETURN(RC_FAIL); /* * So what does all this implicit skip stuff mean? * Imagine two types, * A ::= [5] IMPLICIT T * B ::= [2] EXPLICIT T * Where T is defined as * T ::= [4] IMPLICIT SEQUENCE { ... } * * Let's say, we are starting to decode type A, given the * following TLV stream: <5> <0>. What does this mean? * It means that the type A contains type T which is, * in turn, empty. * Remember though, that we are still in A. We cannot * just pass control to the type T decoder. Why? Because * the type T decoder expects <4> <0>, not <5> <0>. * So, we must make sure we are going to receive <5> while * still in A, then pass control to the T decoder, indicating * that the tag <4> was implicitly skipped. The decoder of T * hence will be prepared to treat <4> as valid tag, and decode * it appropriately. */ tagno = step /* Continuing where left previously */ + (tag_mode==1?-1:0) ; ASN_DEBUG("ber_check_tags(%s, size=%ld, tm=%d, step=%d, tagno=%d)", td->name, (long)size, tag_mode, step, tagno); /* assert(td->tags_count >= 1) May not be the case for CHOICE or ANY */ if(tag_mode == 0 && tagno == td->tags_count) { /* * This must be the _untagged_ ANY type, * which outermost tag isn't known in advance. * Fetch the tag and length separately. */ tag_len = ber_fetch_tag(ptr, size, &tlv_tag); switch(tag_len) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); } tlv_constr = BER_TLV_CONSTRUCTED(ptr); len_len = ber_fetch_length(tlv_constr, (const char *)ptr + tag_len, size - tag_len, &tlv_len); switch(len_len) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); } ASN_DEBUG("Advancing %ld in ANY case", (long)(tag_len + len_len)); ADVANCE(tag_len + len_len); } else { assert(tagno < td->tags_count); /* At least one loop */ } for((void)tagno; tagno < td->tags_count; tagno++, step++) { /* * Fetch and process T from TLV. */ tag_len = ber_fetch_tag(ptr, size, &tlv_tag); ASN_DEBUG("Fetching tag from {%p,%ld}: " "len %ld, step %d, tagno %d got %s", ptr, (long)size, (long)tag_len, step, tagno, ber_tlv_tag_string(tlv_tag)); switch(tag_len) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); } tlv_constr = BER_TLV_CONSTRUCTED(ptr); /* * If {I}, don't check anything. * If {I,B,C}, check B and C unless we're at I. */ if(tag_mode != 0 && step == 0) { /* * We don't expect tag to match here. * It's just because we don't know how the tag * is supposed to look like. */ } else { assert(tagno >= 0); /* Guaranteed by the code above */ if(tlv_tag != td->tags[tagno]) { /* * Unexpected tag. Too bad. */ ASN_DEBUG("Expected: %s, " "expectation failed (tn=%d, tm=%d)", ber_tlv_tag_string(td->tags[tagno]), tagno, tag_mode ); RETURN(RC_FAIL); } } /* * Attention: if there are more tags expected, * ensure that the current tag is presented * in constructed form (it contains other tags!). * If this one is the last one, check that the tag form * matches the one given in descriptor. */ if(tagno < (td->tags_count - 1)) { if(tlv_constr == 0) { ASN_DEBUG("tlv_constr = %d, expfail", tlv_constr); RETURN(RC_FAIL); } } else { if(last_tag_form != tlv_constr && last_tag_form != -1) { ASN_DEBUG("last_tag_form %d != %d", last_tag_form, tlv_constr); RETURN(RC_FAIL); } } /* * Fetch and process L from TLV. */ len_len = ber_fetch_length(tlv_constr, (const char *)ptr + tag_len, size - tag_len, &tlv_len); ASN_DEBUG("Fetchinig len = %ld", (long)len_len); switch(len_len) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); } /* * FIXME * As of today, the chain of tags * must either contain several indefinite length TLVs, * or several definite length ones. * No mixing is allowed. */ if(tlv_len == -1) { /* * Indefinite length. */ if(limit_len == -1) { expect_00_terminators++; } else { ASN_DEBUG("Unexpected indefinite length " "in a chain of definite lengths"); RETURN(RC_FAIL); } ADVANCE(tag_len + len_len); continue; } else { if(expect_00_terminators) { ASN_DEBUG("Unexpected definite length " "in a chain of indefinite lengths"); RETURN(RC_FAIL); } } /* * Check that multiple TLVs specify ever decreasing length, * which is consistent. */ if(limit_len == -1) { limit_len = tlv_len + tag_len + len_len; if(limit_len < 0) { /* Too great tlv_len value? */ RETURN(RC_FAIL); } } else if(limit_len != tlv_len + tag_len + len_len) { /* * Inner TLV specifies length which is inconsistent * with the outer TLV's length value. */ ASN_DEBUG("Outer TLV is %ld and inner is %ld", (long)limit_len, (long)tlv_len); RETURN(RC_FAIL); } ADVANCE(tag_len + len_len); limit_len -= (tag_len + len_len); if((ssize_t)size > limit_len) { /* * Make sure that we won't consume more bytes * from the parent frame than the inferred limit. */ size = limit_len; } } if(opt_tlv_form) *opt_tlv_form = tlv_constr; if(expect_00_terminators) *last_length = -expect_00_terminators; else *last_length = tlv_len; RETURN(RC_OK); } asn1c-0.9.24+dfsg/skeletons/OBJECT_IDENTIFIER.h0000644000000000000000000001136712121065464017071 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _OBJECT_IDENTIFIER_H_ #define _OBJECT_IDENTIFIER_H_ #include #include #ifdef __cplusplus extern "C" { #endif typedef ASN__PRIMITIVE_TYPE_t OBJECT_IDENTIFIER_t; extern asn_TYPE_descriptor_t asn_DEF_OBJECT_IDENTIFIER; asn_struct_print_f OBJECT_IDENTIFIER_print; asn_constr_check_f OBJECT_IDENTIFIER_constraint; der_type_encoder_f OBJECT_IDENTIFIER_encode_der; xer_type_decoder_f OBJECT_IDENTIFIER_decode_xer; xer_type_encoder_f OBJECT_IDENTIFIER_encode_xer; /********************************** * Some handy conversion routines * **********************************/ /* * This function fills an (_arcs) array with OBJECT IDENTIFIER arcs * up to specified (_arc_slots) elements. * * EXAMPLE: * void print_arcs(OBJECT_IDENTIFIER_t *oid) { * unsigned long fixed_arcs[10]; // Try with fixed space first * unsigned long *arcs = fixed_arcs; * int arc_type_size = sizeof(fixed_arcs[0]); // sizeof(long) * int arc_slots = sizeof(fixed_arcs)/sizeof(fixed_arcs[0]); // 10 * int count; // Real number of arcs. * int i; * * count = OBJECT_IDENTIFIER_get_arcs(oid, arcs, * arc_type_size, arc_slots); * // If necessary, reallocate arcs array and try again. * if(count > arc_slots) { * arc_slots = count; * arcs = malloc(arc_type_size * arc_slots); * if(!arcs) return; * count = OBJECT_IDENTIFIER_get_arcs(oid, arcs, * arc_type_size, arc_slots); * assert(count == arc_slots); * } * * // Print the contents of the arcs array. * for(i = 0; i < count; i++) * printf("%d\n", arcs[i]); * * // Avoid memory leak. * if(arcs != fixed_arcs) free(arcs); * } * * RETURN VALUES: * -1/EINVAL: Invalid arguments (oid is missing) * -1/ERANGE: One or more arcs have value out of array cell type range. * >=0: Number of arcs contained in the OBJECT IDENTIFIER * * WARNING: The function always returns the real number of arcs, * even if there is no sufficient (_arc_slots) provided. */ int OBJECT_IDENTIFIER_get_arcs(OBJECT_IDENTIFIER_t *_oid, void *_arcs, /* e.g., unsigned int arcs[N] */ unsigned int _arc_type_size, /* e.g., sizeof(arcs[0]) */ unsigned int _arc_slots /* e.g., N */); /* * This functions initializes the OBJECT IDENTIFIER object with * the given set of arcs. * The minimum of two arcs must be present; some restrictions apply. * RETURN VALUES: * -1/EINVAL: Invalid arguments * -1/ERANGE: The first two arcs do not conform to ASN.1 restrictions. * -1/ENOMEM: Memory allocation failed * 0: The object was initialized with new arcs. */ int OBJECT_IDENTIFIER_set_arcs(OBJECT_IDENTIFIER_t *_oid, const void *_arcs, /* e.g., unsigned int arcs[N] */ unsigned int _arc_type_size, /* e.g., sizeof(arcs[0]) */ unsigned int _arc_slots /* e.g., N */); /* * Print the specified OBJECT IDENTIFIER arc. */ int OBJECT_IDENTIFIER_print_arc(uint8_t *arcbuf, int arclen, int add, /* Arbitrary offset, required to process the first two arcs */ asn_app_consume_bytes_f *cb, void *app_key); /* Same as above, but returns the number of written digits, instead of 0 */ ssize_t OBJECT_IDENTIFIER__dump_arc(uint8_t *arcbuf, int arclen, int add, asn_app_consume_bytes_f *cb, void *app_key); /* * Parse the OBJECT IDENTIFIER textual representation ("1.3.6.1.4.1.9363"). * No arc can exceed the (0..signed_long_max) range (typically, 0..2G if L32). * This function is not specific to OBJECT IDENTIFIER, it may be used to parse * the RELATIVE-OID data, or any other data consisting of dot-separated * series of numeric values. * * If (oid_txt_length == -1), the strlen() will be invoked to determine the * size of the (oid_text) string. * * After return, the optional (opt_oid_text_end) is set to the character after * the last parsed one. (opt_oid_text_end) is never less than (oid_text). * * RETURN VALUES: * -1: Parse error. * >= 0: Number of arcs contained in the OBJECT IDENTIFIER. * * WARNING: The function always returns the real number of arcs, * even if there is no sufficient (_arc_slots) provided. * This is useful for (_arc_slots) value estimation. */ int OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length, long arcs[], unsigned int arcs_slots, const char **opt_oid_text_end); /* * Internal functions. * Used by RELATIVE-OID implementation in particular. */ int OBJECT_IDENTIFIER_get_single_arc(uint8_t *arcbuf, unsigned int arclen, signed int add, void *value, unsigned int value_size); int OBJECT_IDENTIFIER_set_single_arc(uint8_t *arcbuf, const void *arcval, unsigned int arcval_size, int _prepared_order); #ifdef __cplusplus } #endif #endif /* _OBJECT_IDENTIFIER_H_ */ asn1c-0.9.24+dfsg/skeletons/BOOLEAN.c0000644000000000000000000001414312021515371015462 0ustar rootroot/*- * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * BOOLEAN basic type description. */ static ber_tlv_tag_t asn_DEF_BOOLEAN_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)) }; asn_TYPE_descriptor_t asn_DEF_BOOLEAN = { "BOOLEAN", "BOOLEAN", BOOLEAN_free, BOOLEAN_print, asn_generic_no_constraint, BOOLEAN_decode_ber, BOOLEAN_encode_der, BOOLEAN_decode_xer, BOOLEAN_encode_xer, BOOLEAN_decode_uper, /* Unaligned PER decoder */ BOOLEAN_encode_uper, /* Unaligned PER encoder */ 0, /* Use generic outmost tag fetcher */ asn_DEF_BOOLEAN_tags, sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]), asn_DEF_BOOLEAN_tags, /* Same as above */ sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /* * Decode BOOLEAN type. */ asn_dec_rval_t BOOLEAN_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **bool_value, const void *buf_ptr, size_t size, int tag_mode) { BOOLEAN_t *st = (BOOLEAN_t *)*bool_value; asn_dec_rval_t rval; ber_tlv_len_t length; ber_tlv_len_t lidx; if(st == NULL) { st = (BOOLEAN_t *)(*bool_value = CALLOC(1, sizeof(*st))); if(st == NULL) { rval.code = RC_FAIL; rval.consumed = 0; return rval; } } ASN_DEBUG("Decoding %s as BOOLEAN (tm=%d)", td->name, tag_mode); /* * Check tags. */ rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, tag_mode, 0, &length, 0); if(rval.code != RC_OK) return rval; ASN_DEBUG("Boolean length is %d bytes", (int)length); buf_ptr = ((const char *)buf_ptr) + rval.consumed; size -= rval.consumed; if(length > (ber_tlv_len_t)size) { rval.code = RC_WMORE; rval.consumed = 0; return rval; } /* * Compute boolean value. */ for(*st = 0, lidx = 0; (lidx < length) && *st == 0; lidx++) { /* * Very simple approach: read bytes until the end or * value is already TRUE. * BOOLEAN is not supposed to contain meaningful data anyway. */ *st |= ((const uint8_t *)buf_ptr)[lidx]; } rval.code = RC_OK; rval.consumed += length; ASN_DEBUG("Took %ld/%ld bytes to encode %s, value=%d", (long)rval.consumed, (long)length, td->name, *st); return rval; } asn_enc_rval_t BOOLEAN_encode_der(asn_TYPE_descriptor_t *td, void *sptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t erval; BOOLEAN_t *st = (BOOLEAN_t *)sptr; erval.encoded = der_write_tags(td, 1, tag_mode, 0, tag, cb, app_key); if(erval.encoded == -1) { erval.failed_type = td; erval.structure_ptr = sptr; return erval; } if(cb) { uint8_t bool_value; bool_value = *st ? 0xff : 0; /* 0xff mandated by DER */ if(cb(&bool_value, 1, app_key) < 0) { erval.encoded = -1; erval.failed_type = td; erval.structure_ptr = sptr; return erval; } } erval.encoded += 1; _ASN_ENCODED_OK(erval); } /* * Decode the chunk of XML text encoding INTEGER. */ static enum xer_pbd_rval BOOLEAN__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_buf, size_t chunk_size) { BOOLEAN_t *st = (BOOLEAN_t *)sptr; const char *p = (const char *)chunk_buf; (void)td; if(chunk_size && p[0] == 0x3c /* '<' */) { switch(xer_check_tag(chunk_buf, chunk_size, "false")) { case XCT_BOTH: /* "" */ *st = 0; break; case XCT_UNKNOWN_BO: if(xer_check_tag(chunk_buf, chunk_size, "true") != XCT_BOTH) return XPBD_BROKEN_ENCODING; /* "" */ *st = 1; /* Or 0xff as in DER?.. */ break; default: return XPBD_BROKEN_ENCODING; } return XPBD_BODY_CONSUMED; } else { return XPBD_BROKEN_ENCODING; } } asn_dec_rval_t BOOLEAN_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { return xer_decode_primitive(opt_codec_ctx, td, sptr, sizeof(BOOLEAN_t), opt_mname, buf_ptr, size, BOOLEAN__xer_body_decode); } asn_enc_rval_t BOOLEAN_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; asn_enc_rval_t er; (void)ilevel; (void)flags; if(!st) _ASN_ENCODE_FAILED; if(*st) { _ASN_CALLBACK("", 7); er.encoded = 7; } else { _ASN_CALLBACK("", 8); er.encoded = 8; } _ASN_ENCODED_OK(er); cb_failed: _ASN_ENCODE_FAILED; } int BOOLEAN_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; const char *buf; size_t buflen; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(st) { if(*st) { buf = "TRUE"; buflen = 4; } else { buf = "FALSE"; buflen = 5; } } else { buf = ""; buflen = 8; } return (cb(buf, buflen, app_key) < 0) ? -1 : 0; } void BOOLEAN_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { if(td && ptr && !contents_only) { FREEMEM(ptr); } } asn_dec_rval_t BOOLEAN_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv; BOOLEAN_t *st = (BOOLEAN_t *)*sptr; (void)opt_codec_ctx; (void)constraints; if(!st) { st = (BOOLEAN_t *)(*sptr = MALLOC(sizeof(*st))); if(!st) _ASN_DECODE_FAILED; } /* * Extract a single bit */ switch(per_get_few_bits(pd, 1)) { case 1: *st = 1; break; case 0: *st = 0; break; case -1: default: _ASN_DECODE_STARVED; } ASN_DEBUG("%s decoded as %s", td->name, *st ? "TRUE" : "FALSE"); rv.code = RC_OK; rv.consumed = 1; return rv; } asn_enc_rval_t BOOLEAN_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; asn_enc_rval_t er = { 0, 0, 0 }; (void)constraints; if(!st) _ASN_ENCODE_FAILED; if(per_put_few_bits(po, *st ? 1 : 0, 1)) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } asn1c-0.9.24+dfsg/skeletons/xer_decoder.c0000644000000000000000000002103712021514743016670 0ustar rootroot/* * Copyright (c) 2004, 2005 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* XER/XML parsing support */ /* * Decode the XER encoding of a given type. */ asn_dec_rval_t xer_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **struct_ptr, const void *buffer, size_t size) { asn_codec_ctx_t s_codec_ctx; /* * Stack checker requires that the codec context * must be allocated on the stack. */ if(opt_codec_ctx) { if(opt_codec_ctx->max_stack_size) { s_codec_ctx = *opt_codec_ctx; opt_codec_ctx = &s_codec_ctx; } } else { /* If context is not given, be security-conscious anyway */ memset(&s_codec_ctx, 0, sizeof(s_codec_ctx)); s_codec_ctx.max_stack_size = _ASN_DEFAULT_STACK_MAX; opt_codec_ctx = &s_codec_ctx; } /* * Invoke type-specific decoder. */ return td->xer_decoder(opt_codec_ctx, td, struct_ptr, 0, buffer, size); } struct xer__cb_arg { pxml_chunk_type_e chunk_type; size_t chunk_size; const void *chunk_buf; int callback_not_invoked; }; static int xer__token_cb(pxml_chunk_type_e type, const void *_chunk_data, size_t _chunk_size, void *key) { struct xer__cb_arg *arg = (struct xer__cb_arg *)key; arg->chunk_type = type; arg->chunk_size = _chunk_size; arg->chunk_buf = _chunk_data; arg->callback_not_invoked = 0; return -1; /* Terminate the XML parsing */ } /* * Fetch the next token from the XER/XML stream. */ ssize_t xer_next_token(int *stateContext, const void *buffer, size_t size, pxer_chunk_type_e *ch_type) { struct xer__cb_arg arg; int new_stateContext = *stateContext; ssize_t ret; arg.callback_not_invoked = 1; ret = pxml_parse(&new_stateContext, buffer, size, xer__token_cb, &arg); if(ret < 0) return -1; if(arg.callback_not_invoked) { assert(ret == 0); /* No data was consumed */ return 0; /* Try again with more data */ } else { assert(arg.chunk_size); assert(arg.chunk_buf == buffer); } /* * Translate the XML chunk types into more convenient ones. */ switch(arg.chunk_type) { case PXML_TEXT: *ch_type = PXER_TEXT; break; case PXML_TAG: return 0; /* Want more */ case PXML_TAG_END: *ch_type = PXER_TAG; break; case PXML_COMMENT: case PXML_COMMENT_END: *ch_type = PXER_COMMENT; break; } *stateContext = new_stateContext; return arg.chunk_size; } #define CSLASH 0x2f /* '/' */ #define LANGLE 0x3c /* '<' */ #define RANGLE 0x3e /* '>' */ xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { const char *buf = (const char *)buf_ptr; const char *end; xer_check_tag_e ct = XCT_OPENING; if(size < 2 || buf[0] != LANGLE || buf[size-1] != RANGLE) { if(size >= 2) ASN_DEBUG("Broken XML tag: \"%c...%c\"", buf[0], buf[size - 1]); return XCT_BROKEN; } /* * Determine the tag class. */ if(buf[1] == CSLASH) { buf += 2; /* advance past "" */ ct = XCT_CLOSING; if(size > 0 && buf[size-1] == CSLASH) return XCT_BROKEN; /* */ } else { buf++; /* advance past "<" */ size -= 2; /* strip "<" and ">" */ if(size > 0 && buf[size-1] == CSLASH) { ct = XCT_BOTH; size--; /* One more, for "/" */ } } /* Sometimes we don't care about the tag */ if(!need_tag || !*need_tag) return (xer_check_tag_e)(XCT__UNK__MASK | ct); /* * Determine the tag name. */ for(end = buf + size; buf < end; buf++, need_tag++) { int b = *buf, n = *need_tag; if(b != n) { if(n == 0) { switch(b) { case 0x09: case 0x0a: case 0x0c: case 0x0d: case 0x20: /* "": whitespace is normal */ return ct; } } return (xer_check_tag_e)(XCT__UNK__MASK | ct); } if(b == 0) return XCT_BROKEN; /* Embedded 0 in buf?! */ } if(*need_tag) return (xer_check_tag_e)(XCT__UNK__MASK | ct); return ct; } #undef ADVANCE #define ADVANCE(num_bytes) do { \ size_t num = (num_bytes); \ buf_ptr = ((const char *)buf_ptr) + num; \ size -= num; \ consumed_myself += num; \ } while(0) #undef RETURN #define RETURN(_code) do { \ rval.code = _code; \ rval.consumed = consumed_myself; \ if(rval.code != RC_OK) \ ASN_DEBUG("Failed with %d", rval.code); \ return rval; \ } while(0) #define XER_GOT_BODY(chunk_buf, chunk_size, size) do { \ ssize_t converted_size = body_receiver \ (struct_key, chunk_buf, chunk_size, \ (size_t)chunk_size < size); \ if(converted_size == -1) RETURN(RC_FAIL); \ if(converted_size == 0 \ && size == (size_t)chunk_size) \ RETURN(RC_WMORE); \ chunk_size = converted_size; \ } while(0) #define XER_GOT_EMPTY() do { \ if(body_receiver(struct_key, 0, 0, size > 0) == -1) \ RETURN(RC_FAIL); \ } while(0) /* * Generalized function for decoding the primitive values. */ asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx, /* Type decoder context */ void *struct_key, const char *xml_tag, /* Expected XML tag */ const void *buf_ptr, size_t size, int (*opt_unexpected_tag_decoder) (void *struct_key, const void *chunk_buf, size_t chunk_size), ssize_t (*body_receiver) (void *struct_key, const void *chunk_buf, size_t chunk_size, int have_more) ) { asn_dec_rval_t rval; ssize_t consumed_myself = 0; (void)opt_codec_ctx; /* * Phases of XER/XML processing: * Phase 0: Check that the opening tag matches our expectations. * Phase 1: Processing body and reacting on closing tag. */ if(ctx->phase > 1) RETURN(RC_FAIL); for(;;) { pxer_chunk_type_e ch_type; /* XER chunk type */ ssize_t ch_size; /* Chunk size */ xer_check_tag_e tcv; /* Tag check value */ /* * Get the next part of the XML stream. */ ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type); switch(ch_size) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); default: switch(ch_type) { case PXER_COMMENT: /* Got XML comment */ ADVANCE(ch_size); /* Skip silently */ continue; case PXER_TEXT: if(ctx->phase == 0) { /* * We have to ignore whitespace here, * but in order to be forward compatible * with EXTENDED-XER (EMBED-VALUES, #25) * any text is just ignored here. */ } else { XER_GOT_BODY(buf_ptr, ch_size, size); } ADVANCE(ch_size); continue; case PXER_TAG: break; /* Check the rest down there */ } } assert(ch_type == PXER_TAG && size); tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); /* * Phase 0: * Expecting the opening tag * for the type being processed. * Phase 1: * Waiting for the closing XML tag. */ switch(tcv) { case XCT_BOTH: if(ctx->phase) break; /* Finished decoding of an empty element */ XER_GOT_EMPTY(); ADVANCE(ch_size); ctx->phase = 2; /* Phase out */ RETURN(RC_OK); case XCT_OPENING: if(ctx->phase) break; ADVANCE(ch_size); ctx->phase = 1; /* Processing body phase */ continue; case XCT_CLOSING: if(!ctx->phase) break; ADVANCE(ch_size); ctx->phase = 2; /* Phase out */ RETURN(RC_OK); case XCT_UNKNOWN_BO: /* * Certain tags in the body may be expected. */ if(opt_unexpected_tag_decoder && opt_unexpected_tag_decoder(struct_key, buf_ptr, ch_size) >= 0) { /* Tag's processed fine */ ADVANCE(ch_size); if(!ctx->phase) { /* We are not expecting * the closing tag anymore. */ ctx->phase = 2; /* Phase out */ RETURN(RC_OK); } continue; } /* Fall through */ default: break; /* Unexpected tag */ } ASN_DEBUG("Unexpected XML tag (expected \"%s\")", xml_tag); break; /* Dark and mysterious things have just happened */ } RETURN(RC_FAIL); } size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size) { const char *p = (const char *)chunk_buf; const char *pend = p + chunk_size; for(; p < pend; p++) { switch(*p) { /* X.693, #8.1.4 * HORISONTAL TAB (9) * LINE FEED (10) * CARRIAGE RETURN (13) * SPACE (32) */ case 0x09: case 0x0a: case 0x0d: case 0x20: continue; default: break; } break; } return (p - (const char *)chunk_buf); } /* * This is a vastly simplified, non-validating XML tree skipper. */ int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth) { assert(*depth > 0); switch(tcv) { case XCT_BOTH: case XCT_UNKNOWN_BO: /* These negate each other. */ return 0; case XCT_OPENING: case XCT_UNKNOWN_OP: ++(*depth); return 0; case XCT_CLOSING: case XCT_UNKNOWN_CL: if(--(*depth) == 0) return (tcv == XCT_CLOSING) ? 2 : 1; return 0; default: return -1; } } asn1c-0.9.24+dfsg/skeletons/Makefile.am0000644000000000000000000000400511502527550016274 0ustar rootroot SUBDIRS = . standard-modules tests dist_pkgdata_DATA = \ $(srcdir)/README \ $(srcdir)/*.[ch] \ $(srcdir)/file-dependencies uninstall-local: -@echo -n " " -rm -f -r $(DESTDIR)$(pkgdatadir) check_LTLIBRARIES = libasn1cskeletons.la libasn1cskeletons_la_SOURCES = \ ANY.c ANY.h \ BIT_STRING.c BIT_STRING.h \ BMPString.c BMPString.h \ BOOLEAN.c BOOLEAN.h \ ENUMERATED.c ENUMERATED.h \ GeneralString.c GeneralString.h \ GeneralizedTime.c GeneralizedTime.h \ GraphicString.c GraphicString.h \ IA5String.c IA5String.h \ INTEGER.c INTEGER.h \ ISO646String.c ISO646String.h \ NULL.c NULL.h \ NativeEnumerated.c NativeEnumerated.h \ NativeInteger.c NativeInteger.h \ NativeReal.c NativeReal.h \ NumericString.c NumericString.h \ OBJECT_IDENTIFIER.c OBJECT_IDENTIFIER.h \ OCTET_STRING.c OCTET_STRING.h \ ObjectDescriptor.c ObjectDescriptor.h \ PrintableString.c PrintableString.h \ REAL.c REAL.h \ RELATIVE-OID.c RELATIVE-OID.h \ T61String.c T61String.h \ TeletexString.c TeletexString.h \ UTCTime.c UTCTime.h \ UTF8String.c UTF8String.h \ UniversalString.c UniversalString.h \ VideotexString.c VideotexString.h \ VisibleString.c VisibleString.h \ asn_SEQUENCE_OF.c asn_SEQUENCE_OF.h \ asn_SET_OF.c asn_SET_OF.h \ asn_application.h asn_codecs.h \ asn_codecs_prim.c asn_codecs_prim.h \ asn_internal.h asn_system.h \ ber_decoder.c ber_decoder.h \ ber_tlv_length.c ber_tlv_length.h \ ber_tlv_tag.c ber_tlv_tag.h \ constr_CHOICE.c constr_CHOICE.h \ constr_SEQUENCE.c constr_SEQUENCE.h \ constr_SEQUENCE_OF.c constr_SEQUENCE_OF.h \ constr_SET.c constr_SET.h \ constr_SET_OF.c constr_SET_OF.h \ constr_TYPE.c constr_TYPE.h \ constraints.c constraints.h \ der_encoder.c der_encoder.h \ per_decoder.c per_decoder.h \ per_encoder.c per_encoder.h \ per_opentype.c per_opentype.h \ per_support.c per_support.h \ xer_decoder.c xer_decoder.h \ xer_encoder.c xer_encoder.h \ xer_support.c xer_support.h asn1c-0.9.24+dfsg/skeletons/TeletexString.c0000644000000000000000000001535211502527550017214 0ustar rootroot/*- * Copyright (c) 2003, 2006 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * TeletexString basic type description. */ static ber_tlv_tag_t asn_DEF_TeletexString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (20 << 2)), /* [UNIVERSAL 20] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), /* ... OCTET STRING */ }; asn_TYPE_descriptor_t asn_DEF_TeletexString = { "TeletexString", "TeletexString", OCTET_STRING_free, OCTET_STRING_print, /* non-ascii string */ asn_generic_unknown_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_hex, OCTET_STRING_encode_xer, OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_TeletexString_tags, sizeof(asn_DEF_TeletexString_tags) / sizeof(asn_DEF_TeletexString_tags[0]) - 1, asn_DEF_TeletexString_tags, sizeof(asn_DEF_TeletexString_tags) / sizeof(asn_DEF_TeletexString_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; /* * Here is a formal attempt at creating a mapping from TeletexString * (T61String) of the latest ASN.1 standard (X.680:2002) into the Unicode * character set. -- Lev Walkin * * The first thing to keep in mind is that TeletexString (T61String) * is defined in ASN.1, and is not really a T.61 string. * The T.61 standard is withdrawn by ITU-T and is no longer an authoritative * reference. See http://www.itu.int/rec/T-REC-T.61 * * The X.680 specifies TeletexString (T61String) as a combination of the * character sets specified by the registration numbers listed in * ISO International Register of Coded Character Sets to be used with * Escape Sequences (ISO-2375): * 6, 87, 102, 103, 106, 107, 126, 144, 150, 153, 156, 164, 165, 168, * plus SPACE and DELETE characters. * In addition to that, the X.680 Table 6 NOTE 2 allows using register entries * 6 and 156 instead of 102 and 103. * * The ISO Register itself is available at http://www.itscj.ipsj.or.jp/ISO-IR/ * * #6 is ASCII. http://www.itscj.ipsj.or.jp/ISO-IR/006.pdf * Escapes into: * G0: ESC 2/8 4/2 ("(B") * G1: ESC 2/9 4/2 (")B") * The range is [0x21 .. 0x7e]. Conversion into Unicode * is simple, because it has one-to-one correspondence. * #87 is a "Japanese Graphic Character Set for Information Interchange". * Is a multiple-byte set of 6877 characters. * The character set is JIS X 0208-1983 (originally JIS C 6226-1983). * Escapes into: * G0: ESC 2/4 4/2 ("$B") * G1: ESC 2/4 2/9 4/2 ("$)B") * G2: ESC 2/4 2/10 4/2 ("$*B") * G3: ESC 2/4 2/11 4/2 ("$+B") * #102 is "Teletex Primary Set of Graphic Characters" and is almost ASCII. * Escapes into: * G0: ESC 2/8 7/5 ("(u") * G1: ESC 2/9 7/5 (")u") * G2: ESC 2/10 7/5 ("*u") * G3: ESC 2/11 7/5 ("+u") * It is almost identical to ASCII, except for ASCII position for '$' * (DOLLAR SIGN) is filled with '¤' (CURRENCY SIGN), which is U+00A4. * Also, ASCII positions for '`', '\', '^', '{', '}', '~' are marked * as "should not be used". * #103 is a supplementary set of characters used in combination with #102. * Escapes into: * G0: ESC 2/8 7/6 ("(v") * G1: ESC 2/9 7/6 (")v") * G2: ESC 2/10 7/6 ("*v") * G3: ESC 2/11 7/6 ("+v") * Some characters in that character set are combining characters, * which can only be restrictively used with certain basic Latin letters. * It can be thought of as a subset of #156 with the exception of 4/12 * which is UNDERLINE in #103 and absent in #156. * #106 is a primary set of control functions, used in combination with #107. * Escapes into: * C0: ESC 2/1 4/5 ("!E") * This set is so short I can list it here: * 0x08 BS BACKSPACE -- same as Unicode * 0x0a LF LINE FEED -- same as Unicode * 0x0c FF FORM FEED -- same as Unicode * 0x0d CR CARRIAGE RETURN -- same as Unicode * 0x0e LS1 LOCKING SHIFT ONE * 0x0f LS0 LOCKING SHIFT ZERO * 0x19 SS2 SINGLE SHIFT TWO * 0x1a SUB SUBSTITUTE CHARACTER * 0x1b ESC ESCAPE -- same as Unicode * 0x1d SS3 SINGLE SHIFT THREE * The LS1 and LS0 are two magical functions which, respectively, invoke * the currently designated G1 or G0 set into positions 2/1 to 7/14 * The SS2 and SS3, respectively, invoke one character of the * currently designated set G2 and G3. * The SUB is wholly equivalent to U+001a (SUBSTITUTE) * #107 is a supplementary set of control functions, used with #106. * Escapes into: * C1: ESC 2/2 4/8 ('"H') * This set contains three special control codes: * 0x8b PLD PARTIAL LINE DOWN -- similar to * 0x8c PLU PARTIAL LINE UP -- sumilar to * 0x9b CSI CONTROL SEQUENCE INTRODUCER * This set is so out of world we can probably safely ignore it. * #126 is a "Right-hand Part of the Latin/Greek Alphabet". * Comprises of 90 characters, including accented letters. * Escapes into: * G1: ESC 2/13 4/6 ("-F") * G2: ESC 2/14 4/6 (".F") * G3: ESC 2/15 4/6 ("/F") * Note: This Registration is a subset of ISO-IR 227. * #144 is a "Cyrillic part of the Latin/Cyrillic Alphabet". * Comprises of 95 characters. * Escapes into: * G1: ESC 2/13 4/12 ("-L") * G2: ESC 2/14 4/12 (".L") * G3: ESC 2/15 4/12 ("/L") * #150 is a "Greek Primary Set of Graphic Characters". * Comprises of 94 characters. * Escapes into: * G0: ESC 2/8 2/1 4/0 ("(!@") * G1: ESC 2/9 2/1 4/0 (")!@") * G2: ESC 2/10 2/1 4/0 ("*!@") * G3: ESC 2/11 2/1 4/0 ("+!@") * #153 is a "Basic Cyrillic Character Set for 8-bit codes". * Comprises of 68 characters. * Escapes into: * G1: ESC 2/13 4/15 ("-O") * G2: ESC 2/14 4/15 (".O") * G3: ESC 2/15 4/15 ("/O") * #156 is a "Supplementary Set of ISO/IEC 6937:1992" for use with #6 * Comprises of 87 characters. * Escapes into: * G1: ESC 2/13 5/2 ("-R") * G2: ESC 2/14 5/2 (".R") * G3: ESC 2/15 5/2 ("/R") * #164 is a "Hebrew Supplementary Set of Graphic Characters" * Comprises of 27 characters. * Escapes into: * G1: ESC 2/13 5/3 ("-S") * G2: ESC 2/14 5/3 (".S") * G3: ESC 2/15 5/3 ("/S") * #165 is a set of "Codes of the Chinese graphic character set" * Is a multiple-byte set of 8446 characters. * Escapes into: * G0: ESC 2/4 2/8 4/5 ("$(E") * G1: ESC 2/4 2/9 4/5 ("$)E") * G2: ESC 2/4 2/10 4/5 ("$*E") * G3: ESC 2/4 2/11 4/5 ("$+E") * #168 is a "Japanese Graphic Character Set for Information Interchange" * A multiple-byte set of 6879 characters updated from #87. * Escapes into: * G0: ESC 2/6 4/0 ESC 2/4 4/2 ("&@" "$B") * G1: ESC 2/6 4/0 ESC 2/4 2/9 4/2 ("&@" "$)B") * G2: ESC 2/6 4/0 ESC 2/4 2/10 4/2 ("&@" "$*B") * G3: ESC 2/6 4/0 ESC 2/4 2/11 4/2 ("&@" "$+B") */ asn1c-0.9.24+dfsg/skeletons/VisibleString.h0000644000000000000000000000077711472004364017210 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _VisibleString_H_ #define _VisibleString_H_ #include #ifdef __cplusplus extern "C" { #endif typedef OCTET_STRING_t VisibleString_t; /* Implemented via OCTET STRING */ extern asn_TYPE_descriptor_t asn_DEF_VisibleString; asn_constr_check_f VisibleString_constraint; #ifdef __cplusplus } #endif #endif /* _VisibleString_H_ */ asn1c-0.9.24+dfsg/skeletons/NULL.h0000644000000000000000000000131111472004364015157 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef ASN_TYPE_NULL_H #define ASN_TYPE_NULL_H #include #ifdef __cplusplus extern "C" { #endif /* * The value of the NULL type is meaningless: see BOOLEAN if you want to * carry true/false semantics. */ typedef int NULL_t; extern asn_TYPE_descriptor_t asn_DEF_NULL; asn_struct_print_f NULL_print; der_type_encoder_f NULL_encode_der; xer_type_decoder_f NULL_decode_xer; xer_type_encoder_f NULL_encode_xer; per_type_decoder_f NULL_decode_uper; per_type_encoder_f NULL_encode_uper; #ifdef __cplusplus } #endif #endif /* NULL_H */ asn1c-0.9.24+dfsg/skeletons/der_encoder.c0000644000000000000000000001164511472004365016665 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include static ssize_t der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len, asn_app_consume_bytes_f *cb, void *app_key, int constructed); /* * The DER encoder of any type. */ asn_enc_rval_t der_encode(asn_TYPE_descriptor_t *type_descriptor, void *struct_ptr, asn_app_consume_bytes_f *consume_bytes, void *app_key) { ASN_DEBUG("DER encoder invoked for %s", type_descriptor->name); /* * Invoke type-specific encoder. */ return type_descriptor->der_encoder(type_descriptor, struct_ptr, /* Pointer to the destination structure */ 0, 0, consume_bytes, app_key); } /* * Argument type and callback necessary for der_encode_to_buffer(). */ typedef struct enc_to_buf_arg { void *buffer; size_t left; } enc_to_buf_arg; static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) { enc_to_buf_arg *arg = (enc_to_buf_arg *)key; if(arg->left < size) return -1; /* Data exceeds the available buffer size */ memcpy(arg->buffer, buffer, size); arg->buffer = ((char *)arg->buffer) + size; arg->left -= size; return 0; } /* * A variant of the der_encode() which encodes the data into the provided buffer */ asn_enc_rval_t der_encode_to_buffer(asn_TYPE_descriptor_t *type_descriptor, void *struct_ptr, void *buffer, size_t buffer_size) { enc_to_buf_arg arg; asn_enc_rval_t ec; arg.buffer = buffer; arg.left = buffer_size; ec = type_descriptor->der_encoder(type_descriptor, struct_ptr, /* Pointer to the destination structure */ 0, 0, encode_to_buffer_cb, &arg); if(ec.encoded != -1) { assert(ec.encoded == (ssize_t)(buffer_size - arg.left)); /* Return the encoded contents size */ } return ec; } /* * Write out leading TL[v] sequence according to the type definition. */ ssize_t der_write_tags(asn_TYPE_descriptor_t *sd, size_t struct_length, int tag_mode, int last_tag_form, ber_tlv_tag_t tag, /* EXPLICIT or IMPLICIT tag */ asn_app_consume_bytes_f *cb, void *app_key) { ber_tlv_tag_t *tags; /* Copy of tags stream */ int tags_count; /* Number of tags */ size_t overall_length; ssize_t *lens; int i; ASN_DEBUG("Writing tags (%s, tm=%d, tc=%d, tag=%s, mtc=%d)", sd->name, tag_mode, sd->tags_count, ber_tlv_tag_string(tag), tag_mode ?(sd->tags_count+1 -((tag_mode == -1) && sd->tags_count)) :sd->tags_count ); if(tag_mode) { /* * Instead of doing shaman dance like we do in ber_check_tags(), * allocate a small array on the stack * and initialize it appropriately. */ int stag_offset; tags = (ber_tlv_tag_t *)alloca((sd->tags_count + 1) * sizeof(ber_tlv_tag_t)); if(!tags) { /* Can fail on !x86 */ errno = ENOMEM; return -1; } tags_count = sd->tags_count + 1 /* EXPLICIT or IMPLICIT tag is given */ - ((tag_mode == -1) && sd->tags_count); /* Copy tags over */ tags[0] = tag; stag_offset = -1 + ((tag_mode == -1) && sd->tags_count); for(i = 1; i < tags_count; i++) tags[i] = sd->tags[i + stag_offset]; } else { tags = sd->tags; tags_count = sd->tags_count; } /* No tags to write */ if(tags_count == 0) return 0; lens = (ssize_t *)alloca(tags_count * sizeof(lens[0])); if(!lens) { errno = ENOMEM; return -1; } /* * Array of tags is initialized. * Now, compute the size of the TLV pairs, from right to left. */ overall_length = struct_length; for(i = tags_count - 1; i >= 0; --i) { lens[i] = der_write_TL(tags[i], overall_length, 0, 0, 0); if(lens[i] == -1) return -1; overall_length += lens[i]; lens[i] = overall_length - lens[i]; } if(!cb) return overall_length - struct_length; ASN_DEBUG("%s %s TL sequence (%d elements)", cb?"Encoding":"Estimating", sd->name, tags_count); /* * Encode the TL sequence for real. */ for(i = 0; i < tags_count; i++) { ssize_t len; int _constr; /* Check if this tag happens to be constructed */ _constr = (last_tag_form || i < (tags_count - 1)); len = der_write_TL(tags[i], lens[i], cb, app_key, _constr); if(len == -1) return -1; } return overall_length - struct_length; } static ssize_t der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len, asn_app_consume_bytes_f *cb, void *app_key, int constructed) { uint8_t buf[32]; size_t size = 0; int buf_size = cb?sizeof(buf):0; ssize_t tmp; /* Serialize tag (T from TLV) into possibly zero-length buffer */ tmp = ber_tlv_tag_serialize(tag, buf, buf_size); if(tmp == -1 || tmp > (ssize_t)sizeof(buf)) return -1; size += tmp; /* Serialize length (L from TLV) into possibly zero-length buffer */ tmp = der_tlv_length_serialize(len, buf+size, buf_size?buf_size-size:0); if(tmp == -1) return -1; size += tmp; if(size > sizeof(buf)) return -1; /* * If callback is specified, invoke it, and check its return value. */ if(cb) { if(constructed) *buf |= 0x20; if(cb(buf, size, app_key) < 0) return -1; } return size; } asn1c-0.9.24+dfsg/skeletons/UniversalString.c0000644000000000000000000001236611502527550017554 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * UniversalString basic type description. */ static ber_tlv_tag_t asn_DEF_UniversalString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (28 << 2)), /* [UNIVERSAL 28] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; static asn_OCTET_STRING_specifics_t asn_DEF_UniversalString_specs = { sizeof(UniversalString_t), offsetof(UniversalString_t, _asn_ctx), ASN_OSUBV_U32 /* 32-bits character */ }; static asn_per_constraints_t asn_DEF_UniversalString_constraints = { { APC_CONSTRAINED, 32, 32, 0, 2147483647 }, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, 0, 0 }; asn_TYPE_descriptor_t asn_DEF_UniversalString = { "UniversalString", "UniversalString", OCTET_STRING_free, UniversalString_print, /* Convert into UTF8 and print */ asn_generic_no_constraint, OCTET_STRING_decode_ber, OCTET_STRING_encode_der, UniversalString_decode_xer, /* Convert from UTF-8 */ UniversalString_encode_xer, /* Convert into UTF-8 */ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_UniversalString_tags, sizeof(asn_DEF_UniversalString_tags) / sizeof(asn_DEF_UniversalString_tags[0]) - 1, asn_DEF_UniversalString_tags, sizeof(asn_DEF_UniversalString_tags) / sizeof(asn_DEF_UniversalString_tags[0]), &asn_DEF_UniversalString_constraints, 0, 0, /* No members */ &asn_DEF_UniversalString_specs }; static ssize_t UniversalString__dump(const UniversalString_t *st, asn_app_consume_bytes_f *cb, void *app_key) { char scratch[128]; /* Scratchpad buffer */ char *p = scratch; ssize_t wrote = 0; uint8_t *ch; uint8_t *end; ch = st->buf; end = (st->buf + st->size); for(end -= 3; ch < end; ch += 4) { uint32_t wc = (ch[0] << 24) | (ch[1] << 16) | (ch[2] << 8) | ch[3]; /* 4 bytes */ if(sizeof(scratch) - (p - scratch) < 6) { wrote += p - scratch; if(cb(scratch, p - scratch, app_key) < 0) return -1; p = scratch; } if(wc < 0x80) { *p++ = (char)wc; } else if(wc < 0x800) { *p++ = 0xc0 | ((wc >> 6)); *p++ = 0x80 | ((wc & 0x3f)); } else if(wc < 0x10000) { *p++ = 0xe0 | ((wc >> 12)); *p++ = 0x80 | ((wc >> 6) & 0x3f); *p++ = 0x80 | ((wc & 0x3f)); } else if(wc < 0x200000) { *p++ = 0xf0 | ((wc >> 18)); *p++ = 0x80 | ((wc >> 12) & 0x3f); *p++ = 0x80 | ((wc >> 6) & 0x3f); *p++ = 0x80 | ((wc & 0x3f)); } else if(wc < 0x4000000) { *p++ = 0xf8 | ((wc >> 24)); *p++ = 0x80 | ((wc >> 18) & 0x3f); *p++ = 0x80 | ((wc >> 12) & 0x3f); *p++ = 0x80 | ((wc >> 6) & 0x3f); *p++ = 0x80 | ((wc & 0x3f)); } else { *p++ = 0xfc | ((wc >> 30) & 0x1); *p++ = 0x80 | ((wc >> 24) & 0x3f); *p++ = 0x80 | ((wc >> 18) & 0x3f); *p++ = 0x80 | ((wc >> 12) & 0x3f); *p++ = 0x80 | ((wc >> 6) & 0x3f); *p++ = 0x80 | ((wc & 0x3f)); } } wrote += p - scratch; if(cb(scratch, p - scratch, app_key) < 0) return -1; return wrote; } asn_dec_rval_t UniversalString_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { asn_dec_rval_t rc; rc = OCTET_STRING_decode_xer_utf8(opt_codec_ctx, td, sptr, opt_mname, buf_ptr, size); if(rc.code == RC_OK) { /* * Now we have a whole string in UTF-8 format. * Convert it into UCS-4. */ uint32_t *wcs; size_t wcs_len; UTF8String_t *st; #ifndef WORDS_BIGENDIAN int little_endian = 1; #endif assert(*sptr); st = (UTF8String_t *)*sptr; assert(st->buf); wcs_len = UTF8String_to_wcs(st, 0, 0); wcs = (uint32_t *)MALLOC(4 * (wcs_len + 1)); if(wcs == 0 || UTF8String_to_wcs(st, wcs, wcs_len) != wcs_len) { rc.code = RC_FAIL; rc.consumed = 0; return rc; } else { wcs[wcs_len] = 0; /* nul-terminate */ } #ifndef WORDS_BIGENDIAN if(*(char *)&little_endian) { /* Swap byte order in encoding */ uint32_t *wc = wcs; uint32_t *wc_end = wcs + wcs_len; for(; wc < wc_end; wc++) { /* *wc = htonl(*wc); */ uint32_t wch = *wc; *((uint8_t *)wc + 0) = wch >> 24; *((uint8_t *)wc + 1) = wch >> 16; *((uint8_t *)wc + 2) = wch >> 8; *((uint8_t *)wc + 3) = wch; } } #endif /* WORDS_BIGENDIAN */ FREEMEM(st->buf); st->buf = (uint8_t *)wcs; st->size = 4 * wcs_len; } return rc; } asn_enc_rval_t UniversalString_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { const UniversalString_t *st = (const UniversalString_t *)sptr; asn_enc_rval_t er; (void)ilevel; (void)flags; if(!st || !st->buf) _ASN_ENCODE_FAILED; er.encoded = UniversalString__dump(st, cb, app_key); if(er.encoded < 0) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } int UniversalString_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const UniversalString_t *st = (const UniversalString_t *)sptr; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(!st || !st->buf) return (cb("", 8, app_key) < 0) ? -1 : 0; if(UniversalString__dump(st, cb, app_key) < 0) return -1; return 0; } asn1c-0.9.24+dfsg/skeletons/ber_decoder.h0000644000000000000000000000377711472004364016664 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef _BER_DECODER_H_ #define _BER_DECODER_H_ #include #ifdef __cplusplus extern "C" { #endif struct asn_TYPE_descriptor_s; /* Forward declaration */ struct asn_codec_ctx_s; /* Forward declaration */ /* * The BER decoder of any type. * This function may be invoked directly from the application. * The der_encode() function (der_encoder.h) is an opposite to ber_decode(). */ asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, /* Pointer to a target structure's pointer */ const void *buffer, /* Data to be decoded */ size_t size /* Size of that buffer */ ); /* * Type of generic function which decodes the byte stream into the structure. */ typedef asn_dec_rval_t (ber_type_decoder_f)( struct asn_codec_ctx_s *opt_codec_ctx, struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, const void *buf_ptr, size_t size, int tag_mode); /******************************* * INTERNALLY USEFUL FUNCTIONS * *******************************/ /* * Check that all tags correspond to the type definition (as given in head). * On return, last_length would contain either a non-negative length of the * value part of the last TLV, or the negative number of expected * "end of content" sequences. The number may only be negative if the * head->last_tag_form is non-zero. */ asn_dec_rval_t ber_check_tags( struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ struct asn_TYPE_descriptor_s *type_descriptor, asn_struct_ctx_t *opt_ctx, /* saved decoding context */ const void *ptr, size_t size, int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ int last_tag_form, /* {-1,0:1}: any, primitive, constr */ ber_tlv_len_t *last_length, int *opt_tlv_form /* optional tag form */ ); #ifdef __cplusplus } #endif #endif /* _BER_DECODER_H_ */ asn1c-0.9.24+dfsg/skeletons/OCTET_STRING.c0000644000000000000000000013323511502527550016360 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005, 2006 Lev Walkin . * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* for .bits_unused member */ #include /* * OCTET STRING basic type description. */ static ber_tlv_tag_t asn_DEF_OCTET_STRING_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; static asn_OCTET_STRING_specifics_t asn_DEF_OCTET_STRING_specs = { sizeof(OCTET_STRING_t), offsetof(OCTET_STRING_t, _asn_ctx), ASN_OSUBV_STR }; static asn_per_constraints_t asn_DEF_OCTET_STRING_constraints = { { APC_CONSTRAINED, 8, 8, 0, 255 }, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, 0, 0 }; asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = { "OCTET STRING", /* Canonical name */ "OCTET_STRING", /* XML tag name */ OCTET_STRING_free, OCTET_STRING_print, /* non-ascii stuff, generally */ asn_generic_no_constraint, OCTET_STRING_decode_ber, OCTET_STRING_encode_der, OCTET_STRING_decode_xer_hex, OCTET_STRING_encode_xer, OCTET_STRING_decode_uper, /* Unaligned PER decoder */ OCTET_STRING_encode_uper, /* Unaligned PER encoder */ 0, /* Use generic outmost tag fetcher */ asn_DEF_OCTET_STRING_tags, sizeof(asn_DEF_OCTET_STRING_tags) / sizeof(asn_DEF_OCTET_STRING_tags[0]), asn_DEF_OCTET_STRING_tags, /* Same as above */ sizeof(asn_DEF_OCTET_STRING_tags) / sizeof(asn_DEF_OCTET_STRING_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_DEF_OCTET_STRING_specs }; #undef _CH_PHASE #undef NEXT_PHASE #undef PREV_PHASE #define _CH_PHASE(ctx, inc) do { \ if(ctx->phase == 0) \ ctx->context = 0; \ ctx->phase += inc; \ } while(0) #define NEXT_PHASE(ctx) _CH_PHASE(ctx, +1) #define PREV_PHASE(ctx) _CH_PHASE(ctx, -1) #undef ADVANCE #define ADVANCE(num_bytes) do { \ size_t num = (num_bytes); \ buf_ptr = ((const char *)buf_ptr) + num; \ size -= num; \ consumed_myself += num; \ } while(0) #undef RETURN #define RETURN(_code) do { \ asn_dec_rval_t tmprval; \ tmprval.code = _code; \ tmprval.consumed = consumed_myself; \ return tmprval; \ } while(0) #undef APPEND #define APPEND(bufptr, bufsize) do { \ size_t _bs = (bufsize); /* Append size */ \ size_t _ns = ctx->context; /* Allocated now */ \ size_t _es = st->size + _bs; /* Expected size */ \ /* int is really a typeof(st->size): */ \ if((int)_es < 0) RETURN(RC_FAIL); \ if(_ns <= _es) { \ void *ptr; \ /* Be nice and round to the memory allocator */ \ do { _ns = _ns ? _ns << 1 : 16; } \ while(_ns <= _es); \ /* int is really a typeof(st->size): */ \ if((int)_ns < 0) RETURN(RC_FAIL); \ ptr = REALLOC(st->buf, _ns); \ if(ptr) { \ st->buf = (uint8_t *)ptr; \ ctx->context = _ns; \ } else { \ RETURN(RC_FAIL); \ } \ ASN_DEBUG("Reallocating into %ld", (long)_ns); \ } \ memcpy(st->buf + st->size, bufptr, _bs); \ /* Convenient nul-termination */ \ st->buf[_es] = '\0'; \ st->size = _es; \ } while(0) /* * The main reason why ASN.1 is still alive is that too much time and effort * is necessary for learning it more or less adequately, thus creating a gut * necessity to demonstrate that aquired skill everywhere afterwards. * No, I am not going to explain what the following stuff is. */ struct _stack_el { ber_tlv_len_t left; /* What's left to read (or -1) */ ber_tlv_len_t got; /* What was actually processed */ int cont_level; /* Depth of subcontainment */ int want_nulls; /* Want null "end of content" octets? */ int bits_chopped; /* Flag in BIT STRING mode */ ber_tlv_tag_t tag; /* For debugging purposes */ struct _stack_el *prev; struct _stack_el *next; }; struct _stack { struct _stack_el *tail; struct _stack_el *cur_ptr; }; static struct _stack_el * OS__add_stack_el(struct _stack *st) { struct _stack_el *nel; /* * Reuse the old stack frame or allocate a new one. */ if(st->cur_ptr && st->cur_ptr->next) { nel = st->cur_ptr->next; nel->bits_chopped = 0; nel->got = 0; /* Retain the nel->cont_level, it's correct. */ } else { nel = (struct _stack_el *)CALLOC(1, sizeof(struct _stack_el)); if(nel == NULL) return NULL; if(st->tail) { /* Increase a subcontainment depth */ nel->cont_level = st->tail->cont_level + 1; st->tail->next = nel; } nel->prev = st->tail; st->tail = nel; } st->cur_ptr = nel; return nel; } static struct _stack * _new_stack() { return (struct _stack *)CALLOC(1, sizeof(struct _stack)); } /* * Decode OCTET STRING type. */ asn_dec_rval_t OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buf_ptr, size_t size, int tag_mode) { asn_OCTET_STRING_specifics_t *specs = td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics : &asn_DEF_OCTET_STRING_specs; BIT_STRING_t *st = (BIT_STRING_t *)*sptr; asn_dec_rval_t rval; asn_struct_ctx_t *ctx; ssize_t consumed_myself = 0; struct _stack *stck; /* Expectations stack structure */ struct _stack_el *sel = 0; /* Stack element */ int tlv_constr; enum asn_OS_Subvariant type_variant = specs->subvariant; ASN_DEBUG("Decoding %s as %s (frame %ld)", td->name, (type_variant == ASN_OSUBV_STR) ? "OCTET STRING" : "OS-SpecialCase", (long)size); /* * Create the string if does not exist. */ if(st == NULL) { st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size)); if(st == NULL) RETURN(RC_FAIL); } /* Restore parsing context */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); switch(ctx->phase) { case 0: /* * Check tags. */ rval = ber_check_tags(opt_codec_ctx, td, ctx, buf_ptr, size, tag_mode, -1, &ctx->left, &tlv_constr); if(rval.code != RC_OK) return rval; if(tlv_constr) { /* * Complex operation, requires stack of expectations. */ ctx->ptr = _new_stack(); if(ctx->ptr) { stck = (struct _stack *)ctx->ptr; } else { RETURN(RC_FAIL); } } else { /* * Jump into stackless primitive decoding. */ _CH_PHASE(ctx, 3); if(type_variant == ASN_OSUBV_ANY && tag_mode != 1) APPEND(buf_ptr, rval.consumed); ADVANCE(rval.consumed); goto phase3; } NEXT_PHASE(ctx); /* Fall through */ case 1: phase1: /* * Fill the stack with expectations. */ stck = (struct _stack *)ctx->ptr; sel = stck->cur_ptr; do { ber_tlv_tag_t tlv_tag; ber_tlv_len_t tlv_len; ber_tlv_tag_t expected_tag; ssize_t tl, ll, tlvl; /* This one works even if (sel->left == -1) */ ssize_t Left = ((!sel||(size_t)sel->left >= size) ?(ssize_t)size:sel->left); ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel, (long)(sel?sel->left:0), (long)(sel?sel->want_nulls:0), (long)(sel?sel->got:0) ); if(sel && sel->left <= 0 && sel->want_nulls == 0) { if(sel->prev) { struct _stack_el *prev = sel->prev; if(prev->left != -1) { if(prev->left < sel->got) RETURN(RC_FAIL); prev->left -= sel->got; } prev->got += sel->got; sel = stck->cur_ptr = prev; if(!sel) break; tlv_constr = 1; continue; } else { sel = stck->cur_ptr = 0; break; /* Nothing to wait */ } } tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag); ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld", (long)size, (long)Left, sel?"":"!", (long)(sel?sel->left:0), (long)(sel?sel->want_nulls:0), (long)tl); switch(tl) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); } tlv_constr = BER_TLV_CONSTRUCTED(buf_ptr); ll = ber_fetch_length(tlv_constr, (const char *)buf_ptr + tl,Left - tl,&tlv_len); ASN_DEBUG("Got tag=%s, tc=%d, left=%ld, tl=%ld, len=%ld, ll=%ld", ber_tlv_tag_string(tlv_tag), tlv_constr, (long)Left, (long)tl, (long)tlv_len, (long)ll); switch(ll) { case -1: RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); } if(sel && sel->want_nulls && ((const uint8_t *)buf_ptr)[0] == 0 && ((const uint8_t *)buf_ptr)[1] == 0) { ASN_DEBUG("Eat EOC; wn=%d--", sel->want_nulls); if(type_variant == ASN_OSUBV_ANY && (tag_mode != 1 || sel->cont_level)) APPEND("\0\0", 2); ADVANCE(2); sel->got += 2; if(sel->left != -1) { sel->left -= 2; /* assert(sel->left >= 2) */ } sel->want_nulls--; if(sel->want_nulls == 0) { /* Move to the next expectation */ sel->left = 0; tlv_constr = 1; } continue; } /* * Set up expected tags, * depending on ASN.1 type being decoded. */ switch(type_variant) { case ASN_OSUBV_BIT: /* X.690: 8.6.4.1, NOTE 2 */ /* Fall through */ case ASN_OSUBV_STR: default: if(sel) { int level = sel->cont_level; if(level < td->all_tags_count) { expected_tag = td->all_tags[level]; break; } else if(td->all_tags_count) { expected_tag = td->all_tags [td->all_tags_count - 1]; break; } /* else, Fall through */ } /* Fall through */ case ASN_OSUBV_ANY: expected_tag = tlv_tag; break; } if(tlv_tag != expected_tag) { char buf[2][32]; ber_tlv_tag_snprint(tlv_tag, buf[0], sizeof(buf[0])); ber_tlv_tag_snprint(td->tags[td->tags_count-1], buf[1], sizeof(buf[1])); ASN_DEBUG("Tag does not match expectation: %s != %s", buf[0], buf[1]); RETURN(RC_FAIL); } tlvl = tl + ll; /* Combined length of T and L encoding */ if((tlv_len + tlvl) < 0) { /* tlv_len value is too big */ ASN_DEBUG("TLV encoding + length (%ld) is too big", (long)tlv_len); RETURN(RC_FAIL); } /* * Append a new expectation. */ sel = OS__add_stack_el(stck); if(!sel) RETURN(RC_FAIL); sel->tag = tlv_tag; sel->want_nulls = (tlv_len==-1); if(sel->prev && sel->prev->left != -1) { /* Check that the parent frame is big enough */ if(sel->prev->left < tlvl + (tlv_len==-1?0:tlv_len)) RETURN(RC_FAIL); if(tlv_len == -1) sel->left = sel->prev->left - tlvl; else sel->left = tlv_len; } else { sel->left = tlv_len; } if(type_variant == ASN_OSUBV_ANY && (tag_mode != 1 || sel->cont_level)) APPEND(buf_ptr, tlvl); sel->got += tlvl; ADVANCE(tlvl); ASN_DEBUG("+EXPECT2 got=%ld left=%ld, wn=%d, clvl=%d", (long)sel->got, (long)sel->left, sel->want_nulls, sel->cont_level); } while(tlv_constr); if(sel == NULL) { /* Finished operation, "phase out" */ ASN_DEBUG("Phase out"); _CH_PHASE(ctx, +3); break; } NEXT_PHASE(ctx); /* Fall through */ case 2: stck = (struct _stack *)ctx->ptr; sel = stck->cur_ptr; ASN_DEBUG("Phase 2: Need %ld bytes, size=%ld, alrg=%ld, wn=%d", (long)sel->left, (long)size, (long)sel->got, sel->want_nulls); { ber_tlv_len_t len; assert(sel->left >= 0); len = ((ber_tlv_len_t)size < sel->left) ? (ber_tlv_len_t)size : sel->left; if(len > 0) { if(type_variant == ASN_OSUBV_BIT && sel->bits_chopped == 0) { /* Put the unused-bits-octet away */ st->bits_unused = *(const uint8_t *)buf_ptr; APPEND(((const char *)buf_ptr+1), (len - 1)); sel->bits_chopped = 1; } else { APPEND(buf_ptr, len); } ADVANCE(len); sel->left -= len; sel->got += len; } if(sel->left) { ASN_DEBUG("OS left %ld, size = %ld, wn=%d\n", (long)sel->left, (long)size, sel->want_nulls); RETURN(RC_WMORE); } PREV_PHASE(ctx); goto phase1; } break; case 3: phase3: /* * Primitive form, no stack required. */ assert(ctx->left >= 0); if(size < (size_t)ctx->left) { if(!size) RETURN(RC_WMORE); if(type_variant == ASN_OSUBV_BIT && !ctx->context) { st->bits_unused = *(const uint8_t *)buf_ptr; ctx->left--; ADVANCE(1); } APPEND(buf_ptr, size); assert(ctx->context > 0); ctx->left -= size; ADVANCE(size); RETURN(RC_WMORE); } else { if(type_variant == ASN_OSUBV_BIT && !ctx->context && ctx->left) { st->bits_unused = *(const uint8_t *)buf_ptr; ctx->left--; ADVANCE(1); } APPEND(buf_ptr, ctx->left); ADVANCE(ctx->left); ctx->left = 0; NEXT_PHASE(ctx); } break; } if(sel) { ASN_DEBUG("3sel p=%p, wn=%d, l=%ld, g=%ld, size=%ld", sel->prev, sel->want_nulls, (long)sel->left, (long)sel->got, (long)size); if(sel->prev || sel->want_nulls > 1 || sel->left > 0) { RETURN(RC_WMORE); } } /* * BIT STRING-specific processing. */ if(type_variant == ASN_OSUBV_BIT && st->size) { /* Finalize BIT STRING: zero out unused bits. */ st->buf[st->size-1] &= 0xff << st->bits_unused; } ASN_DEBUG("Took %ld bytes to encode %s: [%s]:%ld", (long)consumed_myself, td->name, (type_variant == ASN_OSUBV_STR) ? (char *)st->buf : "", (long)st->size); RETURN(RC_OK); } /* * Encode OCTET STRING type using DER. */ asn_enc_rval_t OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *sptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; asn_OCTET_STRING_specifics_t *specs = td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics : &asn_DEF_OCTET_STRING_specs; BIT_STRING_t *st = (BIT_STRING_t *)sptr; enum asn_OS_Subvariant type_variant = specs->subvariant; int fix_last_byte = 0; ASN_DEBUG("%s %s as OCTET STRING", cb?"Estimating":"Encoding", td->name); /* * Write tags. */ if(type_variant != ASN_OSUBV_ANY || tag_mode == 1) { er.encoded = der_write_tags(td, (type_variant == ASN_OSUBV_BIT) + st->size, tag_mode, type_variant == ASN_OSUBV_ANY, tag, cb, app_key); if(er.encoded == -1) { er.failed_type = td; er.structure_ptr = sptr; return er; } } else { /* Disallow: [] IMPLICIT ANY */ assert(type_variant != ASN_OSUBV_ANY || tag_mode != -1); er.encoded = 0; } if(!cb) { er.encoded += (type_variant == ASN_OSUBV_BIT) + st->size; _ASN_ENCODED_OK(er); } /* * Prepare to deal with the last octet of BIT STRING. */ if(type_variant == ASN_OSUBV_BIT) { uint8_t b = st->bits_unused & 0x07; if(b && st->size) fix_last_byte = 1; _ASN_CALLBACK(&b, 1); er.encoded++; } /* Invoke callback for the main part of the buffer */ _ASN_CALLBACK(st->buf, st->size - fix_last_byte); /* The last octet should be stripped off the unused bits */ if(fix_last_byte) { uint8_t b = st->buf[st->size-1] & (0xff << st->bits_unused); _ASN_CALLBACK(&b, 1); } er.encoded += st->size; _ASN_ENCODED_OK(er); cb_failed: _ASN_ENCODE_FAILED; } asn_enc_rval_t OCTET_STRING_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { static const char *h2c = "0123456789ABCDEF"; const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; asn_enc_rval_t er; char scratch[16 * 3 + 4]; char *p = scratch; uint8_t *buf; uint8_t *end; size_t i; if(!st || (!st->buf && st->size)) _ASN_ENCODE_FAILED; er.encoded = 0; /* * Dump the contents of the buffer in hexadecimal. */ buf = st->buf; end = buf + st->size; if(flags & XER_F_CANONICAL) { char *scend = scratch + (sizeof(scratch) - 2); for(; buf < end; buf++) { if(p >= scend) { _ASN_CALLBACK(scratch, p - scratch); er.encoded += p - scratch; p = scratch; } *p++ = h2c[(*buf >> 4) & 0x0F]; *p++ = h2c[*buf & 0x0F]; } _ASN_CALLBACK(scratch, p-scratch); /* Dump the rest */ er.encoded += p - scratch; } else { for(i = 0; buf < end; buf++, i++) { if(!(i % 16) && (i || st->size > 16)) { _ASN_CALLBACK(scratch, p-scratch); er.encoded += (p-scratch); p = scratch; _i_ASN_TEXT_INDENT(1, ilevel); } *p++ = h2c[(*buf >> 4) & 0x0F]; *p++ = h2c[*buf & 0x0F]; *p++ = 0x20; } if(p - scratch) { p--; /* Remove the tail space */ _ASN_CALLBACK(scratch, p-scratch); /* Dump the rest */ er.encoded += p - scratch; if(st->size > 16) _i_ASN_TEXT_INDENT(1, ilevel-1); } } _ASN_ENCODED_OK(er); cb_failed: _ASN_ENCODE_FAILED; } static struct OCTET_STRING__xer_escape_table_s { char *string; int size; } OCTET_STRING__xer_escape_table[] = { #define OSXET(s) { s, sizeof(s) - 1 } OSXET("\074\156\165\154\057\076"), /* */ OSXET("\074\163\157\150\057\076"), /* */ OSXET("\074\163\164\170\057\076"), /* */ OSXET("\074\145\164\170\057\076"), /* */ OSXET("\074\145\157\164\057\076"), /* */ OSXET("\074\145\156\161\057\076"), /* */ OSXET("\074\141\143\153\057\076"), /* */ OSXET("\074\142\145\154\057\076"), /* */ OSXET("\074\142\163\057\076"), /* */ OSXET("\011"), /* \t */ OSXET("\012"), /* \n */ OSXET("\074\166\164\057\076"), /* */ OSXET("\074\146\146\057\076"), /* */ OSXET("\015"), /* \r */ OSXET("\074\163\157\057\076"), /* */ OSXET("\074\163\151\057\076"), /* */ OSXET("\074\144\154\145\057\076"), /* */ OSXET("\074\144\143\061\057\076"), /* */ OSXET("\074\144\143\062\057\076"), /* */ OSXET("\074\144\143\063\057\076"), /* */ OSXET("\074\144\143\064\057\076"), /* */ OSXET("\074\156\141\153\057\076"), /* */ OSXET("\074\163\171\156\057\076"), /* */ OSXET("\074\145\164\142\057\076"), /* */ OSXET("\074\143\141\156\057\076"), /* */ OSXET("\074\145\155\057\076"), /* */ OSXET("\074\163\165\142\057\076"), /* */ OSXET("\074\145\163\143\057\076"), /* */ OSXET("\074\151\163\064\057\076"), /* */ OSXET("\074\151\163\063\057\076"), /* */ OSXET("\074\151\163\062\057\076"), /* */ OSXET("\074\151\163\061\057\076"), /* */ { 0, 0 }, /* " " */ { 0, 0 }, /* ! */ { 0, 0 }, /* \" */ { 0, 0 }, /* # */ { 0, 0 }, /* $ */ { 0, 0 }, /* % */ OSXET("\046\141\155\160\073"), /* & */ { 0, 0 }, /* ' */ {0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* ()*+,-./ */ {0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* 01234567 */ {0,0},{0,0},{0,0},{0,0}, /* 89:; */ OSXET("\046\154\164\073"), /* < */ { 0, 0 }, /* = */ OSXET("\046\147\164\073"), /* > */ }; static int OS__check_escaped_control_char(const void *buf, int size) { size_t i; /* * Inefficient algorithm which translates the escape sequences * defined above into characters. Returns -1 if not found. * TODO: replace by a faster algorithm (bsearch(), hash or * nested table lookups). */ for(i = 0; i < 32 /* Don't spend time on the bottom half */; i++) { struct OCTET_STRING__xer_escape_table_s *el; el = &OCTET_STRING__xer_escape_table[i]; if(el->size == size && memcmp(buf, el->string, size) == 0) return i; } return -1; } static int OCTET_STRING__handle_control_chars(void *struct_ptr, const void *chunk_buf, size_t chunk_size) { /* * This might be one of the escape sequences * for control characters. Check it out. * #11.15.5 */ int control_char = OS__check_escaped_control_char(chunk_buf,chunk_size); if(control_char >= 0) { OCTET_STRING_t *st = (OCTET_STRING_t *)struct_ptr; void *p = REALLOC(st->buf, st->size + 2); if(p) { st->buf = (uint8_t *)p; st->buf[st->size++] = control_char; st->buf[st->size] = '\0'; /* nul-termination */ return 0; } } return -1; /* No, it's not */ } asn_enc_rval_t OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *sptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; asn_enc_rval_t er; uint8_t *buf, *end; uint8_t *ss; /* Sequence start */ ssize_t encoded_len = 0; (void)ilevel; /* Unused argument */ (void)flags; /* Unused argument */ if(!st || (!st->buf && st->size)) _ASN_ENCODE_FAILED; buf = st->buf; end = buf + st->size; for(ss = buf; buf < end; buf++) { unsigned int ch = *buf; int s_len; /* Special encoding sequence length */ /* * Escape certain characters: X.680/11.15 */ if(ch < sizeof(OCTET_STRING__xer_escape_table) /sizeof(OCTET_STRING__xer_escape_table[0]) && (s_len = OCTET_STRING__xer_escape_table[ch].size)) { if(((buf - ss) && cb(ss, buf - ss, app_key) < 0) || cb(OCTET_STRING__xer_escape_table[ch].string, s_len, app_key) < 0) _ASN_ENCODE_FAILED; encoded_len += (buf - ss) + s_len; ss = buf + 1; } } encoded_len += (buf - ss); if((buf - ss) && cb(ss, buf - ss, app_key) < 0) _ASN_ENCODE_FAILED; er.encoded = encoded_len; _ASN_ENCODED_OK(er); } /* * Convert from hexadecimal format (cstring): "AB CD EF" */ static ssize_t OCTET_STRING__convert_hexadecimal(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) { OCTET_STRING_t *st = (OCTET_STRING_t *)sptr; const char *chunk_stop = (const char *)chunk_buf; const char *p = chunk_stop; const char *pend = p + chunk_size; unsigned int clv = 0; int half = 0; /* Half bit */ uint8_t *buf; /* Reallocate buffer according to high cap estimation */ ssize_t _ns = st->size + (chunk_size + 1) / 2; void *nptr = REALLOC(st->buf, _ns + 1); if(!nptr) return -1; st->buf = (uint8_t *)nptr; buf = st->buf + st->size; /* * If something like " a b c " appears here, the " a b":3 will be * converted, and the rest skipped. That is, unless buf_size is greater * than chunk_size, then it'll be equivalent to "ABC0". */ for(; p < pend; p++) { int ch = *(const unsigned char *)p; switch(ch) { case 0x09: case 0x0a: case 0x0c: case 0x0d: case 0x20: /* Ignore whitespace */ continue; case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/ case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/ clv = (clv << 4) + (ch - 0x30); break; case 0x41: case 0x42: case 0x43: /* ABC */ case 0x44: case 0x45: case 0x46: /* DEF */ clv = (clv << 4) + (ch - 0x41 + 10); break; case 0x61: case 0x62: case 0x63: /* abc */ case 0x64: case 0x65: case 0x66: /* def */ clv = (clv << 4) + (ch - 0x61 + 10); break; default: *buf = 0; /* JIC */ return -1; } if(half++) { half = 0; *buf++ = clv; chunk_stop = p + 1; } } /* * Check partial decoding. */ if(half) { if(have_more) { /* * Partial specification is fine, * because no more more PXER_TEXT data is available. */ *buf++ = clv << 4; chunk_stop = p; } } else { chunk_stop = p; } st->size = buf - st->buf; /* Adjust the buffer size */ assert(st->size <= _ns); st->buf[st->size] = 0; /* Courtesy termination */ return (chunk_stop - (const char *)chunk_buf); /* Converted size */ } /* * Convert from binary format: "00101011101" */ static ssize_t OCTET_STRING__convert_binary(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) { BIT_STRING_t *st = (BIT_STRING_t *)sptr; const char *p = (const char *)chunk_buf; const char *pend = p + chunk_size; int bits_unused = st->bits_unused & 0x7; uint8_t *buf; /* Reallocate buffer according to high cap estimation */ ssize_t _ns = st->size + (chunk_size + 7) / 8; void *nptr = REALLOC(st->buf, _ns + 1); if(!nptr) return -1; st->buf = (uint8_t *)nptr; buf = st->buf + st->size; (void)have_more; if(bits_unused == 0) bits_unused = 8; else if(st->size) buf--; /* * Convert series of 0 and 1 into the octet string. */ for(; p < pend; p++) { int ch = *(const unsigned char *)p; switch(ch) { case 0x09: case 0x0a: case 0x0c: case 0x0d: case 0x20: /* Ignore whitespace */ break; case 0x30: case 0x31: if(bits_unused-- <= 0) { *++buf = 0; /* Clean the cell */ bits_unused = 7; } *buf |= (ch&1) << bits_unused; break; default: st->bits_unused = bits_unused; return -1; } } if(bits_unused == 8) { st->size = buf - st->buf; st->bits_unused = 0; } else { st->size = buf - st->buf + 1; st->bits_unused = bits_unused; } assert(st->size <= _ns); st->buf[st->size] = 0; /* Courtesy termination */ return chunk_size; /* Converted in full */ } /* * Something like strtod(), but with stricter rules. */ static int OS__strtoent(int base, const char *buf, const char *end, int32_t *ret_value) { int32_t val = 0; const char *p; for(p = buf; p < end; p++) { int ch = *p; /* Strange huge value */ if((val * base + base) < 0) return -1; switch(ch) { case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/ case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/ val = val * base + (ch - 0x30); break; case 0x41: case 0x42: case 0x43: /* ABC */ case 0x44: case 0x45: case 0x46: /* DEF */ val = val * base + (ch - 0x41 + 10); break; case 0x61: case 0x62: case 0x63: /* abc */ case 0x64: case 0x65: case 0x66: /* def */ val = val * base + (ch - 0x61 + 10); break; case 0x3b: /* ';' */ *ret_value = val; return (p - buf) + 1; default: return -1; /* Character set error */ } } *ret_value = -1; return (p - buf); } /* * Convert from the plain UTF-8 format, expanding entity references: "2 < 3" */ static ssize_t OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) { OCTET_STRING_t *st = (OCTET_STRING_t *)sptr; const char *p = (const char *)chunk_buf; const char *pend = p + chunk_size; uint8_t *buf; /* Reallocate buffer */ ssize_t _ns = st->size + chunk_size; void *nptr = REALLOC(st->buf, _ns + 1); if(!nptr) return -1; st->buf = (uint8_t *)nptr; buf = st->buf + st->size; /* * Convert series of 0 and 1 into the octet string. */ for(; p < pend; p++) { int ch = *(const unsigned char *)p; int len; /* Length of the rest of the chunk */ if(ch != 0x26 /* '&' */) { *buf++ = ch; continue; /* That was easy... */ } /* * Process entity reference. */ len = chunk_size - (p - (const char *)chunk_buf); if(len == 1 /* "&" */) goto want_more; if(p[1] == 0x23 /* '#' */) { const char *pval; /* Pointer to start of digits */ int32_t val = 0; /* Entity reference value */ int base; if(len == 2 /* "&#" */) goto want_more; if(p[2] == 0x78 /* 'x' */) pval = p + 3, base = 16; else pval = p + 2, base = 10; len = OS__strtoent(base, pval, p + len, &val); if(len == -1) { /* Invalid charset. Just copy verbatim. */ *buf++ = ch; continue; } if(!len || pval[len-1] != 0x3b) goto want_more; assert(val > 0); p += (pval - p) + len - 1; /* Advance past entref */ if(val < 0x80) { *buf++ = (char)val; } else if(val < 0x800) { *buf++ = 0xc0 | ((val >> 6)); *buf++ = 0x80 | ((val & 0x3f)); } else if(val < 0x10000) { *buf++ = 0xe0 | ((val >> 12)); *buf++ = 0x80 | ((val >> 6) & 0x3f); *buf++ = 0x80 | ((val & 0x3f)); } else if(val < 0x200000) { *buf++ = 0xf0 | ((val >> 18)); *buf++ = 0x80 | ((val >> 12) & 0x3f); *buf++ = 0x80 | ((val >> 6) & 0x3f); *buf++ = 0x80 | ((val & 0x3f)); } else if(val < 0x4000000) { *buf++ = 0xf8 | ((val >> 24)); *buf++ = 0x80 | ((val >> 18) & 0x3f); *buf++ = 0x80 | ((val >> 12) & 0x3f); *buf++ = 0x80 | ((val >> 6) & 0x3f); *buf++ = 0x80 | ((val & 0x3f)); } else { *buf++ = 0xfc | ((val >> 30) & 0x1); *buf++ = 0x80 | ((val >> 24) & 0x3f); *buf++ = 0x80 | ((val >> 18) & 0x3f); *buf++ = 0x80 | ((val >> 12) & 0x3f); *buf++ = 0x80 | ((val >> 6) & 0x3f); *buf++ = 0x80 | ((val & 0x3f)); } } else { /* * Ugly, limited parsing of & > < */ char *sc = (char *)memchr(p, 0x3b, len > 5 ? 5 : len); if(!sc) goto want_more; if((sc - p) == 4 && p[1] == 0x61 /* 'a' */ && p[2] == 0x6d /* 'm' */ && p[3] == 0x70 /* 'p' */) { *buf++ = 0x26; p = sc; continue; } if((sc - p) == 3) { if(p[1] == 0x6c) { *buf = 0x3c; /* '<' */ } else if(p[1] == 0x67) { *buf = 0x3e; /* '>' */ } else { /* Unsupported entity reference */ *buf++ = ch; continue; } if(p[2] != 0x74) { /* Unsupported entity reference */ *buf++ = ch; continue; } buf++; p = sc; continue; } /* Unsupported entity reference */ *buf++ = ch; } continue; want_more: if(have_more) { /* * We know that no more data (of the same type) * is coming. Copy the rest verbatim. */ *buf++ = ch; continue; } chunk_size = (p - (const char *)chunk_buf); /* Processing stalled: need more data */ break; } st->size = buf - st->buf; assert(st->size <= _ns); st->buf[st->size] = 0; /* Courtesy termination */ return chunk_size; /* Converted in full */ } /* * Decode OCTET STRING from the XML element's body. */ static asn_dec_rval_t OCTET_STRING__decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size, int (*opt_unexpected_tag_decoder) (void *struct_ptr, const void *chunk_buf, size_t chunk_size), ssize_t (*body_receiver) (void *struct_ptr, const void *chunk_buf, size_t chunk_size, int have_more) ) { OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr; asn_OCTET_STRING_specifics_t *specs = td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics : &asn_DEF_OCTET_STRING_specs; const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; asn_struct_ctx_t *ctx; /* Per-structure parser context */ asn_dec_rval_t rval; /* Return value from the decoder */ int st_allocated; /* * Create the string if does not exist. */ if(!st) { st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size); *sptr = (void *)st; if(!st) goto sta_failed; st_allocated = 1; } else { st_allocated = 0; } if(!st->buf) { /* This is separate from above section */ st->buf = (uint8_t *)CALLOC(1, 1); if(!st->buf) { if(st_allocated) { *sptr = 0; goto stb_failed; } else { goto sta_failed; } } } /* Restore parsing context */ ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset); return xer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag, buf_ptr, size, opt_unexpected_tag_decoder, body_receiver); stb_failed: FREEMEM(st); sta_failed: rval.code = RC_FAIL; rval.consumed = 0; return rval; } /* * Decode OCTET STRING from the hexadecimal data. */ asn_dec_rval_t OCTET_STRING_decode_xer_hex(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, buf_ptr, size, 0, OCTET_STRING__convert_hexadecimal); } /* * Decode OCTET STRING from the binary (0/1) data. */ asn_dec_rval_t OCTET_STRING_decode_xer_binary(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, buf_ptr, size, 0, OCTET_STRING__convert_binary); } /* * Decode OCTET STRING from the string (ASCII/UTF-8) data. */ asn_dec_rval_t OCTET_STRING_decode_xer_utf8(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, const void *buf_ptr, size_t size) { return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, buf_ptr, size, OCTET_STRING__handle_control_chars, OCTET_STRING__convert_entrefs); } static int OCTET_STRING_per_get_characters(asn_per_data_t *po, uint8_t *buf, size_t units, unsigned int bpc, unsigned int unit_bits, long lb, long ub, asn_per_constraints_t *pc) { uint8_t *end = buf + units * bpc; ASN_DEBUG("Expanding %d characters into (%ld..%ld):%d", (int)units, lb, ub, unit_bits); /* X.691: 27.5.4 */ if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) { /* Decode without translation */ lb = 0; } else if(pc && pc->code2value) { if(unit_bits > 16) return 1; /* FATAL: can't have constrained * UniversalString with more than * 16 million code points */ for(; buf < end; buf += bpc) { int value; int code = per_get_few_bits(po, unit_bits); if(code < 0) return -1; /* WMORE */ value = pc->code2value(code); if(value < 0) { ASN_DEBUG("Code %d (0x%02x) is" " not in map (%ld..%ld)", code, code, lb, ub); return 1; /* FATAL */ } switch(bpc) { case 1: *buf = value; break; case 2: buf[0] = value >> 8; buf[1] = value; break; case 4: buf[0] = value >> 24; buf[1] = value >> 16; buf[2] = value >> 8; buf[3] = value; break; } } return 0; } /* Shortcut the no-op copying to the aligned structure */ if(lb == 0 && (unit_bits == 8 * bpc)) { return per_get_many_bits(po, buf, 0, unit_bits * units); } for(; buf < end; buf += bpc) { int code = per_get_few_bits(po, unit_bits); int ch = code + lb; if(code < 0) return -1; /* WMORE */ if(ch > ub) { ASN_DEBUG("Code %d is out of range (%ld..%ld)", ch, lb, ub); return 1; /* FATAL */ } switch(bpc) { case 1: *buf = ch; break; case 2: buf[0] = ch >> 8; buf[1] = ch; break; case 4: buf[0] = ch >> 24; buf[1] = ch >> 16; buf[2] = ch >> 8; buf[3] = ch; break; } } return 0; } static int OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf, size_t units, unsigned int bpc, unsigned int unit_bits, long lb, long ub, asn_per_constraints_t *pc) { const uint8_t *end = buf + units * bpc; ASN_DEBUG("Squeezing %d characters into (%ld..%ld):%d (%d bpc)", (int)units, lb, ub, unit_bits, bpc); /* X.691: 27.5.4 */ if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) { /* Encode as is */ lb = 0; } else if(pc && pc->value2code) { for(; buf < end; buf += bpc) { int code; uint32_t value; switch(bpc) { case 1: value = *(const uint8_t *)buf; break; case 2: value = (buf[0] << 8) | buf[1]; break; case 4: value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; break; default: return -1; } code = pc->value2code(value); if(code < 0) { ASN_DEBUG("Character %d (0x%02x) is" " not in map (%ld..%ld)", *buf, *buf, lb, ub); return -1; } if(per_put_few_bits(po, code, unit_bits)) return -1; } } /* Shortcut the no-op copying to the aligned structure */ if(lb == 0 && (unit_bits == 8 * bpc)) { return per_put_many_bits(po, buf, unit_bits * units); } for(ub -= lb; buf < end; buf += bpc) { int ch; uint32_t value; switch(bpc) { case 1: value = *(const uint8_t *)buf; break; case 2: value = (buf[0] << 8) | buf[1]; break; case 4: value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; break; default: return -1; } ch = value - lb; if(ch < 0 || ch > ub) { ASN_DEBUG("Character %d (0x%02x)" " is out of range (%ld..%ld)", *buf, *buf, lb, ub + lb); return -1; } if(per_put_few_bits(po, ch, unit_bits)) return -1; } return 0; } asn_dec_rval_t OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_OCTET_STRING_specifics_t *specs = td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics : &asn_DEF_OCTET_STRING_specs; asn_per_constraints_t *pc = constraints ? constraints : td->per_constraints; asn_per_constraint_t *cval; asn_per_constraint_t *csiz; asn_dec_rval_t rval = { RC_OK, 0 }; BIT_STRING_t *st = (BIT_STRING_t *)*sptr; ssize_t consumed_myself = 0; int repeat; enum { OS__BPC_BIT = 0, OS__BPC_CHAR = 1, OS__BPC_U16 = 2, OS__BPC_U32 = 4 } bpc; /* Bytes per character */ unsigned int unit_bits; unsigned int canonical_unit_bits; (void)opt_codec_ctx; if(pc) { cval = &pc->value; csiz = &pc->size; } else { cval = &asn_DEF_OCTET_STRING_constraints.value; csiz = &asn_DEF_OCTET_STRING_constraints.size; } switch(specs->subvariant) { default: case ASN_OSUBV_ANY: ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant); RETURN(RC_FAIL); case ASN_OSUBV_BIT: canonical_unit_bits = unit_bits = 1; bpc = OS__BPC_BIT; break; case ASN_OSUBV_STR: canonical_unit_bits = unit_bits = 8; if(cval->flags & APC_CONSTRAINED) unit_bits = cval->range_bits; bpc = OS__BPC_CHAR; break; case ASN_OSUBV_U16: canonical_unit_bits = unit_bits = 16; if(cval->flags & APC_CONSTRAINED) unit_bits = cval->range_bits; bpc = OS__BPC_U16; break; case ASN_OSUBV_U32: canonical_unit_bits = unit_bits = 32; if(cval->flags & APC_CONSTRAINED) unit_bits = cval->range_bits; bpc = OS__BPC_U32; break; } /* * Allocate the string. */ if(!st) { st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size)); if(!st) RETURN(RC_FAIL); } ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d", csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible", csiz->lower_bound, csiz->upper_bound, csiz->effective_bits); if(csiz->flags & APC_EXTENSIBLE) { int inext = per_get_few_bits(pd, 1); if(inext < 0) RETURN(RC_WMORE); if(inext) { csiz = &asn_DEF_OCTET_STRING_constraints.size; cval = &asn_DEF_OCTET_STRING_constraints.value; unit_bits = canonical_unit_bits; } } if(csiz->effective_bits >= 0) { FREEMEM(st->buf); if(bpc) { st->size = csiz->upper_bound * bpc; } else { st->size = (csiz->upper_bound + 7) >> 3; } st->buf = (uint8_t *)MALLOC(st->size + 1); if(!st->buf) { st->size = 0; RETURN(RC_FAIL); } } /* X.691, #16.5: zero-length encoding */ /* X.691, #16.6: short fixed length encoding (up to 2 octets) */ /* X.691, #16.7: long fixed length encoding (up to 64K octets) */ if(csiz->effective_bits == 0) { int ret; if(bpc) { ASN_DEBUG("Encoding OCTET STRING size %ld", csiz->upper_bound); ret = OCTET_STRING_per_get_characters(pd, st->buf, csiz->upper_bound, bpc, unit_bits, cval->lower_bound, cval->upper_bound, pc); if(ret > 0) RETURN(RC_FAIL); } else { ASN_DEBUG("Encoding BIT STRING size %ld", csiz->upper_bound); ret = per_get_many_bits(pd, st->buf, 0, unit_bits * csiz->upper_bound); } if(ret < 0) RETURN(RC_WMORE); consumed_myself += unit_bits * csiz->upper_bound; st->buf[st->size] = 0; if(bpc == 0) { int ubs = (csiz->upper_bound & 0x7); st->bits_unused = ubs ? 8 - ubs : 0; } RETURN(RC_OK); } st->size = 0; do { ssize_t raw_len; ssize_t len_bytes; ssize_t len_bits; void *p; int ret; /* Get the PER length */ raw_len = uper_get_length(pd, csiz->effective_bits, &repeat); if(raw_len < 0) RETURN(RC_WMORE); raw_len += csiz->lower_bound; ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)", (long)csiz->effective_bits, (long)raw_len, repeat ? "repeat" : "once", td->name); if(bpc) { len_bytes = raw_len * bpc; len_bits = len_bytes * unit_bits; } else { len_bits = raw_len; len_bytes = (len_bits + 7) >> 3; if(len_bits & 0x7) st->bits_unused = 8 - (len_bits & 0x7); /* len_bits be multiple of 16K if repeat is set */ } p = REALLOC(st->buf, st->size + len_bytes + 1); if(!p) RETURN(RC_FAIL); st->buf = (uint8_t *)p; if(bpc) { ret = OCTET_STRING_per_get_characters(pd, &st->buf[st->size], raw_len, bpc, unit_bits, cval->lower_bound, cval->upper_bound, pc); if(ret > 0) RETURN(RC_FAIL); } else { ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits); } if(ret < 0) RETURN(RC_WMORE); st->size += len_bytes; } while(repeat); st->buf[st->size] = 0; /* nul-terminate */ return rval; } asn_enc_rval_t OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_OCTET_STRING_specifics_t *specs = td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics : &asn_DEF_OCTET_STRING_specs; asn_per_constraints_t *pc = constraints ? constraints : td->per_constraints; asn_per_constraint_t *cval; asn_per_constraint_t *csiz; const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; asn_enc_rval_t er = { 0, 0, 0 }; int inext = 0; /* Lies not within extension root */ unsigned int unit_bits; unsigned int canonical_unit_bits; unsigned int sizeinunits; const uint8_t *buf; int ret; enum { OS__BPC_BIT = 0, OS__BPC_CHAR = 1, OS__BPC_U16 = 2, OS__BPC_U32 = 4 } bpc; /* Bytes per character */ int ct_extensible; if(!st || (!st->buf && st->size)) _ASN_ENCODE_FAILED; if(pc) { cval = &pc->value; csiz = &pc->size; } else { cval = &asn_DEF_OCTET_STRING_constraints.value; csiz = &asn_DEF_OCTET_STRING_constraints.size; } ct_extensible = csiz->flags & APC_EXTENSIBLE; switch(specs->subvariant) { default: case ASN_OSUBV_ANY: _ASN_ENCODE_FAILED; case ASN_OSUBV_BIT: canonical_unit_bits = unit_bits = 1; bpc = OS__BPC_BIT; sizeinunits = st->size * 8 - (st->bits_unused & 0x07); ASN_DEBUG("BIT STRING of %d bytes, %d bits unused", sizeinunits, st->bits_unused); break; case ASN_OSUBV_STR: canonical_unit_bits = unit_bits = 8; if(cval->flags & APC_CONSTRAINED) unit_bits = cval->range_bits; bpc = OS__BPC_CHAR; sizeinunits = st->size; break; case ASN_OSUBV_U16: canonical_unit_bits = unit_bits = 16; if(cval->flags & APC_CONSTRAINED) unit_bits = cval->range_bits; bpc = OS__BPC_U16; sizeinunits = st->size / 2; break; case ASN_OSUBV_U32: canonical_unit_bits = unit_bits = 32; if(cval->flags & APC_CONSTRAINED) unit_bits = cval->range_bits; bpc = OS__BPC_U32; sizeinunits = st->size / 4; break; } ASN_DEBUG("Encoding %s into %d units of %d bits" " (%ld..%ld, effective %d)%s", td->name, sizeinunits, unit_bits, csiz->lower_bound, csiz->upper_bound, csiz->effective_bits, ct_extensible ? " EXT" : ""); /* Figure out wheter size lies within PER visible constraint */ if(csiz->effective_bits >= 0) { if((int)sizeinunits < csiz->lower_bound || (int)sizeinunits > csiz->upper_bound) { if(ct_extensible) { cval = &asn_DEF_OCTET_STRING_constraints.value; csiz = &asn_DEF_OCTET_STRING_constraints.size; unit_bits = canonical_unit_bits; inext = 1; } else _ASN_ENCODE_FAILED; } } else { inext = 0; } if(ct_extensible) { /* Declare whether length is [not] within extension root */ if(per_put_few_bits(po, inext, 1)) _ASN_ENCODE_FAILED; } /* X.691, #16.5: zero-length encoding */ /* X.691, #16.6: short fixed length encoding (up to 2 octets) */ /* X.691, #16.7: long fixed length encoding (up to 64K octets) */ if(csiz->effective_bits >= 0) { ASN_DEBUG("Encoding %d bytes (%ld), length in %d bits", st->size, sizeinunits - csiz->lower_bound, csiz->effective_bits); ret = per_put_few_bits(po, sizeinunits - csiz->lower_bound, csiz->effective_bits); if(ret) _ASN_ENCODE_FAILED; if(bpc) { ret = OCTET_STRING_per_put_characters(po, st->buf, sizeinunits, bpc, unit_bits, cval->lower_bound, cval->upper_bound, pc); } else { ret = per_put_many_bits(po, st->buf, sizeinunits * unit_bits); } if(ret) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } ASN_DEBUG("Encoding %d bytes", st->size); if(sizeinunits == 0) { if(uper_put_length(po, 0)) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); } buf = st->buf; while(sizeinunits) { ssize_t maySave = uper_put_length(po, sizeinunits); if(maySave < 0) _ASN_ENCODE_FAILED; ASN_DEBUG("Encoding %ld of %ld", (long)maySave, (long)sizeinunits); if(bpc) { ret = OCTET_STRING_per_put_characters(po, buf, maySave, bpc, unit_bits, cval->lower_bound, cval->upper_bound, pc); } else { ret = per_put_many_bits(po, buf, maySave * unit_bits); } if(ret) _ASN_ENCODE_FAILED; if(bpc) buf += maySave * bpc; else buf += maySave >> 3; sizeinunits -= maySave; assert(!(maySave & 0x07) || !sizeinunits); } _ASN_ENCODED_OK(er); } int OCTET_STRING_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { static const char *h2c = "0123456789ABCDEF"; const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; char scratch[16 * 3 + 4]; char *p = scratch; uint8_t *buf; uint8_t *end; size_t i; (void)td; /* Unused argument */ if(!st || (!st->buf && st->size)) return (cb("", 8, app_key) < 0) ? -1 : 0; /* * Dump the contents of the buffer in hexadecimal. */ buf = st->buf; end = buf + st->size; for(i = 0; buf < end; buf++, i++) { if(!(i % 16) && (i || st->size > 16)) { if(cb(scratch, p - scratch, app_key) < 0) return -1; _i_INDENT(1); p = scratch; } *p++ = h2c[(*buf >> 4) & 0x0F]; *p++ = h2c[*buf & 0x0F]; *p++ = 0x20; } if(p > scratch) { p--; /* Remove the tail space */ if(cb(scratch, p - scratch, app_key) < 0) return -1; } return 0; } int OCTET_STRING_print_utf8(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; (void)td; /* Unused argument */ (void)ilevel; /* Unused argument */ if(st && (st->buf || !st->size)) { return (cb(st->buf, st->size, app_key) < 0) ? -1 : 0; } else { return (cb("", 8, app_key) < 0) ? -1 : 0; } } void OCTET_STRING_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) { OCTET_STRING_t *st = (OCTET_STRING_t *)sptr; asn_OCTET_STRING_specifics_t *specs = td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics : &asn_DEF_OCTET_STRING_specs; asn_struct_ctx_t *ctx = (asn_struct_ctx_t *) ((char *)st + specs->ctx_offset); struct _stack *stck; if(!td || !st) return; ASN_DEBUG("Freeing %s as OCTET STRING", td->name); if(st->buf) { FREEMEM(st->buf); st->buf = 0; } /* * Remove decode-time stack. */ stck = (struct _stack *)ctx->ptr; if(stck) { while(stck->tail) { struct _stack_el *sel = stck->tail; stck->tail = sel->prev; FREEMEM(sel); } FREEMEM(stck); } if(!contents_only) { FREEMEM(st); } } /* * Conversion routines. */ int OCTET_STRING_fromBuf(OCTET_STRING_t *st, const char *str, int len) { void *buf; if(st == 0 || (str == 0 && len)) { errno = EINVAL; return -1; } /* * Clear the OCTET STRING. */ if(str == NULL) { FREEMEM(st->buf); st->buf = 0; st->size = 0; return 0; } /* Determine the original string size, if not explicitly given */ if(len < 0) len = strlen(str); /* Allocate and fill the memory */ buf = MALLOC(len + 1); if(buf == NULL) return -1; memcpy(buf, str, len); ((uint8_t *)buf)[len] = '\0'; /* Couldn't use memcpy(len+1)! */ FREEMEM(st->buf); st->buf = (uint8_t *)buf; st->size = len; return 0; } OCTET_STRING_t * OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, const char *str, int len) { asn_OCTET_STRING_specifics_t *specs = td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics : &asn_DEF_OCTET_STRING_specs; OCTET_STRING_t *st; st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size); if(st && str && OCTET_STRING_fromBuf(st, str, len)) { FREEMEM(st); st = NULL; } return st; } asn1c-0.9.24+dfsg/skeletons/asn_SET_OF.h0000644000000000000000000000323311472004364016272 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef ASN_SET_OF_H #define ASN_SET_OF_H #ifdef __cplusplus extern "C" { #endif #define A_SET_OF(type) \ struct { \ type **array; \ int count; /* Meaningful size */ \ int size; /* Allocated size */ \ void (*free)(type *); \ } #define ASN_SET_ADD(headptr, ptr) \ asn_set_add((headptr), (ptr)) /******************************************* * Implementation of the SET OF structure. */ /* * Add another structure into the set by its pointer. * RETURN VALUES: * 0 for success and -1/errno for failure. */ int asn_set_add(void *asn_set_of_x, void *ptr); /* * Delete the element from the set by its number (base 0). * This is a constant-time operation. The order of elements before the * deleted ones is guaranteed, the order of elements after the deleted * one is NOT guaranteed. * If _do_free is given AND the (*free) is initialized, the element * will be freed using the custom (*free) function as well. */ void asn_set_del(void *asn_set_of_x, int number, int _do_free); /* * Empty the contents of the set. Will free the elements, if (*free) is given. * Will NOT free the set itself. */ void asn_set_empty(void *asn_set_of_x); /* * Cope with different conversions requirements to/from void in C and C++. * This is mostly useful for support library. */ typedef A_SET_OF(void) asn_anonymous_set_; #define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr)) #define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr)) #ifdef __cplusplus } #endif #endif /* ASN_SET_OF_H */ asn1c-0.9.24+dfsg/skeletons/GraphicString.c0000644000000000000000000000240111502527550017146 0ustar rootroot/*- * Copyright (c) 2003 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include /* * GraphicString basic type description. */ static ber_tlv_tag_t asn_DEF_GraphicString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (25 << 2)), /* [UNIVERSAL 25] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; asn_TYPE_descriptor_t asn_DEF_GraphicString = { "GraphicString", "GraphicString", OCTET_STRING_free, OCTET_STRING_print, /* non-ascii string */ asn_generic_unknown_constraint, OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_der, OCTET_STRING_decode_xer_hex, OCTET_STRING_encode_xer, /* Can't expect it to be ASCII/UTF8 */ OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_GraphicString_tags, sizeof(asn_DEF_GraphicString_tags) / sizeof(asn_DEF_GraphicString_tags[0]) - 1, asn_DEF_GraphicString_tags, sizeof(asn_DEF_GraphicString_tags) / sizeof(asn_DEF_GraphicString_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ }; asn1c-0.9.24+dfsg/skeletons/asn_SET_OF.c0000644000000000000000000000325211472004364016266 0ustar rootroot/*- * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include #include #include /* * Add another element into the set. */ int asn_set_add(void *asn_set_of_x, void *ptr) { asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x); if(as == 0 || ptr == 0) { errno = EINVAL; /* Invalid arguments */ return -1; } /* * Make sure there's enough space to insert an element. */ if(as->count == as->size) { int _newsize = as->size ? (as->size << 1) : 4; void *_new_arr; _new_arr = REALLOC(as->array, _newsize * sizeof(as->array[0])); if(_new_arr) { as->array = (void **)_new_arr; as->size = _newsize; } else { /* ENOMEM */ return -1; } } as->array[as->count++] = ptr; return 0; } void asn_set_del(void *asn_set_of_x, int number, int _do_free) { asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x); if(as) { void *ptr; if(number < 0 || number >= as->count) return; if(_do_free && as->free) { ptr = as->array[number]; } else { ptr = 0; } as->array[number] = as->array[--as->count]; /* * Invoke the third-party function only when the state * of the parent structure is consistent. */ if(ptr) as->free(ptr); } } /* * Free the contents of the set, do not free the set itself. */ void asn_set_empty(void *asn_set_of_x) { asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x); if(as) { if(as->array) { if(as->free) { while(as->count--) as->free(as->array[as->count]); } FREEMEM(as->array); as->array = 0; } as->count = 0; as->size = 0; } } asn1c-0.9.24+dfsg/INSTALL0000644000000000000000000000125711461150505013264 0ustar rootrootQUICK START INSTALLATION ======================== ./configure # Configure the build infrastructure for your platform make # Build the libraries and the compiler make check # Ensure that the code is still behaving well # after compiling on your platform # PLEASE CONTACT ME IF THIS FAILS ON YOUR PLATFORM! make install # Install the compiler into standard location man asn1c # Display the asn1c manual page QUICK USAGE GUIDE ================= For usage guide and more information please refer to the README file. In case of any difficulties with installing the compiler, consider using the Online ASN.1 Compiler at http://lionet.info/asn1c -- Lev Walkin vlm@lionet.info asn1c-0.9.24+dfsg/COPYING0000644000000000000000000000257511505405150013270 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005, 2006, 2007 Lev Walkin * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id$ */ asn1c-0.9.24+dfsg/m4/0000755000000000000000000000000012223077270012552 5ustar rootrootasn1c-0.9.24+dfsg/m4/ltversion.m40000644000000000000000000000127512015121740015035 0ustar rootroot# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # Generated from ltversion.in. # serial 2976 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.4]) m4_define([LT_PACKAGE_REVISION], [1.2976]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.4' macro_revision='1.2976' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) asn1c-0.9.24+dfsg/m4/libtool.m40000644000000000000000000076731412015121740014471 0ustar rootroot# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 56 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl _LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_quote(m4_if([$2], [], m4_quote(lt_decl_tag_varnames), m4_quote(m4_shift($@)))), m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_INIT ]) # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. if test "$no_create" != yes; then lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) fi ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM -f \"$cfgfile\"; exit 1" 1 2 15 $RM -f "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" if test "$GCC" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM -r conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM -r conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM -r conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM -r conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -r -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -r -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc* ) # Intel C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $RM -r conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then _LT_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM -r conftest* AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) asn1c-0.9.24+dfsg/m4/lt~obsolete.m40000644000000000000000000001311312015121740015354 0ustar rootroot# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) asn1c-0.9.24+dfsg/m4/ltsugar.m40000644000000000000000000001026212015121740014465 0ustar rootroot# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. m4_define([lt_combine], [m4_if([$2], [], [], [m4_if([$4], [], [], [lt_join(m4_quote(m4_default([$1], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2], [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]), [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl ]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) asn1c-0.9.24+dfsg/m4/ltoptions.m40000644000000000000000000002722712015121740015050 0ustar rootroot# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) asn1c-0.9.24+dfsg/configure.ac0000644000000000000000000000332412121076013014511 0ustar rootrootAC_INIT([asn1c], [0.9.24], [vlm@lionet.info]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR([m4]) AM_PROG_LIBTOOL dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_YACC AM_PROG_LEX AC_PATH_PROG(AR, ar, ar, $PATH:/usr/ucb:/usr/ccs/bin) dnl for Solaris case "$host_os" in cygwin) case "$target" in *mingw*) CC="$CC -mno-cygwin" esac ;; esac AC_ARG_ENABLE(Werror, [ --enable-Werror abort compilation after any C compiler warning], enable_werror=$enableval, enable_werror=no) if test x$enable_werror = xyes; then ADD_CFLAGS="-Werror -W -Wpointer-arith" fi AC_SUBST(ADD_CFLAGS) dnl Add these flags if we're using GCC. case "$GCC" in yes) CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Wshadow" CFLAGS="$CFLAGS -Wcast-qual" CFLAGS="$CFLAGS -Wcast-align" CFLAGS="$CFLAGS -Wchar-subscripts" CFLAGS="$CFLAGS -Wmissing-prototypes" CFLAGS="$CFLAGS -Wmissing-declarations" ;; esac dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(sys/param.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_STRUCT_TM AC_CHECK_TYPE(intmax_t, int64_t) dnl For mingw AC_SEARCH_LIBS(getopt, iberty) AC_CHECK_FUNCS(strtoimax strtoll) AC_CHECK_FUNCS(mergesort) AC_CHECK_FUNCS(mkstemps) AC_OUTPUT( \ skeletons/standard-modules/Makefile \ skeletons/tests/Makefile \ libasn1compiler/Makefile \ libasn1parser/Makefile \ libasn1print/Makefile \ asn1c/tests/Makefile \ libasn1fix/Makefile \ doc/docsrc/Makefile \ skeletons/Makefile \ examples/Makefile \ tests/Makefile \ asn1c/Makefile \ doc/Makefile \ asn1c.spec \ Makefile \ ) asn1c-0.9.24+dfsg/asn1c/0000755000000000000000000000000012223077270013237 5ustar rootrootasn1c-0.9.24+dfsg/asn1c/README0000644000000000000000000000014711461150505014115 0ustar rootrootasn1c - The ASN.1 Compiler unber - The ASN.1 BER Decoder enber - Reverse unber(1) output back into BER asn1c-0.9.24+dfsg/asn1c/check-xxber.sh0000755000000000000000000000277211456135547016022 0ustar rootroot#!/bin/sh ORIG="./.check-xxber.orig.$$.tmp" TEST="./.check-xxber.test.$$.tmp" # Test diff(1) capabilities diff -a . . 2>/dev/null && diffArgs="-a" # Assume text files diff -u . . 2>/dev/null && diffArgs="$diffArgs -u" # Unified diff output cat< $ORIG

US

1¦ G

1¦ G

1¦ G

EOM ./enber $ORIG | ./unber -p -i 0 - > $TEST 2>&1 diff $diffArgs $ORIG $TEST >/dev/null 2>&1 diffExitCode=$? if [ "$diffExitCode" = "0" ]; then echo "FAILED: $0: expected failure, got success" exit 42; fi # Append necessary terminator echo '
' >> $ORIG # Try trancoding again ./enber $ORIG | ./unber -p -i 0 - > $TEST 2>&1 diff $diffArgs $ORIG $TEST diffExitCode=$? rm -f $ORIG $TEST exit $diffExitCode asn1c-0.9.24+dfsg/asn1c/unber.10000644000000000000000000000744411456135547014456 0ustar rootroot.de Vb .sp .ft CW .nf .. .de Ve .ft R .fi .sp .. .TH UNBER 1 "\*(Dt" "ASN.1 BER Decoder" "ASN.1 BER Decoder" .SH NAME unber \- ASN.1 BER Decoder .SH SYNOPSIS unber [\fB-1\fR] [\fB-i\fRindent] [\fB-m\fR] [\fB-p\fR] [\fB\-s\fR\fIskip\fR] [\fB\-t\fR\fIhex-string\fR] [\fB-\fR] [\fIinfile\fR...] .SH DESCRIPTION unber presents the internal structure of BER-encoded files as human readable text. A single dash denotes the standard input. .sp (The DER and CER formats are subsets of the BER and are also supported.) .SH OPTIONS .TP \fB\-1\fR Do \fInot\fR attempt to read the next BER structure after the first one. This may be useful if the input contains garbage past the single BER sequence. By default, unber continues decoding until the end of file (input stream). .TP \fB\-i\fR \fIindent\fR Use the specified number of spaces for output indentation. Default is 4 spaces. .TP \fB\-m\fR Generate shorter output while still preserving BER encoding information. .TP \fB\-p\fR Do \fInot\fR attempt pretty-printing of known ASN.1 types (BOOLEAN, INTEGER, OBJECT IDENTIFIER, etc). By default, some ASN.1 types are converted into the text representation. This option is required for \&\fIenber\fR\|(1). .TP \fB\-s\fR \fIskip\fR Ignore the first \fIskip\fR bytes in the input stream; useful for stripping off lower level protocol framing data. .TP \fB\-t\fR \fIhex-string\fR Interpret the hex-string as a sequence of hexadecimal values representing the start of BER TLV encoding. Print the human readable explanation. .SH XML FORMAT unber dumps the output in the regular XML format which preserves most of the information from the underlying binary encoding. .P The XML opening tag format is as follows: .Vb \&<\fBtform\fR O="\fBoff\fR" T="\fBtag\fR" TL="\fBtl_len\fR" V="{Indefinite|\fBv_len\fR}" [A="\fBtype\fR"] [\fBF\fR]> .Ve Where: .TP \fBtform\fR Encoding form the value is in: primitive ("P") or constructed ("C") or constructed with indefinite length ("I") .TP \fBoff\fR Offset of the encoded element in the unber input stream. .TP \fBtag\fR The tag class and value in human readable form. .TP \fBtl_len\fR The length of the TL (BER Tag and Length) encoding. .TP \fBv_len\fR The length of the value (V, encoded by the L), may be "Indefinite". .TP \fBtype\fR Likely name of the underlying ASN.1 type (for UNIVERSAL tags). .TP [\fBF\fR] Indicates that the value was reformatted (pretty-printed). This will never appear in the output produced using \fB-p\fR command line option. .P Sample XML output: .Vb \& \&

US

\& \&

832970823

\&
\&
.Ve .SH EXAMPLES Decode the given Tag/Length sequence specified in hexadecimal form: .Vb \& unber \fB-t\fR "\fIbf 20\fR" .Ve Decode the DER file using two-spaces indentation: .Vb \& unber \fB-i\fR \fI2\fR \fIfilename.der\fR .Ve Decode the binary stream taken from the standard input: .Vb \& cat \fI...\fR | unber \fB-\fR .Ve Decode the binary stream and encode it back into an identical stream (see \&\fIenber\fR\|(1)): .Vb \& cat \fI...\fR | unber \fB-p\fR \fB-\fR | enber \fB-\fR > \fIfilename.ber\fR .Ve .SH FOOTNOTES The constructed XML output is not necessarily well-formed. .P When indefinite length encoding is being used, the BER sequence, which is not terminated with the end-of-content octets, will cause the terminating \fB\fR XML tag to disappear. Thus, invalid BER framing directly causes invalid XML output. .P The \&\fIenber\fR\|(1) utility understands such XML correctly. .SH SEE ALSO .TP \&\fIenber\fR\|(1), \&\fIasn1c\fR\|(1) .SH AUTHORS Lev Walkin asn1c-0.9.24+dfsg/asn1c/enber.10000644000000000000000000000263211456135547014430 0ustar rootroot.de Vb .sp .ft CW .nf .. .de Ve .ft R .fi .sp .. .TH ENBER 1 "\*(Dt" "unber counterpart" "unber counterpart" .SH NAME enber \- Convert the unber XML output back into BER .SH SYNOPSIS enber [\fB-n\fR] [\fB-\fR] [\fIinfile\fR...] .SH DESCRIPTION enber convers the XML-formatted files produced by \fIunber\fR\|(1) back into the BER format. A single dash denotes the standard input. .SH OPTIONS .TP \fB\-n\fR Disable input validation. By default, enber performs some basic validity checks against XML input. .SH EXAMPLES Decode a BER sequence and immediately encode it back .Vb \& unber \fB-p\fR \fIfilename.ber\fR | enber \fB-\fR > \fIreconstructed.ber\fR .Ve .SH FOOTNOTES This program does not attempt to perform full-fledged XML parsing. It is merely compatible with \fIunber\fR\|(1)'s output. In particular, XML style comments are not supported. A hash "\fB#\fR" or two dashes "\fB--\fR" following a whitespace is treated as a beginning of a comment line, which is ignored completely. Empty lines are ignored as well. .P The following example demostrates the use of comments: .Vb \& \& \& \fB--\fR \& \fB#\fR Do not terminate: \& \fB#\fR the absence of end-of-content octets is intentional! \& .Ve .SH SEE ALSO .TP \&\fIunber\fR\|(1), \&\fIasn1c\fR\|(1) .SH AUTHORS Lev Walkin asn1c-0.9.24+dfsg/asn1c/asn1c.c0000644000000000000000000003325512015121740014407 0ustar rootroot/*- * Copyright (c) 2003, 2004, 2005, 2006 * Lev Walkin . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id$ */ /* * This is the program that connects the libasn1* libraries together. * It uses them in turn to parse, fix and then compile or print the ASN.1 tree. */ #include "sys-common.h" #undef COPYRIGHT #define COPYRIGHT \ "Copyright (c) 2003, 2004, 2005, 2006 Lev Walkin \n" #include /* Parse the ASN.1 file and build a tree */ #include /* Fix the ASN.1 tree */ #include /* Print the ASN.1 tree */ #include /* Compile the ASN.1 tree */ #include /* Portable basename(3) and dirname(3) */ #ifdef _WIN32 #include #include #else #include #endif static void usage(const char *av0); /* Print the Usage screen and exit */ static int importStandardModules(asn1p_t *asn, const char *skeletons_dir); int main(int ac, char **av) { enum asn1p_flags asn1_parser_flags = A1P_NOFLAGS; enum asn1f_flags asn1_fixer_flags = A1F_NOFLAGS; enum asn1c_flags asn1_compiler_flags= A1C_NO_C99; enum asn1print_flags asn1_printer_flags = APF_NOFLAGS; int print_arg__print_out = 0; /* Don't compile, just print parsed */ int print_arg__fix_n_print = 0; /* Fix and print */ int warnings_as_errors = 0; /* Treat warnings as errors */ char *skeletons_dir = NULL; /* Directory with supplementary stuff */ asn1p_t *asn = 0; /* An ASN.1 parsed tree */ int ret; /* Return value from misc functions */ int ch; /* Command line character */ int i; /* Index in some loops */ /* * Process command-line options. */ while((ch = getopt(ac, av, "EFf:g:hLPp:RS:vW:X")) != -1) switch(ch) { case 'E': print_arg__print_out = 1; break; case 'F': print_arg__fix_n_print = 1; break; case 'f': if(strcmp(optarg, "all-defs-global") == 0) { asn1_compiler_flags |= A1C_ALL_DEFS_GLOBAL; } else if(strcmp(optarg, "bless-SIZE") == 0) { asn1_fixer_flags |= A1F_EXTENDED_SizeConstraint; } else if(strcmp(optarg, "compound-names") == 0) { asn1_compiler_flags |= A1C_COMPOUND_NAMES; } else if(strcmp(optarg, "indirect-choice") == 0) { asn1_compiler_flags |= A1C_INDIRECT_CHOICE; } else if(strncmp(optarg, "known-extern-type=", 18) == 0) { char *known_type = optarg + 18; ret = asn1f_make_known_external_type(known_type); assert(ret == 0 || errno == EEXIST); } else if(strcmp(optarg, "native-types") == 0) { asn1_compiler_flags |= A1C_USE_NATIVE_TYPES; } else if(strcmp(optarg, "no-constraints") == 0) { asn1_compiler_flags |= A1C_NO_CONSTRAINTS; } else if(strcmp(optarg, "no-include-deps") == 0) { asn1_compiler_flags |= A1C_NO_INCLUDE_DEPS; } else if(strcmp(optarg, "includes-quoted") == 0) { asn1_compiler_flags |= A1C_INCLUDES_QUOTED; } else if(strcmp(optarg, "unnamed-unions") == 0) { asn1_compiler_flags |= A1C_UNNAMED_UNIONS; } else if(strcmp(optarg, "skeletons-copy") == 0) { asn1_compiler_flags |= A1C_SKELETONS_COPY; } else { fprintf(stderr, "-f%s: Invalid argument\n", optarg); exit(EX_USAGE); } break; case 'g': if(strcmp(optarg, "en-PER") == 0) { asn1_compiler_flags |= A1C_GEN_PER; } else { fprintf(stderr, "-g%s: Invalid argument\n", optarg); exit(EX_USAGE); } break; case 'h': usage(av[0]); case 'P': asn1_compiler_flags |= A1C_PRINT_COMPILED; asn1_compiler_flags &= ~A1C_NO_C99; break; case 'p': if(strncmp(optarg, "du=", 3) == 0) { char *pduname = optarg + 3; if(strcmp(pduname, "all") == 0) { asn1_compiler_flags |= A1C_PDU_ALL; } else if(strcmp(pduname, "auto") == 0) { asn1_compiler_flags |= A1C_PDU_AUTO; } else if(pduname[0] >= 'A' && pduname[0] <= 'Z') { asn1c__add_pdu_type(pduname); asn1_compiler_flags |= A1C_PDU_TYPE; } else { fprintf(stderr, "-pdu=%s" ": expected -pdu={all|auto|Type}\n", pduname); exit(EX_USAGE); } } else if(strcmp(optarg, "rint-class-matrix") == 0) { asn1_printer_flags |= APF_PRINT_CLASS_MATRIX; } else if(strcmp(optarg, "rint-constraints") == 0) { asn1_printer_flags |= APF_PRINT_CONSTRAINTS; } else if(strcmp(optarg, "rint-lines") == 0) { asn1_printer_flags |= APF_LINE_COMMENTS; } else { fprintf(stderr, "-p%s: Invalid argument\n", optarg); exit(EX_USAGE); } break; case 'R': asn1_compiler_flags |= A1C_OMIT_SUPPORT_CODE; break; case 'S': skeletons_dir = optarg; break; case 'v': fprintf(stderr, "ASN.1 Compiler, v" VERSION "\n" COPYRIGHT); exit(0); break; case 'W': if(strcmp(optarg, "error") == 0) { warnings_as_errors = 1; break; } else if(strcmp(optarg, "debug-lexer") == 0) { asn1_parser_flags |= A1P_LEXER_DEBUG; break; } else if(strcmp(optarg, "debug-fixer") == 0) { asn1_fixer_flags |= A1F_DEBUG; break; } else if(strcmp(optarg, "debug-compiler") == 0) { asn1_compiler_flags |= A1C_DEBUG; break; } else { fprintf(stderr, "-W%s: Invalid argument\n", optarg); exit(EX_USAGE); } break; case 'X': print_arg__print_out = 1; /* Implicit -E */ print_arg__fix_n_print = 1; /* Implicit -F */ asn1_printer_flags |= APF_PRINT_XML_DTD; break; default: usage(av[0]); } /* * Validate the options combination. */ if(!print_arg__print_out) { if(print_arg__fix_n_print) { fprintf(stderr, "Error: -F requires -E\n"); exit(EX_USAGE); } if(asn1_printer_flags) { fprintf(stderr, "Error: " "-print-... arguments require -E\n"); exit(EX_USAGE); } } /* * Ensure that there are some input files present. */ if(ac > optind) { ac -= optind; av += optind; } else { char *bin_name = a1c_basename(av[0]); fprintf(stderr, "%s: No input files specified. " "Try '%s -h' for more information\n", bin_name, bin_name); exit(1); } /* * Make sure the skeleton directory is out there. */ if(skeletons_dir == NULL) { struct stat sb; skeletons_dir = DATADIR; if((av[-optind][0] == '.' || av[-optind][1] == '/') && stat(skeletons_dir, &sb)) { /* * The default skeletons directory does not exist, * compute it from my file name: * ./asn1c/asn1c -> ./skeletons */ char *p; size_t len; p = a1c_dirname(av[-optind]); len = strlen(p) + sizeof("/../skeletons"); skeletons_dir = malloc(len); assert(skeletons_dir); snprintf(skeletons_dir, len, "%s/../skeletons", p); if(stat(skeletons_dir, &sb)) { fprintf(stderr, "WARNING: skeletons are neither in " "\"%s\" nor in \"%s\"!\n", DATADIR, skeletons_dir); if(warnings_as_errors) exit(EX_OSFILE); } } } /* * Iterate over input files and parse each. * All syntax trees from all files will be bundled together. */ for(i = 0; i < ac; i++) { asn1p_t *new_asn; new_asn = asn1p_parse_file(av[i], asn1_parser_flags); if(new_asn == NULL) { fprintf(stderr, "Cannot parse \"%s\"\n", av[i]); exit(EX_DATAERR); } /* * Bundle the parsed tree with existing one. */ if(asn) { asn1p_module_t *mod; while((mod = TQ_REMOVE(&(new_asn->modules), mod_next))) TQ_ADD(&(asn->modules), mod, mod_next); asn1p_delete(new_asn); } else { asn = new_asn; } } /* These are mostly notes for the human readers */ assert(asn); assert(skeletons_dir); /* * Dump the parsed ASN.1 tree if -E specified and -F is NOT given. */ if(print_arg__print_out && !print_arg__fix_n_print) { if(asn1print(asn, asn1_printer_flags)) exit(EX_SOFTWARE); return 0; } /* * Read in the files from skeletons/standard-modules */ if(importStandardModules(asn, skeletons_dir)) { if(warnings_as_errors) exit(EX_DATAERR); } /* * Process the ASN.1 specification: perform semantic checks, * expand references, etc, etc. * This function will emit necessary warnings and error messages. */ ret = asn1f_process(asn, asn1_fixer_flags, NULL /* default fprintf(stderr) */); switch(ret) { case 1: if(!warnings_as_errors) /* Fall through */ case 0: break; /* All clear */ case -1: exit(EX_DATAERR); /* Fatal failure */ } /* * Dump the parsed ASN.1 tree if -E specified and -F is given. */ if(print_arg__print_out && print_arg__fix_n_print) { if(asn1print(asn, asn1_printer_flags)) exit(EX_SOFTWARE); return 0; } /* * Compile the ASN.1 tree into a set of source files * of another language. */ if(asn1_compile(asn, skeletons_dir, asn1_compiler_flags, ac + optind, optind - 1, av - optind)) { exit(EX_SOFTWARE); } return 0; } /* * Parse and import *.asn1 from skeletons/standard-modules */ static int importStandardModules(asn1p_t *asn, const char *skeletons_dir) { asn1p_t *new_asn; asn1p_module_t *mod; const char *filename; char *fullname; char *target_dir; int target_dir_len; int len; #ifdef _WIN32 intptr_t dir; struct _finddata_t c_file; char *pattern; #else struct dirent *dp; DIR *dir; #endif int ret = 0; /* Notes for the human reader */ assert(asn); assert(skeletons_dir); /* * Figure out the standard-modules directory. */ target_dir_len = strlen(skeletons_dir) + sizeof("/standard-modules") - 1; target_dir = malloc(target_dir_len + 1); assert(target_dir); snprintf(target_dir, target_dir_len + 1, "%s/standard-modules", skeletons_dir); #ifdef _WIN32 len = target_dir_len + sizeof("/*.asn1"); pattern = malloc(len); assert(pattern); snprintf(pattern, len, "%s/*.asn1", target_dir); dir = _findfirst(pattern, &c_file); if(dir == -1L) { #else dir = opendir(target_dir); if(!dir) { #endif fprintf(stderr, "WARNING: Cannot find standard modules in %s\n", target_dir); return -1; } #ifdef _WIN32 do { filename = c_file.name; #else while((dp = readdir(dir))) { filename = dp->d_name; #endif len = strlen(filename); if(len <= 5 || strcmp(filename + len - 5, ".asn1")) continue; len = target_dir_len + 1 + len + 1; fullname = malloc(len); if(!fullname) continue; /* Just skip it, no big deal */ snprintf(fullname, len, "%s/%s", target_dir, filename); filename = fullname; new_asn = asn1p_parse_file(filename, A1P_NOFLAGS); if(new_asn == NULL) { fprintf(stderr, "WARNING: Cannot parse standard module \"%s\"\n", filename); ret = -1; continue; } /* Import these modules and mark them as "standard" */ while((mod = TQ_REMOVE(&(new_asn->modules), mod_next))) { mod->_tags |= MT_STANDARD_MODULE; TQ_ADD(&(asn->modules), mod, mod_next); } asn1p_delete(new_asn); #ifdef _WIN32 } while(_findnext(dir, &c_file) == 0); _findclose(dir); #else free(fullname); } /* while(readdir()) */ closedir(dir); #endif return ret; } /* * Print the usage screen and exit(EX_USAGE). */ static void usage(const char *av0) { fprintf(stderr, "ASN.1 Compiler, v" VERSION "\n" COPYRIGHT "Usage: %s [options] file ...\n" "Options:\n" " -E Run only the ASN.1 parser and print out the tree\n" " -F During -E operation, also perform tree fixing\n" "\n" " -P Concatenate and print the compiled text\n" " -R Restrict output (tables only, no support code)\n" " -S
Directory with support (skeleton?) files\n" " (Default is \"%s\")\n" " -X Generate and print the XML DTD\n" "\n" " -Werror Treat warnings as errors; abort if any warning\n" " -Wdebug-lexer Enable verbose debugging output from lexer\n" " -Wdebug-fixer --//-- semantics processor\n" " -Wdebug-compiler --//-- compiler\n" "\n" " -fbless-SIZE Allow SIZE() constraint for INTEGER etc (non-std.)\n" " -fcompound-names Disambiguate C's struct NAME's inside top-level types\n" " -findirect-choice Compile members of CHOICE as indirect pointers\n" " -fincludes-quoted Generate #includes in \"double\" instead of quotes\n" " -fknown-extern-type= Pretend the specified type is known\n" " -fnative-types Use \"long\" instead of INTEGER_t whenever possible, etc.\n" " -fno-constraints Do not generate constraint checking code\n" " -fno-include-deps Do not generate courtesy #includes for dependencies\n" " -funnamed-unions Enable unnamed unions in structures\n" " -fskeletons-copy Force copying the support files\n" "\n" " -gen-PER Generate PER support code\n" " -pdu={all|auto|Type} Generate PDU table (discover PDUs automatically)\n" "\n" " -print-class-matrix Print out the collected object class matrix (debug)\n" " -print-constraints Explain subtype constraints (debug)\n" " -print-lines Generate \"-- #line\" comments in -E output\n" , a1c_basename(av0), DATADIR ); exit(EX_USAGE); } asn1c-0.9.24+dfsg/asn1c/enber.c0000644000000000000000000002334111505405150014473 0ustar rootroot/*- * Copyright (c) 2004, 2005 Lev Walkin . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id$ */ #include "sys-common.h" #include /* For static string tables */ #include #include #include #include #undef COPYRIGHT #define COPYRIGHT \ "Copyright (c) 2004, 2005 Lev Walkin \n" static void usage(const char *av0, int);/* Print the Usage screen and exit */ static int process(const char *fname); /* Perform the BER decoding */ static int process_line(const char *fname, char *line, int lineno); static int no_validation; /* -n */ int main(int ac, char **av) { int ch; /* Command line character */ int i; /* Index in some loops */ /* * Process command-line options. */ while((ch = getopt(ac, av, "nhv")) != -1) switch(ch) { case 'n': no_validation++; break; case 'v': usage(av[0], 1); break; case 'h': default: usage(av[0], 0); } /* * Ensure that there are some input files present. */ if(ac > optind) { ac -= optind; av += optind; } else { fprintf(stderr, "%s: No input files specified\n", av[0]); exit(1); } setvbuf(stdout, 0, _IOLBF, 0); /* * Iterate over input files and parse each. * All syntax trees from all files will be bundled together. */ for(i = 0; i < ac; i++) { if(process(av[i])) exit(EX_DATAERR); } return 0; } /* * Print the usage screen and exit(EX_USAGE). */ static void usage(const char *av0, int copyright_only) { fprintf(stderr, "Convert unber(1)'s output back into BER, " "v" VERSION "\n" COPYRIGHT); if(copyright_only) exit(0); fprintf(stderr, "Usage: %s [-n] [-] [file ...]\n" "Options:\n" " -n Disable XML input validation\n", av0); exit(EX_USAGE); } /* * Open the file and initiate recursive processing. */ static int process(const char *fname) { char buf[8192]; char *collector = 0; size_t collector_size = sizeof(buf); size_t collector_offset = 0; int lineno = 0; FILE *fp; if(strcmp(fname, "-")) { fp = fopen(fname, "r"); if(!fp) { perror(fname); return -1; } } else { fp = stdin; } while(fgets(buf, sizeof(buf), fp) || !feof(fp)) { size_t len = strlen(buf); if(!len) continue; if(collector_offset || buf[len-1] != '\n') { if((collector_size - collector_offset) <= len || !collector) { collector_size <<= 1; collector = REALLOC(collector, collector_size); if(!collector) { perror("realloc()"); exit(EX_OSERR); } } memcpy(collector + collector_offset, buf, len + 1); collector_offset += len; } if(buf[len-1] != '\n') continue; if(collector_offset) { assert(collector[collector_offset-1] == '\n'); process_line(fname, collector, ++lineno); collector_offset = 0; } else { process_line(fname, buf, ++lineno); } } if(fp != stdin) fclose(fp); return 0; } static int process_line(const char *fname, char *line, int lineno) { char buf[32]; char *op; /* '<' */ char *cl; /* '>' */ char *tcl_pos; /* tag class (T=") position */ char *tl_pos; /* tag length (TL=") position */ char *v_pos; /* value length (V=") position */ int constr; ber_tlv_tag_t tag_value; ber_tlv_tag_t tag_class; ber_tlv_tag_t tlv_tag; ber_tlv_len_t tlv_len; ber_tlv_len_t opt_tl_len; /* optional TL length */ ssize_t ret; (void)fname; /* Skip the whitespace */ for(; *line == ' ' || *line == '\t'; line++); /* Find a tag opening angle bracket */ op = line; switch(*op) { case '<': /* That's what we want! A tag opening */ break; case '-': /* This is a comment (dash-dash) */ if(op[1] == *op) case '\r': case '\n': case '#': /* This is a comment */ return 0; default: fprintf(stderr, "%s: Missing '<' after whitespace at line %d\n", fname, lineno); exit(EX_DATAERR); } /* Find a tag closing angle bracket */ for(; *line && *line != '>'; line++) { if(*line < ' ') { fprintf(stderr, "%s: Invalid charset (%d) at line %d\n", fname, *(const unsigned char *)line, lineno); exit(EX_DATAERR); } } cl = line; if(*cl != '>') { fprintf(stderr, "%s: Missing '>' at line %d\n", fname, lineno); exit(EX_DATAERR); } /* Ignore closing tags */ if(op[1] == '/') { if(strchr(cl, '<')) { /* We are not very robust */ fprintf(stderr, "%s: Multiple tags per line at line %d\n", fname, lineno); exit(EX_DATAERR); } /* End-of-content octets */ if(op[2] == 'I') { buf[0] = buf[1] = 0x00; fwrite(buf, 1, 2, stdout); } return 0; } switch(op[1]) { case '!': return 0; /* A comment */ case '?': return 0; /* An XML preamble */ case 'C': constr = 1; break; case 'P': constr = 0; break; case 'I': constr = 2; break; default: fprintf(stderr, "%s: Expected \"C\"/\"P\"/\"I\" as the XML tag name (%c) at line %d\n", fname, op[1], lineno); exit(EX_DATAERR); } *cl = '\0'; if(cl[-1] == 'F') { fprintf(stderr, "%s: Detected pretty-printing of primitive types at line %d. " "Re-run `unber` with -p option to disable pretty-printing.\n", fname, lineno); exit(EX_DATAERR); } tcl_pos = strstr(op, "T=\"["); tl_pos = strstr(op, "TL=\""); v_pos = strstr(op, "V=\""); if(!tcl_pos || (!v_pos && constr != 2)) { fprintf(stderr, "%s: Mandatory attribute %s is not found at line %d\n", fname, (!tcl_pos)?"T":"V", lineno); exit(EX_DATAERR); } errno = 0; opt_tl_len = tl_pos ? strtoul(tl_pos + 4, 0, 10) : 0; if(constr == 2) { tlv_len = 0; } else { tlv_len = strtoul(v_pos + 3, 0, 10); } if(errno || (opt_tl_len && opt_tl_len < 2) || tlv_len < 0) { fprintf(stderr, "%s: Invalid TL or V value at line %d\n", fname, lineno); exit(EX_DATAERR); } tcl_pos += 4; switch(*tcl_pos) { case 'U': /* UNIVERSAL */ tag_class = ASN_TAG_CLASS_UNIVERSAL; break; case 'P': /* PRIVATE */ tag_class = ASN_TAG_CLASS_PRIVATE; break; case 'A': /* APPLICATION */ tag_class = ASN_TAG_CLASS_APPLICATION; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': /* context */ tag_class = ASN_TAG_CLASS_CONTEXT; break; default: fprintf(stderr, "%s: Invalid tag class (%c) at line %d\n", fname, tcl_pos[4], lineno); exit(EX_DATAERR); } for(;; tcl_pos++) { switch(*tcl_pos) { case '"': tcl_pos = ""; case '\0': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: continue; } break; } errno = 0; if(!*tcl_pos || ((long)(tag_value = strtoul(tcl_pos, 0, 10))) < 0 || errno) { fprintf(stderr, "%s: Invalid tag value (%c) at line %d\n", fname, *tcl_pos, lineno); exit(EX_DATAERR); } tlv_tag = ((tag_value << 2) | tag_class); ret = ber_tlv_tag_serialize(tlv_tag, buf, sizeof(buf)); assert(ret >= 1 && (size_t)ret < sizeof(buf)); if(constr == 2) { buf[ret] = 0x80; ret += 1; } else { ret += der_tlv_length_serialize(tlv_len, buf + ret, sizeof(buf) - ret); assert(ret >= 2 && (size_t)ret < sizeof(buf)); } if(opt_tl_len && ret != opt_tl_len) { fprintf(stderr, "%s: Cannot encode TL at line %d " "in the given number of bytes (%ld!=%ld)\n", fname, lineno, (long)ret, (long)opt_tl_len); exit(EX_DATAERR); } if(constr) *buf |= 0x20; /* Enable "constructed" bit */ fwrite(buf, 1, ret, stdout); if(!constr) { ber_tlv_len_t len; for(len = 0, cl++; *cl && *cl != '<'; cl++, len++) { unsigned char v; int h; if(*cl != '&') { fputc(*cl, stdout); continue; } cl++; if(*cl != '#') { fputc(*cl, stdout); continue; } cl++; if(*cl != 'x') { fprintf(stderr, "%s: Expected \"&#xNN;\" at line %d\n", fname, lineno); exit(EX_DATAERR); } for(v = 0, h = 0; h < 2; h++) { unsigned char clv = *++cl; v <<= 4; switch(clv) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': v |= clv - '0'; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': v |= clv - 'A' + 10; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': v |= clv - 'a' + 10; break; default: fprintf(stderr, "%s: Expected \"&#xNN;\" at line %d (%c)\n", fname, lineno, clv); exit(EX_DATAERR); } } cl++; if(*cl != ';') { fprintf(stderr, "%s: Expected \"&#xNN;\" at line %d\n", fname, lineno); exit(EX_DATAERR); } fputc(v, stdout); } if(len != tlv_len) { if(no_validation) fprintf(stderr, "Warning: "); fprintf(stderr, "%s: Could not encode value of %ld chars " "at line %d in %ld bytes\n", fname, (long)len, lineno, (long)tlv_len); if(!no_validation) exit(EX_DATAERR); } } return 0; } asn1c-0.9.24+dfsg/asn1c/tests/0000755000000000000000000000000012223077270014401 5ustar rootrootasn1c-0.9.24+dfsg/asn1c/tests/check-39.c0000644000000000000000000000055011472004340016044 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include int main(int ac, char **av) { T_t t; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ memset(&t, 0, sizeof(t)); /* * No plans to fill it up: just checking whether it compiles or not. */ return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-42.cc0000644000000000000000000000046411461140121016201 0ustar rootroot/* * This file checks that the output may be compiled by the C++ compiler. */ #undef NDEBUG #include #include #include #include #include #include int main() { VariablePart_t t; t.present = VariablePart_PR_vrange; return 0; } asn1c-0.9.24+dfsg/asn1c/tests/README0000644000000000000000000000044512021077573015266 0ustar rootroot The name of the check-N.c file is used as a pointer to the file ../../tests/N-*.asn1. That ASN.1 file is compiled together with check-N.c in a temporary directory. The check-N.c file contains the test engine. For manual execution of a specific test case: ./check-assembly.sh check-.c asn1c-0.9.24+dfsg/asn1c/tests/check-126.-gen-PER.c0000644000000000000000000002040111472004340017367 0ustar rootroot/* * Mode of operation: * Each of the *.in files is XER-decoded, then converted into PER, * compared with *.out file, then decoded and compared with the original. */ #undef NDEBUG #include #include #include #include /* for chdir(2) */ #include #include #include #include #include #include static unsigned char buf[4096]; static int buf_offset; static int _buf_writer(const void *buffer, size_t size, void *app_key) { unsigned char *b, *bend; (void)app_key; assert(buf_offset + size < sizeof(buf)); memcpy(buf + buf_offset, buffer, size); b = buf + buf_offset; bend = b + size; fprintf(stderr, "=> ["); for(; b < bend; b++) { if(*b >= 32 && *b < 127 && *b != '%') fprintf(stderr, "%c", *b); else fprintf(stderr, "%%%02x", *b); } fprintf(stderr, "]:%ld\n", (long)size); buf_offset += size; return 0; } enum enctype { AS_PER, AS_DER, AS_XER, }; static void save_object_as(PDU_t *st, enum enctype how) { asn_enc_rval_t rval; /* Return value */ buf_offset = 0; /* * Save object using specified method. */ switch(how) { case AS_PER: rval = uper_encode(&asn_DEF_PDU, st, _buf_writer, 0); assert(rval.encoded > 0); fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset); return; case AS_DER: rval = der_encode(&asn_DEF_PDU, st, _buf_writer, 0); break; case AS_XER: rval = xer_encode(&asn_DEF_PDU, st, XER_F_BASIC, _buf_writer, 0); break; } if (rval.encoded == -1) { fprintf(stderr, "Cannot encode %s: %s\n", rval.failed_type->name, strerror(errno)); assert(rval.encoded != -1); return; } fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset); } static PDU_t * load_object_from(const char *fname, char *fbuf, int size, enum enctype how, int mustfail) { asn_dec_rval_t rval; PDU_t *st = 0; int csize = 1; if(getenv("INITIAL_CHUNK_SIZE")) csize = atoi(getenv("INITIAL_CHUNK_SIZE")); /* Perform multiple iterations with multiple chunks sizes */ for(; csize < 20; csize += 1) { int fbuf_offset = 0; int fbuf_left = size; int fbuf_chunk = csize; fprintf(stderr, "LOADING OBJECT OF SIZE %d FROM [%s] as %s," " chunks %d\n", size, fname, how==AS_PER?"PER":"XER", csize); if(st) asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); st = 0; do { fprintf(stderr, "\nDecoding bytes %d..%d (left %d) [%s]\n", fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left, fbuf_left, fname); if(st) { fprintf(stderr, "=== currently ===\n"); asn_fprint(stderr, &asn_DEF_PDU, st); fprintf(stderr, "=== end ===\n"); } switch(how) { case AS_XER: rval = xer_decode(0, &asn_DEF_PDU, (void **)&st, fbuf + fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left); break; case AS_DER: assert(0); break; case AS_PER: rval = uper_decode(0, &asn_DEF_PDU, (void **)&st, fbuf + fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left, 0, 0); if(rval.code == RC_WMORE) { if(fbuf_chunk == fbuf_left) { fprintf(stderr, "-> PER decode error (%d bits of %d bytes (c=%d,l=%d)) \n", rval.consumed, size, fbuf_chunk, fbuf_left); rval.code = RC_FAIL; rval.consumed += 7; rval.consumed /= 8; if(mustfail) { fprintf(stderr, "-> (this was expected failure)\n"); return 0; } } else { rval.consumed = 0; /* Not restartable */ ASN_STRUCT_FREE(asn_DEF_PDU, st); st = 0; fprintf(stderr, "-> PER wants more\n"); } } else { fprintf(stderr, "-> PER ret %d/%d mf=%d\n", rval.code, rval.consumed, mustfail); /* uper_decode() returns _bits_ */ rval.consumed += 7; rval.consumed /= 8; if((mustfail?1:0) == (rval.code == RC_FAIL)) { if(mustfail) { fprintf(stderr, "-> (this was expected failure)\n"); return 0; } } else { fprintf(stderr, "-> (unexpected %s)\n", mustfail ? "success" : "failure"); rval.code = RC_FAIL; } } break; } fbuf_offset += rval.consumed; fbuf_left -= rval.consumed; if(rval.code == RC_WMORE) fbuf_chunk += 1; /* Give little more */ else fbuf_chunk = csize; /* Back off */ } while(fbuf_left && rval.code == RC_WMORE); assert(rval.code == RC_OK); if(how == AS_PER) { fprintf(stderr, "[left %d, off %d, size %d]\n", fbuf_left, fbuf_offset, size); assert(fbuf_offset == size); } else { assert(fbuf_offset - size < 2 || (fbuf_offset + 1 /* "\n" */ == size && fbuf[size - 1] == '\n') || (fbuf_offset + 2 /* "\r\n" */ == size && fbuf[size - 2] == '\r' && fbuf[size - 1] == '\n') ); } } if(st) asn_fprint(stderr, &asn_DEF_PDU, st); return st; } static int xer_encoding_equal(char *obuf, size_t osize, char *nbuf, size_t nsize) { char *oend = obuf + osize; char *nend = nbuf + nsize; if((osize && !nsize) || (!osize && nsize)) return 0; /* not equal apriori */ while(1) { while(obuf < oend && isspace(*obuf)) obuf++; while(nbuf < nend && isspace(*nbuf)) nbuf++; if(obuf == oend || nbuf == nend) { if(obuf == oend && nbuf == nend) break; fprintf(stderr, "%s data in reconstructed encoding\n", (obuf == oend) ? "More" : "Less"); return 0; } if(*obuf != *nbuf) { printf("%c%c != %c%c\n", obuf[0], obuf[1], nbuf[0], nbuf[1]); return 0; } obuf++, nbuf++; } return 1; } static void compare_with_data_out(const char *fname, char *buf, int size) { char outName[256]; char fbuf[1024]; size_t rd; FILE *f; char lastChar; int mustfail, compare; sprintf(outName, "../data-126/%s", fname); strcpy(outName + strlen(outName) - 3, ".out"); fprintf(stderr, "Comparing PER output with [%s]\n", outName); lastChar = outName[strlen(outName)-5]; mustfail = lastChar == 'P'; compare = lastChar != 'C'; if((compare && !mustfail) && getenv("REGENERATE")) { f = fopen(outName, "w"); fwrite(buf, 1, size, f); fclose(f); } else { f = fopen(outName, "r"); assert(f); rd = fread(fbuf, 1, sizeof(fbuf), f); assert(rd); fclose(f); fprintf(stderr, "Trying to decode [%s]\n", outName); load_object_from(outName, fbuf, rd, AS_PER, mustfail); if(mustfail) return; if(compare) { assert(rd == (size_t)size); assert(memcmp(fbuf, buf, rd) == 0); fprintf(stderr, "XER->PER recoding .in->.out match.\n"); } else { assert(rd != (size_t)size || memcmp(fbuf, buf, rd)); fprintf(stderr, "XER->PER recoding .in->.out diverge.\n"); } } } static void process_XER_data(const char *fname, char *fbuf, int size) { PDU_t *st; st = load_object_from(fname, fbuf, size, AS_XER, 0); if(!st) return; /* Save and re-load as PER */ save_object_as(st, AS_PER); compare_with_data_out(fname, buf, buf_offset); st = load_object_from("buffer", buf, buf_offset, AS_PER, 0); assert(st); save_object_as(st, AS_XER); fprintf(stderr, "=== original ===\n"); fwrite(fbuf, 1, size, stderr); fprintf(stderr, "=== re-encoded ===\n"); fwrite(buf, 1, buf_offset, stderr); fprintf(stderr, "=== end ===\n"); if(fname[strlen(fname) - 4] == 'X') assert(!xer_encoding_equal(fbuf, size, buf, buf_offset)); else assert(xer_encoding_equal(fbuf, size, buf, buf_offset)); asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); } /* * Decode the .der files and try to regenerate them. */ static int process(const char *fname) { char fbuf[4096]; char *ext = strrchr(fname, '.'); int rd; FILE *fp; if(ext == 0 || strcmp(ext, ".in")) return 0; fprintf(stderr, "\nProcessing file [../%s]\n", fname); snprintf(fbuf, sizeof(fbuf), "../data-126/%s", fname); fp = fopen(fbuf, "r"); assert(fp); rd = fread(fbuf, 1, sizeof(fbuf), fp); fclose(fp); assert((size_t)rd < sizeof(fbuf)); /* expect small files */ process_XER_data(fname, fbuf, rd); fprintf(stderr, "Finished [%s]\n", fname); return 1; } int main() { DIR *dir; struct dirent *dent; int processed_files = 0; char *str; /* Process a specific test file */ str = getenv("DATA_126_FILE"); if(str && strncmp(str, "data-126-", 9) == 0) { process(str); return 0; } dir = opendir("../data-126"); assert(dir); /* * Process each file in that directory. */ while((dent = readdir(dir))) { if(strncmp(dent->d_name, "data-126-", 9) == 0) if(process(dent->d_name)) processed_files++; } assert(processed_files); closedir(dir); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-127.-fnative-types.-gen-PER.c0000644000000000000000000000401011472004340022240 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include #include #include static void verify(int testNo, T_t *ti) { asn_enc_rval_t er; asn_dec_rval_t rv; unsigned char buf[16]; T_t *to = 0; fprintf(stderr, "%d IN: { %ld, %ld, %lu, %lu }\n", testNo, ti->small32range, ti->full32range, ti->unsigned32, ti->unsplit32); er = uper_encode_to_buffer(&asn_DEF_T, ti, buf, sizeof buf); assert(er.encoded == 8 * sizeof(buf)); rv = uper_decode(0, &asn_DEF_T, (void *)&to, buf, sizeof buf, 0, 0); assert(rv.code == RC_OK); fprintf(stderr, "%d ENC: %2x%2x%2x%2x %2x%2x%2x%2x\n", testNo, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); fprintf(stderr, "%d OUT: { %ld, %ld, %lu, %lu } vs { %ld, %ld, %lu, %lu }\n", testNo, ti->small32range, ti->full32range, ti->unsigned32, ti->unsplit32, to->small32range, to->full32range, to->unsigned32, to->unsplit32); assert(ti->small32range == to->small32range); assert(ti->full32range == to->full32range); assert(ti->unsigned32 == to->unsigned32); assert(ti->unsplit32 == to->unsplit32); xer_fprint(stderr, &asn_DEF_T, ti); xer_fprint(stderr, &asn_DEF_T, to); } int main() { T_t ti; ti.small32range = 0; ti.full32range = 0; ti.unsigned32 = 0; ti.unsplit32 = 5; verify(1, &ti); ti.small32range = -1; ti.full32range = -1; ti.unsigned32 = 1; ti.unsplit32 = 300; verify(2, &ti); ti.small32range = -2000000000; ti.full32range = (-2147483647L - 1); ti.unsigned32 = 4000000000; ti.unsplit32 = 500; verify(3, &ti); ti.small32range = -1999999999; ti.full32range = (-2147483647L); ti.unsigned32 = 4294967295UL; ti.unsplit32 = 600; verify(4, &ti); ti.small32range = 2000000000; ti.full32range = 2147483647; ti.unsigned32 = 4294967295UL - 100; ti.unsplit32 = 4294967290UL; verify(5, &ti); ti.small32range = 1999999999; ti.full32range = 2147483647 - 1; ti.unsigned32 = 4294967295UL - 1; ti.unsplit32 = 4294967290UL - 1; verify(6, &ti); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-131.-gen-PER.c0000644000000000000000000000273012015121740017366 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include "T.h" #include "per_opentype.h" int main() { asn_per_data_t pd; asn_per_outp_t po; asn_dec_rval_t rv; T_t t; T_t *t2 = 0; size_t i; memset(&po, 0, sizeof po); po.buffer = po.tmpspace; po.nbits = sizeof(po.tmpspace) * 8; memset(&t, 0, sizeof t); printf("Checking uper_open_type_put():\n"); assert(0 == uper_open_type_put(&asn_DEF_T, 0, &t, &po)); assert(po.nbits == (-1 + sizeof(po.tmpspace)) * 8); printf("po{nboff=%d; nbits=%d; buffer=%p; tmpspace=%p}\n", po.nboff, po.nbits, po.buffer, po.tmpspace); /* One byte length and one byte 0x00 */ assert( (po.nboff == 8 && po.buffer == &po.tmpspace[1]) || (po.nboff == 0 && po.buffer == &po.tmpspace[2])); assert(po.tmpspace[0] == 0x01); assert(po.tmpspace[1] == 0x00); printf("\nChecking uper_open_type_get():\n"); for(i = 0; i < 16; i++) { FREEMEM(t2); t2 = 0; memset(&pd, 0, sizeof pd); pd.buffer = po.tmpspace; pd.nboff = 0; pd.nbits = i; rv = uper_open_type_get(0, &asn_DEF_T, 0, (void **)&t2, &pd); assert(rv.code == RC_WMORE); } memset(&pd, 0, sizeof pd); pd.buffer = po.tmpspace; pd.nboff = 0; pd.nbits = 16; rv = uper_open_type_get(0, &asn_DEF_T, 0, (void **)&t2, &pd); assert(rv.code == RC_OK); assert( (pd.nboff == 8 && pd.buffer == &po.tmpspace[1]) || (pd.nboff == 16 && pd.buffer == &po.tmpspace[0])); assert(pd.nboff + pd.nbits == 16); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-24.c0000644000000000000000000000347011472004340016042 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include uint8_t buf1[] = { 32 | ((2 << 6) + 5), /* [5], constructed */ 17, /* L */ 32 | 16, /* [UNIVERSAL 16], constructed */ 15, /* L */ /* INTEGER a */ 2, /* [UNIVERSAL 2] */ 2, /* L */ 150, 70, /* INTEGER b */ ((2 << 6) + 0), /* [0] */ 1, /* L */ 123, /* INTEGER c */ ((2 << 6) + 1), /* [1] */ 1, /* L */ 123, /* INTEGER d */ 32 | ((2 << 6) + 5), /* [5], constructed */ 3, 2, 1, /* L */ 123, }; static void check(int is_ok, uint8_t *buf, int size, size_t consumed) { T_t t, *tp; asn_dec_rval_t rval; tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "Buf %p\n", buf); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); if(is_ok) { assert(rval.code == RC_OK); assert(rval.consumed == consumed); } else { if(rval.code == RC_OK) { assert(t.a.size != 2 || (!t.b || t.b->size != 1) || (!t.c || t.c->size != 1) || t.d.size != 1 ); } assert(rval.consumed <= consumed); } } static void try_corrupt(uint8_t *buf, int size) { uint8_t *tmp; int i; fprintf(stderr, "\nCorrupting...\n"); tmp = alloca(size); for(i = 0; i < 1000; i++) { int loc; memcpy(tmp, buf, size); /* Corrupt random _non-value_ location. */ do { loc = random() % size; } while(tmp[loc] >= 70); do { tmp[loc] ^= random(); } while(tmp[loc] == buf[loc]); fprintf(stderr, "\nTry %d: corrupting byte %d (%d->%d)\n", i, loc, buf[loc], tmp[loc]); check(0, tmp, size, size); } } int main(int ac, char **av) { (void)ac; /* Unused argument */ (void)av; /* Unused argument */ check(1, buf1, sizeof(buf1), sizeof(buf1)); try_corrupt(buf1, sizeof(buf1)); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-119.-fnative-types.-gen-PER.c0000644000000000000000000002062711472004340022255 0ustar rootroot/* * Mode of operation: * Each of the *.in files is XER-decoded, then converted into PER, * then decoded back from PER, then encoded into XER again, * and finally compared to the original encoding. */ #undef NDEBUG #include #include #include #include /* for chdir(2) */ #include #include #include #include #include #include enum expectation { EXP_OK, /* Encoding/decoding must succeed */ EXP_CXER_EXACT, /* Encoding/decoding using CXER must be exact */ EXP_CXER_DIFF, /* Encoding/decoding using CXER must be different */ EXP_BROKEN, /* Decoding must fail */ EXP_DIFFERENT, /* Reconstruction will yield different encoding */ EXP_PER_NOCOMP, /* Not PER compatible */ }; static unsigned char buf[4096]; static int buf_offset; static int _buf_writer(const void *buffer, size_t size, void *app_key) { unsigned char *b, *bend; (void)app_key; assert(buf_offset + size < sizeof(buf)); memcpy(buf + buf_offset, buffer, size); b = buf + buf_offset; bend = b + size; fprintf(stderr, "=> ["); for(; b < bend; b++) { if(*b >= 32 && *b < 127 && *b != '%') fprintf(stderr, "%c", *b); else fprintf(stderr, "%%%02x", *b); } fprintf(stderr, "]:%ld\n", (long)size); buf_offset += size; return 0; } enum enctype { AS_PER, AS_DER, AS_XER, AS_CXER, }; static void save_object_as(PDU_t *st, enum expectation exp, enum enctype how) { asn_enc_rval_t rval; /* Return value */ buf_offset = 0; /* * Save object using specified method. */ switch(how) { case AS_PER: rval = uper_encode(&asn_DEF_PDU, st, _buf_writer, 0); if(exp == EXP_PER_NOCOMP) assert(rval.encoded == -1); else assert(rval.encoded > 0); fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset); return; case AS_DER: rval = der_encode(&asn_DEF_PDU, st, _buf_writer, 0); break; case AS_XER: rval = xer_encode(&asn_DEF_PDU, st, XER_F_BASIC, _buf_writer, 0); break; case AS_CXER: rval = xer_encode(&asn_DEF_PDU, st, XER_F_CANONICAL, _buf_writer, 0); break; } if (rval.encoded == -1) { fprintf(stderr, "Cannot encode %s: %s\n", rval.failed_type->name, strerror(errno)); assert(rval.encoded != -1); return; } fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset); } static PDU_t * load_object_from(const char *fname, enum expectation expectation, char *fbuf, int size, enum enctype how) { asn_dec_rval_t rval; PDU_t *st = 0; int csize = 1; if(getenv("INITIAL_CHUNK_SIZE")) csize = atoi(getenv("INITIAL_CHUNK_SIZE")); /* Perform multiple iterations with multiple chunks sizes */ for(; csize < 20; csize += 1) { int fbuf_offset = 0; int fbuf_left = size; int fbuf_chunk = csize; fprintf(stderr, "LOADING OBJECT OF SIZE %d FROM [%s] as %s," " chunks %d\n", size, fname, how==AS_PER?"PER":"XER", csize); if(st) asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); st = 0; do { fprintf(stderr, "Decoding bytes %d..%d (left %d)\n", fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left, fbuf_left); if(st) { fprintf(stderr, "=== currently ===\n"); asn_fprint(stderr, &asn_DEF_PDU, st); fprintf(stderr, "=== end ===\n"); } switch(how) { case AS_XER: rval = xer_decode(0, &asn_DEF_PDU, (void **)&st, fbuf + fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left); break; case AS_PER: rval = uper_decode(0, &asn_DEF_PDU, (void **)&st, fbuf + fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left, 0, 0); if(rval.code == RC_WMORE) { rval.consumed = 0; /* Not restartable */ ASN_STRUCT_FREE(asn_DEF_PDU, st); st = 0; fprintf(stderr, "-> PER wants more\n"); } else { fprintf(stderr, "-> PER ret %d/%d\n", rval.code, rval.consumed); /* uper_decode() returns _bits_ */ rval.consumed += 7; rval.consumed /= 8; } break; } fbuf_offset += rval.consumed; fbuf_left -= rval.consumed; if(rval.code == RC_WMORE) fbuf_chunk += 1; /* Give little more */ else fbuf_chunk = csize; /* Back off */ } while(fbuf_left && rval.code == RC_WMORE); if(expectation != EXP_BROKEN) { assert(rval.code == RC_OK); if(how == AS_PER) { fprintf(stderr, "[left %d, off %d, size %d]\n", fbuf_left, fbuf_offset, size); assert(fbuf_offset == size); } else { assert(fbuf_offset - size < 2 || (fbuf_offset + 1 /* "\n" */ == size && fbuf[size - 1] == '\n') || (fbuf_offset + 2 /* "\r\n" */ == size && fbuf[size - 2] == '\r' && fbuf[size - 1] == '\n') ); } } else { assert(rval.code != RC_OK); fprintf(stderr, "Failed, but this was expected\n"); asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); st = 0; /* ignore leak for now */ } } if(st) asn_fprint(stderr, &asn_DEF_PDU, st); return st; } static int xer_encoding_equal(char *obuf, size_t osize, char *nbuf, size_t nsize) { char *oend = obuf + osize; char *nend = nbuf + nsize; if((osize && !nsize) || (!osize && nsize)) return 0; /* not equal apriori */ while(1) { while(obuf < oend && isspace(*obuf)) obuf++; while(nbuf < nend && isspace(*nbuf)) nbuf++; if(obuf == oend || nbuf == nend) { if(obuf == oend && nbuf == nend) break; fprintf(stderr, "%s data in reconstructed encoding\n", (obuf == oend) ? "More" : "Less"); return 0; } if(*obuf != *nbuf) { printf("%c%c != %c%c\n", obuf[0], obuf[1], nbuf[0], nbuf[1]); return 0; } obuf++, nbuf++; } return 1; } static void process_XER_data(const char *fname, enum expectation expectation, char *fbuf, int size) { PDU_t *st; int ret; st = load_object_from(fname, expectation, fbuf, size, AS_XER); if(!st) return; /* Save and re-load as PER */ save_object_as(st, expectation, AS_PER); if(expectation == EXP_PER_NOCOMP) return; /* Already checked */ st = load_object_from("buffer", expectation, buf, buf_offset, AS_PER); assert(st); save_object_as(st, expectation, (expectation == EXP_CXER_EXACT || expectation == EXP_CXER_DIFF) ? AS_CXER : AS_XER); fprintf(stderr, "=== original ===\n"); fwrite(fbuf, 1, size, stderr); fprintf(stderr, "=== re-encoded ===\n"); fwrite(buf, 1, buf_offset, stderr); fprintf(stderr, "=== end ===\n"); switch(expectation) { case EXP_DIFFERENT: assert(!xer_encoding_equal(fbuf, size, buf, buf_offset)); break; case EXP_BROKEN: assert(!xer_encoding_equal(fbuf, size, buf, buf_offset)); break; case EXP_CXER_EXACT: buf[buf_offset++] = '\n'; assert(size == buf_offset); assert(memcmp(fbuf, buf, size) == 0); break; case EXP_CXER_DIFF: buf[buf_offset++] = '\n'; assert(size != buf_offset || memcmp(fbuf, buf, size)); break; case EXP_OK: case EXP_PER_NOCOMP: assert(xer_encoding_equal(fbuf, size, buf, buf_offset)); break; } asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); } /* * Decode the .der files and try to regenerate them. */ static int process(const char *fname) { char fbuf[4096]; char *ext = strrchr(fname, '.'); enum expectation expectation; int ret; int rd; FILE *fp; if(ext == 0 || strcmp(ext, ".in")) return 0; switch(ext[-1]) { case 'B': /* The file is intentionally broken */ expectation = EXP_BROKEN; break; case 'D': /* Reconstructing should yield different data */ expectation = EXP_DIFFERENT; break; case 'E': /* Byte to byte exact reconstruction */ expectation = EXP_CXER_EXACT; break; case 'X': /* Should fail byte-to-byte comparison */ expectation = EXP_CXER_DIFF; break; case 'P': /* Incompatible with PER */ expectation = EXP_PER_NOCOMP; break; default: expectation = EXP_OK; break; } fprintf(stderr, "\nProcessing file [../%s]\n", fname); snprintf(fbuf, sizeof(fbuf), "../data-119/%s", fname); fp = fopen(fbuf, "r"); assert(fp); rd = fread(fbuf, 1, sizeof(fbuf), fp); fclose(fp); assert(rd < sizeof(fbuf)); /* expect small files */ process_XER_data(fname, expectation, fbuf, rd); fprintf(stderr, "Finished [%s]\n", fname); return 1; } int main() { DIR *dir; struct dirent *dent; int processed_files = 0; char *str; /* Process a specific test file */ str = getenv("DATA_119_FILE"); if(str && strncmp(str, "data-119-", 9) == 0) { process(str); return 0; } dir = opendir("../data-119"); assert(dir); /* * Process each file in that directory. */ while((dent = readdir(dir))) { if(strncmp(dent->d_name, "data-119-", 9) == 0) if(process(dent->d_name)) processed_files++; } assert(processed_files); closedir(dir); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-25.c0000644000000000000000000001370311472004340016043 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include uint8_t buf1[] = { 32 | 16, /* [UNIVERSAL 16], constructed */ 128, /* L */ /* a INTEGER */ 2, /* [UNIVERSAL 2] */ 2, /* L */ 150, 70, /* b [2] IMPLICIT BOOLEAN */ 128 | 2, /* [2] */ 1, /* L */ 0xff, /* c NULL */ 5, /* [UNIVERSAL 5] */ 0, /* L */ /* d ENUMERATED */ 10, /* [UNIVERSAL 10] */ 1, /* L */ 222, /* e OCTET STRING */ 4, /* [UNIVERSAL 4] */ 3, /* L */ 'x', 'y', 'z', /* * X.690 specifies that inner structures must be tagged by * stripping off the outer tag for each subsequent level. */ /* f [5] IMPLICIT VisibleString */ 128 | 32 | 5, /* [5], constructed */ 128, /* L indefinite */ 26, /* [UNIVERSAL 26] (VisibleString), primitive */ 2, 'l', 'o', 32 | 26, /* [UNIVERSAL 26], recursively constructed */ 128, 4, /* [UNIVERSAL 4] (OCTET STRING), primitive */ 1, 'v', 4, /* [UNIVERSAL 4], primitive */ 2, 'e', '_', 0, 0, 26, /* [UNIVERSAL 26], primitive */ 2, 'i', 't', 0, 0, /* g BIT STRING */ 3, /* [UNIVERSAL 3], primitive */ 3, /* L */ 2, /* Skip 2 bits */ 147, 150, /* => 148 */ /* h [7] BIT STRING */ 128 | 32 | 7, /* [7], constructed */ 128, /* L indefinite */ 3, /* [UNIVERSAL 3], primitive */ 3, /* L */ 0, /* Skip 0 bits */ 140, 141, 3, /* [UNIVERSAL 3], primitive */ 2, /* L */ 1, /* Skip 1 bit */ 143, /* => 142 */ 0, /* End of h */ 0, 0, /* End of the whole structure */ 0, /* Three bytes of planned leftover */ 111, 222, 223 }; static void check(int is_ok, uint8_t *buf, int size, size_t consumed) { T_t t, *tp; asn_dec_rval_t rval; tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "Buf %p (%d)\n", buf, (int)size); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d, expected %d\n", (int)rval.code, (int)rval.consumed, (int)consumed); if(is_ok) { assert(rval.code == RC_OK); assert(rval.consumed == consumed); assert(strcmp((char *)t.e->buf, "xyz") == 0); assert(strcmp((char *)t.f->buf, "love_it") == 0); assert(t.g->size == 2); assert(t.g->bits_unused == 2); fprintf(stderr, "%d %d\n", t.g->buf[0], t.g->buf[1]); assert(t.g->buf[0] == 147); assert(t.g->buf[1] != 150); assert(t.g->buf[1] == 148); assert(t.h->size == 3); assert(t.h->bits_unused == 1); assert(t.h->buf[0] == 140); assert(t.h->buf[1] == 141); assert(t.h->buf[2] == 142); } else { if(rval.code == RC_OK) { assert(t.a.size != 2 || !t.d || t.d->size != 1 || !t.e || t.e->size != 3 || !t.f || t.f->size != 7 || !t.g || t.g->size != 2 || !t.h || t.h->size != 3 ); } fprintf(stderr, "%d %d\n", (int)rval.consumed, (int)consumed); assert(rval.consumed <= consumed); } asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); } static void try_corrupt(uint8_t *buf, int size, int allow_consume) { uint8_t *tmp; int i; fprintf(stderr, "\nCorrupting...\n"); tmp = alloca(size); for(i = 0; i < 1000; i++) { int loc; memcpy(tmp, buf, size); /* Corrupt random _non-value_ location. */ do { loc = random() % size; } while( loc == 44 /* bit skips */ || loc == 51 /* bit skips */ || loc == 56 /* bit skips */ || tmp[loc] >= 70); do { tmp[loc] = buf[loc] ^ random(); } while( (tmp[loc] == buf[loc]) || (buf[loc] == 0 && tmp[loc] == 0x80)); fprintf(stderr, "\nTry %d: corrupting byte %d (%d->%d)\n", i, loc, buf[loc], tmp[loc]); check(0, tmp, size, allow_consume); } } static void partial_read(uint8_t *buf, size_t size) { T_t t, *tp; asn_dec_rval_t rval; size_t i1, i2; uint8_t *tbuf1 = alloca(size); uint8_t *tbuf2 = alloca(size); uint8_t *tbuf3 = alloca(size); fprintf(stderr, "\nPartial read sequence...\n"); /* * Divide the space (size) into three blocks in various combinations: * |<----->i1<----->i2<----->| * ^ buf ^ buf+size * Try to read block by block. */ for(i1 = 0; i1 < size; i1++) { for(i2 = i1; i2 < size; i2++) { uint8_t *chunk1 = buf; size_t size1 = i1; uint8_t *chunk2 = buf + size1; size_t size2 = i2 - i1; uint8_t *chunk3 = buf + size1 + size2; size_t size3 = size - size1 - size2; fprintf(stderr, "\n%d:{%d, %d, %d}...\n", (int)size, (int)size1, (int)size2, (int)size3); memset(tbuf1, 0, size); memset(tbuf2, 0, size); memset(tbuf3, 0, size); memcpy(tbuf1, chunk1, size1); memcpy(tbuf2, chunk2, size2); memcpy(tbuf3, chunk3, size3); tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "=> Chunk 1 (%d):\n", (int)size1); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, tbuf1, size1); assert(rval.code == RC_WMORE); assert(rval.consumed <= size1); if(rval.consumed < size1) { int leftover = size1 - rval.consumed; memcpy(tbuf2, tbuf1 + rval.consumed, leftover); memcpy(tbuf2 + leftover, chunk2, size2); size2 += leftover; } fprintf(stderr, "=> Chunk 2 (%d):\n", (int)size2); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, tbuf2, size2); assert(rval.code == RC_WMORE); assert(rval.consumed <= size2); if(rval.consumed < size2) { int leftover = size2 - rval.consumed; memcpy(tbuf3, tbuf2 + rval.consumed, leftover); memcpy(tbuf3 + leftover, chunk3, size3); size3 += leftover; } fprintf(stderr, "=> Chunk 3 (%d):\n", (int)size3); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, tbuf3, size3); assert(rval.code == RC_OK); assert(rval.consumed == size3); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); } } } int main(int ac, char **av) { (void)ac; /* Unused argument */ (void)av; /* Unused argument */ /* Check that the full buffer may be decoded normally */ check(1, buf1, sizeof(buf1), sizeof(buf1) - 3); /* Check that some types of buffer corruptions will lead to failure */ try_corrupt(buf1, sizeof(buf1) - 3, sizeof(buf1) - 3); /* Split the buffer in parts and check decoder restartability */ partial_read(buf1, sizeof(buf1) - 3); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/data-126/0000755000000000000000000000000012223077270015620 5ustar rootrootasn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-04-P.in0000644000000000000000000000003611461140121017771 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/README0000644000000000000000000000057511461140121016474 0ustar rootrootMode of operation: Each of the *.in files is XER-decoded, then converted into PER, then compared with the .out file, then decoded back into XER and compared to the original .in file content. Naming conventions: *-C.in - Comparison of .out might fail, but decoding succeeds *-P.in - PER decoding of .out file must fail. *-X.in - Final XER comparison must fail. asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-03-P.in0000644000000000000000000000003611461140121017770 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-16.in0000644000000000000000000000010011461140121017567 0ustar rootroot a z asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-02-P.in0000644000000000000000000000003611461140121017767 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-14.in0000644000000000000000000000010011461140121017565 0ustar rootroot ab asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-19.in0000644000000000000000000000023211461140121017600 0ustar rootroot some long string spanning multiple bytes zzz-zzz-zzz-zzz
42
asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-17.in0000644000000000000000000000010111461140121017571 0ustar rootroot ab z asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-05-P.in0000644000000000000000000000003611461140121017772 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-13.in0000644000000000000000000000007711461140121017601 0ustar rootroot a asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-17.out0000644000000000000000000000001011461140121017771 0ustar rootrootƒ`0,8€asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-02-P.out0000644000000000000000000000000511461140121020164 0ustar rootroot@Àasn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-16.out0000644000000000000000000000000711461140121017776 0ustar rootrootƒ`  asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-13.out0000644000000000000000000000001011461140121017765 0ustar rootrootƒ`  (asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-19.out0000644000000000000000000000007311461140121020004 0ustar rootrootƒrBŽ{öåA³~ìè9ôå§vtøaÝ»Nìè6õÙÓO ™PbóÓ/0ø¯^–úõéo¯^–úõè0 Pasn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-18-X.in0000644000000000000000000000006111461140121020004 0ustar rootroot ab asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-07-P.out0000644000000000000000000000000311461140121020167 0ustar rootroot@@asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-09-C.in0000644000000000000000000000003611461140121017761 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-20.in0000644000000000000000000000023211461140121017570 0ustar rootroot some long string spanning multiple bytes zzz-zzz-zzz-zzz 13 asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-10-C.out0000644000000000000000000000000611461140121020147 0ustar rootroot@€asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-18-X.out0000644000000000000000000000001011461140121020177 0ustar rootrootƒ`0,8€asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-10-C.in0000644000000000000000000000003611461140121017751 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-05-P.out0000644000000000000000000000000411461140121020166 0ustar rootroot@@@asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-03-P.out0000644000000000000000000000000411461140121020164 0ustar rootroot@€asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-20.out0000644000000000000000000000007411461140121017775 0ustar rootrootƒrBŽ{öåA³~ìè9ôå§vtøaÝ»Nìè6õÙÓO ™PbóÓ/0ø¯^–úõéo¯^–úõèH Ðasn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-08-P.out0000644000000000000000000000000311461140121020170 0ustar rootroot@€asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-01.out0000644000000000000000000000000411461140121017765 0ustar rootrootƒ@asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-01.in0000644000000000000000000000003611461140121017571 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-09-C.out0000644000000000000000000000000411461140121020155 0ustar rootroot‚@ asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-12.out0000644000000000000000000000000711461140121017772 0ustar rootrootƒ`(asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-21.out0000644000000000000000000000001411461140121017770 0ustar rootrootƒp(H asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-15.in0000644000000000000000000000007711461140121017603 0ustar rootroot z asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-04-P.out0000644000000000000000000000000511461140121020166 0ustar rootroot@€asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-11-C.in0000644000000000000000000000003611461140121017752 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-07-P.in0000644000000000000000000000003611461140121017774 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-06-P.in0000644000000000000000000000003611461140121017773 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-21.in0000644000000000000000000000014211461140121017571 0ustar rootroot 0 asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-12.in0000644000000000000000000000007611461140121017577 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-11-C.out0000644000000000000000000000000411461140121020146 0ustar rootroot@@asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-14.out0000644000000000000000000000001111461140121017767 0ustar rootrootƒ`0,8€(asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-08-P.in0000644000000000000000000000003611461140121017775 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-15.out0000644000000000000000000000000611461140121017774 0ustar rootrootƒ`asn1c-0.9.24+dfsg/asn1c/tests/data-126/data-126-06-P.out0000644000000000000000000000000311461140121020166 0ustar rootroot@asn1c-0.9.24+dfsg/asn1c/tests/check-30.c0000644000000000000000000001201211472004340016027 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include /* * Test that the optional member (c) is really optional. */ uint8_t buf1[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 8, /* L */ /* a INTEGER */ 64 | 3, /* [APPLICATION 3] */ 1, /* L */ 96, /* b IA5String */ 22, /* [UNIVERSAL 22] */ 3, /* L */ 'x', 'y', 'z' }; /* * This buffer aims at checking the duplication. */ uint8_t buf2[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 8, /* L */ /* a INTEGER */ 64 | 3, /* [APPLICATION 3] */ 1, /* L */ 96, /* a INTEGER _again_ */ 64 | 3, /* [APPLICATION 3] */ 1, /* L */ 97, }; /* * This buffer checks that an unexpected member may be properly ignored. */ uint8_t buf3[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 14, /* L */ /* INTEGER */ 64 | 3, /* [APPLICATION 3] */ 1, /* L */ 96, /* IA5String */ 22, /* [UNIVERSAL 22] */ 3, /* L */ 'x', 'y', 'z', /* unexpected INTEGER */ 64 | 4, /* [APPLICATION 4] */ 1, /* L */ 96, /* [2] BOOLEAN */ ((2 << 6) + 2), /* [2] */ 1, /* L */ 0xff }; /* * This buffer checks that an unexpected member may be properly ignored. * This time, with indefinite length encoding. */ uint8_t buf4[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 16, /* L */ /* a INTEGER */ 64 | 3, /* [APPLICATION 3] */ 1, /* L */ 96, /* b IA5String */ 22, /* [UNIVERSAL 22] */ 3, /* L */ 'x', 'y', 'z', /* unexpected data structure */ 32 | 64 | 4, /* [APPLICATION 4] */ 0x80, /* indefinite L */ 64 | 1, /* [APPLICATION 1] */ 2, /* L */ 'a', 'b', 0x00, 0x00 }; /* * This buffer checks that an unexpected member may be properly ignored. * This time, with indefinite length encoding at the outer level too. */ uint8_t buf5[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 0x80, /* indefinite L */ /* INTEGER */ 64 | 3, /* [APPLICATION 3] */ 1, /* L */ 96, /* IA5String */ 22, /* [UNIVERSAL 22] */ 3, /* L */ 'x', 'y', 'z', /* unexpected data structure */ 32 | 64 | 4, /* [APPLICATION 4] */ 0x80, /* indefinite L */ 64 | 1, /* [APPLICATION 1] */ 2, /* L */ 'a', 'b', 0x00, 0x00, 0x00, 0x00 }; static void check(int is_ok, uint8_t *buf, int size, size_t consumed) { T_t t, *tp; asn_dec_rval_t rval; fprintf(stderr, "\nMust %s:\n", is_ok?"suceed":"fail"); tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "Buf %p\n", buf); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d (out of %d)\n", (int)rval.code, (int)rval.consumed, size); if(is_ok) { assert(rval.code == RC_OK); assert(rval.consumed == consumed); assert(t.i.size == 1); assert(t.i.buf[0] == 96); assert(t.s.size == 3); assert(strcmp(t.s.buf, "xyz") == 0); if(buf == buf3) { assert(t.b); } else { assert(t.b == 0); } } else { if(rval.code == RC_OK) { assert(t.i.size != 1 || t.s.size != 3 || !t.b ); } assert(rval.consumed <= consumed); } } static char xer_buf[128]; static int xer_off; static int xer_cb(const void *buffer, size_t size, void *key) { (void)key; assert(xer_off + size < sizeof(xer_buf)); memcpy(xer_buf + xer_off, buffer, size); xer_off += size; return 0; } static void check_xer(uint8_t *buf, uint8_t size, char *xer_sample) { T_t *tp = 0; asn_dec_rval_t rval; asn_enc_rval_t er; int xer_sample_len = strlen(xer_sample); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size); assert(rval.code == RC_OK); assert(rval.consumed == size); assert(tp); xer_off = 0; er = xer_encode(&asn_DEF_T, tp, XER_F_CANONICAL, xer_cb, 0); assert(er.encoded == xer_off); assert(xer_off); xer_buf[xer_off] = 0; printf("[%s] vs [%s]\n", xer_buf, xer_sample); assert(xer_off == xer_sample_len); assert(memcmp(xer_buf, xer_sample, xer_off) == 0); } static void try_corrupt(uint8_t *buf, int size) { uint8_t *tmp; int i; fprintf(stderr, "\nCorrupting...\n"); tmp = alloca(size); for(i = 0; i < 1000; i++) { int loc; memcpy(tmp, buf, size); /* Corrupt random _non-value_ location. */ do { loc = random() % size; } while(tmp[loc] >= 70); do { tmp[loc] = buf[loc] ^ random(); } while( (tmp[loc] == buf[loc]) || (buf[loc] == 0 && tmp[loc] == 0x80)); fprintf(stderr, "\nTry %d: corrupting byte %d (%d->%d)\n", i, loc, buf[loc], tmp[loc]); check(0, tmp, size, size); } } int main(int ac, char **av) { (void)ac; /* Unused argument */ (void)av; /* Unused argument */ check(1, buf1, sizeof(buf1) + 20, sizeof(buf1)); check(0, buf2, sizeof(buf2) + 1, 5); check(1, buf3, sizeof(buf3) + 1, sizeof(buf3)); check(1, buf4, sizeof(buf4), sizeof(buf4)); check(1, buf5, sizeof(buf5), sizeof(buf5)); check(1, buf5, sizeof(buf5) + 1, sizeof(buf5)); check(0, buf5, sizeof(buf5) - 1, sizeof(buf5)); check_xer(buf1, sizeof(buf1), "xyz96"); check_xer(buf3, sizeof(buf3), "xyz96"); fprintf(stderr, "\nPseudo-random buffer corruptions must fail\n"); try_corrupt(buf1, sizeof(buf1)); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-assembly.sh0000755000000000000000000000306712021102727017630 0ustar rootroot#!/bin/sh # # This script is designed to quickly create lots of files in underlying # test-* directories, do lots of other magic stuff and exit cleanly. # if [ "x$1" = "x" ]; then echo "Usage: $0 " exit fi # Compute the .asn1 spec name by the given file name. source=`echo "$1" | sed -e 's/.*\///'` testno=`echo "$source" | cut -f2 -d'-' | cut -f1 -d'.'` args=`echo "$source" | sed -e 's/\.c[c]*$//'` testdir=test-${args} OFS=$IFS IFS="." set $args shift IFS=$OFS AFLAGS="$@" touch ${testdir}-FAILED # Create this file to ease post mortem analysis if [ ! -d $testdir ]; then mkdir $testdir || exit $? fi cd $testdir || exit $? rm -f ./$source 2>/dev/null ln -fns ../$source || exit $? asn_module=`echo ../../../tests/${testno}-*.asn1` # Create a Makefile for the project. cat > Makefile < #include #include #include #include #include int main(int ac, char **av) { Choice_t t; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ memset(&t, 0, sizeof(t)); /* * No plans to fill it up: just checking whether it compiles or not. */ return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-03.c0000644000000000000000000000262312015121740016034 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include "Enum2.h" #include "xer_decoder.h" static char buf[4096]; static int buf_offset; static int buf_writer(const void *buffer, size_t size, void *app_key) { char *b, *bend; (void)app_key; assert(buf_offset + size < sizeof(buf)); memcpy(buf + buf_offset, buffer, size); b = buf + buf_offset; bend = b + size; buf_offset += size; return 0; } static void check_xer(e_Enum2 eval, char *xer_string) { asn_dec_rval_t rv; char buf2[128]; Enum2_t *e = 0; long val; rv = xer_decode(0, &asn_DEF_Enum2, (void **)&e, xer_string, strlen(xer_string)); assert(rv.code == RC_OK); assert(rv.consumed == strlen(xer_string)); asn_INTEGER2long(e, &val); printf("%s -> %ld == %d\n", xer_string, val, eval); assert(val == eval); buf_offset = 0; xer_encode(&asn_DEF_Enum2, e, XER_F_CANONICAL, buf_writer, 0); buf[buf_offset] = 0; sprintf(buf2, "%s", xer_string); printf("%ld -> %s == %s\n", eval, buf, buf2); assert(0 == strcmp(buf, buf2)); } int main() { check_xer(Enum2_red, ""); check_xer(Enum2_green, ""); check_xer(Enum2_blue, ""); check_xer(Enum2_orange, ""); check_xer(Enum2_alpha, ""); check_xer(Enum2_beta, ""); check_xer(Enum2_gamma, ""); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/data-119/0000755000000000000000000000000012223077270015622 5ustar rootrootasn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-25-P.in0000644000000000000000000000004111461140121017774 0ustar rootroot ABC asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-10.in0000644000000000000000000000032111461140121017572 0ustar rootroot BAZ BAZ BAZ 19 Do not respect SIZE constraint Do not respect SIZE constraint ABCabc asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-14-P.in0000644000000000000000000000004011461140121017771 0ustar rootroot 13 asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-07-P.in0000644000000000000000000000005211461140121017776 0ustar rootroot non-capitals asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-19.in0000644000000000000000000000040311461140121017604 0ustar rootroot kadabra AAAAZZZZ шеÑть! ABC ABCabc (extensibility in play) ABXZ asn1c-0.9.24+dfsg/asn1c/tests/data-119/README0000644000000000000000000000070211461140121016466 0ustar rootrootMode of operation: Each of the *.in files is XER-decoded, then converted into PER, then decoded back from PER, then encoded into XER again, and finally compared to the original encoding. Naming conventions: *-B.in - The file is intentionally broken *-P.in - Is not PER compatible, PER encoding must fail. *-E.in - CXER reconstruction should yield byte-wise identical data. Otherwise, a reconstructed buffer should loosely match the original. asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-17.in0000644000000000000000000000006011461140121017601 0ustar rootroot 1.3.6.1.4.1.9363.1.5.1 asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-16.in0000644000000000000000000000004611461140121017604 0ustar rootroot 3.14159265 asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-13-P.in0000644000000000000000000000004211461140121017772 0ustar rootroot FAIL asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-15.in0000644000000000000000000000005211461140121017600 0ustar rootroot ABCabc,12234 asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-04-P.in0000644000000000000000000000003111461140121017770 0ustar rootroot z asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-12-P.in0000644000000000000000000000004211461140121017771 0ustar rootroot FAIL asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-23-P.in0000644000000000000000000000003611461140121017776 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-08.in0000644000000000000000000000007511461140121017607 0ustar rootroot CAPITALS CAPITALS asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-06-P.in0000644000000000000000000000004011461140121017772 0ustar rootroot ÑÂÌÏËÏ asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-02.in0000644000000000000000000000004211461140121017573 0ustar rootroot 0123456789 asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-22-P.in0000644000000000000000000000003611461140121017775 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-11-P.in0000644000000000000000000000004411461140121017772 0ustar rootroot FAIL asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-09.in0000644000000000000000000000015111461140121017603 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-18.in0000644000000000000000000000041011461140121017601 0ustar rootroot abra kadabra AAAAZZZZ шеÑть! ABC ABCabc (extensibility in play) ABXZ asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-01.in0000644000000000000000000000003011461140121017567 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-20-P.in0000644000000000000000000000004011461140121017766 0ustar rootroot abcd asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-03.in0000644000000000000000000000003111461140121017572 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-24-P.in0000644000000000000000000000004111461140121017773 0ustar rootroot ABC asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-05.in0000644000000000000000000000006311461140121017601 0ustar rootroot yabloko yabloko asn1c-0.9.24+dfsg/asn1c/tests/data-119/data-119-21-P.in0000644000000000000000000000004011461140121017767 0ustar rootroot abcd asn1c-0.9.24+dfsg/asn1c/tests/check-44.c0000644000000000000000000000265411472004340016047 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include uint8_t buf1[] = { 32 | ((3 << 6) + 1), /* [PRIVATE 1], constructed */ 4, /* L */ ((3 << 6) + 2), /* [PRIVATE 2], primitive */ 0, /* L */ ((3 << 6) + 5), /* [PRIVATE 5], primitive */ 0, /* L */ }; uint8_t buf2[] = { 32 | ((3 << 6) + 1), /* [PRIVATE 1], constructed */ 6, /* L */ ((3 << 6) + 2), /* [PRIVATE 2], primitive */ 0, /* L */ 32 | ((3 << 6) + 9), /* [PRIVATE 9], constructed */ 2, ((3 << 6) + 1), /* [PRIVATE 1], primitive */ 0, /* L */ }; static void check(int is_ok, uint8_t *buf, int size, size_t consumed) { T_t t, *tp; asn_dec_rval_t rval; tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "Buf %p\n", buf); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); if(is_ok) { assert(rval.code == RC_OK); assert(rval.consumed == consumed); } else { if(rval.code == RC_OK) { } assert(rval.consumed <= consumed); } } int main(int ac, char **av) { (void)ac; /* Unused argument */ (void)av; /* Unused argument */ check(1, buf1, sizeof(buf1), sizeof(buf1)); check(0, buf1, sizeof(buf1) - 1, sizeof(buf1) - 1); check(0, buf1, sizeof(buf1) - 2, sizeof(buf1) - 2); check(1, buf2, sizeof(buf2), sizeof(buf2)); check(0, buf2, sizeof(buf2) - 1, sizeof(buf2)); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-22.c0000644000000000000000000000622411472004340016040 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include uint8_t buf1[] = { 32 | 16, /* [UNIVERSAL 16], constructed */ 12, /* L */ /* INTEGER a */ ((2 << 6) + 0), /* [0], primitive */ 2, /* L */ 150, 70, /* b [1] EXPLICIT CHOICE */ 32 | ((2 << 6) + 1), /* [1] */ 3, /* L */ ((2 << 6) + 1), /* [1] */ 1, 'i', /* UTF8String c */ ((2 << 6) + 2), /* [2], primitive */ 1, /* L */ 'x' }; uint8_t buf2[128]; int buf2_pos; static int buf2_fill(const void *buffer, size_t size, void *app_key) { (void)app_key; if(buf2_pos + size > sizeof(buf2)) return -1; memcpy(buf2 + buf2_pos, buffer, size); buf2_pos += size; return 0; } static void check(int is_ok, uint8_t *buf, int size, size_t consumed) { T1_t t, *tp; void *tpp = &tp; asn_dec_rval_t rval; asn_enc_rval_t erval; int ret; int i; tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "Buf %p\n", buf); rval = ber_decode(0, &asn_DEF_T1, (void **)tpp, buf, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); if(is_ok) { assert(rval.code == RC_OK); assert(rval.consumed == (size_t)consumed); assert(t.a.size == 2); assert(t.b.present == b_PR_n); assert(t.b.choice.n.size == 1); assert(t.b.choice.n.buf[0] == 'i'); assert(t.c.size == 1); assert(t.c.buf[0] == 'x'); } else { if(rval.code == RC_OK) { assert(t.a.size != 2 || t.b.present != b_PR_n || t.b.choice.n.size != 1 || t.c.size != 1 ); } assert(rval.consumed <= (size_t)consumed); return; } fprintf(stderr, "=> Re-creating using DER encoder <=\n"); /* * Try to re-create using DER encoding. */ buf2_pos = 0; erval = der_encode(&asn_DEF_T1, tp, buf2_fill, 0); assert(erval.encoded != -1); if(erval.encoded != sizeof(buf1)) { printf("%d != %d\n", (int)erval.encoded, (int)sizeof(buf1)); } assert(erval.encoded == sizeof(buf1)); for(i = 0; i < (ssize_t)sizeof(buf1); i++) { if(buf1[i] != buf2[i]) { fprintf(stderr, "Recreated buffer content mismatch:\n"); fprintf(stderr, "Byte %d, %x != %x (%d != %d)\n", i, buf1[i], buf2[i], buf1[i], buf2[i] ); } assert(buf1[i] == buf2[i]); } fprintf(stderr, "=== asn_fprint() ===\n"); ret = asn_fprint(stderr, &asn_DEF_T1, tp); assert(ret == 0); fprintf(stderr, "=== xer_fprint() ===\n"); ret = xer_fprint(stderr, &asn_DEF_T1, tp); assert(ret == 0); fprintf(stderr, "=== EOF ===\n"); } static void try_corrupt(uint8_t *buf, int size) { uint8_t *tmp; int i; fprintf(stderr, "\nCorrupting...\n"); tmp = alloca(size); for(i = 0; i < 1000; i++) { int loc; memcpy(tmp, buf, size); /* Corrupt random _non-value_ location. */ do { loc = random() % size; } while(tmp[loc] >= 70); do { tmp[loc] ^= random(); } while(tmp[loc] == buf[loc]); fprintf(stderr, "\nTry %d: corrupting byte %d (%d->%d)\n", i, loc, buf[loc], tmp[loc]); check(0, tmp, size, size); } } int main(int ac, char **av) { (void)ac; /* Unused argument */ (void)av; /* Unused argument */ check(1, buf1, sizeof(buf1), sizeof(buf1)); try_corrupt(buf1, sizeof(buf1)); check(1, buf1, sizeof(buf1) + 10, sizeof(buf1)); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-46.c0000644000000000000000000000146011472004340016043 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include uint8_t buf1[] = { 32 | ((2 << 6) + 3), /* [3], constructed */ 5, ((2 << 6) + 5), /* [5], primitive */ 3, /* L */ 'a', 'b', 'c', }; static void check(uint8_t *buf, int size, size_t consumed) { T_t t, *tp; asn_dec_rval_t rval; tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "Buf %p\n", buf); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); assert(rval.code == RC_OK); assert(rval.consumed == consumed); } int main(int ac, char **av) { (void)ac; /* Unused argument */ (void)av; /* Unused argument */ check(buf1, sizeof(buf1), sizeof(buf1)); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/data-62/0000755000000000000000000000000012223077270015537 5ustar rootrootasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-32.ber0000644000000000000000000000001011461140121017565 0ustar rootroot¿5123asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-10.ber0000644000000000000000000000001111461140121017562 0ustar rootroot0¡{€asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-10.xbr0000644000000000000000000000020211461140121017607 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-05-B.xbr0000644000000000000000000000024411461140121020000 0ustar rootroot

&x05;

test

asn1c-0.9.24+dfsg/asn1c/tests/data-62/README0000644000000000000000000000017311461140121016405 0ustar rootroot*-B.* - The file is intentionally broken *-D.* - Reconstructing should yield different data *-L.* - Extensions are present asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-30-L.xbr0000644000000000000000000000043011461140121020005 0ustar rootroot

&x37;&x39;

&x00;

79023700808

&x00;

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-06-B.ber0000644000000000000000000000001511461140121017752 0ustar rootroot0¡testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-29-L.ber0000644000000000000000000000003411461140121017772 0ustar rootroot0€¡testá€á€ÿasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-22.ber0000644000000000000000000000001711461140121017573 0ustar rootroot0 ¡ ဿ{·asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-32.xbr0000644000000000000000000000010011461140121017610 0ustar rootroot

123

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-27.xbr0000644000000000000000000000011111461140121017616 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-13-B.ber0000644000000000000000000000001211461140121017745 0ustar rootroot0¡á€â€asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-23-B.xbr0000644000000000000000000000035011461140121017776 0ustar rootroot

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-22.xbr0000644000000000000000000000035011461140121017616 0ustar rootroot

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-17-B.xbr0000644000000000000000000000023711461140121020005 0ustar rootroot

test2

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-30-L.ber0000644000000000000000000000003511461140121017763 0ustar rootroot°€€79£  79023700808„asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-16.ber0000644000000000000000000000001611461140121017575 0ustar rootroot0 ¡ á€testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-26-B.xbr0000644000000000000000000000036211461140121020004 0ustar rootroot

z

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-12-B.ber0000644000000000000000000000000611461140121017747 0ustar rootroot0¡¡€asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-13-B.xbr0000644000000000000000000000030711461140121017777 0ustar rootroot -- Do not terminate: no end-of-content octets is intended. asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-19-B.ber0000644000000000000000000000001611461140121017757 0ustar rootroot0 ¡ á€testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-27.ber0000644000000000000000000000000411461140121017574 0ustar rootroot0¡asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-28-D.ber0000644000000000000000000000000611461140121017760 0ustar rootroot0¡€asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-14.xbr0000644000000000000000000000027311461140121017623 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-12-B.xbr0000644000000000000000000000023211461140121017773 0ustar rootroot -- Do not terminate: no end-of-content octets is intended asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-08-L.xbr0000644000000000000000000000034011461140121020012 0ustar rootroot

&x05;

test

-- extra component
asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-21-B.ber0000644000000000000000000000001711461140121017751 0ustar rootroot0 ¡ဿ{·asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-15-B.xbr0000644000000000000000000000030511461140121017777 0ustar rootroot -- missing EOC asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-21-B.xbr0000644000000000000000000000034611461140121020001 0ustar rootroot

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-25.ber0000644000000000000000000000002011461140121017570 0ustar rootroot0¡ ဿ{·zasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-04-B.xbr0000644000000000000000000000024411461140121017777 0ustar rootroot

&x05;

test

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-17-B.ber0000644000000000000000000000001711461140121017756 0ustar rootroot0 ¡ á€test2asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-25.xbr0000644000000000000000000000035211461140121017623 0ustar rootroot

z

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-15-B.ber0000644000000000000000000000001611461140121017753 0ustar rootroot0 ¡ á€â€ã€asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-09-L.xbr0000644000000000000000000000110111461140121020007 0ustar rootroot

&x05;

test

-- extra component

&xff;

-- another extra component -- yet another extra component

z

-- and yet another one
asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-06-B.xbr0000644000000000000000000000024411461140121020001 0ustar rootroot

&x05;

test

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-24-L.xbr0000644000000000000000000000043311461140121020013 0ustar rootroot

z

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-19-B.xbr0000644000000000000000000000023611461140121020006 0ustar rootroot

test

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-24-L.ber0000644000000000000000000000002411461140121017764 0ustar rootroot0€¡ဿ{·zasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-31-D.xbr0000644000000000000000000000047111461140121020003 0ustar rootroot

&x37;&x39;

&x00;

79023700808

&x00;

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-01.ber0000644000000000000000000000001511461140121017566 0ustar rootroot0 ¡testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-29-L.xbr0000644000000000000000000000056011461140121020021 0ustar rootroot

&x05;

test

-- extra component -- another one

&xff;

-- and yet another
asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-14.ber0000644000000000000000000000002011461140121017566 0ustar rootroot0¡ á€â€ã€asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-03-B.ber0000644000000000000000000000001511461140121017747 0ustar rootroot0 ¡testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-28-D.xbr0000644000000000000000000000011111461140121020000 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-20.ber0000644000000000000000000000001311461140121017565 0ustar rootroot0 ¡ဿ{asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-23-B.ber0000644000000000000000000000001711461140121017753 0ustar rootroot0 ¡ ဿ{·asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-01.xbr0000644000000000000000000000024511461140121017616 0ustar rootroot

&x05;

test

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-11.xbr0000644000000000000000000000020211461140121017610 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-31-D.ber0000644000000000000000000000003711461140121017756 0ustar rootroot°€€79£€ 79023700808„asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-09-L.ber0000644000000000000000000000004411461140121017771 0ustar rootroot0"¡testÿ¡ ဿ{·zá€asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-04-B.ber0000644000000000000000000000001511461140121017750 0ustar rootroot0¡testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-05-B.ber0000644000000000000000000000001511461140121017751 0ustar rootroot0¡testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-03-B.xbr0000644000000000000000000000024411461140121017776 0ustar rootroot

&x05;

test

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-08-L.ber0000644000000000000000000000001711461140121017770 0ustar rootroot0 ¡testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-02-B.ber0000644000000000000000000000001511461140121017746 0ustar rootroot0 ¡testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-18-B.ber0000644000000000000000000000001611461140121017756 0ustar rootroot0 ¡ á€testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-20.xbr0000644000000000000000000000022311461140121017613 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-07-B.xbr0000644000000000000000000000024511461140121020003 0ustar rootroot

&x05;

test

asn1c-0.9.24+dfsg/asn1c/tests/data-62/Makefile0000644000000000000000000000034011461140121017161 0ustar rootroot all: @for xbr in *.xbr; do \ ber=`echo "$$xbr" | sed -e 's/\.xbr$$/\.ber/'`; \ if [ $$xbr -nt $$ber ]; then \ echo "../../enber $$xbr > $$ber"; \ ../../enber $$xbr > $$ber || exit $$?; \ fi; \ done asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-26-B.ber0000644000000000000000000000002211461140121017752 0ustar rootroot0€¡ဿ{·zasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-11.ber0000644000000000000000000000001411461140121017566 0ustar rootroot0 ¡¡€¡€asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-18-B.xbr0000644000000000000000000000023611461140121020005 0ustar rootroot

test

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-16.xbr0000644000000000000000000000023611461140121017624 0ustar rootroot

test

asn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-07-B.ber0000644000000000000000000000001511461140121017753 0ustar rootroot0 ¡testasn1c-0.9.24+dfsg/asn1c/tests/data-62/data-62-02-B.xbr0000644000000000000000000000024511461140121017776 0ustar rootroot

&x05;

test

asn1c-0.9.24+dfsg/asn1c/tests/check-31.c0000644000000000000000000001116011472004340016033 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include uint8_t buf1[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 128, /* L, indefinite */ 32 | 16, /* [UNIVERSAL 16], constructed */ 6, /* L */ /* height INTEGER */ 2, /* [UNIVERSAL 2] */ 1, /* L */ 100, /* width INTEGER */ 2, /* [UNIVERSAL 2] */ 1, /* L */ 80, 32 | 16, /* [UNIVERSAL 16], constructed */ 6, /* L */ /* height INTEGER */ 2, /* [UNIVERSAL 2] */ 1, /* L */ 110, /* width INTEGER */ 2, /* [UNIVERSAL 2] */ 1, /* L */ 82, 0, /* End of forest */ 0 }; uint8_t buf1_reconstr[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 16, /* L */ 32 | 16, /* [UNIVERSAL 16], constructed */ 6, /* L */ /* height INTEGER */ 2, /* [UNIVERSAL 2] */ 1, /* L */ 100, /* width INTEGER */ 2, /* [UNIVERSAL 2] */ 1, /* L */ 80, 32 | 16, /* [UNIVERSAL 16], constructed */ 6, /* L */ /* height INTEGER */ 2, /* [UNIVERSAL 2] */ 1, /* L */ 110, /* width INTEGER */ 2, /* [UNIVERSAL 2] */ 1, /* L */ 82 }; int buf_pos; static int bytes_compare(const void *bufferp, size_t size, void *key) { const uint8_t *buffer = bufferp; assert(buf_pos + size <= sizeof(buf1_reconstr)); (void)key; /* Unused argument */ fprintf(stderr, " writing %d (%d)\n", (int)size, buf_pos + (int)size); for(; size; buf_pos++, size--, buffer++) { if(buf1_reconstr[buf_pos] != *buffer) { fprintf(stderr, "Byte %d is different: %d != %d (%x != %x)\n", buf_pos, *buffer, buf1_reconstr[buf_pos], *buffer, buf1_reconstr[buf_pos] ); assert(buf1_reconstr[buf_pos] == *buffer); } } return 0; } static void check(int is_ok, uint8_t *buf, int size, size_t consumed) { Forest_t t, *tp; asn_dec_rval_t rval; tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "Buf %p\n", buf); rval = ber_decode(0, &asn_DEF_Forest, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); if(is_ok) { assert(rval.code == RC_OK); assert(rval.consumed == consumed); assert(t.list.count == 2); assert(t.list.array[0]->height.size == 1); assert(t.list.array[0]->width.size == 1); assert(t.list.array[1]->height.size == 1); assert(t.list.array[1]->width.size == 1); } else { if(rval.code == RC_OK) { assert(t.list.count != 2 || t.list.array[0]->height.size != 1 || t.list.array[0]->width.size != 1 || t.list.array[1]->height.size != 1 || t.list.array[1]->width.size != 1 ); } assert(rval.consumed <= consumed); return; } /* * Try to re-create the buffer. */ buf_pos = 0; der_encode(&asn_DEF_Forest, &t, bytes_compare, buf1_reconstr); assert(buf_pos == sizeof(buf1_reconstr)); asn_fprint(stderr, &asn_DEF_Forest, &t); xer_fprint(stderr, &asn_DEF_Forest, &t); asn_DEF_Forest.free_struct(&asn_DEF_Forest, &t, 1); } static char xer_buf[512]; static int xer_off; static int xer_cb(const void *buffer, size_t size, void *key) { (void)key; assert(xer_off + size < sizeof(xer_buf)); memcpy(xer_buf + xer_off, buffer, size); xer_off += size; return 0; } static void check_xer(uint8_t *buf, uint8_t size, char *xer_sample) { Forest_t *tp = 0; asn_dec_rval_t rval; asn_enc_rval_t er; int xer_sample_len = strlen(xer_sample); rval = ber_decode(0, &asn_DEF_Forest, (void **)&tp, buf, size); assert(rval.code == RC_OK); assert(rval.consumed == size); assert(tp); xer_off = 0; er = xer_encode(&asn_DEF_Forest, tp, XER_F_CANONICAL, xer_cb, 0); assert(er.encoded == xer_off); assert(xer_off); xer_buf[xer_off] = 0; printf("[%s] vs [%s]\n", xer_buf, xer_sample); assert(xer_off == xer_sample_len); assert(memcmp(xer_buf, xer_sample, xer_off) == 0); } static void try_corrupt(uint8_t *buf, int size) { uint8_t *tmp; int i; fprintf(stderr, "\nCorrupting...\n"); tmp = alloca(size); for(i = 0; i < 1000; i++) { int loc; memcpy(tmp, buf, size); /* Corrupt random _non-value_ location. */ do { loc = random() % size; } while(tmp[loc] >= 70); do { tmp[loc] = buf[loc] ^ random(); } while( (tmp[loc] == buf[loc]) || (buf[loc] == 0 && tmp[loc] == 0x80)); fprintf(stderr, "\nTry %d: corrupting byte %d (%d->%d)\n", i, loc, buf[loc], tmp[loc]); check(0, tmp, size, size); } } int main(int ac, char **av) { (void)ac; /* Unused argument */ (void)av; /* Unused argument */ check(1, buf1, sizeof(buf1), sizeof(buf1)); check_xer(buf1, sizeof(buf1), "1008011082"); try_corrupt(buf1, sizeof(buf1)); check(1, buf1, sizeof(buf1) + 20, sizeof(buf1)); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/data-70/0000755000000000000000000000000012021513136015526 5ustar rootrootasn1c-0.9.24+dfsg/asn1c/tests/data-70/foo0000644000000000000000000000105612021477003016240 0ustar rootroot 3.14 3.15 3.16 3.17 3.18 3.19 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-54-D.in0000644000000000000000000000011011461140121017607 0ustar rootroot
1 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-09-D.in0000644000000000000000000000015012021513136017616 0ustar rootroot 3.14 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-33.in0000644000000000000000000000011011461140121017423 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-56.in0000644000000000000000000000010012021466563017445 0ustar rootroot 123.456.789.101112 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-18.in0000644000000000000000000000007211461140121017435 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-31-B.in0000644000000000000000000000011111461140121017601 0ustar rootroot 7 asn1c-0.9.24+dfsg/asn1c/tests/data-70/README0000644000000000000000000000100112021463536016406 0ustar rootrootMode of operation: Each of the *.in files is XER-decoded, then converted into DER, then decoded back from DER, then encoded into XER again, and finally compared to the original encoding. Naming conventions: *-B.in - The file is intentionally (B)roken *-D.in - Reconstructing should yield (D)ifferent data *-E.in - CXER reconstruction should yield byte-wise identical data. *-X.in - CXER reconstruction should yield non-identical data. Otherwise, a reconstructed buffer should loosely match the original. asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-21-D.in0000644000000000000000000000023211461140121017606 0ustar rootroot one two asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-38-B.in0000644000000000000000000000007411461140121017620 0ustar rootroot 123.456.789 345 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-05-B.in0000644000000000000000000000013411461140121017607 0ustar rootroot 231234 string asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-04-B.in0000644000000000000000000000001511461140121017604 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-36.in0000644000000000000000000000007611461140121017441 0ustar rootroot 123.456.789.101112 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-39.in0000644000000000000000000000012511461140121017437 0ustar rootroot 123 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-01.in0000644000000000000000000000014311461140121017424 0ustar rootroot 128 string asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-46-X.in0000644000000000000000000000012711461140121017644 0ustar rootroot20040512224355+0000 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-37-D.in0000644000000000000000000000011311461140121017613 0ustar rootroot 123.456.789 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-30-B.in0000644000000000000000000000010011461140121017576 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-50.in0000644000000000000000000000011411461140121017426 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-45-X.in0000644000000000000000000000012711461140121017643 0ustar rootroot20040512224355.120Z asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-34-B.in0000644000000000000000000000017011461140121017611 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-40-D.in0000644000000000000000000000016711461140121017616 0ustar rootroot 123 one two asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-27.in0000644000000000000000000000006211461140121017434 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-42-E.in0000644000000000000000000000012311461140121017611 0ustar rootroot20040512224355Z asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-22-D.in0000644000000000000000000000024011461140121017606 0ustar rootroot 0 in improper place one two asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-52-D.in0000644000000000000000000000007611461140121017620 0ustar rootroot 1 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-59-D.in0000644000000000000000000000010712021466647017643 0ustar rootroot 123.456.789.101112 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-32.in0000644000000000000000000000010411461140121017425 0ustar rootroot 1 7 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-23-D.in0000644000000000000000000000024311461140121017612 0ustar rootroot 234 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-35-B.in0000644000000000000000000000015511461140121017615 0ustar rootroot 35 35 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-48.in0000644000000000000000000000007311461140121017441 0ustar rootroot 1.0 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-62-D.in0000644000000000000000000000022512021466747017637 0ustar rootroot 123.456.789.101112 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-13-D.in0000644000000000000000000000012711461140121017612 0ustar rootroot something here asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-58-D.in0000644000000000000000000000010612021466631017632 0ustar rootroot 123.456.789.101112 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-16-B.in0000644000000000000000000000012211461140121017606 0ustar rootroot one two asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-12.in0000644000000000000000000000006011461140121017424 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-61-D.in0000644000000000000000000000011012021466700017614 0ustar rootroot 123.456.789.101112 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-24-D.in0000644000000000000000000000017311461140121017615 0ustar rootroot 234 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-25.in0000644000000000000000000000010611461140121017431 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-51.in0000644000000000000000000000010111461140121017423 0ustar rootroot 1 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-57-D.in0000644000000000000000000000011012021466607017627 0ustar rootroot 123.456.789.101112 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-28.in0000644000000000000000000000010311461140121017431 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-08-B.in0000644000000000000000000000017311461140121017615 0ustar rootroot 123.456.789.101112 1.2.3.4 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-07-D.in0000644000000000000000000000016011461140121017612 0ustar rootroot 123.456.789.101112 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-15.in0000644000000000000000000000012211461140121017426 0ustar rootroot one two asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-55.in0000644000000000000000000000007612021462660017452 0ustar rootroot 123.456.789.101112 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-11.in0000644000000000000000000000012411461140121017424 0ustar rootroot 8 7 6 9 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-02.in0000644000000000000000000000010711461140121017425 0ustar rootroot-1 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-20-D.in0000644000000000000000000000016511461140121017612 0ustar rootroot 123 one two asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-06-B.in0000644000000000000000000000004611461140121017612 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-49.in0000644000000000000000000000010111461140121017432 0ustar rootroot 1.0 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-03.in0000644000000000000000000000017411461140121017432 0ustar rootroot 231234 01 01 11 01 string asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-26-B.in0000644000000000000000000000006211461140121017612 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-44-X.in0000644000000000000000000000012711461140121017642 0ustar rootroot20040512224355,123Z asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-14-D.in0000644000000000000000000000014411461140121017612 0ustar rootroot something here asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-10.in0000644000000000000000000000004311461140121017423 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-17-D.in0000644000000000000000000000016311461140121017616 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-43-E.in0000644000000000000000000000012711461140121017616 0ustar rootroot20040512224355.123Z asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-41-D.in0000644000000000000000000000016111461140121017611 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-47.in0000644000000000000000000000011511461140121017435 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-60-D.in0000644000000000000000000000010712021466665017633 0ustar rootroot 123.456.789.101112 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-53.in0000644000000000000000000000011311461140121017430 0ustar rootroot 1 asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-19.in0000644000000000000000000000013411461140121017435 0ustar rootroot one two asn1c-0.9.24+dfsg/asn1c/tests/data-70/data-70-29-D.in0000644000000000000000000000010011461140121017610 0ustar rootroot asn1c-0.9.24+dfsg/asn1c/tests/check-43.c0000644000000000000000000000072211472004340016040 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include #include int main(int ac, char **av) { Test_structure_1_t ts1; Choice_1_t cs1; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ memset(&ts1, 0, sizeof(ts1)); memset(&cs1, 0, sizeof(cs1)); /* * No plans to fill it up: just checking whether it compiles or not. */ return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-35.c0000644000000000000000000001572211472004340016047 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include uint8_t buf1[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 15, /* L */ /* b CHOICE { b2 ObjectDescriptor }*/ 7, /* [UNIVERSAL 7] */ 1, /* L */ 'z', /* c BOOLEAN */ 1, /* [UNIVERSAL 1] */ 0, /* L */ /* a NumericString */ 18, /* [UNIVERSAL 18] */ 4, /* L */ '=', '<', '&', '>', /* d.r-oid RELATIVE-OID */ 13, /* [UNIVERSAL 13] */ 2, /* L */ 85, 79, }; uint8_t buf1_reconstr[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 16, /* L */ /* c BOOLEAN */ 1, /* [UNIVERSAL 1] */ 1, /* L */ 0, /* b CHOICE { b2 ObjectDescriptor }*/ 7, /* [UNIVERSAL 7] */ 1, /* L */ 'z', /* d.r-oid RELATIVE-OID */ 13, /* [UNIVERSAL 1] */ 2, /* L */ 85, 79, /* a NumericString */ 18, /* [UNIVERSAL 18] */ 4, /* L */ '=', '<', '&', '>', }; uint8_t buf2[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 15, /* L */ /* a NumericString */ 18, /* [UNIVERSAL 18] */ 4, /* L */ '=', '<', '&', '>', /* c BOOLEAN */ 1, /* [UNIVERSAL 1] */ 1, /* L */ 2, /* True */ /* b CHOICE { b1 IA5String }*/ 22, /* [UNIVERSAL 22] */ 1, /* L */ 'z', /* d.oid RELATIVE-OID */ 6, /* [UNIVERSAL 6] */ 1, /* L */ 81, }; uint8_t buf2_reconstr[] = { 32 | 17, /* [UNIVERSAL 17], constructed */ 15, /* L */ /* c BOOLEAN */ 1, /* [UNIVERSAL 1] */ 1, /* L */ 0xff, /* Canonical True */ /* d.oid RELATIVE-OID */ 6, /* [UNIVERSAL 6] */ 1, /* L */ 81, /* a NumericString */ 18, /* [UNIVERSAL 18] */ 4, /* L */ '=', '<', '&', '>', /* b CHOICE { b1 IA5String }*/ 22, /* [UNIVERSAL 22] */ 1, /* L */ 'z' }; static void check(T_t *tp, uint8_t *buf, int size, size_t consumed) { asn_dec_rval_t rval; tp = memset(tp, 0, sizeof(*tp)); fprintf(stderr, "Buf %p (%d)\n", buf, (int)size); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); assert(rval.code == RC_OK); assert(rval.consumed == consumed); assert(strcmp(tp->a.buf, "=<&>") == 0); assert(strcmp(tp->b.choice.b1.buf, "z") == 0 && strcmp(tp->b.choice.b2.buf, "z") == 0); asn_fprint(stderr, &asn_DEF_T, tp); xer_fprint(stderr, &asn_DEF_T, tp); } size_t buf_pos; size_t buf_size; uint8_t *buf; static int buf_fill(const void *buffer, size_t size, void *app_key) { (void)app_key; if(buf_pos + size > buf_size) { fprintf(stderr, "%d + %d > %d\n", (int)buf_pos, (int)size, (int)buf_size); return -1; } memcpy(buf + buf_pos, buffer, size); buf_pos += size; fprintf(stderr, " written %d (%d)\n", (int)size, (int)buf_pos); return 0; } static void compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) { asn_enc_rval_t erval; int i; buf_size = cmp_buf_size + 100; buf = alloca(buf_size); buf_pos = 0; /* * Try to re-create using DER encoding. */ erval = der_encode(&asn_DEF_T, tp, buf_fill, 0); assert(erval.encoded != -1); if(erval.encoded != cmp_buf_size) { printf("%d != %d\n", erval.encoded, cmp_buf_size); } assert(erval.encoded == cmp_buf_size); for(i = 0; i < cmp_buf_size; i++) { if(buf[i] != cmp_buf[i]) { fprintf(stderr, "Recreated buffer content mismatch:\n"); fprintf(stderr, "Byte %d, %x != %x (%d != %d)\n", i, buf[i], cmp_buf[i], buf[i], cmp_buf[i] ); } assert(buf[i] == cmp_buf[i]); } } static void partial_read(uint8_t *buf, size_t size) { T_t t, *tp; asn_dec_rval_t rval; size_t i1, i2; uint8_t *buf1 = alloca(size); uint8_t *buf2 = alloca(size); uint8_t *buf3 = alloca(size); fprintf(stderr, "\nPartial read sequence...\n"); /* * Divide the space (size) into three blocks in various combinations: * |<----->i1<----->i2<----->| * ^ buf ^ buf+size * Try to read block by block. */ for(i1 = 0; i1 < size; i1++) { for(i2 = i1; i2 < size; i2++) { uint8_t *chunk1 = buf; size_t size1 = i1; uint8_t *chunk2 = buf + size1; size_t size2 = i2 - i1; uint8_t *chunk3 = buf + size1 + size2; size_t size3 = size - size1 - size2; fprintf(stderr, "\n%d:{%d, %d, %d}...\n", (int)size, (int)size1, (int)size2, (int)size3); memset(buf1, 0, size); memset(buf2, 0, size); memset(buf3, 0, size); memcpy(buf1, chunk1, size1); memcpy(buf2, chunk2, size2); memcpy(buf3, chunk3, size3); tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "=> Chunk 1 (%d):\n", (int)size1); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf1, size1); assert(rval.code == RC_WMORE); assert(rval.consumed <= size1); if(rval.consumed < size1) { int leftover = size1 - rval.consumed; memcpy(buf2, buf1 + rval.consumed, leftover); memcpy(buf2 + leftover, chunk2, size2); size2 += leftover; } fprintf(stderr, "=> Chunk 2 (%d):\n", (int)size2); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf2, size2); assert(rval.code == RC_WMORE); assert(rval.consumed <= size2); if(rval.consumed < size2) { int leftover = size2 - rval.consumed; memcpy(buf3, buf2 + rval.consumed, leftover); memcpy(buf3 + leftover, chunk3, size3); size3 += leftover; } fprintf(stderr, "=> Chunk 3 (%d):\n", (int)size3); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf3, size3); assert(rval.code == RC_OK); assert(rval.consumed == size3); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); } } } static char xer_buf[128]; static int xer_off; static int xer_cb(const void *buffer, size_t size, void *key) { (void)key; assert(xer_off + size < sizeof(xer_buf)); memcpy(xer_buf + xer_off, buffer, size); xer_off += size; return 0; } static void check_xer(uint8_t *buf, uint8_t size, char *xer_sample) { T_t *tp = 0; asn_dec_rval_t rval; asn_enc_rval_t er; int xer_sample_len = strlen(xer_sample); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size); assert(rval.code == RC_OK); assert(rval.consumed == size); assert(tp); xer_off = 0; er = xer_encode(&asn_DEF_T, tp, XER_F_CANONICAL, xer_cb, 0); assert(xer_off); xer_buf[xer_off] = 0; printf("[%s] (%d/%d) vs [%s] (%d)\n", xer_buf, er.encoded, xer_off, xer_sample, xer_sample_len); assert(er.encoded == xer_off); assert(xer_off == xer_sample_len); assert(memcmp(xer_buf, xer_sample, xer_off) == 0); } int main(int ac, char **av) { T_t t; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ check(&t, buf1, sizeof(buf1) + 10, sizeof(buf1)); compare(&t, buf1_reconstr, sizeof(buf1_reconstr)); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); check_xer(buf1, sizeof(buf1), "z=<&>85.79"); check(&t, buf2, sizeof(buf2) + 10, sizeof(buf2)); compare(&t, buf2_reconstr, sizeof(buf2_reconstr)); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); check_xer(buf2, sizeof(buf2), "z=<&>2.1"); /* Split the buffer in parts and check decoder restartability */ partial_read(buf1, sizeof(buf1)); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-33.c0000644000000000000000000000055011472004340016036 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include int main(int ac, char **av) { T_t t; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ memset(&t, 0, sizeof(t)); /* * No plans to fill it up: just checking whether it compiles or not. */ return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-19.c0000644000000000000000000000055611472004340016050 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include int main(int ac, char **av) { Name_t t; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ memset(&t, 0, sizeof(t)); /* * No plans to fill it up: just checking whether it compiles or not. */ return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-42.-fnative-types.c0000644000000000000000000000566711472004340020726 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include uint8_t buf0[] = { 48, /* LogLine SEQUENCE */ 24, /* L */ 22, /* IA5String */ 4, /* L */ /* "zzz\007" */ 122, 122, 122, 7, 48, /* varsets SEQUENCE OF VariablePartSet */ 16, /* L */ 48, /* VariablePart */ 14, /* L */ 48, /* vparts SEQUENCE OF VariablePart */ 7, /* L */ 49, /* VariablePart */ 5, 26, /* VisibleString */ 3, 49, 50, 51, /* 1 2 3 */ 48, /* ActionItem SEQUENCE */ 3, /* L */ 10, /* accept-as ENUMERATED */ 1, /* L */ 0, }; uint8_t buf1[] = { 48, /* LogLine SEQUENCE */ 19, /* L */ 22, /* IA5String */ 6, /* L */ /* "static" */ 115, 116, 97, 116, 105, 99, 48, /* varsets SEQUENCE OF VariablePartSet */ 9, /* L */ 48, /* VariablePart */ 7, /* L */ 48, /* vparts SEQUENCE OF VariablePart */ 0, /* L */ 48, /* ActionItem SEQUENCE */ 3, /* L */ 10, /* accept-as ENUMERATED */ 1, /* L */ 0, }; static void check(LogLine_t *tp, uint8_t *ptr, int size, size_t consumed) { asn_dec_rval_t rval; tp = memset(tp, 0, sizeof(*tp)); fprintf(stderr, "Buf %p (%d)\n", ptr, size); rval = ber_decode(0, &asn_DEF_LogLine, (void **)&tp, ptr, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); assert(rval.code == RC_OK); assert(rval.consumed == consumed); asn_fprint(stderr, &asn_DEF_LogLine, tp); asn_DEF_LogLine.free_struct(&asn_DEF_LogLine, tp, 1); } uint8_t *buf; uint8_t buf_size; uint8_t buf_pos; static int buf_fill(const void *buffer, size_t size, void *app_key) { (void)app_key; /* Unused argument */ assert(buf_pos + size <= buf_size); memcpy(buf + buf_pos, buffer, size); buf_pos += size; return 0; } static void check_serialize() { LogLine_t ll; VariablePartSet_t vps; VariablePart_t vp; VisibleString_t vpart; asn_enc_rval_t erval; int i; memset(&ll, 0, sizeof(ll)); memset(&vps, 0, sizeof(vps)); memset(&vp, 0, sizeof(vp)); memset(&vpart, 0, sizeof(vpart)); vpart.buf = "123"; vpart.size = 3; vp.present = VariablePart_PR_vset; ASN_SET_ADD(&vp.choice.vset, &vpart); vps.resolution.accept_as = accept_as_unknown; ASN_SEQUENCE_ADD(&vps.vparts, &vp); ASN_SEQUENCE_ADD(&ll.varsets, &vps); ll.line_digest.buf = "zzz\007"; ll.line_digest.size = 4; asn_fprint(stderr, &asn_DEF_LogLine, &ll); buf_size = 128; buf = alloca(buf_size); erval = der_encode(&asn_DEF_LogLine, &ll, buf_fill, 0); assert(erval.encoded > 1); fprintf(stderr, "Encoded in %d bytes\n", erval.encoded); fprintf(stderr, "\n"); for(i = 0; i < buf_pos; i++) { fprintf(stderr, "%d ", buf[i]); } fprintf(stderr, "\n\n"); assert(erval.encoded == sizeof(buf0)); assert(memcmp(buf0, buf, sizeof(buf0)) == 0); } int main(int ac, char **av) { LogLine_t t; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ check_serialize(); check(&t, buf0, sizeof(buf0), sizeof(buf0)); check(&t, buf1, sizeof(buf1), sizeof(buf1)); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-50.c0000644000000000000000000000061311472004340016035 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include #include #include #include int main(int ac, char **av) { (void)ac; /* Unused argument */ (void)av; /* Unused argument */ /* * No plans to fill it up: just checking whether it compiles or not. */ return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-48.c0000644000000000000000000000373111472004340016050 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include #include static unsigned char buf[4096]; static int buf_offset; static int _buf_writer(const void *buffer, size_t size, void *app_key) { unsigned char *b, *bend; (void)app_key; assert(buf_offset + size < sizeof(buf)); memcpy(buf + buf_offset, buffer, size); b = buf + buf_offset; bend = b + size; printf("=> ["); for(; b < bend; b++) printf(" %02X", *b); printf("]:%ld\n", (long)size); buf_offset += size; return 0; } static int save_object(void *bs, asn_TYPE_descriptor_t *td) { asn_enc_rval_t rval; /* Return value */ int i; rval = der_encode(td, bs, _buf_writer, 0); if (rval.encoded == -1) { fprintf(stderr, "Cannot encode %s: %s\n", rval.failed_type->name, strerror(errno)); assert(rval.encoded != -1); return -1; /* JIC */ } buf[buf_offset++] = 123; /* Finalize with garbage */ asn_fprint(stderr, td, bs); xer_fprint(stderr, td, bs); printf("OUT: ["); for(i = 0; i < buf_offset; i++) printf(" %02x", buf[i]); printf("]\n"); return 0; } static int load_object(void *bs, asn_TYPE_descriptor_t *td) { asn_dec_rval_t rval; fprintf(stderr, "\nLOADING OBJECT OF SIZE %d\n", buf_offset); rval = ber_decode(0, td, (void **)&bs, buf, buf_offset); assert(rval.code == RC_OK); asn_fprint(stderr, td, bs); xer_fprint(stderr, td, bs); return (rval.code == RC_OK)?0:-1; } int main() { asn_TYPE_descriptor_t *td = &asn_DEF_UserIdentifier; UserIdentifier_t user; UserIdentifier_t user_new; int ret; memset(&user, 0, sizeof user); memset(&user_new, 0, sizeof user_new); user.present = UserIdentifier_PR_phoneNumber; OCTET_STRING_fromBuf( &user.choice.phoneNumber, "0123456789", -1); /* Save->Load must succeed */ save_object(&user, td); ret = load_object(&user_new, td); assert(user_new.present == UserIdentifier_PR_phoneNumber); assert(ret == 0); printf("OK\n"); return ret; } asn1c-0.9.24+dfsg/asn1c/tests/check-60.-fnative-types.c0000644000000000000000000001056511472004340020717 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include #include #include static unsigned char buf[4096]; static int buf_offset; static int _buf_writer(const void *buffer, size_t size, void *app_key) { unsigned char *b, *bend; (void)app_key; assert(buf_offset + size < sizeof(buf)); memcpy(buf + buf_offset, buffer, size); b = buf + buf_offset; bend = b + size; printf("=> ["); for(; b < bend; b++) printf(" %02X", *b); printf("]:%ld\n", (long)size); buf_offset += size; return 0; } static int save_object(void *bs, asn_TYPE_descriptor_t *td) { asn_enc_rval_t rval; /* Return value */ int i; buf_offset = 0; rval = der_encode(td, bs, _buf_writer, 0); if (rval.encoded == -1) { fprintf(stderr, "Cannot encode %s: %s\n", rval.failed_type->name, strerror(errno)); assert(rval.encoded != -1); return -1; /* JIC */ } buf[buf_offset++] = 0xab; /* Finalize with garbage */ asn_fprint(stderr, td, bs); printf("OUT: ["); for(i = 0; i < buf_offset; i++) printf(" %02x", buf[i]); printf("]\n"); return 0; } static int load_object(void *bs, asn_TYPE_descriptor_t *td) { asn_dec_rval_t rval; fprintf(stderr, "\nLOADING OBJECT OF SIZE %d\n", buf_offset); rval = ber_decode(0, td, (void **)&bs, buf, buf_offset); assert(rval.code == RC_OK); asn_fprint(stderr, td, bs); return (rval.code == RC_OK)?0:-1; } /* [3] IMPLICIT SEQUENCE { b BOOLEAN } */ uint8_t test_any_buf1[] = { 0xa3, 0x80, /* [3], constructed, indefinite */ 0x01, 0x01, 0xff, /* b BOOLEAN ::= TRUE */ 0x00, 0x00 /* End of content octets */ }; /* b BOOLEAN */ uint8_t test_any_buf2[] = { 0x01, 0x01, 0x13 }; int main() { asn_TYPE_descriptor_t *td1 = &asn_DEF_T1; asn_TYPE_descriptor_t *td2 = &asn_DEF_T2; T1_t t1, t1_new; T2_t t2, t2_new; int ret; /* * Test the T1 with constructed indefinite length ANY encoding. */ memset(&t1, 0, sizeof(t1)); memset(&t1_new, 0, sizeof(t1_new)); t1.i = 112233; t1.any.buf = test_any_buf1; t1.any.size = sizeof(test_any_buf1); /* Save->Load must succeed */ save_object(&t1, td1); ret = load_object(&t1_new, td1); assert(ret == 0); assert(t1_new.i == 112233); assert(t1_new.any.size == sizeof(test_any_buf1)); assert(memcmp(t1_new.any.buf, test_any_buf1, sizeof(test_any_buf1)) == 0); /* * Test the T1 with primitive encoding. */ memset(&t1, 0, sizeof(t1)); memset(&t1_new, 0, sizeof(t1_new)); t1.i = -112233; t1.any.buf = test_any_buf2; t1.any.size = sizeof(test_any_buf2); /* Save->Load must succeed */ save_object(&t1, td1); ret = load_object(&t1_new, td1); assert(ret == 0); assert(t1_new.i == -112233); assert(t1_new.any.size == sizeof(test_any_buf2)); assert(memcmp(t1_new.any.buf, test_any_buf2, sizeof(test_any_buf2)) == 0); /* * Test the T2 empty sequence. */ memset(&t2, 0, sizeof(t2)); memset(&t2_new, 0, sizeof(t2_new)); t2.i = 332211; t2.any = calloc(1, sizeof(*t2.any)); t2.any->buf = 0; t2.any->size = 0; /* Save->Load must succeed */ save_object(&t2, td2); ret = load_object(&t2_new, td2); assert(ret == 0); assert(t2_new.i == 332211); assert(t2_new.any->size == 0); /* * Test the T2 sequence. */ memset(&t2, 0, sizeof(t2)); memset(&t2_new, 0, sizeof(t2_new)); t2.i = 332211; t2.any = calloc(1, sizeof(*t2.any)); t2.any->buf = test_any_buf1; t2.any->size = sizeof(test_any_buf1); /* Save->Load must succeed */ save_object(&t2, td2); ret = load_object(&t2_new, td2); assert(ret == 0); assert(t2_new.i == 332211); assert(t2_new.any->size == sizeof(test_any_buf1)); assert(memcmp(t2_new.any->buf, test_any_buf1, sizeof(test_any_buf1)) == 0); /* * Test the T2 sequence with primitive encoding. */ memset(&t2, 0, sizeof(t2)); memset(&t2_new, 0, sizeof(t2_new)); t2.i = 0; t2.any = calloc(1, sizeof(*t2.any)); t2.any->buf = test_any_buf2; t2.any->size = sizeof(test_any_buf2); /* Save->Load must succeed */ save_object(&t2, td2); ret = load_object(&t2_new, td2); assert(ret == 0); assert(t2_new.i == 0); assert(t2_new.any->size == sizeof(test_any_buf2)); assert(memcmp(t2_new.any->buf, test_any_buf2, sizeof(test_any_buf2)) == 0); /* * Test T2 with ANY element omitted. */ free(t2.any); t2.any = 0; memset(&t2_new, 0, sizeof(t2_new)); save_object(&t2, td2); ret = load_object(&t2_new, td2); assert(ret == 0); assert(t2_new.i == 0); assert(t2_new.any == 0); printf("OK\n"); return ret; } asn1c-0.9.24+dfsg/asn1c/tests/check-72.-fcompound-names.c0000644000000000000000000000055611472004340021216 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include int main(int ac, char **av) { Type_t t; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ memset(&t, 0, sizeof(t)); /* * No plans to fill it up: just checking whether it compiles or not. */ return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-92.c0000644000000000000000000000057211472004340016047 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include int main(int ac, char **av) { Everything_t t; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ memset(&t, 0, sizeof(t)); /* * No plans to fill it up: just checking whether it compiles or not. */ return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-65.c0000644000000000000000000000432111472004340016043 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include #include uint8_t buf1[] = { 32 | ((2 << 6) + 2), /* [2], constructed */ 6, 32 | ((2 << 6) + 3), /* [3], constructed */ 4, 32 | ((2 << 6) + 4), /* [4], constructed */ 2, 0 | ((2 << 6) + 6), /* [6], primitive */ 0 }; uint8_t buf2[] = { 32 | ((2 << 6) + 0), /* [0], constructed */ 23, 32 | ((2 << 6) + 1), /* [1], constructed */ 6, 32 | ((2 << 6) + 4), /* [4], constructed */ 4, 0 | ((2 << 6) + 6), /* [6], primitive */ 2, 0xC0, 0x00, 32 | ((2 << 6) + 2), /* [2], constructed */ 6, 32 | ((2 << 6) + 4), /* [4], constructed */ 4, 0 | ((2 << 6) + 6), /* [6], primitive */ 2, 0x80, 0x00, 32 | ((2 << 6) + 3), /* [3], constructed */ 5, 0 | ((2 << 6) + 6), /* [6], primitive */ 3, 0x80, 0x01, 0x02, }; static void check_1(int is_ok, uint8_t *buf, int size, size_t consumed) { asn_TYPE_descriptor_t *td = &asn_DEF_T1; asn_dec_rval_t rval; T1_t t, *tp; tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "Buf %p\n", buf); rval = ber_decode(0, td, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); if(is_ok) { assert(rval.code == RC_OK); assert(rval.consumed == consumed); } else { if(rval.code == RC_OK) { } assert(rval.consumed <= consumed); } } static void check_2(int is_ok, uint8_t *buf, int size, size_t consumed) { asn_TYPE_descriptor_t *td = &asn_DEF_T; asn_dec_rval_t rval; T_t t, *tp; tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "Buf %p\n", buf); rval = ber_decode(0, td, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); if(is_ok) { assert(rval.code == RC_OK); assert(rval.consumed == consumed); } else { if(rval.code == RC_OK) { } assert(rval.consumed <= consumed); } } int main(int ac, char **av) { (void)ac; /* Unused argument */ (void)av; /* Unused argument */ check_1(1, buf1, sizeof(buf1), sizeof(buf1)); check_1(0, buf1, sizeof(buf1) - 1, sizeof(buf1) - 1); check_2(1, buf2, sizeof(buf2), sizeof(buf2)); check_2(0, buf2, sizeof(buf2) - 1, sizeof(buf2) - 1); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/Makefile.in0000644000000000000000000003074512121076150016450 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = asn1c/tests DIST_COMMON = README $(dist_check_SCRIPTS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = @ADD_CFLAGS@ dist_check_SCRIPTS = check-assembly.sh TESTS_ENVIRONMENT = CC="${CC}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" ./check-assembly.sh TESTS = check-*.c EXTRA_DIST = \ check-*.c* \ data-62 \ data-70 \ data-119 \ data-126 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign asn1c/tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign asn1c/tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(dist_check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-libtool clean-local distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am clean-local: rm -rf test-* # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/asn1c/tests/check-70.c0000644000000000000000000001653112021463202016042 0ustar rootroot/* * Mode of operation: * Each of the *.in files is XER-decoded, then converted into DER, * then decoded from DER and encoded into XER again. The resulting * stream is checked against rules specified in ../data-70/README file. */ #undef NDEBUG #include #include #include #include /* for chdir(2) */ #include #include #include #include #include enum expectation { EXP_OK, /* Encoding/decoding must succeed */ EXP_CXER_EXACT, /* Encoding/decoding using CXER must be exact */ EXP_CXER_DIFF, /* Encoding/decoding using CXER must be different */ EXP_BROKEN, /* Decoding must fail */ EXP_DIFFERENT, /* Reconstruction will yield different encoding */ }; static unsigned char buf[4096]; static int buf_offset; static int _buf_writer(const void *buffer, size_t size, void *app_key) { unsigned char *b, *bend; (void)app_key; assert(buf_offset + size < sizeof(buf)); memcpy(buf + buf_offset, buffer, size); b = buf + buf_offset; bend = b + size; fprintf(stderr, "=> ["); for(; b < bend; b++) { if(*b >= 32 && *b < 127 && *b != '%') fprintf(stderr, "%c", *b); else fprintf(stderr, "%%%02x", *b); } fprintf(stderr, "]:%ld\n", (long)size); buf_offset += size; return 0; } enum der_or_xer { AS_DER, AS_XER, AS_CXER, }; static void save_object_as(PDU_t *st, enum der_or_xer how) { asn_enc_rval_t rval; /* Return value */ buf_offset = 0; /* * Save object using specified method. */ switch(how) { case AS_DER: rval = der_encode(&asn_DEF_PDU, st, _buf_writer, 0); break; case AS_XER: rval = xer_encode(&asn_DEF_PDU, st, XER_F_BASIC, _buf_writer, 0); break; case AS_CXER: rval = xer_encode(&asn_DEF_PDU, st, XER_F_CANONICAL, _buf_writer, 0); break; } if (rval.encoded == -1) { fprintf(stderr, "Cannot encode %s: %s\n", rval.failed_type->name, strerror(errno)); assert(rval.encoded != -1); return; } fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset); } static PDU_t * load_object_from(enum expectation expectation, char *fbuf, int size, enum der_or_xer how) { asn_dec_rval_t rval; asn_dec_rval_t (*zer_decode)(struct asn_codec_ctx_s *, asn_TYPE_descriptor_t *, void **, const void *, size_t); PDU_t *st = 0; int csize = 1; if(how == AS_DER) zer_decode = ber_decode; else zer_decode = xer_decode; if(getenv("INITIAL_CHUNK_SIZE")) csize = atoi(getenv("INITIAL_CHUNK_SIZE")); /* Perform multiple iterations with multiple chunks sizes */ for(; csize < 20; csize += 1) { int fbuf_offset = 0; int fbuf_left = size; int fbuf_chunk = csize; fprintf(stderr, "LOADING OBJECT OF SIZE %d, chunks %d\n", size, csize); if(st) asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); st = 0; do { fprintf(stderr, "Decoding bytes %d..%d (left %d)\n", fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left, fbuf_left); if(st) { fprintf(stderr, "=== currently ===\n"); asn_fprint(stderr, &asn_DEF_PDU, st); fprintf(stderr, "=== end ===\n"); } rval = zer_decode(0, &asn_DEF_PDU, (void **)&st, fbuf + fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left); fbuf_offset += rval.consumed; fbuf_left -= rval.consumed; if(rval.code == RC_WMORE) fbuf_chunk += 1; /* Give little more */ else fbuf_chunk = csize; /* Back off */ } while(fbuf_left && rval.code == RC_WMORE); if(expectation != EXP_BROKEN) { assert(rval.code == RC_OK); if(how == AS_DER) { assert(fbuf_offset == size); } else { assert(fbuf_offset - size < 2 || (fbuf_offset + 1 /* "\n" */ == size && fbuf[size - 1] == '\n') || (fbuf_offset + 2 /* "\r\n" */ == size && fbuf[size - 2] == '\r' && fbuf[size - 1] == '\n') ); } } else { assert(rval.code != RC_OK); fprintf(stderr, "Failed, but this was expected\n"); asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); st = 0; /* ignore leak for now */ } } if(st) asn_fprint(stderr, &asn_DEF_PDU, st); return st; } static int xer_encoding_equal(char *obuf, size_t osize, char *nbuf, size_t nsize) { char *oend = obuf + osize; char *nend = nbuf + nsize; if((osize && !nsize) || (!osize && nsize)) return 0; /* not equal apriori */ while(1) { while(obuf < oend && isspace(*obuf)) obuf++; while(nbuf < nend && isspace(*nbuf)) nbuf++; if(obuf == oend || nbuf == nend) { if(obuf == oend && nbuf == nend) break; fprintf(stderr, "%s data in reconstructed encoding\n", (obuf == oend) ? "More" : "Less"); return 0; } if(*obuf != *nbuf) { printf("%c%c != %c%c\n", obuf[0], obuf[1], nbuf[0], nbuf[1]); return 0; } obuf++, nbuf++; } return 1; } static void process_XER_data(enum expectation expectation, char *fbuf, int size) { PDU_t *st; int ret; st = load_object_from(expectation, fbuf, size, AS_XER); if(!st) return; /* Save and re-load as DER */ save_object_as(st, AS_DER); st = load_object_from(expectation, buf, buf_offset, AS_DER); assert(st); save_object_as(st, (expectation == EXP_CXER_EXACT || expectation == EXP_CXER_DIFF) ? AS_CXER : AS_XER); fprintf(stderr, "=== original ===\n"); fwrite(fbuf, 1, size, stderr); fprintf(stderr, "=== re-encoded ===\n"); fwrite(buf, 1, buf_offset, stderr); fprintf(stderr, "=== end ===\n"); switch(expectation) { case EXP_DIFFERENT: assert(!xer_encoding_equal(fbuf, size, buf, buf_offset)); break; case EXP_BROKEN: assert(!xer_encoding_equal(fbuf, size, buf, buf_offset)); break; case EXP_CXER_EXACT: buf[buf_offset++] = '\n'; assert(size == buf_offset); assert(memcmp(fbuf, buf, size) == 0); break; case EXP_CXER_DIFF: buf[buf_offset++] = '\n'; assert(size != buf_offset || memcmp(fbuf, buf, size)); break; case EXP_OK: assert(xer_encoding_equal(fbuf, size, buf, buf_offset)); break; } asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); } /* * Decode the .der files and try to regenerate them. */ static int process(const char *fname) { char fbuf[4096]; char *ext = strrchr(fname, '.'); enum expectation expectation; int ret; int rd; FILE *fp; if(ext == 0 || strcmp(ext, ".in")) return 0; switch(ext[-1]) { case 'B': /* The file is intentionally broken */ expectation = EXP_BROKEN; break; case 'D': /* Reconstructing should yield different data */ expectation = EXP_DIFFERENT; break; case 'E': /* Byte to byte exact reconstruction */ expectation = EXP_CXER_EXACT; break; case 'X': /* Should fail byte-to-byte comparison */ expectation = EXP_CXER_DIFF; break; default: expectation = EXP_OK; break; } fprintf(stderr, "\nProcessing file [../%s]\n", fname); ret = chdir("../data-70"); assert(ret == 0); fp = fopen(fname, "r"); ret = chdir("../test-check-70"); assert(ret == 0); assert(fp); rd = fread(fbuf, 1, sizeof(fbuf), fp); fclose(fp); assert(rd < sizeof(fbuf)); /* expect small files */ process_XER_data(expectation, fbuf, rd); return 1; } int main() { DIR *dir; struct dirent *dent; int processed_files = 0; char *str; /* Process a specific test file */ str = getenv("DATA_70_FILE"); if(str && strncmp(str, "data-70-", 8) == 0) { process(str); return 0; } dir = opendir("../data-70"); assert(dir); /* * Process each file in that directory. */ while((dent = readdir(dir))) { if(strncmp(dent->d_name, "data-70-", 8) == 0) if(process(dent->d_name)) processed_files++; } assert(processed_files); closedir(dir); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-32.c0000644000000000000000000000347311472004340016044 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include #include #include int main(int ac, char **av) { Programming_t p; SeqWithMandatory_t swm; SeqWithOptional_t *swo = 0; Error_t *err; asn_enc_rval_t erv; asn_dec_rval_t drv; char buf[128]; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ /* * No plans to fill Programming_t up: * just checking whether it compiles or not. */ memset(&p, 0, sizeof(p)); /* * Construct a dummy sequence: * SeqWithMandatory ::= { * seqOfMan [0] EXPLICIT SEQUENCE OF Error * } */ err = calloc(1, sizeof *err); memset(&swm, 0, sizeof swm); OCTET_STRING_fromBuf(&swm.someString, "Oley", 4); ASN_SEQUENCE_ADD(&swm.seqOfMan, err); /* * Encode the sequence. */ erv = der_encode_to_buffer(&asn_DEF_SeqWithMandatory, &swm, buf, sizeof buf); assert(erv.encoded > 0); buf[erv.encoded] = '\0'; /* * Try to decode it using a compatible type. */ drv = ber_decode(0, &asn_DEF_SeqWithOptional, (void **)&swo, buf, erv.encoded); assert(drv.code == RC_OK); assert(drv.consumed == erv.encoded); assert(swo->seqOfOpt != 0); xer_fprint(stderr, &asn_DEF_SeqWithOptional, swo); swo->seqOfOpt = 0; erv = der_encode_to_buffer(&asn_DEF_SeqWithOptional, swo, buf, sizeof buf); assert(erv.encoded > 0); buf[erv.encoded] = '\0'; swo = 0; drv = ber_decode(0, &asn_DEF_SeqWithMandatory, (void **)&swo, buf, erv.encoded); assert(drv.code != RC_OK); swo = 0; drv = ber_decode(0, &asn_DEF_SeqWithOptional, (void **)&swo, buf, erv.encoded); assert(drv.code == RC_OK); assert(drv.consumed == erv.encoded); assert(swo->seqOfOpt == 0); xer_fprint(stderr, &asn_DEF_SeqWithOptional, swo); printf("Finished\n"); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-73.c0000644000000000000000000000070611472004340016045 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include int main(int ac, char **av) { Type_t t; Epyt_t ept; Ypet_t ypt; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ memset(&t, 0, sizeof(t)); memset(&ept, 0, sizeof(ept)); memset(&ypt, 0, sizeof(ypt)); /* * No plans to fill it up: just checking whether it compiles or not. */ return 0; } asn1c-0.9.24+dfsg/asn1c/tests/Makefile.am0000644000000000000000000000044112015121740016423 0ustar rootroot AM_CFLAGS = @ADD_CFLAGS@ dist_check_SCRIPTS = check-assembly.sh TESTS_ENVIRONMENT= CC="${CC}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" ./check-assembly.sh TESTS = check-*.c EXTRA_DIST = \ check-*.c* \ data-62 \ data-70 \ data-119 \ data-126 clean-local: rm -rf test-* asn1c-0.9.24+dfsg/asn1c/tests/check-70.-fnative-types.c0000644000000000000000000001505711472004340020721 0ustar rootroot/* * Mode of operation: * Each of the *.in files is XER-decoded, then converted into DER, * then decoded from DER and encoded into XER again. The resulting * stream is compared with the corresponding .out file. */ #undef NDEBUG #include #include #include #include /* for chdir(2) */ #include #include #include /* for isspace(3) */ #include #include #include enum expectation { EXP_OK, /* Encoding/decoding must succeed */ EXP_BROKEN, /* Decoding must fail */ EXP_DIFFERENT, /* Reconstruction will yield different encoding */ }; static unsigned char buf[4096]; static int buf_offset; static int _buf_writer(const void *buffer, size_t size, void *app_key) { unsigned char *b, *bend; (void)app_key; assert(buf_offset + size < sizeof(buf)); memcpy(buf + buf_offset, buffer, size); b = buf + buf_offset; bend = b + size; fprintf(stderr, "=> ["); for(; b < bend; b++) fprintf(stderr, "%c", *b); fprintf(stderr, "]:%ld\n", (long)size); buf_offset += size; return 0; } enum der_or_xer { AS_DER, AS_XER, }; static void save_object_as(PDU_t *st, enum der_or_xer how) { asn_enc_rval_t rval; /* Return value */ buf_offset = 0; /* * Save object using specified method. */ switch(how) { case AS_DER: rval = der_encode(&asn_DEF_PDU, st, _buf_writer, 0); break; case AS_XER: rval = xer_encode(&asn_DEF_PDU, st, XER_F_BASIC, _buf_writer, 0); break; } if (rval.encoded == -1) { fprintf(stderr, "Cannot encode %s: %s\n", rval.failed_type->name, strerror(errno)); assert(rval.encoded != -1); return; } fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset); } static PDU_t * load_object_from(enum expectation expectation, char *fbuf, int size, enum der_or_xer how) { asn_dec_rval_t rval; asn_dec_rval_t (*zer_decode)(struct asn_codec_ctx_s *, asn_TYPE_descriptor_t *, void **, const void *, size_t); PDU_t *st = 0; int csize = 1; if(how == AS_DER) zer_decode = ber_decode; else zer_decode = xer_decode; if(getenv("INITIAL_CHUNK_SIZE")) csize = atoi(getenv("INITIAL_CHUNK_SIZE")); /* Perform multiple iterations with multiple chunks sizes */ for(; csize < 20; csize += 1) { int fbuf_offset = 0; int fbuf_left = size; int fbuf_chunk = csize; fprintf(stderr, "LOADING OBJECT OF SIZE %d, chunks %d\n", size, csize); if(st) asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); st = 0; do { fprintf(stderr, "Decoding bytes %d..%d (left %d)\n", fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left, fbuf_left); if(st) { fprintf(stderr, "=== currently ===\n"); asn_fprint(stderr, &asn_DEF_PDU, st); fprintf(stderr, "=== end ===\n"); } rval = zer_decode(0, &asn_DEF_PDU, (void **)&st, fbuf + fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left); fbuf_offset += rval.consumed; fbuf_left -= rval.consumed; if(rval.code == RC_WMORE) fbuf_chunk += 1; /* Give little more */ else fbuf_chunk = csize; /* Back off */ } while(fbuf_left && rval.code == RC_WMORE); if(expectation != EXP_BROKEN) { assert(rval.code == RC_OK); if(how == AS_DER) { assert(fbuf_offset == size); } else { assert(fbuf_offset - size < 2 || (fbuf_offset + 1 /* "\n" */ == size && fbuf[size - 1] == '\n') || (fbuf_offset + 2 /* "\r\n" */ == size && fbuf[size - 2] == '\r' && fbuf[size - 1] == '\n') ); } } else { assert(rval.code != RC_OK); fprintf(stderr, "Failed, but this was expected\n"); asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); st = 0; /* ignore leak for now */ } } if(st) asn_fprint(stderr, &asn_DEF_PDU, st); return st; } static int xer_encoding_equal(char *obuf, size_t osize, char *nbuf, size_t nsize) { char *oend = obuf + osize; char *nend = nbuf + nsize; if((osize && !nsize) || (!osize && nsize)) return 0; /* not equal apriori */ while(1) { while(obuf < oend && isspace(*obuf)) obuf++; while(nbuf < nend && isspace(*nbuf)) nbuf++; if(obuf == oend || nbuf == nend) { if(obuf == oend && nbuf == nend) break; fprintf(stderr, "%s data in reconstructed encoding\n", (obuf == oend) ? "More" : "Less"); return 0; } if(*obuf != *nbuf) { printf("%c%c != %c%c\n", obuf[0], obuf[1], nbuf[0], nbuf[1]); return 0; } obuf++, nbuf++; } return 1; } static void process_XER_data(enum expectation expectation, char *fbuf, int size) { PDU_t *st; st = load_object_from(expectation, fbuf, size, AS_XER); if(!st) return; /* Save and re-load as DER */ save_object_as(st, AS_DER); st = load_object_from(expectation, buf, buf_offset, AS_DER); assert(st); save_object_as(st, AS_XER); fprintf(stderr, "=== original ===\n"); fwrite(fbuf, 1, size, stderr); fprintf(stderr, "=== re-encoded ===\n"); fwrite(buf, 1, buf_offset, stderr); fprintf(stderr, "=== end ===\n"); switch(expectation) { case EXP_DIFFERENT: assert(!xer_encoding_equal(fbuf, size, buf, buf_offset)); break; case EXP_BROKEN: assert(!xer_encoding_equal(fbuf, size, buf, buf_offset)); break; case EXP_OK: assert(xer_encoding_equal(fbuf, size, buf, buf_offset)); break; } asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); } /* * Decode the .der files and try to regenerate them. */ static int process(const char *fname) { char fbuf[4096]; char *ext = strrchr(fname, '.'); enum expectation expectation; int ret; int rd; FILE *fp; if(ext == 0 || strcmp(ext, ".in")) return 0; switch(ext[-1]) { case 'B': /* The file is intentionally broken */ expectation = EXP_BROKEN; break; case 'X': case 'D': /* Reconstructing should yield different data */ expectation = EXP_DIFFERENT; break; case 'E': default: expectation = EXP_OK; break; } fprintf(stderr, "\nProcessing file [../%s]\n", fname); ret = chdir("../data-70"); assert(ret == 0); fp = fopen(fname, "r"); ret = chdir("../test-check-70.-fnative-types"); assert(ret == 0); assert(fp); rd = fread(fbuf, 1, sizeof(fbuf), fp); fclose(fp); assert(rd < sizeof(fbuf)); /* expect small files */ process_XER_data(expectation, fbuf, rd); return 1; } int main() { DIR *dir; struct dirent *dent; int processed_files = 0; char *str; /* Process a specific test file */ str = getenv("DATA_70_FILE"); if(str && strncmp(str, "data-70-", 8) == 0) process(str); dir = opendir("../data-70"); assert(dir); /* * Process each file in that directory. */ while((dent = readdir(dir))) { if(strncmp(dent->d_name, "data-70-", 8) == 0) if(process(dent->d_name)) processed_files++; } assert(processed_files); closedir(dir); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-119.-gen-PER.c0000644000000000000000000002062711472004340017403 0ustar rootroot/* * Mode of operation: * Each of the *.in files is XER-decoded, then converted into PER, * then decoded back from PER, then encoded into XER again, * and finally compared to the original encoding. */ #undef NDEBUG #include #include #include #include /* for chdir(2) */ #include #include #include #include #include #include enum expectation { EXP_OK, /* Encoding/decoding must succeed */ EXP_CXER_EXACT, /* Encoding/decoding using CXER must be exact */ EXP_CXER_DIFF, /* Encoding/decoding using CXER must be different */ EXP_BROKEN, /* Decoding must fail */ EXP_DIFFERENT, /* Reconstruction will yield different encoding */ EXP_PER_NOCOMP, /* Not PER compatible */ }; static unsigned char buf[4096]; static int buf_offset; static int _buf_writer(const void *buffer, size_t size, void *app_key) { unsigned char *b, *bend; (void)app_key; assert(buf_offset + size < sizeof(buf)); memcpy(buf + buf_offset, buffer, size); b = buf + buf_offset; bend = b + size; fprintf(stderr, "=> ["); for(; b < bend; b++) { if(*b >= 32 && *b < 127 && *b != '%') fprintf(stderr, "%c", *b); else fprintf(stderr, "%%%02x", *b); } fprintf(stderr, "]:%ld\n", (long)size); buf_offset += size; return 0; } enum enctype { AS_PER, AS_DER, AS_XER, AS_CXER, }; static void save_object_as(PDU_t *st, enum expectation exp, enum enctype how) { asn_enc_rval_t rval; /* Return value */ buf_offset = 0; /* * Save object using specified method. */ switch(how) { case AS_PER: rval = uper_encode(&asn_DEF_PDU, st, _buf_writer, 0); if(exp == EXP_PER_NOCOMP) assert(rval.encoded == -1); else assert(rval.encoded > 0); fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset); return; case AS_DER: rval = der_encode(&asn_DEF_PDU, st, _buf_writer, 0); break; case AS_XER: rval = xer_encode(&asn_DEF_PDU, st, XER_F_BASIC, _buf_writer, 0); break; case AS_CXER: rval = xer_encode(&asn_DEF_PDU, st, XER_F_CANONICAL, _buf_writer, 0); break; } if (rval.encoded == -1) { fprintf(stderr, "Cannot encode %s: %s\n", rval.failed_type->name, strerror(errno)); assert(rval.encoded != -1); return; } fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset); } static PDU_t * load_object_from(const char *fname, enum expectation expectation, char *fbuf, int size, enum enctype how) { asn_dec_rval_t rval; PDU_t *st = 0; int csize = 1; if(getenv("INITIAL_CHUNK_SIZE")) csize = atoi(getenv("INITIAL_CHUNK_SIZE")); /* Perform multiple iterations with multiple chunks sizes */ for(; csize < 20; csize += 1) { int fbuf_offset = 0; int fbuf_left = size; int fbuf_chunk = csize; fprintf(stderr, "LOADING OBJECT OF SIZE %d FROM [%s] as %s," " chunks %d\n", size, fname, how==AS_PER?"PER":"XER", csize); if(st) asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); st = 0; do { fprintf(stderr, "Decoding bytes %d..%d (left %d)\n", fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left, fbuf_left); if(st) { fprintf(stderr, "=== currently ===\n"); asn_fprint(stderr, &asn_DEF_PDU, st); fprintf(stderr, "=== end ===\n"); } switch(how) { case AS_XER: rval = xer_decode(0, &asn_DEF_PDU, (void **)&st, fbuf + fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left); break; case AS_PER: rval = uper_decode(0, &asn_DEF_PDU, (void **)&st, fbuf + fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left, 0, 0); if(rval.code == RC_WMORE) { rval.consumed = 0; /* Not restartable */ ASN_STRUCT_FREE(asn_DEF_PDU, st); st = 0; fprintf(stderr, "-> PER wants more\n"); } else { fprintf(stderr, "-> PER ret %d/%d\n", rval.code, rval.consumed); /* uper_decode() returns _bits_ */ rval.consumed += 7; rval.consumed /= 8; } break; } fbuf_offset += rval.consumed; fbuf_left -= rval.consumed; if(rval.code == RC_WMORE) fbuf_chunk += 1; /* Give little more */ else fbuf_chunk = csize; /* Back off */ } while(fbuf_left && rval.code == RC_WMORE); if(expectation != EXP_BROKEN) { assert(rval.code == RC_OK); if(how == AS_PER) { fprintf(stderr, "[left %d, off %d, size %d]\n", fbuf_left, fbuf_offset, size); assert(fbuf_offset == size); } else { assert(fbuf_offset - size < 2 || (fbuf_offset + 1 /* "\n" */ == size && fbuf[size - 1] == '\n') || (fbuf_offset + 2 /* "\r\n" */ == size && fbuf[size - 2] == '\r' && fbuf[size - 1] == '\n') ); } } else { assert(rval.code != RC_OK); fprintf(stderr, "Failed, but this was expected\n"); asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); st = 0; /* ignore leak for now */ } } if(st) asn_fprint(stderr, &asn_DEF_PDU, st); return st; } static int xer_encoding_equal(char *obuf, size_t osize, char *nbuf, size_t nsize) { char *oend = obuf + osize; char *nend = nbuf + nsize; if((osize && !nsize) || (!osize && nsize)) return 0; /* not equal apriori */ while(1) { while(obuf < oend && isspace(*obuf)) obuf++; while(nbuf < nend && isspace(*nbuf)) nbuf++; if(obuf == oend || nbuf == nend) { if(obuf == oend && nbuf == nend) break; fprintf(stderr, "%s data in reconstructed encoding\n", (obuf == oend) ? "More" : "Less"); return 0; } if(*obuf != *nbuf) { printf("%c%c != %c%c\n", obuf[0], obuf[1], nbuf[0], nbuf[1]); return 0; } obuf++, nbuf++; } return 1; } static void process_XER_data(const char *fname, enum expectation expectation, char *fbuf, int size) { PDU_t *st; int ret; st = load_object_from(fname, expectation, fbuf, size, AS_XER); if(!st) return; /* Save and re-load as PER */ save_object_as(st, expectation, AS_PER); if(expectation == EXP_PER_NOCOMP) return; /* Already checked */ st = load_object_from("buffer", expectation, buf, buf_offset, AS_PER); assert(st); save_object_as(st, expectation, (expectation == EXP_CXER_EXACT || expectation == EXP_CXER_DIFF) ? AS_CXER : AS_XER); fprintf(stderr, "=== original ===\n"); fwrite(fbuf, 1, size, stderr); fprintf(stderr, "=== re-encoded ===\n"); fwrite(buf, 1, buf_offset, stderr); fprintf(stderr, "=== end ===\n"); switch(expectation) { case EXP_DIFFERENT: assert(!xer_encoding_equal(fbuf, size, buf, buf_offset)); break; case EXP_BROKEN: assert(!xer_encoding_equal(fbuf, size, buf, buf_offset)); break; case EXP_CXER_EXACT: buf[buf_offset++] = '\n'; assert(size == buf_offset); assert(memcmp(fbuf, buf, size) == 0); break; case EXP_CXER_DIFF: buf[buf_offset++] = '\n'; assert(size != buf_offset || memcmp(fbuf, buf, size)); break; case EXP_OK: case EXP_PER_NOCOMP: assert(xer_encoding_equal(fbuf, size, buf, buf_offset)); break; } asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0); } /* * Decode the .der files and try to regenerate them. */ static int process(const char *fname) { char fbuf[4096]; char *ext = strrchr(fname, '.'); enum expectation expectation; int ret; int rd; FILE *fp; if(ext == 0 || strcmp(ext, ".in")) return 0; switch(ext[-1]) { case 'B': /* The file is intentionally broken */ expectation = EXP_BROKEN; break; case 'D': /* Reconstructing should yield different data */ expectation = EXP_DIFFERENT; break; case 'E': /* Byte to byte exact reconstruction */ expectation = EXP_CXER_EXACT; break; case 'X': /* Should fail byte-to-byte comparison */ expectation = EXP_CXER_DIFF; break; case 'P': /* Incompatible with PER */ expectation = EXP_PER_NOCOMP; break; default: expectation = EXP_OK; break; } fprintf(stderr, "\nProcessing file [../%s]\n", fname); snprintf(fbuf, sizeof(fbuf), "../data-119/%s", fname); fp = fopen(fbuf, "r"); assert(fp); rd = fread(fbuf, 1, sizeof(fbuf), fp); fclose(fp); assert(rd < sizeof(fbuf)); /* expect small files */ process_XER_data(fname, expectation, fbuf, rd); fprintf(stderr, "Finished [%s]\n", fname); return 1; } int main() { DIR *dir; struct dirent *dent; int processed_files = 0; char *str; /* Process a specific test file */ str = getenv("DATA_119_FILE"); if(str && strncmp(str, "data-119-", 9) == 0) { process(str); return 0; } dir = opendir("../data-119"); assert(dir); /* * Process each file in that directory. */ while((dent = readdir(dir))) { if(strncmp(dent->d_name, "data-119-", 9) == 0) if(process(dent->d_name)) processed_files++; } assert(processed_files); closedir(dir); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-41.c0000644000000000000000000002254211472004340016042 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include uint8_t buf0[] = { 32 | ((2 << 6) + 1), /* [1], constructed */ 18, /* string [0] IMPLICIT UTF8String, */ (2 << 6), /* [0] */ 16, /* L */ 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', }; uint8_t buf0_reconstr[] = { 32 | ((2 << 6) + 1), /* [1], constructed */ 18, /* string [0] IMPLICIT UTF8String, */ (2 << 6), /* [0] */ 16, /* L */ 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', }; uint8_t buf1[] = { 32 | (2 << 6), /* [0], constructed */ 0x80 | 1, /* L */ 134, /* string [0] IMPLICIT UTF8String, */ (2 << 6), /* [0] */ 0x80 | 1, /* L */ 128, 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', /* alpha [1] IMPLICIT INTEGER OPTIONAL */ (2 << 6) + 1, /* [1] */ 1, /* L */ 75, }; uint8_t buf1_reconstr[] = { 32 | (2 << 6), /* [0], constructed */ 0x80 | 1, /* L */ 134, /* string [0] IMPLICIT UTF8String, */ (2 << 6), /* [0] */ 0x80 | 1, /* L */ 128, 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', /* alpha [1] IMPLICIT INTEGER OPTIONAL */ (2 << 6) + 1, /* [1] */ 1, /* L */ 75, }; uint8_t buf2[] = { 32 | ((2 << 6) + 1), /* [1], constructed */ 0x80 | 1, /* L */ 134, /* string [0] IMPLICIT UTF8String, */ (2 << 6), /* [0] */ 0x80 | 1, /* L */ 128, 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', /* beta [2] IMPLICIT INTEGER OPTIONAL */ (2 << 6) + 2, /* [2] */ 1, /* L */ 75, }; uint8_t buf2_reconstr[] = { 32 | ((2 << 6) + 1), /* [1], constructed */ 0x80 | 1, /* L */ 134, /* string [0] IMPLICIT UTF8String, */ (2 << 6), /* [0] */ 0x80 | 1, /* L */ 128, 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', /* beta [2] IMPLICIT INTEGER OPTIONAL */ (2 << 6) + 2, /* [2] */ 1, /* L */ 75, }; static void check(T_t *tp, uint8_t *buf, int size, size_t consumed) { asn_dec_rval_t rval; int ret; tp = memset(tp, 0, sizeof(*tp)); fprintf(stderr, "Buf %p (%d)\n", (int)buf, (int)size); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); assert(rval.code == RC_OK); assert(rval.consumed == consumed); fprintf(stderr, "=== asn_fprint() ===\n"); ret = asn_fprint(stderr, &asn_DEF_T, tp); assert(ret == 0); fprintf(stderr, "=== xer_fprint() ===\n"); ret = xer_fprint(stderr, &asn_DEF_T, tp); fprintf(stderr, "=== END ===\n"); assert(ret == 0); /* assert(tp->string.size == 128); assert(strncmp(tp->string.buf, "zz") == 0); assert(strcmp(tp->b.choice.b1.buf, "z") == 0 && strcmp(tp->b.choice.b2.buf, "z") == 0); */ } size_t buf_pos; size_t buf_size; uint8_t *buffer; static int buf_fill(const void *bufp, size_t size, void *app_key) { (void)app_key; /* Unused argument */ if(buf_pos + size > buf_size) { fprintf(stderr, "%d + %d > %d\n", (int)buf_pos, (int)size, (int)buf_size); return -1; } memcpy(buffer + buf_pos, bufp, size); buf_pos += size; fprintf(stderr, " written %d (%d)\n", (int)size, (int)buf_pos); return 0; } static void compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) { asn_enc_rval_t erval; int i; buf_size = cmp_buf_size + 100; buffer = alloca(buf_size); buf_pos = 0; /* * Try to re-create using DER encoding. */ erval = der_encode(&asn_DEF_T, tp, buf_fill, 0); assert(erval.encoded != -1); if(erval.encoded != cmp_buf_size) { printf("%d != %d\n", (int)erval.encoded, (int)cmp_buf_size); } assert(erval.encoded == cmp_buf_size); for(i = 0; i < cmp_buf_size; i++) { if(buffer[i] != cmp_buf[i]) { fprintf(stderr, "Recreated buffer content mismatch:\n"); fprintf(stderr, "Byte %d, %x != %x (%d != %d)\n", i, buffer[i], cmp_buf[i], buffer[i], cmp_buf[i] ); } assert(buffer[i] == cmp_buf[i]); } } static void partial_read(uint8_t *buf, size_t size) { T_t t, *tp; asn_dec_rval_t rval; size_t i1, i2; uint8_t *buf1 = alloca(size); uint8_t *buf2 = alloca(size); uint8_t *buf3 = alloca(size); fprintf(stderr, "\nPartial read sequence...\n"); /* * Divide the space (size) into three blocks in various combinations: * |<----->i1<----->i2<----->| * ^ buf ^ buf+size * Try to read block by block. */ for(i1 = 0; i1 < size; i1++) { for(i2 = i1; i2 < size; i2++) { uint8_t *chunk1 = buf; size_t size1 = i1; uint8_t *chunk2 = buf + size1; size_t size2 = i2 - i1; uint8_t *chunk3 = buf + size1 + size2; size_t size3 = size - size1 - size2; fprintf(stderr, "\n%d:{%d, %d, %d}...\n", (int)size, (int)size1, (int)size2, (int)size3); memset(buf1, 0, size); memset(buf2, 0, size); memset(buf3, 0, size); memcpy(buf1, chunk1, size1); memcpy(buf2, chunk2, size2); memcpy(buf3, chunk3, size3); tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "=> Chunk 1 (%d):\n", (int)size1); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf1, size1); assert(rval.code == RC_WMORE); assert(rval.consumed <= size1); if(rval.consumed < size1) { int leftover = size1 - rval.consumed; memcpy(buf2, buf1 + rval.consumed, leftover); memcpy(buf2 + leftover, chunk2, size2); size2 += leftover; } fprintf(stderr, "=> Chunk 2 (%d):\n", (int)size2); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf2, size2); assert(rval.code == RC_WMORE); assert(rval.consumed <= size2); if(rval.consumed < size2) { int leftover = size2 - rval.consumed; memcpy(buf3, buf2 + rval.consumed, leftover); memcpy(buf3 + leftover, chunk3, size3); size3 += leftover; } fprintf(stderr, "=> Chunk 3 (%d):\n", (int)size3); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf3, size3); assert(rval.code == RC_OK); assert(rval.consumed == size3); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); } } } int main() { T_t t; /* Check exact buf0 */ check(&t, buf0, sizeof(buf0), sizeof(buf0)); compare(&t, buf0_reconstr, sizeof(buf0_reconstr)); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); /* Check exact buf1 */ check(&t, buf1, sizeof(buf1), sizeof(buf1)); compare(&t, buf1_reconstr, sizeof(buf1_reconstr)); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); /* Check slightly more than buf1 */ check(&t, buf1, sizeof(buf1) + 10, sizeof(buf1)); compare(&t, buf1_reconstr, sizeof(buf1_reconstr)); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); /* Check exact buf2 */ check(&t, buf2, sizeof(buf2), sizeof(buf2)); compare(&t, buf2_reconstr, sizeof(buf2_reconstr)); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); /* Check slightly more than buf2 */ check(&t, buf2, sizeof(buf2) + 10, sizeof(buf2)); compare(&t, buf2_reconstr, sizeof(buf2_reconstr)); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); /* Split the buffer in parts and check decoder restartability */ partial_read(buf0, sizeof(buf0)); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-92.-findirect-choice.c0000644000000000000000000000057211472004340021322 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include int main(int ac, char **av) { Everything_t t; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ memset(&t, 0, sizeof(t)); /* * No plans to fill it up: just checking whether it compiles or not. */ return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-41.-fnative-types.c0000644000000000000000000001226411472004340020714 0ustar rootroot#undef NDEBUG #include #include #include #include #include #include uint8_t buf1[] = { 32 | (2 << 6), /* [0], constructed */ 25, /* L */ /* string [0] IMPLICIT UTF8String, */ (2 << 6), /* [0] */ 16, /* L */ 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', /* beta [2] IMPLICIT INTEGER OPTIONAL */ (2 << 6) + 2, /* [2] */ 5, /* L */ 0, 75, 0x4b, 75, 75, }; uint8_t buf1_reconstr[] = { 32 | (2 << 6), /* [0], constructed */ 24, /* L */ /* string [0] IMPLICIT UTF8String, */ (2 << 6), /* [0] */ 16, /* L */ 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', /* beta [2] IMPLICIT INTEGER OPTIONAL */ (2 << 6) + 2, /* [2] */ 4, /* L */ 75, 75, 75, 0x4b, }; static void check(T_t *tp, uint8_t *buf, int size, size_t consumed) { asn_dec_rval_t rval; tp = memset(tp, 0, sizeof(*tp)); fprintf(stderr, "Buf %p (%d)\n", buf, size); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size); fprintf(stderr, "Returned code %d, consumed %d\n", (int)rval.code, (int)rval.consumed); assert(rval.code == RC_OK); assert(rval.consumed == consumed); assert(tp->choice.seq.string.size == 16); assert(strcmp(tp->choice.seq.string.buf, "zzzzzzzzzzzzzzzz") == 0); assert(tp->choice.seq.alpha == NULL); assert(tp->choice.seq.beta); assert(*tp->choice.seq.beta == 0x4b4b4b4b); } size_t buf_pos; size_t buf_size; uint8_t *buf; static int buf_fill(const void *buffer, size_t size, void *app_key) { (void)app_key; /* Unused argument */ if(buf_pos + size > buf_size) { fprintf(stderr, "%d + %d > %d\n", (int)buf_pos, (int)size, (int)buf_size); return -1; } memcpy(buf + buf_pos, buffer, size); buf_pos += size; fprintf(stderr, " written %d (%d)\n", (int)size, (int)buf_pos); return 0; } static void compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) { asn_enc_rval_t erval; int i; buf_size = cmp_buf_size + 100; buf = alloca(buf_size); buf_pos = 0; /* * Try to re-create using DER encoding. */ erval = der_encode(&asn_DEF_T, tp, buf_fill, 0); assert(erval.encoded != -1); if(erval.encoded != cmp_buf_size) { printf("%d != %d\n", erval.encoded, cmp_buf_size); } assert(erval.encoded == cmp_buf_size); for(i = 0; i < cmp_buf_size; i++) { if(buf[i] != cmp_buf[i]) { fprintf(stderr, "Recreated buffer content mismatch:\n"); fprintf(stderr, "Byte %d, %x != %x (%d != %d)\n", i, buf[i], cmp_buf[i], buf[i], cmp_buf[i] ); } assert(buf[i] == cmp_buf[i]); } } static void partial_read(uint8_t *buf_0, size_t size) { T_t t, *tp; asn_dec_rval_t rval; size_t i1, i2; uint8_t *buf_1 = alloca(size); uint8_t *buf_2 = alloca(size); uint8_t *buf_3 = alloca(size); fprintf(stderr, "\nPartial read sequence...\n"); /* * Divide the space (size) into three blocks in various combinations: * |<----->i1<----->i2<----->| * ^ buf_0 ^ buf_0+size * Try to read block by block. */ for(i1 = 0; i1 < size; i1++) { for(i2 = i1; i2 < size; i2++) { uint8_t *chunk1 = buf_0; size_t size1 = i1; uint8_t *chunk2 = buf_0 + size1; size_t size2 = i2 - i1; uint8_t *chunk3 = buf_0 + size1 + size2; size_t size3 = size - size1 - size2; fprintf(stderr, "\n%d:{%d, %d, %d}...\n", (int)size, (int)size1, (int)size2, (int)size3); memset(buf_1, 0, size); memset(buf_2, 0, size); memset(buf_3, 0, size); memcpy(buf_1, chunk1, size1); memcpy(buf_2, chunk2, size2); memcpy(buf_3, chunk3, size3); tp = memset(&t, 0, sizeof(t)); fprintf(stderr, "=> Chunk 1 (%d):\n", (int)size1); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf_1, size1); assert(rval.code == RC_WMORE); assert(rval.consumed <= size1); if(rval.consumed < size1) { int leftover = size1 - rval.consumed; memcpy(buf_2, buf_1 + rval.consumed, leftover); memcpy(buf_2 + leftover, chunk2, size2); size2 += leftover; } fprintf(stderr, "=> Chunk 2 (%d):\n", (int)size2); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf_2, size2); assert(rval.code == RC_WMORE); assert(rval.consumed <= size2); if(rval.consumed < size2) { int leftover = size2 - rval.consumed; memcpy(buf_3, buf_2 + rval.consumed, leftover); memcpy(buf_3 + leftover, chunk3, size3); size3 += leftover; } fprintf(stderr, "=> Chunk 3 (%d):\n", (int)size3); rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf_3, size3); assert(rval.code == RC_OK); assert(rval.consumed == size3); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); } } } int main(int ac, char **av) { T_t t; (void)ac; /* Unused argument */ (void)av; /* Unused argument */ /* Check exact buf1 */ check(&t, buf1, sizeof(buf1), sizeof(buf1)); compare(&t, buf1_reconstr, sizeof(buf1_reconstr)); asn_fprint(stderr, &asn_DEF_T, &t); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); /* Check slightly more than buf1 */ check(&t, buf1, sizeof(buf1) + 10, sizeof(buf1)); compare(&t, buf1_reconstr, sizeof(buf1_reconstr)); asn_fprint(stderr, &asn_DEF_T, &t); asn_DEF_T.free_struct(&asn_DEF_T, &t, 1); /* Split the buffer in parts and check decoder restartability */ partial_read(buf1, sizeof(buf1)); return 0; } asn1c-0.9.24+dfsg/asn1c/tests/check-62.c0000644000000000000000000001075711472004340016052 0ustar rootroot#undef NDEBUG #include #include #include #include /* for chdir(2) */ #include #include #include #include #include enum expectation { EXP_OK, /* Encoding/decoding must succeed */ EXP_BROKEN, /* Decoding must fail */ EXP_RECLESS, /* Reconstruction is allowed to yield less data */ EXP_DIFFERENT, /* Reconstruction will yield different encoding */ }; static unsigned char buf[4096]; static int buf_offset; static int _buf_writer(const void *buffer, size_t size, void *app_key) { unsigned char *b, *bend; (void)app_key; assert(buf_offset + size < sizeof(buf)); memcpy(buf + buf_offset, buffer, size); b = buf + buf_offset; bend = b + size; printf("=> ["); for(; b < bend; b++) printf(" %02X", *b); printf("]:%ld\n", (long)size); buf_offset += size; return 0; } static int save_object(T_t *st) { asn_enc_rval_t rval; /* Return value */ buf_offset = 0; rval = der_encode(&asn_DEF_T, st, _buf_writer, 0); if (rval.encoded == -1) { fprintf(stderr, "Cannot encode %s: %s\n", rval.failed_type->name, strerror(errno)); assert(rval.encoded != -1); return -1; /* JIC */ } fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset); return 0; } static T_t * load_object(enum expectation expectation, char *fbuf, int size) { asn_dec_rval_t rval; T_t *st = 0; int csize; fprintf(stderr, "LOADING OBJECT OF SIZE %d\n", size); /* Perform multiple iterations with multiple chunks sizes */ for(csize = 1; csize < 20; csize += 1) { int fbuf_offset = 0; int fbuf_left = size; int fbuf_chunk = csize; if(st) asn_DEF_T.free_struct(&asn_DEF_T, st, 0); st = 0; do { fprintf(stderr, "Decoding from %d with %d (left %d)\n", fbuf_offset, fbuf_chunk, fbuf_left); rval = ber_decode(0, &asn_DEF_T, (void **)&st, fbuf + fbuf_offset, fbuf_chunk < fbuf_left ? fbuf_chunk : fbuf_left); fbuf_offset += rval.consumed; fbuf_left -= rval.consumed; if(rval.code == RC_WMORE) fbuf_chunk += 1; /* Give little more */ else fbuf_chunk = csize; /* Back off */ } while(fbuf_left && rval.code == RC_WMORE); if(expectation != EXP_BROKEN) { assert(rval.code == RC_OK); assert(fbuf_offset == size); } else { assert(rval.code != RC_OK); fprintf(stderr, "Failed, but this was expected\n"); asn_DEF_T.free_struct(&asn_DEF_T, st, 0); st = 0; /* ignore leak for now */ } } if(st) asn_fprint(stderr, &asn_DEF_T, st); return st; } static void process_data(enum expectation expectation, char *fbuf, int size) { T_t *st; int ret; st = load_object(expectation, fbuf, size); if(!st) return; ret = save_object(st); assert(buf_offset < sizeof(buf)); assert(ret == 0); switch(expectation) { case EXP_RECLESS: assert(buf_offset > 0 && buf_offset < size); assert(memcmp(buf + 2, fbuf + 2, buf_offset - 2) == 0); break; case EXP_DIFFERENT: assert(buf_offset > 0 && buf_offset < size); break; case EXP_BROKEN: assert(buf_offset != size || memcmp(buf, fbuf, buf_offset)); break; case EXP_OK: assert(buf_offset == size); assert(memcmp(buf, fbuf, buf_offset) == 0); break; } asn_DEF_T.free_struct(&asn_DEF_T, st, 0); } /* * Decode the .der files and try to regenerate them. */ static int process(const char *fname) { char fbuf[4096]; char *ext = strrchr(fname, '.'); enum expectation expectation; int ret; int rd; FILE *fp; if(ext == 0 || strcmp(ext, ".ber")) return 0; switch(ext[-1]) { case 'B': /* The file is intentionally broken */ expectation = EXP_BROKEN; break; case 'D': /* Reconstructing should yield different data */ expectation = EXP_DIFFERENT; break; case 'L': /* Extensions are present */ expectation = EXP_RECLESS; break; default: expectation = EXP_OK; break; } fprintf(stderr, "\nProcessing file [../%s]\n", fname); ret = chdir("../data-62"); assert(ret == 0); fp = fopen(fname, "r"); ret = chdir("../test-check-62"); assert(ret == 0); assert(fp); rd = fread(fbuf, 1, sizeof(fbuf), fp); fclose(fp); assert(rd < sizeof(fbuf)); /* expect small files */ process_data(expectation, fbuf, rd); return 1; } int main() { DIR *dir; struct dirent *dent; int processed_files = 0; char *str; dir = opendir("../data-62"); assert(dir); str = getenv("DATA_62_FILE"); if(str && strncmp(str, "data-62-", 8) == 0) process(str); while((dent = readdir(dir))) { if(strncmp(dent->d_name, "data-62-", 8) == 0) if(process(dent->d_name)) processed_files++; } assert(processed_files); closedir(dir); return 0; } asn1c-0.9.24+dfsg/asn1c/check-parsing.sh0000755000000000000000000000114411461150505016310 0ustar rootroot#!/bin/sh tmpfile=".check-parsing.$$.tmp" # Test diff(1) capabilities diff -a . . 2>/dev/null && diffArgs="-a" # Assume text files diff -u . . 2>/dev/null && diffArgs="$diffArgs -u" # Unified diff output ec=0 for ref in ../tests/*.asn1.-*; do src=`echo "$ref" | sed -e 's/\.-[-a-zA-Z0-9=]*$//'` flags=`echo "$ref" | sed -e 's/.*\.-//'` echo "Checking $src against $ref" ./asn1c -S../skeletons "-$flags" "$src" > "$tmpfile" || ec=$? if [ $? = 0 ]; then diff $diffArgs "$ref" "$tmpfile" || ec=$? fi if [ "$1" != "regenerate" ]; then rm -f "$tmpfile" else mv "$tmpfile" "$ref" fi done exit $ec asn1c-0.9.24+dfsg/asn1c/Makefile.in0000644000000000000000000007054512121076150015310 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = asn1c$(EXEEXT) unber$(EXEEXT) enber$(EXEEXT) TESTS = subdir = asn1c DIST_COMMON = README $(dist_check_SCRIPTS) $(dist_man1_MANS) \ $(noinst_HEADERS) $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) asn1c_SOURCES = asn1c.c asn1c_OBJECTS = asn1c.$(OBJEXT) asn1c_DEPENDENCIES = $(top_builddir)/libasn1parser/libasn1parser.la \ $(top_builddir)/libasn1print/libasn1print.la \ $(top_builddir)/libasn1fix/libasn1fix.la \ $(top_builddir)/libasn1compiler/libasn1compiler.la enber_SOURCES = enber.c enber_OBJECTS = enber.$(OBJEXT) enber_LDADD = $(LDADD) unber_SOURCES = unber.c unber_OBJECTS = unber.$(OBJEXT) unber_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = asn1c.c enber.c unber.c DIST_SOURCES = asn1c.c enber.c unber.c RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man1_MANS) HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = . tests AM_CFLAGS = @ADD_CFLAGS@ AM_CPPFLAGS = \ -I${top_srcdir}/libasn1compiler \ -I${top_srcdir}/libasn1parser \ -I${top_srcdir}/libasn1print \ -I${top_srcdir}/libasn1fix \ -I${top_srcdir}/skeletons \ -DDATADIR=\"$(pkgdatadir)\" asn1c_LDADD = \ $(top_builddir)/libasn1parser/libasn1parser.la \ $(top_builddir)/libasn1print/libasn1print.la \ $(top_builddir)/libasn1fix/libasn1fix.la \ $(top_builddir)/libasn1compiler/libasn1compiler.la noinst_HEADERS = sys-common.h dist_man1_MANS = asn1c.1 unber.1 enber.1 dist_check_SCRIPTS = check-xxber.sh check-parsing.sh CLEANFILES = .check-xxber.*.tmp .check-parsing.*.tmp all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign asn1c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign asn1c/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list asn1c$(EXEEXT): $(asn1c_OBJECTS) $(asn1c_DEPENDENCIES) @rm -f asn1c$(EXEEXT) $(LINK) $(asn1c_OBJECTS) $(asn1c_LDADD) $(LIBS) enber$(EXEEXT): $(enber_OBJECTS) $(enber_DEPENDENCIES) @rm -f enber$(EXEEXT) $(LINK) $(enber_OBJECTS) $(enber_LDADD) $(LIBS) unber$(EXEEXT): $(unber_OBJECTS) $(unber_DEPENDENCIES) @rm -f unber$(EXEEXT) $(LINK) $(unber_OBJECTS) $(unber_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enber.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unber.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(dist_man1_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(dist_check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-TESTS check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: asn1c-0.9.24+dfsg/asn1c/asn1c.10000644000000000000000000001071511461150505014326 0ustar rootroot.TH ASN1C 1 "\*(Dt" "ASN.1 Compiler" "ASN.1 Compiler" .SH NAME asn1c \- ASN.1 Compiler .SH SYNOPSIS asn1c [\fB\-E\fR [\fB-F\fR] | \fB\-P\fR | \fB\-R\fR] [\fB\-S\fR\fIdir\fR] [\fB-X\fR] [\fB\-W\fR\fIdebug-\fR...] [\fB\-f\fR\fIoption\fR] [\fB\-gen-\fR\fIoption\fR] [\fB\-pdu=\fR{\fBall\fR|\fBauto\fR|\fIType\fR}\fR] [\fB\-print-\fR\fIoption\fR] \fIinfile\fR... .SH DESCRIPTION asn1c compiles ASN.1 specifications into a set of target language (C/C++) encoders and decoders for BER, DER, PER, XER and other encoding rules. .SH OPTIONS .TP \fIOverall Options\fR \fB\-E \-F \-P \-R\fR .BI "\-S " directory \fB\-X .TP \fIWarning Options\fR .br \fB\-Werror \-Wdebug-lexer \-Wdebug-fixer \-Wdebug-compiler\fR .TP \fILanguage Options\fR .br \fB\-fbless-SIZE \-fcompound-names \-findirect-choice .BI "\-fknown-extern-type=" \fB\-fnative-types \-fno-constraints \-fno-include-deps \-funnamed-unions \-fskeletons-copy .TP \fICodecs Generation Options\fR .br .B \-gen-PER \-pdu=\fR{\fBall\fR|\fBauto\fR|\fIType\fR} .TP \fIOutput Options\fR .br .B \-print-constraints \-print-lines .SH OVERALL OPTIONS .TP .B \-E Stop after the parsing stage and print the reconstructed ASN.1 specification code to the standard output. .TP .B \-F Used together with \c .B \-E\c , instructs the compiler to stop after the ASN.1 syntax tree fixing stage and dump the reconstructed ASN.1 specification to the standard output. .TP .B \-P Dump the compiled output to the standard output instead of creating the target language files on disk. .TP .B \-R Restrict the compiler to generate only the ASN.1 tables, omitting the usual support code. .TP \fB\-S\fR \fIdirectory\fR Use the specified directory with ASN.1 skeleton files. .TP .B \-X Generate an XML DTD schema for the specified ASN.1 files. .SH WARNING OPTIONS .TP .B \-Werror Treat warnings as errors; abort if any warning is produced. .TP .B \-Wdebug-lexer Enable lexer debugging during the ASN.1 parsing stage. .TP .B \-Wdebug-fixer Enable ASN.1 syntax tree fixer debugging during the fixing stage. .TP .B \-Wdebug-compiler Enable debugging during the actual compile time. .SH LANGUAGE OPTIONS .TP .B \-fbless-SIZE Allow SIZE() constraint for INTEGER, ENUMERATED, and other types for which this constraint is normally prohibited by the standard. This is a violation of ASN.1 standard, and the compiler may fail to produce a meaningful code. .TP .B \-fcompound-names Using this option prevents name collisions in the target source code by using complex names for target language structures. (Name collisions may occur if the ASN.1 module reuses the same identifiers in multiple contexts). .TP .B \-findirect-choice When generating code for a CHOICE type, compile the CHOICE members as indirect pointers instead of declaring them inline. Consider using this option together with .B \-fno-include-deps to prevent circular references. .TP .BI "\-fknown-extern-type=" Pretend the specified type is known. The compiler will assume the target language source files for the given type have been provided manually. .TP .B \-fnative-types Use the native machine's data types (int, double) whenever possible, instead of the compound INTEGER_t, ENUMERATED_t and REAL_t types. .TP .B \-fno-constraints Do not generate ASN.1 subtype constraint checking code. This may make a shorter executable. .TP .B \-fno-include-deps Do not generate courtesy #include lines for non-critical type dependencies. Helps prevent namespace collisions. .TP .B \-funnamed-unions Enable unnamed unions in the definitions of target language's structures. .TP .B \-fskeletons-copy Copy support files (skeletons) rather than symlink them. .SH CODECS GENERATION OPTIONS .TP .B \-gen-PER Generate Packed Encoding Rules (PER) support code. .TP .B \-pdu=\fR{\fBall\fR|\fBauto\fR|\fIType\fR} Create a PDU table for specified types, or discover Protocol Data Units automatically. In case of -pdu=\fBall\fR, all ASN.1 types defined in all modules will form a PDU table. In case of -pdu=\fBauto\fR, all types not referenced by any other type will form a PDU table. If \fIType\fR is an ASN.1 type identifier, it is added to a PDU table. The last form may be specified multiple times to add any number of PDUs. .SH OUTPUT OPTIONS .TP .B \-print-constraints When -EF are also specified, this option forces the compiler to explain its internal understanding of subtype constraints. .TP .B \-print-lines Generate "-- #line" comments in \fB-E\fR output. .SH SEE ALSO .TP \&\fIunber\fR\|(1), \&\fIenber\fR\|(1) .SH AUTHORS Lev Walkin asn1c-0.9.24+dfsg/asn1c/Makefile.am0000644000000000000000000000127312021336147015273 0ustar rootroot SUBDIRS = . tests AM_CFLAGS = @ADD_CFLAGS@ AM_CPPFLAGS = \ -I${top_srcdir}/libasn1compiler \ -I${top_srcdir}/libasn1parser \ -I${top_srcdir}/libasn1print \ -I${top_srcdir}/libasn1fix \ -I${top_srcdir}/skeletons \ -DDATADIR=\"$(pkgdatadir)\" asn1c_LDADD = \ $(top_builddir)/libasn1parser/libasn1parser.la \ $(top_builddir)/libasn1print/libasn1print.la \ $(top_builddir)/libasn1fix/libasn1fix.la \ $(top_builddir)/libasn1compiler/libasn1compiler.la bin_PROGRAMS = asn1c unber enber noinst_HEADERS = sys-common.h dist_man1_MANS = asn1c.1 unber.1 enber.1 dist_check_SCRIPTS = check-xxber.sh check-parsing.sh TESTS = $(check_SCRIPTS) CLEANFILES = .check-xxber.*.tmp .check-parsing.*.tmp asn1c-0.9.24+dfsg/asn1c/sys-common.h0000644000000000000000000000405312015121740015505 0ustar rootroot/*- * Copyright (c) 2005 Lev Walkin . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id$ */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_STAT_H #include /* for stat(2) */ #endif #ifndef _WIN32 #include /* for EX_USAGE & others */ #else /* _WIN32 */ #ifndef EX_USAGE #define EX_USAGE 64 #endif #ifndef EX_DATAERR #define EX_DATAERR 65 #endif #ifndef EX_SOFTWARE #define EX_SOFTWARE 70 #endif #ifndef EX_OSERR #define EX_OSERR 71 #endif #ifndef EX_OSFILE #define EX_OSFILE 72 #endif #define alloca _alloca #define snprintf _snprintf #endif /* _WIN32 */ asn1c-0.9.24+dfsg/asn1c/unber.c0000644000000000000000000005137112021064122014511 0ustar rootroot/*- * Copyright (c) 2004, 2005, 2006 Lev Walkin . * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id$ */ #include "sys-common.h" #define ASN_DISABLE_PER_SUPPORT 1 #include /* For static string tables */ #include #include #include #include #include #include #include #include #undef COPYRIGHT #define COPYRIGHT \ "Copyright (c) 2004, 2005 Lev Walkin \n" static void usage(const char *av0); /* Print the Usage screen and exit */ static int process(const char *fname); /* Perform the BER decoding */ static int decode_tlv_from_string(const char *datastring); static int single_type_decoding = 0; /* -1 enables that */ static int minimalistic = 0; /* -m enables that */ static int pretty_printing = 1; /* -p disables that */ static int skip_bytes = 0; /* -s controls that */ static char indent_bytes[16] = " "; /* -i controls that */ int main(int ac, char **av) { int ch; /* Command line character */ int i; /* Index in some loops */ /* * Process command-line options. */ while((ch = getopt(ac, av, "1hi:mps:t:v")) != -1) switch(ch) { case '1': single_type_decoding = 1; break; case 'i': i = atoi(optarg); if(i >= 0 && i < (int)sizeof(indent_bytes)) { memset(indent_bytes, ' ', i); indent_bytes[i] = '\0'; } else { fprintf(stderr, "-i %s: Invalid indent value\n",optarg); exit(EX_USAGE); } break; case 'm': minimalistic = 1; break; case 'p': pretty_printing = 0; break; case 's': skip_bytes = atoi(optarg); if(skip_bytes < 0) { fprintf(stderr, "-s %s: positive value expected\n", optarg); exit(EX_USAGE); } break; case 't': if(decode_tlv_from_string(optarg)) exit(EX_DATAERR); exit(0); case 'v': fprintf(stderr, "ASN.1 BER Decoder, v" VERSION "\n" COPYRIGHT); exit(0); break; case 'h': default: usage(av[0]); } /* * Ensure that there are some input files present. */ if(ac > optind) { ac -= optind; av += optind; } else { fprintf(stderr, "%s: No input files specified\n", av[0]); exit(1); } setvbuf(stdout, 0, _IOLBF, 0); /* * Iterate over input files and parse each. * All syntax trees from all files will be bundled together. */ for(i = 0; i < ac; i++) { if(process(av[i])) exit(EX_DATAERR); } return 0; } /* * Print the usage screen and exit(EX_USAGE). */ static void usage(const char *av0) { fprintf(stderr, "ASN.1 BER Decoder, v" VERSION "\n" COPYRIGHT "Usage: %s [options] [-] [file ...]\n" "Options:\n" " -1 Decode only the first BER structure (otherwise, until EOF)\n" " -i Amount of spaces for output indentation (default is 4)\n" " -m Minimalistic mode: print as little as possible\n" " -p Do not attempt pretty-printing of known ASN.1 types\n" " -s Ignore first bytes of input\n" " -t Decode the given tag[/length] sequence (e.g. -t \"bf20\")\n" "\n" "The XML opening tag format is as follows:\n" " \n" "Where:\n" " tform Which form the value is in: constructed (\"C\", \"I\") or primitive (\"P\")\n" " off Offset of the encoded element in the unber input stream\n" " tag The tag class and value in human readable form\n" " tl_len The length of the TL (BER Tag and Length) encoding\n" " v_len The length of the value (V, encoded by the L), may be \"Indefinite\"\n" " type Likely name of the underlying ASN.1 type (for [UNIVERSAL n] tags)\n" " [F] Indicates that the value was reformatted (pretty-printed)\n" "See the manual page for details\n" , av0); exit(EX_USAGE); } typedef enum pd_code { PD_FAILED = -1, PD_FINISHED = 0, PD_EOF = 1, } pd_code_e; static pd_code_e process_deeper(const char *fname, FILE *fp, asn1c_integer_t *offset, int level, ssize_t limit, ber_tlv_len_t *frame_size, ber_tlv_len_t effective_size, int expect_eoc); static void print_TL(int fin, asn1c_integer_t offset, int level, int constr, ssize_t tlen, ber_tlv_tag_t, ber_tlv_len_t, ber_tlv_len_t effective_frame_size); static int print_V(const char *fname, FILE *fp, ber_tlv_tag_t, ber_tlv_len_t); /* * Open the file and initiate recursive processing. */ static int process(const char *fname) { FILE *fp; pd_code_e pdc; asn1c_integer_t offset = 0; /* Stream decoding position */ ber_tlv_len_t frame_size = 0; /* Single frame size */ if(strcmp(fname, "-")) { fp = fopen(fname, "rb"); if(!fp) { perror(fname); return -1; } } else { fp = stdin; } /* * Skip the requested amount of bytes. */ for(; offset < skip_bytes; offset++) { if(fgetc(fp) == -1) { fprintf(stderr, "%s: input source (%" PRIdASN " bytes) " "has less data than \"-s %d\" switch " "wants to skip\n", fname, offset, skip_bytes); if(fp != stdin) fclose(fp); return -1; } } /* * Fetch out BER-encoded data until EOF or error. */ do { pdc = process_deeper(fname, fp, &offset, 0, -1, &frame_size, 0, 0); } while(pdc == PD_FINISHED && !single_type_decoding); if(fp != stdin) fclose(fp); if(pdc == PD_FAILED) return -1; return 0; } /* * Process the TLV recursively. */ static pd_code_e process_deeper(const char *fname, FILE *fp, asn1c_integer_t *offset, int level, ssize_t limit, ber_tlv_len_t *frame_size, ber_tlv_len_t effective_size, int expect_eoc) { unsigned char tagbuf[32]; ssize_t tblen = 0; pd_code_e pdc = PD_FINISHED; ber_tlv_tag_t tlv_tag; ber_tlv_len_t tlv_len; ssize_t t_len; ssize_t l_len; for(;;) { ber_tlv_len_t local_esize = 0; int constr; int ch; if(limit == 0) return PD_FINISHED; if(limit >= 0 && tblen >= limit) { fprintf(stderr, "%s: Too long TL sequence (%ld >= %ld)" " at %" PRIdASN ". " "Broken or maliciously constructed file\n", fname, (long)tblen, (long)limit, *offset); return PD_FAILED; } /* Get the next byte from the input stream */ ch = fgetc(fp); if(ch == -1) { if(limit > 0 || expect_eoc) { fprintf(stderr, "%s: Unexpected end of file (TL)" " at %" PRIdASN "\n", fname, *offset); return PD_FAILED; } else { return PD_EOF; } } tagbuf[tblen++] = ch; /* * Decode the TLV tag. */ t_len = ber_fetch_tag(tagbuf, tblen, &tlv_tag); switch(t_len) { case -1: fprintf(stderr, "%s: Fatal error decoding tag" " at %" PRIdASN "+%ld\n", fname, *offset, (long)tblen); return PD_FAILED; case 0: /* More data expected */ continue; } /* * Decode the TLV length. */ constr = BER_TLV_CONSTRUCTED(tagbuf); l_len = ber_fetch_length(constr, tagbuf + t_len, tblen - t_len, &tlv_len); switch(l_len) { case -1: fprintf(stderr, "%s: Fatal error decoding value length" " at %" PRIdASN "\n", fname, *offset + t_len); return PD_FAILED; case 0: /* More data expected */ continue; } /* Make sure the T & L decoders took exactly the whole buffer */ assert((t_len + l_len) == tblen); if(!expect_eoc || tagbuf[0] || tagbuf[1]) print_TL(0, *offset, level, constr, tblen, tlv_tag, tlv_len, effective_size); if(limit != -1) { /* If limit is set, account for the TL sequence */ limit -= (t_len + l_len); assert(limit >= 0); if(tlv_len > limit) { fprintf(stderr, "%s: Structure advertizes length (%ld) " "greater than of a parent container (%ld)\n", fname, (long)tlv_len, (long)limit); return PD_FAILED; } } *offset += t_len + l_len; *frame_size += t_len + l_len; effective_size += t_len + l_len; local_esize += t_len + l_len; if(expect_eoc && !tagbuf[0] && !tagbuf[1]) { /* End of content octets */ print_TL(1, *offset - 2, level - 1, 1, 2, 0, -1, effective_size); return PD_FINISHED; } if(constr) { ber_tlv_len_t dec = 0; /* * This is a constructed type. Process recursively. */ printf(">\n"); /* Close the opening tag */ if(tlv_len != -1 && limit != -1) { assert(limit >= tlv_len); } pdc = process_deeper(fname, fp, offset, level + 1, tlv_len == -1 ? limit : tlv_len, &dec, t_len + l_len, tlv_len == -1); if(pdc == PD_FAILED) return pdc; if(limit != -1) { assert(limit >= dec); limit -= dec; } *frame_size += dec; effective_size += dec; local_esize += dec; if(tlv_len == -1) { tblen = 0; if(pdc == PD_FINISHED && limit < 0 && !expect_eoc) return pdc; continue; } } else { assert(tlv_len >= 0); if(print_V(fname, fp, tlv_tag, tlv_len)) return PD_FAILED; if(limit != -1) { assert(limit >= tlv_len); limit -= tlv_len; } *offset += tlv_len; *frame_size += tlv_len; effective_size += tlv_len; local_esize += tlv_len; } print_TL(1, *offset, level, constr, tblen, tlv_tag, tlv_len, local_esize); tblen = 0; /* Report success for a single top level TLV */ if(level == 0 && limit == -1 && !expect_eoc) break; } /* for(;;) */ return pdc; } static void print_TL(int fin, asn1c_integer_t offset, int level, int constr, ssize_t tlen, ber_tlv_tag_t tlv_tag, ber_tlv_len_t tlv_len, ber_tlv_len_t effective_size) { if(fin && !constr) { printf("

\n"); return; } while(level-- > 0) fputs(indent_bytes, stdout); /* Print indent */ printf(fin ? "\n"); } } /* * Print the value in binary form, or reformat for pretty-printing. */ static int print_V(const char *fname, FILE *fp, ber_tlv_tag_t tlv_tag, ber_tlv_len_t tlv_len) { asn1c_integer_t *arcs = 0; /* Object identifier arcs */ unsigned char *vbuf = 0; asn1p_expr_type_e etype = 0; asn1c_integer_t collector = 0; int special_format = 0; ssize_t i; /* Figure out what type is it */ if(BER_TAG_CLASS(tlv_tag) == ASN_TAG_CLASS_UNIVERSAL && pretty_printing) { ber_tlv_tag_t tvalue = BER_TAG_VALUE(tlv_tag); etype = ASN_UNIVERSAL_TAG2TYPE(tvalue); } /* * Determine how to print the value, either in its native binary form, * encoded with &xNN characters, or using pretty-printing. * The basic string types (including "useful types", like UTCTime) * are excempt from this determination logic, because their alphabets * are subsets of the XML's native UTF-8 encoding. */ switch(etype) { case ASN_BASIC_BOOLEAN: if(tlv_len == 1) special_format = 1; else etype = 0; break; case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: if((size_t)tlv_len <= sizeof(collector)) special_format = 1; else etype = 0; break; case ASN_BASIC_OBJECT_IDENTIFIER: case ASN_BASIC_RELATIVE_OID: if(tlv_len > 0 && tlv_len < 128*1024 /* VERY long OID! */) { arcs = MALLOC(sizeof(*arcs) * (tlv_len + 1)); if(arcs) { vbuf = MALLOC(tlv_len + 1); /* Not checking is intentional */ } } case ASN_BASIC_UTCTime: case ASN_BASIC_GeneralizedTime: case ASN_STRING_NumericString: case ASN_STRING_PrintableString: case ASN_STRING_VisibleString: case ASN_STRING_IA5String: case ASN_STRING_UTF8String: break; /* Directly compatible with UTF-8 */ case ASN_STRING_BMPString: case ASN_STRING_UniversalString: break; /* Not directly compatible with UTF-8 */ default: /* Conditionally compatible with UTF-8 */ if(( (etype & ASN_STRING_MASK) || (etype == ASN_BASIC_OCTET_STRING) || /* * AUTOMATIC TAGS or IMPLICIT TAGS in effect, * Treat this primitive type as OCTET_STRING. */ (BER_TAG_CLASS(tlv_tag) != ASN_TAG_CLASS_UNIVERSAL && pretty_printing) ) && (tlv_len > 0 && tlv_len < 128 * 1024)) { vbuf = MALLOC(tlv_len + 1); /* Not checking is intentional */ } break; } /* If collection vbuf is present, defer printing the F flag. */ if(!vbuf) printf(special_format ? " F>" : ">"); /* * Print the value in binary or text form, * or collect the bytes into vbuf. */ for(i = 0; i < tlv_len; i++) { int ch = fgetc(fp); if(ch == -1) { fprintf(stderr, "%s: Unexpected end of file (V)\n", fname); if(vbuf) FREEMEM(vbuf); if(arcs) FREEMEM(arcs); return -1; } switch(etype) { case ASN_BASIC_UTCTime: case ASN_BASIC_GeneralizedTime: case ASN_STRING_NumericString: case ASN_STRING_PrintableString: case ASN_STRING_VisibleString: case ASN_STRING_IA5String: case ASN_STRING_UTF8String: switch(ch) { default: if(((etype == ASN_STRING_UTF8String) || !(ch & 0x80)) && (ch >= 0x20) ) { printf("%c", ch); break; } /* Fall through */ case 0x3c: case 0x3e: case 0x26: printf("&#x%02x;", ch); } break; case ASN_BASIC_BOOLEAN: switch(ch) { case 0: printf(""); break; case 0xff: printf(""); break; default: printf("", ch); } break; case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: if(i) collector = collector * 256 + ch; else collector = (int)(signed char)ch; break; default: if(vbuf) { vbuf[i] = ch; } else { printf("&#x%02x;", ch); } } } /* Do post-processing */ switch(etype) { case ASN_BASIC_INTEGER: case ASN_BASIC_ENUMERATED: printf("%" PRIdASN, collector); break; case ASN_BASIC_OBJECT_IDENTIFIER: if(vbuf) { OBJECT_IDENTIFIER_t oid; int arcno; oid.buf = vbuf; oid.size = tlv_len; arcno = OBJECT_IDENTIFIER_get_arcs(&oid, arcs, sizeof(*arcs), tlv_len + 1); if(arcno >= 0) { assert(arcno <= (tlv_len + 1)); printf(" F>"); for(i = 0; i < arcno; i++) { if(i) printf("."); printf("%" PRIuASN, arcs[i]); } FREEMEM(vbuf); vbuf = 0; } } break; case ASN_BASIC_RELATIVE_OID: if(vbuf) { RELATIVE_OID_t oid; int arcno; oid.buf = vbuf; oid.size = tlv_len; arcno = RELATIVE_OID_get_arcs(&oid, arcs, sizeof(*arcs), tlv_len); if(arcno >= 0) { assert(arcno <= (tlv_len + 1)); printf(" F>"); for(i = 0; i < arcno; i++) { if(i) printf("."); printf("%" PRIuASN, arcs[i]); } FREEMEM(vbuf); vbuf = 0; } } break; default: break; } /* * If the buffer was not consumed, print it out. * It might be an OCTET STRING or other primitive type, * which might actually be printable, but we need to figure it out. */ if(vbuf) { int binary; /* * Check whether the data could be represented as text */ binary = -1 * (tlv_len >> 3); /* Threshold is 12.5% binary */ for(i = 0; i < tlv_len; i++) { switch(vbuf[i]) { case 0x1b: binary = 1; break; case 0x09: case 0x0a: case 0x0d: continue; default: if(vbuf[i] < 0x20 || vbuf[i] >= 0x7f) if(++binary > 0) /* Way too many */ break; continue; } break; } printf(">"); for(i = 0; i < tlv_len; i++) { if(binary > 0 || vbuf[i] < 0x20 || vbuf[i] >= 0x7f || vbuf[i] == 0x26 /* '&' */ || vbuf[i] == 0x3c /* '<' */ || vbuf[i] == 0x3e /* '>' */ ) printf("&#x%02x;", vbuf[i]); else printf("%c", vbuf[i]); } FREEMEM(vbuf); } if(arcs) FREEMEM(arcs); return 0; } static int decode_tlv_from_string(const char *datastring) { unsigned char *data, *dp; size_t dsize; /* Data size */ ssize_t len; ber_tlv_tag_t tlv_tag; ber_tlv_len_t tlv_len; const char *p; int half; dsize = strlen(datastring) + 1; dp = data = CALLOC(1, dsize); assert(data); for(half = 0, p = datastring; *p; p++) { switch(*p) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': *dp |= *p - '0'; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': *dp |= *p - 'A' + 10; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': *dp |= *p - 'a' + 10; break; case ' ': case '\t': case '\r': case '\n': continue; default: fprintf(stderr, "Unexpected symbols in data string:\n"); fprintf(stderr, "%s\n", datastring); for(dp = data; datastring < p; datastring++, dp++) *dp = ' '; *dp = '\0'; fprintf(stderr, "%s^ <- here\n", (char *)data); return -1; } if(half) dp++; else (*dp) <<= 4; half = !half; } assert((size_t)(dp - data) <= dsize); dsize = dp - data; printf("BER: "); for(dp = data; dp < data + dsize; dp++) printf("%02X", *dp); printf("\n"); len = ber_fetch_tag(data, dsize, &tlv_tag); switch(len) { case -1: fprintf(stderr, "TAG: Fatal error decoding tag\n"); return -1; case 0: fprintf(stderr, "TAG: More data expected\n"); return -1; default: printf("TAG: "); ber_tlv_tag_fwrite(tlv_tag, stdout); if(BER_TLV_CONSTRUCTED(data)) { printf(" (constructed)"); } else if(dsize >= 2 && data[0] == 0 && data[1] == 0) { printf(" (end-of-content)"); } else { printf(" (primitive)"); } if(BER_TAG_CLASS(tlv_tag) == ASN_TAG_CLASS_UNIVERSAL) { const char *str; ber_tlv_tag_t tvalue = BER_TAG_VALUE(tlv_tag); str = ASN_UNIVERSAL_TAG2STR(tvalue); if(str) printf(" \"%s\"", str); } printf("\n"); } if(dsize > (size_t)len) { len = ber_fetch_length(BER_TLV_CONSTRUCTED(data), data + len, dsize - len, &tlv_len); switch(len) { case -1: fprintf(stderr, "LEN: Fatal error decoding length\n"); return -1; case 0: fprintf(stderr, "LEN: More data expected\n"); return -1; default: if(tlv_len == (ber_tlv_len_t)-1) printf("LEN: Indefinite length encoding\n"); else printf("LEN: %ld bytes\n", (long)tlv_len); } } return 0; } /* * Dummy functions. */ asn_dec_rval_t ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx, const void *ptr, size_t size, int tag_mode, int last_tag_form, ber_tlv_len_t *last_length, int *opt_tlv_form) { asn_dec_rval_t rv = { 0, 0 }; (void)opt_codec_ctx; (void)td; (void)opt_ctx; (void)ptr; (void)size; (void)tag_mode; (void)last_tag_form; (void)last_length; (void)opt_tlv_form; return rv; } ssize_t der_write_tags(asn_TYPE_descriptor_t *td, size_t slen, int tag_mode, int last_tag_form, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { (void)td; (void)slen; (void)tag_mode; (void)last_tag_form; (void)tag; (void)cb; (void)app_key; return -1; } asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx, void *struct_key, const char *xml_tag, const void *buf_ptr, size_t size, int (*otd)(void *struct_key, const void *chunk_buf, size_t chunk_size), ssize_t (*br)(void *struct_key, const void *chunk_buf, size_t chunk_size, int have_more)) { asn_dec_rval_t rv = { 0, 0 }; (void)opt_codec_ctx; (void)ctx; (void)struct_key; (void)xml_tag; (void)buf_ptr; (void)size; (void)otd; (void)br; return rv; } asn_dec_rval_t OCTET_STRING_decode_uper(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv = { 0, 0 }; (void)ctx; (void)td; (void)cts; (void)sptr; (void)pd; return rv; } asn_enc_rval_t OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; } int xer_is_whitespace(const void *b, size_t s) { (void)b; (void)s; return 0; }