gprs_gb: Add NS CodecPort + Emulation; Add NS selftests
diff --git a/gprs_gb/NS_Types.ttcn b/gprs_gb/NS_Types.ttcn
index ee2444d..bd04a66 100644
--- a/gprs_gb/NS_Types.ttcn
+++ b/gprs_gb/NS_Types.ttcn
@@ -57,6 +57,15 @@
NS_CAUSE_IP_TEST_FAILEDA ('00010100'B)
} with { variant "FIELDLENGTH(8)" };
+ /* TS 48.016 10.3.9 */
+ type record NsSduControlBits {
+ BIT6 spare,
+ boolean c,
+ boolean r
+ } with { variant (c) "FIELDLENGTH(1)"
+ variant (r) "FIELDLENGTH(1)"
+ };
+
type uint16_t Nsvci;
type uint16_t Nsei;
@@ -90,11 +99,29 @@
type record of NsTLV NsTLVs;
- type record NsPdu {
- NsPduType pdu_type,
+ type record NsPduUnitdata {
+ NsSduControlBits control_bits,
+ BssgpBvci bvci,
+ octetstring sdu
+ } with { variant "" };
+
+ type record NsPduOther {
NsTLVs tlvs optional
} with { variant "" };
+ type union NsPduUnion {
+ NsPduUnitdata unitdata,
+ NsPduOther other
+ } with { variant "" };
+
+ type record NsPdu {
+ NsPduType pdu_type,
+ NsPduUnion u
+ } with { variant (u) "CROSSTAG(
+ unitdata, pdu_type = NS_PDUT_NS_UNITDATA;
+ other, OTHERWISE)"
+ };
+
external function enc_NsPdu(in NsPdu pdu) return octetstring
with { extension "prototype(convert) encode(RAW)" };
external function dec_NsPdu(in octetstring stream) return NsPdu