hnodeb: Add audio SAPI
Change-Id: I20544f67c2450bc3cd4bcb3ee638de1958bf5783
diff --git a/library/HNBLLIF_Types.ttcn b/library/HNBLLIF_Types.ttcn
index f9c8cc5..befd7bb 100644
--- a/library/HNBLLIF_Types.ttcn
+++ b/library/HNBLLIF_Types.ttcn
@@ -232,15 +232,121 @@
other, OTHERWISE)"
};
+/**********************
+ * AUDIO SAPI
+ **********************/
+type enumerated HNBLLIF_AUDIO_MsgType {
+ HNBLL_IF_AUDIO_MSG_CONN_ESTABLISH ('0000'O),
+ HNBLL_IF_AUDIO_MSG_CONN_RELEASE ('0001'O),
+ HNBLL_IF_AUDIO_MSG_CONN_DATA ('0002'O)
+} with { variant "FIELDLENGTH(16)" };
+
+/* CONN_ESTABLISH */
+type record HNBLLIF_AUDIO_conn_establish_req {
+ uint32_t context_id,
+ uint16_t remote_rtp_port,
+ uint8_t reserved,
+ HNBLLIF_AddrType remote_rtp_address_type,
+ HNBLLIF_Addr remote_addr
+} with { variant "" };
+
+type record HNBLLIF_AUDIO_conn_establish_cnf {
+ uint32_t context_id,
+ uint16_t local_rtp_port,
+ uint8_t error_code,
+ HNBLLIF_AddrType local_rtp_address_type,
+ HNBLLIF_Addr local_addr
+} with { variant "" };
+
+type union HNBLLIF_AUDIO_PrimOpUnion_conn_establish {
+ HNBLLIF_AUDIO_conn_establish_req req,
+ HNBLLIF_AUDIO_conn_establish_cnf cnf,
+ octetstring other
+} with { variant "" };
+type record HNBLLIF_AUDIO_PrimOp_conn_establish {
+ HNBLLIF_Operation op,
+ HNBLLIF_AUDIO_PrimOpUnion_conn_establish u
+} with { variant (u) "CROSSTAG( req, op = HNBLL_IF_OP_REQUEST;
+ cnf, op = HNBLL_IF_OP_CONFIRM;
+ other, OTHERWISE)"
+};
+
+/* CONN_RELEASE */
+type record HNBLLIF_AUDIO_conn_release_req {
+ uint32_t context_id
+} with { variant "" };
+
+
+type union HNBLLIF_AUDIO_PrimOpUnion_conn_release {
+ HNBLLIF_AUDIO_conn_release_req req,
+ octetstring other
+} with { variant "" };
+type record HNBLLIF_AUDIO_PrimOp_conn_release {
+ HNBLLIF_Operation op,
+ HNBLLIF_AUDIO_PrimOpUnion_conn_release u
+} with { variant (u) "CROSSTAG( req, op = HNBLL_IF_OP_REQUEST;
+ other, OTHERWISE)"
+};
+
+/* CONN_DATA */
+type record HNBLLIF_AUDIO_conn_data_ind {
+ uint32_t context_id,
+ uint32_t data_len,
+ octetstring data /* RANAP message */
+} with { variant (data_len) "LENGTHTO (data)" };
+
+type record HNBLLIF_AUDIO_conn_data_req {
+ uint32_t context_id,
+ uint32_t data_len,
+ octetstring data /* RANAP message */
+} with { variant (data_len) "LENGTHTO (data)" };
+
+type union HNBLLIF_AUDIO_PrimOpUnion_conn_data {
+ HNBLLIF_AUDIO_conn_data_req req,
+ HNBLLIF_AUDIO_conn_data_ind ind,
+ octetstring other
+} with { variant "" };
+type record HNBLLIF_AUDIO_PrimOp_conn_data {
+ HNBLLIF_Operation op,
+ HNBLLIF_AUDIO_PrimOpUnion_conn_data u
+} with { variant (u) "CROSSTAG( req, op = HNBLL_IF_OP_REQUEST;
+ ind, op = HNBLL_IF_OP_INDICATION;
+ other, OTHERWISE)"
+};
+
+type union HNBLLIF_AUDIO_PrimUnion {
+ HNBLLIF_AUDIO_PrimOp_conn_establish conn_establish,
+ HNBLLIF_AUDIO_PrimOp_conn_release conn_release,
+ HNBLLIF_AUDIO_PrimOp_conn_data conn_data,
+ octetstring other
+} with { variant "" };
+
+type record HNBLLIF_AUDIO_PrimHdr {
+ HNBLLIF_AUDIO_MsgType prim,
+ HNBLLIF_AUDIO_PrimUnion u
+} with { variant (u) "CROSSTAG( conn_establish, prim = HNBLL_IF_AUDIO_MSG_CONN_ESTABLISH;
+ conn_release, prim = HNBLL_IF_AUDIO_MSG_CONN_RELEASE;
+ conn_data, prim = HNBLL_IF_AUDIO_MSG_CONN_DATA;
+ other, OTHERWISE)"
+};
+
/**********************
* General
**********************/
+
+type enumerated HNBLLIF_AddrType {
+ HNBLL_IF_ADDR_TYPE_UNSPEC ('00'O),
+ HNBLL_IF_ADDR_TYPE_IPV4 ('01'O),
+ HNBLL_IF_ADDR_TYPE_IPV6 ('02'O)
+} with { variant "FIELDLENGTH(8)" };
+type octetstring HNBLLIF_Addr length(16);
+
type enumerated HNBLLIF_Sapi {
HNBLL_IF_SAPI_CTL (-1),
- HNBLL_IF_SAPI_IUH ('00000001'O)//,
+ HNBLL_IF_SAPI_IUH ('00000001'O),
//HNBLL_IF_SAPI_GTP ('00000002'O),
- //HNBLL_IF_SAPI_AUDIO ('00000003'O),
+ HNBLL_IF_SAPI_AUDIO ('00000003'O)
} with { variant "FIELDLENGTH(32)"
variant "COMP(2scompl)"
};
@@ -255,6 +361,7 @@
type union HNBLLIF_SapiUnion {
HNBLLIF_CTL_PrimHdr ctl,
HNBLLIF_IUH_PrimHdr iuh,
+ HNBLLIF_AUDIO_PrimHdr audio,
octetstring other
} with { variant "" };
@@ -263,6 +370,7 @@
HNBLLIF_SapiUnion u
} with { variant (u) "CROSSTAG( ctl, sapi = HNBLL_IF_SAPI_CTL;
iuh, sapi = HNBLL_IF_SAPI_IUH;
+ audio, sapi = HNBLL_IF_SAPI_AUDIO;
other, OTHERWISE)"
};
@@ -271,5 +379,29 @@
external function dec_HNBLLIF_Message(in octetstring stream) return HNBLLIF_Message
with { extension "prototype(convert) decode(RAW)" };
+function f_HNBLLIF_AF2addr_type(AddressFamily address_family)
+return HNBLLIF_AddrType {
+ if (address_family == AF_INET) {
+ return HNBLL_IF_ADDR_TYPE_IPV4;
+ } else if (address_family == AF_INET6) {
+ return HNBLL_IF_ADDR_TYPE_IPV6;
+ } else {
+ return HNBLL_IF_ADDR_TYPE_UNSPEC;
+ }
+}
+
+function f_HNBLLIF_Addr(HNBLLIF_AddrType addr_type, charstring addr_str)
+return HNBLLIF_Addr {
+ var HNBLLIF_Addr addr;
+
+ if (addr_type == HNBLL_IF_ADDR_TYPE_IPV4) {
+ addr := f_inet_addr(addr_str);
+ } else {
+ addr := f_inet6_addr(addr_str);
+ }
+
+ return addr;
+}
+
} with { encode "RAW" variant "BYTEORDER(first)" };