1. 31 May, 2018 2 commits
    • Bi-Ruei, Chiu's avatar
      Regenerte test cases · 054f06c2
      Bi-Ruei, Chiu authored
      054f06c2
    • Bi-Ruei, Chiu's avatar
      Add min and max value of INTEGER(min..max) to asn_constant.h · efd2af41
      Bi-Ruei, Chiu authored
      For the following ASN.1 excerpt, the value of these Types will
      be checked against its valid range in their corresponding
      constraint functions.
      
      DRB-Identity ::= INTEGER(1..32)
      RSRP-Range   ::= INTEGER(0..97)
      RSRQ-Range   ::= INTEGER(0..34)
      
      Sometime it is convenient for application being aware of these
      min and max values.
      
      This commit generate the following macro defintions in
      asn_constant.h :
      
      \#define min_val_DRB_Identity (1)
      \#define max_val_DRB_Identity (32)
      \#define min_val_RSRP_Range (0)
      \#define max_val_RSRP_Range (97)
      \#define min_val_RSRQ_Range (0)
      \#define max_val_RSRQ_Range (34)
      efd2af41
  2. 30 May, 2018 1 commit
    • Bi-Ruei, Chiu's avatar
      Fix the problem when ActualParameter to parameterized type is a Type · d64be68b
      Bi-Ruei, Chiu authored
      When ActualParameter to a parameterized type is a Type, commit
      59b9e705 will produce C struct types using ActualParameter,
      which are conflict with the C struct types for these Types themselves.
      
      For example, the following typedef has duplicate definition of
      UCI_OnPUSCH_t :
      
      typedef struct UCI_OnPUSCH {
      	UCI_OnPUSCH_PR present;
      	union UCI_OnPUSCH_u {
      		NULL_t	 release;
      		UCI_OnPUSCH_t	 setup;
      	} choice;
      
      	/* Context for parsing across buffer boundaries */
      	asn_struct_ctx_t _asn_ctx;
      } UCI_OnPUSCH_t;
      
      With this commit, if ActualParameter is a Type, then prefix it
      with Parameterized Type name.
      
      typedef struct SetupRelease_UCI_OnPUSCH {
      	SetupRelease_UCI_OnPUSCH_PR present;
      	union SetupRelease_UCI_OnPUSCH_u {
      		NULL_t	 release;
      		UCI_OnPUSCH_t	 setup;
      	} choice;
      
      	/* Context for parsing across buffer boundaries */
      	asn_struct_ctx_t _asn_ctx;
      } SetupRelease_UCI_OnPUSCH_t;
      
      As for ActualParameter is ObjectSet, used in S1AP ... etc, it doesn't
      prefix generated typedefs for keeping names shorter.
      
      This commit can replace item 3 of
      
      https://github.com/vlm/asn1c/issues/282#issuecomment-390838895
      
      which solve part of #282.
      d64be68b
  3. 19 Apr, 2018 1 commit
    • Bi-Ruei, Chiu's avatar
      Fix item 2 of issue 254 · 0bb89078
      Bi-Ruei, Chiu authored
      1. Record the de-referenced expression to newly added field ref_expr
         of strcut asn1p_ref_t.
      2. In function asn1c_make_identifier(), not only check whehter there
         is name clash occurred for this asn1p_expr_t but also the referenced
         expression to determine whether an additional module name to be added.
      3. Change signature of some functions and variables to eliminate warning
         messages when const type pointer, i.e. const asn1p_ref_t *, variables
         versus, non-const * type pointer, i.e. asn1p_ref_t *, varibles are
         used. E.g.:
         warning: assignment discards ‘const’ qualifier from pointer target type
      0bb89078
  4. 12 Apr, 2018 2 commits
  5. 21 Mar, 2018 6 commits
  6. 14 Mar, 2018 3 commits
  7. 09 Mar, 2018 2 commits
  8. 08 Mar, 2018 5 commits
  9. 07 Mar, 2018 1 commit
  10. 06 Mar, 2018 1 commit
  11. 05 Mar, 2018 4 commits
  12. 09 Feb, 2018 1 commit
  13. 02 Feb, 2018 1 commit
  14. 26 Jan, 2018 5 commits
  15. 24 Jan, 2018 2 commits
    • Bi-Ruei, Chiu's avatar
      Regenerate test cases · 6eae4421
      Bi-Ruei, Chiu authored
      6eae4421
    • Bi-Ruei, Chiu's avatar
      Fix problem results from empty ios cells generated · 6b76c7c7
      Bi-Ruei, Chiu authored
      For RANAP specification :
      
        RANAP-ELEMENTARY-PROCEDURE ::= CLASS {
          &InitiatingMessage,
          &SuccessfulOutcome          OPTIONAL,
          &UnsuccessfulOutcome        OPTIONAL,
          &Outcome                    OPTIONAL,
          &procedureCode              ProcedureCode  UNIQUE,
          &criticality                Criticality    DEFAULT ignore
        } WITH SYNTAX {
          INITIATING MESSAGE          &InitiatingMessage
          [SUCCESSFUL OUTCOME         &SuccessfulOutcome]
          [UNSUCCESSFUL OUTCOME       &UnsuccessfulOutcome]
          [OUTCOME                    &Outcome]
          PROCEDURE CODE              &procedureCode
          [CRITICALITY                &criticality]
        }
      
      Not all instances of elementary procedure have all their
      optional members defined.
      
      For examples :
      
        iu-Release RANAP-ELEMENTARY-PROCEDURE ::= {
          INITIATING MESSAGE  Iu-ReleaseCommand
          SUCCESSFUL OUTCOME  Iu-ReleaseComplete
          PROCEDURE CODE      id-Iu-Release
          CRITICALITY         reject
        }
      
        rAB-Assignment RANAP-ELEMENTARY-PROCEDURE ::= {
          INITIATING MESSAGE	RAB-AssignmentRequest
          OUTCOME             RAB-AssignmentResponse
          PROCEDURE CODE      id-RAB-Assignment
          CRITICALITY         reject
        }
      
      So there are empty cells generated in Outcome.c ... etc.
      
        static const asn_ioc_cell_t asn_IOS_RANAP_ELEMENTARY_PROCEDURES_1_rows[] = {
          { "&InitiatingMessage", aioc__type, &asn_DEF_Iu_ReleaseCommand },
          { "&SuccessfulOutcome", aioc__type, &asn_DEF_Iu_ReleaseComplete },
          { "&UnsuccessfulOutcome",  },
          { "&Outcome",  },
          { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_1_id_Iu_Release },
          { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_1_reject },
      
          { "&InitiatingMessage", aioc__type, &asn_DEF_RAB_AssignmentRequest },
          { "&SuccessfulOutcome",  },
          { "&UnsuccessfulOutcome",  },
          { "&Outcome", aioc__type, &asn_DEF_RAB_AssignmentResponse },
          { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_49_id_RAB_Assignment },
          { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_49_reject }
        }
      
      However, in type_selector() functions, these undefined cell are still
      be counted into presence_index value. This results in wrong behavior for
      decoder.
      
      This commit is to fix this problem.
      6b76c7c7
  16. 23 Jan, 2018 3 commits
    • Bi-Ruei, Chiu's avatar
      Generate constant variables reference to user defined types · 8d0f6857
      Bi-Ruei, Chiu authored
      Currently, there is no code generated for following ASN.1 excerpt.
      Thus application is not aware of these values.
      
          ProtocolIE-ID ::= INTEGER (0..65535)
      
          id-MME-UE-S1AP-ID  ProtocolIE-ID ::= 0
          id-HandoverType    ProtocolIE-ID ::= 1
          id-Cause           ProtocolIE-ID ::= 2
          id-SourceID        ProtocolIE-ID ::= 3
            ...
      
          ProcedureCode ::= INTEGER (0..255)
      
          id-HandoverPreparation         ProcedureCode ::= 0
          id-HandoverResourceAllocation  ProcedureCode ::= 1
          id-HandoverNotification        ProcedureCode ::= 2
          id-PathSwitchRequest           ProcedureCode ::= 3
          ...
      
      This commit adds corresponding macro definitions in
      ProtocolIE-ID.h and ProcedureCode.h respectively.
      
          #define ProtocolIE_ID_id_MME_UE_S1AP_ID       ((ProtocolIE_ID_t)0)
          #define ProtocolIE_ID_id_HandoverType ((ProtocolIE_ID_t)1)
          #define ProtocolIE_ID_id_Cause        ((ProtocolIE_ID_t)2)
          #define ProtocolIE_ID_id_SourceID     ((ProtocolIE_ID_t)3)
          ...
      
          #define ProcedureCode_id_HandoverPreparation ((ProcedureCode_t)0)
          #define ProcedureCode_id_HandoverResourceAllocation    ((ProcedureCode_t)1)
          #define ProcedureCode_id_HandoverNotification ((ProcedureCode_t)2)
          #define ProcedureCode_id_PathSwitchRequest    ((ProcedureCode_t)3)
          ...
      
      Only types of ASN_BASIC_INTEGER and ASN_BASIC_ENUMERATED referenced
      by these constant variables are handled.
      
      Other built-in types shall be added in the future.
      8d0f6857
    • Bi-Ruei, Chiu's avatar
      Generate asn_constant.h · e436f61a
      Bi-Ruei, Chiu authored
      Currently, there is no code generated for following ASN.1 excerpt.
      Thus application is not aware of these values.
      
          maxnoofErrors           INTEGER ::= 256
          maxnoofBPLMNs           INTEGER ::= 6
          maxnoofPLMNsPerMME      INTEGER ::= 32
          maxnoofEPLMNs           INTEGER ::= 15
          ...
      
      This commit generate asn_constant.h which has the following macro
      defitions :
      
          #define maxnoofErrors (256)
          #define maxnoofBPLMNs (6)
          #define maxnoofPLMNsPerMME (32)
          #define maxnoofEPLMNs (15)
          #define maxnoofEPLMNsPlusOne (16)
          ...
      
      It only handles ASN_BASIC_INTEGER type. Other built-in types shall
      be added in the future.
      e436f61a
    • Bi-Ruei, Chiu's avatar
      Rename test cases for avoiding conflict · 8d1673db
      Bi-Ruei, Chiu authored
      8d1673db