1. 23 Jan, 2018 4 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
    • Bi-Ruei, Chiu's avatar
      Use comprehensible names for instances of parameterized types · 59b9e705
      Bi-Ruei, Chiu authored
      With previous commit, the following data types are generated in ProtocolIE-Field.h
      for S1AP's ASN.1 :
      
      ```
      typedef enum ProtocolIE_Field_6564P0__value_PR {
          ProtocolIE_Field_6564P0__value_PR_NOTHING, /* No components present */
          ProtocolIE_Field_6564P0__value_PR_E_RABToBeSetupItemBearerSUReq
      } ProtocolIE_Field_6564P0__value_PR;
      
      typedef struct ProtocolIE_Field_6564P0 {
          ProtocolIE_ID_t      id;
          Criticality_t        criticality;
          struct ProtocolIE_Field_6564P0__value {
              ProtocolIE_Field_6564P0__value_PR        present;
              union ProtocolIE_Field_6564P0__value_u {
                  E_RABToBeSetupItemBearerSUReq_t      E_RABToBeSetupItemBearerSUReq;
              } choice;
      
              /* Context for parsing across buffer boundaries */
              asn_struct_ctx_t _asn_ctx;
          } value;
      
          /* Context for parsing across buffer boundaries */
          asn_struct_ctx_t _asn_ctx;
      } ProtocolIE_Field_6564P0_t;
      
      ```
      
      It's difficult for developer to recognize to which ASN.1 type they are linked.
      They all start with 'ProtocolIE_Field_'. It will be error-prone.
      
      With this commit, more human comprehensible data types are generated :
      
      ```
      
      typedef enum E_RABToBeSetupItemBearerSUReqIEs__value_PR {
          E_RABToBeSetupItemBearerSUReqIEs__value_PR_NOTHING, /* No components present */
          E_RABToBeSetupItemBearerSUReqIEs__value_PR_E_RABToBeSetupItemBearerSUReq
      } E_RABToBeSetupItemBearerSUReqIEs__value_PR;
      
      typedef struct E_RABToBeSetupItemBearerSUReqIEs {
          ProtocolIE_ID_t      id;
          Criticality_t        criticality;
          struct E_RABToBeSetupItemBearerSUReqIEs__value {
              E_RABToBeSetupItemBearerSUReqIEs__value_PR present;
              union E_RABToBeSetupItemBearerSUReqIEs__value_u {
                  E_RABToBeSetupItemBearerSUReq_t               E_RABToBeSetupItemBearerSUReq;
              } choice;
      
              /* Context for parsing across buffer boundaries */
              asn_struct_ctx_t _asn_ctx;
          } value;
      
          /* Context for parsing across buffer boundaries */
          asn_struct_ctx_t _asn_ctx;
      } E_RABToBeSetupItemBearerSUReqIEs_t;
      
      ```
      
      Developers can understand they are generated from :
      
      ```
      
      E-RABToBeSetupItemBearerSUReqIEs S1AP-PROTOCOL-IES ::= {
          { ID id-E-RABToBeSetupItemBearerSUReq CRITICALITY reject TYPE E-RABToBeSetupItemBearerSUReq PRESENCE mandatory },
          ...
      }
      
      ```
      59b9e705
  2. 16 Jan, 2018 7 commits
  3. 21 Nov, 2017 6 commits
  4. 20 Nov, 2017 1 commit
  5. 18 Nov, 2017 9 commits
  6. 15 Nov, 2017 3 commits
  7. 14 Nov, 2017 10 commits