diff options
author | Harald Welte <laforge@gnumonks.org> | 2019-05-02 09:50:34 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-05-02 10:03:32 +0200 |
commit | d21f6a20059d425fbe581ea0bb52f238bec90c1d (patch) | |
tree | e8380df17394d79f4e15ea1bd07a91364d7e4fcf | |
parent | e13cfb2d2298c2a5f8d62c0451dd7db029b1e541 (diff) |
LLC_Templates: Add XID related templates
Change-Id: I383e8761f91fac18625a442088e865ad6a9b472b
-rw-r--r-- | library/LLC_Templates.ttcn | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index b1cdb75c..b71bce16 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -84,6 +84,37 @@ template PDU_LLC tr_LLC_XID(template XID_Information xid, template BIT4 sapi := fCS := '000000'O /* provided by decoder if FCS OK */ } } +template PDU_LLC tr_LLC_XID_MO_CMD(template XID_Information xid, template BIT4 sapi) := + tr_LLC_XID(xid, sapi, LLC_CR_UL_CMD, '1'B); +template PDU_LLC tr_LLC_XID_MO_RSP(template XID_Information xid, template BIT4 sapi) := + tr_LLC_XID(xid, sapi, LLC_CR_UL_RSP, '1'B); +template PDU_LLC tr_LLC_XID_MT_CMD(template XID_Information xid, template BIT4 sapi) := + tr_LLC_XID(xid, sapi, LLC_CR_DL_CMD, '1'B); +template PDU_LLC tr_LLC_XID_MT_RSP(template XID_Information xid, template BIT4 sapi) := + tr_LLC_XID(xid, sapi, LLC_CR_DL_RSP, '1'B); +template (value) PDU_LLC ts_LLC_XID(template (value) XID_Information xid, + template (value) BIT4 sapi, + template (value) BIT1 cr, + template (value) BIT1 p_f) := { + pDU_LLC_U := { + address_field := ts_LLC_Addr(sapi, cr), + control_field := ts_LLC_CtrlU('1011'B, p_f), + information_field_U := { + xID := xid + }, + fCS := omit /* causes encoder to generate FCS */ + } +} + +template (value) PDU_LLC ts_LLC_XID_MO_CMD(template (value) XID_Information xid, template (value) BIT4 sapi) := + ts_LLC_XID(xid, sapi, LLC_CR_UL_CMD, '1'B); +template (value) PDU_LLC ts_LLC_XID_MO_RSP(template (value) XID_Information xid, template (value) BIT4 sapi) := + ts_LLC_XID(xid, sapi, LLC_CR_UL_RSP, '1'B); +template (value) PDU_LLC ts_LLC_XID_MT_CMD(template (value) XID_Information xid, template (value) BIT4 sapi) := + ts_LLC_XID(xid, sapi, LLC_CR_DL_CMD, '1'B); +template (value) PDU_LLC ts_LLC_XID_MT_RSP(template (value) XID_Information xid, template (value) BIT4 sapi) := + ts_LLC_XID(xid, sapi, LLC_CR_DL_RSP, '1'B); + template PDU_LLC tr_LLC_U(template BIT4 m_bits, template BIT1 p_f, template Information_field_U u, template BIT4 sapi, template BIT1 cr) := { @@ -173,4 +204,69 @@ template PDU_LLC tr_LLC_UI_USER := tr_LLC_UI(?, (c_LLC_SAPI_LL3, ); +template XID tr_XID(template XID_Data xd := ?) := { + xl := ?, + typefield := ?, + xID_length := ?, + xID_Data := xd +}; +template (value) XID ts_XID(template (value) BIT5 tf, template (value) XID_Data xd) := { + xl := '0'B, + typefield := tf, + xID_length := { + short_len := 0 + }, + xID_Data := xd +}; + +template XID tr_XID_kU(template uint8_t ku) := tr_XID({kU := ku}); +template (value) XID ts_XID_kU(template (value) uint8_t ku) := ts_XID('01010'B, {kU := ku}); + +template XID tr_XID_kD(template uint8_t kd) := tr_XID({kD := kd}); +template (value) XID ts_XID_kD(template (value) uint8_t kd) := ts_XID('01001'B, {kD := kd}); + +template XID tr_XID_mD(template uint15_t md) := tr_XID({mD := {spare := '0'B, mDValue := md}}); +template (value) XID ts_XID_mD(template (value) uint15_t md) := ts_XID('00111'B, {mD := { spare := '0'B, mDValue := md}}); + +template XID tr_XID_mU(template uint15_t mu) := tr_XID({mU := {spare := '0'B, mUValue := mu}}); +template (value) XID ts_XID_mU(template (value) uint15_t mu) := ts_XID('01000'B, {mU := { spare := '0'B, mUValue := mu}}); + +template XID tr_XID_N201I(template uint11_t n201i) := + tr_XID({n201_I := {spare := '00000'B, n201IValue := n201i}}); +template (value) XID ts_XID_N201I(template (value) uint11_t n201i) := + ts_XID('00110'B, {n201_I := { spare := '00000'B, n201IValue := n201i}}); + +template XID tr_XID_N201U(template uint11_t n201u) := + tr_XID({n201_U := {spare := '00000'B, n201UValue := n201u}}); +template (value) XID ts_XID_N201U(template (value) uint11_t n201u) := + ts_XID('00101'B, {n201_U := { spare := '00000'B, n201UValue := n201u}}); + +template XID tr_XID_N200(template uint4_t n200) := + tr_XID({n200 := { retransmissions := n200, spare := '0000'B}}); +template (value) XID ts_XID_N200(template (value) uint4_t n200) := + ts_XID('00100'B, {n200 := { retransmissions := n200, spare := '0000'B}}); + +template XID tr_XID_T200(template uint12_t t200) := + tr_XID({t200 := { spare := '0000'B, t200Value := t200}}); +template (value) XID ts_XID_T200(template (value) uint12_t t200) := + ts_XID('00011'B, {t200 := { spare := '0000'B, t200Value := t200}}); + +template XID tr_XID_version(template uint4_t v) := + tr_XID({version := {version_value := v, spare := '0000'B}}); +template (value) XID ts_XID_version(template (value) uint4_t v) := + ts_XID('00000'B, {version := {version_value := v, spare := '0000'B}}); + +template XID tr_XID_IOV_UI(template OCT4 iov) := tr_XID({iOV_UI := iov}); +template (value) XID ts_XID_IOV_UI(template (value) OCT4 iov) := ts_XID('00001'B, {iOV_UI := iov}); + +template XID tr_XID_IOV_I(template OCT4 iov) := tr_XID({iOV_I := iov}); +template (value) XID ts_XID_IOV_I(template (value) OCT4 iov) := ts_XID('00010'B, {iOV_I := iov}); + +template XID tr_XID_L3(template octetstring l3) := tr_XID({l3param := l3}); +template (value) XID ts_XID_L3(template (value) octetstring l3) := ts_XID('01011'B, {l3param := l3}); + +template XID tr_XID_RESET := tr_XID({reset := ''O}); +template (value) XID ts_XID_RESET := ts_XID('01100'B, {reset := ''O}); + + } |