diff --git a/.gitmodules b/.gitmodules
index f269600cb52434900d03db5d95a5e1290d36275c..68eb61fa584cb0c72f48d6a947b7a5643b66765d 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -14,3 +14,7 @@
path = ttcn/LibIms
url = https://forge.etsi.org/rep/LIBS/LibIms.git
branch = TTF006
+[submodule "titan-test-system-framework"]
+ path = titan-test-system-framework
+ url = https://labs.etsi.org/rep/cti-tools/titan-test-system-framework.git
+ branch = devel
diff --git a/LICENSE b/LICENSE
index 2df8cd5739a1fe4d30ffbd6173ee851da799218a..c7a6ba06afc8440ff3742ee50286ada519c15dec 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2022 ETSI
+Copyright 2019 ETSI
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..451a6c31e5c48f41758472c530ae4eb392f23762
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,120 @@
+-include config.mk
+
+ifeq (,$(ATS))
+ $(error ATS shall be defined)
+endif
+
+ifeq (,$(TOPDIR))
+ TOPDIR := .
+endif
+
+ifeq (,$(TTCN3_DIR))
+ $(error TTCN3_DIR shall be defined in config.mk)
+endif
+first: all
+
+define IncludeModule
+undefine sources
+undefine modules
+undefine includes
+include $(1)/module.mk
+$$(foreach S, $$(sources), $$(eval all_sources += $(1)/$$(S)))
+$$(foreach I, $$(includes), $$(eval all_includes += $(1)/$$(I)))
+$$(foreach M, $$(modules), $$(eval $$(call IncludeModule, $$(if $$(filter /%, $$(M)), $$(M), $(1)/$$(M)))))
+endef
+
+all_includes := $(TTCN3_DIR)/include $(TTCN3_DIR)/src /usr/include/libxml2
+defines += TITAN_RUNTIME_2 _NO_SOFTLINKS_ $(ATS) AS_USE_SSL
+libs += $(TTCN3_DIR)/lib/libttcn3-rt2-parallel.a -lstdc++fs
+
+ifeq (Windows_NT,$(OS))
+# Silence linker warnings.
+LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
+defines += WIN32
+libs += $(patsubst %, -L%/lib, $(OPENSSL_DIR))
+all_includes += $(addsuffix /include, $(OPENSSL_DIR))
+libs += $(WPCAP_DLL_PATH)
+else
+defines += LINUX
+libs += -lpcap -lrt -lpthread
+endif
+
+libs += -lssl -lcrypto -lxml2 -L$(OSIP_LIB) -losipparser2
+
+$(eval $(call IncludeModule, $(TOPDIR)/ttcn/$(ATS)))
+
+outdir := $(TOPDIR)/build/$(ATS)
+bindir := $(TOPDIR)/bin
+
+sources := $(sort $(all_sources))
+includes := $(outdir) $(outdir)/.. $(all_includes) $(NPCAP_INCLUDE) $(OSIP_INCLUDE)
+
+ifeq (Windows_NT,$(OS))
+ EXE=.exe
+endif
+
+ttcn_sources := $(filter %.ttcn , $(sources))
+ttcn3_sources := $(filter %.ttcn3, $(sources))
+xsd_sources := $(filter %.xsd, $(sources))
+
+tt_sources := $(ttcn_sources) $(ttcn3_sources) $(xsd_sources)
+cc_sources := $(filter %.cc, $(sources))
+
+gen_ttcn_sources := $(addprefix $(outdir)/, $(notdir $(patsubst %.ttcn, %.cc, $(ttcn_sources))))
+gen_ttcn_headers := $(addprefix $(outdir)/, $(notdir $(patsubst %.ttcn, %.hh, $(ttcn_sources))))
+gen_ttcn3_sources := $(addprefix $(outdir)/, $(notdir $(patsubst %.ttcn3, %.cc, $(ttcn3_sources))))
+gen_ttcn3_headers := $(addprefix $(outdir)/, $(notdir $(patsubst %.ttcn3, %.hh, $(ttcn3_sources))))
+gen_xsd_sources := $(addprefix $(outdir)/, $(notdir $(patsubst %.xsd, %.cc, $(xsd_sources))))
+gen_xsd_headers := $(addprefix $(outdir)/, $(notdir $(patsubst %.xsd, %.hh, $(xsd_sources))))
+
+gen_sources := $(gen_ttcn_sources) $(gen_ttcn3_sources) $(gen_xsd_sources)
+gen_headers := $(gen_ttcn_headers) $(gen_ttcn3_headers) $(gen_xsd_headers)
+
+gen_objects := $(patsubst %.cc, %.o, $(gen_sources))
+cc_objects := $(patsubst %.cc, $(outdir)/%.o, $(cc_sources))
+
+.PHONY: all FORCE echo
+
+all: $(bindir) $(outdir) $(bindir)/$(ATS)$(EXE)
+
+echo_sources:
+ @echo -e "$(addsuffix \n,$(all_sources))"
+
+echo: echo_sources
+ @echo -e "sources:\n $(addsuffix \n, $(sources))"
+ @echo -e "gen_sources:\n $(addsuffix \n, $(gen_sources))"
+ @echo -e "gen_objects:\n $(addsuffix \n, $(gen_objects))"
+ @echo -e "cc_objects:\n $(addsuffix \n, $(cc_objects))"
+ @echo -e "includes:\n $(addsuffix \n, $(includes))"
+ @echo -e "defines: $(addsuffix \n, $(defines))"
+
+clean:
+ rm -f $(outdir)/$(ATS)$(EXE) $(gen_objects) $(gen_sources) $(gen_headers) $(cc_objects) $(outdir)/.generate
+
+regen: force_regen $(outdir)/.generate
+force_regen:
+ rm -f $(outdir)/.generate
+
+$(outdir) $(bindir):
+ mkdir -p $@
+
+$(bindir)/$(ATS)$(EXE): $(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 $@ $<
+
+$(cc_objects) : $(outdir)/%.o : %.cc
+ mkdir -p $(dir $@)
+ g++ -g -O0 -std=c++17 -c $(addprefix -D, $(defines)) $(addprefix -I, $(includes)) -o $@ $<
+
+$(gen_sources): $(outdir)/.generate
+
+$(outdir)/.generate: Makefile $(tt_sources)
+ $(TTCN3_DIR)/bin/compiler $(TTCN3_COMPILER_OPTIONS) -o $(outdir) $(tt_sources)
+ 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, $(xsd_sources), $(eval $(outdir)/$(notdir $(patsubst %.xsd, %.cc, $(S))): $(S)))
+
diff --git a/README.md b/README.md
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..aad3949abfd8b173da6714135c1f48cf898b58c8 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,334 @@
+# Voice and Video over LTE/Emergency VoLTE Interoperability Tests
+
+## Introduction
+This repositories contains the test specifications and test adapter code
+for interoprability tests to ETSI TS 1037 950-2 (Core Network and Interoperability Testing (INT); Network Interoperability Test Description for emergency services over VoLTE; (3GPP™ Release 15); Part 2: Test Descriptions).
+
+## Contact information
+Email at cti_support at etsi dot org
+
+## License
+The content of this repository and the files contained are released under the BSD-3-Clause License.
+See the attached LICENSE file or visit
+https://forge.etsi.org/legal-matters
+
+## Standard links
+- ETSI TS 103 795-1: "Core Network and Interoperability Testing (INT); Network Interoperability Test Description for emergency services over VoLTE; (3GPP™ Release 15); Part 1: Test Purposes (TP)"
+- ETSI TS 124 229: "Digital cellular telecommunications system (Phase 2+) (GSM); Universal Mobile Telecommunications System (UMTS); LTE; 5G; IP multimedia call control protocol based on Session Initiation Protocol (SIP) and Session Description Protocol (SDP); Stage 3 (3GPP TS 24.229 Release 15)"
+- ETSI TS 129 165: "Digital cellular telecommunications system (Phase 2+) (GSM); Universal Mobile Telecommunications System (UMTS); LTE; 5G; Inter-IMS Network to Network Interface (NNI) (3GPP TS 29.165 Release 15)"
+- ETSI TS 129 228: "Digital cellular telecommunications system (Phase 2+) (GSM); Universal Mobile Telecommunications System (UMTS); LTE; IP Multimedia (IM) Subsystem Cx and Dx Interfaces; Signalling flows and message contents (3GPP TS 29.228 Release 15)".
+- ETSI TS 129 229: "Digital cellular telecommunications system (Phase 2+) (GSM); Universal Mobile Telecommunications System (UMTS); LTE; Cx and Dx interfaces based on the Diameter protocol; Protocol details (3GPP TS 29.229 Release 15)"
+
+## RFC links
+-
+
+NOTE All draft can be found in the 'IETF XML Registry', accessible [here](https://www.iana.org/assignments/xml-registry/xml-registry.xhtml)
+
+# Installation
+
+The ETSI Emergency VoLTE Interoperability Tests project builds and tests regularly on the following platforms:
+
+ - Linux (Ubuntu)
+
+Note: The [OpenSSL](https://www.openssl.org) version > 1.1.x is also required.
+
+## How to do it?
+
+They are two different methods:
+- Using [Vagrant](https://www.vagrantup.com/)
+- Using [Docker](https://www.docker.com/)
+
+How to choose one of these methods is depending of your host system.
+
+NOTE: In all case, if you want to setup an continuous integration process (e.g. Jenkins), Docker is the best choice.
+
+
+### The host system is Windows
+The both methods require a virtual machine. You can use either VirtualBox or WMware.
+In this case, the easiest way is to use Vagrant.
+
+
+### The host system is Linux
+Vagrant requires a virtual machine. You can use either VirtualBox or WMware.
+Docker does not need a virtual machine, so it is the more efficant way.
+
+
+## Using TITAN compiler on a Docker image
+
+In this configuration, TITAN compiler is located on a Docker image and the sources and the outputs are located on the host.
+
+Pre-requisites on your host machine:
+- Install Docker
+
+Procedure on the host machine:
+- Open a Terminal
+- Clone the ETSI Emergency VoLTE Interoperability Test System
+- From the ETSI Emergency VoLTE Interoperability Test System root directory, build the Docker image executing the following commands:
+
+```sh
+$ cd ./virtualization/docker
+$ docker build --no-cache --tag alpine-emergency-iop -f Dockerfile --force-rm .
+$ docker images
+```
+
+To build the Emergency VoLTE Interoperability Test Suite, execute the following command:
+
+```sh
+$ ./docker-run.sh build
+```
+
+Possble other options are 'clean' to remove all the build outputs or 'rebuild' to force a build of the Test Suite after a 'clean'.
+
+To retrieve the list of the available test cases, execute the following command:
+
+```sh
+$ ./docker-run.sh list
+```
+
+Before to execute the Emergency VoLTE Interoperability Test Suite, prepare, edit and update the configuration file:
+
+```sh
+$ ln -sf ../../etc/AtsXxx/AtsXxx_yyy.cf_ ../../etc/AtsXxx/AtsXxx.cfg
+$ vi ../../etc/AtsXxx/AtsXxx.cfg # To update it
+```
+
+To execute the Emergency VoLTE Interoperability Test Suite, execute the following command:
+
+```sh
+$ ./docker-run.sh run
+```
+
+Notes:
+- The Emergency VoLTE Interoperability Test System is listening on port 443
+- Updating the file etc/AtsXxx/AtsXxx.cfg is about (e.g. etc/AtsBCF/AtsBCF.cfg):
+. Selecting the test(s) to be executed
+. Updating value of PICs and PIXITs
+. Updating HTTP port setting
+
+## Using development Docker image
+
+In this configuration, the TITAN compiler, the sources and the outputs are located on the Docker image.
+
+Pre-requisites on your host machine:
+- Install Docker
+
+Procedure for a Windows host machine:
+- On your host machine, open a the Docker Quickstart Terminal
+- On your host machine, clone the ETSI EEmergency Communications project. NOTE that only Docker folder and .jenkins.sh script file are required
+- From the ETSI Emergency VoLTE Interoperability Tests project root directory, execute the following commands:
+
+```sh
+$ ./.jenkins.sh
+...
+```
+
+NOTE The creation and the installations will take some time to achieve
+- Start the container
+
+```sh
+$ ./docker/run-container.sh
+...
+```
+
+- Switch to the next clause (Usage)
+
+
+## Using Vagrant
+
+Pre-requisites on your host machine:
+- Install [Virtualbox](https://www.virtualbox.org/manual/ch01.html)
+- Install [Vagrant](https://www.vagrantup.com/intro/getting-started/)
+- Install Vagrant plugin vagrant-vbguest
+- Credentials to access [ETSI forge](https://forge.etsi.org/gitlab/users/sign_in)
+ - Set the environment variable USERNAME to your ETSI EOL account user name
+ - Set the environment variable PASSWORD to your ETSI EOL account password
+
+Procedure:
+- On your host machine, open a command line session (PuTTY, DOS window...)
+- From the ETSI Emergency VoLTE Interoperability Tests project, clone the Vagrant folder
+- In the file Vagrantfile, modify the tag config.vm.provision replacing & strings by your ETSI credentials
+- In the Vagrant folder, execute the following commands:
+
+```sh
+$ vagrant up --provider virtualbox --provision
+...
+```
+
+NOTE The creation and the installations will take some time to achieve
+- Stop vagrant virtual machine
+
+```sh
+$ vagrant halt
+...
+```
+
+- Update the file 'Vagrantfile' to match with your networks configuration
+- Re-start the vagrant virtual machine and log to to the machine
+
+```sh
+$ vagrant up
+...
+$ vagrant ssh
+```
+
+- Switch to the next clause (Usage)
+
+NOTE The user password is vagrant.
+
+
+## From scratch
+
+Pre-requisites:
+- Install Virtualbox
+
+Procedure:
+- Install a new Linux Virtual machine (Mint, Debian...)
+- Update your system with the latest version of kernel and security packages
+- Install the following packages (According to the Linux chosen, the package naming can be different)
+ autoconf
+ bison
+ build-essential
+ cmake
+ curl
+ dos2unix
+ doxygen
+ emacs
+ expect
+ flex
+ g++:latest
+ gcc:latest
+ graphviz
+ gdb
+ git-core
+ gnutls-bin
+ libglib2.0-dev
+ libpcap-dev
+ libgcrypt-dev
+ libncurses5-dev
+ libssl-dev
+ libtool-bin
+ libtool
+ libwireshark-dev
+ libxml2-dev
+ lsof
+ ntp
+ pkg-config
+ qt5-default
+ qtmultimedia5-dev
+ libqt5svg5-dev
+ subversion
+ sudo
+ sshpass
+ tcpdump
+ texlive-font-utils
+ tshark
+ valgrind
+ vim
+ vsftpd
+ xutils-dev
+ tree
+ tzdata
+ unzip
+ wget
+ xsltproc
+- In your home directory, create the following folders:
+ - $HOME/frameworks,
+ - $HOME/dev
+ - $HOME/lib
+
+- In $HOME/frameworks, build the following package:
+ - Eclipse IDE for C/C++ Developers, according the procedure specified [here](https://www.eclipse.org/cdt/)
+ - TITAN, according the procedure specified [here](https://github.com/eclipse/titan.core)
+ - Import the TITAN plugin into your Eclipse IDE, according the procedure specified [here](https://github.com/eclipse/titan.core)
+
+- Install LibOSIP framework
+```sh
+$ cd ${HOME}/frameworks
+$ git clone https://git.savannah.gnu.org/git/osip.git ./osip
+$ cd osip
+$ ./autogen.sh
+$ ./configure --prefix=/home/etsi
+$ make && make install
+```
+
+- Clone the ETSI Emergency VoLTE Interoperability Tests project into $HOME/dev folder
+
+```sh
+$ git clone --recurse-submodules --branch devel https://forge.etsi.org/rep/int/vxlte/emergency-iop.git
+```
+
+- Apply patches
+```sh
+$ cd /home/etsi/dev/emergency-iop/
+$ ./install.sh
+```
+
+- Update your default environment with the content of the script $HOME/dev/emergency-iop/scripts/devenv.bash.ubuntu
+
+- Switch to the next clause (Usage)
+
+
+# Generate certificates for TLS and Emergency VoLTE Interoperability security support
+
+This clause describes how generate certificates desrived from Let's encrypt certificate. These certificate will be used for TS mutual authentication.
+NOTE:
+- Certficates shall be renewed every 3 months
+- The port 80 shall be vailable for standalone validation
+
+Pre-requisites:
+- You need to install python and [certbot](https://manpages.ubuntu.com/manpages/impish/en/man1/certbot.1.html).
+
+To generate certifcates, execute the following command:
+
+```sh
+$ export REQUESTS_CA_BUNDLE=$(dirname `python -c "import certifi; print(certifi.where())"`)
+$ mkdir -p $HOME/var/ssl
+$ sudo certbot certonly --debug --emergency-iop-tls-cert --config-dir $HOME/var/ssl --work-dir $HOME/var/ssl --logs-dir $HOME/var/ssl --standalone --agree-tos --email -d -w $HOME/var/ssl/
+```
+
+NOTE: For testing certificate generation and renewal, use the certbot's --dry-run option.
+
+
+# Usage
+
+This clause describes how to compile and execute an Abstract Test Suite.
+The procedures below illustrate how to run the CAM test suite. The same procedures will apply for any other ETSI Emergency Communications test suite.
+
+
+Pre-requisites:
+- Your machine is installed following one of the installation method describes in the previous clause
+- Your are logged as 'etsi' or 'vagrant' user
+
+Procedure in TITAN command line:
+- Open several SSH session (PuTTY...)
+- Change to the directory ~/dev/emergency-iop/
+- Build the test suite you want to exectue (e.g. LIS test suite)
+
+```sh
+$ cd ~/dev/emergency-iop/
+$ export ATS=AtsImsIot
+$ make
+...
+```
+
+- Edit the file ../etc/AtsImsIot/AtsImsIot.cfg
+- Update the following fields:
+ - system.httpPort.params
+ - system.SIPP.params
+ - system.DIAMETER.params
+
+- To run the test suitem, execute the following command:
+
+```sh
+$ cd ~/dev/emergency-iop/scripts
+$ ./run-all.bash
+...
+```
+
+- The log files are located in ../logs/AtsImsIot folder. You can edit them using any editor or using the Eclipse TITAN log plugins
+
+
+# How to Report a Bug
+
+The ETSI Emergency VoLTE Interoperability Tests project is under constant development, so it is possible that you will
+encounter a bug while using it. Please report bugs at cti_support at etsi dot org.
diff --git a/ccsrc/EncDec/LibDiameter/LibDiameter_EncDec.cc b/ccsrc/EncDec/LibDiameter/LibDiameter_EncDec.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5002bf319b458677eecc1c504030e3508b79cbfd
--- /dev/null
+++ b/ccsrc/EncDec/LibDiameter/LibDiameter_EncDec.cc
@@ -0,0 +1,901 @@
+
+#include "LibDiameter_EncdecDeclarations.hh"
+
+#include "loggers.hh"
+
+#include "diameter_uar_codec.hh"
+
+namespace LibDiameter__EncdecDeclarations {
+
+ BITSTRING fx__enc__CER__MSG(const LibDiameter__TypesAndValues::CER__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__CER__MSG(BITSTRING&, LibDiameter__TypesAndValues::CER__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__CEA__MSG(const LibDiameter__TypesAndValues::CEA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__CEA__MSG(BITSTRING&, LibDiameter__TypesAndValues::CEA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__RAR__MSG(const LibDiameter__TypesAndValues::RAR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__RAR__MSG(BITSTRING&, LibDiameter__TypesAndValues::RAR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__RAA__MSG(const LibDiameter__TypesAndValues::RAA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__RAA__MSG(BITSTRING&, LibDiameter__TypesAndValues::RAA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__ACR__MSG(const LibDiameter__TypesAndValues::ACR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__ACR__MSG(BITSTRING&, LibDiameter__TypesAndValues::ACR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__ACA__MSG(const LibDiameter__TypesAndValues::ACA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__ACA__MSG(BITSTRING&, LibDiameter__TypesAndValues::ACA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__ASR__MSG(const LibDiameter__TypesAndValues::ASR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__ASR__MSG(BITSTRING&, LibDiameter__TypesAndValues::ASR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__ASA__MSG(const LibDiameter__TypesAndValues::ASA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__ASA__MSG(BITSTRING&, LibDiameter__TypesAndValues::ASA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__STR__MSG(const LibDiameter__TypesAndValues::STR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__STR__MSG(BITSTRING&, LibDiameter__TypesAndValues::STR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__STA__MSG(const LibDiameter__TypesAndValues::STA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__STA__MSG(BITSTRING&, LibDiameter__TypesAndValues::STA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__DWR__MSG(const LibDiameter__TypesAndValues::DWR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__DWR__MSG(BITSTRING&, LibDiameter__TypesAndValues::DWR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__DWA__MSG(const LibDiameter__TypesAndValues::DWA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__DWA__MSG(BITSTRING&, LibDiameter__TypesAndValues::DWA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__DPR__MSG(const LibDiameter__TypesAndValues::DPR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__DPR__MSG(BITSTRING&, LibDiameter__TypesAndValues::DPR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__DPA__MSG(const LibDiameter__TypesAndValues::DPA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__DPA__MSG(BITSTRING&, LibDiameter__TypesAndValues::DPA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__UAR__MSG(const LibDiameter__TypesAndValues::UAR__MSG& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__UAR__MSG: ", p);
+
+ float duration;
+ std::string tag("fx__enc__UAR__MSG");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ diameter_uar_codec codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__UAR__MSG: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__UAR__MSG(BITSTRING& pdu, LibDiameter__TypesAndValues::UAR__MSG& p) {
+
+ OCTETSTRING os = bit2oct(pdu);
+ diameter_uar_codec codec;
+ codec.decode(os, p);
+
+ return INTEGER(0);
+ }
+
+ BITSTRING fx__enc__UAA__MSG(const LibDiameter__TypesAndValues::UAA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__UAR__MSG: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__UAR__MSG");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__UAA__MSG(BITSTRING&, LibDiameter__TypesAndValues::UAA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__SAR__MSG(const LibDiameter__TypesAndValues::SAR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__SAR__MSG(BITSTRING&, LibDiameter__TypesAndValues::SAR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__SAA__MSG(const LibDiameter__TypesAndValues::SAA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__SAA__MSG(BITSTRING&, LibDiameter__TypesAndValues::SAA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__LIR__MSG(const LibDiameter__TypesAndValues::LIR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__LIR__MSG(BITSTRING&, LibDiameter__TypesAndValues::LIR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__LIA__MSG(const LibDiameter__TypesAndValues::LIA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__LIA__MSG(BITSTRING&, LibDiameter__TypesAndValues::LIA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__MAR__MSG(const LibDiameter__TypesAndValues::MAR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__MAR__MSG(BITSTRING&, LibDiameter__TypesAndValues::MAR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__MAA__MSG(const LibDiameter__TypesAndValues::MAA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__MAA__MSG(BITSTRING&, LibDiameter__TypesAndValues::MAA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__RTR__MSG(const LibDiameter__TypesAndValues::RTR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__RTR__MSG(BITSTRING&, LibDiameter__TypesAndValues::RTR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__RTA__MSG(const LibDiameter__TypesAndValues::RTA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__RTA__MSG(BITSTRING&, LibDiameter__TypesAndValues::RTA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__PPR__MSG(const LibDiameter__TypesAndValues::PPR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__PPR__MSG(BITSTRING&, LibDiameter__TypesAndValues::PPR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__PPA__MSG(const LibDiameter__TypesAndValues::PPA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__PPA__MSG(BITSTRING&, LibDiameter__TypesAndValues::PPA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__UDR__MSG(const LibDiameter__TypesAndValues::UDR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__UDR__MSG(BITSTRING&, LibDiameter__TypesAndValues::UDR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__UDA__MSG(const LibDiameter__TypesAndValues::UDA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__UDA__MSG(BITSTRING&, LibDiameter__TypesAndValues::UDA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__PUR__MSG(const LibDiameter__TypesAndValues::PUR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__PUR__MSG(BITSTRING&, LibDiameter__TypesAndValues::PUR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__PUA__MSG(const LibDiameter__TypesAndValues::PUA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__PUA__MSG(BITSTRING&, LibDiameter__TypesAndValues::PUA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__SNR__MSG(const LibDiameter__TypesAndValues::SNR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__SNR__MSG(BITSTRING&, LibDiameter__TypesAndValues::SNR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__SNA__MSG(const LibDiameter__TypesAndValues::SNA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__SNA__MSG(BITSTRING&, LibDiameter__TypesAndValues::SNA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__PNR__MSG(const LibDiameter__TypesAndValues::PNR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__PNR__MSG(BITSTRING&, LibDiameter__TypesAndValues::PNR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__PNA__MSG(const LibDiameter__TypesAndValues::PNA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__PNA__MSG(BITSTRING&, LibDiameter__TypesAndValues::PNA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__CCR__MSG(const LibDiameter__TypesAndValues::CCR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__CCR__MSG(BITSTRING&, LibDiameter__TypesAndValues::CCR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__CCA__MSG(const LibDiameter__TypesAndValues::CCA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__CCA__MSG(BITSTRING&, LibDiameter__TypesAndValues::CCA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__AAR__MSG(const LibDiameter__TypesAndValues::AAR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__AAR__MSG(BITSTRING&, LibDiameter__TypesAndValues::AAR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__AAA__MSG(const LibDiameter__TypesAndValues::AAA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__AAA__MSG(BITSTRING&, LibDiameter__TypesAndValues::AAA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__ULR__MSG(const LibDiameter__TypesAndValues::ULR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__ULR__MSG(BITSTRING&, LibDiameter__TypesAndValues::ULR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__ULA__MSG(const LibDiameter__TypesAndValues::ULA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__ULA__MSG(BITSTRING&, LibDiameter__TypesAndValues::ULA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__AIR__MSG(const LibDiameter__TypesAndValues::AIR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__AIR__MSG(BITSTRING&, LibDiameter__TypesAndValues::AIR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__AIA__MSG(const LibDiameter__TypesAndValues::AIA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__AIA__MSG(BITSTRING&, LibDiameter__TypesAndValues::AIA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__CLR__MSG(const LibDiameter__TypesAndValues::CLR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__CLR__MSG(BITSTRING&, LibDiameter__TypesAndValues::CLR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__CLA__MSG(const LibDiameter__TypesAndValues::CLA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__CLA__MSG(BITSTRING&, LibDiameter__TypesAndValues::CLA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__IDR__MSG(const LibDiameter__TypesAndValues::IDR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__IDR__MSG(BITSTRING&, LibDiameter__TypesAndValues::IDR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__IDA__MSG(const LibDiameter__TypesAndValues::IDA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__IDA__MSG(BITSTRING&, LibDiameter__TypesAndValues::IDA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__DSR__MSG(const LibDiameter__TypesAndValues::DSR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__DSR__MSG(BITSTRING&, LibDiameter__TypesAndValues::DSR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__DSA__MSG(const LibDiameter__TypesAndValues::DSA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__DSA__MSG(BITSTRING&, LibDiameter__TypesAndValues::DSA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__RSR__MSG(const LibDiameter__TypesAndValues::RSR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__RSR__MSG(BITSTRING&, LibDiameter__TypesAndValues::RSR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__RSA__MSG(const LibDiameter__TypesAndValues::RSA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__RSA__MSG(BITSTRING&, LibDiameter__TypesAndValues::RSA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__NOR__MSG(const LibDiameter__TypesAndValues::NOR__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__NOR__MSG(BITSTRING&, LibDiameter__TypesAndValues::NOR__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__NOA__MSG(const LibDiameter__TypesAndValues::NOA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__NOA__MSG(BITSTRING&, LibDiameter__TypesAndValues::NOA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__PUER__MSG(const LibDiameter__TypesAndValues::PUER__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__PUER__MSG(BITSTRING&, LibDiameter__TypesAndValues::PUER__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__PUEA__MSG(const LibDiameter__TypesAndValues::PUEA__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__PUEA__MSG(BITSTRING&, LibDiameter__TypesAndValues::PUEA__MSG& p) { return INTEGER(0); }
+
+ BITSTRING fx__enc__UNKNOWN__MSG(const LibDiameter__TypesAndValues::UNKNOWN__MSG& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__UNKNOWN__MSG(BITSTRING&, LibDiameter__TypesAndValues::UNKNOWN__MSG& p) { return INTEGER(0); }
+
+} // End of namespace LibDiameter__EncdecDeclarations
diff --git a/ccsrc/EncDec/LibDiameter/module.mk b/ccsrc/EncDec/LibDiameter/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..5f362ce7c0eb3b80b1afcaf71eec306df910404a
--- /dev/null
+++ b/ccsrc/EncDec/LibDiameter/module.mk
@@ -0,0 +1,2 @@
+sources := \
+ LibDiameter_EncDec.cc
diff --git a/ccsrc/EncDec/LibEmtel/LibNg112_EncDec.cc b/ccsrc/EncDec/LibEmtel/LibNg112_EncDec.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b13692a172270bb06e2aa90ffb8ca117ea1aa71d
--- /dev/null
+++ b/ccsrc/EncDec/LibEmtel/LibNg112_EncDec.cc
@@ -0,0 +1,130 @@
+#include "LibNg112_EncdecDeclarations.hh"
+
+#include "json_codec.hh"
+
+#include "loggers.hh"
+
+namespace LibNg112__EncdecDeclarations { // TODO File to be removed
+
+/* BITSTRING enc__DequeueRegistrationRequest(const LibNg112__DequeueRegistration::DequeueRegistrationRequest& p) {
+ loggers::get_instance().log_msg(">>> enc__DequeueRegistrationRequest: ", (const Base_Type&)p);
+
+ OCTETSTRING os;
+ json_codec codec;
+ codec.encode(p, os);
+
+ return oct2bit(os);
+ }
+
+ INTEGER dec__DequeueRegistrationRequest(BITSTRING& pdu, LibNg112__DequeueRegistration::DequeueRegistrationRequest& p) {
+ loggers::get_instance().log_msg(">>> dec__DequeueRegistrationRequest: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ json_codec codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ BITSTRING enc__DequeueRegistrationResponse(const LibNg112__DequeueRegistration::DequeueRegistrationResponse& p) {
+ loggers::get_instance().log_msg(">>> enc__DequeueRegistrationResponse: ", (const Base_Type&)p);
+
+ OCTETSTRING os;
+ json_codec codec;
+ codec.encode(p, os);
+
+ return oct2bit(os);
+ }
+
+ INTEGER dec__DequeueRegistrationResponse(BITSTRING& pdu, LibNg112__DequeueRegistration::DequeueRegistrationResponse& p) {
+ loggers::get_instance().log_msg(">>> dec__DequeueRegistrationResponse: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ json_codec codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ BITSTRING enc__ServiceStatePayload(const LibNg112__SubscriptionPayloads::ServiceStatePayload& p) {
+ loggers::get_instance().log_msg(">>> enc__ServiceStatePayload: ", (const Base_Type&)p);
+
+ OCTETSTRING os;
+ json_codec codec;
+ codec.encode(p, os);
+
+ return oct2bit(os);
+ }
+
+ INTEGER dec__ServiceStatePayload(BITSTRING& pdu, LibNg112__SubscriptionPayloads::ServiceStatePayload& p) {
+ loggers::get_instance().log_msg(">>> dec__ServiceStatePayload: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ json_codec codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ BITSTRING enc__ElementStatePayload(const LibNg112__SubscriptionPayloads::ElementStatePayload& p) {
+ loggers::get_instance().log_msg(">>> enc__ElementStatePayload: ", (const Base_Type&)p);
+
+ OCTETSTRING os;
+ json_codec codec;
+ codec.encode(p, os);
+
+ return oct2bit(os);
+ }
+
+ INTEGER dec__ElementStatePayload(BITSTRING& pdu, LibNg112__SubscriptionPayloads::ElementStatePayload& p) {
+ loggers::get_instance().log_msg(">>> dec__ElementStatePayload: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ json_codec codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ BITSTRING enc__SecurityPosturePayload(const LibNg112__SubscriptionPayloads::SecurityPosturePayload& p) {
+ loggers::get_instance().log_msg(">>> enc__SecurityPosturePayload: ", (const Base_Type&)p);
+
+ OCTETSTRING os;
+ json_codec codec;
+ codec.encode(p, os);
+
+ return oct2bit(os);
+ }
+
+ INTEGER dec__SecurityPosturePayload(BITSTRING& pdu, LibNg112__SubscriptionPayloads::SecurityPosturePayload& p) {
+ loggers::get_instance().log_msg(">>> dec__QueueStdec__SecurityPosturePayloadtePayload: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ json_codec codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ BITSTRING enc__QueueStatePayload(const LibNg112__SubscriptionPayloads::QueueStatePayload& p) {
+ loggers::get_instance().log_msg(">>> enc__QueueStatePayload: ", (const Base_Type&)p);
+
+ OCTETSTRING os;
+ json_codec codec;
+ codec.encode(p, os);
+
+ return oct2bit(os);
+ }
+
+ INTEGER dec__QueueStatePayload(BITSTRING& pdu, LibNg112__SubscriptionPayloads::QueueStatePayload& p) {
+ loggers::get_instance().log_msg(">>> dec__QueueStatePayload: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ json_codec codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+*/
+} // End of namespace LibNg112__EncdecDeclarations
+
diff --git a/ccsrc/EncDec/LibEmtel/module.mk b/ccsrc/EncDec/LibEmtel/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..43f2b71da14e30dd5787c7c62c3ec752d93fe363
--- /dev/null
+++ b/ccsrc/EncDec/LibEmtel/module.mk
@@ -0,0 +1 @@
+sources := LibNg112_EncDec.cc
diff --git a/ccsrc/EncDec/LibMsrp/LibMsrp_EncDec.cc b/ccsrc/EncDec/LibMsrp/LibMsrp_EncDec.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9786ab576e1a90b523246a89ee416c1320b5983f
--- /dev/null
+++ b/ccsrc/EncDec/LibMsrp/LibMsrp_EncDec.cc
@@ -0,0 +1,24 @@
+
+#include "LibMsrp_EncDecDeclarations.hh"
+
+#include "loggers.hh"
+
+namespace LibMsrp__EncDecDeclarations {
+
+ BITSTRING fx__enc__MsrpURI(const LibMsrp__TypesAndValues::MsrpURI& p) {
+ loggers::get_instance().log_msg(">>> BITSTRING fx__enc__MsrpURI: ", p);
+
+ float duration;
+ std::string tag(" BITSTRING fx__enc__MsrpURI");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ // TODO
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__MsrpURI(BITSTRING&, LibMsrp__TypesAndValues::MsrpURI& p) { return INTEGER(0); }
+
+} // End of module LibMsrp__EncDecDeclarations
\ No newline at end of file
diff --git a/ccsrc/EncDec/LibMsrp/module.mk b/ccsrc/EncDec/LibMsrp/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..52b99146a8c68753ac06d93428acde77e2373942
--- /dev/null
+++ b/ccsrc/EncDec/LibMsrp/module.mk
@@ -0,0 +1,2 @@
+sources := \
+ LibMsrp_EncDec.cc
diff --git a/ccsrc/EncDec/LibSip/LibSip_Encdec.cc b/ccsrc/EncDec/LibSip/LibSip_Encdec.cc
new file mode 100644
index 0000000000000000000000000000000000000000..add0174651c9c2875983a50eaef8a6fc7a730cbe
--- /dev/null
+++ b/ccsrc/EncDec/LibSip/LibSip_Encdec.cc
@@ -0,0 +1,372 @@
+
+#include "LibSip_EncdecDeclarations.hh"
+#include "LibSip_XMLTypes.hh"
+
+#include "sip_codec_register_request.hh"
+#include "sip_codec_invite_request.hh"
+#include "sip_codec_options_request.hh"
+#include "sip_codec_bye_request.hh"
+#include "sip_codec_ack_request.hh"
+#include "sip_codec_subscribe_request.hh"
+#include "sip_codec_notify_request.hh"
+#include "sip_codec_info_request.hh"
+#include "sip_codec_message_request.hh"
+#include "sip_codec_message_body.hh"
+#include "sip_codec_response.hh"
+
+#include "loggers.hh"
+
+namespace LibSip__EncdecDeclarations {
+
+ BITSTRING fx__enc__Request(const LibSip__SIPTypesAndValues::Request& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__Request: ", p);
+
+ float duration;
+ std::string tag("fx__enc__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_request codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__Request -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ BITSTRING fx__enc__REGISTER__Request(const LibSip__SIPTypesAndValues::REGISTER__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__REGISTER__Request: ", p);
+
+ float duration;
+ std::string tag("fx__enc__REGISTER__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_register_request codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__REGISTER__Request: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ BITSTRING fx__enc__INVITE__Request(const LibSip__SIPTypesAndValues::INVITE__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__INVITE__Request: ", p);
+
+ float duration;
+ std::string tag("fx__enc__INVITE__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_invite_request codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__INVITE__Request: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ BITSTRING fx__enc__OPTIONS__Request(const LibSip__SIPTypesAndValues::OPTIONS__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__OPTIONS__Request: ", p);
+
+ float duration;
+ std::string tag("fx__enc__OPTIONS__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_options_request codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__OPTIONS__Request: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ BITSTRING fx__enc__BYE__Request(const LibSip__SIPTypesAndValues::BYE__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__BYE__Request: ", p);
+
+ float duration;
+ std::string tag("fx__enc__BYE__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_bye_request codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__BYE__Request: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ BITSTRING fx__enc__ACK__Request(const LibSip__SIPTypesAndValues::ACK__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__ACK__Request: ", p);
+
+ float duration;
+ std::string tag("fx__enc__ACK__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_ack_request codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__ACK__Request: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ BITSTRING fx__enc__CANCEL__Request(const LibSip__SIPTypesAndValues::CANCEL__Request& p) { return BITSTRING(); }
+ BITSTRING fx__enc__PRACK__Request(const LibSip__SIPTypesAndValues::PRACK__Request& p) { return BITSTRING(); }
+ BITSTRING fx__enc__NOTIFY__Request(const LibSip__SIPTypesAndValues::NOTIFY__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__NOTIFY__Request: ", p);
+
+ float duration;
+ std::string tag("fx__enc__NOTIFY__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_notify_request codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__NOTIFY__Request: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ BITSTRING fx__enc__SUBSCRIBE__Request(const LibSip__SIPTypesAndValues::SUBSCRIBE__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__SUBSCRIBE__Request: ", p);
+
+ float duration;
+ std::string tag("fx__enc__SUBSCRIBE__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_subscribe_request codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__SUBSCRIBE__Request: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ BITSTRING fx__enc__MESSAGE__Request(const LibSip__SIPTypesAndValues::MESSAGE__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__MESSAGE__Request: ", p);
+
+ float duration;
+ std::string tag("fx__enc__MESSAGE__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_message_request codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__MESSAGE__Request: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ BITSTRING fx__enc__PUBLISH__Request(const LibSip__SIPTypesAndValues::PUBLISH__Request& p) { return BITSTRING(); }
+ BITSTRING fx__enc__UPDATE__Request(const LibSip__SIPTypesAndValues::UPDATE__Request& p) { return BITSTRING(); }
+ BITSTRING fx__enc__REFER__Request(const LibSip__SIPTypesAndValues::REFER__Request& p) { return BITSTRING(); }
+ BITSTRING fx__enc__INFO__Request(const LibSip__SIPTypesAndValues::INFO__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__INFO__Request: ", p);
+
+ float duration;
+ std::string tag("fx__enc__INFO__Request");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_info_request codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__INFO__Request: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+
+ BITSTRING fx__enc__Response(const LibSip__SIPTypesAndValues::Response& p) {
+ loggers::get_instance().log_msg(">>> fx__enc__Response: ", p);
+
+ float duration;
+ std::string tag("fx__enc__Response");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_response codec;
+ if (codec.encode(p, os) == -1) {
+ loggers::get_instance().warning("fx__enc__Response: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ BITSTRING fx__enc__Raw(const CHARSTRING& p) { return BITSTRING(); }
+ BITSTRING fx__enc__SMS(const LibSip__SimpleMsgSummaryTypes::SimpleMsgSummary& pdu) { return BITSTRING(); }
+
+ BITSTRING fx__enc__MessageBody(const LibSip__MessageBodyTypes::MessageBody& pdu) {
+ loggers::get_instance().log_msg(">>> fx__enc__MessageBody: ", pdu);
+
+ float duration;
+ std::string tag("fx__enc__MessageBody");
+ loggers::get_instance().set_start_time(tag);
+
+ OCTETSTRING os;
+ sip_codec_message_body codec;
+ if (codec.encode(pdu, os) == -1) {
+ loggers::get_instance().warning("fx__enc__MessageBody: -1 result code was returned");
+ return int2bit(0, 1);
+ }
+ loggers::get_instance().set_stop_time(tag, duration);
+
+ return oct2bit(os);
+ }
+
+ INTEGER fx__dec__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::Request& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__Request: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_request codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__REGISTER__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::REGISTER__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__REGISTER__Request: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_register_request codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__INVITE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::INVITE__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__INVITE__Request: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_invite_request codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__OPTIONS__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::OPTIONS__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__OPTIONS__Request: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_options_request codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__BYE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::BYE__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__BYE__Request: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_bye_request codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__ACK__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::ACK__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__ACK__Request: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_ack_request codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__CANCEL__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::CANCEL__Request& p) { return INTEGER(0); }
+ INTEGER fx__dec__PRACK__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::PRACK__Request& p) { return INTEGER(0); }
+ INTEGER fx__dec__NOTIFY__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::NOTIFY__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__NOTIFY__Request: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_notify_request codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__SUBSCRIBE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::SUBSCRIBE__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__SUBSCRIBE__Request: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_subscribe_request codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__MESSAGE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::MESSAGE__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__MESSAGE__Request: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_message_request codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__PUBLISH__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::PUBLISH__Request& p) { return INTEGER(0); }
+ INTEGER fx__dec__UPDATE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::UPDATE__Request& p) { return INTEGER(0); }
+ INTEGER fx__dec__REFER__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::REFER__Request& p) { return INTEGER(0); }
+ INTEGER fx__dec__INFO__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::INFO__Request& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__INFO__Request: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_info_request codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__Response(BITSTRING& pdu, LibSip__SIPTypesAndValues::Response& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__Response: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_response codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+
+ INTEGER fx__dec__SMS(BITSTRING& pdu, LibSip__SimpleMsgSummaryTypes::SimpleMsgSummary& p) { return INTEGER(0); }
+
+ INTEGER fx__dec__MessageBody(BITSTRING& pdu, LibSip__MessageBodyTypes::MessageBody& p) {
+ loggers::get_instance().log_msg(">>> fx__dec__MessageBody: ", pdu);
+
+ OCTETSTRING os = bit2oct(pdu);
+ sip_codec_message_body codec;
+ codec.decode(os, p);
+
+ return 0;
+ }
+} // End of namespace LibSip__EncdecDeclarations
diff --git a/ccsrc/EncDec/LibSip/LibSip_SMSFunctions_Encdec.cc b/ccsrc/EncDec/LibSip/LibSip_SMSFunctions_Encdec.cc
new file mode 100644
index 0000000000000000000000000000000000000000..65e0af8cc95a391b028b21fe17c22ce0087fe2d6
--- /dev/null
+++ b/ccsrc/EncDec/LibSip/LibSip_SMSFunctions_Encdec.cc
@@ -0,0 +1,9 @@
+#include "LibSip_SMSFunctions.hh"
+
+#include "loggers.hh"
+
+namespace LibSip__SMSFunctions {
+
+ HEXSTRING fx__GetSC__TimeStamp(const INTEGER& p__TimeZone) { return int2hex(0, 14); };
+
+} // End of namespace LibSip__SMSFunctions
diff --git a/ccsrc/EncDec/LibSip/LibSip_Steps_Encdec.cc b/ccsrc/EncDec/LibSip/LibSip_Steps_Encdec.cc
new file mode 100644
index 0000000000000000000000000000000000000000..35a297030547f04b8b6018af78340957a0351077
--- /dev/null
+++ b/ccsrc/EncDec/LibSip/LibSip_Steps_Encdec.cc
@@ -0,0 +1,109 @@
+#include
+#include
+#include
+
+#include
+
+#include "LibSip_Steps.hh"
+
+#include "loggers.hh"
+
+#include "converter.hh"
+
+namespace LibSip__Steps {
+
+ int calculate_md5(const std::string& p_data, std::string& p_md5)
+ {
+ loggers::get_instance().log(">>> calculate_md5: %s", p_data.c_str());
+
+ MD5_CTX md5_context;
+ ::MD5_Init(&md5_context);
+
+ loggers::get_instance().log("calculate_md5: length=%d", p_data.length());
+ ::MD5_Update(&md5_context, p_data.c_str(), p_data.length()); // TODO Add support of block size > 512
+
+ const size_t digestlen = 16;
+ unsigned char digest[digestlen];
+ ::MD5_Final(digest, &md5_context);
+ p_md5 = converter::get_instance().bytes_to_hexa(std::vector(digest, digest + digestlen));
+
+ loggers::get_instance().log("<<< calculate_md5: %s", p_md5.c_str());
+ return 0;
+ }
+
+ CHARSTRING fx__rndStr() {
+ static const char alphanum[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ static int length = 10;
+ char s[length] = { 0 };
+ for (int i = 0; i < length - 1; ++i) {
+ s[i] = alphanum[rand() % (sizeof(alphanum) - 1)];
+ } // End of 'for' statement
+ return CHARSTRING(s);
+ };
+
+ CHARSTRING fx__putInLowercase(const CHARSTRING& p__string) {
+ std::string s(static_cast(p__string));
+ std::transform(s.begin(), s.end(), s.begin(), ::tolower);
+ return CHARSTRING(s.c_str());
+ };
+
+ CHARSTRING fx__getIpAddr(const CHARSTRING& p__host__name) { return CHARSTRING(""); };
+
+ CHARSTRING fx__calculateDigestResponse(const CHARSTRING& p__nonce, const CHARSTRING& p__cnonce, const CHARSTRING& p__user, const CHARSTRING& p__realm, const CHARSTRING& p__passwd, const CHARSTRING& p__alg, const CHARSTRING& p__nonceCount, const CHARSTRING& p__method, const CHARSTRING& p__qop, const CHARSTRING& p__URI, const CHARSTRING& p__HEntity) {
+ loggers::get_instance().log(">>> fx__calculateDigestResponse");
+
+ // Buid a1=USERNAME:REALM:PASSWORD
+ std::string a1(static_cast(p__user));
+ a1 += ":";
+ a1 += static_cast(p__realm);
+ a1 += ":";
+ a1 += static_cast(p__passwd);
+ if (a1.find("\"") != std::string::npos) {
+ a1 = std::regex_replace(a1, std::regex("\""), "");
+ }
+ loggers::get_instance().log("fx__calculateDigestResponse: a1='%s'", a1.c_str());
+ std::string md5_a1;
+ calculate_md5(a1, md5_a1);
+
+ // Buid a2=METHOD:DIGESTURI
+ std::string a2(static_cast(p__method));
+ a2 += ":";
+ a2 += static_cast(p__URI);
+ if (a2.find("\"") != std::string::npos) {
+ a2 = std::regex_replace(a2, std::regex("\""), ""); // TODO Move to converter
+ }
+ loggers::get_instance().log("fx__calculateDigestResponse: a2='%s'", a2.c_str());
+ std::string md5_a2;
+ calculate_md5(a2, md5_a2);
+
+ // Buid resp=HA1:NONCE:HA2
+ std::string resp(md5_a1);
+ resp += ":";
+ resp += static_cast(p__nonce);
+ resp += ":";
+ resp += md5_a2;
+ loggers::get_instance().log("fx__calculateDigestResponse: resp='%s'", resp.c_str());
+ std::string md5_resp;
+ calculate_md5(resp, md5_resp);
+
+ // Convert into Base64
+ std::vector u = converter::get_instance().string_to_bytes(md5_resp);
+ md5_resp = converter::get_instance().bytes_to_string(converter::get_instance().buffer_to_base64(u));
+
+ loggers::get_instance().log("<<< fx__calculateDigestResponse: '%s'", md5_resp.c_str());
+ return CHARSTRING(md5_resp.c_str());
+ };
+
+ CHARSTRING fx__encodeBase64(const CHARSTRING& p__value) {
+ std::vector s(static_cast(p__value), static_cast(p__value) + p__value.lengthof());
+ std::vector o = converter::get_instance().buffer_to_base64(s);
+ return CHARSTRING(o.size(), (const char*)o.data());
+ };
+
+ CHARSTRING fx__decodeBase64(const CHARSTRING& p__value) {
+ std::vector s(static_cast(p__value), static_cast(p__value) + p__value.lengthof());
+ std::vector o = converter::get_instance().base64_to_buffer(s);
+ return CHARSTRING(o.size(), (const char*)o.data());
+ };
+
+} // End of namespace LibSip__Steps
diff --git a/ccsrc/EncDec/LibSip/LibSip_Templates_Encdec.cc b/ccsrc/EncDec/LibSip/LibSip_Templates_Encdec.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2c68f22cdfaecf05680cf3ebfc960365d5daa729
--- /dev/null
+++ b/ccsrc/EncDec/LibSip/LibSip_Templates_Encdec.cc
@@ -0,0 +1,9 @@
+#include "LibSip_Templates.hh"
+
+#include "loggers.hh"
+
+namespace LibSip__Templates {
+
+ INTEGER fx__calculateXMLBodyLen(const LibSip__XMLTypes::XmlBody& p__mb) { return INTEGER(0); };
+
+} // End of namespace LibSip__Templates
diff --git a/ccsrc/EncDec/LibSip/module.mk b/ccsrc/EncDec/LibSip/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..86e171030bc6242e576f593006e3c11ab9792dc2
--- /dev/null
+++ b/ccsrc/EncDec/LibSip/module.mk
@@ -0,0 +1,5 @@
+sources := \
+ LibSip_Encdec.cc \
+ LibSip_SMSFunctions_Encdec.cc \
+ LibSip_Steps_Encdec.cc \
+ LibSip_Templates_Encdec.cc
diff --git a/ccsrc/Ports/Data/DataPort.cc b/ccsrc/Ports/Data/DataPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9a26e574626c28095212fa2bae9feeaafdea1eb3
--- /dev/null
+++ b/ccsrc/Ports/Data/DataPort.cc
@@ -0,0 +1,73 @@
+#include "DataPort.hh"
+#include "loggers.hh"
+
+namespace AtsImsIot__TestSystem {
+
+ DataPort::DataPort(const char *par_port_name): DataPort_BASE(par_port_name), _cfg_params(), _layer_params(), _layer(nullptr), _time_key("DataPort::outgoing_send") {
+ // Nothing to do
+ } // End of constructor
+
+ DataPort::~DataPort() {
+ loggers::get_instance().log(">>> DataPort::~DataPort");
+
+ if (_layer != nullptr) {
+ delete _layer;
+ }
+ } // End of destructor
+
+ void DataPort::set_parameter(const char * parameter_name, const char * parameter_value)
+ {
+ loggers::get_instance().log("DataPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ _cfg_params.insert(std::pair(std::string(parameter_name), std::string(parameter_value)));
+ }
+
+ /*void DataPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void DataPort::Handle_Fd_Event_Error(int /*fd*/)
+ {
+
+ }
+
+ void DataPort::Handle_Fd_Event_Writable(int /*fd*/)
+ {
+
+ }
+
+ void DataPort::Handle_Fd_Event_Readable(int /*fd*/)
+ {
+
+ }
+
+ /*void DataPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void DataPort::user_map(const char * system_port)
+ {
+ loggers::get_instance().log(">>> DataPort::user_map: %s", system_port);
+ } // End of user_map method
+
+ void DataPort::user_unmap(const char * system_port)
+ {
+ loggers::get_instance().log(">>> DataPort::user_unmap: %s", system_port);
+
+ // Reset layers
+ if (_layer != nullptr) {
+ delete _layer;
+ _layer = nullptr;
+ }
+ } // End of user_unmap method
+
+ void DataPort::user_start()
+ {
+ loggers::get_instance().log(">>> DataPort::user_start");
+
+ } // End of user_start method
+
+ void DataPort::user_stop()
+ {
+ loggers::get_instance().log(">>> DataPort::user_stop");
+
+ } // End of user_stop method
+
+}
+
diff --git a/ccsrc/Ports/Data/DataPort.hh b/ccsrc/Ports/Data/DataPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..c9809b1c769863d218e5c1a36334070d36a27983
--- /dev/null
+++ b/ccsrc/Ports/Data/DataPort.hh
@@ -0,0 +1,45 @@
+#pragma once
+
+#include "AtsImsIot_TestSystem.hh"
+
+#include "layer.hh"
+#include "params.hh"
+
+namespace AtsImsIot__TestSystem {
+
+ class DataPort : public DataPort_BASE {
+ params _cfg_params;
+ params _layer_params;
+ layer* _layer;
+ std::string _time_key;
+ public:
+ DataPort(const char *par_port_name);
+ ~DataPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+
+ void receiveMsg (const LibSip__SIPTypesAndValues::Request& p_ind, const params& p_params) {};
+ void receiveMsg (const LibSip__SIPTypesAndValues::Response& p_ind, const params& p_params) {};
+ void receiveMsg (const LibMsrp__TypesAndValues::SEND__request& p_ind, const params& p_params) {};
+ void receiveMsg (const LibMsrp__TypesAndValues::RECEIVE__response& p_ind, const params& p_params) {};
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+
+ protected:
+ }; // End of class DataPort
+
+}
+
diff --git a/ccsrc/Ports/Data/module.mk b/ccsrc/Ports/Data/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..b6ee7999e241806b19cd28233c0233bf0d5f6e27
--- /dev/null
+++ b/ccsrc/Ports/Data/module.mk
@@ -0,0 +1,3 @@
+sources := DataPort.cc
+includes := .
+
diff --git a/ccsrc/Ports/ImsMonitorDiameterPort/ImsMonitorDiameterPort.cc b/ccsrc/Ports/ImsMonitorDiameterPort/ImsMonitorDiameterPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..50c6f354a5a13475dc2835b91842bd7a9beee7f3
--- /dev/null
+++ b/ccsrc/Ports/ImsMonitorDiameterPort/ImsMonitorDiameterPort.cc
@@ -0,0 +1,102 @@
+#include "ImsMonitorDiameterPort.hh"
+#include "diameter_layer_factory.hh"
+#include "loggers.hh"
+
+namespace AtsImsIot__TestSystem {
+
+ ImsMonitorDiameterPort::ImsMonitorDiameterPort(const char *par_port_name): ImsMonitorDiameterPort_BASE(par_port_name), _cfg_params(), _layer_params(), _layer(nullptr), _time_key("ImsMonitorDiameterPort::outgoing_send") {
+ // Nothing to do
+ } // End of constructor
+
+ ImsMonitorDiameterPort::~ImsMonitorDiameterPort() {
+ loggers::get_instance().log(">>> ImsMonitorDiameterPort::~ImsMonitorDiameterPort");
+
+ if (_layer != nullptr) {
+ delete _layer;
+ }
+ } // End of destructor
+
+ void ImsMonitorDiameterPort::set_parameter(const char * parameter_name, const char * parameter_value)
+ {
+ loggers::get_instance().log("ImsMonitorDiameterPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ _cfg_params.insert(std::pair(std::string(parameter_name), std::string(parameter_value)));
+ }
+
+ /*void ImsMonitorDiameterPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void ImsMonitorDiameterPort::Handle_Fd_Event_Error(int /*fd*/)
+ {
+
+ }
+
+ void ImsMonitorDiameterPort::Handle_Fd_Event_Writable(int /*fd*/)
+ {
+
+ }
+
+ void ImsMonitorDiameterPort::Handle_Fd_Event_Readable(int /*fd*/)
+ {
+
+ }
+
+ /*void ImsMonitorDiameterPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void ImsMonitorDiameterPort::user_map(const char * system_port)
+ {
+ loggers::get_instance().log(">>> ImsMonitorDiameterPort::user_map: %s", system_port);
+ // Build layer stack
+ /*params::iterator it = _cfg_params.find(std::string("params"));
+ if (it != _cfg_params.end()) {
+ loggers::get_instance().log("ImsMonitorDiameterPort::user_map: %s", it->second.c_str());
+ // Setup parameters
+ params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
+ // Create layer
+ _layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
+ if (static_cast(_layer) == nullptr) {
+ loggers::get_instance().error("ImsMonitorDiameterPort::user_map: Invalid stack configuration: %s", it->second.c_str());
+ }
+ static_cast(_layer)->add_upper_port(this);
+
+ } else {*/
+ loggers::get_instance().error("ImsMonitorDiameterPort::user_map: No layers defined in configuration file");
+ /*}*/
+ } // End of user_map method
+
+ void ImsMonitorDiameterPort::user_unmap(const char * system_port)
+ {
+ loggers::get_instance().log(">>> ImsMonitorDiameterPort::user_unmap: %s", system_port);
+
+ // Reset layers
+ if (_layer != nullptr) {
+ delete _layer;
+ _layer = nullptr;
+ }
+ } // End of user_unmap method
+
+ void ImsMonitorDiameterPort::user_start()
+ {
+ loggers::get_instance().log(">>> ImsMonitorDiameterPort::user_start");
+
+ } // End of user_start method
+
+ void ImsMonitorDiameterPort::user_stop()
+ {
+ loggers::get_instance().log(">>> ImsMonitorDiameterPort::user_stop");
+
+ } // End of user_stop method
+
+ void ImsMonitorDiameterPort::receiveMsg (const LibDiameter__TypesAndValues::DIAMETER__MSG& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> ImsMonitorDiameterPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+
+ } // End of method receiveMsg
+
+}
+
diff --git a/ccsrc/Ports/ImsMonitorDiameterPort/ImsMonitorDiameterPort.hh b/ccsrc/Ports/ImsMonitorDiameterPort/ImsMonitorDiameterPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..78759ee35a42d1c5350f8c82ee5253a9892a497e
--- /dev/null
+++ b/ccsrc/Ports/ImsMonitorDiameterPort/ImsMonitorDiameterPort.hh
@@ -0,0 +1,41 @@
+#pragma once
+
+#include "AtsImsIot_TestSystem.hh"
+#include "LibDiameter_TypesAndValues.hh"
+
+#include "layer.hh"
+#include "params.hh"
+
+namespace AtsImsIot__TestSystem {
+
+ class ImsMonitorDiameterPort : public ImsMonitorDiameterPort_BASE {
+ params _cfg_params;
+ params _layer_params;
+ layer* _layer;
+ std::string _time_key;
+ public:
+ ImsMonitorDiameterPort(const char *par_port_name);
+ ~ImsMonitorDiameterPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+
+ void receiveMsg (const LibDiameter__TypesAndValues::DIAMETER__MSG& p_ind, const params& p_params);
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+ }; // End of class ImsMonitorDiameterPort
+
+}
+
diff --git a/ccsrc/Ports/ImsMonitorDiameterPort/module.mk b/ccsrc/Ports/ImsMonitorDiameterPort/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..c189618dce3dfc60855e7ee6e269bc9c25235fb0
--- /dev/null
+++ b/ccsrc/Ports/ImsMonitorDiameterPort/module.mk
@@ -0,0 +1,3 @@
+sources := ImsMonitorDiameterPort.cc
+includes := .
+
diff --git a/ccsrc/Ports/ImsMonitorSipPort/ImsMonitorSipPort.cc b/ccsrc/Ports/ImsMonitorSipPort/ImsMonitorSipPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7776a1ef2451f4fbbbcb1a1cdcfc8348a6760597
--- /dev/null
+++ b/ccsrc/Ports/ImsMonitorSipPort/ImsMonitorSipPort.cc
@@ -0,0 +1,134 @@
+#include "ImsMonitorSipPort.hh"
+#include "sip_layer_factory.hh"
+#include "loggers.hh"
+
+namespace AtsImsIot__TestSystem {
+
+ ImsMonitorSipPort::ImsMonitorSipPort(const char *par_port_name): ImsMonitorSipPort_BASE(par_port_name), _cfg_params(), _layer_params(), _layer(nullptr), _time_key("ImsMonitorSipPort::outgoing_send") {
+ // Nothing to do
+ } // End of constructor
+
+ ImsMonitorSipPort::~ImsMonitorSipPort() {
+ loggers::get_instance().log(">>> ImsMonitorSipPort::~ImsMonitorSipPort");
+
+ if (_layer != nullptr) {
+ delete _layer;
+ }
+ } // End of destructor
+
+ void ImsMonitorSipPort::set_parameter(const char * parameter_name, const char * parameter_value)
+ {
+ loggers::get_instance().log("ImsMonitorSipPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ _cfg_params.insert(std::pair(std::string(parameter_name), std::string(parameter_value)));
+ }
+
+ /*void ImsMonitorSipPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void ImsMonitorSipPort::Handle_Fd_Event_Error(int /*fd*/)
+ {
+
+ }
+
+ void ImsMonitorSipPort::Handle_Fd_Event_Writable(int /*fd*/)
+ {
+
+ }
+
+ void ImsMonitorSipPort::Handle_Fd_Event_Readable(int /*fd*/)
+ {
+
+ }
+
+ /*void ImsMonitorSipPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void ImsMonitorSipPort::user_map(const char * system_port)
+ {
+ loggers::get_instance().log(">>> ImsMonitorSipPort::user_map: %s", system_port);
+ // Build layer stack
+ /*params::iterator it = _cfg_params.find(std::string("params"));
+ if (it != _cfg_params.end()) {
+ loggers::get_instance().log("ImsMonitorSipPort::user_map: %s", it->second.c_str());
+ // Setup parameters
+ params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
+ // Create layer
+ _layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
+ if (static_cast(_layer) == nullptr) {
+ loggers::get_instance().error("ImsMonitorSipPort::user_map: Invalid stack configuration: %s", it->second.c_str());
+ }
+ static_cast(_layer)->add_upper_port(this);
+
+ } else {*/
+ loggers::get_instance().error("ImsMonitorSipPort::user_map: No layers defined in configuration file");
+ /*}*/
+ } // End of user_map method
+
+ void ImsMonitorSipPort::user_unmap(const char * system_port)
+ {
+ loggers::get_instance().log(">>> ImsMonitorSipPort::user_unmap: %s", system_port);
+
+ // Reset layers
+ if (_layer != nullptr) {
+ delete _layer;
+ _layer = nullptr;
+ }
+ } // End of user_unmap method
+
+ void ImsMonitorSipPort::user_start()
+ {
+ loggers::get_instance().log(">>> ImsMonitorSipPort::user_start");
+
+ } // End of user_start method
+
+ void ImsMonitorSipPort::user_stop()
+ {
+ loggers::get_instance().log(">>> ImsMonitorSipPort::user_stop");
+
+ } // End of user_stop method
+
+ void ImsMonitorSipPort::receiveMsg (const LibSip__SIPTypesAndValues::Request& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> ImsMonitorSipPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+ } // End of method receiveMsg
+
+ void ImsMonitorSipPort::receiveMsg (const LibSip__SIPTypesAndValues::Response& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> ImsMonitorSipPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+ } // End of method receiveMsg
+
+ void ImsMonitorSipPort::receiveMsg (const LibMsrp__TypesAndValues::SEND__request& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> ImsMonitorSipPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+ } // End of method receiveMsg
+
+ void ImsMonitorSipPort::receiveMsg (const LibMsrp__TypesAndValues::RECEIVE__response& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> ImsMonitorSipPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+ } // End of method receiveMsg
+
+}
+
diff --git a/ccsrc/Ports/ImsMonitorSipPort/ImsMonitorSipPort.hh b/ccsrc/Ports/ImsMonitorSipPort/ImsMonitorSipPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..93f6d574344ca7ddb40486147414c05b0a5a767f
--- /dev/null
+++ b/ccsrc/Ports/ImsMonitorSipPort/ImsMonitorSipPort.hh
@@ -0,0 +1,50 @@
+#pragma once
+
+#include "AtsImsIot_TestSystem.hh"
+#include "LibSip_Interface.hh"
+#include "LibMsrp_TypesAndValues.hh"
+
+#include "layer.hh"
+#include "params.hh"
+
+namespace LibSip__SIPTypesAndValues {
+ class REGISTER__Request;
+}
+
+namespace AtsImsIot__TestSystem {
+
+ class ImsMonitorSipPort : public ImsMonitorSipPort_BASE {
+ params _cfg_params;
+ params _layer_params;
+ layer* _layer;
+ std::string _time_key;
+ public:
+ ImsMonitorSipPort(const char *par_port_name);
+ ~ImsMonitorSipPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+
+ void receiveMsg (const LibSip__SIPTypesAndValues::Request& p_ind, const params& p_params);
+ void receiveMsg (const LibSip__SIPTypesAndValues::Response& p_ind, const params& p_params);
+ void receiveMsg (const LibMsrp__TypesAndValues::SEND__request& p_ind, const params& p_params);
+ void receiveMsg (const LibMsrp__TypesAndValues::RECEIVE__response& p_ind, const params& p_params);
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+
+ }; // End of class ImsMonitorSipPort
+
+}
+
diff --git a/ccsrc/Ports/ImsMonitorSipPort/module.mk b/ccsrc/Ports/ImsMonitorSipPort/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..e65eb1e35331f3c34bc9aca925c3fcc4e2966b0c
--- /dev/null
+++ b/ccsrc/Ports/ImsMonitorSipPort/module.mk
@@ -0,0 +1,3 @@
+sources := ImsMonitorSipPort.cc
+includes := .
+
diff --git a/ccsrc/Ports/LibDiameter/DiameterPort.cc b/ccsrc/Ports/LibDiameter/DiameterPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7900fb417ada69a3a1f89c04ffdf3af971b1af81
--- /dev/null
+++ b/ccsrc/Ports/LibDiameter/DiameterPort.cc
@@ -0,0 +1,113 @@
+#include "DiameterPort.hh"
+#include "diameter_layer_factory.hh"
+#include "loggers.hh"
+
+namespace LibDiameter__Interface {
+
+ DiameterPort::DiameterPort(const char *par_port_name): DiameterPort_BASE(par_port_name), _cfg_params(), _layer_params(), _layer(nullptr), _time_key("DiameterPort::outgoing_send") {
+ // Nothing to do
+ } // End of constructor
+
+ DiameterPort::~DiameterPort() {
+ loggers::get_instance().log(">>> DiameterPort::~DiameterPort");
+
+ if (_layer != nullptr) {
+ delete _layer;
+ }
+ } // End of destructor
+
+ void DiameterPort::set_parameter(const char * parameter_name, const char * parameter_value)
+ {
+ loggers::get_instance().log("DiameterPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ _cfg_params.insert(std::pair(std::string(parameter_name), std::string(parameter_value)));
+ }
+
+ /*void DiameterPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void DiameterPort::Handle_Fd_Event_Error(int /*fd*/)
+ {
+
+ }
+
+ void DiameterPort::Handle_Fd_Event_Writable(int /*fd*/)
+ {
+
+ }
+
+ void DiameterPort::Handle_Fd_Event_Readable(int /*fd*/)
+ {
+
+ }
+
+ /*void DiameterPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void DiameterPort::user_map(const char * system_port)
+ {
+ loggers::get_instance().log(">>> DiameterPort::user_map: %s", system_port);
+ // Build layer stack
+ params::iterator it = _cfg_params.find(std::string("params"));
+ if (it != _cfg_params.end()) {
+ loggers::get_instance().log("DiameterPort::user_map: %s", it->second.c_str());
+ // Setup parameters
+ params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
+ // Create layer
+ _layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
+ if (static_cast(_layer) == nullptr) {
+ loggers::get_instance().error("DiameterPort::user_map: Invalid stack configuration: %s", it->second.c_str());
+ }
+ static_cast(_layer)->add_upper_port(this);
+
+ } else {
+ loggers::get_instance().error("DiameterPort::user_map: No layers defined in configuration file");
+ }
+ } // End of user_map method
+
+ void DiameterPort::user_unmap(const char * system_port)
+ {
+ loggers::get_instance().log(">>> DiameterPort::user_unmap: %s", system_port);
+
+ // Reset layers
+ if (_layer != nullptr) {
+ delete _layer;
+ _layer = nullptr;
+ }
+ } // End of user_unmap method
+
+ void DiameterPort::user_start()
+ {
+ loggers::get_instance().log(">>> DiameterPort::user_start");
+
+ } // End of user_start method
+
+ void DiameterPort::user_stop()
+ {
+ loggers::get_instance().log(">>> DiameterPort::user_stop");
+
+ } // End of user_stop method
+
+ void DiameterPort::receiveMsg (const LibDiameter__TypesAndValues::DIAMETER__MSG& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> DiameterPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+
+ } // End of method receiveMsg
+
+ void DiameterPort::outgoing_send(const LibDiameter__TypesAndValues::DIAMETER__MSG& send_par)
+ {
+ loggers::get_instance().log_msg(">>> DiameterPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ } // End of outgoing_send
+
+}
+
diff --git a/ccsrc/Ports/LibDiameter/DiameterPort.hh b/ccsrc/Ports/LibDiameter/DiameterPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..523b9d949c9fb58176af727ffb040f4572822fd8
--- /dev/null
+++ b/ccsrc/Ports/LibDiameter/DiameterPort.hh
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "LibDiameter_Interface.hh"
+
+#include "layer.hh"
+#include "params.hh"
+
+namespace LibDiameter__Interface {
+
+ class DiameterPort : public DiameterPort_BASE {
+ params _cfg_params;
+ params _layer_params;
+ layer* _layer;
+ std::string _time_key;
+ public:
+ DiameterPort(const char *par_port_name);
+ ~DiameterPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+
+ void receiveMsg (const LibDiameter__TypesAndValues::DIAMETER__MSG& p_ind, const params& p_params);
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+
+ protected:
+ virtual void outgoing_send(const LibDiameter__TypesAndValues::DIAMETER__MSG& send_par);
+ }; // End of class DiameterPort
+
+}
+
diff --git a/ccsrc/Ports/LibDiameter/LowerLayerPPort.cc b/ccsrc/Ports/LibDiameter/LowerLayerPPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8978f6daa70e8467c4395598d7ef88881a72b850
--- /dev/null
+++ b/ccsrc/Ports/LibDiameter/LowerLayerPPort.cc
@@ -0,0 +1,113 @@
+#include "LowerLayerPPort.hh"
+#include "lower_layer_pport_layer_factory.hh"
+#include "loggers.hh"
+
+namespace LibDiameter__Interface {
+
+ LowerLayerPPort::LowerLayerPPort(const char *par_port_name): LowerLayerPPort_BASE(par_port_name), _cfg_params(), _layer_params(), _layer(nullptr), _time_key("LowerLayerPPort::outgoing_send") {
+ // Nothing to do
+ } // End of constructor
+
+ LowerLayerPPort::~LowerLayerPPort() {
+ loggers::get_instance().log(">>> LowerLayerPPort::~LowerLayerPPort");
+
+ if (_layer != nullptr) {
+ delete _layer;
+ }
+ } // End of destructor
+
+ void LowerLayerPPort::set_parameter(const char * parameter_name, const char * parameter_value)
+ {
+ loggers::get_instance().log("LowerLayerPPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ _cfg_params.insert(std::pair(std::string(parameter_name), std::string(parameter_value)));
+ }
+
+ /*void LowerLayerPPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void LowerLayerPPort::Handle_Fd_Event_Error(int /*fd*/)
+ {
+
+ }
+
+ void LowerLayerPPort::Handle_Fd_Event_Writable(int /*fd*/)
+ {
+
+ }
+
+ void LowerLayerPPort::Handle_Fd_Event_Readable(int /*fd*/)
+ {
+
+ }
+
+ /*void LowerLayerPPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void LowerLayerPPort::user_map(const char * system_port)
+ {
+ loggers::get_instance().log(">>> LowerLayerPPort::user_map: %s", system_port);
+ // Build layer stack
+ params::iterator it = _cfg_params.find(std::string("params"));
+ if (it != _cfg_params.end()) {
+ loggers::get_instance().log("LowerLayerPPort::user_map: %s", it->second.c_str());
+ // Setup parameters
+ params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
+ // Create layer
+ _layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
+ if (static_cast(_layer) == nullptr) {
+ loggers::get_instance().error("LowerLayerPPort::user_map: Invalid stack configuration: %s", it->second.c_str());
+ }
+ static_cast(_layer)->add_upper_port(this);
+
+ } else {
+ loggers::get_instance().error("LowerLayerPPort::user_map: No layers defined in configuration file");
+ }
+ } // End of user_map method
+
+ void LowerLayerPPort::user_unmap(const char * system_port)
+ {
+ loggers::get_instance().log(">>> LowerLayerPPort::user_unmap: %s", system_port);
+
+ // Reset layers
+ if (_layer != nullptr) {
+ delete _layer;
+ _layer = nullptr;
+ }
+ } // End of user_unmap method
+
+ void LowerLayerPPort::user_start()
+ {
+ loggers::get_instance().log(">>> LowerLayerPPort::user_start");
+
+ } // End of user_start method
+
+ void LowerLayerPPort::user_stop()
+ {
+ loggers::get_instance().log(">>> LowerLayerPPort::user_stop");
+
+ } // End of user_stop method
+
+ void LowerLayerPPort::receiveMsg (const LibDiameter__TypesAndValues::Lower__Layer__Primitive& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> LowerLayerPPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+
+ } // End of method receiveMsg
+
+ void LowerLayerPPort::outgoing_send(const LibDiameter__TypesAndValues::Lower__Layer__Primitive& send_par)
+ {
+ loggers::get_instance().log_msg(">>> LowerLayerPPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ } // End of outgoing_send
+
+}
+
diff --git a/ccsrc/Ports/LibDiameter/LowerLayerPPort.hh b/ccsrc/Ports/LibDiameter/LowerLayerPPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..4f517f515a21e96b654a8cc6583243e2517960c2
--- /dev/null
+++ b/ccsrc/Ports/LibDiameter/LowerLayerPPort.hh
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "LibDiameter_Interface.hh"
+
+#include "layer.hh"
+#include "params.hh"
+
+namespace LibDiameter__Interface {
+
+ class LowerLayerPPort : public LowerLayerPPort_BASE {
+ params _cfg_params;
+ params _layer_params;
+ layer* _layer;
+ std::string _time_key;
+ public:
+ LowerLayerPPort(const char *par_port_name);
+ ~LowerLayerPPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+
+ void receiveMsg (const LibDiameter__TypesAndValues::Lower__Layer__Primitive& p_ind, const params& p_params);
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+
+ protected:
+ virtual void outgoing_send(const LibDiameter__TypesAndValues::Lower__Layer__Primitive& send_par);
+ }; // End of class LowerLayerPPort
+
+}
+
diff --git a/ccsrc/Ports/LibDiameter/module.mk b/ccsrc/Ports/LibDiameter/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..3d9debd99e219570ebc2a99aa5f4509cd807aaa0
--- /dev/null
+++ b/ccsrc/Ports/LibDiameter/module.mk
@@ -0,0 +1,3 @@
+sources := DiameterPort.cc LowerLayerPPort.cc
+includes := .
+
diff --git a/ccsrc/Ports/LibHttp/HttpPort.cc b/ccsrc/Ports/LibHttp/HttpPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..30b524f94c26e02a0743a3d86b26df57425e565a
--- /dev/null
+++ b/ccsrc/Ports/LibHttp/HttpPort.cc
@@ -0,0 +1,117 @@
+#include "HttpPort.hh"
+#include "http_layer_factory.hh"
+#include "http_layer.hh"
+#include "http_codec_emtel.hh"
+#include "loggers.hh"
+
+#include "LibHttp_TypesAndValues.hh"
+
+namespace LibHttp__TestSystem {
+
+ HttpPort::HttpPort(const char *par_port_name): HttpPort_BASE(par_port_name), _cfg_params(), _layer_params(), _layer(nullptr), _time_key("HttpPort::outgoing_send") {
+ // Nothing to do
+ } // End of constructor
+
+ HttpPort::~HttpPort() {
+ loggers::get_instance().log(">>> HttpPort::~HttpPort");
+
+ if (_layer != nullptr) {
+ delete _layer;
+ }
+ } // End of destructor
+
+ void HttpPort::set_parameter(const char * parameter_name, const char * parameter_value)
+ {
+ loggers::get_instance().log("HttpPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ _cfg_params.insert(std::pair(std::string(parameter_name), std::string(parameter_value)));
+ }
+
+ /*void HttpPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void HttpPort::Handle_Fd_Event_Error(int /*fd*/)
+ {
+
+ }
+
+ void HttpPort::Handle_Fd_Event_Writable(int /*fd*/)
+ {
+
+ }
+
+ void HttpPort::Handle_Fd_Event_Readable(int /*fd*/)
+ {
+
+ }
+
+ /*void HttpPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void HttpPort::user_map(const char * system_port)
+ {
+ loggers::get_instance().log(">>> HttpPort::user_map: %s", system_port);
+ // Build layer stack
+ params::iterator it = _cfg_params.find(std::string("params"));
+ if (it != _cfg_params.end()) {
+ loggers::get_instance().log("HttpPort::user_map: %s", it->second.c_str());
+ // Setup parameters
+ params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
+ // Create layer
+ _layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
+ if (static_cast(_layer) == nullptr) {
+ loggers::get_instance().error("HttpPort::user_map: Invalid stack configuration: %s", it->second.c_str());
+ }
+ if (!static_cast(_layer)->set_codec(new http_codec_emtel())) {
+ loggers::get_instance().error("HttpPort::user_map: Null codec");
+ }
+ static_cast(_layer)->add_upper_port(this);
+ } else {
+ loggers::get_instance().error("HttpPort::user_map: No layers defined in configuration file");
+ }
+ } // End of user_map method
+
+ void HttpPort::user_unmap(const char * system_port)
+ {
+ loggers::get_instance().log(">>> HttpPort::user_unmap: %s", system_port);
+
+ // Reset layers
+ if (_layer != nullptr) {
+ delete _layer;
+ _layer = nullptr;
+ }
+ } // End of user_unmap method
+
+ void HttpPort::user_start()
+ {
+ loggers::get_instance().log(">>> HttpPort::user_start");
+
+ } // End of user_start method
+
+ void HttpPort::user_stop()
+ {
+ loggers::get_instance().log(">>> HttpPort::user_stop");
+
+ } // End of user_stop method
+
+ void HttpPort::outgoing_send(const LibHttp__TypesAndValues::HttpMessage& send_par)
+ {
+ loggers::get_instance().log_msg(">>> HttpPort::outgoing_send: payload=", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ }
+
+ void HttpPort::receiveMsg (const LibHttp__TypesAndValues::HttpMessage& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> HttpPort::receive_msg: ", p_ind);
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+ }
+
+} // End of namespace LibHttp__TestSystem
+
diff --git a/ccsrc/Ports/LibHttp/HttpPort.hh b/ccsrc/Ports/LibHttp/HttpPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..7d8b1af81630f28bced659562603e38caa50e05e
--- /dev/null
+++ b/ccsrc/Ports/LibHttp/HttpPort.hh
@@ -0,0 +1,46 @@
+#pragma once
+
+#include "LibHttp_TestSystem.hh"
+
+#include "layer.hh"
+#include "params.hh"
+
+namespace LibHttp__TypesAndValues {
+ class HttpMessage;
+}
+
+namespace LibHttp__TestSystem {
+
+ class HttpPort : public HttpPort_BASE {
+ params _cfg_params;
+ params _layer_params;
+ layer* _layer;
+ std::string _time_key;
+ public:
+ HttpPort(const char *par_port_name);
+ ~HttpPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+ void receiveMsg (const LibHttp__TypesAndValues::HttpMessage& p_ind, const params& p_params);
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+
+ protected:
+ void outgoing_send(const LibHttp__TypesAndValues::HttpMessage& send_par);
+ }; // End of class HttpPort
+
+} // End of namespace LibHttp__TestSystem
+
diff --git a/ccsrc/Ports/LibHttp/module.mk b/ccsrc/Ports/LibHttp/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..0fba8bd2e9442497d91fa111d95c889d4d57e139
--- /dev/null
+++ b/ccsrc/Ports/LibHttp/module.mk
@@ -0,0 +1,3 @@
+sources := HttpPort.cc
+includes := .
+
diff --git a/ccsrc/Ports/LibIot/AdapterConfigPort.cc b/ccsrc/Ports/LibIot/AdapterConfigPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f9f2f7bd5eccd3683f1ab6df50094d7828f07b4c
--- /dev/null
+++ b/ccsrc/Ports/LibIot/AdapterConfigPort.cc
@@ -0,0 +1,128 @@
+#include
+
+#include "loggers.hh"
+#include "registration.hh"
+
+#include "AdapterConfigPort.hh"
+
+//=============================================================================
+namespace LibIot__TestInterface {
+
+ AdapterConfigPort::AdapterConfigPort(const char *par_port_name) : AdapterConfigPort_BASE(par_port_name), _params() {
+ loggers::get_instance().log("AdapterConfigPort::AdapterConfigPort");
+ }
+
+ AdapterConfigPort::~AdapterConfigPort() {}
+
+ void AdapterConfigPort::set_parameter(const char *parameter_name, const char *parameter_value) {
+ loggers::get_instance().log("AdapterConfigPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ }
+
+ /*void AdapterConfigPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void AdapterConfigPort::Handle_Fd_Event_Error(int /*fd*/) {}
+
+ void AdapterConfigPort::Handle_Fd_Event_Writable(int /*fd*/) {}
+
+ void AdapterConfigPort::Handle_Fd_Event_Readable(int /*fd*/) {}
+
+ /*void AdapterConfigPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void AdapterConfigPort::user_map(const char *system_port) { loggers::get_instance().log(">>> AdapterConfigPort::user_map: %s", system_port); }
+
+ void AdapterConfigPort::user_unmap(const char *system_port) { loggers::get_instance().log(">>> AdapterConfigPort::user_unmap: %s", system_port); }
+
+ void AdapterConfigPort::user_start() {}
+
+ void AdapterConfigPort::user_stop() {}
+
+ void AdapterConfigPort::outgoing_send(const LibIot__TypesAndValues::GeneralConfigurationReq& send_par) {
+ loggers::get_instance().log_msg(">>> AdapterConfigPort::outgoing_send: ", send_par);
+
+ // Register this object for AdapterConfigPort
+/* geonetworking_layer *p = registration::get_instance().get_item(std::string("GN"));
+ if (p != NULL) {
+ loggers::get_instance().log("AdapterConfigPort::outgoing_send: Got GN layer %p", p);
+ LibIot__TypesAndValues::AcGnResponse response;
+ response.failure() = LibIot__TypesAndValues::AcGnResponseFailure(BOOLEAN(false));
+ if (send_par.ischosen(LibIot__TypesAndValues::AcGnPrimitive::ALT_startBeaconing)) {
+ loggers::get_instance().log("AdapterConfigPort::outgoing_send: Start beaconing");
+ p->start_beaconing(send_par.startBeaconing().beaconPacket());
+ // No response
+ return;
+ } else if (send_par.ischosen(LibIot__TypesAndValues::AcGnPrimitive::ALT_stopBeaconing)) {
+ loggers::get_instance().log("AdapterConfigPort::outgoing_send: Stop beaconing");
+ p->stop_beaconing();
+ // No response
+ return;
+ } else if (send_par.ischosen(LibIot__TypesAndValues::AcGnPrimitive::ALT_getLongPosVector)) {
+ loggers::get_instance().log("AdapterConfigPort::outgoing_send: Get LongPosVector");
+ const LibIot__TypesAndValues::LongPosVector *lpv = p->get_lpv(send_par.getLongPosVector().gnAddress());
+ loggers::get_instance().log("AdapterConfigPort::outgoing_send: Return value: %p", lpv);
+ if (lpv == nullptr) {
+ response.failure() = LibIot__TypesAndValues::AcGnResponseFailure(BOOLEAN(true));
+ } else {
+ response.getLongPosVector() = *lpv;
+ }
+ } else if (send_par.ischosen(LibIot__TypesAndValues::AcGnPrimitive::ALT_startPassBeaconing)) {
+ loggers::get_instance().log("AdapterConfigPort::outgoing_send: Start pass beaconing");
+ p->start_pass_beaconing(send_par.startPassBeaconing().beaconHeader());
+ // No response
+ return;
+ } else if (send_par.ischosen(LibIot__TypesAndValues::AcGnPrimitive::ALT_stopPassBeaconing)) {
+ loggers::get_instance().log("AdapterConfigPort::outgoing_send: Stop pass beaconing");
+ p->stop_pass_beaconing();
+ // No response
+ return;
+ } else {
+ response.failure() = LibIot__TypesAndValues::AcGnResponseFailure(BOOLEAN(true));
+ }
+ // Send response
+ loggers::get_instance().log_msg("AdapterConfigPort::outgoing_send: Send response: ", response);
+ incoming_message(response);
+ } else {*/
+ loggers::get_instance().error("AdapterConfigPort::outgoing_send: %s not registered", "geoNetworkingPort");
+ /*}*/
+ }
+
+ void AdapterConfigPort::outgoing_send(const LibIot__TypesAndValues::SetFilterReq& send_par) {
+ loggers::get_instance().log_msg(">>> AdapterConfigPort::outgoing_send: ", send_par);
+ }
+
+ void AdapterConfigPort::outgoing_send(const LibIot__TypesAndValues::StartTrafficCaptureReq& send_par) {
+ loggers::get_instance().log_msg(">>> AdapterConfigPort::outgoing_send: ", send_par);
+ }
+
+ void AdapterConfigPort::outgoing_send(const LibIot__TypesAndValues::StopTrafficCaptureReq& send_par) {
+ loggers::get_instance().log_msg(">>> AdapterConfigPort::outgoing_send: ", send_par);
+
+ // Register this object for AdapterConfigPort
+ /*geonetworking_layer *p = registration::get_instance().get_item(std::string("GN"));
+ if (p != NULL) {
+ loggers::get_instance().log("AdapterConfigPort::outgoing_send: Got GN layer %p", p);
+ LibItsCommon__TypesAndValues::AdapterControlResults response;
+ response.acSecResponse() = BOOLEAN(true);
+ if (send_par.ischosen(LibItsCommon__TypesAndValues::AcSecPrimitive::ALT_acEnableSecurity)) {
+ loggers::get_instance().log("AdapterConfigPort::outgoing_send: Enable secured mode");
+ std::string str(static_cast(send_par.acEnableSecurity().certificateId()));
+ if (p->enable_secured_mode(str, send_par.acEnableSecurity().enforceSecurity()) == -1) {
+ response.acSecResponse() = BOOLEAN(false);
+ }
+ } else if (send_par.ischosen(LibItsCommon__TypesAndValues::AcSecPrimitive::ALT_acDisableSecurity)) {
+ loggers::get_instance().log("AdapterConfigPort::outgoing_send: Disable secured mode");
+ if (p->disable_secured_mode() == -1) {
+ response.acSecResponse() = BOOLEAN(false);
+ }
+ } else {
+ response.acSecResponse() = BOOLEAN(false);
+ }
+ // Send response
+ loggers::get_instance().log_msg("AdapterConfigPort::outgoing_send: Send response: ", response);
+ incoming_message(response);
+ } else {*/
+ loggers::get_instance().error("AdapterConfigPort::outgoing_send: %s not registered", "geoNetworkingPort");
+ /*}*/
+ }
+
+} // namespace LibIot__TestInterface
diff --git a/ccsrc/Ports/LibIot/AdapterConfigPort.hh b/ccsrc/Ports/LibIot/AdapterConfigPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..2143db5d58f568205583d3fcffcf16c5bd7467db
--- /dev/null
+++ b/ccsrc/Ports/LibIot/AdapterConfigPort.hh
@@ -0,0 +1,42 @@
+#pragma once
+
+#include "LibIot_TestInterface.hh"
+
+#include "params.hh"
+
+namespace LibIot__TestInterface {
+
+ class AdapterConfigPort : public AdapterConfigPort_BASE {
+ params _params;
+
+ public:
+ AdapterConfigPort(const char *par_port_name = NULL);
+ ~AdapterConfigPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+
+ void outgoing_send(const LibIot__TypesAndValues::GeneralConfigurationReq &send_par);
+
+ void outgoing_send(const LibIot__TypesAndValues::SetFilterReq &send_par);
+
+ void outgoing_send(const LibIot__TypesAndValues::StartTrafficCaptureReq &send_par);
+
+ void outgoing_send(const LibIot__TypesAndValues::StopTrafficCaptureReq &send_par);
+ };
+
+} // namespace LibIot__TestInterface
+
diff --git a/ccsrc/Ports/LibIot/EquipmentAccessPort.cc b/ccsrc/Ports/LibIot/EquipmentAccessPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..78e945b24eb183481f4cf461af282a95fc535528
--- /dev/null
+++ b/ccsrc/Ports/LibIot/EquipmentAccessPort.cc
@@ -0,0 +1,113 @@
+#include "EquipmentAccessPort.hh"
+#include "upper_tester_layer_factory.hh"
+#include "loggers.hh"
+
+namespace LibIot__TestInterface {
+
+ EquipmentAccessPort::EquipmentAccessPort(const char *par_port_name): EquipmentAccessPort_BASE(par_port_name), _cfg_params(), _layer_params(), _layer(nullptr), _time_key("EquipmentAccessPort::outgoing_send") {
+ // Nothing to do
+ } // End of constructor
+
+ EquipmentAccessPort::~EquipmentAccessPort() {
+ loggers::get_instance().log(">>> EquipmentAccessPort::~EquipmentAccessPort");
+
+ if (_layer != nullptr) {
+ delete _layer;
+ }
+ } // End of destructor
+
+ void EquipmentAccessPort::set_parameter(const char * parameter_name, const char * parameter_value)
+ {
+ loggers::get_instance().log("EquipmentAccessPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ _cfg_params.insert(std::pair(std::string(parameter_name), std::string(parameter_value)));
+ }
+
+ /*void EquipmentAccessPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void EquipmentAccessPort::Handle_Fd_Event_Error(int /*fd*/)
+ {
+
+ }
+
+ void EquipmentAccessPort::Handle_Fd_Event_Writable(int /*fd*/)
+ {
+
+ }
+
+ void EquipmentAccessPort::Handle_Fd_Event_Readable(int /*fd*/)
+ {
+
+ }
+
+ /*void EquipmentAccessPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void EquipmentAccessPort::user_map(const char * system_port)
+ {
+ loggers::get_instance().log(">>> EquipmentAccessPort::user_map: %s", system_port);
+ // Build layer stack
+ params::iterator it = _cfg_params.find(std::string("params"));
+ if (it != _cfg_params.end()) {
+ loggers::get_instance().log("EquipmentAccessPort::user_map: %s", it->second.c_str());
+ // Setup parameters
+ params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
+ // Create layer
+ _layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
+ if (static_cast(_layer) == nullptr) {
+ loggers::get_instance().error("EquipmentAccessPort::user_map: Invalid stack configuration: %s", it->second.c_str());
+ }
+ static_cast(_layer)->add_upper_port(this);
+
+ } else {
+ loggers::get_instance().error("EquipmentAccessPort::user_map: No layers defined in configuration file");
+ }
+ } // End of user_map method
+
+ void EquipmentAccessPort::user_unmap(const char * system_port)
+ {
+ loggers::get_instance().log(">>> EquipmentAccessPort::user_unmap: %s", system_port);
+
+ // Reset layers
+ if (_layer != nullptr) {
+ delete _layer;
+ _layer = nullptr;
+ }
+ } // End of user_unmap method
+
+ void EquipmentAccessPort::user_start()
+ {
+ loggers::get_instance().log(">>> EquipmentAccessPort::user_start");
+
+ } // End of user_start method
+
+ void EquipmentAccessPort::user_stop()
+ {
+ loggers::get_instance().log(">>> EquipmentAccessPort::user_stop");
+
+ } // End of user_stop method
+
+ void EquipmentAccessPort::receiveMsg (const LibUpperTester::EquipmentOperationRsp& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> EquipmentAccessPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+
+ } // End of method receiveMsg
+
+ void EquipmentAccessPort::outgoing_send(const LibUpperTester::EquipmentOperationReq& send_par)
+ {
+ loggers::get_instance().log_msg(">>> EquipmentAccessPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ } // End of outgoing_send
+
+}
+
diff --git a/ccsrc/Ports/LibIot/EquipmentAccessPort.hh b/ccsrc/Ports/LibIot/EquipmentAccessPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..297ae4faae4151ffffaf7e1e14f214af4221d5e6
--- /dev/null
+++ b/ccsrc/Ports/LibIot/EquipmentAccessPort.hh
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "LibIot_TestInterface.hh"
+
+#include "layer.hh"
+#include "params.hh"
+
+namespace LibIot__TestInterface {
+
+ class EquipmentAccessPort : public EquipmentAccessPort_BASE {
+ params _cfg_params;
+ params _layer_params;
+ layer* _layer;
+ std::string _time_key;
+ public:
+ EquipmentAccessPort(const char *par_port_name);
+ ~EquipmentAccessPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+
+ void receiveMsg (const LibUpperTester::EquipmentOperationRsp& p_ind, const params& p_params);
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+
+ protected:
+ virtual void outgoing_send(const LibUpperTester::EquipmentOperationReq& send_par);
+ }; // End of class EquipmentAccessPort
+
+}
+
diff --git a/ccsrc/Ports/LibIot/module.mk b/ccsrc/Ports/LibIot/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..8c24c4b66a3baa366dea75935e683d25be937014
--- /dev/null
+++ b/ccsrc/Ports/LibIot/module.mk
@@ -0,0 +1,3 @@
+sources := EquipmentAccessPort.cc AdapterConfigPort.cc
+includes := .
+
diff --git a/ccsrc/Ports/LibSip/OperatorPort.hh b/ccsrc/Ports/LibSip/OperatorPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..a44d31675dfb7db40db280178d9149691301865c
--- /dev/null
+++ b/ccsrc/Ports/LibSip/OperatorPort.hh
@@ -0,0 +1,31 @@
+
+
+#pragma once
+
+#include "LibSip_Interface.hh"
+
+namespace LibSip__Interface {
+
+ class OperatorPort : public OperatorPort_BASE {
+ public:
+ OperatorPort(const char *par_port_name): OperatorPort_BASE(par_port_name) { };
+ ~OperatorPort() { };
+
+ protected:
+ virtual void outgoing_call(const s__SIP__conversation_call& call_par) { };
+ virtual void outgoing_call(const s__SIP__ringing_call& call_par) { };
+ virtual void outgoing_call(const s__SIP__announcementA_call& call_par) { };
+ virtual void outgoing_call(const s__SIP__announcementB_call& call_par) { };
+ virtual void outgoing_call(const s__SIP__announcement_call& call_par) { };
+ virtual void outgoing_call(const s__SIP__voiceMessage_call& call_par) { };
+ virtual void outgoing_call(const s__SIP__mediastopped_call& call_par) { };
+ virtual void outgoing_reply(const s__SIP__conversation_reply& reply_par) { };
+ virtual void outgoing_reply(const s__SIP__ringing_reply& reply_par) { };
+ virtual void outgoing_reply(const s__SIP__announcementA_reply& reply_par) { };
+ virtual void outgoing_reply(const s__SIP__announcementB_reply& reply_par) { };
+ virtual void outgoing_reply(const s__SIP__announcement_reply& reply_par) { };
+ virtual void outgoing_reply(const s__SIP__voiceMessage_reply& reply_par) { };
+ virtual void outgoing_reply(const s__SIP__mediastopped_reply& reply_par) { };
+ }; // End of class OperatorPort
+
+}
diff --git a/ccsrc/Ports/LibSip/SipPort.cc b/ccsrc/Ports/LibSip/SipPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cb54e167f57405bc51491b2bbbe4718ef96f800e
--- /dev/null
+++ b/ccsrc/Ports/LibSip/SipPort.cc
@@ -0,0 +1,246 @@
+#include "SipPort.hh"
+#include "sip_layer_factory.hh"
+#include "loggers.hh"
+
+namespace LibSip__Interface {
+
+ SipPort::SipPort(const char *par_port_name): SipPort_BASE(par_port_name), _cfg_params(), _layer_params(), _layer(nullptr), _time_key("SipPort::outgoing_send") {
+ // Nothing to do
+ } // End of constructor
+
+ SipPort::~SipPort() {
+ loggers::get_instance().log(">>> SipPort::~SipPort");
+
+ if (_layer != nullptr) {
+ delete _layer;
+ }
+ } // End of destructor
+
+ void SipPort::set_parameter(const char * parameter_name, const char * parameter_value)
+ {
+ loggers::get_instance().log("SipPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ _cfg_params.insert(std::pair(std::string(parameter_name), std::string(parameter_value)));
+ }
+
+ /*void SipPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void SipPort::Handle_Fd_Event_Error(int /*fd*/)
+ {
+
+ }
+
+ void SipPort::Handle_Fd_Event_Writable(int /*fd*/)
+ {
+
+ }
+
+ void SipPort::Handle_Fd_Event_Readable(int /*fd*/)
+ {
+
+ }
+
+ /*void SipPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void SipPort::user_map(const char * system_port)
+ {
+ loggers::get_instance().log(">>> SipPort::user_map: %s", system_port);
+ // Build layer stack
+ params::iterator it = _cfg_params.find(std::string("params"));
+ if (it != _cfg_params.end()) {
+ loggers::get_instance().log("SipPort::user_map: %s", it->second.c_str());
+ // Setup parameters
+ params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
+ // Create layer
+ _layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
+ if (static_cast(_layer) == nullptr) {
+ loggers::get_instance().error("SipPort::user_map: Invalid stack configuration: %s", it->second.c_str());
+ }
+ static_cast(_layer)->add_upper_port(this);
+
+ } else {
+ loggers::get_instance().error("SipPort::user_map: No layers defined in configuration file");
+ }
+ } // End of user_map method
+
+ void SipPort::user_unmap(const char * system_port)
+ {
+ loggers::get_instance().log(">>> SipPort::user_unmap: %s", system_port);
+
+ // Reset layers
+ if (_layer != nullptr) {
+ delete _layer;
+ _layer = nullptr;
+ }
+ } // End of user_unmap method
+
+ void SipPort::user_start()
+ {
+ loggers::get_instance().log(">>> SipPort::user_start");
+
+ } // End of user_start method
+
+ void SipPort::user_stop()
+ {
+ loggers::get_instance().log(">>> SipPort::user_stop");
+
+ } // End of user_stop method
+
+ void SipPort::receiveMsg (const LibSip__SIPTypesAndValues::Request& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> SipPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::REGISTER__E) {
+ incoming_message(LibSip__SIPTypesAndValues::REGISTER__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
+ } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::INVITE__E) {
+ incoming_message(LibSip__SIPTypesAndValues::INVITE__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
+ } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::SUBSCRIBE__E) {
+ incoming_message(LibSip__SIPTypesAndValues::SUBSCRIBE__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
+ } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::NOTIFY__E) {
+ incoming_message(LibSip__SIPTypesAndValues::NOTIFY__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
+ } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::BYE__E) {
+ incoming_message(LibSip__SIPTypesAndValues::BYE__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
+ } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::INFO__E) {
+ incoming_message(LibSip__SIPTypesAndValues::INFO__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
+ } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::OPTIONS__E) {
+ incoming_message(LibSip__SIPTypesAndValues::OPTIONS__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
+ } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::MESSAGE__E) {
+ incoming_message(LibSip__SIPTypesAndValues::MESSAGE__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
+ } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::CANCEL__E) {
+ incoming_message(LibSip__SIPTypesAndValues::CANCEL__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
+ } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::ACK__E) {
+ incoming_message(LibSip__SIPTypesAndValues::ACK__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
+ } else {
+ incoming_message(p_ind);
+ }
+ } // End of method receiveMsg
+
+ void SipPort::receiveMsg (const LibSip__SIPTypesAndValues::Response& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> SipPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+ } // End of method receiveMsg
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::INVITE__Request& send_par, const Address4SIP *destination_address)
+ {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ } // End of outgoing_send
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::ACK__Request& send_par, const Address4SIP *destination_address)
+ {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ } // End of outgoing_send
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::REGISTER__Request& send_par, const Address4SIP *destination_address) {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ }
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::SUBSCRIBE__Request& send_par, const Address4SIP *destination_address) {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ }
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::MESSAGE__Request& send_par, const Address4SIP *destination_address) {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ }
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::OPTIONS__Request& send_par, const Address4SIP *destination_address) {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ }
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::BYE__Request& send_par, const Address4SIP *destination_address) {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ }
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::CANCEL__Request& send_par, const Address4SIP *destination_address) {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ }
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::NOTIFY__Request& send_par, const Address4SIP *destination_address) {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ }
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::INFO__Request& send_par, const Address4SIP *destination_address) {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ }
+
+ void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::Response& send_par, const Address4SIP *destination_address) {
+ loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ }
+
+}
+
diff --git a/ccsrc/Ports/LibSip/SipPort.hh b/ccsrc/Ports/LibSip/SipPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..fc2edfaf56e68bf3598a5d14468a270c210a1bd3
--- /dev/null
+++ b/ccsrc/Ports/LibSip/SipPort.hh
@@ -0,0 +1,64 @@
+#pragma once
+
+#include "LibSip_Interface.hh"
+
+#include "layer.hh"
+#include "params.hh"
+
+namespace LibSip__SIPTypesAndValues {
+ class REGISTER__Request;
+}
+
+namespace LibSip__Interface {
+
+ class SipPort : public SipPort_BASE {
+ params _cfg_params;
+ params _layer_params;
+ layer* _layer;
+ std::string _time_key;
+ public:
+ SipPort(const char *par_port_name);
+ ~SipPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+
+ void receiveMsg (const LibSip__SIPTypesAndValues::Request& p_ind, const params& p_params);
+ void receiveMsg (const LibSip__SIPTypesAndValues::Response& p_ind, const params& p_params);
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+
+ protected:
+ virtual void outgoing_send(const LibSip__SIPTypesAndValues::Request& send_par, const Address4SIP *destination_address) { };
+ void outgoing_send(const LibSip__SIPTypesAndValues::REGISTER__Request& send_par, const Address4SIP *destination_address);
+ void outgoing_send(const LibSip__SIPTypesAndValues::INVITE__Request& send_par, const Address4SIP *destination_address);
+ void outgoing_send(const LibSip__SIPTypesAndValues::OPTIONS__Request& send_par, const Address4SIP *destination_address);
+ void outgoing_send(const LibSip__SIPTypesAndValues::BYE__Request& send_par, const Address4SIP *destination_address);
+ void outgoing_send(const LibSip__SIPTypesAndValues::CANCEL__Request& send_par, const Address4SIP *destination_address);
+ void outgoing_send(const LibSip__SIPTypesAndValues::ACK__Request& send_par, const Address4SIP *destination_address);
+ virtual void outgoing_send(const LibSip__SIPTypesAndValues::PRACK__Request& send_par, const Address4SIP *destination_address) { };
+ void outgoing_send(const LibSip__SIPTypesAndValues::NOTIFY__Request& send_par, const Address4SIP *destination_address);
+ void outgoing_send(const LibSip__SIPTypesAndValues::SUBSCRIBE__Request& send_par, const Address4SIP *destination_address);
+ virtual void outgoing_send(const LibSip__SIPTypesAndValues::PUBLISH__Request& send_par, const Address4SIP *destination_address) { };
+ virtual void outgoing_send(const LibSip__SIPTypesAndValues::UPDATE__Request& send_par, const Address4SIP *destination_address) { };
+ virtual void outgoing_send(const LibSip__SIPTypesAndValues::REFER__Request& send_par, const Address4SIP *destination_address) { };
+ void outgoing_send(const LibSip__SIPTypesAndValues::MESSAGE__Request& send_par, const Address4SIP *destination_address);
+ void outgoing_send(const LibSip__SIPTypesAndValues::INFO__Request& send_par, const Address4SIP *destination_address);
+ void outgoing_send(const LibSip__SIPTypesAndValues::Response& send_par, const Address4SIP *destination_address);
+ virtual void outgoing_send(const CHARSTRING& send_par, const Address4SIP *destination_address) { };
+ }; // End of class SipPort
+
+}
+
diff --git a/ccsrc/Ports/LibSip/module.mk b/ccsrc/Ports/LibSip/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..7c599702e1dfe14d409117e77e97eed48f9d306f
--- /dev/null
+++ b/ccsrc/Ports/LibSip/module.mk
@@ -0,0 +1,3 @@
+sources := SipPort.cc
+includes := .
+
diff --git a/ccsrc/Ports/Naptr/NaptrPort.cc b/ccsrc/Ports/Naptr/NaptrPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ee3b9bf069c86e4a648981099b41a5f654e09e4b
--- /dev/null
+++ b/ccsrc/Ports/Naptr/NaptrPort.cc
@@ -0,0 +1,113 @@
+#include "NaptrPort.hh"
+#include "naptrPort_layer_factory.hh"
+#include "loggers.hh"
+
+namespace AtsImsIot__TestSystem {
+
+ NaptrPort::NaptrPort(const char *par_port_name): NaptrPort_BASE(par_port_name), _cfg_params(), _layer_params(), _layer(nullptr), _time_key("NaptrPort::outgoing_send") {
+ // Nothing to do
+ } // End of constructor
+
+ NaptrPort::~NaptrPort() {
+ loggers::get_instance().log(">>> NaptrPort::~NaptrPort");
+
+ if (_layer != nullptr) {
+ delete _layer;
+ }
+ } // End of destructor
+
+ void NaptrPort::set_parameter(const char * parameter_name, const char * parameter_value)
+ {
+ loggers::get_instance().log("NaptrPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ _cfg_params.insert(std::pair(std::string(parameter_name), std::string(parameter_value)));
+ }
+
+ /*void NaptrPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void NaptrPort::Handle_Fd_Event_Error(int /*fd*/)
+ {
+
+ }
+
+ void NaptrPort::Handle_Fd_Event_Writable(int /*fd*/)
+ {
+
+ }
+
+ void NaptrPort::Handle_Fd_Event_Readable(int /*fd*/)
+ {
+
+ }
+
+ /*void NaptrPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void NaptrPort::user_map(const char * system_port)
+ {
+ loggers::get_instance().log(">>> NaptrPort::user_map: %s", system_port);
+ // Build layer stack
+ params::iterator it = _cfg_params.find(std::string("params"));
+ if (it != _cfg_params.end()) {
+ loggers::get_instance().log("NaptrPort::user_map: %s", it->second.c_str());
+ // Setup parameters
+ params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
+ // Create layer
+ _layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
+ if (static_cast(_layer) == nullptr) {
+ loggers::get_instance().error("NaptrPort::user_map: Invalid stack configuration: %s", it->second.c_str());
+ }
+ static_cast(_layer)->add_upper_port(this);
+
+ } else {
+ loggers::get_instance().error("NaptrPort::user_map: No layers defined in configuration file");
+ }
+ } // End of user_map method
+
+ void NaptrPort::user_unmap(const char * system_port)
+ {
+ loggers::get_instance().log(">>> NaptrPort::user_unmap: %s", system_port);
+
+ // Reset layers
+ if (_layer != nullptr) {
+ delete _layer;
+ _layer = nullptr;
+ }
+ } // End of user_unmap method
+
+ void NaptrPort::user_start()
+ {
+ loggers::get_instance().log(">>> NaptrPort::user_start");
+
+ } // End of user_start method
+
+ void NaptrPort::user_stop()
+ {
+ loggers::get_instance().log(">>> NaptrPort::user_stop");
+
+ } // End of user_stop method
+
+ void NaptrPort::receiveMsg (const AtsImsIot__TypesAndValues::NAPTRmessage& p_ind, const params& p_params) {
+ loggers::get_instance().log_msg(">>> NaptrPort::receive_msg: ", p_ind);
+
+ // Sanity check
+ if (!p_ind.is_bound()) {
+ return;
+ }
+
+ incoming_message(p_ind);
+
+ } // End of method receiveMsg
+
+ void NaptrPort::outgoing_send(const AtsImsIot__TypesAndValues::NAPTRmessage& send_par)
+ {
+ loggers::get_instance().log_msg(">>> NaptrPort::outgoing_send: ", send_par);
+
+ float duration;
+ loggers::get_instance().set_start_time(_time_key);
+ params params;
+ static_cast(_layer)->sendMsg(send_par, params);
+ loggers::get_instance().set_stop_time(_time_key, duration);
+ } // End of outgoing_send
+
+}
+
diff --git a/ccsrc/Ports/Naptr/NaptrPort.hh b/ccsrc/Ports/Naptr/NaptrPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..b573737dbab12e0d8f0e0ca593b773091657321e
--- /dev/null
+++ b/ccsrc/Ports/Naptr/NaptrPort.hh
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "AtsImsIot_TestSystem.hh"
+
+#include "layer.hh"
+#include "params.hh"
+
+namespace AtsImsIot__TestSystem {
+
+ class NaptrPort : public NaptrPort_BASE {
+ params _cfg_params;
+ params _layer_params;
+ layer* _layer;
+ std::string _time_key;
+ public:
+ NaptrPort(const char *par_port_name);
+ ~NaptrPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+
+ void receiveMsg (const AtsImsIot__TypesAndValues::NAPTRmessage& p_ind, const params& p_params);
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+
+ protected:
+ virtual void outgoing_send(const AtsImsIot__TypesAndValues::NAPTRmessage& send_par);
+ }; // End of class NaptrPort
+
+}
+
diff --git a/ccsrc/Ports/Naptr/module.mk b/ccsrc/Ports/Naptr/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..aeb30dec26ac874b86cbb85363cd1f52017d1ed7
--- /dev/null
+++ b/ccsrc/Ports/Naptr/module.mk
@@ -0,0 +1,3 @@
+sources := NaptrPort.cc
+includes := .
+
diff --git a/ccsrc/Ports/Sgi/SgiPort.cc b/ccsrc/Ports/Sgi/SgiPort.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8d766fd3eacb76da305daadf118057513866d368
--- /dev/null
+++ b/ccsrc/Ports/Sgi/SgiPort.cc
@@ -0,0 +1,73 @@
+#include "SgiPort.hh"
+#include "loggers.hh"
+
+namespace AtsImsIot__TestSystem {
+
+ SgiPort::SgiPort(const char *par_port_name): SgiPort_BASE(par_port_name), _cfg_params(), _layer_params(), _layer(nullptr), _time_key("SgiPort::outgoing_send") {
+ // Nothing to do
+ } // End of constructor
+
+ SgiPort::~SgiPort() {
+ loggers::get_instance().log(">>> SgiPort::~SgiPort");
+
+ if (_layer != nullptr) {
+ delete _layer;
+ }
+ } // End of destructor
+
+ void SgiPort::set_parameter(const char * parameter_name, const char * parameter_value)
+ {
+ loggers::get_instance().log("SgiPort::set_parameter: %s=%s", parameter_name, parameter_value);
+ _cfg_params.insert(std::pair(std::string(parameter_name), std::string(parameter_value)));
+ }
+
+ /*void SgiPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+ void SgiPort::Handle_Fd_Event_Error(int /*fd*/)
+ {
+
+ }
+
+ void SgiPort::Handle_Fd_Event_Writable(int /*fd*/)
+ {
+
+ }
+
+ void SgiPort::Handle_Fd_Event_Readable(int /*fd*/)
+ {
+
+ }
+
+ /*void SgiPort::Handle_Timeout(double time_since_last_call) {}*/
+
+ void SgiPort::user_map(const char * system_port)
+ {
+ loggers::get_instance().log(">>> SgiPort::user_map: %s", system_port);
+ } // End of user_map method
+
+ void SgiPort::user_unmap(const char * system_port)
+ {
+ loggers::get_instance().log(">>> SgiPort::user_unmap: %s", system_port);
+
+ // Reset layers
+ if (_layer != nullptr) {
+ delete _layer;
+ _layer = nullptr;
+ }
+ } // End of user_unmap method
+
+ void SgiPort::user_start()
+ {
+ loggers::get_instance().log(">>> SgiPort::user_start");
+
+ } // End of user_start method
+
+ void SgiPort::user_stop()
+ {
+ loggers::get_instance().log(">>> SgiPort::user_stop");
+
+ } // End of user_stop method
+
+}
+
diff --git a/ccsrc/Ports/Sgi/SgiPort.hh b/ccsrc/Ports/Sgi/SgiPort.hh
new file mode 100644
index 0000000000000000000000000000000000000000..740373911762eaef7bcc3b9d512a80b38fa9bca8
--- /dev/null
+++ b/ccsrc/Ports/Sgi/SgiPort.hh
@@ -0,0 +1,42 @@
+#pragma once
+
+#include "AtsImsIot_TestSystem.hh"
+
+#include "layer.hh"
+#include "params.hh"
+
+namespace AtsImsIot__TestSystem {
+
+ class SgiPort : public SgiPort_BASE {
+ params _cfg_params;
+ params _layer_params;
+ layer* _layer;
+ std::string _time_key;
+ public:
+ SgiPort(const char *par_port_name);
+ ~SgiPort();
+
+ void set_parameter(const char *parameter_name, const char *parameter_value);
+
+ void receiveMsg (const CHARSTRING& p_ind, const params& p_params) {};
+
+ private:
+ /* void Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error); */
+ void Handle_Fd_Event_Error(int fd);
+ void Handle_Fd_Event_Writable(int fd);
+ void Handle_Fd_Event_Readable(int fd);
+ /* void Handle_Timeout(double time_since_last_call); */
+
+ protected:
+ void user_map(const char *system_port);
+ void user_unmap(const char *system_port);
+
+ void user_start();
+ void user_stop();
+
+ protected:
+ }; // End of class SgiPort
+
+}
+
diff --git a/ccsrc/Ports/Sgi/module.mk b/ccsrc/Ports/Sgi/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..58a9d0b52c3c4002914bdb6a9a2aac00a1cdcc15
--- /dev/null
+++ b/ccsrc/Ports/Sgi/module.mk
@@ -0,0 +1,3 @@
+sources := SgiPort.cc
+includes := .
+
diff --git a/ccsrc/Protocols/Diameter/avp.cc b/ccsrc/Protocols/Diameter/avp.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ad6ce3c9479130da51bebd2c9902fb88b1aac9c3
--- /dev/null
+++ b/ccsrc/Protocols/Diameter/avp.cc
@@ -0,0 +1,87 @@
+#include
+
+#include "avp.hh"
+
+#include "loggers.hh"
+#include "converter.hh"
+
+avp::avp(const int p_code, const unsigned char p_vendor_specific, const unsigned char p_mandatory, const unsigned char p_protected_, const int p_length, const int p_vendor_id, const int p_encoded_length, const std::vector p_payload) : _code(p_code), _vendor_specific(p_vendor_specific), _mandatory(p_mandatory), _protected_(p_protected_), _length(p_length), _vendor_id(p_vendor_id), _encoded_length(p_encoded_length), _payload(p_payload), _avp_header(LibDiameter__Types__Base__AVPs::AVP__Header(p_code, LibDiameter__Types__Base__AVPs::AVP__Flags( int2bit(p_vendor_specific, 1), int2bit(p_mandatory, 1), int2bit(p_protected_, 1), int2bit(0, 5)), p_length, (p_vendor_specific == 0) ? OPTIONAL(OPTIONAL_OMIT) : OPTIONAL(p_vendor_id))), _enc_avp() {
+ loggers::get_instance().log_msg("avp::avp (1): _avp_header:", _avp_header);
+ loggers::get_instance().log_to_hexa("avp::avp (1): _payload:", _payload.data(), _payload.size());
+} // End of ctor
+
+avp::avp(const int p_code, const unsigned char p_vendor_specific, const unsigned char p_mandatory, const unsigned char p_protected_, const int p_length, const int p_vendor_id, const int p_encoded_length, const std::vector p_payload, const OCTETSTRING& p_enc_avp) : _code(p_code), _vendor_specific(p_vendor_specific), _mandatory(p_mandatory), _protected_(p_protected_), _length(p_length), _vendor_id(p_vendor_id), _encoded_length(p_encoded_length), _payload(p_payload), _avp_header(LibDiameter__Types__Base__AVPs::AVP__Header(p_code, LibDiameter__Types__Base__AVPs::AVP__Flags( int2bit(p_vendor_specific, 1), int2bit(p_mandatory, 1), int2bit(p_protected_, 1), int2bit(0, 5)), p_length, (p_vendor_specific == 0) ? OPTIONAL(OPTIONAL_OMIT) : OPTIONAL(p_vendor_id))), _enc_avp(p_enc_avp) {
+ loggers::get_instance().log_msg("avp::avp (2): _avp_header:", _avp_header);
+ loggers::get_instance().log_to_hexa("avp::avp (2): _payload:", _payload.data(), _payload.size());
+ loggers::get_instance().log_msg("avp::avp (2): _enc_avp:", _enc_avp);
+} // End of ctor
+
+int avp::get_code() const {
+ return _code;
+}
+
+int avp::decode_session_id(LibDiameter__Types__Base__AVPs::Session__Id__AVP& p_avp) const {
+ loggers::get_instance().log(">>> avp::decode_session_id: '%d'", _code);
+ loggers::get_instance().log_to_hexa("avp::decode_session_id: _payload:", _payload.data(), _payload.size());
+
+ p_avp = LibDiameter__Types__Base__AVPs::Session__Id__AVP(LibDiameter__Types__Base__AVPs::AVP__Header(_avp_header), CHARSTRING(converter::get_instance().bytes_to_string(_payload).c_str()));
+ loggers::get_instance().log_msg("avp::decode_session_id: p_avp:", p_avp);
+
+ return 0;
+}
+
+int avp::decode_auth_session_state(LibDiameter__Types__Base__AVPs::Auth__Session__State__AVP& p_avp) const {
+ loggers::get_instance().log(">>> avp::decode_auth_session_state: '%d'", _code);
+ loggers::get_instance().log_to_hexa("avp::decode_auth_session_state: _payload:", _payload.data(), _payload.size());
+
+ // Sanity checks
+ if (_payload.size() != 4) {
+ loggers::get_instance().warning("avp::decode_auth_session_state: Wrong payload length: '%d'", _payload.size());
+ return -1;
+ }
+ p_avp = LibDiameter__Types__Base__AVPs::Auth__Session__State__AVP(LibDiameter__Types__Base__AVPs::AVP__Header(_avp_header), LibDiameter__Types__Base__AVPs::Auth__Session__State__Type(_payload[0] << 24 || _payload[1] << 16 || _payload[2] << 8 || _payload[3]));
+ loggers::get_instance().log_msg("avp::decode_auth_session_state: p_avp:", p_avp);
+
+ return 0;
+}
+
+int avp::decode_origin_host(LibDiameter__Types__Base__AVPs::Origin__Host__AVP& p_avp) const {
+ loggers::get_instance().log(">>> avp::decode_origin_host: '%d'", _code);
+ loggers::get_instance().log_to_hexa("avp::decode_origin_host: _payload:", _payload.data(), _payload.size());
+
+ p_avp = LibDiameter__Types__Base__AVPs::Origin__Host__AVP(LibDiameter__Types__Base__AVPs::AVP__Header(_avp_header), CHARSTRING(converter::get_instance().bytes_to_string(_payload).c_str()));
+ loggers::get_instance().log_msg("avp::decode_origin_host: p_avp:", p_avp);
+
+ return 0;
+}
+
+int avp::decode_origin_realm(LibDiameter__Types__Base__AVPs::Origin__Realm__AVP& p_avp) const {
+ loggers::get_instance().log(">>> avp::decode_origin_realm: '%d'", _code);
+ loggers::get_instance().log_to_hexa("avp::decode_origin_realm: _payload:", _payload.data(), _payload.size());
+
+ p_avp = LibDiameter__Types__Base__AVPs::Origin__Realm__AVP(LibDiameter__Types__Base__AVPs::AVP__Header(_avp_header), CHARSTRING(converter::get_instance().bytes_to_string(_payload).c_str()));
+ loggers::get_instance().log_msg("avp::decode_origin_realm: p_avp:", p_avp);
+
+ return 0;
+}
+
+int avp::decode_destination_host(LibDiameter__Types__Base__AVPs::Destination__Host__AVP& p_avp) const {
+ loggers::get_instance().log(">>> avp::decode_destination_host: '%d'", _code);
+ loggers::get_instance().log_to_hexa("avp::decode_destination_host: _payload:", _payload.data(), _payload.size());
+
+ p_avp = LibDiameter__Types__Base__AVPs::Destination__Host__AVP(LibDiameter__Types__Base__AVPs::AVP__Header(_avp_header), CHARSTRING(converter::get_instance().bytes_to_string(_payload).c_str()));
+ loggers::get_instance().log_msg("avp::decode_destination_host: p_avp:", p_avp);
+
+ return 0;
+}
+
+int avp::decode_destination_realm(LibDiameter__Types__Base__AVPs::Destination__Realm__AVP& p_avp) const {
+ loggers::get_instance().log(">>> avp::decode_destination_realm: '%d'", _code);
+ loggers::get_instance().log_to_hexa("avp::decode_destination_realm: _payload:", _payload.data(), _payload.size());
+
+ p_avp = LibDiameter__Types__Base__AVPs::Destination__Realm__AVP(LibDiameter__Types__Base__AVPs::AVP__Header(_avp_header), CHARSTRING(converter::get_instance().bytes_to_string(_payload).c_str()));
+ loggers::get_instance().log_msg("avp::decode_destination_realm: p_avp:", p_avp);
+
+ return 0;
+}
+
diff --git a/ccsrc/Protocols/Diameter/avp.hh b/ccsrc/Protocols/Diameter/avp.hh
new file mode 100644
index 0000000000000000000000000000000000000000..dec2c6af4e6ca80c9f0bb5db82cb7093be441774
--- /dev/null
+++ b/ccsrc/Protocols/Diameter/avp.hh
@@ -0,0 +1,36 @@
+#pragma once
+
+#include
+#include
+
+
+#include "LibDiameter_TypesAndValues.hh"
+
+class avp {
+ const int _code;
+ const unsigned char _vendor_specific;
+ const unsigned char _mandatory;
+ const unsigned char _protected_;
+ const int _length;
+ const int _vendor_id;
+ const int _encoded_length;
+ const std::vector _payload;
+ const OCTETSTRING _enc_avp;
+ const LibDiameter__Types__Base__AVPs::AVP__Header _avp_header;
+public:
+ avp(const int p_code, const unsigned char p_vendor_specific, const unsigned char p_mandatory, const unsigned char p_protected_, const int p_length, const int p_vendor_id, const int p_encoded_length, const std::vector p_payload);
+ avp(const int p_code, const unsigned char p_vendor_specific, const unsigned char p_mandatory, const unsigned char p_protected_, const int p_length, const int p_vendor_id, const int p_encoded_length, const std::vector p_payload, const OCTETSTRING& p_enc_avp);
+ virtual ~avp() {};
+
+ int get_code() const;
+
+ int encode_auth_session_state(const LibDiameter__Types__Base__AVPs::Auth__Session__State__AVP& p_avp, std::unique_ptr& p_encoded_avp);
+
+ int decode_session_id(LibDiameter__Types__Base__AVPs::Session__Id__AVP& p_avp) const;
+ int decode_auth_session_state(LibDiameter__Types__Base__AVPs::Auth__Session__State__AVP& p_avp) const;
+ int decode_origin_host(LibDiameter__Types__Base__AVPs::Origin__Host__AVP& p_avp) const;
+ int decode_origin_realm(LibDiameter__Types__Base__AVPs::Origin__Realm__AVP& p_avp) const;
+ int decode_destination_host(LibDiameter__Types__Base__AVPs::Destination__Host__AVP& p_avp) const;
+ int decode_destination_realm(LibDiameter__Types__Base__AVPs::Destination__Realm__AVP& p_avp) const;
+
+}; // End of class avp
\ No newline at end of file
diff --git a/ccsrc/Protocols/Diameter/diameter_codec.cc b/ccsrc/Protocols/Diameter/diameter_codec.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4c2ee29fc5e3e163e0e8ffad58751928f90c1903
--- /dev/null
+++ b/ccsrc/Protocols/Diameter/diameter_codec.cc
@@ -0,0 +1,583 @@
+#include
+
+#include "LibDiameter_TypesAndValues.hh"
+
+#include "diameter_codec.hh"
+
+#include "loggers.hh"
+#include "converter.hh"
+
+template class OPTIONAL;
+class TTCN_Buffer;
+class TTCN_EncDec;
+
+diameter_codec::~diameter_codec() {
+ loggers::get_instance().log(">>> diameter_codec::~diameter_codec");
+ if (_avps.size() != 0) {
+ _avps.clear();
+ }
+}
+
+int diameter_codec::encode_header(const LibDiameter__TypesAndValues::DiameterHeader& p_header, TTCN_Buffer& p_encoding_buffer) {
+ loggers::get_instance().log_msg(">>> diameter_codec::encode_header: ", (const Base_Type &)p_header);
+
+ p_encoding_buffer.put_c(p_header.version());
+
+ p_encoding_buffer.put_c(static_cast((p_header.msglen() >> 16) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((p_header.msglen() >> 8) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((p_header.msglen()) & 0xFF));
+
+ unsigned char cmdflags = 0x00;
+ BITSTRING bit_set = int2bit(1, 1);
+ if (p_header.cmdflags().r__bit() == bit_set) {
+ cmdflags |= 0x80;
+ }
+ if (p_header.cmdflags().p__bit() == bit_set) {
+ cmdflags |= 0x40;
+ }
+ if (p_header.cmdflags().e__bit() == bit_set) {
+ cmdflags |= 0x20;
+ }
+ if (p_header.cmdflags().t__bit() == bit_set) {
+ cmdflags |= 0x10;
+ }
+ p_encoding_buffer.put_c(cmdflags);
+
+ int cmdcode = _command_codes[p_header.cmdcode()];
+ p_encoding_buffer.put_c(static_cast((cmdcode >> 16) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((cmdcode >> 8) & 0xFF));
+ p_encoding_buffer.put_c(static_cast(cmdcode & 0xFF));
+
+ p_encoding_buffer.put_c(static_cast((p_header.applid() >> 24) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((p_header.applid() >> 16) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((p_header.applid() >> 8) & 0xFF));
+ p_encoding_buffer.put_c(static_cast(p_header.applid() & 0xFF));
+
+ p_encoding_buffer.put_c(static_cast((p_header.hopid() >> 24) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((p_header.hopid() >> 16) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((p_header.hopid() >> 8) & 0xFF));
+ p_encoding_buffer.put_c(static_cast(p_header.hopid() & 0xFF));
+
+ p_encoding_buffer.put_c(static_cast((p_header.endid() >> 24) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((p_header.endid() >> 16) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((p_header.endid() >> 8) & 0xFF));
+ p_encoding_buffer.put_c(static_cast(p_header.endid() & 0xFF));
+
+ _avps.clear(); // unique_ptr class manages deletion of resources
+
+ loggers::get_instance().log_msg("<<< diameter_codec::encode_header: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+ return 0;
+} // End of method encode_header
+
+int diameter_codec::encode_session_id(const LibDiameter__Types__Base__AVPs::Session__Id__AVP& p_avp, TTCN_Buffer& p_encoding_buffer) {
+ loggers::get_instance().log_msg(">>> diameter_codec::encode_session_id: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+
+ // TODO Group
+
+ // Encode AVP header
+ int padding = 0;
+ if (encode_avp_header(p_avp.aVP__Header(), &padding, p_encoding_buffer) == -1) {
+ loggers::get_instance().warning("diameter_codec::encode_session_id: Failed to encode AVP header");
+ return -1;
+ }
+
+ const OCTETSTRING& os = unichar2oct(p_avp.aVP__Data());
+ p_encoding_buffer.put_string(os);
+
+ _avps.insert(
+ std::make_pair >(
+ p_avp.aVP__Header().aVP__Code(),
+ std::unique_ptr(
+ new avp(
+ p_avp.aVP__Header().aVP__Code(),
+ (p_avp.aVP__Header().aVP__vid().is_present()) ? 0x01 : 0x00,
+ (p_avp.aVP__Header().aVP__flags().m__bit()[0].get_bit()) ? 0x01 : 0x00,
+ (p_avp.aVP__Header().aVP__flags().p__bit()[0].get_bit()) ? 0x01 : 0x00,
+ p_avp.aVP__Header().aVP__len(),
+ (p_avp.aVP__Header().aVP__vid().is_present()) ? static_cast(static_cast(*p_avp.aVP__Header().aVP__vid().get_opt_value())) : 0,
+ p_avp.aVP__Header().aVP__len(),
+ std::vector(static_cast(os), static_cast(os) + os.lengthof()),
+ static_cast(OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()))
+ ))));
+
+ if (padding != 0) {
+ OCTETSTRING os = int2oct(0, padding);
+ p_encoding_buffer.put_string(os);
+ }
+
+ loggers::get_instance().log_msg("<<< diameter_codec::encode_session_id: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+ return 0;
+}
+
+int diameter_codec::encode_origin_host(const LibDiameter__Types__Base__AVPs::Origin__Host__AVP& p_avp, TTCN_Buffer& p_encoding_buffer) {
+ loggers::get_instance().log_msg(">>> diameter_codec::encode_origin_host: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+
+ // TODO Group
+
+ // Encode AVP header
+ int padding = 0;
+ if (encode_avp_header(p_avp.aVP__Header(), &padding, p_encoding_buffer) == -1) {
+ loggers::get_instance().warning("diameter_codec::encode_origin_host: Failed to encode AVP header");
+ return -1;
+ }
+
+ const OCTETSTRING& os = char2oct(p_avp.aVP__Data());
+ p_encoding_buffer.put_string(os);
+
+ _avps.insert(
+ std::make_pair >(
+ p_avp.aVP__Header().aVP__Code(),
+ std::unique_ptr(
+ new avp(
+ p_avp.aVP__Header().aVP__Code(),
+ (p_avp.aVP__Header().aVP__vid().is_present()) ? 0x01 : 0x00,
+ (p_avp.aVP__Header().aVP__flags().m__bit()[0].get_bit()) ? 0x01 : 0x00,
+ (p_avp.aVP__Header().aVP__flags().p__bit()[0].get_bit()) ? 0x01 : 0x00,
+ p_avp.aVP__Header().aVP__len(),
+ (p_avp.aVP__Header().aVP__vid().is_present()) ? static_cast(static_cast(*p_avp.aVP__Header().aVP__vid().get_opt_value())) : 0,
+ p_avp.aVP__Header().aVP__len(),
+ std::vector(static_cast(os), static_cast(os) + os.lengthof()),
+ static_cast(OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()))
+ ))));
+
+ if (padding != 0) {
+ OCTETSTRING os = int2oct(0, padding);
+ p_encoding_buffer.put_string(os);
+ }
+
+ loggers::get_instance().log_msg("<<< diameter_codec::encode_origin_host: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+ return 0;
+}
+
+int diameter_codec::encode_origin_realm(const LibDiameter__Types__Base__AVPs::Origin__Realm__AVP& p_avp, TTCN_Buffer& p_encoding_buffer) {
+ loggers::get_instance().log_msg(">>> diameter_codec::encode_origin_realm: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+
+ // TODO Group
+
+ // Encode AVP header
+ int padding = 0;
+ if (encode_avp_header(p_avp.aVP__Header(), &padding, p_encoding_buffer) == -1) {
+ loggers::get_instance().warning("diameter_codec::encode_origin_realm: Failed to encode AVP header");
+ return -1;
+ }
+
+ const OCTETSTRING& os = char2oct(p_avp.aVP__Data());
+ p_encoding_buffer.put_string(os);
+
+ _avps.insert(
+ std::make_pair >(
+ p_avp.aVP__Header().aVP__Code(),
+ std::unique_ptr(
+ new avp(
+ p_avp.aVP__Header().aVP__Code(),
+ (p_avp.aVP__Header().aVP__vid().is_present()) ? 0x01 : 0x00,
+ (p_avp.aVP__Header().aVP__flags().m__bit()[0].get_bit()) ? 0x01 : 0x00,
+ (p_avp.aVP__Header().aVP__flags().p__bit()[0].get_bit()) ? 0x01 : 0x00,
+ p_avp.aVP__Header().aVP__len(),
+ (p_avp.aVP__Header().aVP__vid().is_present()) ? static_cast(static_cast(*p_avp.aVP__Header().aVP__vid().get_opt_value())) : 0,
+ p_avp.aVP__Header().aVP__len(),
+ std::vector(static_cast(os), static_cast(os) + os.lengthof()),
+ static_cast(OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()))
+ ))));
+
+ if (padding != 0) {
+ OCTETSTRING os = int2oct(0, padding);
+ p_encoding_buffer.put_string(os);
+ }
+
+ loggers::get_instance().log_msg("<<< diameter_codec::encode_origin_realm: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+ return 0;
+}
+
+int diameter_codec::encode_auth_session_state(const LibDiameter__Types__Base__AVPs::Auth__Session__State__AVP& p_avp, TTCN_Buffer& p_encoding_buffer) {
+ loggers::get_instance().log_msg(">>> diameter_codec::encode_auth_session_state: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+
+ // TODO Group
+
+ // Encode AVP header
+ int padding = 0;
+ if (encode_avp_header(p_avp.aVP__Header(), &padding, p_encoding_buffer) == -1) {
+ loggers::get_instance().warning("diameter_codec::encode_auth_session_state: Failed to encode AVP header");
+ return -1;
+ }
+
+ int conv = p_avp.aVP__Data().as_int();
+ std::vector v;
+ unsigned char c = static_cast((conv >> 24) & 0xFF);
+ v.push_back(c);
+ p_encoding_buffer.put_c(c);
+ c = static_cast((conv >> 16) & 0xFF);
+ p_encoding_buffer.put_c(c);
+ v.push_back(c);
+ c = static_cast((conv >> 8) & 0xFF);
+ p_encoding_buffer.put_c(c);
+ v.push_back(c);
+ c = static_cast(conv & 0xFF);
+ p_encoding_buffer.put_c(c);
+ v.push_back(c);
+
+ _avps.insert(
+ std::make_pair >(
+ p_avp.aVP__Header().aVP__Code(),
+ std::unique_ptr(
+ new avp(
+ p_avp.aVP__Header().aVP__Code(),
+ (p_avp.aVP__Header().aVP__vid().is_present()) ? 0x01 : 0x00,
+ (p_avp.aVP__Header().aVP__flags().m__bit()[0].get_bit()) ? 0x01 : 0x00,
+ (p_avp.aVP__Header().aVP__flags().p__bit()[0].get_bit()) ? 0x01 : 0x00,
+ p_avp.aVP__Header().aVP__len(),
+ (p_avp.aVP__Header().aVP__vid().is_present()) ? static_cast(static_cast(*p_avp.aVP__Header().aVP__vid().get_opt_value())) : 0,
+ p_avp.aVP__Header().aVP__len(),
+ v,
+ static_cast(OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()))
+ ))));
+
+ if (padding != 0) {
+ OCTETSTRING os = int2oct(0, padding);
+ p_encoding_buffer.put_string(os);
+ }
+
+ loggers::get_instance().log_msg("<<< diameter_codec::encode_auth_session_state: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+ return 0;
+}
+
+int diameter_codec::encode_avp_header(const LibDiameter__Types__Base__AVPs::AVP__Header& p_header, int* p_padding, TTCN_Buffer& p_encoding_buffer) {
+ loggers::get_instance().log_msg(">>> diameter_codec::encode_avp_header: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+
+ int total_length = 4 + 4 + p_header.aVP__len();
+ loggers::get_instance().log("diameter_codec::encode_avp_header: total_length: '%d'", total_length);
+
+ if (p_header.aVP__vid().is_present()) {
+ total_length += 4;
+ }
+ int send_length = total_length;
+ if ((total_length % 4) != 0) {
+ total_length = (total_length / 4 + 1) * 4;
+ *p_padding = total_length - send_length;
+ }
+ loggers::get_instance().log("diameter_codec::encode_avp_header: send_length: '%d'", send_length);
+ loggers::get_instance().log("diameter_codec::encode_avp_header: total_length after padding: '%d'", total_length);
+ loggers::get_instance().log("diameter_codec::encode_avp_header: *p_padding: '%d'", *p_padding);
+
+ int conv = p_header.aVP__Code();
+ p_encoding_buffer.put_c(static_cast((conv >> 24) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((conv >> 16) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((conv >> 8) & 0xFF));
+ p_encoding_buffer.put_c(static_cast(conv & 0xFF));
+
+ unsigned char flags = 0x00;
+ if (p_header.aVP__vid().is_present()) {
+ flags |= 0x80;
+ }
+ if (p_header.aVP__flags().m__bit()[0].get_bit()) {
+ flags |= 0x40;
+
+ }
+ if (p_header.aVP__flags().p__bit()[0].get_bit()) {
+ flags |= 0x20;
+
+ }
+ p_encoding_buffer.put_c(flags);
+
+ conv = send_length;
+ p_encoding_buffer.put_c(static_cast((send_length >> 16) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((send_length >> 8) & 0xFF));
+ p_encoding_buffer.put_c(static_cast(send_length & 0xFF));
+
+ if (p_header.aVP__vid().is_present()) {
+ conv = static_cast(*p_header.aVP__vid().get_opt_value());
+ p_encoding_buffer.put_c(static_cast((conv >> 24) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((conv >> 16) & 0xFF));
+ p_encoding_buffer.put_c(static_cast((conv >> 8) & 0xFF));
+ p_encoding_buffer.put_c(static_cast(conv & 0xFF));
+ }
+
+ loggers::get_instance().log_msg("<<< diameter_codec::encode_auth_session_state: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+ return 0;
+}
+
+int diameter_codec::decode_header(TTCN_Buffer& p_decoding_buffer, LibDiameter__TypesAndValues::DiameterHeader& p_header, const params& p_params) {
+ loggers::get_instance().log(">>> diameter_codec::decode_header: '%p'", _start);
+
+ // Sanity check
+ if (p_decoding_buffer.get_len() < 20) { // DiameterHeader size
+ loggers::get_instance().warning("diameter_codec::decode: Wrong packet length for daimeter message");
+ return -1;
+ }
+
+ _start = static_cast(p_decoding_buffer.get_data());
+ _avps.clear(); // unique_ptr class manages deletion of resources
+
+ p_header.version() = static_cast(*_start++ & 0xFF);
+ p_header.msglen() = static_cast(static_cast(*_start++ & 0xFF) << 16 | static_cast(*_start++ & 0xFF) << 8 | static_cast(*_start++ & 0xFF));
+ // Resize the docoding buffer
+ if ((int)p_header.msglen() > p_decoding_buffer.get_len()) {
+ loggers::get_instance().warning("diameter_codec::decode: Resize docoding buffer: '%d' to '%d'", p_header.msglen(), p_decoding_buffer.get_len());
+ p_header.msglen() = p_decoding_buffer.get_len();
+ }
+ _end = static_cast(p_decoding_buffer.get_data()) + p_header.msglen();
+ loggers::get_instance().log("diameter_codec::decode: _end: '%p' - offset: '%d'", _end, static_cast(_end - _start));
+ loggers::get_instance().log_to_hexa("diameter_codec::decode: diameter message:", _start, static_cast(_end - _start));
+
+ p_header.cmdflags().r__bit() = int2bit(static_cast(static_cast(*_start & 0x80) != 0), 1);
+ p_header.cmdflags().p__bit() = int2bit(static_cast(static_cast(*_start & 0x40) != 0), 1);
+ p_header.cmdflags().e__bit() = int2bit(static_cast(static_cast(*_start & 0x20) != 0), 1);
+ p_header.cmdflags().t__bit() = int2bit(static_cast(static_cast(*_start & 0x10) != 0), 1);
+ p_header.cmdflags().reserved__bits() = int2bit(static_cast(*_start++ & 0x0F), 4);
+
+ params::const_iterator it = p_params.find(std::string("Request"));
+ boolean is_request = true;
+ if (it != p_params.cend()) {
+ is_request = it->second.compare("1") == 0;
+ }
+ p_header.cmdcode() = LibDiameter__TypesAndValues::Command__Code::str_to_enum(
+ command_code_2_enumerated(
+ static_cast(static_cast(*_start++ & 0xFF) << 16 | static_cast(*_start++ & 0xFF) << 8 | static_cast(*_start++ & 0xFF)),
+ static_cast(is_request)
+ ).c_str()
+ );
+
+ p_header.applid() = static_cast(static_cast(*_start++ & 0xFF) << 24 | static_cast(*_start++ & 0xFF) << 16 | static_cast(*_start++ & 0xFF) << 8 | static_cast(*_start++ & 0xFF));
+
+ p_header.hopid() = static_cast(static_cast(*_start++ & 0xFF) << 24 | static_cast(*_start++ & 0xFF) << 16 | static_cast(*_start++ & 0xFF) << 8 | static_cast(*_start++ & 0xFF));
+
+ p_header.endid() = static_cast(static_cast(*_start++ & 0xFF) << 24 | static_cast(*_start++ & 0xFF) << 16 | static_cast(*_start++ & 0xFF) << 8 | static_cast(*_start++ & 0xFF));
+
+ loggers::get_instance().log_msg("diameter_codec::decode_header: p_header=", p_header);
+
+ return 0;
+} // End of method decode_header
+
+int diameter_codec::decode_avps(TTCN_Buffer& p_decoding_buffer, const LibDiameter__TypesAndValues::DiameterHeader& p_header, const params& p_params) {
+ loggers::get_instance().log(">>> diameter_codec::decode_avps: '%p'", _start);
+
+ while (_start < _end) {
+ avp* avp_ptr = nullptr;
+ if (decode_avp(p_decoding_buffer, p_header, p_params, &avp_ptr) == -1) {
+ loggers::get_instance().log("diameter_codec::decode_avps: Failed to decode AVP: current position: '%p' - offset:'%d' - value:'0x%02x'", _start, reinterpret_cast(_end) - reinterpret_cast(_start), static_cast(*_start));
+ return -1;
+ }
+ _avps.insert(std::make_pair >(avp_ptr->get_code(), std::unique_ptr(avp_ptr)));
+ } // End of 'while' statemement
+ loggers::get_instance().log(">>> diameter_codec::decode_avps: No more AVP to decode: '%p' / '%p'", _start, _end);
+
+ return 0;
+} // End of method decode_avps
+
+int diameter_codec::decode_avp(TTCN_Buffer& p_decoding_buffer, const LibDiameter__TypesAndValues::DiameterHeader& p_header, const params& p_params, avp** avp_ptr) {
+ loggers::get_instance().log(">>> diameter_codec::decode_avp: '%p'", _start);
+
+ // Sanity checks
+ if (static_cast((_end - _start)) < 8) {
+ loggers::get_instance().warning("diameter_codec::decode_avp: Not enought bytes for AVP decoding");
+ return -1;
+ }
+
+ int code = static_cast(static_cast(*_start++ & 0xFF) << 24 | static_cast(*_start++ & 0xFF) << 16 | static_cast(*_start++ & 0xFF) << 8 | static_cast(*_start++ & 0xFF));
+ loggers::get_instance().log("diameter_codec::decode_avp: code:'%d'", code);
+ unsigned char vendor_specific = static_cast(static_cast(*_start & 0x80) != 0);
+ loggers::get_instance().log("diameter_codec::decode_avp: vendor_specific:'0x%x'", vendor_specific);
+ unsigned char mandatory = static_cast(static_cast(*_start & 0x40) != 0);
+ loggers::get_instance().log("diameter_codec::decode_avp: mandatory:'0x%x'", mandatory);
+ unsigned char protected_ = static_cast(static_cast(*_start++ & 0x20) != 0);
+ loggers::get_instance().log("diameter_codec::decode_avp: protected_:'0x%x'", protected_);
+ int length = static_cast(static_cast(*_start++ & 0xFF) << 16 | static_cast(*_start++ & 0xFF) << 8 | static_cast(*_start++ & 0xFF));
+ loggers::get_instance().log("diameter_codec::decode_avp: length:'%d'", length);
+
+ int vendor_id = 0;
+ int payload_length = length;
+ if (vendor_specific) {
+ vendor_id = static_cast(static_cast(*_start++ & 0xFF) << 24 | static_cast(*_start++ & 0xFF) << 16 | static_cast(*_start++ & 0xFF) << 8 | static_cast(*_start++ & 0xFF));
+ payload_length -= 12;
+ } else {
+ payload_length -= 8;
+ }
+ loggers::get_instance().log("diameter_codec::decode_avp: payload_length:'%d'", payload_length);
+ std::vector payload(_start, _start + payload_length);
+
+ // if (length > static_cast(_end - _start)) {
+ // loggers::get_instance().warning("diameter_codec::decode_avp: Resize docoding buffer: '%d' to '%d'", length, static_cast(_end - _start));
+ // length = static_cast(_end - _start);
+ // }
+
+ int encoded_length = length;
+ if ((encoded_length % 4) !=0) {
+ encoded_length = (encoded_length / 4 + 1) * 4;
+ }
+ loggers::get_instance().log("diameter_codec::decode_avp: encoded_length:'%d'", encoded_length);
+
+ loggers::get_instance().log("diameter_codec::decode_avp: encoded_length:'%d'", encoded_length - length);
+ loggers::get_instance().log("diameter_codec::decode_avp: payload_length + (encoded_length - length):'%d'", payload_length + (encoded_length - length));
+ _start = _start + payload_length + (encoded_length - length);
+ loggers::get_instance().log("diameter_codec::decode_avp: new _start:'%p'", _start);
+
+ *avp_ptr = new avp(code, vendor_specific, mandatory, protected_, length, vendor_id, encoded_length, payload);
+
+ return 0;
+}
+
+const std::unique_ptr& diameter_codec::get_avp(const int p_code) {
+ loggers::get_instance().log(">>> diameter_codec::get_avp: '%d'", p_code);
+
+ if ((_it = _avps.find(p_code)) == _avps.cend()) {
+ loggers::get_instance().log("diameter_codec::get_avp: Failed to retrieve AVP '%d'", p_code);
+ return _nullptr;
+ }
+
+ loggers::get_instance().log("diameter_codec::get_avp: got AVP '%d'", _it->second->get_code());
+ return _it->second;
+}
+
+std::string diameter_codec::command_code_2_enumerated(const int p_code, const boolean p_request_flag) {
+
+ std::string code_enum;
+ if(p_request_flag) {
+ switch(p_code){
+ case Code_CE: code_enum.assign("CER_E"); break;
+ case Code_RA: code_enum.assign("RAR_E"); break;
+ case Code_AC: code_enum.assign("ACR_E"); break;
+ case Code_AS: code_enum.assign("ASR_E"); break;
+ case Code_ST: code_enum.assign("STR_E"); break;
+ case Code_DW: code_enum.assign("DWR_E"); break;
+ case Code_DP: code_enum.assign("DPR_E"); break;
+ //CxDx
+ case Code_UA: code_enum.assign("UAR_E"); break;
+ case Code_SA: code_enum.assign("SAR_E"); break;
+ case Code_LI: code_enum.assign("LIR_E"); break;
+ case Code_MA: code_enum.assign("MAR_E"); break;
+ case Code_RT: code_enum.assign("RTR_E"); break;
+ case Code_PP: code_enum.assign("PPR_E"); break;
+
+ /* Codes on Sh/Dh interface */
+ case Code_UD: code_enum.assign("UDR_E"); break;// UDR User-Data-Request AS->HSS UDR (306)
+ case Code_PU: code_enum.assign("PUR_E"); break;// PUR Profile-Update-Request AS->HSS PUR (307)
+ case Code_SN: code_enum.assign("SNR_E"); break;// SNR Subscribe-Notifications-Request AS->HSS SNR (308)
+ case Code_PN: code_enum.assign("PNR_E"); break;// PNR Profile-Notification-Request HSS->AS
+
+ //Rx
+ case Code_AA: code_enum.assign("AAR_E"); break;
+ //4006
+ case Code_CC: code_enum.assign("CCR_E"); break;
+
+ //s6a
+ case Code_UL: code_enum.assign("ULR_E"); break; // Update-Location-Request ULR (316)- Ref: TS 129 272 7.2.3-4
+ case Code_CL: code_enum.assign("CLR_E"); break; // Cancel-Location-Request CLR (317)- Ref: TS 129 272 7.2.7-8
+ case Code_AI: code_enum.assign("AIR_E"); break; // Authentication-Information-Request AIR (318)- Ref: TS 129 272 7.2.5-6
+ case Code_ID: code_enum.assign("IDR_E"); break; // Insert-Subscriber-Data-Request IDR (319)- Ref: TS 129 272 7.2.9-10
+ case Code_DS: code_enum.assign("DSR_E"); break; // Delete-Subscriber-Data-Request DSR (320)- Ref: TS 129 272 7.2.11-12
+ case Code_PUE: code_enum.assign("PUER_E"); break; // Purge-UE-Request PUR (321)- Ref: TS 129 272 7.2.13-14
+ case Code_RS: code_enum.assign("RSR_E"); break; // Reset-Request DSR (322)- Ref: TS 129 272 7.2.15-16
+ case Code_NO: code_enum.assign("NOR_E"); break; // Notify-Request NOR (323)- Ref: TS 129 272 7.2.17-18
+ }
+ } else {
+ switch(p_code) {
+ case Code_CE: code_enum.assign("CEA_E"); break;
+ case Code_RA: code_enum.assign("RAA_E"); break;
+ case Code_AC: code_enum.assign("ACA_E"); break;
+ case Code_AS: code_enum.assign("ASA_E"); break;
+ case Code_ST: code_enum.assign("STA_E"); break;
+ case Code_DW: code_enum.assign("DWA_E"); break;
+ case Code_DP: code_enum.assign("DPA_E"); break;
+ //CxDx
+ case Code_UA: code_enum.assign("UAA_E"); break;
+ case Code_SA: code_enum.assign("SAA_E"); break;
+ case Code_LI: code_enum.assign("LIA_E"); break;
+ case Code_MA: code_enum.assign("MAA_E"); break;
+ case Code_RT: code_enum.assign("RTA_E"); break;
+ case Code_PP: code_enum.assign("PPA_E"); break;
+
+ /* Codes on Sh/Dh interface */
+ case Code_UD: code_enum.assign("UDA_E"); break;// UDR User-Data-Request AS->HSS UDR (306)
+ case Code_PU: code_enum.assign("PUA_E"); break;// PUR Profile-Update-Request AS->HSS PUR (307)
+ case Code_SN: code_enum.assign("SNA_E"); break;// SNR Subscribe-Notifications-Request AS->HSS SNR (308)
+ case Code_PN: code_enum.assign("PNA_E"); break;// PNR Profile-Notification-Request HSS->AS
+ //Rx
+ case Code_AA: code_enum.assign("AAA_E"); break;
+ //4006
+ case Code_CC: code_enum.assign("CCA_E"); break;
+
+ //S6a
+ case Code_UL: code_enum.assign("ULA_E"); break; // Update-Location-Request ULR (316)- Ref: TS 129 272 7.2.3-4
+ case Code_CL: code_enum.assign("CLA_E"); break; // Cancel-Location-Request CLR (317)- Ref: TS 129 272 7.2.7-8
+ case Code_AI: code_enum.assign("AIA_E"); break; // Authentication-Information-Request AIR (318)- Ref: TS 129 272 7.2.5-6
+ case Code_ID: code_enum.assign("IDA_E"); break; // Insert-Subscriber-Data-Request IDR (319)- Ref: TS 129 272 7.2.9-10
+ case Code_DS: code_enum.assign("DSA_E"); break; // Delete-Subscriber-Data-Request DSR (320)- Ref: TS 129 272 7.2.11-12
+ case Code_PUE: code_enum.assign("PUEA_E"); break; // Purge-UE-Request PUR (321)- Ref: TS 129 272 7.2.13-14
+ case Code_RS: code_enum.assign("RSA_E"); break; // Reset-Request DSR (322)- Ref: TS 129 272 7.2.15-16
+ case Code_NO: code_enum.assign("NOA_E"); break; // Notify-Request NOR (323)- Ref: TS 129 272 7.2.17-1
+ }
+ }
+ return code_enum;
+} // End of method command_code_2_enumerated
+
+const int diameter_codec::_command_codes[] = {
+ /* Ref: RFC3588 p.3.1 */
+
+ diameter_codec::Code_CE, // Capabilities-Exchange-Request CER (257)
+ diameter_codec::Code_CE, // Capabilities-Exchange-Answer CEA (257)
+ diameter_codec::Code_RA, // Re-Auth-Request RAR (258)
+ diameter_codec::Code_RA, // Re-Auth-Answer RAA (258)
+ /**/
+ diameter_codec::Code_AC, // Accounting-Request ACR(271)
+ diameter_codec::Code_AC, // Accounting-Answer ACA (271)
+ /**/
+ diameter_codec::Code_AS, // Abort-Session-Request ASR (274)
+ diameter_codec::Code_AS, // Abort-Sesion-Answer ASA (274)
+ diameter_codec::Code_ST, // Session-Termination-Request STR (275)
+ diameter_codec::Code_ST, // Session-Termination-Answer STA (275)
+/**/
+ diameter_codec::Code_DW, // Device-Watchdog-Request DWR (280)
+ diameter_codec::Code_DW, // Device-Watchdog-Answer DWA (280)
+ diameter_codec::Code_DP, // Disconnect-Peer-Request DPR (282)
+ diameter_codec::Code_DP, // Disconnect-Peer-Answer DPA (282)
+
+/* Codes on Cx */
+ diameter_codec::Code_UA, // User-Authorization-Request UAR 300
+ diameter_codec::Code_UA, // User-Authorization-Answer UAA 300
+ diameter_codec::Code_SA, // Server-Assignment-Request SAR 301
+ diameter_codec::Code_SA, // Server-Assignment-Answer SAA 301
+ diameter_codec::Code_LI, // Location-Info-Request LIR 302
+ diameter_codec::Code_LI, // Location-Info-Answer LIA 302
+ diameter_codec::Code_MA, // Multimedia-Auth-Request MAR 303
+ diameter_codec::Code_MA, // Multimedia-Auth-Answer MAA 303
+ diameter_codec::Code_RT, // Registration-Termination-Request RTR 304
+ diameter_codec::Code_RT, // Registration-Termination-Answer RTA 304
+ diameter_codec::Code_PP, // Push-Profile-Request PPR 305
+ diameter_codec::Code_PP, // Push-Profile-Answer PPA 305
+
+/* Codes on Sh/Dh interface */
+ diameter_codec::Code_UD, // UDR User-Data-Request AS->HSS 306
+ diameter_codec::Code_UD, // UDA User-Data-Answer HSS->AS 306
+ diameter_codec::Code_PU, // PUR Profile-Update-Request AS->HSS 307
+ diameter_codec::Code_PU, // PUA Profile-Update-Answer HSS->AS 307
+ diameter_codec::Code_SN, // SNR Subscribe-Notifications-Request AS->HSS 308
+ diameter_codec::Code_SN, // SNA Subscribe-Notifications-Answer HSS->AS 308
+ diameter_codec::Code_PN, // PNR Profile-Notification-Request HSS->AS 309
+ diameter_codec::Code_PN, // PNA Profile-Notification-Answer AS->HSS 309
+
+/* Codes on Rx interface */
+ diameter_codec::Code_AA, // AAR Auth-Accounting-Request 265
+ diameter_codec::Code_AA, // AAA Auth-Accounting-Request 265
+
+/*RFC4006*/
+ diameter_codec::Code_CC, // CCR Credit-Control-Request 272
+ diameter_codec::Code_CC, // CCA Credit-Control-Answer 272
+
+ /* Codes on S6a interface - TS 129 272 */
+ diameter_codec::Code_UL, // Update-Location-Request ULR (316)- Ref: TS 129 272 7.2.3
+ diameter_codec::Code_UL, // Update-Location-Answer ULA (316)- Ref: TS 129 272 7.2.4
+ diameter_codec::Code_CL, // Cancel-Location-Request CLR (317)- Ref: TS 129 272 7.2.7
+ diameter_codec::Code_CL, // Cancel-Location-Answer CLA (317)- Ref: TS 129 272 7.2.8
+ diameter_codec::Code_AI, // Authentication-Information-Request AIR (318)- Ref: TS 129 272 7.2.5
+ diameter_codec::Code_AI, // Authentication-Information-Answer AIA (318)- Ref: TS 129 272 7.2.6
+ diameter_codec::Code_ID, // Insert-Subscriber-Data-Request IDR (319)- Ref: TS 129 272 7.2.9
+ diameter_codec::Code_ID, // Insert-Subscriber-Data-Answer IDA (319)- Ref: TS 129 272 7.2.10
+ diameter_codec::Code_DS, // Delete-Subscriber-Data-Request DSR (320)- Ref: TS 129 272 7.2.11
+ diameter_codec::Code_DS, // Delete-Subscriber-Data-Answer DSA (320)- Ref: TS 129 272 7.2.12
+ diameter_codec::Code_PUE, // Purge-UE-Request PUR (321)- Ref: TS 129 272 7.2.13
+ diameter_codec::Code_PUE, // Purge-UE-Answer PUA (321)- Ref: TS 129 272 7.2.14
+ diameter_codec::Code_RS, // Reset-Request DSR (322)- Ref: TS 129 272 7.2.15
+ diameter_codec::Code_RS, // Reset-Answer DSA (322)- Ref: TS 129 272 7.2.16
+ diameter_codec::Code_NO, // Notify-Request NOR (323)- Ref: TS 129 272 7.2.17
+ diameter_codec::Code_NO // Notify-Answer NOA (323)- Ref: TS 129 272 7.2.18
+};
diff --git a/ccsrc/Protocols/Diameter/diameter_codec.hh b/ccsrc/Protocols/Diameter/diameter_codec.hh
new file mode 100644
index 0000000000000000000000000000000000000000..89326bdb39e92d0eaa1ca531ca4cb567c9371b3a
--- /dev/null
+++ b/ccsrc/Protocols/Diameter/diameter_codec.hh
@@ -0,0 +1,534 @@
+#pragma once
+
+#include
+#include
+
+#include "codec_gen.hh"
+#include "params.hh"
+
+#include "avp.hh"
+
+class TTCN_Typedescriptor_t;
+class TTCN_Buffer;
+
+namespace LibDiameter__TypesAndValues {
+ class DiameterHeader; //! Forward declaration of TITAN class
+}
+
+class diameter_codec {
+ std::map > _avps;
+ std::map >::const_iterator _it;
+ std::unique_ptr _nullptr;
+ const unsigned char* _start;
+ const unsigned char* _end;
+
+public:
+ explicit diameter_codec() : _avps(), _it(), _nullptr(nullptr), _start(nullptr) { };
+ virtual ~diameter_codec();
+
+ int encode_header(const LibDiameter__TypesAndValues::DiameterHeader& p_header, TTCN_Buffer& p_encoding_buffer);
+ int encode_session_id(const LibDiameter__Types__Base__AVPs::Session__Id__AVP& p_avp, TTCN_Buffer& p_encoding_buffer);
+ int encode_auth_session_state(const LibDiameter__Types__Base__AVPs::Auth__Session__State__AVP& p_avp, TTCN_Buffer& p_encoding_buffer);
+ int encode_origin_host(const LibDiameter__Types__Base__AVPs::Origin__Host__AVP& p_avp, TTCN_Buffer& p_encoding_buffer);
+ int encode_origin_realm(const LibDiameter__Types__Base__AVPs::Origin__Realm__AVP& p_avp, TTCN_Buffer& p_encoding_buffer);
+
+ int decode_header(TTCN_Buffer& p_decoding_buffer, LibDiameter__TypesAndValues::DiameterHeader& p_header, const params& p_params);
+ int decode_avps(TTCN_Buffer& p_decoding_buffer, const LibDiameter__TypesAndValues::DiameterHeader& p_header, const params& p_params);
+
+ const std::unique_ptr& get_avp(const int p_code);
+
+public:
+ int encode_avp_header(const LibDiameter__Types__Base__AVPs::AVP__Header& p_header, int* p_padding, TTCN_Buffer& p_encoding_buffer);
+
+ int decode_avp(TTCN_Buffer& p_decoding_buffer, const LibDiameter__TypesAndValues::DiameterHeader& p_header, const params& p_params, avp** avp_ptr);
+
+ std::string command_code_2_enumerated(const int p_code, const boolean p_request_flag);
+
+ /** Command code of Request/Answer */
+ static const int Code_CE=257;// Capabilities-Exchange
+ static const int Code_RA=258;// Re-Auth
+ static const int Code_AC=271;// Accounting
+ static const int Code_AS=274;// Abort-Session
+ static const int Code_ST=275;// Session-Termination
+ static const int Code_DW=280;// Device-Watchdog
+ static const int Code_DP=282;// Disconnect-Peer
+
+ /* Codes on Cx */
+ static const int Code_UA=300;// User-Authorization
+ static const int Code_SA=301;// Server-Assignment-Request SAR (284 in RFC4740 or 301 in TS 129 229)
+ static const int Code_LI=302;// Location-Info-Request LIR (285 in RFC4740 or 302 in TS 129 229)
+ static const int Code_MA=303;// Multimedia-Auth-Request MAR (286 in RFC4740 or 303 in TS 129 229)
+ static const int Code_RT=304;// Registration-Termination-Request RTR (287 in RFC4740 or 304 in TS 129 229)
+ static const int Code_PP=305;// Push-Profile-Request PPR (288 in RFC4740 or 305 in TS 129 229)
+
+ /* Codes on Sh/Dh interface */
+ static const int Code_UD=306;// UDR User-Data-Request AS->HSS UDR (306)
+ static const int Code_PU=307;// PUR Profile-Update-Request AS->HSS PUR (307)
+ static const int Code_SN=308;// SNR Subscribe-Notifications-Request AS->($1) ($2) (308)
+ static const int Code_PN=309;// PNR Profile-Notification-Request HSS->AS PNR (309)
+
+ /* Codes on Rx interface */
+ static const int Code_AA=265;// Auth-Accounting
+
+ /* Codes on Gx interface - RFC4006 and TS 129 212 */
+ static const int Code_CC=272;// Credit-Control
+
+ /* Codes on S6a interface - TS 129 272 */
+ static const int Code_UL=316; // Update-Location-Request ULR (316)- Ref: TS 129 272 7.2.3-4
+ static const int Code_CL=317; // Cancel-Location-Request CLR (317)- Ref: TS 129 272 7.2.7-8
+ static const int Code_AI=318; // Authentication-Information-Request AIR (318)- Ref: TS 129 272 7.2.5-6
+ static const int Code_ID=319; // Insert-Subscriber-Data-Request IDR (319)- Ref: TS 129 272 7.2.9-10
+ static const int Code_DS=320; // Delete-Subscriber-Data-Request DSR (320)- Ref: TS 129 272 7.2.11-12
+ static const int Code_PUE=321; // Purge-UE-Request PUR (321)- Ref: TS 129 272 7.2.13-14
+ static const int Code_RS=322; // Reset-Request DSR (322)- Ref: TS 129 272 7.2.15-16
+ static const int Code_NO=323; // Notify-Request NOR (323)- Ref: TS 129 272 7.2.17-18
+
+
+ /*RFC3588 AVP codes*/
+ const int AVP_Accounting_Realtime_Required_AVP = 483; //Ref: RFC3588 9.8.7. Accounting-Realtime-Required AVP
+ const int AVP_Accounting_Record_Number_AVP = 485; //Ref: RFC3588 9.8.3. Accounting-Record-Number AVP
+ const int AVP_Accounting_Record_Type_AVP = 480; //Ref: RFC3588 9.8.1. Accounting-Record-Type AVP
+ const int AVP_Accounting_Sub_Session_Id_AVP = 287; //Ref: RFC3588 9.8.6. Accounting-Sub-Session-Id AVP
+ const int AVP_Acct_Application_Id_AVP = 259; //Ref: RFC3588 6.9. Acct-Application-Id AVP
+ const int AVP_Acct_Interim_Interval_AVP = 85; //Ref: RFC3588 9.8.2. Acct-Interim-Interval
+ const int AVP_Acct_Multi_Session_Id_AVP = 50; //Ref: RFC3588 9.8.5. Acct-Multi-Session-Id AVP
+ const int AVP_Acct_Session_Id_AVP = 44; //Ref: RFC3588 9.8.4. Acct-Session-Id AVP
+ const int AVP_Auth_Application_Id_AVP = 258; //Ref: RFC3588 6.8. Auth-Application-Id AVP
+ const int AVP_Class_AVP = 25; //Ref: RFC3588 8.20. Class AVP
+ const int AVP_Destination_Host_AVP = 293; //Ref: RFC3588 6.5. Destination-Host AVP
+ const int AVP_Destination_Realm_AVP = 283; //Ref: RFC3588 6.6. Destination-Realm AVP
+ const int AVP_Disconnect_Cause_AVP = 273; //Ref: RFC3588 5.4.3. Disconnect-Cause AVP
+ const int AVP_Error_Message_AVP = 281; //Ref: RFC3588 7.3. Error-Message AVP
+ const int AVP_Error_Reporting_Host_AVP = 294; //Ref: RFC3588 7.4. Error-Reporting-Host AVP
+ const int AVP_Event_Timestamp_AVP = 55; //Ref: RFC3588 8.21. Event-Timestamp AVP
+ const int AVP_Failed_AVP = 279; //Ref: RFC3588 7.5. Failed-AVP AVP
+ const int AVP_Firmware_Revision_AVP = 267; //Ref: RFC3588 5.3.4. Firmware-Revision AVP
+ const int AVP_Host_IP_Address_AVP = 257; //Ref: RFC3588 5.3.5. Host-IP-Address AVP
+ const int AVP_Inband_Security_Id_AVP = 299; //Ref: RFC3588 6.10. Inband-Security-Id AVP
+ const int AVP_Origin_Host_AVP = 264; //Ref: RFC3588 6.3. Origin-Host AVP
+ const int AVP_Origin_Realm_AVP = 296; //Ref: RFC3588 6.4. Origin-Realm AVP
+ const int AVP_Origin_State_Id_AVP = 278; //Ref: RFC3588 8.16. Origin-State-Id AVP
+ const int AVP_Product_Name_AVP = 269; //Ref: RFC3588 5.3.7. Product-Name AVP
+ const int AVP_Proxy_Host_AVP = 280; //Ref: RFC3588 6.7.3. Proxy-Host AVP
+ const int AVP_Proxy_Info_AVP = 284; //Ref: RFC3588 6.7.2. Proxy-Info AVP
+ const int AVP_Proxy_State_AVP = 33; //Ref: RFC3588 6.7.4. Proxy-State AVP
+ const int AVP_Re_Auth_Request_Type_AVP = 285; //Ref: RFC3588 8.12. Re-Auth-Request-Type AVP
+ const int AVP_Redirect_Host_AVP = 292; //Ref: RFC3588 6.12. Redirect-Host AVP
+ const int AVP_redirect_Max_Cache_Time_AVP = 262; //Ref: RFC3588 redirect_Max_Cache_Time_AVP is not defined.
+ const int AVP_Redirect_Host_Usage_AVP = 261; //Ref: RFC3588 6.13. Redirect-Host-Usage AVP
+ const int AVP_Result_Code_AVP = 268; //Ref: RFC3588 7.1. Result-Code AVP
+ const int AVP_Route_Record_AVP = 282; //Ref: RFC3588 6.7.1. Route-Record AVP
+ const int AVP_Session_Id_AVP = 263; //Ref: RFC3588 8.8. Session-Id AVP
+ const int AVP_Supported_Vendor_Id_AVP = 265; //Ref; RFC3588 5.3.6. Supported-Vendor-Id AVP
+ const int AVP_Termination_Cause_AVP = 295; //Ref: RFC3588 8.15. Termination-Cause AVP
+ const int AVP_User_Name_AVP = 1; //Ref: RFC3588 8.14. User-Name AVP
+ const int AVP_Vendor_Id_AVP = 266; //Ref: RFC3588 5.3.3. Vendor-Id AVP
+ const int AVP_Vendor_Specific_Appl_Id_AVP = 260; //Ref: RFC3588 6.11. Vendor-Specific-Application-Id AVP
+ /*end RFC3588 AVP codes*/
+
+ //RFC4740 AVP codes{
+// const int AVP_Auth_Grace_Period_AVP = 276; //Ref: RFC3588 8.10. Auth-Grace-Period AVP
+ const int AVP_Auth_Session_State_AVP = 277; //Ref: RFC3588 8.11. Auth-Session-State AVP
+// const int AVP_Authorization_Lifetime_AVP = 291; //Ref: RFC3588 8.9. Authorization-Lifetime AVP
+// const int AVP_Redirect_Max_Cache_Time_AVP = 262; //Ref: RFC3588 6.14. Redirect-Max-Cache-Time AVP
+// const int AVP_SIP_Accounting_Information_AVP = 368; //Ref: RFC4740 9.1. SIP-Accounting-Information AVP
+// const int AVP_SIP_Accounting_Server_URI_AVP = 369; //Ref: RFC4740 9.1.1. SIP-Accounting-Server-URI AVP
+// const int AVP_SIP_AOR_AVP = 122; //Ref: RFC4740 9.8. SIP-AOR AVP
+ const int AVP_SIP_Auth_Data_Item_RFC_AVP = 376; //Ref: RFC4740 9.5. SIP-Auth-Data-Item AVP
+ const int AVP_SIP_Item_Number_AVP = 378;
+ const int AVP_SIP_Authenticate_RFC_AVP = 379; //Ref: RFC4740 9.5.3. SIP-Authenticate AVP
+// const int AVP_SIP_Authentication_Info_AVP = 381; //Ref: RFC4740 9.5.5. SIP-Authentication-Info AVP
+ const int AVP_SIP_Authentication_Scheme_RFC_AVP = 377; //Ref: RFC4740 9.5.1. SIP-Authentication-Scheme AVP
+ const int AVP_SIP_Authorization_RFC_AVP = 380; //Ref: RFC4740 9.5.4. SIP-Authorization AVP
+// const int AVP_SIP_Credit_Control_Server_URI_AVP = 370; //Ref: RFC4740 9.1.2. SIP-Credit-Control-Server-URI AVP
+// const int AVP_SIP_Deregistration_Reason_AVP = 383; //Ref: RFC4740 9.5.5. SIP-Authentication-Info AVP
+// const int AVP_SIP_Item_Number_AVP = 378; //Ref: RFC4740 9.5.2 SIP-Item-Number AVP
+// const int AVP_SIP_MandatoryCapability_AVP = 373; //Ref: RFC4740 9.3.1. SIP-Mandatory-Capability AVP
+ const int AVP_SIP_Method_AVP = 393; //Ref: RFC4740 9.14. SIP-Method AVP
+ const int AVP_SIP_Number_Auth_Items_RFC_AVP = 382; //Ref: RFC4740 9.6. SIP-Number-Auth-Items AVP
+// const int AVP_SIP_OptionalCapability_AVP = 374; //Ref: RFC4740 9.3.2. SIP-Optional-Capability AVP
+// const int AVP_SIP_Reason_Code_AVP = 384; //Ref: RFC4740 9.7.1. SIP-Reason-Code AVP
+// const int AVP_SIP_Reason_Info_AVP = 385; //Ref: RFC4740 9.7.2. SIP-Reason-Info AVP
+// const int AVP_SIP_Server_Assignment_Type_AVP = 375; //Ref: RFC4740 9.4. SIP-Server-Assignment-Type AVP
+// const int AVP_SIP_Server_Capabilities_AVP = 372; //Ref: RFC4740 9.3. SIP-Server-Capabilities AVP
+// const int AVP_SIP_Server_URI_AVP = 371; //Ref: RFC4740 9.2 SIP-Server-URI AVP
+// const int AVP_SIP_Supported_User_Data_Type_AVP = 388; //Ref: RFC4740 9.12.1. SIP-User-Data-Type AVP
+// const int AVP_SIP_User_Authorization_Type_AVP = 387; //Ref: RFC4740 9.10. SIP-User-Authorization-Type AVP
+// const int AVP_SIP_User_Data_Already_Available_AVP = 392; //Ref: RFC4740 9.13. SIP-User-Data-Already-Available AVP
+// const int AVP_SIP_User_Data_AVP = 389; //Ref: RFC4740 9.12. SIP-User-Data AVP
+// const int AVP_SIP_User_Data_Contents_AVP = 391; //Ref: RFC4740 9.12.2. SIP-User-Data-Contents AVP
+// const int AVP_SIP_User_Data_Type_AVP = 390; //Ref: RFC4740 9.12.1. SIP-User-Data-Type AVP
+// const int AVP_SIP_Visited_Network_Id_AVP = 386; //Ref: RFC4740 9.9. SIP-Visited-Network-Id AVP
+ //end of RFC4740 AVP codes
+
+ const int AVP_Digest_Realm_AVP = 104;
+ const int AVP_Digest_Nonce_AVP = 105;
+ const int AVP_Digest_Domain_AVP = 119;
+ const int AVP_Digest_Opaque_AVP = 116;
+ const int AVP_Digest_Stale_AVP = 120;
+ const int AVP_Digest_Algorithm_AVP = 111;
+ const int AVP_Digest_QoP_AVP = 110;
+ const int AVP_Digest_HA1_AVP = 121;
+ const int AVP_Digest_Auth_Param_AVP = 117;
+ const int AVP_Digest_Username_AVP = 115;
+ const int AVP_Digest_URI_AVP = 109;
+ const int AVP_Digest_Response_AVP = 103;
+ const int AVP_Digest_CNonce_AVP = 113;
+ const int AVP_Digest_Nonce_Count_AVP = 114;
+ const int AVP_Digest_Method_AVP = 108;
+ const int AVP_Digest_Entity_Body_Hash_AVP = 112;
+ const int AVP_Digest_Nextnonce_AVP = 107;
+ const int AVP_Digest_Response_Auth_AVP = 106;
+
+
+ //RFC4005 AVP codes
+ const int AVP_Called_Station_Id_AVP = 30;
+ const int AVP_Framed_IP_Address_AVP = 8;
+ const int AVP_Framed_IPv6_Prefix_AVP = 97;
+ const int AVP_Framed_Interface_Id_AVP = 96;
+ //end of RFC4005 AVP codes
+
+ //RFC4006 AVP codes
+// const int AVP_Rating_Group_AVP = 433; //Ref: RFC4006 8.29. Rating-Group AVP
+const int AVP_Tariff_Time_Change_AVP = 451; //Ref: RFC4006 8.20. Tariff-Time-Change AVP
+// const int AVP_CC_Correlation_Id_AVP = 411; //Ref: RFC4006 8.1. CC-Correlation-Id AVP
+const int AVP_CC_Input_Octets_AVP = 412; //Ref: RFC4006 8.24. CC-Input-Octets AVP
+const int AVP_CC_Money_AVP = 413; //Ref: RFC4006 8.22. CC-Money AVP
+const int AVP_CC_Output_Octets_AVP = 414; //Ref: RFC4006 8.25. CC-Output-Octets AVP
+ const int AVP_CC_Request_Number_AVP = 415; //Ref: RFC4006 8.2. CC-Request-Number AVP
+ const int AVP_CC_Request_Type_AVP = 416; //Ref: RFC4006 8.3. CC-Request-Type AVP
+const int AVP_CC_Service_Specific_Units_AVP = 417; //Ref: RFC4006 8.26. CC-Service-Specific-Units AVP
+const int AVP_CC_Session_Failover_AVP = 418; //Ref: RFC4006 8.4. CC-Session-Failover AVP
+// const int AVP_vendIdCC_Sub_Session_Id_AVP = 419; //Ref: RFC4006 8.5. CC-Sub-Session-Id AVP
+const int AVP_CC_Time_AVP = 420; //Ref: RFC4006 8.21. CC-Time AVP
+const int AVP_CC_Total_Octets_AVP = 421; //Ref: RFC4006 8.23. CC-Total-Octets AVP
+const int AVP_CC_Unit_Type_AVP = 454; //Ref: RFC4006 8.32. CC-Unit-Type AVP
+// const int AVP_vendIdCheck_Balance_Result_AVP = 422; //Ref: RFC4006 8.6. Check-Balance-Result AVP 12.8. Check-Balance-Result AVP
+const int AVP_Cost_Information_AVP = 423; //Ref: RFC4006 8.7. Cost-Information AVP
+const int AVP_Cost_Unit_AVP = 424; //Ref: RFC4006 8.12. Cost-Unit AVP
+const int AVP_Credit_Control_Failure_Handling_AVP = 427; //Ref: RFC4006 8.14. Credit-Control-Failure-Handling AVP
+const int AVP_Currency_Code_AVP = 425; //Ref: RFC4006 8.11. Currency-Code AVP
+const int AVP_Direct_Debiting_Failure_Handling_AVP = 428; //Ref: RFC4006 8.15. Direct-Debiting-Failure-Handling AVP
+const int AVP_Exponent_AVP = 429; //Ref: RFC4006 8.9. Exponent AVP
+const int AVP_Filter_Id_AVP = 11; //Ref: RFC4005 6.7. Filter-Id AVP
+const int AVP_Final_Unit_Action_AVP = 449; //Ref: RFC4006 8.35. Final-Unit-Action AVP
+const int AVP_Final_Unit_Indication_AVP = 430; //Ref: RFC4006 8.34. Final-Unit-Indication AVP
+const int AVP_G_S_U_Pool_Identifier_AVP = 453; //Ref: RFC4006 8.31. G-S-U-Pool-Identifier AVP
+const int AVP_G_S_U_Pool_Reference_AVP = 457; //Ref: RFC4006 8.30. G-S-U-Pool-Reference AVP
+const int AVP_Granted_Service_Unit_AVP = 431; //Ref: RFC4006 8.17. Granted-Service-Unit AVP
+// const int AVP_vendIdMultiple_Services_Credit_Control_AVP = 456; //Ref: RFC4006 8.16. Multiple-Services-Credit-Control AVP
+const int AVP_Multiple_Services_Indicator_AVP = 455; //Ref: RFC4006 8.40. Multiple-Services-Indicator AVP
+ const int AVP_Redirect_Address_Type_AVP = 433; //Ref: RFC4006 8.38. Redirect-Address-Type AVP
+ const int AVP_Redirect_Server_Address_AVP = 435; //Ref: RFC4006 8.39. Redirect-Server-Address AVP
+ const int AVP_Redirect_Server_AVP = 434; //Ref: RFC4006 8.37. Redirect-Server AVP
+// const int AVP_vendIdRequested_Action_AVP = 436; //Ref: RFC4006 8.41. Requested-Action AVP
+const int AVP_Requested_Service_Unit_AVP = 437; //Ref: RFC4006 8.18. Requested-Service-Unit AVP
+const int AVP_Restriction_Filter_Rule_AVP = 438; //Ref: RFC4006 8.36. Restriction-Filter-Rule AVP
+ const int AVP_Service_Context_Id_AVP = 461; //Ref: RFC4006 8.42. Service-Context-Id AVP
+ const int AVP_Service_Identifier_AVP = 439; //Ref: RFC4006 8.28. Service-Identifier AVP
+ const int AVP_Requested_Action_AVP = 436;
+ // const int AVP_vendIdService_Parameter_Info_AVP = 440; //Ref: RFC4006 8.43. Service-Parameter-Info AVP
+// const int AVP_vendIdService_Parameter_Type_AVP = 441; //Ref: RFC4006 8.44. Service-Parameter-Type AVP
+// const int AVP_vendIdService_Parameter_Value_AVP = 442; //Ref: RFC4006 8.45. Service-Parameter-Value AVP
+ const int AVP_Subscription_Id_AVP = 443; //Ref: RFC4006 8.46. Subscription-Id AVP
+ const int AVP_Subscription_Id_Data_AVP = 444; //Ref: RFC4006
+ const int AVP_Subscription_Id_Type_AVP = 450; //Ref: RFC4006 8.47. Subscription-Id-Type AVP
+ const int AVP_Tariff_Change_Usage_AVP = 452;//Ref: RFC4006 8.27. Tariff-Change-Usage AVP
+ const int AVP_Rating_Group_AVP = 433;
+const int AVP_Unit_Value_AVP = 445; //Ref: RFC4006 8.8. Unit-Value AVP
+const int AVP_Used_Service_Unit_AVP = 446; //Ref: RFC4006 8.19. Used-Service-Unit AVP
+// const int AVP_vendIdUser_Equipment_Info_AVP = 458; //Ref: RFC4006 8.49. User-Equipment-Info AVP
+// const int AVP_vendIdUser_Equipment_Info_Type_AVP = 459; //Ref: RFC4006 8.50. User-Equipment-Info-Type AVP
+// const int AVP_vendIdUser_Equipment_Info_Value_AVP = 460; //Ref: RFC4006 8.51. User-Equipment-Info-Value AVP
+const int AVP_Validity_Time_AVP = 448; //Ref: RFC4006 8.33. Validity-Time AVP
+const int AVP_Value_Digits_AVP = 447; //Ref: RFC4006 8.10. Value-Digits AVP
+ /*end of RFC4006 AVP codes*/
+
+ //TS129_229 AVP codes
+// const int AVP_vendIdCharging_Information_AVP = 61; //Ref: ETSI TS 129 229 Charging_Information_AVP
+// const int AVP_vendIdPrimary_Event_Charging_Function_Name_AVP = 619; //Ref: ETSI TS 129 229 Primary_Event_Charging_Function_Name_AVP
+// const int AVP_vendIdSecondary_Event_Charging_Function_Name_AVP = 620; //Ref: ETSI TS 129 229 Secondary_Event_Charging_Function_Name_AVP
+// const int AVP_vendIdPrimary_Charging_Collection_Function_Name_AVP = 621; //Ref: ETSI TS 129 229 Primary_Charging_Collection_Function_Name_AVP
+// const int AVP_vendIdSecondary_Charging_Collection_Function_Name_AVP = 622; //Ref: ETSI TS 129 229 Secondary_Charging_Collection_Function_Name_AVP
+ const int AVP_Charging_Rule_Remove_AVP = 1002;
+ const int AVP_Charging_Rule_Install_AVP = 1001;
+ const int AVP_Charging_Rule_Report_AVP = 1018;
+ const int AVP_Routing_Rule_Install_AVP = 1081;
+ const int AVP_Routing_Rule_Remove_AVP = 1075;
+ const int AVP_QoS_Information_AVP = 1016;
+ const int AVP_Default_EPS_Bearer_QoS_AVP = 1049;
+ const int AVP_Server_Capabilities_AVP = 603; //Ref: ETSI TS 129 229 Server_Capabilities_AVP
+// const int AVP_vendIdMandatory_Capability_AVP = 604; //Ref: ETSI TS 129 229 Mandatory_Capability_AVP
+// const int AVP_vendIdOptional_Capability_AVP = 605; //Ref: ETSI TS 129 229 Optional_Capability_AVP
+ const int AVP_IP_CAN_Type_AVP = 1027;
+ const int AVP_RAT_Type_AVP = 1032; //Ref: ETSI TS 129 212 RAT_Type_AVP
+ const int AVP_Event_Trigger_AVP = 1006;
+ const int AVP_Session_Release_Cause_AVP = 1045;
+ const int AVP_Charging_Rule_Name_AVP = 1005;
+ const int AVP_AN_GW_Address_AVP = 1050;
+
+ const int AVP_Experimental_Result_AVP = 297;
+ const int AVP_Experimental_Result_Code_AVP = 298;
+ const int AVP_User_Data_AVP = 606;
+
+ /*end of TS129_229 AVP codes*/
+
+ //tS129_329
+ const int AVP_Public_Identity_AVP = 601;
+ const int AVP_Server_Name_AVP = 602;
+ const int AVP_Feature_List_ID_AVP = 629; // Ref: 3GPP TS 29.229, clause 6.3.30
+ const int AVP_Feature_List_AVP = 630; // Ref: 3GPP TS 29.229, clause 6.3.31
+ const int AVP_Supported_Features_AVP = 628; // Ref: 3GPP TS 29.329 6.3.11 Supported-Features AVP (See 3GPP TS 29.229, clause 6.3.29)
+ /*End TS129_329*/
+
+ //Sh AVP codes
+
+ ////const int AVP_Public_Identity_AVP = 601;
+ const int AVP_User_Identity_AVP = 700;
+ const int AVP_MSISDN_AVP= 701;
+ const int AVP_User_Data_Sh_AVP= 702;
+ const int AVP_Data_Reference_AVP = 703;
+ const int AVP_Service_Indication_AVP = 704;
+ const int AVP_Subs_Req_Type_AVP =705;
+ const int AVP_Requested_Domain_AVP = 706;
+ const int AVP_Current_Location_AVP = 707;
+ const int AVP_Identity_Set_AVP = 708;
+ const int AVP_Expiry_Time_AVP= 709;
+ const int AVP_Send_Data_Indication_AVP = 710;
+ const int AVP_Repository_Data_ID_AVP = 715;
+ const int AVP_Sequence_Number_AVP = 716;
+ ////const int AVP_Server_Name_AVP = 602;
+ ////const int AVP_Supported_Features_AVP = 628;
+ ////const int AVP_Feature_List_ID_AVP = 629;
+ ////const int AVP_Feature_List_AVP = 630;
+ const int AVP_Wildcarded_PSI_AVP = 634;
+ const int AVP_Wildcarded_IMPU_AVP = 636;
+ const int AVP_DSAI_Tag_AVP = 711;
+ ////const int AVP_Experimental_Result_Code_AVP = 298;
+ ////const int AVP_Experimental_Result_AVP = 297;
+ ////const int AVP_User_Data_AVP = 606;
+ //TS129_214 AVP codes
+ const int AVP_Media_Component_Description_AVP = 517;
+ const int AVP_Media_Component_Nr_AVP = 518;
+ const int AVP_Media_Sub_Component_AVP = 519;
+ const int AVP_AF_Application_Identifier_AVP = 504;
+ const int AVP_Media_Type_AVP = 520;
+ const int AVP_AF_Signalling_Protocol_AVP = 529;
+ const int AVP_Reservation_Priority_AVP = 458;
+ const int AVP_RS_Bandwidth_AVP = 522;
+ const int AVP_RR_Bandwidth_AVP = 521;
+ const int AVP_Codec_Data_AVP = 524;
+ const int AVP_Flow_Description_AVP = 507;
+ const int AVP_Flow_Number_AVP = 509;
+ const int AVP_Flow_Status_AVP = 511;
+ const int AVP_Flow_Usage_AVP = 512;
+ const int AVP_Specific_Action_AVP = 513;
+ const int AVP_Service_Info_Status_AVP = 527;
+ const int AVP_Rx_Request_Type_AVP = 533;
+
+ //TS129_215 AVP codes
+ const int AVP_QoS_Rule_Name_AVP = 1054;
+ const int AVP_Rule_Failure_Code_AVP = 1031;
+ const int AVP_PDN_Connection_ID_AVP = 1065;
+ const int AVP_QoS_Rule_Report_AVP = 1055;
+ const int AVP_QoS_Rule_Install_AVP = 1051;
+ const int AVP_Multiple_BBERF_Action_AVP = 2204;
+ const int AVP_Session_Linking_Indicator_AVP = 1064;
+ const int AVP_Subses_Decision_Info_AVP = 2200;
+ const int AVP_Subses_Enforcement_Info_AVP = 2201;
+ const int AVP_Subsession_Id_AVP = 2202;
+ const int AVP_Subsession_Operation_AVP = 2203;
+ //End TS129_215 AVP codes
+
+ //TS129_272 AVP codes
+ const int AVP_ULR_Flags_AVP = 1405; //ref: 7.3.7 ETSI TS 129 272
+ const int AVP_ULA_Flags_AVP = 1406; //ref: 7.3.8
+ const int AVP_Visited_PLMN_Id_AVP = 1407; //ref: 7.3.9
+ const int AVP_UE_SRVCC_Capability_AVP = 1615; //ref: 7.3.130
+ const int AVP_SGSN_Number_AVP = 1489; //ref: 7.3.102
+ const int AVP_Homogeneous_Support_AVP = 1493; //ref: 7.3.107
+
+ const int AVP_Context_Identifier_AVP = 1423; //ref: 7.3.27
+ const int AVP_Service_Selection_AVP = 493; //ref: 7.3.36
+ const int AVP_MIP_Home_Agent_Address_AVP = 334; //ref: 7.3.42 - IETF RFC 4004 7.4
+ const int AVP_MIP_Home_Agent_Host_AVP = 348; //ref: 7.3.43 - IETF RFC 4004 7.11
+ const int AVP_MIP6_Home_Link_Prefix_AVP = 125; //ref:IETF RFC 5447 4.2.4
+ const int AVP_MIP6_Agent_Info_AVP = 486; //ref: 7.3.45
+ const int AVP_Visited_Network_Identifier_AVP = 600; //ref: 7.3.105 - TS 129 229 6.3.1
+ const int AVP_SIP_Authentication_Context_AVP = 611;
+ const int AVP_UAR_Flags_AVP = 637;
+ const int AVP_User_Authorization_Type_AVP = 623;
+ const int AVP_Server_Assignment_Type_AVP = 614;
+ const int AVP_User_Data_Already_Available_AVP = 624;
+ const int AVP_SIP_Digest_Authenticate_AVP = 635;
+ const int AVP_SCSCF_Restoration_Info_AVP = 639;
+ const int AVP_Restoration_Info_AVP = 649;
+ const int AVP_Path_AVP = 640;
+ const int AVP_Contact_AVP = 641;
+ const int AVP_Subscription_Info_AVP = 642;
+ const int AVP_Originating_Request_AVP = 652;
+ const int AVP_Deregistration_Reason_AVP = 615;
+ const int AVP_Reason_Code_AVP = 616;
+ const int AVP_Reason_Info_AVP = 617;
+ const int AVP_Specific_APN_Info_AVP = 1472; //ref: 7.3.82
+ const int AVP_Active_APN_AVP = 1612; //ref: 7.3.127
+ const int AVP_Error_Diagnostic_AVP = 1614; //ref: 7.3.128;
+ const int AVP_Subscriber_Status_AVP = 1424;
+ const int AVP_Operator_Determined_Barring_AVP = 1425;
+ const int AVP_HPLMN_ODB_AVP = 1418;
+ const int AVP_Access_Restriction_Data_AVP = 1426;
+ const int AVP_APN_OI_Replacement_AVP = 1427;
+ const int AVP_Max_Requested_Bandwidth_UL_AVP = 516;
+ const int AVP_Max_Requested_Bandwidth_DL_AVP = 515;
+ const int AVP_APN_Aggregate_Max_Bitrate_UL_AVP = 1041;
+ const int AVP_APN_Aggregate_Max_Bitrate_DL_AVP = 1040;
+ const int AVP_AMBR_AVP = 1435;
+
+ const int AVP_All_APN_Conf_Included_Id_AVP = 1428;
+ const int AVP_APN_Configuration_Profile_AVP = 1429;
+ const int AVP_PDN_Type_AVP = 1456;
+ const int AVP_QoS_Class_Identifier_AVP=1028;
+ const int AVP_Priority_Level_AVP = 1046;
+ const int AVP_Pre_emption_Capability_AVP = 1047;
+ const int AVP_Pre_emption_Vulnerability_AVP = 1048;
+
+ const int AVP_Allocation_Retention_Priority_AVP =1034;
+ const int AVP_EPS_Subscribed_QoS_Profile_AVP = 1431;
+ const int AVP_APN_Configuration_AVP = 1430;
+ const int AVP_GMLC_Address_AVP = 2405; //ref: 7.3.109 - TS 129 173 6.4.7
+ //....
+ const int AVP_Complete_DL_Included_Indicator_AVP = 1468;
+ const int AVP_QoS_Subscribed_AVP = 1404;
+ const int AVP_PDP_Type_AVP = 1470;
+ const int AVP_PDP_Context_AVP = 1469;
+ const int AVP_GPRS_Subscription_Data_AVP = 1467;
+ const int AVP_Subscription_Data_AVP = 1400; //ref: 7.3.2
+ const int AVP_Immediate_Response_Preferred_AVP = 1412; //ref: 7.3.16
+ const int AVP_Re_synchronization_Info_AVP = 1411; //ref: 7.3.15
+ const int AVP_Req_EUTRAN_Auth_Info_AVP = 1408; //ref: 7.3.11
+ const int AVP_Req_UTRAN_GERAN_Auth_Info_AVP = 1409; //ref: 7.3.12
+
+ const int AVP_Item_Number_AVP = 1419;
+ const int AVP_RAND_AVP = 1447;
+ const int AVP_XRES_AVP = 1448;
+ const int AVP_AUTN_AVP = 1449;
+ const int AVP_KASME_AVP = 1450;
+ const int AVP_E_UTRAN_Vector_AVP = 1414;
+ const int AVP_SIP_Authentication_Scheme_3GPP_AVP = 608;
+ const int AVP_SIP_Authenticate_3GPP_AVP = 609;
+ const int AVP_SIP_Authorization_3GPP_AVP = 610;
+ const int AVP_SIP_Number_Auth_Items_3GPP_AVP = 607;
+ const int AVP_SIP_Auth_Data_Item_3GPP_AVP = 612;//ETSI TS 129 229 V10.5.0 (2013-04) Clause 6.3.13 SIP-Auth-Data-Item AVP
+ const int AVP_Identity_with_Emergency_Registration_AVP = 651;
+ const int AVP_Confidentiality_Key_AVP = 625;
+ const int AVP_Integrity_Key_AVP = 626;
+ const int AVP_Line_Identifier_AVP = 500;
+ const int AVP_UTRAN_Vector_AVP = 1415;
+ const int AVP_SRES_AVP = 1454;
+ const int AVP_Kc_AVP = 1453;
+ const int AVP_GERAN_Vector_AVP = 1416;
+ const int AVP_Authentication_Info_AVP = 1413;
+
+ const int AVP_Cancellation_Type_AVP = 1420;
+ const int AVP_CLR_Flags_AVP = 1638; //ref: 7.3.152
+ const int AVP_IDR_Flags_AVP = 1490; //ref: 7.3.103
+ const int AVP_DSR_Flags_AVP = 1421; //ref: 7.3.25
+ const int AVP_DSA_Flags_AVP = 1422; //ref: 7.3.26
+ const int AVP_PUER_Flags_AVP= 1635; //ref: 7.3.149
+ const int AVP_PUEA_Flags_AVP= 1442; //ref: 7.3.48
+ const int AVP_IDA_Flags_AVP = 1441; //ref: 7.3.47
+ const int AVP_NOR_Flags_AVP = 1443; //ref: 7.3.49
+ const int AVP_IMS_Voice_PS_Sessions_Support_AVP = 1492;
+ const int AVP_Last_UE_Activity_Time_AVP = 1494;
+ const int AVP_EPS_User_State_AVP = 1495;
+ const int AVP_EPS_Location_Information_AVP = 1496;
+ //end TS129_272 AVP codes
+
+
+ //TS132_299 AVP codes
+ const int AVP_Charging_Information_AVP = 618;
+ const int AVP_Primary_Event_Charging_Function_Name_AVP = 619;
+ const int AVP_Secondary_Event_Charging_Function_Name_AVP = 620;
+ const int AVP_Primary_Charging_Collection_Function_Name_AVP = 621;
+ const int AVP_Secondary_Charging_Collection_Function_Name_AVP = 622;
+// const int AVP_User_CSG_Information_AVP = 2319; //Ref: ETSI TS 132 299 User_CSG_Information_AVP
+// const int AVP_CSG_Id_AVP = 1437; //Ref: ETSI TS 132 299 CSG_Id_AVP
+// const int AVP_CSG_Access_Mode_AVP = 2317; //Ref: ETSI TS 132 299 CSG_Access_Mode_AVP
+// const int AVP_CSG_Membership_Indication_AVP = 2318; //Ref: ETSI TS 132 299 CSG_Membership_Indication_AVP
+ const int AVP_Service_Information_AVP = 873; //Ref: ETSI TS 132 299 Service_Information_AVP
+ const int AVP_PS_Information_AVP = 874; //Ref: ETSI TS 132 299 PS_Information_AVP
+ const int AVP_WLAN_Information_AVP = 875; //Ref: ETSI TS 132 299 WLAN_Information_AVP
+ const int AVP_IMS_Information_AVP = 876; //Ref: ETSI TS 132 299 IMS_Information_AVP
+// const int AVP_MMS_Information_AVP = 877; //Ref: ETSI TS 132 299 MMS_Information_AVP
+// const int AVP_LCS_Information_AVP = 878; //Ref: ETSI TS 132 299 LCS_Information_AVP
+// const int AVP_PoC_Information_AVP = 879; //Ref: ETSI TS 132 299 PoC_Information_AVP
+// const int AVP_MBMS_Information_AVP = 880; //Ref: ETSI TS 132 299 MBMS_Information_AVP
+ const int AVP_Service_Generic_Information_AVP = 1256; //Ref: ETSI TS 132 299 Service_Generic_Information_AVP
+ const int AVP_Event_Type_AVP = 825; //Ref: ETSI TS 132 299 Event_Type_AVP
+ const int AVP_Event_AVP = 823; //Ref: ETSI TS 132 299 Event_AVP
+ const int AVP_Expires_AVP = 888; //Ref: ETSI TS 132 299 Expires_AVP
+ const int AVP_Role_Of_Node_AVP = 829; //Ref: ETSI TS 132 299 Role_Of_Node_AVP
+ const int AVP_Node_Functionality_AVP = 862; //Ref: ETSI TS 132 299 Node_Functionality_AVP
+ const int AVP_User_Session_ID_AVP = 830; //Ref: ETSI TS 132 299 User_Session_ID_AVP
+ const int AVP_Calling_Party_Address_AVP = 831; //Ref: ETSI TS 132 299 Calling_Party_Address_AVP
+ const int AVP_Called_Party_Address_AVP = 832; //Ref: ETSI TS 132 299 Called_Party_Address_AVP
+ const int AVP_Called_Asserted_Identity_AVP = 1250; //Ref: ETSI TS 132 299 Called_Asserted_Identity_AVP
+ const int AVP_Alternate_Charged_Party_Address_AVP = 1280;//Ref: ETSI TS 132 299 Alternate_Charged_Party_Address_AVP
+ const int AVP_Requested_Party_Address_AVP = 1251; //Ref: ETSI TS 132 299 Requested_Party_Address_AVP
+ const int AVP_Associated_URI_AVP = 856; //Ref: ETSI TS 132 299 Associated_URI_AVP
+ const int AVP_Time_Stamps_AVP = 833; //Ref: ETSI TS 132 299 Time_Stamps_AVP
+ const int AVP_SIP_Request_Timestamp_AVP = 834; //Ref: ETSI TS 132 299 SIP_Request_Timestamp_AVP
+ const int AVP_SIP_Response_Timestamp_AVP = 835; //Ref: ETSI TS 132 299 SIP_Response_Timestamp_AVP
+ const int AVP_Application_Server_Information_AVP = 850;//Ref: ETSI TS 132 299 Application_Server_Information_AVP
+ const int AVP_Application_Server_AVP = 836; //Ref: ETSI TS 132 299 Application_Server_AVP
+ const int AVP_Application_Provided_Called_Party_Address_AVP = 837; //Ref: ETSI TS 132 299 Application_Provided_Called_Party_Address_AVP
+ const int AVP_Inter_Operator_Identifier_AVP = 838; //Ref: ETSI TS 132 299 Inter_Operator_Identifier_AVP
+ const int AVP_Originating_IOI_AVP = 839; //Ref: ETSI TS 132 299 Originating_IOI_AVP
+ const int AVP_Terminating_IOI_AVP = 840; //Ref: ETSI TS 132 299 Terminating_IOI_AVP
+ const int AVP_IMS_Charging_Identifier_AVP = 841; //Ref: ETSI TS 132 299 IMS_Charging_Identifier_AVP
+ const int AVP_SDP_Session_Description_AVP = 842; //Ref: ETSI TS 132 299 SDP_Session_Description_AVP
+ const int AVP_SDP_Media_Component_AVP = 844; //Ref: ETSI TS 132 299 SDP_Media_Name_AVP
+// const int AVP_SDP_Media_Name_AVP = 844; //Ref: ETSI TS 132 299 SDP_Media_Name_AVP
+// const int AVP_SDP_Media_Description_AVP = 845; //Ref: ETSI TS 132 299 SDP_Media_Description_AVP
+// const int AVP_Media_Initiator_Flag_AVP = 882; //Ref: ETSI TS 132 299 Media_Initiator_Flag_AVP
+// const int AVP_Media_Initiator_Party_AVP = 1288; //Ref: ETSI TS 132 299 Media_Initiator_Party_AVP
+// const int AVP_Authorized_QoS_AVP = 849; //Ref: ETSI TS 132 299 Authorized_QoS_AVP
+ const int AVP_Served_Party_IP_Address_AVP = 848; //Ref: ETSI TS 132 299 Served_Party_IP_Address_AVP
+ const int AVP_Trunk_Group_ID_AVP = 851; //Ref: ETSI TS 132 299 Trunk_Group_ID_AVP
+ const int AVP_Incoming_Trunk_Group_ID_AVP = 852; //Ref: ETSI TS 132 299 Incoming_Trunk_Group_ID_AVP
+ const int AVP_Outgoing_Trunk_Group_ID_AVP = 853; //Ref: ETSI TS 132 299 Outgoing_Trunk_Group_ID_AVP
+
+ const int AVP_Delivery_Status_AVP =2104;
+ const int AVP_Application_Session_ID_AVP=2103;
+ const int AVP_Application_Service_Type_AVP=2102;
+ const int AVP_Application_Server_ID_AVP=2101;
+
+ const int AVP_Reporting_Reason_AVP=872;
+ const int AVP_Time_Quota_Threshold_AVP=868;
+ const int AVP_Volume_Quota_Threshold_AVP=869;
+ const int AVP_Unit_Quota_Threshold_AVP=1226;
+ const int AVP_Quota_Holding_Time_AVP=871;
+ const int AVP_Quota_Consumption_Time_AVP=881;
+ const int AVP_Time_Quota_Type_AVP=1271;
+ const int AVP_Base_Time_Interval_AVP=1265;
+ const int AVP_Time_Quota_Mechanism_AVP=1270;
+ const int AVP_Envelope_Start_Time_AVP=1269;
+ const int AVP_Envelope_End_Time_AVP=1267;
+ const int AVP_Envelope_AVP=1266;
+ const int AVP_Envelope_Reporting_AVP=1268;
+ const int AVP_Trigger_AVP=1264;
+ const int AVP_Trigger_Type_AVP=870;
+ const int AVP_Refund_Information_AVP=2022;
+ const int AVP_Multiple_Services_Credit_Control_AVP = 456;
+
+ const int AVP_Offline_Charging_AVP = 1278;
+ const int AVP_Low_Balance_Indication_AVP=2020;
+ const int AVP_Remaining_Balance_AVP = 2021;
+ //end of TS132_299 AVP codes
+
+private:
+ //NOTE: The order of constants in the following array is very important.
+ //It must exactly match order specified in TTCN-3 module.
+ static const int _command_codes[];
+
+}; // End of class diameter_codec
diff --git a/ccsrc/Protocols/Diameter/diameter_layer.cc b/ccsrc/Protocols/Diameter/diameter_layer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..da022b2b69ef65323947ef413a1f1b084f8b1849
--- /dev/null
+++ b/ccsrc/Protocols/Diameter/diameter_layer.cc
@@ -0,0 +1,39 @@
+#include "LibDiameter_Interface.hh"
+#include "LibDiameter_TypesAndValues.hh"
+
+#include "diameter_layer_factory.hh"
+
+#include "loggers.hh"
+
+#include "converter.hh"
+
+diameter_layer::diameter_layer(const std::string & p_type, const std::string & p_param) : t_layer(p_type), _params() {
+ loggers::get_instance().log(">>> diameter_layer::diameter_layer: %s, %s", to_string().c_str(), p_param.c_str());
+ // Setup parameters
+ params::convert(_params, p_param);
+}
+
+void diameter_layer::sendMsg(const LibDiameter__TypesAndValues::DIAMETER__MSG& p_diameter_message, params& p_param) {
+ loggers::get_instance().log_msg(">>> diameter_layer::sendMsg: ", p_diameter_message);
+
+ // Encode DiameterMessage
+ OCTETSTRING data;
+ // _codec_register.encode(p_diameter_message, data);
+ // send_data(data, _params);
+}
+
+void diameter_layer::send_data(OCTETSTRING& data, params& p_params) {
+ loggers::get_instance().log_msg(">>> diameter_layer::send_data: ", data);
+
+ send_to_all_layers(data, p_params);
+}
+
+void diameter_layer::receive_data(OCTETSTRING& data, params& p_params)
+{
+ loggers::get_instance().log_msg(">>> diameter_layer::receive_data: ", data);
+
+ // Decode Diameter message
+}
+
+diameter_layer_factory diameter_layer_factory::_f;
+
diff --git a/ccsrc/Protocols/Diameter/diameter_layer.hh b/ccsrc/Protocols/Diameter/diameter_layer.hh
new file mode 100644
index 0000000000000000000000000000000000000000..a6409c614fe2a0aa96b33b63dd213fb3a437a62b
--- /dev/null
+++ b/ccsrc/Protocols/Diameter/diameter_layer.hh
@@ -0,0 +1,73 @@
+/*!
+ * \file diameter_layer.hh
+ * \brief Header file for ITS HTTP protocol layer.
+ * \author ETSI STF549
+ * \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
+
+#include
+
+#include "t_layer.hh"
+
+namespace LibDiameter__Interface {
+ class DiameterPort; //! Forward declaration of TITAN class
+}
+
+namespace LibDiameter__TypesAndValues {
+ class DIAMETER__MSG; //! Forward declaration of TITAN class
+}
+
+class OCTETSTRING; //! Forward declaration of TITAN class
+
+/*!
+ * \class diameter_layer
+ * \brief This class provides a factory class to create an diameter_layer class instance
+ */
+class diameter_layer : public t_layer {
+ params _params;
+
+public: //! \publicsection
+ /*!
+ * \brief Specialised constructor
+ * Create a new instance of the diameter_layer class
+ * \param[in] p_type \todo
+ * \param[in] p_param \todo
+ */
+ diameter_layer() : t_layer(), _params() {};
+ /*!
+ * \brief Specialised constructor
+ * Create a new instance of the diameter_layer class
+ * \param[in] p_type \todo
+ * \param[in] p_param \todo
+ */
+ diameter_layer(const std::string& p_type, const std::string& p_param);
+ /*!
+ * \brief Default destructor
+ */
+ virtual ~diameter_layer() { };
+
+ void sendMsg(const LibDiameter__TypesAndValues::DIAMETER__MSG& p_diameter_message, params& p_param);
+
+ /*!
+ * \virtual
+ * \fn void send_data(OCTETSTRING& data, params& p_params);
+ * \brief Send bytes formated data to the lower layers
+ * \param[in] p_data The data to be sent
+ * \param[in] p_params Some parameters to overwrite default value of the lower layers parameters
+ */
+ virtual void send_data(OCTETSTRING& data, params& p_params);
+ /*!
+ * \virtual
+ * \fn void receive_data(OCTETSTRING& data, params& p_params);
+ * \brief Receive bytes formated data from the lower layers
+ * \param[in] p_data The bytes formated data received
+ * \param[in] p_params Some lower layers parameters values when data was received
+ */
+ virtual void receive_data(OCTETSTRING& data, params& info);
+}; // End of class diameter_layer
+
diff --git a/ccsrc/Protocols/Diameter/diameter_layer_factory.hh b/ccsrc/Protocols/Diameter/diameter_layer_factory.hh
new file mode 100644
index 0000000000000000000000000000000000000000..f43182f3236b8d3902ebf4cf012621b3eec391f5
--- /dev/null
+++ b/ccsrc/Protocols/Diameter/diameter_layer_factory.hh
@@ -0,0 +1,45 @@
+/*!
+ * \file diameter_layer_factory.hh
+ * \brief Header file for Diameter protocol layer factory.
+ * \author ETSI TTF T010
+ * \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
+
+#include "layer_stack_builder.hh"
+
+#include "diameter_layer.hh"
+
+/*!
+ * \class diameter_layer_factory
+ * \brief This class provides a factory class to create an diameter_layer class instance
+ */
+class diameter_layer_factory : public layer_factory {
+ static diameter_layer_factory _f; //! Reference to the unique instance of this class
+public: //! \publicsection
+ /*!
+ * \brief Default constructor
+ * Create a new instance of the udp_layer_factory class
+ * \remark The HTTP layer identifier is HTTP
+ */
+ diameter_layer_factory() {
+ // Register factory
+ layer_stack_builder::register_layer_factory("DIAMETER", this);
+ };
+ /*!
+ * \fn layer* create_layer(const std::string & type, const std::string & param);
+ * \brief Create the layers stack based on the provided layers stack description
+ * \param[in] p_type The provided layers stack description
+ * \param[in] p_params Optional parameters
+ * \return 0 on success, -1 otherwise
+ * \inline
+ */
+ inline virtual layer* create_layer(const std::string& p_type, const std::string& p_param){
+ return new diameter_layer(p_type, p_param);
+ };
+}; // End of class diameter_layer_factory
+
diff --git a/ccsrc/Protocols/Diameter/diameter_uar_codec.cc b/ccsrc/Protocols/Diameter/diameter_uar_codec.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4c7f93e1128ee0334aa741976f3c6bd1a805795f
--- /dev/null
+++ b/ccsrc/Protocols/Diameter/diameter_uar_codec.cc
@@ -0,0 +1,208 @@
+#include
+
+#include "avp.hh"
+
+#include "diameter_uar_codec.hh"
+
+#include "loggers.hh"
+#include "converter.hh"
+
+template class OPTIONAL;
+class TTCN_EncDec;
+
+int diameter_uar_codec::encode(const LibDiameter__TypesAndValues::UAR__MSG& p_uar_msg, OCTETSTRING& p_data) {
+ loggers::get_instance().log_msg(">>> diameter_uar_codec::encode", (const Base_Type &)p_uar_msg);
+
+ TTCN_EncDec::clear_error();
+ TTCN_Buffer encoding_buffer;
+
+ if (_codec.encode_header(p_uar_msg.header(), encoding_buffer) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::encode: Failed to encode UAR header");
+ return -1;
+ }
+
+ if (encode_avps(p_uar_msg, encoding_buffer) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::encode: Failed to encode UAR AVPs");
+ return -1;
+ }
+
+ p_data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data());
+ // Update length at offset #1 on 3 bytes
+
+ return 0;
+}
+
+int diameter_uar_codec::encode_avps(const LibDiameter__TypesAndValues::UAR__MSG& p_uar_msg, TTCN_Buffer p_encoding_buffer) {
+ loggers::get_instance().log_msg(">>> diameter_uar_codec::encode_avps: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+
+ // SessionId
+ if (_codec.encode_session_id(p_uar_msg.session__Id(), p_encoding_buffer) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::encode_avps: Failed to encode session__Id__AVP");
+ return -1;
+ }
+
+ // Mandatory AVPs
+ if (_codec.encode_origin_host(p_uar_msg.uAR__Body().origin__Host(), p_encoding_buffer) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::encode_avps: Failed to encode Origin__Host__AVP");
+ return -1;
+ }
+ if (_codec.encode_origin_realm(p_uar_msg.uAR__Body().origin__Realm(), p_encoding_buffer) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::encode_avps: Failed to encode Origin__Realm__AVP");
+ return -1;
+ }
+
+
+
+ // Optional AVPs
+ if (_codec.encode_auth_session_state(p_uar_msg.uAR__Body().auth__Session__State(), p_encoding_buffer) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::encode_avps: AVP is missing");
+ return -1;
+ }
+ // TODO Continue
+
+ loggers::get_instance().log_msg("<<< diameter_uar_codec::encode_avps: ", OCTETSTRING(p_encoding_buffer.get_len(), p_encoding_buffer.get_data()));
+ return 0;
+}
+
+int diameter_uar_codec::decode(const OCTETSTRING& p_data, LibDiameter__TypesAndValues::UAR__MSG& p_uar_msg, params* p_params) {
+ loggers::get_instance().log_msg(">>> diameter_uar_codec::decode: ", (const Base_Type &)p_data);
+
+ TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
+ TTCN_EncDec::clear_error();
+ TTCN_Buffer decoding_buffer(p_data);
+
+ params _params;
+ _params.insert(std::make_pair("Request", "1"));
+
+ if (_codec.decode_header(decoding_buffer, p_uar_msg.header(), static_cast(_params)) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::decode: Failed to decode UAR message header");
+ return -1;
+ }
+
+ if (_codec.decode_avps(decoding_buffer, p_uar_msg.header(), static_cast(_params)) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::decode: Failed to decode UAR AVPs");
+ return -1;
+ }
+
+ // Mandatory AVPs
+ if (decode_auth_session_state(p_uar_msg.uAR__Body().auth__Session__State()) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::decode: Missing Auth__Session__State__AVP");
+ return -1;
+ }
+ if (decode_origin_host(p_uar_msg.uAR__Body().origin__Host()) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::decode: Missing Origin__Host__AVP");
+ return -1;
+ }
+ if (decode_origin_realm(p_uar_msg.uAR__Body().origin__Realm()) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::decode: Missing Origin__Realm__AVP");
+ return -1;
+ }
+ if (decode_destination_realm(p_uar_msg.uAR__Body().destination__Realm()) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::decode: Missing Destination__Realm__AVP");
+ return -1;
+ }
+ if (decode_session_id(p_uar_msg.session__Id()) == -1) {
+ loggers::get_instance().warning("diameter_uar_codec::decode: Missing Destination__Realm__AVP");
+ return -1;
+ }
+
+ // Optinal AVPs
+ if (decode_destination_host(p_uar_msg.uAR__Body().destination__Host()) == -1) {
+ p_uar_msg.uAR__Body().destination__Host().set_to_omit();
+ }
+
+ p_uar_msg.uAR__Body().vendor__Specific__Application__Id().set_to_omit();
+ p_uar_msg.uAR__Body().auth__Application__Id().set_to_omit();
+ p_uar_msg.uAR__Body().sIP__AOR().set_to_omit();
+ p_uar_msg.uAR__Body().user__Name().set_to_omit();
+ p_uar_msg.uAR__Body().sIP__Visited__Network__Id().set_to_omit();
+ p_uar_msg.uAR__Body().sIP__User__Authorization__Type().set_to_omit();
+ p_uar_msg.uAR__Body().supported__Features().set_to_omit();
+ p_uar_msg.uAR__Body().public__Identity().set_to_omit();
+ p_uar_msg.uAR__Body().visited__Network__Identifier().set_to_omit();
+ p_uar_msg.uAR__Body().user__Authorization__Type().set_to_omit();
+ p_uar_msg.uAR__Body().uAR__Flags().set_to_omit();
+ p_uar_msg.uAR__Body().proxy__Info().set_to_omit();
+ p_uar_msg.uAR__Body().route__Record().set_to_omit();
+ p_uar_msg.uAR__Body().aVP__Type().set_to_omit();
+
+ return 0;
+}
+
+int diameter_uar_codec::decode_session_id(LibDiameter__Types__Base__AVPs::Session__Id__AVP& p_avp) {
+ loggers::get_instance().log("diameter_uar_codec::decode_session_id: looking for '%d", _codec.AVP_Session_Id_AVP);
+ const std::unique_ptr& avp_ptr = _codec.get_avp(_codec.AVP_Session_Id_AVP);
+ if (avp_ptr.get() == nullptr) {
+ loggers::get_instance().warning("diameter_uar_codec::decode_session_id: AVP is missing");
+ return -1;
+ }
+ avp_ptr->decode_session_id(p_avp);
+ loggers::get_instance().log_msg("diameter_uar_codec::decode_session_id: ", p_avp);
+
+ return 0;
+}
+
+int diameter_uar_codec::decode_auth_session_state(LibDiameter__Types__Base__AVPs::Auth__Session__State__AVP& p_avp) {
+ loggers::get_instance().log("diameter_uar_codec::decode_auth_session_state: looking for '%d", _codec.AVP_Auth_Session_State_AVP);
+ const std::unique_ptr& avp_ptr = _codec.get_avp(_codec.AVP_Auth_Session_State_AVP);
+ if (avp_ptr.get() == nullptr) {
+ loggers::get_instance().warning("diameter_uar_codec::decode_auth_session_state: AVP is missing");
+ return -1;
+ }
+ avp_ptr->decode_auth_session_state(p_avp);
+ loggers::get_instance().log_msg("diameter_uar_codec::decode_auth_session_state: ", p_avp);
+
+ return 0;
+}
+
+int diameter_uar_codec::decode_origin_host(LibDiameter__Types__Base__AVPs::Origin__Host__AVP& p_avp) {
+ loggers::get_instance().log("diameter_uar_codec::decode_origin_host: looking for '%d", _codec.AVP_Origin_Host_AVP);
+ const std::unique_ptr& avp_ptr = _codec.get_avp(_codec.AVP_Origin_Host_AVP);
+ if (avp_ptr.get() == nullptr) {
+ loggers::get_instance().warning("diameter_uar_codec::decode_origin_host: AVP is missing");
+ return -1;
+ }
+ avp_ptr->decode_origin_host(p_avp);
+ loggers::get_instance().log_msg("diameter_uar_codec::decode_origin_host: ", p_avp);
+
+ return 0;
+}
+
+int diameter_uar_codec::decode_destination_host(LibDiameter__Types__Base__AVPs::Destination__Host__AVP& p_avp) {
+ loggers::get_instance().log("diameter_uar_codec::decode_destination_host: looking for '%d", _codec.AVP_Destination_Host_AVP);
+ const std::unique_ptr& avp_ptr = _codec.get_avp(_codec.AVP_Destination_Host_AVP);
+ if (avp_ptr.get() == nullptr) {
+ loggers::get_instance().warning("diameter_uar_codec::decode_destination_host: AVP is missing");
+ return -1;
+ }
+ avp_ptr->decode_destination_host(p_avp);
+ loggers::get_instance().log_msg("diameter_uar_codec::decode_destination_host: ", p_avp);
+
+ return 0;
+}
+
+int diameter_uar_codec::decode_origin_realm(LibDiameter__Types__Base__AVPs::Origin__Realm__AVP& p_avp) {
+ loggers::get_instance().log("diameter_uar_codec::decode_origin_realm: looking for '%d", _codec.AVP_Origin_Realm_AVP);
+ const std::unique_ptr& avp_ptr = _codec.get_avp(_codec.AVP_Origin_Realm_AVP);
+ if (avp_ptr.get() == nullptr) {
+ loggers::get_instance().warning("diameter_uar_codec::decode_origin_realm: AVP is missing");
+ return -1;
+ }
+ avp_ptr->decode_origin_realm(p_avp);
+ loggers::get_instance().log_msg("diameter_uar_codec::decode_origin_realm: ", p_avp);
+
+ return 0;
+}
+
+int diameter_uar_codec::decode_destination_realm(LibDiameter__Types__Base__AVPs::Destination__Realm__AVP& p_avp) {
+ loggers::get_instance().log("diameter_uar_codec::decode_destination_realm: looking for '%d", _codec.AVP_Destination_Realm_AVP);
+ const std::unique_ptr& avp_ptr = _codec.get_avp(_codec.AVP_Destination_Realm_AVP);
+ if (avp_ptr.get() == nullptr) {
+ loggers::get_instance().warning("diameter_uar_codec::decode_destination_realm: AVP is missing");
+ return -1;
+ }
+ avp_ptr->decode_destination_realm(p_avp);
+ loggers::get_instance().log_msg("diameter_uar_codec::decode_destination_realm: ", p_avp);
+
+ return 0;
+}
diff --git a/ccsrc/Protocols/Diameter/diameter_uar_codec.hh b/ccsrc/Protocols/Diameter/diameter_uar_codec.hh
new file mode 100644
index 0000000000000000000000000000000000000000..910b13d099ad038e13e81df48b720f867f7ab293
--- /dev/null
+++ b/ccsrc/Protocols/Diameter/diameter_uar_codec.hh
@@ -0,0 +1,43 @@
+#pragma once
+
+#include
+
+#include "codec_gen.hh"
+#include "params.hh"
+
+#include "avp.hh"
+#include "diameter_codec.hh"
+
+class Base_Type;
+class TTCN_Typedescriptor_t;
+class TTCN_Buffer;
+
+namespace LibDiameter__TypesAndValues {
+ class UAR__MSG; //! Forward declaration of TITAN class
+}
+
+class diameter_uar_codec: public codec_gen <
+ LibDiameter__TypesAndValues::UAR__MSG,
+ LibDiameter__TypesAndValues::UAR__MSG>
+{
+ std::vector avps;
+ diameter_codec _codec;
+
+public:
+ diameter_uar_codec() : codec_gen(), avps(), _codec() { };
+ virtual ~diameter_uar_codec() { };
+
+ virtual int encode (const LibDiameter__TypesAndValues::UAR__MSG& p_uar_msg, OCTETSTRING& p_data);
+ virtual int decode (const OCTETSTRING& p_data, LibDiameter__TypesAndValues::UAR__MSG& p_uar_msg, params* p_params = NULL);
+
+private:
+ int encode_avps(const LibDiameter__TypesAndValues::UAR__MSG& p_uar_msg, TTCN_Buffer p_encoding_buffer);
+
+ int decode_session_id(LibDiameter__Types__Base__AVPs::Session__Id__AVP& p_avp);
+ int decode_auth_session_state(LibDiameter__Types__Base__AVPs::Auth__Session__State__AVP& p_avp);
+ int decode_origin_host(LibDiameter__Types__Base__AVPs::Origin__Host__AVP& p_avp);
+ int decode_destination_host(LibDiameter__Types__Base__AVPs::Destination__Host__AVP& p_avp);
+ int decode_origin_realm(LibDiameter__Types__Base__AVPs::Origin__Realm__AVP& p_avp);
+ int decode_destination_realm(LibDiameter__Types__Base__AVPs::Destination__Realm__AVP& p_avp);
+
+}; // End of class diameter_uar_codec
diff --git a/ccsrc/Protocols/Diameter/module.mk b/ccsrc/Protocols/Diameter/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..e3ad396cbedbf445af7f239ec5c7de866c785c4f
--- /dev/null
+++ b/ccsrc/Protocols/Diameter/module.mk
@@ -0,0 +1,7 @@
+sources := \
+ diameter_layer.cc \
+ diameter_codec.cc \
+ diameter_uar_codec.cc \
+ avp.cc
+
+includes := .
diff --git a/ccsrc/Protocols/Http/http_codec_emtel.cc b/ccsrc/Protocols/Http/http_codec_emtel.cc
new file mode 100644
index 0000000000000000000000000000000000000000..31b69f4eaaf450ec4b4e8bde53c951399d0df3aa
--- /dev/null
+++ b/ccsrc/Protocols/Http/http_codec_emtel.cc
@@ -0,0 +1,111 @@
+#include "http_codec_emtel.hh"
+
+#include "loggers.hh"
+
+bool http_codec_emtel::encode_body_xml(const LibHttp__XmlMessageBodyTypes::XmlBody &p_xml_body, OCTETSTRING &p_encoding_buffer, const std::string &p_content_type) {
+ loggers::get_instance().log(">>> http_codec_emtel::encode_body_xml");
+
+ std::map > >::const_iterator it;
+ bool processed = false;
+ loggers::get_instance().log("http_codec_emtel::encode_body_xml: Content-Type:'%s'", p_content_type.c_str());
+ if (p_content_type.find("held") != std::string::npos) {
+ it = _codecs.find("held"); // TODO Use params
+ if (it != _codecs.cend()) {
+ loggers::get_instance().log("http_codec_emtel::encode_body_xml: Call 'held_codec'");
+ _codecs["held"]->encode((Record_Type&)p_xml_body, p_encoding_buffer); // TODO Use params
+ processed = true;
+ }
+ } else if (p_content_type.find("lost") != std::string::npos) {
+ it = _codecs.find("lost"); // TODO Use params
+ if (it != _codecs.cend()) {
+ loggers::get_instance().log("http_codec_emtel::encode_body_xml: Call 'lost_codec'");
+ _codecs["lost"]->encode((Record_Type&)p_xml_body, p_encoding_buffer); // TODO Use params
+ processed = true;
+ }
+ } // TODO Add new HTTP message codec_gen here
+ if (!processed) {
+ loggers::get_instance().warning("http_codec_emtel::encode_body_xml: Unsupported HTTP codec_gen, use raw field as default");
+ p_encoding_buffer = OCTETSTRING(0, nullptr);
+ }
+
+ return true;
+}
+
+bool http_codec_emtel::decode_body_xml(const OCTETSTRING &p_data, LibHttp__XmlMessageBodyTypes::XmlBody &p_xml_body, const std::string &p_content_type, params* p_params) {
+ loggers::get_instance().log(">>> http_codec_emtel::decode_body_xml");
+
+ if (
+ ((*p_params)["decode_str"].find("=\"urn:ietf:params:xml:ns:geopriv:held\"") != std::string::npos) ||
+ ((*p_params)["decode_str"].find("=\"urn:ietf:params:xml:ns:pidf\"") != std::string::npos)
+ ) {
+ loggers::get_instance().log("http_codec_emtel::decode_body_xml: Find 'urn:ietf:params:xml:ns:geopriv:held'");
+ if (_codecs["held"].get() != nullptr) {
+ loggers::get_instance().log("http_codec_emtel::decode_body_xml: Call 'held_codec'");
+ if (_codecs["held"]->decode(p_data, (Record_Type&)p_xml_body, p_params) == -1) {
+ loggers::get_instance().warning("http_codec_emtel::decode_body_xml: Failed to decode HELD message");
+ p_xml_body.raw() = CHARSTRING(p_data.lengthof(), (char*)static_cast(p_data));
+ } else {
+ loggers::get_instance().log_msg("http_codec_emtel::decode_body_xml: Decoded message:", p_xml_body);
+ }
+ } else {
+ loggers::get_instance().warning("http_codec_emtel::decode_body_xml: No codec_gen for HELD");
+ p_xml_body.raw() = CHARSTRING(p_data.lengthof(), (char*)static_cast(p_data));
+ }
+ } else if ((*p_params)["decode_str"].find("=\"urn:ietf:params:xml:ns:lost1\"") != std::string::npos) {
+ loggers::get_instance().log("http_codec_emtel::decode_body_xml: Find 'urn:ietf:params:xml:ns:lost1'");
+ if (_codecs["lost"].get() != nullptr) {
+ loggers::get_instance().log("http_codec_emtel::decode_body_xml: Call 'lost_codec'");
+ if (_codecs["lost"]->decode(p_data, (Record_Type&)p_xml_body, p_params) == -1) {
+ loggers::get_instance().warning("http_codec_emtel::decode_body_xml: Failed to decode LOST message");
+ p_xml_body.raw() = CHARSTRING(p_data.lengthof(), (char*)static_cast(p_data));
+ } else {
+ loggers::get_instance().log_msg("http_codec_emtel::decode_body_xml: Decoded message:", p_xml_body);
+ }
+ } else {
+ loggers::get_instance().warning("http_codec_emtel::decode_body_xml: No codec_gen for LOST");
+ p_xml_body.raw() = CHARSTRING(p_data.lengthof(), (char*)static_cast(p_data));
+ }
+ } else {
+ loggers::get_instance().warning("http_codec_emtel::decode_body_xml: No XML codec_gen found");
+ p_xml_body.raw() = CHARSTRING(p_data.lengthof(), (char*)static_cast(p_data));
+ }
+
+ return true;
+}
+
+bool http_codec_emtel::encode_body_json(const LibHttp__JsonMessageBodyTypes::JsonBody &p_json_body, OCTETSTRING &p_encoding_buffer, const std::string &p_content_type) {
+ loggers::get_instance().log(">>> http_codec_emtel::encode_body_json");
+
+ std::map > >::const_iterator it;
+ bool processed = false;
+ loggers::get_instance().log("http_codec_emtel::encode_body_json: Content-Type:'%s'", p_content_type.c_str());
+ if (p_content_type.find("json") != std::string::npos) {
+ it = _codecs.find("json"); // TODO Use params
+ if (it != _codecs.cend()) {
+ loggers::get_instance().log("http_codec_emtel::encode_body_json: Call 'json_codec'");
+ _codecs["json"]->encode((Record_Type&)p_json_body, p_encoding_buffer); // TODO Use params
+ processed = true;
+ }
+ } // TODO Add new HTTP message codec_gen here
+ if (!processed) {
+ loggers::get_instance().warning("http_codec_emtel::encode_body_json: Unsupported HTTP codec_gen, use raw field as default");
+ p_encoding_buffer = OCTETSTRING(0, nullptr);
+ }
+
+ return true;
+}
+bool http_codec_emtel::decode_body_json(const OCTETSTRING &p_data, LibHttp__JsonMessageBodyTypes::JsonBody &p_json_body, const std::string &p_content_type, params* p_params) {
+ loggers::get_instance().log(">>> http_codec_emtel::decode_body_json");
+
+ if (_codecs["json"].get() != nullptr) {
+ loggers::get_instance().log("http_codec_emtel::decode_body_json: Call 'json_codec'");
+ if (_codecs["json"]->decode(p_data, (Record_Type&)p_json_body, p_params) == -1) {
+ loggers::get_instance().warning("http_codec_emtel::decode_body_json: Failed to decode JSON message");
+ p_json_body.raw() = CHARSTRING(p_data.lengthof(), (char*)static_cast(p_data));
+ } else {
+ loggers::get_instance().log_msg("http_codec_emtel::decode_body_json: Decoded message:", p_json_body);
+ }
+ }
+
+ return true;
+}
\ No newline at end of file
diff --git a/ccsrc/Protocols/Http/http_codec_emtel.hh b/ccsrc/Protocols/Http/http_codec_emtel.hh
new file mode 100644
index 0000000000000000000000000000000000000000..9e4f30b06114e8b638080c87bebb5d7cf25ae4de
--- /dev/null
+++ b/ccsrc/Protocols/Http/http_codec_emtel.hh
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "http_codec.hh"
+
+#include "LibHttp_MessageBodyTypes.hh"
+
+class http_codec_emtel : public http_codec {
+
+public:
+ explicit http_codec_emtel() : http_codec(){};
+ virtual ~http_codec_emtel(){};
+
+protected: //! \protectedsection
+ bool encode_body_xml(const LibHttp__XmlMessageBodyTypes::XmlBody &p_xml_body, OCTETSTRING &p_encoding_buffer, const std::string &p_content_type);
+ bool decode_body_xml(const OCTETSTRING &p_data, LibHttp__XmlMessageBodyTypes::XmlBody &p_xml_body, const std::string &p_content_type, params* p_params);
+ bool encode_body_json(const LibHttp__JsonMessageBodyTypes::JsonBody &p_json_body, OCTETSTRING &p_encoding_buffer, const std::string &p_content_type);
+ bool decode_body_json(const OCTETSTRING &p_data, LibHttp__JsonMessageBodyTypes::JsonBody &p_json_body, const std::string &p_content_type, params* p_params);
+}; // End of class http_codec_emtel
diff --git a/ccsrc/Protocols/Http/module.mk b/ccsrc/Protocols/Http/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..0acfc845c6ae5adc69f69cec3422903195e4bcb2
--- /dev/null
+++ b/ccsrc/Protocols/Http/module.mk
@@ -0,0 +1,3 @@
+sources := http_codec_emtel.cc
+includes := .
+
diff --git a/ccsrc/Protocols/LowerLayerPPort/lower_layer_pport_layer.cc b/ccsrc/Protocols/LowerLayerPPort/lower_layer_pport_layer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ab5bfa062796236519df459ba774a1b95dbfbc7a
--- /dev/null
+++ b/ccsrc/Protocols/LowerLayerPPort/lower_layer_pport_layer.cc
@@ -0,0 +1,39 @@
+#include "LibDiameter_Interface.hh"
+#include "LibDiameter_TypesAndValues.hh"
+
+#include "lower_layer_pport_layer_factory.hh"
+
+#include "loggers.hh"
+
+#include "converter.hh"
+
+lower_layer_pport_layer::lower_layer_pport_layer(const std::string & p_type, const std::string & p_param) : t_layer(p_type), _params() {
+ loggers::get_instance().log(">>> lower_layer_pport_layer::lower_layer_pport_layer: %s, %s", to_string().c_str(), p_param.c_str());
+ // Setup parameters
+ params::convert(_params, p_param);
+}
+
+void lower_layer_pport_layer::sendMsg(const LibDiameter__TypesAndValues::Lower__Layer__Primitive& p_diameter_message, params& p_param) {
+ loggers::get_instance().log_msg(">>> lower_layer_pport_layer::sendMsg: ", p_diameter_message);
+
+ // Encode DiameterMessage
+ OCTETSTRING data;
+ // _codec_register.encode(p_diameter_message, data);
+ // send_data(data, _params);
+}
+
+void lower_layer_pport_layer::send_data(OCTETSTRING& data, params& p_params) {
+ loggers::get_instance().log_msg(">>> lower_layer_pport_layer::send_data: ", data);
+
+ send_to_all_layers(data, p_params);
+}
+
+void lower_layer_pport_layer::receive_data(OCTETSTRING& data, params& p_params)
+{
+ loggers::get_instance().log_msg(">>> lower_layer_pport_layer::receive_data: ", data);
+
+ // Decode Diameter message
+}
+
+lower_layer_pport_layer_factory lower_layer_pport_layer_factory::_f;
+
diff --git a/ccsrc/Protocols/LowerLayerPPort/lower_layer_pport_layer.hh b/ccsrc/Protocols/LowerLayerPPort/lower_layer_pport_layer.hh
new file mode 100644
index 0000000000000000000000000000000000000000..17c73b1b42035d71804eeda0d91a064bf495c6a2
--- /dev/null
+++ b/ccsrc/Protocols/LowerLayerPPort/lower_layer_pport_layer.hh
@@ -0,0 +1,73 @@
+/*!
+ * \file lower_layer_pport_layer.hh
+ * \brief Header file for ITS HTTP protocol layer.
+ * \author ETSI STF549
+ * \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
+
+#include
+
+#include "t_layer.hh"
+
+namespace LibDiameter__Interface {
+ class LowerLayerPPort; //! Forward declaration of TITAN class
+}
+
+namespace LibDiameter__TypesAndValues {
+ class Lower__Layer__Primitive; //! Forward declaration of TITAN class
+}
+
+class OCTETSTRING; //! Forward declaration of TITAN class
+
+/*!
+ * \class lower_layer_pport_layer
+ * \brief This class provides a factory class to create an lower_layer_pport_layer class instance
+ */
+class lower_layer_pport_layer : public t_layer