FRNET: Frame Relay network side emulation

Change-Id: I95d64dc26a8d2ff02d6cf2bfcd22a97e5481f957
This commit is contained in:
Harald Welte 2020-09-13 23:17:50 +02:00
parent 17bab82de0
commit 7dcf174098
5 changed files with 155 additions and 0 deletions

16
fr-net/FRNET_Tests.cfg Normal file
View File

@ -0,0 +1,16 @@
[ORDERED_INCLUDE]
# Common configuration, shared between test suites
"../Common.cfg"
# testsuite specific configuration, not expected to change
"./FRNET_Tests.default"
[LOGGING]
[MODULE_PARAMETERS]
[TESTPORT_PARAMETERS]
[MAIN_CONTROLLER]
[EXECUTE]
FRNET_Tests.control

View File

@ -0,0 +1,15 @@
[ORDERED_INCLUDE]
# Common configuration, shared between test suites
"../Common.cfg"
[LOGGING]
#*.FileMask := LOG_ALL
ConsoleMask := ERROR | WARNING | TESTCASE | TIMEROP_START | DEBUG_ENCDEC | USER
[MODULE_PARAMETERS]
[TESTPORT_PARAMETERS]
[MAIN_CONTROLLER]
[EXECUTE]

60
fr-net/FRNET_Tests.ttcn Normal file
View File

@ -0,0 +1,60 @@
module FRNET_Tests {
import from General_Types all;
import from Osmocom_Types all;
import from NS_Emulation all;
modulepar {
NSConfigurations mp_nsconfig := {
{
provider := {
fr := {
netdev := "hdlc2",
dlci := 123
}
},
nsvci := 123,
nsei := 123,
role_sgsn := true,
handle_sns := false
}
};
}
type record GbInstance {
NS_CT vc_NS
//BSSGP_CT vc_BSSGP,
//BssgpConfig cfg
};
const integer NUM_GB := 1;
type record length(NUM_GB) of GbInstance GbInstances;
type record length(NUM_GB) of NSConfiguration NSConfigurations;
//type record length(NUM_GB) of BssgpCellId BssgpCellIds;
type component test_CT {
var GbInstances g_gb;
port NS_PT NS[NUM_GB];
};
private function f_init_gb(inout GbInstance gb, charstring id, integer offset) runs on test_CT {
var charstring id_idx := id & int2str(offset);
gb.vc_NS := NS_CT.create(id_idx & "-NSemu");
//gb_vc_BSSGP := BSSGP_CT.create(id_idx & "-BSSGPemu");
//connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP);
connect(self:NS[offset], gb.vc_NS:NS_SP);
gb.vc_NS.start(NSStart(mp_nsconfig[offset], id_idx));
//gb.vc_BSSGP.start(BssgpStart(gb.cfg));
}
testcase TC_foo() runs on test_CT {
f_init_gb(g_gb[0], "gb", 0);
while (true) {
f_sleep(100.0);
}
}
}

55
fr-net/gen_links.sh Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
BASEDIR=../deps
. ../gen_links.sh.inc
#DIR=$BASEDIR/titan.TestPorts.UNIX_DOMAIN_SOCKETasp/src
#FILES="UD_PT.cc UD_PT.hh UD_PortType.ttcn UD_Types.ttcn"
#gen_links $DIR $FILES
DIR=$BASEDIR/titan.Libraries.TCCUsefulFunctions/src
FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCInterface.cc TCCInterface_ip.h"
gen_links $DIR $FILES
DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src
FILES="Socket_API_Definitions.ttcn"
gen_links $DIR $FILES
DIR=$BASEDIR/titan.TestPorts.IPL4asp/src
FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh"
gen_links $DIR $FILES
DIR=$BASEDIR/titan.ProtocolModules.NS_v7.3.0/src
FILES="NS_Types.ttcn"
gen_links $DIR $FILES
DIR=$BASEDIR/titan.ProtocolModules.BSSGP_v13.0.0/src
FILES="BSSGP_EncDec.cc BSSGP_Types.ttcn"
gen_links $DIR $FILES
DIR=$BASEDIR/titan.ProtocolModules.LLC_v7.1.0/src
FILES="LLC_EncDec.cc LLC_Types.ttcn"
gen_links $DIR $FILES
DIR=$BASEDIR/titan.ProtocolModules.SNDCP_v7.0.0/src
FILES="SNDCP_Types.ttcn"
gen_links $DIR $FILES
DIR=$BASEDIR/titan.TestPorts.TELNETasp/src
FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn"
gen_links $DIR $FILES
DIR=$BASEDIR/titan.TestPorts.AF_PACKET/src
FILES="AF_PACKET_PT.cc AF_PACKET_PT.hh AF_PACKET_PortType.ttcn AF_PACKET_PortTypes.ttcn "
FILES+="FrameRelay_Types.ttcn FrameRelay_CodecPort.ttcn FrameRelay_Emulation.ttcn Q931_Types.ttcn Q933_Types.ttcn "
gen_links $DIR $FILES
DIR=../library
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc GSM_Types.ttcn Osmocom_Types.ttcn "
FILES+="NS_Provider_IPL4.ttcn NS_Provider_FR.ttcn NS_Emulation.ttcnpp NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "
FILES+="BSSGP_Emulation.ttcnpp Osmocom_Gb_Types.ttcn "
FILES+="LLC_Templates.ttcn "
gen_links $DIR $FILES
ignore_pp_results

9
fr-net/regen_makefile.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
FILES="*.ttcn *.ttcnpp IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc Native_FunctionDefs.cc "
FILES+="BSSGP_EncDec.cc NS_CodecPort_CtrlFunctDef.cc LLC_EncDec.cc TELNETasp_PT.cc "
FILES+="AF_PACKET_PT.cc AF_PACKET_PT.hh "
export CPPFLAGS_TTCN3="-DNS_EMULATION_FR"
../regen-makefile.sh FRNET_Tests.ttcn $FILES