Commit 3aebdf81 authored by Yann Garcia's avatar Yann Garcia
Browse files

Merge branch 'TTF_T05x_wo_asn1c' into 'TTF_T05x'

Remove asn1c support

See merge request !12
parents ea297f90 bcac6289
Loading
Loading
Loading
Loading
+62 −36
Original line number Diff line number Diff line
@@ -12,20 +12,14 @@ ifeq (,$(TOPDIR))
 TOPDIR := .
endif

ifeq (,$(TTCN3_DIR))
 $(error TTCN3_DIR shall be defined in config.mk)
ifeq (,$(TOP_DIR))
 TOP_DIR := .
endif

ifeq (,$(ASN1C))
 ifneq (,$(ASN1C_PATH))
  ASN1C := $(ASN1C_PATH)/asn1c/.libs/asn1c -S $(ASN1C_PATH)/skeletons
 else
  ASN1C := asn1c
 endif
ifeq (,$(TTCN3_DIR))
 $(error TTCN3_DIR shall be defined in config.mk)
endif

export ASN1C_PATH

first: all

define IncludeModule
@@ -56,8 +50,8 @@ endif

libs += -lssl -lcrypto -lxml2 -ljsoncpp -lzip

bindir := $(TOPDIR)/bin
outdir := $(TOPDIR)/build/$(ATS)
bindir := $(TOPDIR)/bin

$(eval $(call IncludeModule, $(TOPDIR)/ttcn/$(ATS)))

@@ -93,9 +87,9 @@ cc_objects := $(patsubst %.cc, $(outdir)/%.o, $(cc_sources))

outbin = $(bindir)/$(ATS)$(SUB_ATS)$(EXE)

.PHONY: all FORCE echo postamble
.PHONY: all FORCE echo

all: $(bindir) $(outdir) $(outbin) postamble
all: $(bindir) $(outdir) $(outbin) 

echo_sources:
	@echo -e "$(addsuffix \n,$(all_sources))"
@@ -109,8 +103,7 @@ echo: echo_sources
	@echo -e "defines: $(addsuffix \n, $(defines))"

clean:
	rm -f $(outbin) $(gen_objects) $(gen_sources) $(gen_headers) $(cc_objects) $(outdir)/.generate $(outdir)/../libItsAsn.so
#	rm -f $(outdir)/asn1/*.so $(outdir)/asn1/*.o $(outdir)/asn1/*.c $(outdir)/asn1/*.h $(outdir)/asn1/Makefile.am.libasncodec
	rm -f $(outbin) $(gen_objects) $(gen_sources) $(gen_headers) $(cc_objects) $(outdir)/.generate

regen: force_regen $(outdir)/.generate
force_regen:
@@ -128,18 +121,18 @@ t3d: all
	@echo -e "TTCN-3 doc generation done..."
	@echo -e "Output file is located here: $(outdir)/t3d.out"

$(outdir) $(outdir)/asn1 $(bindir):
$(outdir) $(outdir)/asn1 $(bindir):  $(TOP_DIR)/./build/asn1/ISO_TS_17419/CITSapplMgmtIDs.asn $(TOP_DIR)/./build/asn1/ISO_TS_17419/CITSapplMgmtIDs.asn $(TOP_DIR)/./build/asn1/ISO_TS_19091/ISO-TS-19091-addgrp-C-2018-patched.asn $(TOP_DIR)/./build/asn1/ISO_TS_17419/CITSdataDictionary1.asn $(TOP_DIR)/./build/asn1/ISO_TS_17419/CITSdataDictionary2.asn
	mkdir -p $@

$(outbin): $(outdir)/asn1/libItsAsn.a $(gen_objects) $(cc_objects) 
	g++ -g -O0 -std=c++17 -o $@ $(LDFLAGS) $(gen_objects) $(cc_objects) $(outdir)/asn1/libItsAsn.a $(libs)
$(outbin): $(gen_objects) $(cc_objects) 
	g++ -g -O0 -std=c++17 -o $@ $(LDFLAGS) $(gen_objects) $(cc_objects) $(libs)

$(gen_objects) :%.o :%.cc
	g++ -g -O0 -std=c++17 -c $(addprefix -D, $(defines)) $(addprefix -I, $(includes)) -o $@ $<
	g++ -g -O0 -std=c++17 -Wno-long-long -flarge-source-files -Wmisleading-indentation -fPIC -c $(addprefix -D, $(defines)) $(addprefix -I, $(includes)) -o $@ $<

$(cc_objects) : $(outdir)/%.o : %.cc
	mkdir -p $(dir $@)
	g++ -g -O0 -std=c++17 -c $(addprefix -D, $(defines)) $(addprefix -I, $(includes)) -o $@ $<
	g++ -g -O0 -std=c++17 -Wno-long-long -flarge-source-files -Wmisleading-indentation -fPIC -c $(addprefix -D, $(defines)) $(addprefix -I, $(includes)) -o $@ $<

#$(gen_sources):
#	$(TTCN3_DIR)/bin/compiler -n -e -L -R -U none -o $(outdir) $(tt_sources)
@@ -150,25 +143,58 @@ $(outdir)/.generate: Makefile $(tt_sources)
	$(TTCN3_DIR)/bin/compiler $(TTCN3_COMPILER_OPTIONS) -o  $(outdir) $(tt_sources)
	touch $@

$(bindir)/libItsAsn.so: $(outdir)/asn1/libItsAsn.so
	cp -f $< $@

$(outdir)/asn1/libItsAsn.a: $(asn_sources) $(asn1_sources) libasn1.mk Makefile
	mkdir -p $(outdir)/asn1
	echo TOP_DIR   := ../../..                                               >$(outdir)/asn1/Makefile
	echo ASN_PDU   := $(pdu)                                                >>$(outdir)/asn1/Makefile
	echo ASN_FILES := \\                                                    >>$(outdir)/asn1/Makefile
	for n in $(asn_sources) $(asn1_sources); do echo "        $$n \\"; done >>$(outdir)/asn1/Makefile
	echo                                                                    >>$(outdir)/asn1/Makefile
	cat libasn1.mk                                                          >>$(outdir)/asn1/Makefile
	$(MAKE) -C $(outdir)/asn1
	touch $@

$(foreach S, $(ttcn_sources),  $(eval $(outdir)/$(notdir $(patsubst %.ttcn, %.cc,  $(S))): $(S)))
$(foreach S, $(ttcn3_sources), $(eval $(outdir)/$(notdir $(patsubst %.ttcn3, %.cc, $(S))): $(S)))
$(foreach S, $(asn_sources),   $(eval $(outdir)/$(notdir $(patsubst %.asn, %.cc,   $(S))): $(S)))
$(foreach S, $(asn1_sources),  $(eval $(outdir)/$(notdir $(patsubst %.asn1, %.cc,  $(S))): $(S)))

$(asn_sources) $(asn1_sources):
#$(asn_sources) $(asn1_sources):

$(TOP_DIR)/./build/asn1/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn:
	mkdir -p "$(dir $@)"
	curl 'https://standards.iso.org/iso/14816/ISO14816%20ASN.1%20repository/ISO14816_AVIAEINumberingAndDataStructures.asn' | \
	sed -e 's/IssuerIdentifier/AVIAEIIssuerIdentifier/g' > "$@"

#$(TOP_DIR)/./build/asn1/ISO_TS_14906/EfcDsrcApplication.asn:
#	mkdir -p "$(dir $@)"
#	curl -o "$@" 'https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcApplicationv6.asn'

#$(TOP_DIR)/./build/asn1/ISO_TS_14906/EfcDsrcGeneric.asn:
#	mkdir -p "$(dir $@)
#	curl -o "$@" 'https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcGenericv7.asn'

#$(TOP_DIR)/./build/asn1/ISO_TS_ISO17573_3/EfcDataDictionary.asn:
#	mkdir -p "$(dir $@)
#	curl -o "$@" 'https://standards.iso.org/iso/17573/-3/ed-1/en/ISO17573-3(2023)EfcDataDictionaryV1.3.asn'

$(TOP_DIR)/./build/asn1/ISO_TS_17419/CITSapplMgmtIDs.asn:
	mkdir -p "$(dir $@)"
	curl -o "$@" 'https://standards.iso.org/iso/ts/17419/TS%2017419%20ASN.1%20repository/TS17419_2014_CITSapplMgmtIDs.asn'

$(TOP_DIR)/./build/asn1/ISO_TS_19091/ISO-TS-19091-addgrp-C-2018-patched.asn:
	mkdir -p "$(dir $@)"
	curl 'https://standards.iso.org/iso/ts/19091/ed-2/en/ISO-TS-19091-addgrp-C-2018.asn' | \
	sed -e 's/\bHeadingConfidence\b/HeadingConfidenceDSRC/g' \
        -e 's/\bSpeedConfidence\b/SpeedConfidenceDSRC/g' \
        -e 's/\bHeading\b/HeadingDSRC/g' > "$@"

$(TOP_DIR)/./build/asn1/ISO_TS_17419/CITSdataDictionary1.asn:
	mkdir -p "$(dir $@)"
	curl -o "$@" 'https://standards.iso.org/iso/17419/ed-1/en/17419.1.asn'

$(TOP_DIR)/./build/asn1/ISO_TS_17419/CITSdataDictionary2.asn:
	mkdir -p "$(dir $@)"
	curl -o "$@" 'https://standards.iso.org/iso/17419/ed-1/en/17419.2.asn'

#$(TOP_DIR)/./build/asn1/ISO_TS_19321/IVI.asn:
#	mkdir -p "$(dir $@)"
#	curl -o "$@" 'https://standards.iso.org/iso/ts/19321/ed-3/en/ISO_CD%20TS%2019321%20ed.3%20-%20id.82956%20Approval%20ISO19321IVIv3.1.asn'

#$(TOP_DIR)/./build/asn1/ISO_TS_19321/IVI-IS.asn:
#	mkdir -p "$(dir $@)"
#	curl -o "$@" 'https://standards.iso.org/iso/ts/19321/ed-3/en/ISO_CD%20TS%2019321%20ed.3%20-%20id.82956%20Approval%20ISO19321IVI-IS.asn'

#$(TOP_DIR)/build/asn1/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn:
#	mkdir -p "$(dir $@)"
#	curl -o "$@" 'https://standards.iso.org/iso/24534/-3/ISO%2024534-3%20ASN.1%20repository/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule_ForBallot.asn'
postamble:
+10 −7
Original line number Diff line number Diff line
@@ -5,11 +5,15 @@

This repositories contains the test specifications and test adapter code for ETSI ITS protocols testing, Release 1.
ETSI ITS protocols project supports:
- ETSI TS 103 900 v2.1.1: "Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Part 2: Specification of Cooperative Awareness Basic Service"
- ETSI TS 103 831 v2.1.1: "Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Part 3: Specifications of Decentralized Environmental Notification Basic Service" 
- ETSI TS 103 301 v2.1.1: "Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Facilities layer protocols and communication requirements for infrastructure services"
- ETSI TS 103 900 v2.1.1: "Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Part 2: Specification of Cooperative Awareness Basic Service; Release 2"
- ETSI TS 103 831 v2.1.1: "Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Part 3: Specifications of Decentralized Environmental Notification Basic Service; Release 2" 
- ETSI TS 103 301 v2.1.1: "Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Facilities layer protocols and communication requirements for infrastructure services; Release 2"
- ETSI TS 103 301 v1.3.1: "ntelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Facilities layer protocols and communication requirements for infrastructure services"
- ETSI TS 103 882 V2.1.1: "Intelligent Transport Systems (ITS); Automated Vehicle Marshalling (AVM); Release 2"
- ETSI TS 104 072 V2.1.1: "Intelligent Transport Systems (ITS); Facilities Layer; Parking Information Service; Release 2"
- ETSI TS 104 091 v2.1.1: "Intelligent Transport Systems (ITS); Facilities Layer; Services Announcement (SA) Service; Release 2"
- EN 302 636-5-1 V1.4.1: "Intelligent Transport Systems (ITS); Vehicular Communications; GeoNetworking; Part 5: Transport Protocols; Sub-part 1: Basic Transport Protocol"
- ETSI TS 103 836-4-1 v2.1.1: "Intelligent Transport Systems (ITS); Vehicular Communications; GeoNetworking; Part 4: Geographical addressing and forwarding for point-to-point and point-to-multipoint communications; Sub-part 1: Media-Independent Functionality"
- ETSI TS 103 836-4-1 v2.1.1: "Intelligent Transport Systems (ITS); Vehicular Communications; GeoNetworking; Part 4: Geographical addressing and forwarding for point-to-point and point-to-multipoint communications; Sub-part 1: Media-Independent Functionality; Release 2"

In addition, it also support ITS Security as define by:
- ETSI TS 103 940 v2.1.1: "Intelligent Transport Systems (ITS); Security; Security Architecture and Management".
@@ -30,7 +34,7 @@ See the attached LICENSE file or visit https://forge.etsi.org/legal-matters.
## STFs/TTFs

The following STFs were or are currently involved in the evolutions of the ETSI ITS protocols project:
- STF 405, STF 422, STF 424, STF 455, STF 462, STF 481, STF 484, STF 507, STF 517, STF 525, STF 538, STF 545, STF 594, TTF T002, TTF T011, TTF T024, TTF T025, TTF T030, TTF T036
- STF 405, STF 422, STF 424, STF 455, STF 462, STF 481, STF 484, STF 507, STF 517, STF 525, STF 538, STF 545, STF 594, TTF T002, TTF T011, TTF T024, TTF T025, TTF T030, TTF T036, TTF T042, TTF T051, TTF T052, TTF T053


# Installation
@@ -289,13 +293,12 @@ Procedure:
    - $HOME/dev
    - $HOME/lib
- In $HOME/frameworks, build the following package:
    - asn1c, according the procedure specified [here](https://github.com/fillabs/asn1c.git)
    - TITAN, according the procedure specified [here](https://github.com/eclipse/titan.core)

- Clone the ETSI ITS protocols project into $HOME/dev folder

```sh
$ git clone --recurse-submodules --branch=TTF_T036 https://forge.etsi.org/gitlab/ITS/TS.ITS.git TS.ITS.TTF_T036
$ git clone --recurse-submodules --branch=TTF_T05x https://forge.etsi.org/gitlab/ITS/TS.ITS.git TS.ITS.TTF_T05x
```

- Execute the script install.sh
+12 −12
Original line number Diff line number Diff line
@@ -1078,8 +1078,8 @@
    <FileResource projectRelativePath="bin/RTCMEM_PDU_Descriptions.o" relativeURI="bin/RTCMEM_PDU_Descriptions.o"/>
    <FileResource projectRelativePath="bin/RtcmemCodec.d" relativeURI="bin/RtcmemCodec.d"/>
    <FileResource projectRelativePath="bin/RtcmemCodec.o" relativeURI="bin/RtcmemCodec.o"/>
    <FileResource projectRelativePath="bin/RtcmemLayer.d" relativeURI="bin/RtcmemLayer.d"/>
    <FileResource projectRelativePath="bin/RtcmemLayer.o" relativeURI="bin/RtcmemLayer.o"/>
    <FileResource projectRelativePath="bin/rtcmem_layer.d" relativeURI="bin/rtcmem_layer.d"/>
    <FileResource projectRelativePath="bin/rtcmem_layer.o" relativeURI="bin/rtcmem_layer.o"/>
    <FileResource projectRelativePath="bin/RtcmemPort.d" relativeURI="bin/RtcmemPort.d"/>
    <FileResource projectRelativePath="bin/RtcmemPort.o" relativeURI="bin/RtcmemPort.o"/>
    <FileResource projectRelativePath="bin/SPATEM_PDU_Descriptions.cc" relativeURI="bin/SPATEM_PDU_Descriptions.cc"/>
@@ -1096,8 +1096,8 @@
    <FileResource projectRelativePath="bin/SSEM_PDU_Descriptions.o" relativeURI="bin/SSEM_PDU_Descriptions.o"/>
    <FileResource projectRelativePath="bin/SremCodec.d" relativeURI="bin/SremCodec.d"/>
    <FileResource projectRelativePath="bin/SremCodec.o" relativeURI="bin/SremCodec.o"/>
    <FileResource projectRelativePath="bin/SremSsemLayer.d" relativeURI="bin/SremSsemLayer.d"/>
    <FileResource projectRelativePath="bin/SremSsemLayer.o" relativeURI="bin/SremSsemLayer.o"/>
    <FileResource projectRelativePath="bin/srem_ssem_layer.d" relativeURI="bin/srem_ssem_layer.d"/>
    <FileResource projectRelativePath="bin/srem_ssem_layer.o" relativeURI="bin/srem_ssem_layer.o"/>
    <FileResource projectRelativePath="bin/SremSsemPort.d" relativeURI="bin/SremSsemPort.d"/>
    <FileResource projectRelativePath="bin/SremSsemPort.o" relativeURI="bin/SremSsemPort.o"/>
    <FileResource projectRelativePath="bin/SsemCodec.d" relativeURI="bin/SsemCodec.d"/>
@@ -1522,10 +1522,10 @@
    <FileResource projectRelativePath="ccsrc/Protocols/RawSocket/module.mk" relativeURI="ccsrc/Protocols/RawSocket/module.mk"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/RtcmemCodec.cc" relativeURI="ccsrc/Protocols/Rtcmem/RtcmemCodec.cc"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/RtcmemCodec.hh" relativeURI="ccsrc/Protocols/Rtcmem/RtcmemCodec.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/RtcmemLayer.cc" relativeURI="ccsrc/Protocols/Rtcmem/RtcmemLayer.cc"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/RtcmemLayer.hh" relativeURI="ccsrc/Protocols/Rtcmem/RtcmemLayer.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/RtcmemLayerFactory.hh" relativeURI="ccsrc/Protocols/Rtcmem/RtcmemLayerFactory.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/RtcmemTypes.hh" relativeURI="ccsrc/Protocols/Rtcmem/RtcmemTypes.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/rtcmem_layer.cc" relativeURI="ccsrc/Protocols/Rtcmem/rtcmem_layer.cc"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/rtcmem_layer.hh" relativeURI="ccsrc/Protocols/Rtcmem/rtcmem_layer.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/rtcmem_layer_factory.hh" relativeURI="ccsrc/Protocols/Rtcmem/rtcmem_layer_factory.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/rtcmem_types.hh" relativeURI="ccsrc/Protocols/Rtcmem/rtcmem_types.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Rtcmem/module.mk" relativeURI="ccsrc/Protocols/Rtcmem/module.mk"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Security/certificates_loader.cc" relativeURI="ccsrc/Protocols/Security/certificates_loader.cc"/>
    <FileResource projectRelativePath="ccsrc/Protocols/Security/certificates_loader.hh" relativeURI="ccsrc/Protocols/Security/certificates_loader.hh"/>
@@ -1583,10 +1583,10 @@
    <FileResource projectRelativePath="ccsrc/Protocols/Security/sha384.hh" relativeURI="ccsrc/Protocols/Security/sha384.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/SremCodec.cc" relativeURI="ccsrc/Protocols/SremSsem/SremCodec.cc"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/SremCodec.hh" relativeURI="ccsrc/Protocols/SremSsem/SremCodec.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/SremSsemLayer.cc" relativeURI="ccsrc/Protocols/SremSsem/SremSsemLayer.cc"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/SremSsemLayer.hh" relativeURI="ccsrc/Protocols/SremSsem/SremSsemLayer.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/SremSsemLayerFactory.hh" relativeURI="ccsrc/Protocols/SremSsem/SremSsemLayerFactory.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/SremSsemTypes.hh" relativeURI="ccsrc/Protocols/SremSsem/SremSsemTypes.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/srem_ssem_layer.cc" relativeURI="ccsrc/Protocols/SremSsem/srem_ssem_layer.cc"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/srem_ssem_layer.hh" relativeURI="ccsrc/Protocols/SremSsem/srem_ssem_layer.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/srem_ssem_layer_factory.hh" relativeURI="ccsrc/Protocols/SremSsem/srem_ssem_layer_factory.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/srem_ssem_types.hh" relativeURI="ccsrc/Protocols/SremSsem/srem_ssem_types.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/SsemCodec.cc" relativeURI="ccsrc/Protocols/SremSsem/SsemCodec.cc"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/SsemCodec.hh" relativeURI="ccsrc/Protocols/SremSsem/SsemCodec.hh"/>
    <FileResource projectRelativePath="ccsrc/Protocols/SremSsem/module.mk" relativeURI="ccsrc/Protocols/SremSsem/module.mk"/>

ccsrc/Asn1c/asn1_recoder.cc

deleted100644 → 0
+0 −51
Original line number Diff line number Diff line
#include <asn1/asn_application.h>

#include "asn1_recoder.hh"

#include <TTCN3.hh>

extern "C" {
static int asn1c_collect_encoded_data(const void *buffer, size_t size, void *application_specific_key) {
  TTCN_Buffer *tb = (TTCN_Buffer *)application_specific_key;
  tb->put_s(size, (unsigned char *)buffer);
  return 0;
}
}

int asn1_recoder::recode(const asn_TYPE_descriptor_s &td, int from, int to, TTCN_Buffer &buf) {
  int            rc  = -1;
  void *         ptr = NULL;
  asn_dec_rval_t rc_d;
  rc_d = asn_decode(NULL, (asn_transfer_syntax)from, (asn_TYPE_descriptor_s *)&td, &ptr, buf.get_data(), buf.get_len());
  if (rc_d.code == RC_OK) {
    // Encode as PER
    asn_enc_rval_t rc_e;
    buf.clear();
    rc_e = asn_encode(NULL, (asn_transfer_syntax)to, (asn_TYPE_descriptor_s *)&td, ptr, asn1c_collect_encoded_data, &buf);
    rc   = rc_e.encoded;
  }
  if (ptr) {
    ASN_STRUCT_FREE(td, ptr);
  }
  return rc;
}

int asn1_recoder::ber2per(const asn_TYPE_descriptor_s &td, TTCN_Buffer &buf) 
{
  return recode(td, (int)ATS_BER, (int)ATS_UNALIGNED_CANONICAL_PER, buf);
}

int asn1_recoder::per2ber(const asn_TYPE_descriptor_s &td, TTCN_Buffer &buf) 
{
  return recode(td, (int)ATS_UNALIGNED_BASIC_PER, (int)ATS_DER, buf);
}

int asn1_recoder::ber2oer(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
  return recode(td, (int)ATS_BER, (int)ATS_CANONICAL_OER, buf);
}

int asn1_recoder::oer2ber(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
  return recode(td, (int)ATS_BASIC_OER, (int)ATS_BER, buf);
}

ccsrc/Asn1c/asn1_recoder.hh

deleted100644 → 0
+0 −29
Original line number Diff line number Diff line
/*!
 * \file      asn1_recode_per.hh
 * \brief     Header file ASN.1 PER codec based on asn1c external tool.
 * \author    ETSI STF525
 * \copyright ETSI Copyright Notification
 *            No part may be reproduced except as authorized by written permission.
 *            The copyright and the foregoing restriction extend to reproduction in all media.
 *            All rights reserved.
 * \version   0.1
 */
#pragma once

class OCTETSTRING;           //! Forward declaration of TITAN class
class CHARSTRING;            //! Forward declaration of TITAN class
class BITSTRING;             //! Forward declaration of TITAN class
class TTCN_Buffer;           //! Forward declaration of TITAN class
class TTCN_EncDec;           //! Forward declaration of TITAN class
class TTCN_Typedescriptor_t; //! Forward declaration of TITAN class

struct asn_TYPE_descriptor_s; //! Forward declaration of asn1c class

class asn1_recoder {
protected:
  int ber2per(const asn_TYPE_descriptor_s &td, TTCN_Buffer &buf);
  int per2ber(const asn_TYPE_descriptor_s &td, TTCN_Buffer &buf);
  int ber2oer(const asn_TYPE_descriptor_s &td, TTCN_Buffer &buf);
  int oer2ber(const asn_TYPE_descriptor_s &td, TTCN_Buffer &buf);
  int recode(const asn_TYPE_descriptor_s &td, int from, int to, TTCN_Buffer &buf);
}; // End of class asn1_recode_per
Loading