Commit Graph

194 Commits

Author SHA1 Message Date
Lev Walkin 57cf20953e fix library dependency management 2017-11-21 07:18:17 +00:00
Lev Walkin 4bc278d043 libs fix 2017-11-20 23:10:30 -08:00
Bi-Ruei, Chiu 288e95d5b1 Fix crash when processing S1AP
Ref :

https://github.com/vlm/asn1c/pull/237#issuecomment-342356046
2017-11-13 23:24:40 -08:00
Bi-Ruei, Chiu 0299037ed8 Fix memory leakeage 2017-11-13 22:23:29 -08:00
Lev Walkin 1a49ced90e use hash for name lookup 2017-11-06 00:07:53 -08:00
Bi-Ruei, Chiu e460c3b7a3 Fix error during 'make check' 2017-10-20 17:15:57 -07:00
Bi-Ruei, Chiu 3e2de6960b Solve the problem that information object table with one entry can not be properly handled
E-RABToBeSetupItemBearerSUReqIEs S1AP-PROTOCOL-IES ::= {
    { ID id-E-RABToBeSetupItemBearerSUReq   CRITICALITY reject	TYPE E-RABToBeSetupItemBearerSUReq	PRESENCE mandatory },
    ...
}

result in 'FATAL: Information Object Set E-RABToBeSetupItemBearerSUReqIEs contains no objects at line xxxx'

If it contains more than one entry then there is no problem.

E-RABSetupRequestIEs S1AP-PROTOCOL-IES ::= {
    { ID id-MME-UE-S1AP-ID                  CRITICALITY reject  TYPE MME-UE-S1AP-ID                     PRESENCE mandatory }|
    { ID id-eNB-UE-S1AP-ID                  CRITICALITY reject  TYPE ENB-UE-S1AP-ID                     PRESENCE mandatory }|
    { ID id-uEaggregateMaximumBitrate       CRITICALITY reject  TYPE UEAggregateMaximumBitrate          PRESENCE optional  }|
    { ID id-E-RABToBeSetupListBearerSUReq   CRITICALITY reject  TYPE E-RABToBeSetupListBearerSUReq      PRESENCE mandatory },
    ...
}
2017-10-20 17:15:57 -07:00
Bi-Ruei, Chiu 214c491951 Pass evaluated arguments to members and type references
One of the most tricky ASN.1 excerpt :

E-RABDataForwardingItemIEs S1AP-PROTOCOL-IES ::= {
    { ID id-E-RABDataForwardingItem   CRITICALITY ignore   TYPE E-RABDataForwardingItem PRESENCE mandatory },
    ...
}

E-RABSubjecttoDataForwardingList ::= E-RAB-IE-ContainerList { {E-RABDataForwardingItemIEs} }

E-RAB-IE-ContainerList { S1AP-PROTOCOL-IES : IEsSetParam } ::=
    ProtocolIE-ContainerList { 1, maxnoofE-RABs, {IEsSetParam} }

ProtocolIE-ContainerList {INTEGER : lowerBound, INTEGER : upperBound, S1AP-PROTOCOL-IES : IEsSetParam} ::=
    SEQUENCE (SIZE (lowerBound..upperBound)) OF
    ProtocolIE-SingleContainer {{IEsSetParam}}

ProtocolIE-SingleContainer {S1AP-PROTOCOL-IES : IEsSetParam} ::=
    ProtocolIE-Field {{IEsSetParam}}

ProtocolIE-Field {S1AP-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE {
    id          S1AP-PROTOCOL-IES.&id           ({IEsSetParam}),
    criticality S1AP-PROTOCOL-IES.&criticality  ({IEsSetParam}{@id}),
    value       S1AP-PROTOCOL-IES.&Value        ({IEsSetParam}{@id})
}
2017-10-20 17:15:57 -07:00
Bi-Ruei, Chiu aeff717baf Fix unrecognized value type for reject/ignore
In Module_1,

	Criticality ::= ENUMERATED { reject, ignore, notify }

In Module_2,

	IMPORTS
		Criticality
	FROM Module_1

		someMessage SOME-CLASS ::= {
			CRITICALITY	ignore
		}

This pull request add the capability to resolve 'reject', 'ignore' and 'notify'
in Module_2.
2017-10-20 17:15:57 -07:00
Bi-Ruei, Chiu 50934ba3d4 Fix 'Information Object Set XXX contains no objects' when parsing S1AP's ASN.1
The aforementioned error message displayed during processing the following ASN.1 excerpt.

S1AP-ELEMENTARY-PROCEDURES S1AP-ELEMENTARY-PROCEDURE ::= {
    S1AP-ELEMENTARY-PROCEDURES-CLASS-1 |
    S1AP-ELEMENTARY-PROCEDURES-CLASS-2,
    ...
}

S1AP-ELEMENTARY-PROCEDURES-CLASS-1 S1AP-ELEMENTARY-PROCEDURE ::= {
    handoverPreparation                |
...
    writeReplaceWarning,
    ...,
    uERadioCapabilityMatch             |
....
    uEContextResume
}

S1AP-ELEMENTARY-PROCEDURES-CLASS-2 S1AP-ELEMENTARY-PROCEDURE ::= {
    handoverNotification               |
...
    privateMessage,
    ...,
    downlinkUEAssociatedLPPaTransport  |
...
    mMECPRelocationIndication
}

Because S1AP-ELEMENTARY-PROCEDURES-CLASS-1 and S1AP-ELEMENTARY-PROCEDURES-CLASS-2
are resolved 'after' S1AP-ELEMENTARY-PROCEDURES, so the ioc tables of them are not
available during resolving S1AP-ELEMENTARY-PROCEDURES. So we can not drop the
latter's containedSubtype field at first pass of asn1f_resolve_constraints of fix
process.

We also add second pass of asn1f_resolve_constraints to have a chance to combine
ioc tables of S1AP-ELEMENTARY-PROCEDURES-CLASS-1 and
S1AP-ELEMENTARY-PROCEDURES-CLASS-2.
2017-10-20 17:15:57 -07:00
Lev Walkin 48e82d1f1f removed gcc-7 warnings 2017-10-19 03:07:27 -07:00
Lev Walkin f11ebf8a5b corrected to the best known range (fixed after X.696 Corrigendum 1) 2017-10-11 00:37:27 -07:00
Lev Walkin 2225674d46 cosmetics 2017-10-08 16:33:57 -07:00
Lev Walkin 1f05facc8c ignore garbage in the tests directory 2017-10-08 16:33:21 -07:00
Lev Walkin 4329272a64 for OER use IEEE754 binary32 and binary64 format over the wire 2017-10-05 00:33:32 -07:00
Lev Walkin c44edc0df4 take into account X696 Corrigendum 1 (05/2017) 2017-10-04 03:28:38 -07:00
Lev Walkin 026e21abe1 narrowing to support 32-bit floats 2017-10-04 00:49:01 -07:00
Lev Walkin 42457fe974 remove namespace leak 2017-09-26 18:07:50 -07:00
Lev Walkin f6e04b5522 ignore single value constraint which looks like a (bit)string itself 2017-09-11 06:51:21 -07:00
Lev Walkin 77f65c9759 remove extra log 2017-09-08 00:27:49 -07:00
Lev Walkin be518fac4c ENUMERATION can not be empty 2017-09-07 02:05:28 -07:00
Lev Walkin d523ea454d parse advanced WITH COMPONENTS 2017-09-06 22:15:08 -07:00
Lev Walkin ade508caed avoid generating references to empty maps 2017-08-23 10:25:46 -07:00
Lev Walkin 53a28a26c4 empty information object sets are OK 2017-08-23 09:56:53 -07:00
Lev Walkin d8e07c5f08 parameterized referencing of information object sets 2017-08-23 07:38:30 -07:00
Lev Walkin f75b874253 specialization fix, tested on value specialization 2017-08-23 04:44:18 -07:00
Lev Walkin c0e03b946e introduce namespaces 2017-08-22 01:48:23 -07:00
Lev Walkin d9221847e5 add common lib 2017-08-22 01:44:56 -07:00
Lev Walkin d357f3d53f fix ioc value encoding 2017-08-10 17:40:37 -07:00
Lev Walkin 700df493dd reshuffled the tests layout 2017-08-10 14:59:15 -07:00
Lev Walkin 4dcf8367d9 refactor constraint matrix handling 2017-08-07 20:10:05 -07:00
Lev Walkin 62d95d2ef4 rm warnings 2017-08-06 23:41:11 -07:00
Lev Walkin ea6635bdae better parsing information object class sets 2017-08-06 23:23:04 -07:00
Lev Walkin da997b1ea1 work in 128-bit integer values while compiling 2017-08-04 01:38:41 -07:00
Bi-Ruei, Chiu 1fa31c9e3e Simplify the logic of accessing codec function for specific TYPE 2017-08-02 14:06:07 -07:00
Lev Walkin ed1ce785bb oer constraints (incomplete) 2017-08-02 13:32:23 -07:00
Lev Walkin a28cbb9f66 add constraint debug 2017-08-02 13:32:23 -07:00
Lev Walkin dbdc06725f clarification that EXCEPT is ignored in both PER and OER 2017-08-02 13:32:23 -07:00
Lev Walkin 8b6a8005e0 account for a wider structure 2017-08-02 13:32:21 -07:00
Lev Walkin 98eabc1c82 a pass over OER constraints 2017-08-02 13:32:18 -07:00
Lev Walkin af8595ad09 remove comment 2017-06-27 08:22:30 -07:00
Bi-Ruei, Chiu 80fd3065f4 Merge PR99 and its fixes to support parsing Information Object and Information Object Set
This is a collection of works :

1. Based on @zhanglei002's pull request 99.

2. A fix by @AuthenticEshkinKot and merged by @mouse07410 at
   commit 2c8d366bbe1fc4e4c041e9b0eb9779f8a42d754b of https://github.com/mouse07410/asn1c
   to support parsing of Information Object and Information Object Set

3. A fix by @Uri Blumenthal in asn1fix_derefv.c at :
   commit ec0ade4f87c807e763e3f35fc5466adb6dda3473 of https://github.com/mouse07410/asn1c
   to solve crash on asn1p_value_free().

4. My pull request 18 to @mouse07410's https://github.com/mouse07410/asn1c to solve
   problems found during parsing ASN.1 modules of S1AP, RANAP and J2735-201603.

5. My pull request 22 to @mouse07410's https://github.com/mouse07410/asn1c to solve issue 147
   and to solve the problem during parsing ASN.1 module of NBAP.

6. My pull request 23 to @mouse07410's https://github.com/mouse07410/asn1c to fix memory leakage
   introduced in aforementioned commits.
   Most code changes are the same as pull request 153 to this repository.

7. A fix of my bug in item 6 which result asn1c crash, fixed by @mouse07410.
2017-05-07 22:20:30 +08:00
Bi-Ruei, Chiu 3dcf05bbb0 Fix some memory leakage found 2017-05-05 15:03:32 +08:00
Vasil Velichkov e318759ef2 Add code coverage using lcov and gcov
To generate the code coverage report you need gcov and lcov installed
and then execute

 ./configure --enable-code-coverage
 make check-code-coverage

 Writing directory view page.
 Overall coverage rate:
   lines......: 76.5% (10519 of 13759 lines)
   functions..: 85.5% (491 of 574 functions)
   branches...: 57.5% (7040 of 12250 branches)
 file:///home/user/asn1c/asn1c-0.9.28-coverage/index.html

Open the index.html with a web browser
2017-03-26 04:42:26 -07:00
Markus Elfring f3d1861b94 Bug #86: Deletion of unnecessary checks before calls of the function "free"
The function "free" is documented in the way that no action shall occur for
a passed null pointer. It is therefore not needed that a function caller
repeats a corresponding check.
http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first

This issue was fixed by using the software "Coccinelle 1.0.4".

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2016-03-15 08:35:24 +01:00
Lev Walkin 55982b820a undo skeletons hierarchy detection 2016-03-14 03:56:16 -07:00
Lev Walkin 9ee77995ba more explicit test spec 2016-03-14 03:46:16 -07:00
Lev Walkin 9e66d16ab3 infer skeletons level 2016-03-14 03:36:35 -07:00
Lev Walkin 819c832b86 go one dir deeper, still, if possible 2016-03-14 03:24:28 -07:00
Lev Walkin 04532ccc2a another attempt at travis debug 2016-03-14 03:09:00 -07:00