Git Product home page Git Product logo

Comments (9)

mouse07410 avatar mouse07410 commented on August 14, 2024

1.0.0 release was a mistake. Please use the current vlm_master branch (the default), as it's the only branch that gets updates and fixes (and it provides the most capabilities). I doubt you can make 1.0.0 work properly with s1ap-f40.asn.

Regarding parsing IEs, I don't really know - but AFAIK it should be possible to tell the code to parse a single PDU. Now, if that PDU is comprised of several IEs - I doubt you can tell it to stop mid-way after the IE you're interested in was parsed, but I'll let @brchiu and @velichkov to weigh in on this.

from asn1c.

jeick2008 avatar jeick2008 commented on August 14, 2024

@mouse07410
vlm_master branch can generate the codes, but something is wrong.
the cmdline asn1c -pdu=S1AP-PDU -pdu=all -fcompound-names -findirect-choice -fno-include-deps -flink-skeletons -no-gen-OER - gen-PER ../36413/s1ap-f40.asn ../36331/lte-rrc-f40.asn
lte-rrc-f40.zip
s1ap-f40.zip
then execute make -f converter-example.mk,
cc -DASN_DISABLE_OER_SUPPORT -DPDU=S1AP_PDU -DASN_PDU_COLLECTION -I. -o S1AP-PDU.o -c S1AP-PDU.c cc -DASN_DISABLE_OER_SUPPORT -DPDU=S1AP_PDU -DASN_PDU_COLLECTION -I. -o InitiatingMessage.o -c InitiatingMessage.c InitiatingMessage.c:138:39: error: ‘asn_DEF_HandoverCommand’ undeclared here (not in a function) { "&SuccessfulOutcome", aioc__type, &asn_DEF_HandoverCommand }, ^ InitiatingMessage.c:252:39: error: ‘asn_DEF_Paging’ undeclared here (not in a function) { "&InitiatingMessage", aioc__type, &asn_DEF_Paging }, ^ make: *** [InitiatingMessage.o] Error 1
Within brchiu's repo , the same cmdline works well.
https://github.com/brchiu/asn1c/tree/velichkov_s1ap_plus_option_group
.................................................
the difference is asn_DEF_(S1AP_PDU_Contens)HandoverCommand, details likes bellow:
图片

from asn1c.

brchiu avatar brchiu commented on August 14, 2024

@jeick2008, to avoid name clash from ASN.1 modules, it is practically not recommended to combine ASN.1 of two different protocols.

from asn1c.

jeick2008 avatar jeick2008 commented on August 14, 2024

@brchiu
thank you so much

from asn1c.

brchiu avatar brchiu commented on August 14, 2024

@jeick2008, I forgot mentioning that , at application level, if a program indeed has to include the header files generated from two different protocols, thus name clash becomes inevitible. One trick is setting environment variable ASN1C_PREFIX=LTE_ and ASN1C_PREFIX=S1AP_ when create C files, then the types created will be appended with specified prefixes.

from asn1c.

jeick2008 avatar jeick2008 commented on August 14, 2024

@brchiu thank you,

from asn1c.

jeick2008 avatar jeick2008 commented on August 14, 2024

@brchiu @mouse07410 @velichkov
the S1AP message's datastruct in rencently repo is defined as :(for example struct InitiatingMessage->HandoverRequired)

typedef struct S1AP_InitiatingMessage {
    S1AP_ProcedureCode_t     procedureCode;
    S1AP_Criticality_t   criticality;
    struct S1AP_InitiatingMessage__value {
        S1AP_InitiatingMessage__value_PR present;
        union S1AP_InitiatingMessage__S1AP_value_u {      
            S1AP_HandoverRequired_t  HandoverRequired; -------------------------
            S1AP_HandoverRequest_t   HandoverRequest;
            ...........
         } 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;
} S1AP_InitiatingMessage_t;

And two years ago(maybe) ,the data struct was defined as

typedef struct InitiatingMessage {
    ProcedureCode_t  procedureCode;
    Criticality_t    criticality;
    ANY_t    value;  --------------

    /* Context for parsing across buffer boundaries */
    asn_struct_ctx_t _asn_ctx;
} InitiatingMessage_t;

Within old version(two years ago)parsing the InitiatingMessage_t->ANY_t value,

HandoverRequired_t *handover_require = NULL;
ANY_to_type_aper(value, &asn_DEF_HandoverRequired, (void**)&handover_require)
ASN_STRUCT_FREE(asn_DEF_HandoverRequired, handover_require);

In this way, if the procedureCode is concerned, invoking ANY_to_type_aper manually. It is more efficient than the current approach.
Is there any way to make the data struct in asn1c generate code like ANY_t value not choice?
Thank you so much.

from asn1c.

brchiu avatar brchiu commented on August 14, 2024

@jeick2008 , you can do it on your own.

from asn1c.

mouse07410 avatar mouse07410 commented on August 14, 2024

I don't think we can do anything about this - I suggest @jeick2008 to follow what @brchiu recommended.

Closing this issue - if you need more help with it, please feel free to re-open.

from asn1c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.