Move f_addrstr2addr() to library/Misc_Helpers.ttcn
This function can easily be reused in other testsuites supporting both IPv4 and IPv6 addresses. Change-Id: I4243ec5551f128629b6504ccc59efeb456a6855d
This commit is contained in:
parent
a907b9f1c9
commit
a16a6b667b
|
@ -44,7 +44,7 @@ FILES="UDPasp_PT.cc UDPasp_PT.hh UDPasp_PortType.ttcn UDPasp_Types.ttcn"
|
||||||
gen_links $DIR $FILES
|
gen_links $DIR $FILES
|
||||||
|
|
||||||
DIR=../library
|
DIR=../library
|
||||||
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp "
|
FILES="Native_Functions.ttcn Native_FunctionDefs.cc Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp "
|
||||||
FILES+="PCO_Types.ttcn GSUP_Types.ttcn GSUP_Templates.ttcn GSUP_Emulation.ttcn "
|
FILES+="PCO_Types.ttcn GSUP_Types.ttcn GSUP_Templates.ttcn GSUP_Emulation.ttcn "
|
||||||
FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn "
|
FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn "
|
||||||
FILES+="Osmocom_VTY_Functions.ttcn "
|
FILES+="Osmocom_VTY_Functions.ttcn "
|
||||||
|
|
|
@ -10,6 +10,7 @@ FILES="
|
||||||
IPA_CodecPort_CtrlFunctDef.cc
|
IPA_CodecPort_CtrlFunctDef.cc
|
||||||
IPL4asp_PT.cc
|
IPL4asp_PT.cc
|
||||||
IPL4asp_discovery.cc
|
IPL4asp_discovery.cc
|
||||||
|
Native_FunctionDefs.cc
|
||||||
MAP_EncDec.cc
|
MAP_EncDec.cc
|
||||||
SS_EncDec.cc
|
SS_EncDec.cc
|
||||||
TCCConversion.cc
|
TCCConversion.cc
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
module Misc_Helpers {
|
module Misc_Helpers {
|
||||||
|
|
||||||
|
import from Native_Functions all;
|
||||||
|
|
||||||
modulepar {
|
modulepar {
|
||||||
charstring mp_osmo_repo := "nightly";
|
charstring mp_osmo_repo := "nightly";
|
||||||
}
|
}
|
||||||
|
@ -51,4 +53,12 @@ function f_addr_is_ipv6(charstring addr) return boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function f_addrstr2addr(charstring addr) return octetstring {
|
||||||
|
if (f_addr_is_ipv6(addr)) {
|
||||||
|
return f_inet6_addr(addr);
|
||||||
|
} else {
|
||||||
|
return f_inet_addr(addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,15 +118,6 @@ private function f_mgcp_addr2addrtype(charstring addr) return charstring {
|
||||||
}
|
}
|
||||||
return "IP4";
|
return "IP4";
|
||||||
}
|
}
|
||||||
|
|
||||||
private function f_addrstr2addr(charstring addr) return octetstring {
|
|
||||||
if (f_addr_is_ipv6(addr)) {
|
|
||||||
return f_inet6_addr(addr);
|
|
||||||
} else {
|
|
||||||
return f_inet_addr(addr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function f_init_mncc(charstring id) runs on test_CT {
|
function f_init_mncc(charstring id) runs on test_CT {
|
||||||
id := id & "-MNCC";
|
id := id & "-MNCC";
|
||||||
var MnccOps ops := {
|
var MnccOps ops := {
|
||||||
|
|
|
@ -25,7 +25,7 @@ FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn"
|
||||||
gen_links $DIR $FILES
|
gen_links $DIR $FILES
|
||||||
|
|
||||||
DIR=../library
|
DIR=../library
|
||||||
FILES="GSMTAP_PortType.ttcn GSMTAP_Types.ttcn GSM_SystemInformation.ttcn GSM_RestOctets.ttcn GSM_RR_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_Types.ttcn IPL4_GSMTAP_CtrlFunct.ttcn IPL4_GSMTAP_CtrlFunctDef.cc Osmocom_Types.ttcn Misc_Helpers.ttcn General_Types.ttcn Osmocom_VTY_Functions.ttcn"
|
FILES="GSMTAP_PortType.ttcn GSMTAP_Types.ttcn GSM_SystemInformation.ttcn GSM_RestOctets.ttcn GSM_RR_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_Types.ttcn IPL4_GSMTAP_CtrlFunct.ttcn IPL4_GSMTAP_CtrlFunctDef.cc Osmocom_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc Misc_Helpers.ttcn General_Types.ttcn Osmocom_VTY_Functions.ttcn"
|
||||||
gen_links $DIR $FILES
|
gen_links $DIR $FILES
|
||||||
|
|
||||||
ignore_pp_results
|
ignore_pp_results
|
||||||
|
|
|
@ -7,6 +7,7 @@ FILES="
|
||||||
IPL4_GSMTAP_CtrlFunctDef.cc
|
IPL4_GSMTAP_CtrlFunctDef.cc
|
||||||
IPL4asp_PT.cc
|
IPL4asp_PT.cc
|
||||||
IPL4asp_discovery.cc
|
IPL4asp_discovery.cc
|
||||||
|
Native_FunctionDefs.cc
|
||||||
TCCConversion.cc
|
TCCConversion.cc
|
||||||
TCCInterface.cc
|
TCCInterface.cc
|
||||||
TELNETasp_PT.cc
|
TELNETasp_PT.cc
|
||||||
|
|
Loading…
Reference in New Issue