library/PCUIF_Types: get rid of version 9 compatibility glue
Change-Id: Ia9f366ca1fdad700a90ca3367e43523f7bac39a1
Related: OS#5083
diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index 96b2bac..2216a0e 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -153,30 +153,14 @@
} with { variant (ma) "BYTEORDER(first), BITORDER(msb)" };
private type record length(8) of PCUIF_InfoTrxTs PCUIF_InfoTrxTsList;
-/* Version >= 10 specific coding */
-private type record PCUIF_InfoV10Trx {
+private type record PCUIF_InfoTrx {
uint16_t arfcn,
BIT8 pdch_mask,
OCT1 spare,
uint32_t hLayer1,
PCUIF_InfoTrxTsList ts
} with { variant (pdch_mask) "BITORDER(msb)" };
-type record length(8) of PCUIF_InfoV10Trx PCUIF_InfoV10TrxList;
-
-/* Version <= 9 specific coding */
-private type record PCUIF_InfoV09Trx {
- uint16_t arfcn,
- BIT8 pdch_mask,
- OCT1 spare,
- OCT8 tsc,
- uint32_t hLayer1
-} with { variant (pdch_mask) "BITORDER(msb)" };
-private type record length(8) of PCUIF_InfoV09Trx PCUIF_InfoV09TrxList;
-
-type union PCUIF_InfoTrxs {
- PCUIF_InfoV09TrxList v09,
- PCUIF_InfoV10TrxList v10
-} with { variant "" };
+type record length(8) of PCUIF_InfoTrx PCUIF_InfoTrxs;
type record PCUIF_info_ind {
uint32_t version,
@@ -216,20 +200,6 @@
record length(2) of uint16_t local_port,
record length(2) of uint16_t remote_port,
PCUIF_RemoteAddr remote_addr
-} with {
- /* NOTE: TITAN is not smart enough to handle 'version < 10' and 'version > 9',
- * so we cannot support more than two versions at the same time here. Sigh. */
- variant (trx) "CROSSTAG(v09, version = 9; v10, version = 10)"
- variant (remote_addr) "CROSSTAG(v09, version = 9; v10, version = 10)"
-};
-
-type union PCUIF_RemoteAddr {
- PCUIF_RemoteAddrV09 v09,
- PCUIF_RemoteAddrV10 v10
-} with { variant "" };
-
-type record PCUIF_RemoteAddrV09 {
- record length(2) of OCT4 addr
} with { variant "" };
type enumerated PCUIF_AddrType {
@@ -238,7 +208,7 @@
PCUIF_ADDR_TYPE_IPV6 ('29'O)
} with { variant "FIELDLENGTH(8)" };
-type record PCUIF_RemoteAddrV10 {
+type record PCUIF_RemoteAddr {
record length(2) of PCUIF_AddrType addr_type,
record length(2) of octetstring addr length(16)
} with { variant "" };
@@ -822,9 +792,10 @@
ma := ma
};
-template (value) PCUIF_InfoV10Trx ts_PCUIF_InfoV10Trx(template (value) uint16_t arfcn := 871,
- template (value) BIT8 pdch_mask := '00000001'B,
- template (value) uint3_t tsc := 7) := {
+template (value) PCUIF_InfoTrx
+ts_PCUIF_InfoTrx(template (value) uint16_t arfcn := 871,
+ template (value) BIT8 pdch_mask := '00000001'B,
+ template (value) uint3_t tsc := 7) := {
arfcn := arfcn,
pdch_mask := pdch_mask,
spare := '00'O,
@@ -837,34 +808,16 @@
}
};
-template (value) PCUIF_InfoV09Trx ts_PCUIF_InfoV09Trx(template (value) uint16_t arfcn := 871,
- template (value) BIT8 pdch_mask := '00000001'B,
- OCT1 tsc := '07'O) := {
- arfcn := arfcn,
- pdch_mask := pdch_mask,
- spare := '00'O,
- tsc := tsc & tsc & tsc & tsc & tsc & tsc & tsc & tsc,
- hLayer1 := 0
-}
-
-template (value) PCUIF_InfoV09Trx ts_PCUIF_InfoV09TrxNULL := ts_PCUIF_InfoV09Trx(0, '00000000'B, '00'O);
-
-template (value) PCUIF_InfoTrxs ts_PCUIF_InfoV09Trxs_def(uint16_t base_arfcn) := {
- v09 := {
- ts_PCUIF_InfoV09Trx(arfcn := base_arfcn + 0), ts_PCUIF_InfoV09TrxNULL,
- ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL,
- ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL,
- ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL
- }
-};
-
-template (value) PCUIF_InfoTrxs ts_PCUIF_InfoV10Trxs_def(uint16_t base_arfcn) := {
- v10 := {
- ts_PCUIF_InfoV10Trx(arfcn := base_arfcn + 0), ts_PCUIF_InfoV10Trx(arfcn := base_arfcn + 1),
- ts_PCUIF_InfoV10Trx(arfcn := base_arfcn + 2), ts_PCUIF_InfoV10Trx(arfcn := base_arfcn + 3),
- ts_PCUIF_InfoV10Trx(arfcn := base_arfcn + 4), ts_PCUIF_InfoV10Trx(arfcn := base_arfcn + 5),
- ts_PCUIF_InfoV10Trx(arfcn := base_arfcn + 6), ts_PCUIF_InfoV10Trx(arfcn := base_arfcn + 7)
- }
+template (value) PCUIF_InfoTrxs
+ts_PCUIF_InfoTrxs_def(uint16_t base_arfcn) := {
+ ts_PCUIF_InfoTrx(arfcn := base_arfcn + 0),
+ ts_PCUIF_InfoTrx(arfcn := base_arfcn + 1),
+ ts_PCUIF_InfoTrx(arfcn := base_arfcn + 2),
+ ts_PCUIF_InfoTrx(arfcn := base_arfcn + 3),
+ ts_PCUIF_InfoTrx(arfcn := base_arfcn + 4),
+ ts_PCUIF_InfoTrx(arfcn := base_arfcn + 5),
+ ts_PCUIF_InfoTrx(arfcn := base_arfcn + 6),
+ ts_PCUIF_InfoTrx(arfcn := base_arfcn + 7)
};
template (value) PCUIF_Message ts_PCUIF_INFO_IND(template (value) uint8_t bts_nr,
@@ -1005,39 +958,12 @@
}
-/* TODO: remove this as soon as we drop version 9 support */
-function f_PCUIF_ver_INFO_Trxs(uint16_t base_arfcn)
-return PCUIF_InfoTrxs {
- if (PCUIF_Types.mp_pcuif_version >= 10) {
- return valueof(ts_PCUIF_InfoV10Trxs_def(base_arfcn));
- } else {
- return valueof(ts_PCUIF_InfoV09Trxs_def(base_arfcn));
- }
-}
-
-function f_PCUIF_ver_INFO_PDCHMask_get(in PCUIF_info_ind info, uint8_t trx_nr)
-return BIT8 {
- if (PCUIF_Types.mp_pcuif_version >= 10) {
- return info.trx.v10[trx_nr].pdch_mask;
- } else {
- return info.trx.v09[trx_nr].pdch_mask;
- }
-}
-
-function f_PCUIF_ver_INFO_PDCHMask_set(inout PCUIF_info_ind info, BIT8 pdch_mask,
- template (present) uint8_t trx_nr := ?)
+function f_PCUIF_PDCHMask_set(inout PCUIF_info_ind info, BIT8 pdch_mask,
+ template (present) uint8_t trx_nr := ?)
{
- if (PCUIF_Types.mp_pcuif_version >= 10) {
- for (var integer nr := 0; nr < lengthof(info.trx.v10); nr := nr + 1) {
- if (match(nr, trx_nr)) {
- info.trx.v10[nr].pdch_mask := pdch_mask;
- }
- }
- } else {
- for (var integer nr := 0; nr < lengthof(info.trx.v09); nr := nr + 1) {
- if (match(nr, trx_nr)) {
- info.trx.v09[nr].pdch_mask := pdch_mask;
- }
+ for (var integer nr := 0; nr < lengthof(info.trx); nr := nr + 1) {
+ if (match(nr, trx_nr)) {
+ info.trx[nr].pdch_mask := pdch_mask;
}
}
}
@@ -1054,31 +980,21 @@
}
/* TODO: second (redundant) NSVC connection is not (yet) supported */
-function f_PCUIF_ver_INFO_RemoteAddr(PCUIF_AddrType addr_type,
- charstring addr)
+function f_PCUIF_RemoteAddr(PCUIF_AddrType addr_type,
+ charstring addr_str)
return PCUIF_RemoteAddr {
var PCUIF_RemoteAddr remote_addr;
- if (PCUIF_Types.mp_pcuif_version >= 10) {
- remote_addr.v10.addr_type[0] := addr_type;
- if (addr_type == PCUIF_ADDR_TYPE_IPV4) {
- remote_addr.v10.addr[0] := f_inet_addr(addr);
- } else {
- remote_addr.v10.addr[0] := f_inet6_addr(addr);
- }
- remote_addr.v10.addr_type[1] := PCUIF_ADDR_TYPE_UNSPEC;
- remote_addr.v10.addr[1] := f_pad_oct(''O, 16, '00'O);
+ remote_addr.addr_type[0] := addr_type;
+ if (addr_type == PCUIF_ADDR_TYPE_IPV4) {
+ remote_addr.addr[0] := f_inet_addr(addr_str);
} else {
- if (addr_type != PCUIF_ADDR_TYPE_IPV4) {
- testcase.stop("NSVC address type := ", addr_type,
- "is not supported in version := ",
- PCUIF_Types.mp_pcuif_version);
- }
- /* v9 requires the IP in host byte order */
- remote_addr.v09.addr[0] := f_inet_haddr(addr);
- remote_addr.v09.addr[1] := f_pad_oct(''O, 4, '00'O);
+ remote_addr.addr[0] := f_inet6_addr(addr_str);
}
+ remote_addr.addr_type[1] := PCUIF_ADDR_TYPE_UNSPEC;
+ remote_addr.addr[1] := f_pad_oct(''O, 16, '00'O);
+
return remote_addr;
}