Fix local server for multiple applications master
authoreramos <diametersuite@gmail.com>
Sat, 19 Aug 2023 23:29:34 +0000 (01:29 +0200)
committereramos <diametersuite@gmail.com>
Sat, 19 Aug 2023 23:41:06 +0000 (01:41 +0200)
commite14f6ba5183403d7bbf589ef87b0643b12a0f72c
tree4aad75b50c78187a44a6dfcd8d2027c48947a0e1
parent7681cb4079366eb6908dd5d0dc0124c3fcef4b6b
Fix local server for multiple applications

There was a historic bug/limitation, due to the
diameter.comm module design. We were not able to
set two (or more) origin hosts sharing the same
local server. So, we needed to set different ports
(3868, 3869, etc.) to listen for different diameter
applications as a server.

This was because a poor design where LocalServer was
tied to specific engine, and then, depending on when
the service was registered (services.xml), one engine
or the other was enabled to manage traffic. So, the
server was unable to respond correctly one of the
applications.

We have implemented a map of remote origin hosts
with local origin hosts, and when we have a
reception, we check the origin host of the
message and retrieve the own origin host which was
configured for it. This is primarly done at CER/CEA
exchange. When the CER arrives, we get the
Auth-Application-Id, and we know the corresponding
stack and answer in consequence. Also, we store
the relation remote-local origin host in the
origin host manager map.

All the virtual methods must carry the origin host
which applies, to operate. Also, many virtuals with
default empty implementation but not used have been
removed.

Reacting answers are now stored in specific origin
host. We could even improve the fact that operated
host is not needed to be set when programming
reacting answers, because all depends on the origin
host for those answers. But this way, we allow to
do rare things (tests).

CER and DWR configuration have been separated.
And setClientCER now have specific prototype for
default CER, which needs the application-id which
will be set as Auth-Application-Id.

Entity and client sessions, still keep a_engine
most of the cases.

Component Test have been tested OK.

New version will be 1.0.6
34 files changed:
CMakeLists.txt
docker-images/anna-adml-http/Dockerfile
example/diameter/launcher/EventOperation.cpp
example/diameter/launcher/Launcher.cpp
example/diameter/launcher/MyDiameterEntity.cpp
example/diameter/launcher/MyDiameterEntity.hpp
example/diameter/launcher/MyLocalServer.cpp
example/diameter/launcher/MyLocalServer.hpp
example/diameter/launcher/resources/rest_api/ct/ct.sh
example/diameter/launcher/resources/scripts/tinyTestcase.sh
example/diameter/rxSimpleTest/MyDiameterEntity.cpp
example/diameter/rxSimpleTest/MyDiameterEntity.hpp
example/diameter/rxSimpleTest/MyLocalServer.cpp
example/diameter/rxSimpleTest/MyLocalServer.hpp
example/diameter/rxSimpleTest/rxSimpleTest.cpp
include/anna/diameter.comm/ClientSession.hpp
include/anna/diameter.comm/Engine.hpp
include/anna/diameter.comm/Entity.hpp
include/anna/diameter.comm/LocalServer.hpp
include/anna/diameter.comm/OriginHost.hpp
include/anna/diameter.comm/OriginHostManager.hpp
include/anna/diameter.comm/Server.hpp
include/anna/diameter.comm/ServerSession.hpp
include/anna/diameter.comm/Session.hpp
source/diameter.comm/ClientSession.cpp
source/diameter.comm/Engine.cpp
source/diameter.comm/Entity.cpp
source/diameter.comm/LocalServer.cpp
source/diameter.comm/MessageStatistics.cpp
source/diameter.comm/OriginHost.cpp
source/diameter.comm/OriginHostManager.cpp
source/diameter.comm/Server.cpp
source/diameter.comm/ServerSession.cpp
source/diameter.comm/Session.cpp