amarisoft_enb: add NR support

this patch adds the ability to configure NR cells with
Amarisoft eNB. It adds the new DRB-NR template and updates
the normal enb.cfg template to allow using it as LTE only
or with NR cells (5G NSA).

Change-Id: Ia27bbc6db5920ce14bacabe8043601aa2adaa5fe
diff --git a/src/osmo_gsm_tester/templates/amarisoft_drb_nr.cfg.tmpl b/src/osmo_gsm_tester/templates/amarisoft_drb_nr.cfg.tmpl
new file mode 100644
index 0000000..82f3b8c
--- /dev/null
+++ b/src/osmo_gsm_tester/templates/amarisoft_drb_nr.cfg.tmpl
@@ -0,0 +1,423 @@
+/* DRB configuration for each QCI value.
+   QCI characteristics in TS 23.203 table 6.1.7 */
+[
+  /**************************************** GBR */
+  {
+    qci: 1, /* UM - real time (RTP for VOIP) */
+    use_for_en_dc: false,
+    pdcp_config: {
+      discardTimer: 100, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 12,
+      pdcp_SN_SizeDL: 12,
+      statusReportRequired: false,
+      outOfOrderDelivery: false,
+      t_Reordering: 0,
+      /* ROHC header compression */
+      /*
+      headerCompression: {
+        maxCID: 15,
+        profile0x0001: true, // RTP profile
+        profile0x0002: true, // UDP profile
+        profile0x0004: false, // IP profile
+      },
+      */
+    },
+    rlc_config: {
+      ul_um: {
+        sn_FieldLength: 6,
+      },
+      dl_um: {
+        sn_FieldLength: 6,
+        t_Reassembly: 50,
+      },
+    },
+    logical_channel_config: {
+      priority: 7,
+      prioritisedBitRate: 0, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 1,
+    },
+  },
+  {
+    qci: 2, /* UM - real time (video) */
+    pdcp_config: {
+      discardTimer: 150, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: false,
+      outOfOrderDelivery: false,
+      t_Reordering: 0,
+    },
+    rlc_config: {
+      ul_um: {
+        sn_FieldLength: 12,
+      },
+      dl_um: {
+        sn_FieldLength: 12,
+        t_Reassembly: 50,
+      },
+    },
+    logical_channel_config: {
+      priority: 8,
+      prioritisedBitRate: 0, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 1,
+    },
+  },
+  {
+    qci: 3, /* UM - real time (gaming) */
+    pdcp_config: {
+      discardTimer: 100, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: false,
+      outOfOrderDelivery: false,
+      t_Reordering: 0,
+    },
+    rlc_config: {
+      ul_um: {
+        sn_FieldLength: 12,
+      },
+      dl_um: {
+        sn_FieldLength: 12,
+        t_Reassembly: 50,
+      },
+    },
+    logical_channel_config: {
+      priority: 7,
+      prioritisedBitRate: 0, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 2,
+    },
+  },
+  {
+    qci: 4, /* AM - Non-Conversational Video (Buffered Streaming) */
+    pdcp_config: {
+      discardTimer: 0, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: true,
+      outOfOrderDelivery: false,
+    },
+    rlc_config: {
+      ul_am: {
+        sn_FieldLength: 18,
+        t_PollRetransmit: 80, /* in ms */
+        pollPDU: 64,
+        pollByte: 125, /* in kBytes, 0 means infinity */
+        maxRetxThreshold: 4,
+      },
+      dl_am: {
+        sn_FieldLength: 18,
+        t_Reassembly: 80, /* in ms */
+        t_StatusProhibit: 10, /* in ms */
+      },
+    },
+    logical_channel_config: {
+      priority: 9,
+      prioritisedBitRate: 8, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 3,
+    },
+  },
+  {
+    qci: 65, /* UM - real time (MC-PTT voice) */
+    use_for_en_dc: false,
+    pdcp_config: {
+      discardTimer: 100, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 12,
+      pdcp_SN_SizeDL: 12,
+      statusReportRequired: false,
+      outOfOrderDelivery: false,
+      t_Reordering: 0,
+      /* ROHC header compression */
+      /*
+      headerCompression: {
+        maxCID: 15,
+        profile0x0001: true, // RTP profile
+        profile0x0002: true, // UDP profile
+        profile0x0004: false, // IP profile
+      },
+      */
+    },
+    rlc_config: {
+      ul_um: {
+        sn_FieldLength: 6,
+      },
+      dl_um: {
+        sn_FieldLength: 6,
+        t_Reassembly: 50,
+      },
+    },
+    logical_channel_config: {
+      priority: 5,
+      prioritisedBitRate: 0, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 4,
+    },
+  },
+  {
+    qci: 66, /* UM - real time (non MC-PTT voice) */
+    use_for_en_dc: false,
+    pdcp_config: {
+      discardTimer: 150, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: false,
+      outOfOrderDelivery: false,
+      t_Reordering: 0,
+    },
+    rlc_config: {
+      ul_um: {
+        sn_FieldLength: 12,
+      },
+      dl_um: {
+        sn_FieldLength: 12,
+        t_Reassembly: 50,
+      },
+    },
+    logical_channel_config: {
+      priority: 7,
+      prioritisedBitRate: 0, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 4,
+    },
+  },
+  {
+    qci: 67, /* UM - Mission Critical Video user plane */
+    use_for_en_dc: false,
+    pdcp_config: {
+      discardTimer: 100, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: false,
+      outOfOrderDelivery: false,
+      t_Reordering: 0,
+    },
+    rlc_config: {
+      ul_um: {
+        sn_FieldLength: 12,
+      },
+      dl_um: {
+        sn_FieldLength: 12,
+        t_Reassembly: 50,
+      },
+    },
+    logical_channel_config: {
+      priority: 6,
+      prioritisedBitRate: 0, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 5,
+    },
+  },
+  /**************************************** non GBR */
+  {
+    qci: 5, /* AM - high priority (SIP) */
+    use_for_en_dc: false,
+    pdcp_config: {
+      discardTimer: 0, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: true,
+      outOfOrderDelivery: false,
+    },
+    rlc_config: {
+      ul_am: {
+        sn_FieldLength: 18,
+        t_PollRetransmit: 80, /* in ms */
+        pollPDU: 64,
+        pollByte: 125, /* in kBytes, 0 means infinity */
+        maxRetxThreshold: 4,
+      },
+      dl_am: {
+        sn_FieldLength: 18,
+        t_Reassembly: 80, /* in ms */
+        t_StatusProhibit: 10, /* in ms */
+      },
+    },
+    logical_channel_config: {
+      priority: 6,
+      prioritisedBitRate: 8, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 4,
+    },
+  },
+  {
+    qci: 6, /* AM - Video (buffered streaming) */
+    pdcp_config: {
+      discardTimer: 0, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: true,
+      outOfOrderDelivery: false,
+    },
+    rlc_config: {
+      ul_am: {
+        sn_FieldLength: 18,
+        t_PollRetransmit: 80, /* in ms */
+        pollPDU: 64,
+        pollByte: 125, /* in kBytes, 0 means infinity */
+        maxRetxThreshold: 4,
+      },
+      dl_am: {
+        sn_FieldLength: 18,
+        t_Reassembly: 80, /* in ms */
+        t_StatusProhibit: 10, /* in ms */
+      },
+    },
+    logical_channel_config: {
+      priority: 10,
+      prioritisedBitRate: 8, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 5,
+    },
+  },
+  {
+    qci: 7, /* UM - voice, video (live streaming), interactive gaming */
+    pdcp_config: {
+      discardTimer: 100, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: false,
+      outOfOrderDelivery: false,
+      t_Reordering: 0,
+    },
+    rlc_config: {
+      ul_um: {
+        sn_FieldLength: 12,
+      },
+      dl_um: {
+        sn_FieldLength: 12,
+        t_Reassembly: 50,
+      },
+    },
+    logical_channel_config: {
+      priority: 11,
+      prioritisedBitRate: 0, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 6,
+    },
+  },
+  {
+    qci: 8, /* AM - best effort (Internet traffic) */
+    pdcp_config: {
+      discardTimer: 0, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: true,
+      outOfOrderDelivery: false,
+    },
+    rlc_config: {
+      ul_am: {
+        sn_FieldLength: 18,
+        t_PollRetransmit: 80, /* in ms */
+        pollPDU: 64,
+        pollByte: 125, /* in kBytes, 0 means infinity */
+        maxRetxThreshold: 4,
+      },
+      dl_am: {
+        sn_FieldLength: 18,
+        t_Reassembly: 80, /* in ms */
+        t_StatusProhibit: 10, /* in ms */
+      },
+    },
+    logical_channel_config: {
+      priority: 12,
+      prioritisedBitRate: 8, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 7,
+    },
+  },
+  {
+    qci: 9, /* AM - best effort (Internet traffic) */
+    pdcp_config: {
+      discardTimer: 0, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: true,
+      outOfOrderDelivery: false,
+    },
+    rlc_config: {
+      ul_am: {
+        sn_FieldLength: 18,
+        t_PollRetransmit: 80, /* in ms */
+        pollPDU: 64,
+        pollByte: 125, /* in kBytes, 0 means infinity */
+        maxRetxThreshold: 4,
+      },
+      dl_am: {
+        sn_FieldLength: 18,
+        t_Reassembly: 80, /* in ms */
+        t_StatusProhibit: 10, /* in ms */
+      },
+    },
+    logical_channel_config: {
+      priority: 13,
+      prioritisedBitRate: 8, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 7,
+    },
+  },
+  {
+    qci: 69, /* AM - high priority (MC-PTT signalling) */
+    use_for_en_dc: false,
+    pdcp_config: {
+      discardTimer: 0, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: true,
+      outOfOrderDelivery: false,
+    },
+    rlc_config: {
+      ul_am: {
+        sn_FieldLength: 18,
+        t_PollRetransmit: 80, /* in ms */
+        pollPDU: 64,
+        pollByte: 125, /* in kBytes, 0 means infinity */
+        maxRetxThreshold: 4,
+      },
+      dl_am: {
+        sn_FieldLength: 18,
+        t_Reassembly: 80, /* in ms */
+        t_StatusProhibit: 10, /* in ms */
+      },
+    },
+    logical_channel_config: {
+      priority: 4,
+      prioritisedBitRate: 8, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 4,
+    },
+  },
+  {
+    qci: 70, /* AM - MC data */
+    use_for_en_dc: false,
+    pdcp_config: {
+      discardTimer: 0, /* in ms, 0 means infinity */
+      pdcp_SN_SizeUL: 18,
+      pdcp_SN_SizeDL: 18,
+      statusReportRequired: true,
+      outOfOrderDelivery: false,
+    },
+    rlc_config: {
+      ul_am: {
+        sn_FieldLength: 18,
+        t_PollRetransmit: 80, /* in ms */
+        pollPDU: 64,
+        pollByte: 125, /* in kBytes, 0 means infinity */
+        maxRetxThreshold: 4,
+      },
+      dl_am: {
+        sn_FieldLength: 18,
+        t_Reassembly: 80, /* in ms */
+        t_StatusProhibit: 10, /* in ms */
+      },
+    },
+    logical_channel_config: {
+      priority: 11,
+      prioritisedBitRate: 8, /* in kb/s, -1 means infinity */
+      bucketSizeDuration: 100, /* in ms */
+      logicalChannelGroup: 5,
+    },
+  },
+]