diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index 0e5d4d025ab9b6832aafd83c9add0d2137b56ad0..1e5fee20805b7070a5b71b816db0f789d9d5a179 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -27,8 +27,8 @@ cmake_minimum_required (VERSION 2.8)
 # Base directories, compatible with legacy OAI building
 ################################################
 set (OPENAIR_DIR     $ENV{OPENAIR_DIR})
-#set (NFAPI_DIR       $ENV{NFAPI_DIR})
-set (NFAPI_DIR       ${OPENAIR_DIR}/nfapi)
+set (NFAPI_DIR       ${OPENAIR_DIR}/nfapi/open-nFAPI)
+set (NFAPI_USER_DIR  ${OPENAIR_DIR}/nfapi/oai_integration)
 set (OPENAIR1_DIR    ${OPENAIR_DIR}/openair1)
 set (OPENAIR2_DIR    ${OPENAIR_DIR}/openair2)
 set (OPENAIR3_DIR    ${OPENAIR_DIR}/openair3)
@@ -728,7 +728,12 @@ else()
   include_directories("${OPENAIR2_DIR}/UTIL")
   include_directories("${OPENAIR2_DIR}/UTIL/LOG")
 endif()
-include_directories("${NFAPI_DIR}")
+include_directories("${NFAPI_DIR}/nfapi/public_inc")
+include_directories("${NFAPI_DIR}/common/public_inc")
+include_directories("${NFAPI_DIR}/pnf/public_inc")
+include_directories("${NFAPI_DIR}/nfapi/inc")
+include_directories("${NFAPI_DIR}/sim_common/inc")
+include_directories("${NFAPI_DIR}/pnf_sim/inc")
 include_directories("${OPENAIR1_DIR}")
 include_directories("${OPENAIR2_DIR}")
 include_directories("${OPENAIR2_DIR}/LAYER2/RLC")
@@ -969,6 +974,58 @@ set(SCHED_SRC
 )
 add_library(SCHED_LIB ${SCHED_SRC})
 
+# nFAPI
+#################################
+set(NFAPI_COMMON_SRC
+  ${NFAPI_DIR}/common/src/debug.c
+)
+add_library(NFAPI_COMMON_LIB ${NFAPI_COMMON_SRC})
+
+include_directories(${NFAPI_DIR}/common/public_inc)
+
+set(NFAPI_SRC
+  ${NFAPI_DIR}/nfapi/src/nfapi.c
+  ${NFAPI_DIR}/nfapi/src/nfapi_p4.c
+  ${NFAPI_DIR}/nfapi/src/nfapi_p5.c
+  ${NFAPI_DIR}/nfapi/src/nfapi_p7.c
+)
+add_library(NFAPI_LIB ${NFAPI_SRC})
+
+include_directories(${NFAPI_DIR}/nfapi/public_inc)
+include_directories(${NFAPI_DIR}/nfapi/inc)
+
+set(NFAPI_PNF_SRC
+  ${NFAPI_DIR}/pnf/src/pnf.c
+  ${NFAPI_DIR}/pnf/src/pnf_interface.c
+  ${NFAPI_DIR}/pnf/src/pnf_p7.c
+  ${NFAPI_DIR}/pnf/src/pnf_p7_interface.c
+)
+add_library(NFAPI_PNF_LIB ${NFAPI_PNF_SRC})
+
+include_directories(${NFAPI_DIR}/pnf/public_inc)
+include_directories(${NFAPI_DIR}/pnf/inc)
+
+set(NFAPI_VNF_SRC
+  ${NFAPI_DIR}/vnf/src/vnf.c
+  ${NFAPI_DIR}/vnf/src/vnf_interface.c
+  ${NFAPI_DIR}/vnf/src/vnf_p7.c
+  ${NFAPI_DIR}/vnf/src/vnf_p7_interface.c
+)
+add_library(NFAPI_VNF_LIB ${NFAPI_VNF_SRC})
+
+include_directories(${NFAPI_DIR}/vnf/public_inc)
+include_directories(${NFAPI_DIR}/vnf/inc)
+
+# nFAPI user defined code
+#############################
+set(NFAPI_USER_SRC
+  ${NFAPI_USER_DIR}/nfapi.c
+  ${NFAPI_USER_DIR}/nfapi_pnf.c
+  ${NFAPI_USER_DIR}/nfapi_vnf.c
+)
+add_library(NFAPI_USER_LIB ${NFAPI_USER_SRC})
+include_directories(${NFAPI_USER_DIR})
+
 # Layer 1
 #############################
 set(PHY_SRC
@@ -1164,6 +1221,8 @@ add_library(L2
   ${ENB_APP_SRC})
 #  ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c)
 
+include_directories(${NFAPI_USER_DIR})
+
 if (FLEXRAN_AGENT_SB_IF)
 
 #Test for adding a shared library
@@ -1556,6 +1615,13 @@ add_library(OPENAIR0_LIB
   ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
 )
 
+include_directories("${NFAPI_DIR}/nfapi/public_inc")
+include_directories("${NFAPI_DIR}/common/public_inc")
+include_directories("${NFAPI_DIR}/pnf/public_inc")
+include_directories("${NFAPI_DIR}/nfapi/inc")
+include_directories("${NFAPI_DIR}/sim_common/inc")
+include_directories("${NFAPI_DIR}/pnf_sim/inc")
+
 # System packages that are required
 # We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/
 # or cmake provide a generic interface to pkg-config that widely used
@@ -1721,10 +1787,12 @@ add_executable(lte-softmodem
   ${SHLIB_LOADER_SOURCES}
   )
 
-target_link_libraries (lte-softmodem -ldl 
+target_link_libraries (lte-softmodem
   -Wl,--start-group
   RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
-  -Wl,--end-group )
+  NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB
+  NFAPI_USER_LIB
+  -Wl,--end-group z dl)
 
 target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
 target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp  ${XFORMS_LIBRARIES} ${PROTOBUF_LIB}  ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
@@ -1830,17 +1898,18 @@ target_include_directories(oaisim PUBLIC  ${OPENAIR_TARGETS}/SIMU/USER)
 target_link_libraries (oaisim
   -Wl,-ldl,--start-group
   RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} LIB_NAS_UE SIMU SECU_OSA ${ITTI_LIB}
+  NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB
+  NFAPI_USER_LIB
   -Wl,--end-group )
 
 target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
-target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES}  ${NETTLE_LIBRARIES} sctp 
-  ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES})
+target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES}  ${NETTLE_LIBRARIES} sctp z
+  ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES} )
 #Force link with forms, regardless XFORMS option
 target_link_libraries (oaisim forms)
 target_link_libraries (oaisim ${T_LIB})
 
 
-
 # A all in one network simulator
 ################
 add_executable(oaisim_nos1
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 2ac0975a81eb37bd8e761abda68a334d97f3d03d..0d48f51df91bc743d844a3306ef3577b4cd1cb5e 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -197,7 +197,7 @@ function main() {
             GDB=1
             CMAKE_BUILD_TYPE="Debug"
             echo_info "Will Compile with gdb symbols and disable compiler optimization"
-            CMAKE_CMD="$CMAKE_CMD -DCMAKE_BUILD_TYPE=Debug"
+            CMAKE_CMD="$CMAKE_CMD -DCMAKE_BUILD_TYPE=Debug --trace-expand"
             shift;;
        --eNB)
             eNB=1
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index 8cf0d22e91fa67c803095667346e980a239ea593..1ea97c030f2b07169c0009920e55be800c7da3c1 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -95,6 +95,8 @@ get_distribution_release() {
 check_supported_distribution() {
     local distribution=$(get_distribution_release)
     case "$distribution" in
+        "ubuntu17.10") return 0 ;;
+        "ubuntu17.04") return 0 ;;
         "ubuntu16.04") return 0 ;;
         "ubuntu14.04") return 0 ;;
         "fedora24")    return 0 ;;
@@ -230,6 +232,7 @@ install_protobuf_c_from_source(){
     rm -rf /tmp/protobuf-c
     git clone https://github.com/protobuf-c/protobuf-c.git
     cd protobuf-c
+	git checkout 2a46af42784abf86804d536f6e0122d47cfeea45
     ./autogen.sh
     ./configure
     echo "Compiling protobuf-c"
@@ -479,16 +482,26 @@ check_install_oai_software() {
     fi
     $SUDO $INSTALLER update -y
   if [[ "$OS_DISTRO" == "ubuntu" ]]; then
+    local LAPACK_LIBNAME="liblapack.so"
+    local LAPACK_TARGET="/usr/lib/atlas-base/atlas/liblapack.so"
     $SUDO apt install -y software-properties-common
     case "$(get_distribution_release)" in
         "ubuntu14.04")
-            specific_packages="libtasn1-3-dev"
+            specific_packages="libtasn1-3-dev gccxml libgnutls-dev libatlas-dev"
             # For iperf3
             $SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe"
             $SUDO apt-get update
             ;;
         "ubuntu16.04")
-            specific_packages="libtasn1-6-dev"
+            specific_packages="libtasn1-6-dev gccxml libgnutls-dev libatlas-dev"
+            ;;
+        "ubuntu17.04")
+            specific_packages="libtasn1-6-dev castxml libgnutls28-dev libatlas-dev"
+            ;;
+        "ubuntu17.10")
+            specific_packages="libtasn1-6-dev castxml libgnutls28-dev"
+            LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
+            LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
             ;;
     esac
     $SUDO apt-get install -y \
@@ -504,7 +517,6 @@ check_install_oai_software() {
 	texlive-latex-base \
 	ethtool \
 	flex  \
-	gccxml \
 	gdb  \
 	git \
 	graphviz \
@@ -515,7 +527,6 @@ check_install_oai_software() {
 	iptables \
 	iptables-dev \
 	libatlas-base-dev \
-	libatlas-dev \
 	libblas-dev \
 	libconfig8-dev \
 	libffi-dev \
@@ -553,11 +564,9 @@ check_install_oai_software() {
 	wget \
 	libxpm-dev
 
-    $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
-    
-    $SUDO apt-get install -y nettle-dev nettle-bin
+    $SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET"
 
-    $SUDO apt-get install -y libgnutls-dev
+    $SUDO apt-get install -y nettle-dev nettle-bin
   elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
     if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
       if rpm -q epel-release > /dev/null; then
diff --git a/common/config/config_userapi.c b/common/config/config_userapi.c
index 4e49f2c56a8e69afeac77a2ebb2fd1f5fc24b588..acee5646cd7aae319f6fccef056a309e306d8fde 100644
--- a/common/config/config_userapi.c
+++ b/common/config/config_userapi.c
@@ -128,6 +128,7 @@ int config_get(paramdef_t *params,int numparams, char *prefix)
 {
 int ret= -1;
 
+printf("numparams:%d prefix:%s\n", numparams, prefix);
 if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
     fprintf(stderr,"[CONFIG] config_get skipped, config module not properly initialized\n");
     return ret;
diff --git a/common/utils/T/T_defs.h b/common/utils/T/T_defs.h
index 24845b6b9eafb2241ad62e7cc9e9ad643f0ecbbb..6bdda0edacdb8f53ead52a6eea844037de309080 100644
--- a/common/utils/T/T_defs.h
+++ b/common/utils/T/T_defs.h
@@ -29,7 +29,7 @@ typedef struct {
 #define T_SHM_FILENAME "/T_shm_segment"
 
 /* number of VCD functions (to be kept up to date! see in T_messages.txt) */
-#define VCD_NUM_FUNCTIONS 178
+#define VCD_NUM_FUNCTIONS 187
 
 /* number of VCD variables (to be kept up to date! see in T_messages.txt) */
 #define VCD_NUM_VARIABLES 128
diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt
index 3e37b5ea150c7913d5c596001c03d364db13f828..3009cc3305d55555d03ef727d79606fcc22c6e84 100644
--- a/common/utils/T/T_messages.txt
+++ b/common/utils/T/T_messages.txt
@@ -2157,3 +2157,39 @@ ID = VCD_FUNCTION_TRX_DECOMPR_IF
     DESC = VCD function TRX_DECOMPR_IF
     GROUP = ALL:VCD:ENB:VCD_FUNCTION
     FORMAT = int,value
+ID = VCD_FUNCTION_NFAPI
+    DESC = VCD function NFAPI
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_GENERATE_PCFICH
+    DESC = VCD function GENERATE_PCFICH
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_GENERATE_DCI0
+    DESC = VCD function GENERATE_DCI0
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_GENERATE_DLSCH
+    DESC = VCD function GENERATE_DLSCH
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_GENERATE_PHICH
+    DESC = VCD function GENERATE_PHICH
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PDCCH_SCRAMBLING
+    DESC = VCD function PDCCH_SCRAMBLING
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PDCCH_MODULATION
+    DESC = VCD function PDCCH_MODULATION
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PDCCH_INTERLEAVING
+    DESC = VCD function PDCCH_INTERLEAVING
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PDCCH_TX
+    DESC = VCD function PDCCH_TX
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
diff --git a/nfapi/README b/nfapi/README
new file mode 100644
index 0000000000000000000000000000000000000000..b2e132153244fbef1c5eab14f653c623817e1fc6
--- /dev/null
+++ b/nfapi/README
@@ -0,0 +1,15 @@
+This directory contains the NFAPI code.
+
+It comes in two parts:
+
+1 - open-nFAPI
+
+    This is a clone of the github repository
+    (https://github.com/cisco/open-nFAPI,
+     commit b3bc579b1697eab829d5d8a2de59c93a61b88fa4).
+    The patch open-nfapi.oai.patch has then been applied.
+
+2 - oai_integration
+
+    This is code written by David Price from Cisco to integrate
+    open-nFAPI into OpenAirInterface.
diff --git a/nfapi/oai_integration/nfapi.c b/nfapi/oai_integration/nfapi.c
new file mode 100644
index 0000000000000000000000000000000000000000..5a3bc804c1b7685ad1292413d71d3965a03339a1
--- /dev/null
+++ b/nfapi/oai_integration/nfapi.c
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1  (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ *      contact@openairinterface.org
+ */
+
+#include <stdio.h>
+#include <pthread.h>
+
+void set_thread_priority(int priority)
+{
+  //printf("%s(priority:%d)\n", __FUNCTION__, priority);
+
+  pthread_attr_t ptAttr;
+
+  struct sched_param schedParam;
+  schedParam.__sched_priority = priority; //79;
+  if(sched_setscheduler(0, SCHED_RR, &schedParam) != 0)
+  {
+    printf("Failed to set scheduler to SCHED_RR\n");
+  }
+
+  if(pthread_attr_setschedpolicy(&ptAttr, SCHED_RR) != 0)
+  {
+    printf("Failed to set pthread sched policy SCHED_RR\n");
+  }
+
+  pthread_attr_setinheritsched(&ptAttr, PTHREAD_EXPLICIT_SCHED);
+
+  struct sched_param thread_params;
+  thread_params.sched_priority = 20;
+  if(pthread_attr_setschedparam(&ptAttr, &thread_params) != 0)
+  {
+    printf("failed to set sched param\n");
+  }
+}
diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c
new file mode 100644
index 0000000000000000000000000000000000000000..c63d504e43d569f2cf9c3045aa2dca1c3b7056d8
--- /dev/null
+++ b/nfapi/oai_integration/nfapi_pnf.c
@@ -0,0 +1,1625 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1  (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ *      contact@openairinterface.org
+ */
+
+#define _GNU_SOURCE
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "debug.h"
+#include "nfapi_pnf_interface.h"
+#include "nfapi.h"
+#include "nfapi_pnf.h"
+#include "common/ran_context.h"
+//#include "openair1/PHY/vars.h"
+extern RAN_CONTEXT_t RC;
+
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <netinet/in.h>
+#include <assert.h>
+#include <arpa/inet.h>
+#include <pthread.h>
+#include <errno.h>
+
+#include <vendor_ext.h>
+#include "fapi_stub.h"
+//#include "fapi_l1.h"
+#include "UTIL/LOG/log.h"
+#include "openair2/LAYER2/MAC/proto.h"
+
+#define NUM_P5_PHY 2
+
+#define _GNU_SOURCE
+
+extern void phy_init_RU(RU_t*);
+extern int config_sync_var;
+
+extern pthread_cond_t nfapi_sync_cond;
+extern pthread_mutex_t nfapi_sync_mutex;
+extern int nfapi_sync_var;
+
+extern int sync_var;
+
+extern void init_eNB_afterRU(void);
+extern void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, int frame, int subframe, eNB_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu);
+extern void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, nfapi_ul_config_request_pdu_t *ul_config_pdu, uint16_t frame,uint8_t subframe,uint8_t srs_present);
+extern void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, eNB_rxtx_proc_t *proc,  nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t codeword_index, uint8_t *sdu);
+extern void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, eNB_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu);
+extern void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, eNB_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu);
+extern void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t *sdu);
+
+extern uint8_t  nfapi_mode;
+
+nfapi_tx_request_pdu_t* tx_request_pdu[1023][10][10]; // [frame][subframe][max_num_pdus]
+
+uint8_t tx_pdus[32][8][4096];
+
+
+uint16_t phy_antenna_capability_values[] = { 1, 2, 4, 8, 16 };
+
+nfapi_pnf_param_response_t g_pnf_param_resp;
+
+
+nfapi_pnf_p7_config_t *p7_config_g = NULL;
+
+void* pnf_allocate(size_t size) {
+  return malloc(size);
+}
+
+void pnf_deallocate(void* ptr) {
+  free(ptr);
+}
+
+
+typedef struct {
+  //public:
+  uint8_t enabled;
+  uint32_t rx_port;
+  uint32_t tx_port;
+  //std::string tx_addr;
+  char tx_addr[80];
+} udp_data;
+
+typedef struct {
+    uint16_t index;
+    uint16_t id;
+    uint8_t rfs[2];
+    uint8_t excluded_rfs[2];
+
+    udp_data udp;
+
+    char local_addr[80];
+    int local_port;
+
+    char* remote_addr;
+    int remote_port;
+
+    uint8_t duplex_mode;
+    uint16_t dl_channel_bw_support;
+    uint16_t ul_channel_bw_support;
+    uint8_t num_dl_layers_supported;
+    uint8_t num_ul_layers_supported;
+    uint16_t release_supported;
+    uint8_t nmm_modes_supported;
+
+    uint8_t dl_ues_per_subframe;
+    uint8_t ul_ues_per_subframe;
+
+    uint8_t first_subframe_ind;
+
+    // timing information recevied from the vnf
+    uint8_t timing_window;
+    uint8_t timing_info_mode;
+    uint8_t timing_info_period;
+
+} phy_info;
+
+typedef struct {
+  //public:
+  uint16_t index;
+  uint16_t band;
+  int16_t max_transmit_power;
+  int16_t min_transmit_power;
+  uint8_t num_antennas_supported;
+  uint32_t min_downlink_frequency;
+  uint32_t max_downlink_frequency;
+  uint32_t max_uplink_frequency;
+  uint32_t min_uplink_frequency;
+} rf_info;
+
+
+typedef struct {
+
+    int release;
+    phy_info phys[2];
+    rf_info rfs[2];
+
+    uint8_t sync_mode;
+    uint8_t location_mode;
+    uint8_t location_coordinates[6];
+    uint32_t dl_config_timing;
+    uint32_t ul_config_timing;
+    uint32_t tx_timing;
+    uint32_t hi_dci0_timing;
+
+    uint16_t max_phys;
+    uint16_t max_total_bw;
+    uint16_t max_total_dl_layers;
+    uint16_t max_total_ul_layers;
+    uint8_t shared_bands;
+    uint8_t shared_pa;
+    int16_t max_total_power;
+    uint8_t oui;
+
+    uint8_t wireshark_test_mode;
+
+} pnf_info;
+
+typedef struct {
+  uint16_t phy_id;
+  nfapi_pnf_config_t* config;
+  phy_info* phy;
+  nfapi_pnf_p7_config_t* p7_config;
+} pnf_phy_user_data_t;
+
+static pnf_info pnf;
+static pthread_t pnf_start_pthread;
+
+extern void nfapi_log(char *file, char *func, int line, int comp, int level, const char* format, va_list args);
+
+void pnf_nfapi_trace(nfapi_trace_level_t nfapi_level, const char* message, ...) {
+  va_list args;
+  int oai_level;
+
+  if (nfapi_level==NFAPI_TRACE_ERROR) {
+    oai_level = LOG_ERR;
+  } else if (nfapi_level==NFAPI_TRACE_WARN) {
+    oai_level = LOG_WARNING;
+  } else if (nfapi_level==NFAPI_TRACE_NOTE) {
+    oai_level = LOG_INFO;
+  } else if (nfapi_level==NFAPI_TRACE_INFO) {
+    oai_level = LOG_DEBUG;
+  } else {
+    oai_level = LOG_ERR;
+  }
+
+  va_start(args, message);
+  nfapi_log("FILE>", "FUNC", 999, PHY, oai_level, message, args);
+  va_end(args);
+}
+
+void pnf_set_thread_priority(int priority) {
+
+  pthread_attr_t ptAttr;
+
+  struct sched_param schedParam;
+  schedParam.__sched_priority = priority;
+  if(sched_setscheduler(0, SCHED_RR, &schedParam) != 0) {
+    printf("failed to set SCHED_RR\n");
+  }
+
+  if(pthread_attr_setschedpolicy(&ptAttr, SCHED_RR) != 0) {
+    printf("failed to set pthread SCHED_RR %d\n", errno);
+  }
+
+  pthread_attr_setinheritsched(&ptAttr, PTHREAD_EXPLICIT_SCHED);
+
+  struct sched_param thread_params;
+  thread_params.sched_priority = 20;
+  if(pthread_attr_setschedparam(&ptAttr, &thread_params) != 0) {
+    printf("failed to set sched param\n");
+  }
+}
+
+void* pnf_p7_thread_start(void* ptr) {
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] P7 THREAD %s\n", __FUNCTION__);
+
+  pnf_set_thread_priority(79);
+
+  nfapi_pnf_p7_config_t* config = (nfapi_pnf_p7_config_t*)ptr;
+  nfapi_pnf_p7_start(config);
+
+  return 0;
+}
+
+int pnf_param_request(nfapi_pnf_config_t* config, nfapi_pnf_param_request_t* req) {
+
+  printf("[PNF] pnf param request\n");
+
+  nfapi_pnf_param_response_t resp;
+  memset(&resp, 0, sizeof(resp));
+  resp.header.message_id = NFAPI_PNF_PARAM_RESPONSE;
+  resp.error_code = NFAPI_MSG_OK;
+
+  pnf_info* pnf = (pnf_info*)(config->user_data);
+
+  resp.pnf_param_general.tl.tag = NFAPI_PNF_PARAM_GENERAL_TAG;
+  resp.pnf_param_general.nfapi_sync_mode = pnf->sync_mode;
+  resp.pnf_param_general.location_mode = pnf->location_mode;
+  resp.pnf_param_general.dl_config_timing = pnf->dl_config_timing;
+  resp.pnf_param_general.tx_timing = pnf->tx_timing;
+  resp.pnf_param_general.ul_config_timing = pnf->ul_config_timing;
+  resp.pnf_param_general.hi_dci0_timing = pnf->hi_dci0_timing;
+  resp.pnf_param_general.maximum_number_phys = pnf->max_phys;
+  resp.pnf_param_general.maximum_total_bandwidth = pnf->max_total_bw;
+  resp.pnf_param_general.maximum_total_number_dl_layers = pnf->max_total_dl_layers;
+  resp.pnf_param_general.maximum_total_number_ul_layers = pnf->max_total_ul_layers;
+  resp.pnf_param_general.shared_bands = pnf->shared_bands;
+  resp.pnf_param_general.shared_pa = pnf->shared_pa;
+  resp.pnf_param_general.maximum_total_power = pnf->max_total_power;
+
+  resp.pnf_phy.tl.tag = NFAPI_PNF_PHY_TAG;
+  resp.pnf_phy.number_of_phys = 1;
+
+  for(int i = 0; i < 1; ++i) {
+    resp.pnf_phy.phy[i].phy_config_index = pnf->phys[i].index; 
+    resp.pnf_phy.phy[i].downlink_channel_bandwidth_supported = pnf->phys[i].dl_channel_bw_support;
+    resp.pnf_phy.phy[i].uplink_channel_bandwidth_supported = pnf->phys[i].ul_channel_bw_support;
+    resp.pnf_phy.phy[i].number_of_dl_layers_supported = pnf->phys[i].num_dl_layers_supported;
+    resp.pnf_phy.phy[i].number_of_ul_layers_supported = pnf->phys[i].num_ul_layers_supported;
+    resp.pnf_phy.phy[i].maximum_3gpp_release_supported = pnf->phys[i].release_supported;
+    resp.pnf_phy.phy[i].nmm_modes_supported = pnf->phys[i].nmm_modes_supported;
+
+    resp.pnf_phy.phy[i].number_of_rfs = 2;
+    for(int j = 0; j < 1; ++j) {
+      resp.pnf_phy.phy[i].rf_config[j].rf_config_index = pnf->phys[i].rfs[j];
+    }
+
+    resp.pnf_phy.phy[i].number_of_rf_exclusions = 0;
+    for(int j = 0; j < 0; ++j) {
+      resp.pnf_phy.phy[i].excluded_rf_config[j].rf_config_index = pnf->phys[i].excluded_rfs[j];
+    }
+  }
+
+  resp.pnf_rf.tl.tag = NFAPI_PNF_RF_TAG;
+  resp.pnf_rf.number_of_rfs = 2;
+
+  for(int i = 0; i < 2; ++i) {
+    resp.pnf_rf.rf[i].rf_config_index = pnf->rfs[i].index; 
+    resp.pnf_rf.rf[i].band = pnf->rfs[i].band;
+    resp.pnf_rf.rf[i].maximum_transmit_power = pnf->rfs[i].max_transmit_power; 
+    resp.pnf_rf.rf[i].minimum_transmit_power = pnf->rfs[i].min_transmit_power;
+    resp.pnf_rf.rf[i].number_of_antennas_suppported = pnf->rfs[i].num_antennas_supported;
+    resp.pnf_rf.rf[i].minimum_downlink_frequency = pnf->rfs[i].min_downlink_frequency;
+    resp.pnf_rf.rf[i].maximum_downlink_frequency = pnf->rfs[i].max_downlink_frequency;
+    resp.pnf_rf.rf[i].minimum_uplink_frequency = pnf->rfs[i].min_uplink_frequency;
+    resp.pnf_rf.rf[i].maximum_uplink_frequency = pnf->rfs[i].max_uplink_frequency;
+  }
+
+  if(pnf->release >= 10) {
+    resp.pnf_phy_rel10.tl.tag = NFAPI_PNF_PHY_REL10_TAG;
+    resp.pnf_phy_rel10.number_of_phys = 1;
+
+    for(int i = 0; i < 1; ++i)
+    {
+      resp.pnf_phy_rel10.phy[i].phy_config_index = pnf->phys[i].index; 
+      resp.pnf_phy_rel10.phy[i].transmission_mode_7_supported = 0;
+      resp.pnf_phy_rel10.phy[i].transmission_mode_8_supported = 1;
+      resp.pnf_phy_rel10.phy[i].two_antenna_ports_for_pucch = 0;
+      resp.pnf_phy_rel10.phy[i].transmission_mode_9_supported = 1;
+      resp.pnf_phy_rel10.phy[i].simultaneous_pucch_pusch = 0;
+      resp.pnf_phy_rel10.phy[i].four_layer_tx_with_tm3_and_tm4 = 1;
+    }
+  }
+
+  if(pnf->release >= 11) {
+    resp.pnf_phy_rel11.tl.tag = NFAPI_PNF_PHY_REL11_TAG;
+    resp.pnf_phy_rel11.number_of_phys = 1;
+
+    for(int i = 0; i < 1; ++i) {
+      resp.pnf_phy_rel11.phy[i].phy_config_index = pnf->phys[i].index; 
+      resp.pnf_phy_rel11.phy[i].edpcch_supported = 0;
+      resp.pnf_phy_rel11.phy[i].multi_ack_csi_reporting = 1;
+      resp.pnf_phy_rel11.phy[i].pucch_tx_diversity = 0;
+      resp.pnf_phy_rel11.phy[i].ul_comp_supported = 1;
+      resp.pnf_phy_rel11.phy[i].transmission_mode_5_supported = 0;
+    }
+  }
+
+  if(pnf->release >= 12) {
+    resp.pnf_phy_rel12.tl.tag = NFAPI_PNF_PHY_REL12_TAG;
+    resp.pnf_phy_rel12.number_of_phys = 1;
+
+    for(int i = 0; i < 1; ++i) {
+      resp.pnf_phy_rel12.phy[i].phy_config_index = pnf->phys[i].index; 
+      resp.pnf_phy_rel12.phy[i].csi_subframe_set = 0;
+      resp.pnf_phy_rel12.phy[i].enhanced_4tx_codebook = 2;
+      resp.pnf_phy_rel12.phy[i].drs_supported = 0;
+      resp.pnf_phy_rel12.phy[i].ul_64qam_supported = 1;
+      resp.pnf_phy_rel12.phy[i].transmission_mode_10_supported = 0;
+      resp.pnf_phy_rel12.phy[i].alternative_bts_indices = 1;
+    }
+  }
+
+  if(pnf->release >= 13) {
+    resp.pnf_phy_rel13.tl.tag = NFAPI_PNF_PHY_REL13_TAG;
+    resp.pnf_phy_rel13.number_of_phys = 1;
+
+    for(int i = 0; i < 1; ++i) {
+      resp.pnf_phy_rel13.phy[i].phy_config_index = pnf->phys[i].index; 
+      resp.pnf_phy_rel13.phy[i].pucch_format4_supported = 0;
+      resp.pnf_phy_rel13.phy[i].pucch_format5_supported = 1;
+      resp.pnf_phy_rel13.phy[i].more_than_5_ca_support = 0;
+      resp.pnf_phy_rel13.phy[i].laa_supported = 1;
+      resp.pnf_phy_rel13.phy[i].laa_ending_in_dwpts_supported = 0;
+      resp.pnf_phy_rel13.phy[i].laa_starting_in_second_slot_supported = 1;
+      resp.pnf_phy_rel13.phy[i].beamforming_supported = 0;
+      resp.pnf_phy_rel13.phy[i].csi_rs_enhancement_supported = 1;
+      resp.pnf_phy_rel13.phy[i].drms_enhancement_supported = 0;
+      resp.pnf_phy_rel13.phy[i].srs_enhancement_supported = 1;
+    }
+
+    resp.pnf_phy_rel13_nb_iot.tl.tag = NFAPI_PNF_PHY_REL13_NB_IOT_TAG;
+    resp.pnf_phy_rel13_nb_iot.number_of_phys = 1;
+
+    for(int i = 0; i < 1; ++i) {
+      resp.pnf_phy_rel13_nb_iot.phy[i].phy_config_index = pnf->phys[i].index; 
+
+      resp.pnf_phy_rel13_nb_iot.phy[i].number_of_rfs = 1;
+      for(int j = 0; j < 1; ++j) {
+        resp.pnf_phy_rel13_nb_iot.phy[i].rf_config[j].rf_config_index = pnf->phys[i].rfs[j];
+      }
+
+      resp.pnf_phy_rel13_nb_iot.phy[i].number_of_rf_exclusions = 1;
+      for(int j = 0; j < 1; ++j) {
+        resp.pnf_phy_rel13_nb_iot.phy[i].excluded_rf_config[j].rf_config_index = pnf->phys[i].excluded_rfs[j];
+      }
+
+      resp.pnf_phy_rel13_nb_iot.phy[i].number_of_dl_layers_supported = pnf->phys[i].num_dl_layers_supported;
+      resp.pnf_phy_rel13_nb_iot.phy[i].number_of_ul_layers_supported = pnf->phys[i].num_ul_layers_supported;
+      resp.pnf_phy_rel13_nb_iot.phy[i].maximum_3gpp_release_supported = pnf->phys[i].release_supported;
+      resp.pnf_phy_rel13_nb_iot.phy[i].nmm_modes_supported = pnf->phys[i].nmm_modes_supported;
+    }
+  }
+
+  nfapi_pnf_pnf_param_resp(config, &resp);
+
+  return 0;
+}
+
+int pnf_config_request(nfapi_pnf_config_t* config, nfapi_pnf_config_request_t* req) {
+
+  printf("[PNF] pnf config request\n");
+
+  pnf_info* pnf = (pnf_info*)(config->user_data);
+
+  phy_info *phy = pnf->phys;
+  phy->id = req->pnf_phy_rf_config.phy_rf_config[0].phy_id;
+  printf("[PNF] pnf config request assigned phy_id %d to phy_config_index %d\n", phy->id, req->pnf_phy_rf_config.phy_rf_config[0].phy_config_index);
+
+  nfapi_pnf_config_response_t resp;
+  memset(&resp, 0, sizeof(resp));
+  resp.header.message_id = NFAPI_PNF_CONFIG_RESPONSE;
+  resp.error_code = NFAPI_MSG_OK;
+  nfapi_pnf_pnf_config_resp(config, &resp);
+  printf("[PNF] Sent pnf_config_resp\n");
+
+  return 0;
+}
+
+void nfapi_send_pnf_start_resp(nfapi_pnf_config_t* config, uint16_t phy_id) {
+
+  printf("Sending NFAPI_START_RESPONSE config:%p phy_id:%d\n", config, phy_id);
+
+  nfapi_start_response_t start_resp;
+  memset(&start_resp, 0, sizeof(start_resp));
+  start_resp.header.message_id = NFAPI_START_RESPONSE;
+  start_resp.header.phy_id = phy_id;
+  start_resp.error_code = NFAPI_MSG_OK;
+
+  nfapi_pnf_start_resp(config, &start_resp);
+}
+
+int pnf_start_request(nfapi_pnf_config_t* config, nfapi_pnf_start_request_t* req) {
+
+  printf("Received NFAPI_PNF_START_REQUEST\n");
+
+  pnf_info* pnf = (pnf_info*)(config->user_data);
+
+  // start all phys that have been configured
+  phy_info* phy = pnf->phys;
+
+  if(phy->id != 0) {
+    nfapi_pnf_start_response_t resp;
+    memset(&resp, 0, sizeof(resp));
+    resp.header.message_id = NFAPI_PNF_START_RESPONSE;
+    resp.error_code = NFAPI_MSG_OK;
+    nfapi_pnf_pnf_start_resp(config, &resp);
+    printf("[PNF] Sent NFAPI_PNF_START_RESP\n");
+  }
+  return 0;
+}
+
+int pnf_stop_request(nfapi_pnf_config_t* config, nfapi_pnf_stop_request_t* req) {
+
+  printf("[PNF] Received NFAPI_PNF_STOP_REQ\n");
+
+  nfapi_pnf_stop_response_t resp;
+  memset(&resp, 0, sizeof(resp));
+  resp.header.message_id = NFAPI_PNF_STOP_RESPONSE;
+  resp.error_code = NFAPI_MSG_OK;
+  nfapi_pnf_pnf_stop_resp(config, &resp);
+  printf("[PNF] Sent NFAPI_PNF_STOP_REQ\n");
+
+  return 0;
+}
+
+int param_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_param_request_t* req) {
+
+  printf("[PNF] Received NFAPI_PARAM_REQUEST phy_id:%d\n", req->header.phy_id);
+
+  //pnf_info* pnf = (pnf_info*)(config->user_data);
+
+  nfapi_param_response_t nfapi_resp;
+
+  pnf_info* pnf = (pnf_info*)(config->user_data);
+
+  memset(&nfapi_resp, 0, sizeof(nfapi_resp));
+  nfapi_resp.header.message_id = NFAPI_PARAM_RESPONSE;
+  nfapi_resp.header.phy_id = req->header.phy_id;
+  nfapi_resp.error_code = 0; // DJP - what value???
+
+  struct sockaddr_in pnf_p7_sockaddr;
+
+  pnf_p7_sockaddr.sin_addr.s_addr = inet_addr(pnf->phys[0].local_addr);
+  nfapi_resp.nfapi_config.p7_pnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG;
+  memcpy(nfapi_resp.nfapi_config.p7_pnf_address_ipv4.address, &pnf_p7_sockaddr.sin_addr.s_addr, 4);
+  nfapi_resp.num_tlv++;
+
+  // P7 PNF Port
+  nfapi_resp.nfapi_config.p7_pnf_port.tl.tag = NFAPI_NFAPI_P7_PNF_PORT_TAG;
+  nfapi_resp.nfapi_config.p7_pnf_port.value = 32123; // DJP - hard code alert!!!! FIXME TODO
+  nfapi_resp.num_tlv++;
+
+  nfapi_pnf_param_resp(config, &nfapi_resp);
+
+  printf("[PNF] Sent NFAPI_PARAM_RESPONSE phy_id:%d number_of_tlvs:%u\n", req->header.phy_id, nfapi_resp.num_tlv);
+
+  printf("[PNF] param request .. exit\n");
+
+  return 0;
+}
+
+int config_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_config_request_t* req) {
+
+  printf("[PNF] Received NFAPI_CONFIG_REQ phy_id:%d\n", req->header.phy_id);
+
+  pnf_info* pnf = (pnf_info*)(config->user_data);
+  uint8_t num_tlv = 0;
+  struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
+  LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
+
+  phy_info* phy_info = pnf->phys;
+
+  if(req->nfapi_config.timing_window.tl.tag == NFAPI_NFAPI_TIMING_WINDOW_TAG) {
+    phy_info->timing_window = req->nfapi_config.timing_window.value;
+    printf("Phy_info:Timing window:%u NFAPI_CONFIG:timing_window:%u\n", phy_info->timing_window, req->nfapi_config.timing_window.value);
+    num_tlv++;
+  }
+
+  if(req->nfapi_config.timing_info_mode.tl.tag == NFAPI_NFAPI_TIMING_INFO_MODE_TAG) {
+    printf("timing info mode:%d\n", req->nfapi_config.timing_info_mode.value);
+    phy_info->timing_info_mode = req->nfapi_config.timing_info_mode.value;
+    num_tlv++;
+  } else {
+    phy_info->timing_info_mode = 0;
+    printf("NO timing info mode provided\n");
+  }
+
+  if(req->nfapi_config.timing_info_period.tl.tag == NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG) {
+    printf("timing info period provided value:%d\n", req->nfapi_config.timing_info_period.value);
+    phy_info->timing_info_period = req->nfapi_config.timing_info_period.value;
+    num_tlv++;
+  } else {
+    phy_info->timing_info_period = 0;
+  }
+
+  if(req->rf_config.dl_channel_bandwidth.tl.tag == NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG) {
+    phy_info->dl_channel_bw_support = req->rf_config.dl_channel_bandwidth.value;
+    fp->N_RB_DL = req->rf_config.dl_channel_bandwidth.value;
+    num_tlv++;
+    NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG N_RB_DL:%u\n", __FUNCTION__, fp->N_RB_DL);
+  } else {
+    NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() Missing NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG\n", __FUNCTION__);
+  }
+
+  if(req->rf_config.ul_channel_bandwidth.tl.tag == NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG) {
+    phy_info->ul_channel_bw_support = req->rf_config.ul_channel_bandwidth.value;
+    fp->N_RB_UL = req->rf_config.ul_channel_bandwidth.value;
+    num_tlv++;
+  }
+
+  if(req->nfapi_config.rf_bands.tl.tag == NFAPI_NFAPI_RF_BANDS_TAG) {
+    pnf->rfs[0].band = req->nfapi_config.rf_bands.rf_band[0];
+    fp->eutra_band = req->nfapi_config.rf_bands.rf_band[0];
+    num_tlv++;
+  }
+
+  if(req->nfapi_config.earfcn.tl.tag == NFAPI_NFAPI_EARFCN_TAG) {
+    fp->dl_CarrierFreq = from_earfcn(fp->eutra_band, req->nfapi_config.earfcn.value);
+    fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_uldl_offset(fp->eutra_band) * 1e5);
+    num_tlv++;
+
+    NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() earfcn:%u dl_carrierFreq:%u ul_CarrierFreq:%u band:%u N_RB_DL:%u\n", 
+        __FUNCTION__, req->nfapi_config.earfcn.value, fp->dl_CarrierFreq, fp->ul_CarrierFreq, pnf->rfs[0].band, fp->N_RB_DL);
+  }
+
+  if (req->subframe_config.duplex_mode.tl.tag == NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG) {
+    fp->frame_type = req->subframe_config.duplex_mode.value==0 ? TDD : FDD;
+    num_tlv++;
+    NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() frame_type:%d\n", __FUNCTION__, fp->frame_type);
+  }
+
+  if (req->subframe_config.dl_cyclic_prefix_type.tl.tag == NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG) {
+    fp->Ncp = req->subframe_config.dl_cyclic_prefix_type.value;
+    num_tlv++;
+  }
+
+  if (req->subframe_config.ul_cyclic_prefix_type.tl.tag == NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG) {
+    fp->Ncp_UL = req->subframe_config.ul_cyclic_prefix_type.value;
+    num_tlv++;
+  }
+
+  fp->num_MBSFN_config = 0; // DJP - hard code alert
+
+  if (req->sch_config.physical_cell_id.tl.tag == NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG) {
+    fp->Nid_cell = req->sch_config.physical_cell_id.value;
+    fp->nushift = fp->Nid_cell%6;
+    num_tlv++;
+  }
+
+  if (req->rf_config.tx_antenna_ports.tl.tag == NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG) {
+    fp->nb_antennas_tx = req->rf_config.tx_antenna_ports.value;
+    fp->nb_antenna_ports_eNB = 1;
+    num_tlv++;
+  }
+
+  if (req->rf_config.rx_antenna_ports.tl.tag == NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG) {
+    fp->nb_antennas_rx = req->rf_config.rx_antenna_ports.value;
+    num_tlv++;
+  }
+
+  if (req->phich_config.phich_resource.tl.tag == NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG) {
+    fp->phich_config_common.phich_resource = req->phich_config.phich_resource.value;
+    num_tlv++;
+  }
+
+  if (req->phich_config.phich_duration.tl.tag == NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG) {
+    fp->phich_config_common.phich_duration = req->phich_config.phich_duration.value;
+    num_tlv++;
+  }
+
+  if (req->phich_config.phich_power_offset.tl.tag == NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG) {
+    LOG_E(PHY, "%s() NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG tag:%d not supported\n", __FUNCTION__, req->phich_config.phich_power_offset.tl.tag);
+    //fp->phich_config_common.phich_power_offset = req->phich_config.
+    num_tlv++;
+  }
+
+  // UL RS Config
+  if (req->uplink_reference_signal_config.cyclic_shift_1_for_drms.tl.tag == NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG) {
+    fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = req->uplink_reference_signal_config.cyclic_shift_1_for_drms.value;
+    num_tlv++;
+  }
+
+  if (req->uplink_reference_signal_config.uplink_rs_hopping.tl.tag == NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG) {
+    fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = req->uplink_reference_signal_config.uplink_rs_hopping.value;
+    num_tlv++;
+  }
+
+  if (req->uplink_reference_signal_config.group_assignment.tl.tag == NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG) {
+    fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = req->uplink_reference_signal_config.group_assignment.value;
+    num_tlv++;
+  }
+
+  if (req->pusch_config.hopping_mode.tl.tag == NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG) {
+  }  // DJP - not being handled?
+
+  if (req->pusch_config.hopping_offset.tl.tag == NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG) {
+  }  // DJP - not being handled?
+
+  if (req->pusch_config.number_of_subbands.tl.tag == NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG) {
+  }  // DJP - not being handled?
+
+  if (req->prach_config.configuration_index.tl.tag == NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG) {
+    fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex=req->prach_config.configuration_index.value;
+    num_tlv++;
+  }
+
+  if (req->prach_config.root_sequence_index.tl.tag == NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG) {
+    fp->prach_config_common.rootSequenceIndex=req->prach_config.root_sequence_index.value;
+    num_tlv++;
+  }
+
+  if (req->prach_config.zero_correlation_zone_configuration.tl.tag == NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG) {
+    fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=req->prach_config.zero_correlation_zone_configuration.value;
+    num_tlv++;
+  }
+
+  if (req->prach_config.high_speed_flag.tl.tag == NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG) {
+    fp->prach_config_common.prach_ConfigInfo.highSpeedFlag=req->prach_config.high_speed_flag.value;
+    num_tlv++;
+  }
+
+  if (req->prach_config.frequency_offset.tl.tag == NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG) {
+    fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset=req->prach_config.frequency_offset.value;
+    num_tlv++;
+  }
+
+  printf("[PNF] CONFIG_REQUEST[num_tlv:%d] TLVs processed:%d\n", req->num_tlv, num_tlv);
+
+  printf("[PNF] Simulating PHY CONFIG - DJP\n");
+  PHY_Config_t phy_config;
+  phy_config.Mod_id = 0;
+  phy_config.CC_id=0;
+  phy_config.cfg = req;
+
+  phy_config_request(&phy_config);
+
+  dump_frame_parms(fp);
+
+  phy_info->remote_port = req->nfapi_config.p7_vnf_port.value;
+
+  struct sockaddr_in vnf_p7_sockaddr;
+  memcpy(&vnf_p7_sockaddr.sin_addr.s_addr, &(req->nfapi_config.p7_vnf_address_ipv4.address[0]), 4);
+  phy_info->remote_addr = inet_ntoa(vnf_p7_sockaddr.sin_addr);
+
+  printf("[PNF] %d vnf p7 %s:%d timing %d %d %d\n", phy_info->id, phy_info->remote_addr, phy_info->remote_port, 
+      phy_info->timing_window, phy_info->timing_info_mode, phy_info->timing_info_period);
+
+  nfapi_config_response_t nfapi_resp;
+  memset(&nfapi_resp, 0, sizeof(nfapi_resp));
+  nfapi_resp.header.message_id = NFAPI_CONFIG_RESPONSE;
+  nfapi_resp.header.phy_id = phy_info->id;
+  nfapi_resp.error_code = 0; // DJP - some value resp->error_code;
+  nfapi_pnf_config_resp(config, &nfapi_resp);
+  printf("[PNF] Sent NFAPI_CONFIG_RESPONSE phy_id:%d\n", phy_info->id);
+
+  return 0;
+}
+
+nfapi_p7_message_header_t* pnf_phy_allocate_p7_vendor_ext(uint16_t message_id, uint16_t* msg_size) {
+
+  if(message_id == P7_VENDOR_EXT_REQ) {
+    (*msg_size) = sizeof(vendor_ext_p7_req);
+    return (nfapi_p7_message_header_t*)malloc(sizeof(vendor_ext_p7_req));
+  }
+
+  return 0;
+}
+
+void pnf_phy_deallocate_p7_vendor_ext(nfapi_p7_message_header_t* header) {
+
+  free(header);
+}
+
+int pnf_phy_hi_dci0_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req) {
+
+  if (req->hi_dci0_request_body.number_of_dci == 0 && req->hi_dci0_request_body.number_of_hi == 0)
+    LOG_D(PHY,"[PNF] HI_DCI0_REQUEST SFN/SF:%05d dci:%d hi:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), req->hi_dci0_request_body.number_of_dci, req->hi_dci0_request_body.number_of_hi);
+
+  //phy_info* phy = (phy_info*)(pnf_p7->user_data);
+
+  struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
+  eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
+
+  for (int i=0; i<req->hi_dci0_request_body.number_of_dci + req->hi_dci0_request_body.number_of_hi; i++) {
+
+    //LOG_D(PHY,"[PNF] HI_DCI0_REQ sfn_sf:%d PDU[%d]\n", NFAPI_SFNSF2DEC(req->sfn_sf), i);
+
+    if (req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) {
+
+      //LOG_D(PHY,"[PNF] HI_DCI0_REQ sfn_sf:%d PDU[%d] - NFAPI_HI_DCI0_DCI_PDU_TYPE\n", NFAPI_SFNSF2DEC(req->sfn_sf), i);
+
+      nfapi_hi_dci0_request_pdu_t *hi_dci0_req_pdu = &req->hi_dci0_request_body.hi_dci0_pdu_list[i];
+
+      handle_nfapi_hi_dci0_dci_pdu(eNB,NFAPI_SFNSF2SFN(req->sfn_sf),NFAPI_SFNSF2SF(req->sfn_sf),proc,hi_dci0_req_pdu);
+
+      eNB->pdcch_vars[NFAPI_SFNSF2SF(req->sfn_sf)&1].num_dci++;
+
+    } else if (req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type == NFAPI_HI_DCI0_HI_PDU_TYPE) {
+
+      LOG_D(PHY,"[PNF] HI_DCI0_REQ sfn_sf:%d PDU[%d] - NFAPI_HI_DCI0_HI_PDU_TYPE\n", NFAPI_SFNSF2DEC(req->sfn_sf), i);
+
+      nfapi_hi_dci0_request_pdu_t *hi_dci0_req_pdu = &req->hi_dci0_request_body.hi_dci0_pdu_list[i];
+
+      handle_nfapi_hi_dci0_hi_pdu(eNB, NFAPI_SFNSF2SFN(req->sfn_sf),NFAPI_SFNSF2SF(req->sfn_sf), proc, hi_dci0_req_pdu);
+
+    } else {
+
+      LOG_E(PHY,"[PNF] HI_DCI0_REQ sfn_sf:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), i, req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type);
+
+    }
+  }
+
+  return 0;
+}
+
+int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req) {
+
+  if (RC.ru == 0) {
+    return -1;
+  }
+
+  if (RC.eNB == 0) {
+    return -2;
+  }
+
+  if (RC.eNB[0][0] == 0) {
+    return -3;
+  }
+
+  if (sync_var != 0) { 
+    NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() Main system not up - is this a dummy subframe?\n", __FUNCTION__);
+    return -4;
+  }
+
+  int sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
+  int sf = NFAPI_SFNSF2SF(req->sfn_sf);
+
+  struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
+  eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
+  nfapi_dl_config_request_pdu_t* dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list;
+  LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[sf&1];
+
+  pdcch_vars->num_pdcch_symbols = req->dl_config_request_body.number_pdcch_ofdm_symbols;
+  pdcch_vars->num_dci = 0;
+
+  if (req->dl_config_request_body.number_dci || 
+      req->dl_config_request_body.number_pdu ||
+      req->dl_config_request_body.number_pdsch_rnti)
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX:%d/%d RX:%d/%d sfn_sf:%d pdcch:%u dl_cfg[dci:%u pdus:%d pdsch_rnti:%d] pcfich:%u\n", 
+      __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx, 
+      NFAPI_SFNSF2DEC(req->sfn_sf), 
+      req->dl_config_request_body.number_pdcch_ofdm_symbols, 
+      req->dl_config_request_body.number_dci, 
+      req->dl_config_request_body.number_pdu, 
+      req->dl_config_request_body.number_pdsch_rnti, 
+      req->dl_config_request_body.transmission_power_pcfich);
+
+  for (int i=0;i<req->dl_config_request_body.number_pdu;i++) {
+
+    NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d pdcch_vars->num_dci:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size,pdcch_vars->num_dci);
+
+    if (dl_config_pdu_list[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) {
+
+      handle_nfapi_dci_dl_pdu(eNB,NFAPI_SFNSF2SFN(req->sfn_sf),NFAPI_SFNSF2SF(req->sfn_sf),proc,&dl_config_pdu_list[i]);
+
+      pdcch_vars->num_dci++; // Is actually number of DCI PDUs
+
+      NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() pdcch_vars->num_dci:%d\n", __FUNCTION__, pdcch_vars->num_dci);
+
+    } else if (dl_config_pdu_list[i].pdu_type == NFAPI_DL_CONFIG_BCH_PDU_TYPE) {
+
+      nfapi_dl_config_bch_pdu *bch_pdu = &dl_config_pdu_list[i].bch_pdu;
+      uint16_t pdu_index = bch_pdu->bch_pdu_rel8.pdu_index;
+
+      if (tx_request_pdu[sfn][sf][pdu_index] != NULL) {
+
+        //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]);
+
+        handle_nfapi_bch_pdu(eNB, proc, &dl_config_pdu_list[i], tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_data);
+
+        eNB->pbch_configured=1;
+
+      } else {
+
+        NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() BCH NULL TX PDU SFN/SF:%d PDU_INDEX:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pdu_index); 
+      }
+    } else if (dl_config_pdu_list[i].pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE) {
+
+      nfapi_dl_config_dlsch_pdu *dlsch_pdu = &dl_config_pdu_list[i].dlsch_pdu;
+      nfapi_dl_config_dlsch_pdu_rel8_t *rel8_pdu = &dlsch_pdu->dlsch_pdu_rel8;
+      nfapi_tx_request_pdu_t *tx_pdu = tx_request_pdu[sfn][sf][rel8_pdu->pdu_index];
+
+      if (tx_pdu != NULL) {
+        int UE_id = find_dlsch(rel8_pdu->rnti,eNB,SEARCH_EXIST_OR_FREE);
+        AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
+        AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
+        LTE_eNB_DLSCH_t *dlsch0 = eNB->dlsch[UE_id][0];
+        //LTE_eNB_DLSCH_t *dlsch1 = eNB->dlsch[UE_id][1];
+        int harq_pid = dlsch0->harq_ids[sf];
+        uint8_t *dlsch_sdu = tx_pdus[UE_id][harq_pid];
+        
+        memcpy(dlsch_sdu, tx_pdu->segments[0].segment_data, tx_pdu->segments[0].segment_length);
+
+        //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() DLSCH:pdu_index:%d handle_nfapi_dlsch_pdu(eNB, proc_rxtx, dlsch_pdu, transport_blocks:%d sdu:%p) eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols:%d\n", __FUNCTION__, rel8_pdu->pdu_index, rel8_pdu->transport_blocks, dlsch_sdu, eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols);
+
+        handle_nfapi_dlsch_pdu( eNB, sfn,sf, &eNB->proc.proc_rxtx[0], &dl_config_pdu_list[i], rel8_pdu->transport_blocks-1, dlsch_sdu);
+
+      } else {
+
+        NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() DLSCH NULL TX PDU SFN/SF:%d PDU_INDEX:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), rel8_pdu->pdu_index);
+      }
+
+    } else {
+      NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() UNKNOWN:%d\n", __FUNCTION__, dl_config_pdu_list[i].pdu_type);
+    }
+  }
+
+  if(req->vendor_extension)
+    free(req->vendor_extension);
+
+  return 0;
+}
+
+int pnf_phy_tx_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req) {
+
+  uint16_t sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
+  uint16_t sf = NFAPI_SFNSF2SF(req->sfn_sf);
+
+  if (req->tx_request_body.number_of_pdus==0)
+    LOG_D(PHY,"%s() SFN/SF:%d%d PDUs:%d\n", __FUNCTION__, sfn, sf, req->tx_request_body.number_of_pdus);
+
+  if (req->tx_request_body.tl.tag==NFAPI_TX_REQUEST_BODY_TAG) {
+    for (int i=0; i<req->tx_request_body.number_of_pdus; i++) {
+      LOG_D(PHY,"%s() SFN/SF:%d%d number_of_pdus:%d [PDU:%d] pdu_length:%d pdu_index:%d num_segments:%d\n",
+          __FUNCTION__,
+          sfn, sf,
+          req->tx_request_body.number_of_pdus,
+          i,
+          req->tx_request_body.tx_pdu_list[i].pdu_length,
+          req->tx_request_body.tx_pdu_list[i].pdu_index,
+          req->tx_request_body.tx_pdu_list[i].num_segments
+          );
+
+      tx_request_pdu[sfn][sf][i] = &req->tx_request_body.tx_pdu_list[i];
+    }
+  }
+
+  return 0;
+}
+
+int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req) {
+
+  if (0)LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n", 
+      __FUNCTION__,
+      NFAPI_SFNSF2DEC(req->sfn_sf), 
+      req->ul_config_request_body.number_of_pdus,
+      req->ul_config_request_body.rach_prach_frequency_resources,
+      req->ul_config_request_body.srs_present
+      );
+
+  if (RC.ru == 0) {
+    return -1;
+  }
+
+  if (RC.eNB == 0) {
+    return -2;
+  }
+
+  if (RC.eNB[0][0] == 0) {
+    return -3;
+  }
+
+  if (sync_var != 0) { 
+    NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() Main system not up - is this a dummy subframe?\n", __FUNCTION__);
+    return -4;
+  }
+
+  uint16_t curr_sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
+  uint16_t curr_sf = NFAPI_SFNSF2SF(req->sfn_sf);
+
+  struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
+  eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
+  nfapi_ul_config_request_pdu_t* ul_config_pdu_list = req->ul_config_request_body.ul_config_pdu_list;
+
+  for (int i=0;i<req->ul_config_request_body.number_of_pdus;i++) {
+    //LOG_D(PHY, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, ul_config_pdu_list[i].pdu_size);
+
+    if (
+        ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
+        ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE ||
+        ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE ||
+        ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE ||
+        ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE ||
+        ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE ||
+        ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE
+       ) {
+      //LOG_D(PHY, "%s() handle_nfapi_ul_pdu() for PDU:%d\n", __FUNCTION__, i);
+
+      handle_nfapi_ul_pdu(eNB,proc,&ul_config_pdu_list[i],curr_sfn,curr_sf,req->ul_config_request_body.srs_present);
+    } else {
+      NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() PDU:%i UNKNOWN type :%d\n", __FUNCTION__, i, ul_config_pdu_list[i].pdu_type);
+    }
+  }
+
+  return 0;
+}
+
+int pnf_phy_lbt_dl_config_req(nfapi_pnf_p7_config_t* config, nfapi_lbt_dl_config_request_t* req) {
+  //printf("[PNF] lbt dl config request\n");
+  return 0;
+}
+
+int pnf_phy_vendor_ext(nfapi_pnf_p7_config_t* config, nfapi_p7_message_header_t* msg) {
+  if(msg->message_id == P7_VENDOR_EXT_REQ) {
+    //vendor_ext_p7_req* req = (vendor_ext_p7_req*)msg;
+    //printf("[PNF] vendor request (1:%d 2:%d)\n", req->dummy1, req->dummy2);
+  } else {
+    printf("[PNF] unknown vendor ext\n");
+  }
+  return 0;
+}
+
+int pnf_phy_pack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t** ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* codex) {
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+  if(header->message_id == P7_VENDOR_EXT_IND) {
+    vendor_ext_p7_ind* ind = (vendor_ext_p7_ind*)(header);
+    if(!push16(ind->error_code, ppWritePackedMsg, end))
+      return 0;
+
+    return 1;
+  }
+  return -1;
+}
+
+int pnf_phy_unpack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t** ppReadPackedMessage, uint8_t *end, nfapi_p7_codec_config_t* codec) {
+  if(header->message_id == P7_VENDOR_EXT_REQ) {
+    //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+    vendor_ext_p7_req* req = (vendor_ext_p7_req*)(header);
+    if(!(pull16(ppReadPackedMessage, &req->dummy1, end) &&
+          pull16(ppReadPackedMessage, &req->dummy2, end)))
+      return 0;
+    return 1;
+  }
+  return -1;
+}
+
+int pnf_phy_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessage, uint8_t* end, void** ve, nfapi_p7_codec_config_t* config) {
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "pnf_phy_unpack_vendor_extension_tlv\n");
+
+  switch(tl->tag)
+  {
+    case VENDOR_EXT_TLV_1_TAG:
+      *ve = malloc(sizeof(vendor_ext_tlv_1));
+      if(!pull32(ppReadPackedMessage, &((vendor_ext_tlv_1*)(*ve))->dummy, end))
+	return 0;
+
+      return 1;
+      break;
+  }
+
+  return -1;
+}
+
+int pnf_phy_pack_vendor_extention_tlv(void* ve, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p7_codec_config_t* config) {
+  //printf("%s\n", __FUNCTION__);
+  (void)ve;
+  (void)ppWritePackedMsg;
+  return -1;
+}
+
+int pnf_sim_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessage, uint8_t *end, void** ve, nfapi_p4_p5_codec_config_t* config) {
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "pnf_sim_unpack_vendor_extension_tlv\n");
+
+  switch(tl->tag)
+  {
+    case VENDOR_EXT_TLV_2_TAG:
+      *ve = malloc(sizeof(vendor_ext_tlv_2));
+      if(!pull32(ppReadPackedMessage, &((vendor_ext_tlv_2*)(*ve))->dummy, end))
+	return 0;
+
+      return 1;
+      break;
+  }
+
+  return -1;
+}
+
+int pnf_sim_pack_vendor_extention_tlv(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config) {
+  //printf("%s\n", __FUNCTION__);
+  (void)ve;
+  (void)ppWritePackedMsg;
+  return -1;
+}
+
+nfapi_dl_config_request_t dummy_dl_config_req;
+nfapi_tx_request_t dummy_tx_req;
+
+nfapi_pnf_p7_subframe_buffer_t dummy_subframe;
+
+int start_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_start_request_t* req) {
+
+  printf("[PNF] Received NFAPI_START_REQ phy_id:%d\n", req->header.phy_id);
+
+  nfapi_set_trace_level(NFAPI_TRACE_INFO);
+
+  pnf_info* pnf = (pnf_info*)(config->user_data);
+
+  phy_info* phy_info = pnf->phys;
+
+  nfapi_pnf_p7_config_t* p7_config = nfapi_pnf_p7_config_create();
+
+  p7_config->phy_id = phy->phy_id;
+
+  p7_config->remote_p7_port = phy_info->remote_port;
+  p7_config->remote_p7_addr = phy_info->remote_addr;
+  p7_config->local_p7_port = 32123; // DJP - good grief cannot seem to get the right answer phy_info->local_port;
+  //DJP p7_config->local_p7_addr = (char*)phy_info->local_addr.c_str();
+  p7_config->local_p7_addr = phy_info->local_addr;
+
+  printf("[PNF] P7 remote:%s:%d local:%s:%d\n", p7_config->remote_p7_addr, p7_config->remote_p7_port, p7_config->local_p7_addr, p7_config->local_p7_port);
+
+  p7_config->user_data = phy_info;
+
+  p7_config->malloc = &pnf_allocate;
+  p7_config->free = &pnf_deallocate;
+  p7_config->codec_config.allocate = &pnf_allocate;
+  p7_config->codec_config.deallocate = &pnf_deallocate;
+
+  p7_config->trace = &pnf_nfapi_trace;
+
+  phy->user_data = p7_config;
+
+  p7_config->subframe_buffer_size = phy_info->timing_window;
+  printf("subframe_buffer_size configured using phy_info->timing_window:%d\n", phy_info->timing_window);
+  if(phy_info->timing_info_mode & 0x1) {
+    p7_config->timing_info_mode_periodic = 1;
+    p7_config->timing_info_period = phy_info->timing_info_period;
+  }
+
+  if(phy_info->timing_info_mode & 0x2) {
+    p7_config->timing_info_mode_aperiodic = 1;
+  }
+
+  p7_config->dl_config_req = &pnf_phy_dl_config_req;
+  p7_config->ul_config_req = &pnf_phy_ul_config_req;
+  p7_config->hi_dci0_req = &pnf_phy_hi_dci0_req;
+  p7_config->tx_req = &pnf_phy_tx_req;
+  p7_config->lbt_dl_config_req = &pnf_phy_lbt_dl_config_req;
+
+  memset(&dummy_dl_config_req, 0, sizeof(dummy_dl_config_req));
+  dummy_dl_config_req.dl_config_request_body.tl.tag=NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
+  dummy_dl_config_req.dl_config_request_body.number_pdcch_ofdm_symbols=1;
+  dummy_dl_config_req.dl_config_request_body.number_dci=0;
+  dummy_dl_config_req.dl_config_request_body.number_pdu=0;
+  dummy_dl_config_req.dl_config_request_body.number_pdsch_rnti=0;
+  dummy_dl_config_req.dl_config_request_body.transmission_power_pcfich=6000;
+  dummy_dl_config_req.dl_config_request_body.dl_config_pdu_list=0;
+
+  memset(&dummy_tx_req, 0, sizeof(dummy_tx_req));
+  dummy_tx_req.tx_request_body.number_of_pdus=0;
+  dummy_tx_req.tx_request_body.tl.tag=NFAPI_TX_REQUEST_BODY_TAG;
+
+  dummy_subframe.dl_config_req = &dummy_dl_config_req;
+  dummy_subframe.tx_req = 0;//&dummy_tx_req;
+
+  dummy_subframe.ul_config_req=0;
+  dummy_subframe.hi_dci0_req=0;
+  dummy_subframe.lbt_dl_config_req=0;
+
+  p7_config->dummy_subframe = dummy_subframe;
+
+  p7_config->vendor_ext = &pnf_phy_vendor_ext;
+
+  p7_config->allocate_p7_vendor_ext = &pnf_phy_allocate_p7_vendor_ext;
+  p7_config->deallocate_p7_vendor_ext = &pnf_phy_deallocate_p7_vendor_ext;
+
+  p7_config->codec_config.unpack_p7_vendor_extension = &pnf_phy_unpack_p7_vendor_extension;
+  p7_config->codec_config.pack_p7_vendor_extension = &pnf_phy_pack_p7_vendor_extension;
+  p7_config->codec_config.unpack_vendor_extension_tlv = &pnf_phy_unpack_vendor_extension_tlv;
+  p7_config->codec_config.pack_vendor_extension_tlv = &pnf_phy_pack_vendor_extention_tlv;
+
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Creating P7 thread %s\n", __FUNCTION__);
+  pthread_t p7_thread;
+  pthread_create(&p7_thread, NULL, &pnf_p7_thread_start, p7_config);
+
+  //((pnf_phy_user_data_t*)(phy_info->fapi->user_data))->p7_config = p7_config;
+
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Calling l1_north_init_eNB() %s\n", __FUNCTION__);
+  l1_north_init_eNB();
+
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] DJP - HACK - Set p7_config global ready for subframe ind%s\n", __FUNCTION__);
+  p7_config_g = p7_config;
+
+  // Need to wait for main thread to create RU structures
+  while(config_sync_var<0) {
+    usleep(5000000);
+    printf("[PNF] waiting for OAI to be configured (eNB/RU)\n");
+  }
+  printf("[PNF] OAI eNB/RU configured\n");
+
+  printf("[PNF] About to call init_eNB_afterRU()\n");
+  init_eNB_afterRU();
+
+  // Signal to main thread that it can carry on - otherwise RU will startup too quickly and it is not initialised
+  pthread_mutex_lock(&nfapi_sync_mutex);
+  nfapi_sync_var=0;
+  pthread_cond_broadcast(&nfapi_sync_cond);
+  pthread_mutex_unlock(&nfapi_sync_mutex);
+
+  while(sync_var<0) {
+    usleep(5000000);
+    printf("[PNF] waiting for OAI to be started\n");
+  }
+
+  printf("[PNF] Sending PNF_START_RESP\n");
+  nfapi_send_pnf_start_resp(config, p7_config->phy_id);
+
+  printf("[PNF] Sending first P7 subframe ind\n");
+  nfapi_pnf_p7_subframe_ind(p7_config, p7_config->phy_id, 0); // DJP - SFN_SF set to zero - correct???
+  printf("[PNF] Sent first P7 subframe ind\n");
+
+  return 0;
+}
+
+int measurement_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_measurement_request_t* req) {
+
+  nfapi_measurement_response_t resp;
+  memset(&resp, 0, sizeof(resp));
+  resp.header.message_id = NFAPI_MEASUREMENT_RESPONSE;
+  resp.header.phy_id = req->header.phy_id;
+  resp.error_code = NFAPI_MSG_OK;
+  nfapi_pnf_measurement_resp(config, &resp);
+  return 0;
+}
+
+int rssi_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_rssi_request_t* req) {
+
+  nfapi_rssi_response_t resp;
+  memset(&resp, 0, sizeof(resp));
+  resp.header.message_id = NFAPI_RSSI_RESPONSE;
+  resp.header.phy_id = req->header.phy_id;
+  resp.error_code = NFAPI_P4_MSG_OK;
+  nfapi_pnf_rssi_resp(config, &resp);
+
+  nfapi_rssi_indication_t ind;
+  memset(&ind, 0, sizeof(ind));
+  ind.header.message_id = NFAPI_RSSI_INDICATION;
+  ind.header.phy_id = req->header.phy_id;
+  ind.error_code = NFAPI_P4_MSG_OK;
+  ind.rssi_indication_body.tl.tag = NFAPI_RSSI_INDICATION_TAG;
+  ind.rssi_indication_body.number_of_rssi = 1;
+  ind.rssi_indication_body.rssi[0] = -42;
+  nfapi_pnf_rssi_ind(config, &ind);
+
+  return 0;
+}
+
+int cell_search_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_cell_search_request_t* req) {
+
+  nfapi_cell_search_response_t resp;
+  memset(&resp, 0, sizeof(resp));
+  resp.header.message_id = NFAPI_CELL_SEARCH_RESPONSE;
+  resp.header.phy_id = req->header.phy_id;
+  resp.error_code = NFAPI_P4_MSG_OK;
+  nfapi_pnf_cell_search_resp(config, &resp);
+
+  nfapi_cell_search_indication_t ind;
+  memset(&ind, 0, sizeof(ind));
+  ind.header.message_id = NFAPI_CELL_SEARCH_INDICATION;
+  ind.header.phy_id = req->header.phy_id;
+  ind.error_code = NFAPI_P4_MSG_OK;
+
+  switch(req->rat_type) {
+    case NFAPI_RAT_TYPE_LTE:
+      ind.lte_cell_search_indication.tl.tag = NFAPI_LTE_CELL_SEARCH_INDICATION_TAG;
+      ind.lte_cell_search_indication.number_of_lte_cells_found = 1;
+      ind.lte_cell_search_indication.lte_found_cells[0].pci = 123;
+      ind.lte_cell_search_indication.lte_found_cells[0].rsrp = 123;
+      ind.lte_cell_search_indication.lte_found_cells[0].rsrq = 123;
+      ind.lte_cell_search_indication.lte_found_cells[0].frequency_offset = 123;
+      break;
+    case NFAPI_RAT_TYPE_UTRAN:
+      {
+        ind.utran_cell_search_indication.tl.tag = NFAPI_UTRAN_CELL_SEARCH_INDICATION_TAG;
+        ind.utran_cell_search_indication.number_of_utran_cells_found = 1;
+        ind.utran_cell_search_indication.utran_found_cells[0].psc = 89;
+        ind.utran_cell_search_indication.utran_found_cells[0].rscp = 89;
+        ind.utran_cell_search_indication.utran_found_cells[0].ecno = 89;
+        ind.utran_cell_search_indication.utran_found_cells[0].frequency_offset = -89;
+
+      }
+      break;
+    case NFAPI_RAT_TYPE_GERAN:
+      {
+        ind.geran_cell_search_indication.tl.tag = NFAPI_GERAN_CELL_SEARCH_INDICATION_TAG;
+        ind.geran_cell_search_indication.number_of_gsm_cells_found = 1;
+        ind.geran_cell_search_indication.gsm_found_cells[0].bsic = 23;
+        ind.geran_cell_search_indication.gsm_found_cells[0].rxlev = 23;
+        ind.geran_cell_search_indication.gsm_found_cells[0].rxqual = 23;
+        ind.geran_cell_search_indication.gsm_found_cells[0].frequency_offset = -23;
+        ind.geran_cell_search_indication.gsm_found_cells[0].sfn_offset = 230;
+
+      }
+      break;
+  }
+
+  ind.pnf_cell_search_state.tl.tag = NFAPI_PNF_CELL_SEARCH_STATE_TAG;
+  ind.pnf_cell_search_state.length = 3;
+
+  nfapi_pnf_cell_search_ind(config, &ind);	
+
+  return 0;
+}
+
+int broadcast_detect_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_broadcast_detect_request_t* req)
+{
+  nfapi_broadcast_detect_response_t resp;
+  memset(&resp, 0, sizeof(resp));
+  resp.header.message_id = NFAPI_BROADCAST_DETECT_RESPONSE;
+  resp.header.phy_id = req->header.phy_id;
+  resp.error_code = NFAPI_P4_MSG_OK;
+  nfapi_pnf_broadcast_detect_resp(config, &resp);
+
+  nfapi_broadcast_detect_indication_t ind;
+  memset(&ind, 0, sizeof(ind));
+  ind.header.message_id = NFAPI_BROADCAST_DETECT_INDICATION;
+  ind.header.phy_id = req->header.phy_id;
+  ind.error_code = NFAPI_P4_MSG_OK;
+
+  switch(req->rat_type)
+  {
+    case NFAPI_RAT_TYPE_LTE:
+      {
+        ind.lte_broadcast_detect_indication.tl.tag = NFAPI_LTE_BROADCAST_DETECT_INDICATION_TAG;
+        ind.lte_broadcast_detect_indication.number_of_tx_antenna = 1;
+        ind.lte_broadcast_detect_indication.mib_length = 4;
+        //ind.lte_broadcast_detect_indication.mib...
+        ind.lte_broadcast_detect_indication.sfn_offset = 77;
+
+      }
+      break;
+    case NFAPI_RAT_TYPE_UTRAN:
+      {
+        ind.utran_broadcast_detect_indication.tl.tag = NFAPI_UTRAN_BROADCAST_DETECT_INDICATION_TAG;
+        ind.utran_broadcast_detect_indication.mib_length = 4;
+        //ind.utran_broadcast_detect_indication.mib...
+        // ind.utran_broadcast_detect_indication.sfn_offset; DJP - nonsense line
+
+      }
+      break;
+  }
+
+  ind.pnf_cell_broadcast_state.tl.tag = NFAPI_PNF_CELL_BROADCAST_STATE_TAG;
+  ind.pnf_cell_broadcast_state.length = 3;
+
+  nfapi_pnf_broadcast_detect_ind(config, &ind);	
+
+  return 0;
+}
+
+int system_information_schedule_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_system_information_schedule_request_t* req)
+{
+  nfapi_system_information_schedule_response_t resp;
+  memset(&resp, 0, sizeof(resp));
+  resp.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE;
+  resp.header.phy_id = req->header.phy_id;
+  resp.error_code = NFAPI_P4_MSG_OK;
+  nfapi_pnf_system_information_schedule_resp(config, &resp);
+
+  nfapi_system_information_schedule_indication_t ind;
+  memset(&ind, 0, sizeof(ind));
+  ind.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION;
+  ind.header.phy_id = req->header.phy_id;
+  ind.error_code = NFAPI_P4_MSG_OK;
+
+  ind.lte_system_information_indication.tl.tag = NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG;
+  ind.lte_system_information_indication.sib_type = 3;
+  ind.lte_system_information_indication.sib_length = 5;
+  //ind.lte_system_information_indication.sib...
+
+  nfapi_pnf_system_information_schedule_ind(config, &ind);		
+
+  return 0;
+}
+
+int system_information_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_system_information_request_t* req)
+{
+  nfapi_system_information_response_t resp;
+  memset(&resp, 0, sizeof(resp));
+  resp.header.message_id = NFAPI_SYSTEM_INFORMATION_RESPONSE;
+  resp.header.phy_id = req->header.phy_id;
+  resp.error_code = NFAPI_P4_MSG_OK;
+  nfapi_pnf_system_information_resp(config, &resp);
+
+  nfapi_system_information_indication_t ind;
+  memset(&ind, 0, sizeof(ind));
+  ind.header.message_id = NFAPI_SYSTEM_INFORMATION_INDICATION;
+  ind.header.phy_id = req->header.phy_id;
+  ind.error_code = NFAPI_P4_MSG_OK;
+
+  switch(req->rat_type)
+  {
+    case NFAPI_RAT_TYPE_LTE:
+      {
+        ind.lte_system_information_indication.tl.tag = NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG;
+        ind.lte_system_information_indication.sib_type = 1;
+        ind.lte_system_information_indication.sib_length = 3;
+        //ind.lte_system_information_indication.sib...
+      }
+      break;
+    case NFAPI_RAT_TYPE_UTRAN:
+      {
+        ind.utran_system_information_indication.tl.tag = NFAPI_UTRAN_SYSTEM_INFORMATION_INDICATION_TAG;
+        ind.utran_system_information_indication.sib_length = 3;
+        //ind.utran_system_information_indication.sib...
+
+      }
+      break;
+    case NFAPI_RAT_TYPE_GERAN:
+      {
+        ind.geran_system_information_indication.tl.tag = NFAPI_GERAN_SYSTEM_INFORMATION_INDICATION_TAG;
+        ind.geran_system_information_indication.si_length = 3;
+        //ind.geran_system_information_indication.si...
+
+      }
+      break;
+  }
+
+  nfapi_pnf_system_information_ind(config, &ind);		
+
+  return 0;
+}
+
+int nmm_stop_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_nmm_stop_request_t* req)
+{
+  nfapi_nmm_stop_response_t resp;
+  memset(&resp, 0, sizeof(resp));
+  resp.header.message_id = NFAPI_NMM_STOP_RESPONSE;
+  resp.header.phy_id = req->header.phy_id;
+  resp.error_code = NFAPI_P4_MSG_OK;
+  nfapi_pnf_nmm_stop_resp(config, &resp);
+  return 0;
+}
+
+int vendor_ext(nfapi_pnf_config_t* config, nfapi_p4_p5_message_header_t* msg)
+{
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] P5 %s %p\n", __FUNCTION__, msg);
+
+  switch(msg->message_id)
+  {
+    case P5_VENDOR_EXT_REQ:
+      {
+        vendor_ext_p5_req* req = (vendor_ext_p5_req*)msg;
+        NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] P5 Vendor Ext Req (%d %d)\n", req->dummy1, req->dummy2);
+        // send back the P5_VENDOR_EXT_RSP
+        vendor_ext_p5_rsp rsp;
+        memset(&rsp, 0, sizeof(rsp));
+        rsp.header.message_id = P5_VENDOR_EXT_RSP;
+        rsp.error_code = NFAPI_MSG_OK;
+        nfapi_pnf_vendor_extension(config, &rsp.header, sizeof(vendor_ext_p5_rsp));
+      }
+      break;
+  }
+
+  return 0;
+}
+
+nfapi_p4_p5_message_header_t* pnf_sim_allocate_p4_p5_vendor_ext(uint16_t message_id, uint16_t* msg_size) {
+
+  if(message_id == P5_VENDOR_EXT_REQ) {
+    (*msg_size) = sizeof(vendor_ext_p5_req);
+    return (nfapi_p4_p5_message_header_t*)malloc(sizeof(vendor_ext_p5_req));
+  }
+
+  return 0;
+}
+
+void pnf_sim_deallocate_p4_p5_vendor_ext(nfapi_p4_p5_message_header_t* header) {
+  free(header);
+}
+
+int pnf_sim_pack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t* header, uint8_t** ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config) {
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+  if(header->message_id == P5_VENDOR_EXT_RSP) {
+    vendor_ext_p5_rsp* rsp = (vendor_ext_p5_rsp*)(header);
+    return (!push16(rsp->error_code, ppWritePackedMsg, end));
+  }
+  return 0;
+}
+
+int pnf_sim_unpack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t* header, uint8_t** ppReadPackedMessage, uint8_t *end, nfapi_p4_p5_codec_config_t* codec) {
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+  if(header->message_id == P5_VENDOR_EXT_REQ) {
+    vendor_ext_p5_req* req = (vendor_ext_p5_req*)(header);
+    return (!(pull16(ppReadPackedMessage, &req->dummy1, end) &&
+          pull16(ppReadPackedMessage, &req->dummy2, end)));
+
+    //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s (%d %d)\n", __FUNCTION__, req->dummy1, req->dummy2);
+  }
+  return 0;
+}
+
+/*------------------------------------------------------------------------------*/
+
+void* pnf_start_thread(void* ptr) {
+
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] IN PNF NFAPI start thread %s\n", __FUNCTION__);
+
+  nfapi_pnf_config_t *config = (nfapi_pnf_config_t*)ptr;
+
+  struct sched_param sp;
+  sp.sched_priority = 20;
+  pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp);
+
+  nfapi_pnf_start(config);
+
+  return (void*)0;
+}
+
+void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {
+
+  printf("%s() PNF\n\n\n\n\n\n", __FUNCTION__);
+
+  nfapi_mode = 1;  // PNF!
+
+  nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+
+  config->vnf_ip_addr = vnf_ip_addr;
+  config->vnf_p5_port = vnf_p5_port;
+
+  pnf.phys[0].udp.enabled = 1;
+  pnf.phys[0].udp.rx_port = pnf_p7_port;
+  pnf.phys[0].udp.tx_port = vnf_p7_port;
+  strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
+
+  strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
+
+  printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%d rx:%d]\n", 
+      __FUNCTION__, 
+      config->vnf_ip_addr, config->vnf_p5_port, 
+      pnf.phys[0].local_addr,
+      pnf.phys[0].udp.tx_addr, pnf.phys[0].udp.tx_port,
+      pnf.phys[0].udp.rx_port);
+
+  config->pnf_param_req = &pnf_param_request;
+  config->pnf_config_req = &pnf_config_request;
+  config->pnf_start_req = &pnf_start_request;
+  config->pnf_stop_req = &pnf_stop_request;
+  config->param_req = &param_request;
+  config->config_req = &config_request;
+  config->start_req = &start_request;
+
+  config->measurement_req = &measurement_request;
+  config->rssi_req = &rssi_request;
+  config->cell_search_req = &cell_search_request;
+  config->broadcast_detect_req = &broadcast_detect_request;
+  config->system_information_schedule_req = &system_information_schedule_request;
+  config->system_information_req = &system_information_request;
+  config->nmm_stop_req = &nmm_stop_request;
+
+  config->vendor_ext = &vendor_ext;
+
+  config->trace = &pnf_nfapi_trace;
+
+  config->user_data = &pnf;
+
+  // To allow custom vendor extentions to be added to nfapi
+  config->codec_config.unpack_vendor_extension_tlv = &pnf_sim_unpack_vendor_extension_tlv;
+  config->codec_config.pack_vendor_extension_tlv = &pnf_sim_pack_vendor_extention_tlv;
+
+  config->allocate_p4_p5_vendor_ext = &pnf_sim_allocate_p4_p5_vendor_ext;
+  config->deallocate_p4_p5_vendor_ext = &pnf_sim_deallocate_p4_p5_vendor_ext;
+
+  config->codec_config.unpack_p4_p5_vendor_extension = &pnf_sim_unpack_p4_p5_vendor_extension;
+  config->codec_config.pack_p4_p5_vendor_extension = &pnf_sim_pack_p4_p5_vendor_extension;
+
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Creating PNF NFAPI start thread %s\n", __FUNCTION__);
+  pthread_create(&pnf_start_pthread, NULL, &pnf_start_thread, config);
+
+  pthread_setname_np(pnf_start_pthread, "NFAPI_PNF");
+}
+
+void oai_subframe_ind(uint16_t sfn, uint16_t sf) {
+
+  //LOG_D(PHY,"%s(sfn:%d, sf:%d)\n", __FUNCTION__, sfn, sf);
+
+  //TODO FIXME - HACK - DJP - using a global to bodge it in 
+
+  if (p7_config_g != NULL && sync_var==0) {
+
+    uint16_t sfn_sf_tx = sfn<<4 | sf;
+
+    if ((sfn % 100 == 0) && sf==0)
+    {
+      struct timespec ts;
+
+      clock_gettime(CLOCK_MONOTONIC, &ts);
+
+      NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s %d.%d (sfn:%u sf:%u) SFN/SF(TX):%u\n", __FUNCTION__, ts.tv_sec, ts.tv_nsec, sfn, sf, NFAPI_SFNSF2DEC(sfn_sf_tx));
+    }
+
+    int subframe_ret = nfapi_pnf_p7_subframe_ind(p7_config_g, p7_config_g->phy_id, sfn_sf_tx);
+
+    if (subframe_ret) {
+      NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s(frame:%u subframe:%u) SFN/SF(TX):%u - PROBLEM with pnf_p7_subframe_ind()\n", __FUNCTION__, sfn, sf, sfn_sf_tx, NFAPI_SFNSF2DEC(sfn_sf_tx));
+    } else {
+      //NFAPI_TRACE(NFAPI_TRACE_INFO, "***NFAPI subframe handler finished *** \n");
+    }
+  } else {
+  }
+}
+
+int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {
+
+  rach_ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
+
+  LOG_D(PHY, "%s() sfn_sf:%d preambles:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(rach_ind->sfn_sf), rach_ind->rach_indication_body.number_of_preambles);
+
+  return nfapi_pnf_p7_rach_ind(p7_config_g, rach_ind);
+}
+
+int oai_nfapi_harq_indication(nfapi_harq_indication_t *harq_ind) {
+
+  harq_ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
+  harq_ind->header.message_id = NFAPI_HARQ_INDICATION;
+
+  LOG_D(PHY, "%s() sfn_sf:%d number_of_harqs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(harq_ind->sfn_sf), harq_ind->harq_indication_body.number_of_harqs);
+
+  int retval = nfapi_pnf_p7_harq_ind(p7_config_g, harq_ind);
+
+  if (retval != 0)
+    LOG_E(PHY, "%s() sfn_sf:%d number_of_harqs:%d nfapi_pnf_p7_harq_ind()=%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(harq_ind->sfn_sf), harq_ind->harq_indication_body.number_of_harqs, retval);
+
+  return retval;
+}
+
+int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind) {
+
+  crc_ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
+  crc_ind->header.message_id = NFAPI_CRC_INDICATION;
+
+  //LOG_D(PHY, "%s() sfn_sf:%d number_of_crcs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(crc_ind->sfn_sf), crc_ind->crc_indication_body.number_of_crcs);
+
+  return nfapi_pnf_p7_crc_ind(p7_config_g, crc_ind);
+}
+
+int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *ind) {
+
+  ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
+  ind->header.message_id = NFAPI_RX_CQI_INDICATION;
+
+  //LOG_D(PHY, "%s() sfn_sf:%d number_of_cqis:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->cqi_indication_body.number_of_cqis);
+
+  return nfapi_pnf_p7_cqi_ind(p7_config_g, ind);
+}
+
+int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind) {
+
+  ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
+  ind->header.message_id = NFAPI_RX_ULSCH_INDICATION;
+
+  int retval = nfapi_pnf_p7_rx_ind(p7_config_g, ind);
+
+  //LOG_D(PHY,"%s() SFN/SF:%d pdus:%d retval:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rx_indication_body.number_of_pdus, retval);
+
+  //free(ind.rx_indication_body.rx_pdu_list);
+
+  return retval;
+}
+
+int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind) {
+
+  ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
+
+  int retval = nfapi_pnf_p7_sr_ind(p7_config_g, ind);
+
+  //LOG_D(PHY,"%s() SFN/SF:%d srs:%d retval:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->sr_indication_body.number_of_srs, retval);
+
+  //free(ind.rx_indication_body.rx_pdu_list);
+
+  return retval;
+}
diff --git a/nfapi/oai_integration/nfapi_pnf.h b/nfapi/oai_integration/nfapi_pnf.h
new file mode 100644
index 0000000000000000000000000000000000000000..592d4877af1ac87a95c67f9d4d2365b0c586e36d
--- /dev/null
+++ b/nfapi/oai_integration/nfapi_pnf.h
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1  (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ *      contact@openairinterface.org
+ */
+
+#if !defined(NFAPI_PNF_H__)
+#define NFAPI_PNF_H__
+
+void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
+
+#endif
diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c
new file mode 100644
index 0000000000000000000000000000000000000000..07c3f1aa91fda58261b36dd8c90df3cbaf12d781
--- /dev/null
+++ b/nfapi/oai_integration/nfapi_vnf.c
@@ -0,0 +1,1221 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1  (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ *      contact@openairinterface.org
+ */
+
+#define _GNU_SOURCE
+
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "nfapi_interface.h"
+#include "nfapi_vnf_interface.h"
+#include "nfapi.h"
+#include "vendor_ext.h"
+
+#include "nfapi_vnf.h"
+
+
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
+typedef struct {
+  uint8_t enabled;
+  uint32_t rx_port;
+  uint32_t tx_port;
+  char tx_addr[80];
+} udp_data;
+
+typedef struct {
+  uint16_t index;
+  uint16_t id;
+  uint8_t rfs[2];
+  uint8_t excluded_rfs[2];
+
+  udp_data udp;
+
+  char local_addr[80];
+  int local_port;
+
+  char* remote_addr;
+  int remote_port;
+
+  uint8_t duplex_mode;
+  uint16_t dl_channel_bw_support;
+  uint16_t ul_channel_bw_support;
+  uint8_t num_dl_layers_supported;
+  uint8_t num_ul_layers_supported;
+  uint16_t release_supported;
+  uint8_t nmm_modes_supported;
+
+  uint8_t dl_ues_per_subframe;
+  uint8_t ul_ues_per_subframe;
+
+  uint8_t first_subframe_ind;
+
+  // timing information recevied from the vnf
+  uint8_t timing_window;
+  uint8_t timing_info_mode;
+  uint8_t timing_info_period;
+
+} phy_info;
+
+typedef struct {
+  uint16_t index;
+  uint16_t band;
+  int16_t max_transmit_power;
+  int16_t min_transmit_power;
+  uint8_t num_antennas_supported;
+  uint32_t min_downlink_frequency;
+  uint32_t max_downlink_frequency;
+  uint32_t max_uplink_frequency;
+  uint32_t min_uplink_frequency;
+} rf_info;
+
+typedef struct {
+
+  int release;
+  phy_info phys[2];
+  rf_info rfs[2];
+
+  uint8_t sync_mode;
+  uint8_t location_mode;
+  uint8_t location_coordinates[6];
+  uint32_t dl_config_timing;
+  uint32_t ul_config_timing;
+  uint32_t tx_timing;
+  uint32_t hi_dci0_timing;
+
+  uint16_t max_phys;
+  uint16_t max_total_bw;
+  uint16_t max_total_dl_layers;
+  uint16_t max_total_ul_layers;
+  uint8_t shared_bands;
+  uint8_t shared_pa;
+  int16_t max_total_power;
+  uint8_t oui;
+
+  uint8_t wireshark_test_mode;
+
+} pnf_info;
+
+typedef struct mac mac_t;
+
+typedef struct mac {
+
+	void* user_data;
+
+	void (*dl_config_req)(mac_t* mac, nfapi_dl_config_request_t* req);
+	void (*ul_config_req)(mac_t* mac, nfapi_ul_config_request_t* req);
+	void (*hi_dci0_req)(mac_t* mac, nfapi_hi_dci0_request_t* req);
+	void (*tx_req)(mac_t* mac, nfapi_tx_request_t* req);
+} mac_t;
+
+typedef struct {
+
+  int local_port;
+  char local_addr[80];
+
+  unsigned timing_window;
+  unsigned periodic_timing_enabled;
+  unsigned aperiodic_timing_enabled;
+  unsigned periodic_timing_period;
+
+  // This is not really the right place if we have multiple PHY, 
+  // should be part of the phy struct
+  udp_data udp;
+
+  uint8_t thread_started;
+
+  nfapi_vnf_p7_config_t* config;
+
+  mac_t* mac;
+
+} vnf_p7_info;
+
+typedef struct {
+
+  uint8_t wireshark_test_mode;
+  pnf_info pnfs[2];
+  vnf_p7_info p7_vnfs[2];
+
+} vnf_info;
+
+int vnf_pack_vendor_extension_tlv(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* codec) {
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "vnf_pack_vendor_extension_tlv\n");
+  nfapi_tl_t* tlv = (nfapi_tl_t*)ve;
+  switch(tlv->tag) {
+    case VENDOR_EXT_TLV_2_TAG:
+      {
+        //NFAPI_TRACE(NFAPI_TRACE_INFO, "Packing VENDOR_EXT_TLV_2\n");
+        vendor_ext_tlv_2* ve = (vendor_ext_tlv_2*)tlv;
+        if(!push32(ve->dummy, ppWritePackedMsg, end))
+          return 0;
+        return 1;
+      }
+      break;
+  }
+  return -1;
+}
+
+int vnf_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessage, uint8_t *end, void** ve, nfapi_p4_p5_codec_config_t* codec) {
+  return -1;
+}
+
+void install_schedule_handlers(IF_Module_t *if_inst);
+extern int single_thread_flag;
+extern void init_eNB_afterRU(void);
+extern uint16_t sf_ahead;
+
+void oai_create_enb(void) {
+
+  int bodge_counter=0;
+  PHY_VARS_eNB *eNB = RC.eNB[0][0];
+
+  printf("[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d nb_CC[0]:%d abstraction_flag:%d single_thread_flag:%d td:%p te:%p if_inst:%p\n", eNB->Mod_id, eNB->CC_id, RC.nb_CC[0], eNB->abstraction_flag, eNB->single_thread_flag, eNB->td, eNB->te, eNB->if_inst);
+
+  eNB->Mod_id  = bodge_counter;
+  eNB->CC_id   = bodge_counter;
+  eNB->abstraction_flag   = 0;
+  eNB->single_thread_flag = 0;//single_thread_flag;
+  eNB->td                   = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
+  eNB->te                   = dlsch_encoding;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
+
+  RC.nb_CC[bodge_counter] = 1;
+
+  if (eNB->if_inst==0) {
+    eNB->if_inst = IF_Module_init(bodge_counter);
+  }
+
+  // This will cause phy_config_request to be installed. That will result in RRC configuring the PHY
+  // that will result in eNB->configured being set to TRUE.
+  // See we need to wait for that to happen otherwise the NFAPI message exchanges won't contain the right parameter values
+  if (RC.eNB[0][0]->if_inst==0 || RC.eNB[0][0]->if_inst->PHY_config_req==0 || RC.eNB[0][0]->if_inst->schedule_response==0) {
+
+    printf("RC.eNB[0][0]->if_inst->PHY_config_req is not installed - install it\n");
+    install_schedule_handlers(RC.eNB[0][0]->if_inst);
+  }
+
+  do {
+    printf("%s() Waiting for eNB to become configured (by RRC/PHY) - need to wait otherwise NFAPI messages won't contain correct values\n", __FUNCTION__);
+    usleep(50000);
+  } while(eNB->configured != 1);
+
+  printf("%s() eNB is now configured\n", __FUNCTION__);
+}
+
+void oai_enb_init(void) {
+
+  printf("%s() About to call init_eNB_afterRU()\n", __FUNCTION__);
+  init_eNB_afterRU();
+}
+
+int pnf_connection_indication_cb(nfapi_vnf_config_t* config, int p5_idx) {
+
+  printf("[VNF] pnf connection indication idx:%d\n", p5_idx);
+
+  oai_create_enb();
+
+  nfapi_pnf_param_request_t req;
+  memset(&req, 0, sizeof(req));
+  req.header.message_id = NFAPI_PNF_PARAM_REQUEST;
+  nfapi_vnf_pnf_param_req(config, p5_idx, &req);
+  return 0;
+}
+
+int pnf_disconnection_indication_cb(nfapi_vnf_config_t* config, int p5_idx) {
+  printf("[VNF] pnf disconnection indication idx:%d\n", p5_idx);
+
+  vnf_info* vnf = (vnf_info*)(config->user_data);
+
+  pnf_info *pnf = vnf->pnfs;
+  phy_info *phy = pnf->phys;
+
+  vnf_p7_info* p7_vnf = vnf->p7_vnfs;
+  nfapi_vnf_p7_del_pnf((p7_vnf->config), phy->id);
+
+  return 0;
+}
+
+int pnf_param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_response_t* resp) {
+
+  printf("[VNF] pnf param response idx:%d error:%d\n", p5_idx, resp->error_code);
+
+  vnf_info* vnf = (vnf_info*)(config->user_data);
+
+  pnf_info *pnf = vnf->pnfs;
+
+  for(int i = 0; i < resp->pnf_phy.number_of_phys; ++i)
+  {
+    phy_info phy;
+    phy.index = resp->pnf_phy.phy[i].phy_config_index;
+
+    printf("[VNF] (PHY:%d) phy_config_idx:%d\n", i, resp->pnf_phy.phy[i].phy_config_index);
+
+    nfapi_vnf_allocate_phy(config, p5_idx, &(phy.id));
+
+    for(int j = 0; j < resp->pnf_phy.phy[i].number_of_rfs; ++j)
+    {
+      printf("[VNF] (PHY:%d) (RF%d) %d\n", i, j, resp->pnf_phy.phy[i].rf_config[j].rf_config_index);
+      phy.rfs[0] = resp->pnf_phy.phy[i].rf_config[j].rf_config_index;
+    }
+
+    pnf->phys[0] = phy;
+  }
+
+  for(int i = 0; i < resp->pnf_rf.number_of_rfs; ++i) {
+    rf_info rf;
+    rf.index = resp->pnf_rf.rf[i].rf_config_index;
+
+    printf("[VNF] (RF:%d) rf_config_idx:%d\n", i, resp->pnf_rf.rf[i].rf_config_index);
+
+    pnf->rfs[0] = rf;
+  }
+
+  nfapi_pnf_config_request_t req;
+  memset(&req, 0, sizeof(req));
+  req.header.message_id = NFAPI_PNF_CONFIG_REQUEST;
+
+  req.pnf_phy_rf_config.tl.tag = NFAPI_PNF_PHY_RF_TAG;
+  req.pnf_phy_rf_config.number_phy_rf_config_info = 2; // DJP pnf.phys.size();
+  printf("DJP:Hard coded num phy rf to 2\n");
+
+  for(unsigned i = 0; i < 2; ++i) {
+    req.pnf_phy_rf_config.phy_rf_config[i].phy_id = pnf->phys[i].id;
+    req.pnf_phy_rf_config.phy_rf_config[i].phy_config_index = pnf->phys[i].index;
+    req.pnf_phy_rf_config.phy_rf_config[i].rf_config_index = pnf->phys[i].rfs[0];
+  }
+
+  nfapi_vnf_pnf_config_req(config, p5_idx, &req);
+
+  return 0;
+}
+
+int pnf_config_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_config_response_t* resp) {
+
+  printf("[VNF] pnf config response idx:%d resp[header[phy_id:%u message_id:%02x message_length:%u]]\n", p5_idx, resp->header.phy_id, resp->header.message_id, resp->header.message_length);
+
+  if(1) {
+      nfapi_pnf_start_request_t req;
+      memset(&req, 0, sizeof(req));
+      req.header.phy_id = resp->header.phy_id;
+      req.header.message_id = NFAPI_PNF_START_REQUEST;
+      nfapi_vnf_pnf_start_req(config, p5_idx, &req);
+  } else {
+    // Rather than send the pnf_start_request we will demonstrate
+    // sending a vendor extention message. The start request will be
+    // send when the vendor extension response is received 
+
+    //vnf_info* vnf = (vnf_info*)(config->user_data);
+    vendor_ext_p5_req req;
+    memset(&req, 0, sizeof(req));
+    req.header.message_id = P5_VENDOR_EXT_REQ;
+    req.dummy1 = 45;
+    req.dummy2 = 1977;
+    nfapi_vnf_vendor_extension(config, p5_idx, &req.header);
+  }
+  return 0;
+}
+
+int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) {
+
+  eNB_proc_t *proc=&eNB->proc;
+
+  eNB_rxtx_proc_t *proc_rxtx=&proc->proc_rxtx[sf&1];
+
+  LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
+
+  //printf("%s(eNB:%p, sfn:%d, sf:%d)\n", __FUNCTION__, eNB, sfn, sf);
+
+  //int i;
+  struct timespec wait;
+
+  wait.tv_sec=0;
+  wait.tv_nsec=5000000L;
+
+#if 0
+  /* accept some delay in processing - up to 5ms */
+  for (i = 0; i < 10 && proc_rxtx->instance_cnt_rxtx == 0; i++) {
+    LOG_W( PHY,"[eNB] sfn/sf:%d:%d proc_rxtx[%d]:TXsfn:%d/%d eNB RXn-TXnp4 thread busy!! (cnt_rxtx %i)\n", sfn, sf, sf&1, proc_rxtx->frame_tx, proc_rxtx->subframe_tx, proc_rxtx->instance_cnt_rxtx);
+    usleep(500);
+  }
+  if (proc_rxtx->instance_cnt_rxtx == 0) {
+    exit_fun( "TX thread busy" );
+    return(-1);
+  }
+#endif
+
+  // wake up TX for subframe n+sf_ahead
+  // lock the TX mutex and make sure the thread is ready
+  if (pthread_mutex_timedlock(&proc_rxtx->mutex_rxtx,&wait) != 0) {
+    LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", proc_rxtx->subframe_rx&1,proc_rxtx->instance_cnt_rxtx );
+    exit_fun( "error locking mutex_rxtx" );
+    return(-1);
+  }
+
+  {
+    static uint16_t old_sf = 0;
+    static uint16_t old_sfn = 0;
+
+    proc->subframe_rx = old_sf;
+    proc->frame_rx = old_sfn;
+
+    // Try to be 1 frame back
+    old_sf = sf;
+    old_sfn = sfn;
+
+    if (old_sf == 0 && old_sfn % 100==0) LOG_W( PHY,"[eNB] sfn/sf:%d%d old_sfn/sf:%d%d proc[rx:%d%d]\n", sfn, sf, old_sfn, old_sf, proc->frame_rx, proc->subframe_rx);
+  }
+
+  ++proc_rxtx->instance_cnt_rxtx;
+
+  //LOG_D( PHY,"[VNF-subframe_ind] sfn/sf:%d:%d proc[frame_rx:%d subframe_rx:%d] proc_rxtx->instance_cnt_rxtx:%d \n", sfn, sf, proc->frame_rx, proc->subframe_rx, proc_rxtx->instance_cnt_rxtx);
+
+  // We have just received and processed the common part of a subframe, say n.
+  // TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
+  // transmitted timestamp of the next TX slot (first).
+  // The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
+  // we want to generate subframe (n+N), so TS_tx = TX_rx+N*samples_per_tti,
+  // and proc->subframe_tx = proc->subframe_rx+sf_ahead
+  proc_rxtx->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
+  proc_rxtx->frame_rx     = proc->frame_rx;
+  proc_rxtx->subframe_rx  = proc->subframe_rx;
+  proc_rxtx->frame_tx     = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx;
+  proc_rxtx->subframe_tx  = (proc_rxtx->subframe_rx + sf_ahead)%10;
+
+  //LOG_D(PHY, "sfn/sf:%d%d proc[rx:%d%d] proc_rxtx[instance_cnt_rxtx:%d rx:%d%d] About to wake rxtx thread\n\n", sfn, sf, proc->frame_rx, proc->subframe_rx, proc_rxtx->instance_cnt_rxtx, proc_rxtx->frame_rx, proc_rxtx->subframe_rx);
+
+  // the thread can now be woken up
+  if (pthread_cond_signal(&proc_rxtx->cond_rxtx) != 0) {
+    LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RXn-TXnp4 thread\n");
+    exit_fun( "ERROR pthread_cond_signal" );
+    return(-1);
+  }
+
+  //LOG_D(PHY,"%s() About to attempt pthread_mutex_unlock\n", __FUNCTION__);
+  pthread_mutex_unlock( &proc_rxtx->mutex_rxtx );
+  //LOG_D(PHY,"%s() UNLOCKED pthread_mutex_unlock\n", __FUNCTION__);
+
+  return(0);
+}
+
+extern pthread_cond_t nfapi_sync_cond;
+extern pthread_mutex_t nfapi_sync_mutex;
+extern int nfapi_sync_var;
+
+int phy_sync_indication(struct nfapi_vnf_p7_config* config, uint8_t sync) {
+
+  printf("[VNF] SYNC %s\n", sync==1 ? "ACHIEVED" : "LOST");
+  
+  if (sync==1 && nfapi_sync_var!=0) {
+
+    printf("[VNF] Signal to OAI main code that it can go\n");
+    pthread_mutex_lock(&nfapi_sync_mutex);
+    nfapi_sync_var=0;
+    pthread_cond_broadcast(&nfapi_sync_cond);
+    pthread_mutex_unlock(&nfapi_sync_mutex);
+  }
+
+  return(0);
+}
+
+int phy_subframe_indication(struct nfapi_vnf_p7_config* config, uint16_t phy_id, uint16_t sfn_sf) {
+
+  static uint8_t first_time = 1;
+  if (first_time) {
+    printf("[VNF] subframe indication %d\n", NFAPI_SFNSF2DEC(sfn_sf));
+    first_time = 0;
+  }
+
+  if (RC.eNB && RC.eNB[0][0]->configured) {
+    uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf);
+    uint16_t sf = NFAPI_SFNSF2SF(sfn_sf);
+
+    //LOG_D(PHY,"[VNF] subframe indication sfn_sf:%d sfn:%d sf:%d\n", sfn_sf, sfn, sf);
+
+    wake_eNB_rxtx(RC.eNB[0][0], sfn, sf);
+  } else {
+    printf("[VNF] %s() RC.eNB:%p\n", __FUNCTION__, RC.eNB);
+    if (RC.eNB) printf("RC.eNB[0][0]->configured:%d\n", RC.eNB[0][0]->configured);
+  }
+
+  return 0;
+}
+
+int phy_rach_indication(struct nfapi_vnf_p7_config* config, nfapi_rach_indication_t* ind) {
+
+  LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_preambles:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
+
+  struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
+
+  printf("[VNF] RACH_IND eNB:%p sfn_sf:%d number_of_preambles:%d\n", eNB, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
+
+  pthread_mutex_lock(&eNB->UL_INFO_mutex);
+
+  eNB->UL_INFO.rach_ind = *ind;
+  eNB->UL_INFO.rach_ind.rach_indication_body.preamble_list = eNB->preamble_list;
+
+  for (int i=0;i<ind->rach_indication_body.number_of_preambles;i++) {
+    if (ind->rach_indication_body.preamble_list[i].preamble_rel8.tl.tag == NFAPI_PREAMBLE_REL8_TAG) {
+
+      printf("preamble[%d]: rnti:%02x preamble:%d timing_advance:%d\n", 
+          i,
+          ind->rach_indication_body.preamble_list[i].preamble_rel8.rnti,
+          ind->rach_indication_body.preamble_list[i].preamble_rel8.preamble,
+          ind->rach_indication_body.preamble_list[i].preamble_rel8.timing_advance
+          );
+    }
+
+    if(ind->rach_indication_body.preamble_list[i].preamble_rel13.tl.tag == NFAPI_PREAMBLE_REL13_TAG) {
+      printf("RACH PREAMBLE REL13 present\n");
+    }
+
+    eNB->preamble_list[i] = ind->rach_indication_body.preamble_list[i];
+  }
+  pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+
+  // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+  //mac_rach_ind(p7_vnf->mac, ind);
+  return 1;
+}
+
+int phy_harq_indication(struct nfapi_vnf_p7_config* config, nfapi_harq_indication_t* ind) {
+
+  struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
+
+  LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_harqs:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->harq_indication_body.number_of_harqs);
+
+  pthread_mutex_lock(&eNB->UL_INFO_mutex);
+
+  eNB->UL_INFO.harq_ind = *ind;
+  eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = eNB->harq_pdu_list;
+
+  for (int i=0; i<ind->harq_indication_body.number_of_harqs; i++) {
+    memcpy(&eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[i], &ind->harq_indication_body.harq_pdu_list[i], sizeof(eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[i]));
+  }
+
+  pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+
+  // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+  //mac_harq_ind(p7_vnf->mac, ind);
+
+  return 1;
+}
+
+int phy_crc_indication(struct nfapi_vnf_p7_config* config, nfapi_crc_indication_t* ind) {
+
+  struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
+
+  pthread_mutex_lock(&eNB->UL_INFO_mutex);
+
+  eNB->UL_INFO.crc_ind = *ind;
+
+  nfapi_crc_indication_t *dest_ind = &eNB->UL_INFO.crc_ind;
+  nfapi_crc_indication_pdu_t *dest_pdu_list = eNB->crc_pdu_list;
+
+  *dest_ind = *ind;
+  dest_ind->crc_indication_body.crc_pdu_list = dest_pdu_list;
+
+  if (ind->crc_indication_body.number_of_crcs==0)
+    LOG_D(MAC, "%s() NFAPI SFN/SF:%d IND:number_of_crcs:%u UL_INFO:crcs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->crc_indication_body.number_of_crcs, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs);
+
+  for (int i=0; i<ind->crc_indication_body.number_of_crcs; i++) {
+    memcpy(&dest_ind->crc_indication_body.crc_pdu_list[i], &ind->crc_indication_body.crc_pdu_list[i], sizeof(ind->crc_indication_body.crc_pdu_list[0]));
+
+    LOG_D(MAC, "%s() NFAPI SFN/SF:%d CRC_IND:number_of_crcs:%u UL_INFO:crcs:%d PDU[%d] rnti:%04x UL_INFO:rnti:%04x\n", 
+        __FUNCTION__,
+        NFAPI_SFNSF2DEC(ind->sfn_sf), ind->crc_indication_body.number_of_crcs, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs,
+        i, 
+        ind->crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti, 
+        eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti);
+  }
+
+  pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+
+  // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+  //mac_crc_ind(p7_vnf->mac, ind);
+
+  return 1;
+}
+
+int phy_rx_indication(struct nfapi_vnf_p7_config* config, nfapi_rx_indication_t* ind) {
+
+  struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
+
+  if (ind->rx_indication_body.number_of_pdus==0) {
+    LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_pdus:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rx_indication_body.number_of_pdus);
+  }
+
+  pthread_mutex_lock(&eNB->UL_INFO_mutex);
+
+  nfapi_rx_indication_t *dest_ind = &eNB->UL_INFO.rx_ind;
+  nfapi_rx_indication_pdu_t *dest_pdu_list = eNB->rx_pdu_list;
+
+  *dest_ind = *ind;
+  dest_ind->rx_indication_body.rx_pdu_list = dest_pdu_list;
+
+  for(int i=0; i<ind->rx_indication_body.number_of_pdus; i++) {
+    nfapi_rx_indication_pdu_t *dest_pdu = &dest_ind->rx_indication_body.rx_pdu_list[i];
+    nfapi_rx_indication_pdu_t *src_pdu = &ind->rx_indication_body.rx_pdu_list[i];
+
+    memcpy(dest_pdu, src_pdu, sizeof(*src_pdu));
+
+    // DJP - TODO FIXME - intentional memory leak
+    dest_pdu->data = malloc(dest_pdu->rx_indication_rel8.length);
+
+    memcpy(dest_pdu->data, src_pdu->data, dest_pdu->rx_indication_rel8.length);
+
+    LOG_D(PHY, "%s() NFAPI SFN/SF:%d PDUs:%d [PDU:%d] handle:%d rnti:%04x length:%d offset:%d ul_cqi:%d ta:%d data:%p\n",
+        __FUNCTION__,
+        NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rx_indication_body.number_of_pdus, i,
+        dest_pdu->rx_ue_information.handle,
+        dest_pdu->rx_ue_information.rnti,
+        dest_pdu->rx_indication_rel8.length,
+        dest_pdu->rx_indication_rel8.offset,
+        dest_pdu->rx_indication_rel8.ul_cqi,
+        dest_pdu->rx_indication_rel8.timing_advance,
+        dest_pdu->data
+        );
+  }
+
+  pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+
+  // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+  //mac_rx_ind(p7_vnf->mac, ind);
+  return 1;
+}
+int phy_srs_indication(struct nfapi_vnf_p7_config* config, nfapi_srs_indication_t* ind) {
+  // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+  //mac_srs_ind(p7_vnf->mac, ind);
+  return 1;
+}
+
+int phy_sr_indication(struct nfapi_vnf_p7_config* config, nfapi_sr_indication_t* ind) {
+
+  struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
+
+  LOG_D(MAC, "%s() NFAPI SFN/SF:%d srs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->sr_indication_body.number_of_srs);
+
+  pthread_mutex_lock(&eNB->UL_INFO_mutex);
+
+  nfapi_sr_indication_t *dest_ind = &eNB->UL_INFO.sr_ind;
+  nfapi_sr_indication_pdu_t *dest_pdu_list = eNB->sr_pdu_list;
+
+  *dest_ind = *ind;
+  dest_ind->sr_indication_body.sr_pdu_list = dest_pdu_list;
+
+  LOG_D(MAC,"%s() eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs:%d\n", __FUNCTION__, eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs);
+
+  for (int i=0;i<eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs;i++) {
+    nfapi_sr_indication_pdu_t *dest_pdu = &dest_ind->sr_indication_body.sr_pdu_list[i];
+    nfapi_sr_indication_pdu_t *src_pdu = &ind->sr_indication_body.sr_pdu_list[i];
+
+    LOG_D(MAC, "SR_IND[PDU:%d][rnti:%x cqi:%d channel:%d]\n", i, src_pdu->rx_ue_information.rnti, src_pdu->ul_cqi_information.ul_cqi, src_pdu->ul_cqi_information.channel);
+
+    memcpy(dest_pdu, src_pdu, sizeof(*src_pdu));
+  }
+
+  pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+
+  // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+  //mac_sr_ind(p7_vnf->mac, ind);
+
+  return 1;
+}
+
+int phy_cqi_indication(struct nfapi_vnf_p7_config* config, nfapi_cqi_indication_t* ind) {
+
+  // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+  //mac_cqi_ind(p7_vnf->mac, ind);
+  struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
+
+  LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_cqis:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->cqi_indication_body.number_of_cqis);
+
+  pthread_mutex_lock(&eNB->UL_INFO_mutex);
+
+  eNB->UL_INFO.cqi_ind = ind->cqi_indication_body;
+
+  pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+
+  return 1;
+}
+
+int phy_lbt_dl_indication(struct nfapi_vnf_p7_config* config, nfapi_lbt_dl_indication_t* ind) {
+  // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+  //mac_lbt_dl_ind(p7_vnf->mac, ind);
+  return 1;
+}
+
+int phy_nb_harq_indication(struct nfapi_vnf_p7_config* config, nfapi_nb_harq_indication_t* ind) {
+  // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+  //mac_nb_harq_ind(p7_vnf->mac, ind);
+  return 1;
+}
+
+int phy_nrach_indication(struct nfapi_vnf_p7_config* config, nfapi_nrach_indication_t* ind) {
+  // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+  //mac_nrach_ind(p7_vnf->mac, ind);
+  return 1;
+}
+
+void* vnf_allocate(size_t size) {
+  //return (void*)memory_pool::allocate(size);
+  return (void*)malloc(size);
+}
+
+void vnf_deallocate(void* ptr) {
+  //memory_pool::deallocate((uint8_t*)ptr);
+  free(ptr);
+}
+
+extern void nfapi_log(char *file, char *func, int line, int comp, int level, const char* format, va_list args);
+
+void vnf_trace(nfapi_trace_level_t nfapi_level, const char* message, ...) {
+
+  va_list args;
+  int oai_level;
+
+  if (nfapi_level==NFAPI_TRACE_ERROR)
+  {
+    oai_level = LOG_ERR;
+  }
+  else if (nfapi_level==NFAPI_TRACE_WARN)
+  {
+    oai_level = LOG_WARNING;
+  }
+  else if (nfapi_level==NFAPI_TRACE_NOTE)
+  {
+    oai_level = LOG_INFO;
+  }
+  else if (nfapi_level==NFAPI_TRACE_INFO)
+  {
+    oai_level = LOG_INFO;
+  }
+  else
+  {
+    oai_level = LOG_INFO;
+  }
+
+  va_start(args, message);
+  nfapi_log("FILE>", "FUNC", 999, PHY, oai_level, message, args);
+  va_end(args);
+}
+
+int phy_vendor_ext(struct nfapi_vnf_p7_config* config, nfapi_p7_message_header_t* msg) {
+
+  if(msg->message_id == P7_VENDOR_EXT_IND)
+  {
+    //vendor_ext_p7_ind* ind = (vendor_ext_p7_ind*)msg;
+    //printf("[VNF] vendor_ext (error_code:%d)\n", ind->error_code);
+  }
+  else
+  {
+    printf("[VNF] unknown %02x\n", msg->message_id);
+  }
+  return 0;
+}
+
+nfapi_p7_message_header_t* phy_allocate_p7_vendor_ext(uint16_t message_id, uint16_t* msg_size) {
+  if(message_id == P7_VENDOR_EXT_IND)
+  {
+    *msg_size = sizeof(vendor_ext_p7_ind);
+    return (nfapi_p7_message_header_t*)malloc(sizeof(vendor_ext_p7_ind));
+  }
+  return 0;
+}
+
+void phy_deallocate_p7_vendor_ext(nfapi_p7_message_header_t* header) {
+  free(header);
+}
+
+int phy_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessage, uint8_t *end, void** ve, nfapi_p7_codec_config_t* codec) {
+
+  (void)tl;
+  (void)ppReadPackedMessage;
+  (void)ve;
+  return -1;
+}
+
+int phy_pack_vendor_extension_tlv(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* codec) {
+
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "phy_pack_vendor_extension_tlv\n");
+
+  nfapi_tl_t* tlv = (nfapi_tl_t*)ve;
+  switch(tlv->tag) {
+    case VENDOR_EXT_TLV_1_TAG:
+      {
+        //NFAPI_TRACE(NFAPI_TRACE_INFO, "Packing VENDOR_EXT_TLV_1\n");
+        vendor_ext_tlv_1* ve = (vendor_ext_tlv_1*)tlv;
+        if(!push32(ve->dummy, ppWritePackedMsg, end))
+          return 0;
+        return 1;
+      }
+      break;
+    default:
+      return -1;
+      break;
+  }
+}
+
+int phy_unpack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t** ppReadPackedMessage, uint8_t *end, nfapi_p7_codec_config_t* config) {
+
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+  if(header->message_id == P7_VENDOR_EXT_IND) {
+    vendor_ext_p7_ind* req = (vendor_ext_p7_ind*)(header);
+    if(!pull16(ppReadPackedMessage, &req->error_code, end))
+      return 0;
+  }
+
+  return 1;
+}
+
+int phy_pack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t** ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) {
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+  if(header->message_id == P7_VENDOR_EXT_REQ) {
+    //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+    vendor_ext_p7_req* req = (vendor_ext_p7_req*)(header);
+    if(!(push16(req->dummy1, ppWritePackedMsg, end) &&
+          push16(req->dummy2, ppWritePackedMsg, end)))
+      return 0;
+  }
+  return 1;
+}
+
+int vnf_pack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t* header, uint8_t** ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* codec) {
+
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+  if(header->message_id == P5_VENDOR_EXT_REQ) {
+    vendor_ext_p5_req* req = (vendor_ext_p5_req*)(header);
+    //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s %d %d\n", __FUNCTION__, req->dummy1, req->dummy2);
+    return (!(push16(req->dummy1, ppWritePackedMsg, end) &&
+          push16(req->dummy2, ppWritePackedMsg, end)));
+  }
+  return 0;
+}
+
+static pthread_t vnf_start_pthread;
+static pthread_t vnf_p7_start_pthread;
+
+void* vnf_p7_start_thread(void *ptr) {
+
+  printf("%s()\n", __FUNCTION__);
+
+  pthread_setname_np(pthread_self(), "VNF_P7");
+
+  nfapi_vnf_p7_config_t* config = (nfapi_vnf_p7_config_t*)ptr;
+
+  nfapi_vnf_p7_start(config);
+
+  return config;
+}
+
+void set_thread_priority(int priority);
+
+void* vnf_p7_thread_start(void* ptr) {
+
+  set_thread_priority(79);
+
+  vnf_p7_info* p7_vnf = (vnf_p7_info*)ptr;
+
+  p7_vnf->config->port = p7_vnf->local_port;
+  p7_vnf->config->sync_indication = &phy_sync_indication;
+  p7_vnf->config->subframe_indication = &phy_subframe_indication;
+  p7_vnf->config->harq_indication = &phy_harq_indication;
+  p7_vnf->config->crc_indication = &phy_crc_indication;
+  p7_vnf->config->rx_indication = &phy_rx_indication;
+  p7_vnf->config->rach_indication = &phy_rach_indication;
+  p7_vnf->config->srs_indication = &phy_srs_indication;
+  p7_vnf->config->sr_indication = &phy_sr_indication;
+  p7_vnf->config->cqi_indication = &phy_cqi_indication;
+  p7_vnf->config->lbt_dl_indication = &phy_lbt_dl_indication;
+  p7_vnf->config->nb_harq_indication = &phy_nb_harq_indication;
+  p7_vnf->config->nrach_indication = &phy_nrach_indication;
+  p7_vnf->config->malloc = &vnf_allocate;
+  p7_vnf->config->free = &vnf_deallocate;
+
+  p7_vnf->config->trace = &vnf_trace;
+
+  p7_vnf->config->vendor_ext = &phy_vendor_ext;
+  p7_vnf->config->user_data = p7_vnf;
+
+  p7_vnf->mac->user_data = p7_vnf;
+
+  p7_vnf->config->codec_config.unpack_p7_vendor_extension = &phy_unpack_p7_vendor_extension;
+  p7_vnf->config->codec_config.pack_p7_vendor_extension = &phy_pack_p7_vendor_extension;
+  p7_vnf->config->codec_config.unpack_vendor_extension_tlv = &phy_unpack_vendor_extension_tlv;
+  p7_vnf->config->codec_config.pack_vendor_extension_tlv = &phy_pack_vendor_extension_tlv;
+  p7_vnf->config->codec_config.allocate = &vnf_allocate;
+  p7_vnf->config->codec_config.deallocate = &vnf_deallocate;
+
+  p7_vnf->config->allocate_p7_vendor_ext = &phy_allocate_p7_vendor_ext;
+  p7_vnf->config->deallocate_p7_vendor_ext = &phy_deallocate_p7_vendor_ext;
+
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI start thread %s\n", __FUNCTION__);
+  pthread_create(&vnf_p7_start_pthread, NULL, &vnf_p7_start_thread, p7_vnf->config);
+
+  return 0;
+}
+
+int pnf_start_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_start_response_t* resp) {
+
+  vnf_info* vnf = (vnf_info*)(config->user_data);
+  vnf_p7_info *p7_vnf = vnf->p7_vnfs;
+  pnf_info *pnf = vnf->pnfs;
+  nfapi_param_request_t req;
+
+  printf("[VNF] pnf start response idx:%d config:%p user_data:%p p7_vnf[config:%p thread_started:%d]\n", p5_idx, config, config->user_data, vnf->p7_vnfs[0].config, vnf->p7_vnfs[0].thread_started);
+
+  if(p7_vnf->thread_started == 0) {
+
+    pthread_t vnf_p7_thread;
+    pthread_create(&vnf_p7_thread, NULL, &vnf_p7_thread_start, p7_vnf);
+    p7_vnf->thread_started = 1;
+  }
+  else
+  {
+    // P7 thread already running. 
+  }
+
+  // start all the phys in the pnf.
+  printf("[VNF] Sending NFAPI_PARAM_REQUEST phy_id:%d\n", pnf->phys[0].id);
+
+  memset(&req, 0, sizeof(req));
+  req.header.message_id = NFAPI_PARAM_REQUEST;
+  req.header.phy_id = pnf->phys[0].id;
+
+  nfapi_vnf_param_req(config, p5_idx, &req);
+
+  return 0;
+}
+
+extern uint32_t to_earfcn(int eutra_bandP,uint32_t dl_CarrierFreq,uint32_t bw);
+
+int param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_response_t* resp) {
+
+  printf("[VNF] Received NFAPI_PARAM_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+
+  vnf_info* vnf = (vnf_info*)(config->user_data);
+  vnf_p7_info *p7_vnf = vnf->p7_vnfs;
+
+  pnf_info *pnf = vnf->pnfs;
+  phy_info *phy = pnf->phys;
+  struct sockaddr_in pnf_p7_sockaddr;
+  nfapi_config_request_t *req = &RC.mac[0]->config[0];
+
+  phy->remote_port = resp->nfapi_config.p7_pnf_port.value;
+
+  memcpy(&pnf_p7_sockaddr.sin_addr.s_addr, &(resp->nfapi_config.p7_pnf_address_ipv4.address[0]), 4);
+
+  phy->remote_addr = inet_ntoa(pnf_p7_sockaddr.sin_addr);
+
+  // for now just 1
+
+  printf("[VNF] %d.%d pnf p7 %s:%d timing %d %d %d %d\n", p5_idx, phy->id, phy->remote_addr, phy->remote_port, p7_vnf->timing_window, p7_vnf->periodic_timing_period, p7_vnf->aperiodic_timing_enabled, p7_vnf->periodic_timing_period);
+
+  req->header.message_id = NFAPI_CONFIG_REQUEST;
+  req->header.phy_id = phy->id;
+
+  printf("[VNF] Send NFAPI_CONFIG_REQUEST\n");
+
+  req->nfapi_config.p7_vnf_port.tl.tag = NFAPI_NFAPI_P7_VNF_PORT_TAG;
+  req->nfapi_config.p7_vnf_port.value = p7_vnf->local_port;
+  req->num_tlv++;
+
+  printf("[VNF] DJP local_port:%d\n", p7_vnf->local_port);
+
+  req->nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
+  struct sockaddr_in vnf_p7_sockaddr;
+  vnf_p7_sockaddr.sin_addr.s_addr = inet_addr(p7_vnf->local_addr);
+  memcpy(&(req->nfapi_config.p7_vnf_address_ipv4.address[0]), &vnf_p7_sockaddr.sin_addr.s_addr, 4);
+  req->num_tlv++;
+  printf("[VNF] DJP local_addr:%s\n", p7_vnf->local_addr);
+
+  req->nfapi_config.timing_window.tl.tag = NFAPI_NFAPI_TIMING_WINDOW_TAG;
+  req->nfapi_config.timing_window.value = p7_vnf->timing_window;
+  printf("[VNF] Timing window:%d\n", p7_vnf->timing_window);
+  req->num_tlv++;
+
+  if(p7_vnf->periodic_timing_enabled || p7_vnf->aperiodic_timing_enabled) {
+
+    req->nfapi_config.timing_info_mode.tl.tag = NFAPI_NFAPI_TIMING_INFO_MODE_TAG;
+    req->nfapi_config.timing_info_mode.value = (p7_vnf->aperiodic_timing_enabled << 1) | (p7_vnf->periodic_timing_enabled);
+    req->num_tlv++;
+
+    if(p7_vnf->periodic_timing_enabled) {
+
+      req->nfapi_config.timing_info_period.tl.tag = NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG;
+      req->nfapi_config.timing_info_period.value = p7_vnf->periodic_timing_period;
+      req->num_tlv++;
+    }
+  }
+
+  vendor_ext_tlv_2 ve2;
+  memset(&ve2, 0, sizeof(ve2));
+  ve2.tl.tag = VENDOR_EXT_TLV_2_TAG;
+  ve2.dummy = 2016;
+  req->vendor_extension = &ve2.tl;
+
+  nfapi_vnf_config_req(config, p5_idx, req);
+  printf("[VNF] Sent NFAPI_CONFIG_REQ num_tlv:%u\n",req->num_tlv);
+
+  return 0;
+}
+
+int config_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_config_response_t* resp) {
+
+  nfapi_start_request_t req;
+
+  printf("[VNF] Received NFAPI_CONFIG_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+
+  printf("[VNF] Calling oai_enb_init()\n");
+  oai_enb_init();
+
+  memset(&req, 0, sizeof(req));
+  req.header.message_id = NFAPI_START_REQUEST;
+  req.header.phy_id = resp->header.phy_id;
+  nfapi_vnf_start_req(config, p5_idx, &req);
+
+  printf("[VNF] Send NFAPI_START_REQUEST idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+
+  return 0;
+}
+
+int start_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_start_response_t* resp) {
+
+  printf("[VNF] Received NFAPI_START_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+
+  vnf_info* vnf = (vnf_info*)(config->user_data);
+
+  pnf_info *pnf = vnf->pnfs;
+  phy_info *phy = pnf->phys;
+  vnf_p7_info *p7_vnf = vnf->p7_vnfs;
+  nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, phy->remote_port, phy->id);
+
+  return 0;
+}
+
+int vendor_ext_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_p4_p5_message_header_t* msg) {
+
+  printf("[VNF] %s\n", __FUNCTION__);
+
+  switch(msg->message_id) {
+    case P5_VENDOR_EXT_RSP:
+      {
+        vendor_ext_p5_rsp* rsp = (vendor_ext_p5_rsp*)msg;
+        printf("[VNF] P5_VENDOR_EXT_RSP error_code:%d\n", rsp->error_code);
+
+        // send the start request
+
+        nfapi_pnf_start_request_t req;
+        memset(&req, 0, sizeof(req));
+        req.header.message_id = NFAPI_PNF_START_REQUEST;
+        nfapi_vnf_pnf_start_req(config, p5_idx, &req);
+      }
+      break;
+  }
+
+  return 0;
+}
+
+int vnf_unpack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t* header, uint8_t** ppReadPackedMessage, uint8_t *end, nfapi_p4_p5_codec_config_t* codec) {
+
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+  if(header->message_id == P5_VENDOR_EXT_RSP)
+  {
+    vendor_ext_p5_rsp* req = (vendor_ext_p5_rsp*)(header);
+    return(!pull16(ppReadPackedMessage, &req->error_code, end));
+  }
+  return 0;
+}
+
+nfapi_p4_p5_message_header_t* vnf_allocate_p4_p5_vendor_ext(uint16_t message_id, uint16_t* msg_size) {
+
+  if(message_id == P5_VENDOR_EXT_RSP) {
+    *msg_size = sizeof(vendor_ext_p5_rsp);
+    return (nfapi_p4_p5_message_header_t*)malloc(sizeof(vendor_ext_p5_rsp));
+  }
+  return 0;
+}
+
+void vnf_deallocate_p4_p5_vendor_ext(nfapi_p4_p5_message_header_t* header) {
+  free(header);
+}
+
+nfapi_vnf_config_t *config = 0;
+
+void vnf_start_thread(void* ptr) {
+
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] VNF NFAPI thread - nfapi_vnf_start()%s\n", __FUNCTION__);
+
+  pthread_setname_np(pthread_self(), "VNF");
+
+  config = (nfapi_vnf_config_t*)ptr;
+
+  nfapi_vnf_start(config);
+}
+
+static vnf_info vnf;
+extern uint8_t nfapi_mode;
+/*------------------------------------------------------------------------------*/
+void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port)
+{
+  nfapi_mode = 2;
+
+  memset(&vnf, 0, sizeof(vnf));
+
+  memset(vnf.p7_vnfs, 0, sizeof(vnf.p7_vnfs));
+
+  vnf.p7_vnfs[0].timing_window = 32;
+  vnf.p7_vnfs[0].periodic_timing_enabled = 1;
+  vnf.p7_vnfs[0].aperiodic_timing_enabled = 0;
+  vnf.p7_vnfs[0].periodic_timing_period = 10;
+
+  vnf.p7_vnfs[0].config = nfapi_vnf_p7_config_create();
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() vnf.p7_vnfs[0].config:%p VNF ADDRESS:%s:%d\n", __FUNCTION__, vnf.p7_vnfs[0].config, vnf_addr, vnf_p5_port);
+
+  strcpy(vnf.p7_vnfs[0].local_addr, vnf_addr);
+  vnf.p7_vnfs[0].local_port = 50001;
+  vnf.p7_vnfs[0].mac = (mac_t*)malloc(sizeof(mac_t));
+
+  nfapi_vnf_config_t* config = nfapi_vnf_config_create();
+
+  config->malloc = malloc;
+  config->free = free;
+  config->trace = &vnf_trace;
+
+  config->vnf_p5_port = vnf_p5_port;
+  config->vnf_ipv4 = 1;
+  config->vnf_ipv6 = 0;
+
+  config->pnf_list = 0;
+  config->phy_list = 0;
+
+  config->pnf_connection_indication = &pnf_connection_indication_cb;
+  config->pnf_disconnect_indication = &pnf_disconnection_indication_cb;
+  config->pnf_param_resp = &pnf_param_resp_cb;
+  config->pnf_config_resp = &pnf_config_resp_cb;
+  config->pnf_start_resp = &pnf_start_resp_cb;
+  config->param_resp = &param_resp_cb;
+  config->config_resp = &config_resp_cb;
+  config->start_resp = &start_resp_cb;
+  config->vendor_ext = &vendor_ext_cb;
+
+  config->user_data = &vnf;
+
+  // To allow custom vendor extentions to be added to nfapi
+  config->codec_config.unpack_vendor_extension_tlv = &vnf_unpack_vendor_extension_tlv;
+  config->codec_config.pack_vendor_extension_tlv = &vnf_pack_vendor_extension_tlv;
+
+  config->codec_config.unpack_p4_p5_vendor_extension = &vnf_unpack_p4_p5_vendor_extension;
+  config->codec_config.pack_p4_p5_vendor_extension = &vnf_pack_p4_p5_vendor_extension;
+  config->allocate_p4_p5_vendor_ext = &vnf_allocate_p4_p5_vendor_ext;
+  config->deallocate_p4_p5_vendor_ext = &vnf_deallocate_p4_p5_vendor_ext;
+  config->codec_config.allocate = &vnf_allocate;
+  config->codec_config.deallocate = &vnf_deallocate;
+
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI start thread %s\n", __FUNCTION__);
+  pthread_create(&vnf_start_pthread, NULL, (void*)&vnf_start_thread, config);
+  NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Created VNF NFAPI start thread %s\n", __FUNCTION__);
+}
+
+int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req)
+{
+  nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
+
+  dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
+
+  int retval = nfapi_vnf_p7_dl_config_req(p7_config, dl_config_req);
+
+  dl_config_req->dl_config_request_body.number_pdcch_ofdm_symbols           = 1;
+  dl_config_req->dl_config_request_body.number_dci                          = 0;
+  dl_config_req->dl_config_request_body.number_pdu                          = 0;
+  dl_config_req->dl_config_request_body.number_pdsch_rnti                   = 0;
+
+  if (retval!=0) {
+    LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
+  }
+  return retval;
+}
+
+int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req)
+{
+  nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
+
+  tx_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
+
+  //LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
+
+  int retval = nfapi_vnf_p7_tx_req(p7_config, tx_req);
+
+
+  if (retval!=0) {
+    LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
+  } else {
+    tx_req->tx_request_body.number_of_pdus = 0;
+  }
+  return retval;
+}
+
+int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) {
+  nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
+
+  hi_dci0_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
+
+  //LOG_D(PHY, "[VNF] %s() HI_DCI0_REQ sfn_sf:%d dci:%d hi:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(hi_dci0_req->sfn_sf), hi_dci0_req->hi_dci0_request_body.number_of_dci, hi_dci0_req->hi_dci0_request_body.number_of_hi);
+
+  int retval = nfapi_vnf_p7_hi_dci0_req(p7_config, hi_dci0_req);
+
+  if (retval!=0) {
+    LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
+  } else {
+    hi_dci0_req->hi_dci0_request_body.number_of_hi = 0;
+    hi_dci0_req->hi_dci0_request_body.number_of_dci = 0;
+  }
+  return retval;
+}
+
+int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) {
+
+  nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
+
+  ul_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
+
+  //LOG_D(PHY, "[VNF] %s() header message_id:%02x\n", __FUNCTION__, ul_config_req->header.message_id);
+
+  //LOG_D(PHY, "[VNF] %s() UL_CONFIG sfn_sf:%d PDUs:%d rach_prach_frequency_resources:%d srs_present:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ul_config_req->sfn_sf), ul_config_req->ul_config_request_body.number_of_pdus, ul_config_req->ul_config_request_body.rach_prach_frequency_resources, ul_config_req->ul_config_request_body.srs_present);
+
+  int retval = nfapi_vnf_p7_ul_config_req(p7_config, ul_config_req);
+
+  if (retval!=0) {
+    LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
+  } else {
+    // Reset number of PDUs so that it is not resent
+    ul_config_req->ul_config_request_body.number_of_pdus = 0;
+    ul_config_req->ul_config_request_body.rach_prach_frequency_resources = 0;
+    ul_config_req->ul_config_request_body.srs_present = 0;
+  }
+  return retval;
+}
diff --git a/nfapi/oai_integration/nfapi_vnf.h b/nfapi/oai_integration/nfapi_vnf.h
new file mode 100644
index 0000000000000000000000000000000000000000..4ea26eda12d1a8d3feb1d9013830eff9c72b7b44
--- /dev/null
+++ b/nfapi/oai_integration/nfapi_vnf.h
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1  (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ *      contact@openairinterface.org
+ */
+
+#if !defined(NFAPI_VNF_H__)
+#define NFAPI_VNF_H__
+
+void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port);
+
+#endif
diff --git a/nfapi/oai_integration/vendor_ext.h b/nfapi/oai_integration/vendor_ext.h
new file mode 100644
index 0000000000000000000000000000000000000000..0622432260060dc7ef3f4fc4d76f889a7e3860d8
--- /dev/null
+++ b/nfapi/oai_integration/vendor_ext.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _VENDOR_EXT_H_
+#define _VENDOR_EXT_H_
+
+#include "nfapi_interface.h"
+
+typedef enum {
+	P5_VENDOR_EXT_REQ = NFAPI_VENDOR_EXT_MSG_MIN,
+	P5_VENDOR_EXT_RSP,
+
+	P7_VENDOR_EXT_REQ,
+	P7_VENDOR_EXT_IND
+
+} vendor_ext_message_id_e;
+
+typedef struct {
+	nfapi_p4_p5_message_header_t header;
+	uint16_t dummy1;
+	uint16_t dummy2;
+} vendor_ext_p5_req;
+
+typedef struct {
+	nfapi_p4_p5_message_header_t header;
+	uint16_t error_code;
+} vendor_ext_p5_rsp;
+
+typedef struct {
+	nfapi_p7_message_header_t header;
+	uint16_t dummy1;
+	uint16_t dummy2;
+} vendor_ext_p7_req;
+
+typedef struct {
+	nfapi_p7_message_header_t header;
+	uint16_t error_code;
+} vendor_ext_p7_ind;
+
+typedef struct {
+	nfapi_tl_t tl;
+	uint32_t dummy;
+} vendor_ext_tlv_1;
+
+#define VENDOR_EXT_TLV_1_TAG 0xF001
+
+typedef struct {
+	nfapi_tl_t tl;
+	uint32_t dummy;
+} vendor_ext_tlv_2;
+
+#define VENDOR_EXT_TLV_2_TAG 0xF002
+
+#endif // _VENDOR_EXT_
diff --git a/nfapi/open-nFAPI/.travis.yml b/nfapi/open-nFAPI/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..ce2faea92371b6bb7c7748819cfbe69a926692b2
--- /dev/null
+++ b/nfapi/open-nFAPI/.travis.yml
@@ -0,0 +1,36 @@
+
+env:
+  global:
+    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created 
+    #   via the "travis encrypt" command using the project repo's public key
+    - secure: "oNj8JhGBN/zjzrAU7y2Nn/wxSxA/MDp2Y8fVLLp6fhx+y2mWdlMZhgCjeKSpdbGtroUnxErX1P8t+8EPz2+mMoq+G809Q9t7eJjd1+6nkVhEEfDXN83BmJkvIylC0/IKJiT2wCa8LzbdhpQUFyZ1Gk1WKZozAW5HotfFjm6/NFi/GX4uA7S0tU5E4yC3r4yqH9cLZ+arWMOEY/X0lrx0n6tLjDe921kFwkZQGFzAzrbXN2fZXKQ3xFcpREWEgEWsY7H2n4T7oJI3nEPY4P/4kvCjeQMjnlATEwtcciBiUbHRew4WWSTndF54crRlqFlzFcEf/Ouz27U/d2xYHJWcWNi88l+/qsb+V0uobwhiGUJGbVhf9IkgEO3tr/zbwkPDFrXpa/1xuSoc6jDm8i61gKQkcBhQsRFXlciPvwLhiL07gzeAfZD1Yke3tE+0geHPbEA0czzwtHe35jorAKYWsFXOXmcoK9t9SpnvBRFz6JuEsHPooafze43sTJg3qkgBszkU+U38CneeAVwo/uTA3Zw1ZrtOQv56v0UvAHze/VAF5z3rFJPl1oJl60OI8V5UBg4yIa2bySKhO//zwd4MGmsBpcWwDuu2BHUVasfk0vaetVxVVtdXG/2BuBP+IXinpJtI48NSFs6PT82dHz4cDF/iLDs0hPC6sbV258PY8F0="
+
+language: cpp
+
+dist: trusty
+sudo: required
+
+compiler:
+  - g++
+
+before_install:
+  - sudo apt-get install doxygen 
+  - sudo apt-get install libcunit1-dev 
+  - sudo apt-get install libz-dev
+  - sudo apt-get install libsctp-dev
+  - sudo apt-get install libboost-all-dev
+  - autoreconf -i
+
+addons:
+  coverity_scan:
+    project:
+      name: cisco-open-nFAPI
+      version: 1.0
+      description: Build submitted via Travis CI
+    notification_email: xxx@cisco.com
+    build_command_prepend: ./configure
+    build_command: make
+    branch_pattern: coverity_scan
+
+script:
+  - ./configure && make && make check
diff --git a/nfapi/open-nFAPI/CHANGELOG.md b/nfapi/open-nFAPI/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/nfapi/open-nFAPI/LICENSE.md b/nfapi/open-nFAPI/LICENSE.md
new file mode 100644
index 0000000000000000000000000000000000000000..5e0fd33cbbdc8038b61e29ce0437688cc3bc1d00
--- /dev/null
+++ b/nfapi/open-nFAPI/LICENSE.md
@@ -0,0 +1,201 @@
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by
+the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all
+other entities that control, are controlled by, or are under common
+control with that entity. For the purposes of this definition,
+"control" means (i) the power, direct or indirect, to cause the
+direction or management of such entity, whether by contract or
+otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity
+exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation
+source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but
+not limited to compiled object code, generated documentation,
+and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or
+Object form, made available under the License, as indicated by a
+copyright notice that is included in or attached to the work
+(an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object
+form, that is based on (or derived from) the Work and for which the
+editorial revisions, annotations, elaborations, or other modifications
+represent, as a whole, an original work of authorship. For the purposes
+of this License, Derivative Works shall not include works that remain
+separable from, or merely link (or bind by name) to the interfaces of,
+the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including
+the original version of the Work and any modifications or additions
+to that Work or Derivative Works thereof, that is intentionally
+submitted to Licensor for inclusion in the Work by the copyright owner
+or by an individual or Legal Entity authorized to submit on behalf of
+the copyright owner. For the purposes of this definition, "submitted"
+means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems,
+and issue tracking systems that are managed by, or on behalf of, the
+Licensor for the purpose of discussing and improving the Work, but
+excluding communication that is conspicuously marked or otherwise
+designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the
+Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+(except as stated in this section) patent license to make, have made,
+use, offer to sell, sell, import, and otherwise transfer the Work,
+where such license applies only to those patent claims licensable
+by such Contributor that are necessarily infringed by their
+Contribution(s) alone or by combination of their Contribution(s)
+with the Work to which such Contribution(s) was submitted. If You
+institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work
+or a Contribution incorporated within the Work constitutes direct
+or contributory patent infringement, then any patent licenses
+granted to You under this License for that Work shall terminate
+as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+Work or Derivative Works thereof in any medium, with or without
+modifications, and in Source or Object form, provided that You
+meet the following conditions:
+
+(a) You must give any other recipients of the Work or
+Derivative Works a copy of this License; and
+
+(b) You must cause any modified files to carry prominent notices
+stating that You changed the files; and
+
+(c) You must retain, in the Source form of any Derivative Works
+that You distribute, all copyright, patent, trademark, and
+attribution notices from the Source form of the Work,
+excluding those notices that do not pertain to any part of
+the Derivative Works; and
+
+(d) If the Work includes a "NOTICE" text file as part of its
+distribution, then any Derivative Works that You distribute must
+include a readable copy of the attribution notices contained
+within such NOTICE file, excluding those notices that do not
+pertain to any part of the Derivative Works, in at least one
+of the following places: within a NOTICE text file distributed
+as part of the Derivative Works; within the Source form or
+documentation, if provided along with the Derivative Works; or,
+within a display generated by the Derivative Works, if and
+wherever such third-party notices normally appear. The contents
+of the NOTICE file are for informational purposes only and
+do not modify the License. You may add Your own attribution
+notices within Derivative Works that You distribute, alongside
+or as an addendum to the NOTICE text from the Work, provided
+that such additional attribution notices cannot be construed
+as modifying the License.
+
+You may add Your own copyright statement to Your modifications and
+may provide additional or different license terms and conditions
+for use, reproduction, or distribution of Your modifications, or
+for any such Derivative Works as a whole, provided Your use,
+reproduction, and distribution of the Work otherwise complies with
+the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work
+by You to the Licensor shall be under the terms and conditions of
+this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify
+the terms of any separate license agreement you may have executed
+with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+agreed to in writing, Licensor provides the Work (and each
+Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied, including, without limitation, any warranties or conditions
+of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any
+risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise,
+unless required by applicable law (such as deliberate and grossly
+negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special,
+incidental, or consequential damages of any character arising as a
+result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses), even if such Contributor
+has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+the Work or Derivative Works thereof, You may choose to offer,
+and charge a fee for, acceptance of support, warranty, indemnity,
+or other liability obligations and/or rights consistent with this
+License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf
+of any other Contributor, and only if You agree to indemnify,
+defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason
+of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+To apply the Apache License to your work, attach the following
+boilerplate notice, with the fields enclosed by brackets "{}"
+replaced with your own identifying information. (Don't include
+the brackets!)  The text should be enclosed in the appropriate
+comment syntax for the file format. We also recommend that a
+file or class name and description of purpose be included on the
+same "printed page" as the copyright notice for easier
+identification within third-party archives.
+
+Copyright {yyyy} {name of copyright owner}
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/nfapi/open-nFAPI/Makefile.am b/nfapi/open-nFAPI/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..900cf2bbcf5ad4740f544fe9af7132e4a37eba68
--- /dev/null
+++ b/nfapi/open-nFAPI/Makefile.am
@@ -0,0 +1,15 @@
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS =common/ \
+	 sim_common/ \
+	 nfapi/ \
+	 pnf/ \
+	 vnf/ \
+	 nfapi/tests \
+	 pnf/tests \
+	 vnf/tests \
+	 pnf_sim/ \
+	 vnf_sim/ \
+	 integration_tests/ \
+	 docs/ \
+	 $(NULL)
diff --git a/nfapi/open-nFAPI/README.md b/nfapi/open-nFAPI/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..f3132c78d6f088e3df6ef32f97262250f7989393
--- /dev/null
+++ b/nfapi/open-nFAPI/README.md
@@ -0,0 +1,138 @@
+[![Build Status](https://travis-ci.org/cisco/open-nFAPI.svg?branch=master)](https://travis-ci.org/cisco/open-nFAPI)
+[![Coverity Status](https://scan.coverity.com/projects/11791/badge.svg)](https://scan.coverity.com/projects/cisco-open-nfapi)
+
+# open-nFAPI
+ 
+Open-nFAPI is implementation of the Small Cell Forum's network functional API or nFAPI for short. 
+nFAPI defines a network protocol that is used to connect a Physical Network Function (PNF) 
+running LTE Layer 1 to a Virtual Network Function (VNF) running LTE layer 2 and above. The specification
+can be found at http://scf.io/documents/082.
+ 
+The aim of open-nFAPI is to provide an open interface between LTE layer 1 and layer 2 to allow for
+interoperability between the PNF and VNF & also to facilitate the sharing of PNF's between
+different VNF's
+
+Open-nFAPI implements the P4, P5 and P7 interfaces as defined by the nFAPI specification. 
+* The P5 interface allows the VNF to query and configure the 'resources' of the PNF; i.e slice it into
+ 1 or more PHY instances.
+* The P7 interface is used to send the subframe information between the PNF and VNF for a PHY instance
+* The P4 interface allows the VNF to request the PNF PHY instance to perform measurements of the surrounding network
+
+The remaining interfaces are currently outside of the scope of this project.
+
+Supports release 082.09.05 of the nFAPI specification
+
+**The Small Cell Forum cordially requests that any derivative work that looks to 
+extend the nFAPI libraries use the specified vendor extension techniques, 
+so ensuring the widest interoperability of the baseline nFAPI specification 
+in those derivative works.**
+
+## Awards
+
+The Open-nFAPI project has won the Small Cell Forum Judges Choice award 2017. (http://www.smallcellforum.org/awards-2/winners-2017/)
+
+## Licensing
+
+The open-nFAPI libraries are release by CISCO under an Apache 2 license. See `LICENSE.md` file for details
+
+## Downloading
+
+The open-nFAPI project can be pulled from git hub
+
+```
+git clone https://github.com/cisco/open-nFAPI.git nfapi
+```
+
+The following dependencies are required. These are based on a fresh ubuntu installation.
+
+```
+sudo apt-get install autoconf
+sudo apt-get install gcc
+sudo apt-get install g++
+sudo apt-get install libtool
+sudo apt-get install make
+sudo apt-get install doxygen
+sudo apt-get install libcunit1-dev
+sudo apt-get install libz-dev
+sudo apt-get install libsctp-dev
+sudo apt-get install libboost-all-dev
+```
+
+
+
+## Building
+
+To build the open-nFAPI project
+
+```
+autoreconf -i
+./configure
+make
+```
+
+To run the unit and integration tests
+
+```
+make check
+```
+
+You may notice in the console output of the final integration tests the following
+
+```
+*** Missing subframe 123 125
+```
+
+Out of the box the machine on which you are running has not be configured for real time operation as a result
+the vnf may not be scheduled at the correct times and hence it may risk 'missing' subframe opportunities. This
+warning indicates this has happened. 
+
+## Running the simulator
+
+The vnf and pnf simulator can be run using the following commands. The pnf and vnf simulator support sourcing and sinking
+data over udp. Review the xml configuration files for the details of the port and address to configure. Console logging will show
+which address:port is being used
+
+Note : Pinning the simulators to unused cores will produce more consistent behaviour.
+
+Note : You may have to run the processes with sudo to be able to set the real time scheduling and priority
+
+### vnf simulator
+
+To run the vnf simulator you need to specify the port the vnf will listen for p5 connection request upon and also the xml configuration file
+
+```
+vnfsim <port> <xml config file>
+```
+
+### pnf simulator
+
+To run the vnf simulator you need to specify the addrss & port the pnf will connect to the vnf on and also the xml configuration file
+
+```
+pnfsim <address> <port> <xml config file>
+```
+
+
+## Directory structure
+
+```
+docs                    doxgen documentation
+common                  common code used by the nfapi libraries
+nfapi                   the nfapi library including message definitions & encode/decode functions
+pnf                     the pnf library for p4, p5, & p7 interfaces
+vnf                     the vnf library for p4, p5, & p7 interfaces
+sim_common              common simulation for used by the vnf and pnf sim
+vnf_sim                 a vnf simulator including a stub mac implementation
+pnf_sim                 a pnf simualtor including a fapi interface defintion and stub implementation
+xml                     xml configuration files for the vnf and pnf simulator
+wireshark               code for a wireshark dissector for the nFAPI protocol
+```
+
+## Coverity
+
+Coverity runs on the coverity-scan branch. Changes must be merged to the coverity-scan branch to be checked.
+
+
+## eNB Integration - Open Air Interface
+
+The open-nFAPI implementation has been integrated with the Open Air Interface solution here (https://gitlab.eurecom.fr/oai/openairinterface5g) and is (at the time of writing) here (https://gitlab.eurecom.fr/daveprice/openairinterface5g/tree/nfapi-ru-rau-split). The open-nFAPI implementation is integrated with the source eNB implementation with any changes required applied as a patch on top of the baseline open-nFAPI library. Any extensions required must be implemented through the vendor extensions as specified by the Small Cell Forum documentation. Any integration wrapping of functionality must be done within the target environment as shown in the Open Air Interface implementation nfapi directory which is defined by the $NFAPI_DIR location at the top level.
diff --git a/nfapi/open-nFAPI/common/Makefile.am b/nfapi/open-nFAPI/common/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..3e3326ea2c9dea397e3b2bb47ea6f7e736a870ba
--- /dev/null
+++ b/nfapi/open-nFAPI/common/Makefile.am
@@ -0,0 +1,31 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+AM_CPPFLAGS = -I$(top_srcdir)/common/public_inc -g -Wall -Werror
+
+noinst_LIBRARIES =libnfapi_common.a
+
+libnfapi_common_a_SOURCES = src/debug.c 
+
+libnfapi_common_a_CFLAGS =$(AM_CFLAGS)
+
+lib_LTLIBRARIES =libnfapi_common.la
+
+libnfapi_common_la_SOURCES = src/debug.c
+
+
+
+
diff --git a/nfapi/open-nFAPI/common/public_inc/debug.h b/nfapi/open-nFAPI/common/public_inc/debug.h
new file mode 100644
index 0000000000000000000000000000000000000000..14f97a17f6f8fbe23bd2e3e414b51baaa90f4714
--- /dev/null
+++ b/nfapi/open-nFAPI/common/public_inc/debug.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef _DEBUG_H_
+#define _DEBUG_H_
+
+/*! The trace levels used by the nfapi libraries */
+typedef enum nfapi_trace_level
+{
+	NFAPI_TRACE_ERROR = 1,
+	NFAPI_TRACE_WARN,
+	NFAPI_TRACE_NOTE,
+	NFAPI_TRACE_INFO,
+
+	NFAPI_TRACE_LEVEL_MAX
+} nfapi_trace_level_t;
+
+/*! The trace function pointer */
+typedef void (*nfapi_trace_fn_t)(nfapi_trace_level_t level, const char* format, ...);
+
+/*! Global trace function */
+extern nfapi_trace_fn_t nfapi_trace_g;
+
+/*! Global trace level */
+extern nfapi_trace_level_t nfapi_trace_level_g;
+
+/*! NFAPI trace macro */
+//#define NFAPI_TRACE(level, format, ...) { if(nfapi_trace_g && ((nfapi_trace_level_t)level <= nfapi_trace_level_g)) (*nfapi_trace_g)(level, format, ##__VA_ARGS__); }
+#define NFAPI_TRACE(level, format, ...) { if (nfapi_trace_g) (*nfapi_trace_g)(level, format, ##__VA_ARGS__); }
+
+/*! Function to change the trace level 
+ * \param new_level The modified trace level
+ */
+
+void nfapi_set_trace_level(nfapi_trace_level_t new_level);
+
+#endif /* _DEBUG_H_ */
diff --git a/nfapi/open-nFAPI/common/src/debug.c b/nfapi/open-nFAPI/common/src/debug.c
new file mode 100644
index 0000000000000000000000000000000000000000..a45d41d7d7218f806869f6fda7dd9c628b893d9a
--- /dev/null
+++ b/nfapi/open-nFAPI/common/src/debug.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <pthread.h>
+#include <syslog.h>
+
+#include <debug.h>
+
+#define MAX_MSG_LENGTH 			2096
+#define TRACE_HEADER_LENGTH		44
+
+void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...);
+
+// initialize the trace function to 0
+void (*nfapi_trace_g)(nfapi_trace_level_t level, const char* format, ...) = &nfapi_trace_dbg;
+
+nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_INFO;
+//nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_WARN;
+
+void nfapi_set_trace_level(nfapi_trace_level_t new_level)
+{
+	nfapi_trace_level_g = new_level;
+}
+
+void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...)
+{
+	char trace_buff[MAX_MSG_LENGTH + TRACE_HEADER_LENGTH];
+	uint32_t num_chars;
+	va_list p_args;
+	struct timeval tv;
+	pthread_t tid = pthread_self();
+
+	(void)gettimeofday(&tv, NULL);
+
+	num_chars = (uint32_t)snprintf(trace_buff, TRACE_HEADER_LENGTH, "%04u.%06u: 0x%02x: %10u: ", ((uint32_t)tv.tv_sec) & 0x1FFF, (uint32_t)tv.tv_usec, (uint32_t)level, (uint32_t)tid);
+
+	if (num_chars > TRACE_HEADER_LENGTH)
+	{
+		printf("trace_dbg: Error, num_chars is too large: %d", num_chars);
+		return;
+	}
+
+	va_start(p_args, format);
+	if ((num_chars = (uint32_t)vsnprintf(&trace_buff[num_chars], MAX_MSG_LENGTH, format, p_args)))
+	{
+		if (level <= NFAPI_TRACE_WARN)
+		{
+			printf("%s", trace_buff);
+		}
+		printf("%s", trace_buff);
+	}
+	va_end(p_args);
+}
diff --git a/nfapi/open-nFAPI/configure.ac b/nfapi/open-nFAPI/configure.ac
new file mode 100644
index 0000000000000000000000000000000000000000..fd3b387ee50d185af57efe1e27cb8f6777ebb28a
--- /dev/null
+++ b/nfapi/open-nFAPI/configure.ac
@@ -0,0 +1,45 @@
+AC_INIT([open-nFAPI], [1.0])
+
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign serial-tests])
+AM_PROG_AR
+
+LT_INIT([shared static])
+
+# Dependencies
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_AWK
+AC_CONFIG_HEADERS([config.h])
+
+AC_PROG_LIBTOOL
+
+AC_CHECK_FILE([/usr/include/CUnit/CUnit.h],
+	[CFLAGS_CUNIT=-I/usr/include/CUnit AC_SUBST(CFLAGS_CUNIT)],
+	[AC_MSG_NOTICE([Have cunit *************])])
+
+# Need doxygen
+AC_CHECK_PROGS([DOXYGEN], [doxygen])
+if test -z "$DOXYGEN";
+	then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
+fi
+AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([docs/Doxyfile])])
+
+AC_REQUIRE_AUX_FILE([tap-driver.sh])
+
+AC_CONFIG_FILES([Makefile
+                 sim_common/Makefile
+                 common/Makefile
+                 nfapi/Makefile
+                 pnf/Makefile
+                 vnf/Makefile
+                 nfapi/tests/Makefile
+                 pnf/tests/Makefile
+                 vnf/tests/Makefile
+                 pnf_sim/Makefile
+                 vnf_sim/Makefile
+                 integration_tests/Makefile
+                 docs/Makefile
+])
+AC_OUTPUT
diff --git a/nfapi/open-nFAPI/docs/Doxyfile b/nfapi/open-nFAPI/docs/Doxyfile
new file mode 100644
index 0000000000000000000000000000000000000000..9491727d2b53802448d2bad3abd61e6009ee2210
--- /dev/null
+++ b/nfapi/open-nFAPI/docs/Doxyfile
@@ -0,0 +1,1720 @@
+# Doxyfile 1.7.4
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = open-nFAPI
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         = 1.0
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       =
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = ../nfapi/public_inc ../pnf/public_inc ../vnf/public_inc ../docs/doxygen.h
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is adviced to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# If the HTML_TIMESTAMP tag is set to YES then the generated HTML documentation will contain the timesstamp.
+
+HTML_TIMESTAMP         = NO
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the
+# mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will write a font called Helvetica to the output
+# directory and reference it in all dot files that doxygen generates.
+# When you want a differently looking font you can specify the font name
+# using DOT_FONTNAME. You need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME           = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES
diff --git a/nfapi/open-nFAPI/docs/Doxyfile.in b/nfapi/open-nFAPI/docs/Doxyfile.in
new file mode 100644
index 0000000000000000000000000000000000000000..74d405ad000e5b796d92948249e95018a1b4bb33
--- /dev/null
+++ b/nfapi/open-nFAPI/docs/Doxyfile.in
@@ -0,0 +1,1720 @@
+# Doxyfile 1.7.4
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = @PACKAGE_NAME@
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         = @PACKAGE_VERSION@
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       =
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = @top_srcdir@/nfapi/public_inc @top_srcdir@/pnf/public_inc @top_srcdir@/vnf/public_inc @top_srcdir@/docs/doxygen.h
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is adviced to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# If the HTML_TIMESTAMP tag is set to YES then the generated HTML documentation will contain the timesstamp.
+
+HTML_TIMESTAMP         = NO
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the
+# mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will write a font called Helvetica to the output
+# directory and reference it in all dot files that doxygen generates.
+# When you want a differently looking font you can specify the font name
+# using DOT_FONTNAME. You need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME           = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES
diff --git a/nfapi/open-nFAPI/docs/Makefile.am b/nfapi/open-nFAPI/docs/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..9530fa844d9d99e1a8df86f3c90dddcb46008826
--- /dev/null
+++ b/nfapi/open-nFAPI/docs/Makefile.am
@@ -0,0 +1,35 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+if HAVE_DOXYGEN
+directory = $(top_srcdir)/docs/man/man3/
+
+dist_man_MANS = $(directory)/man_page_1.3 $(directory)/man_page_2.3
+$(directory)/man_page_1.3: doxyfile.stamp
+$(directory)/man_page_2.3: doxyfile.stamp
+
+doxyfile.stamp:
+	$(DOXYGEN) Doxyfile
+	echo Timestamp > doxyfile.stamp
+
+CLEANFILES = doxyfile.stamp
+
+all-local: doxyfile.stamp
+clean-local:
+	rm -rf $(top_srcdir)/docs/man
+	rm -rf $(top_srcdir)/docs/html
+	rm -rf $(top_srcdir)/docs/latex
+endif
diff --git a/nfapi/open-nFAPI/docs/doxygen.h b/nfapi/open-nFAPI/docs/doxygen.h
new file mode 100644
index 0000000000000000000000000000000000000000..ae815e68d6feb2389a7978e182998a5300e0a1b8
--- /dev/null
+++ b/nfapi/open-nFAPI/docs/doxygen.h
@@ -0,0 +1,327 @@
+/*! \mainpage Open Network Function Application Platform Interface (Open-nFAPI)
+ *
+ * \section intro_sec Introduction
+ *
+ * Open-nFAPI is implementation of the Small Cell Forum's network femto API or nFAPI for short. 
+ * nFAPI defines a network protocol that is used to connect a Physical Network Function (PNF) 
+ * running LTE Layer 1 to a Virtual Network Function (VNF) running LTE Layer 2 and above. The specification
+ * can be found at http://scf.io/documents/082.
+ *
+ * The aim of Open-nFAPI is to provide an open interface between LTE Layer 1 and Layer 2 to allow for
+ * interoperability between the PNF and VNF & also to facilitate the sharing of PNF's between
+ * different VNF's
+ *
+ * Open-nFAPI implements the P4, P5 and P7 interfaces as defined by the nFAPI specification. 
+ * - The P5 interface allows the VNF to query and configure the 'resources' of the PNF; slicing it into
+ * 1 or more phy instances.  
+ * - The P7 interface is used to send the subframe information between the PNF and VNF for 1 or more phy instances
+ * - The P4 interface allows the VNF to request the PNF phy instances to perform measurements of the surrounding network
+ *
+ * The remaining interfaces are currently outside of the scope of this project.
+ *
+ * The best place to start is by reviewing the detailed nFAPI call flow which can be \ref nfapi_call_flow "here"
+ * 
+ * \section contrib Contibuting
+ *
+ * The Small Cell Forum cordially requests that any derivative work that looks to extend 
+ * the nFAPI libraries use the specified vendor extension techniques, so ensuring 
+ *the widest interoperability of the baseline nFAPI specification in those derivative works.
+ * 
+ * \section install_sec Installation
+ *
+ * \subsection step1 Step 1: Opening the box
+ *
+ * etc...
+ *
+ * \section dir_struct Directory Structure
+ * \code
+ 
+ *     nfapi
+ *     |- common                    Common functions for the nfapi project
+ *     |  |- src
+ *     |  |- public-inc
+ *     |- nfapi                     The NFAPI lib
+ *     |  |- inc
+ *     |  |- src
+ *     |  |- public-inc             Public interface for the nfapi library
+ *     |  |- tests                  Unit test for the nfapi lib
+ *     |- pnf                       The PNF lib
+ *     |  |- inc
+ *     |  |- src
+ *     |  |- public-inc             Public interface for the pnf library
+ *     |  |- tests                  Unit test for the pnf lib
+ *     |- vnf                       The VNF lib
+ *     |  |- inc
+ *     |  |- src
+ *     |  |- public-inc             Public interface for the vnf library
+ *     |  |- tests                  Unit test for the vnf lib
+ *     |- sim_common                Common functions for the nfapi simulators
+ *     |  |- inc
+ *     |  |- src
+ *     |- pnf_sim                   The PNF simulator
+ *     |  |- inc
+ *     |  |- src
+ *     |- vnf_sim                   The VNF simulator
+ *     |  |- inc
+ *     |  |- src
+ *     |- integration_tests         Integration tests that run both VNF & PNF simulators
+ *     |  |- inc
+ *     |  |- src
+ *     |- docs                      Documentation
+ *     |- xml                       Xml configuration for the simulator
+ 
+ * \endcode
+ * \section building Building
+ * To build the nfapi project and run the unit test you will need to 
+ * \code
+ *     autoreconf -i
+ *     ./configure
+ *     make
+ *     make check
+ * \endcode
+ * The following dependencies will be required
+ * - Boost. Need to build the simulators
+ * - STCP. Need to run the simulators
+ * - 
+ * \section simulators  Running the simulators
+ * Once you have build the nfapi project you can run the PNF/VNF simulators on either the same
+ * of seperate linux machines. 
+ * 
+ * To run the VNF from the vnf_sim directory.
+ * \code
+ *     ./vnfsim 4242 ../xml/vnf_A.xml
+ * [MAC] Rx Data from 8891
+ * [MAC] Tx Data to 10.231.16.80.8892
+ * Calling nfapi_vnf_start
+ * 2035.854438: 0x04:  773068608: nfapi_vnf_start()
+ * 2035.854450: 0x04:  773068608: Starting P5 VNF connection on port 4242
+ * 2035.854472: 0x04:  773068608: P5 socket created... 3
+ * 2035.854478: 0x03:  773068608: VNF Setting the SCTP_INITMSG
+ * 2035.854481: 0x04:  773068608: IPV4 binding to port 4242
+ * 2035.854485: 0x04:  773068608: bind succeeded..3.
+ * 2035.854497: 0x04:  773068608: listen succeeded...
+ * \endcode
+ *
+ * 
+ * To run the PNF from the pnf_sim directory
+ * \code
+ *     ./pnfsim 127.0.01 4242 ../xml/pnf_phy_1_A.xml
+ * nfapi_pnf_start
+ * Starting P5 PNF connection to VNF at 127.0.0.1:4242
+ * Host address info  0 Family:IPV4 Address:127.0.0.1
+ * PNF Setting the SCTP_INITMSG
+ * P5 socket created...
+ * Socket CONNECTED
+ * PNF_PARAM.request received
+ * [PNF_SIM] pnf param request
+ * PNF_CONFIG.request received
+ * [PNF_SIM] pnf config request
+ * .... and so on
+ * \endcode
+ * 
+ * You can Ctrl-C to exit the simulators. 
+ * 
+
+ */
+
+/*! \page nfapi_call_flow NFAPI Call Flow
+ *
+ * \section seq_diag Sequence diagram
+ *
+ * The follow sequence digram show how the nFAPI api will be used to bring up 
+ * the PNF and then the PNF PHY and initiate subframe message exchange
+ * The names of the CLIENT callbacks are placeholders for the functions that 
+ * the CLIENT will provide.
+ *
+ * \msc
+ *
+ *   width="1750";
+ *   FAPI, PNF_P7_CLIENT, PNF_P7_LIB, PNF_P5_CLIENT, PNF_P5_LIB, VNF_P5_LIB, VNF_P5_CLIENT, VNF_P7_LIB, VNF_P7_CLIENT, MAC;
+ *   VNF_P5_CLIENT=>VNF_P5_LIB		[label="nfapi_vnf_config_create", URL="\ref nfapi_vnf_config_create"];
+ *   VNF_P5_CLIENT=>VNF_P5_LIB		[label="nfapi_vnf_start", URL="\ref nfapi_vnf_start"];
+ *   VNF_P5_LIB note VNF_P5_LIB		[label="Listening for PNF connection"];
+ *   PNF_P5_CLIENT note PNF_P5_CLIENT		[label="P9 has provided the address of the VNF"];
+ *	 PNF_P5_CLIENT=>PNF_P5_LIB		[label="nfapi_pnf_config_create", URL="\ref nfapi_pnf_config_create"];
+ *	 PNF_P5_CLIENT=>PNF_P5_LIB		[label="nfapi_pnf_start", URL="\ref nfapi_pnf_start"];
+ *   PNF_P5_LIB note PNF_P5_LIB		[label="PNF STATE : PNF IDLE"];
+ *   PNF_P5_LIB->VNF_P5_LIB			[label="<connect>"];
+ *   VNF_P5_LIB=>VNF_P5_CLIENT		[label="pnf_connection_indication", URL="\ref nfapi_vnf_config::pnf_connection_indication"];
+ *
+ *   VNF_P5_LIB<=VNF_P5_CLIENT		[label="nfapi_vnf_pnf_param_req", URL="\ref nfapi_vnf_pnf_param_req"];
+ *   VNF_P5_LIB->PNF_P5_LIB			[label="PNF_PARAM.request"];
+ *   PNF_P5_LIB=>PNF_P5_CLIENT		[label="pnf_param_request", URL="\ref nfapi_pnf_config::pnf_param_req"];
+ *   PNF_P5_LIB<=PNF_P5_CLIENT		[label="nfapi_pnf_pnf_param_response", URL="\ref nfapi_pnf_pnf_param_resp"];
+ *   VNF_P5_LIB<-PNF_P5_LIB			[label="PNF_PARAM.response"];
+ *   VNF_P5_LIB=>VNF_P5_CLIENT		[label="pnf_param_response", URL="\ref nfapi_vnf_config::pnf_param_resp"];
+ *
+ *   VNF_P5_LIB<=VNF_P5_CLIENT		[label="nfapi_vnf_pnf_config_req", URL="\ref nfapi_vnf_pnf_config_req"];
+ *   VNF_P5_LIB->PNF_P5_LIB			[label="PNF_CONFIG.request"];
+ *   PNF_P5_LIB=>PNF_P5_CLIENT		[label="pnf_config_request", URL="\ref nfapi_pnf_config::pnf_config_req"];
+ *   PNF_P5_LIB<=PNF_P5_CLIENT		[label="nfapi_pnf_pnf_config_response", URL="\ref nfapi_pnf_pnf_config_resp"];
+ *   PNF_P5_LIB note PNF_P5_LIB		[label="PNF STATE : PNF CONFIGURED"];
+ *   VNF_P5_LIB<-PNF_P5_LIB			[label="PNF_CONFIG.response"];
+ *   VNF_P5_LIB=>VNF_P5_CLIENT		[label="pnf_config_response", URL="\ref nfapi_vnf_config::pnf_config_resp"];
+ *
+ *   VNF_P5_LIB<=VNF_P5_CLIENT		[label="nfapi_vnf_pnf_start_req", URL="\ref nfapi_vnf_pnf_start_req"];
+ *   VNF_P5_LIB->PNF_P5_LIB			[label="PNF_START.request"];
+ *   PNF_P5_LIB=>PNF_P5_CLIENT		[label="pnf_start_request", URL="\ref nfapi_pnf_config::pnf_start_req"];
+ *   PNF_P5_CLIENT=>FAPI			[label="<create>"];
+ *   FAPI note FAPI					[label="FAPI STATE : IDLE"];
+ *   PNF_P5_LIB<=PNF_P5_CLIENT		[label="nfapi_pnf_pnf_start_response", URL="\ref nfapi_pnf_pnf_start_resp"];
+ *   PNF_P5_LIB note PNF_P5_LIB		[label="PNF STATE : PNF RUNNING"];
+ *   VNF_P5_LIB<-PNF_P5_LIB			[label="PNF_START.response"];
+ *   VNF_P5_LIB=>VNF_P5_CLIENT		[label="pnf_start_response", URL="\ref nfapi_vnf_config::pnf_param_resp"];
+ *
+ *   --- [ label="If vnf p7 instance not already running"];
+ *   VNF_P5_CLIENT=>VNF_P5_LIB	    [label="nfapi_vnf_allocate_phy", URL="\ref nfapi_vnf_allocate_phy"];
+ *   VNF_P5_CLIENT=>VNF_P7_CLIENT	[label="<create>"];
+ *   VNF_P7_CLIENT=>VNF_P7_LIB		[label="nfapi_vnf_p7_config_create", URL="\ref nfapi_vnf_p7_config_create"];
+ *   VNF_P7_CLIENT=>VNF_P7_LIB		[label="nfapi_vnf_p7_start", URL="\ref nfapi_vnf_p7_start"];
+ *   ---;
+ *
+ *   VNF_P5_LIB<=VNF_P5_CLIENT		[label="nfapi_vnf_param_request", URL="\ref nfapi_vnf_param_req"];
+ *   VNF_P5_LIB->PNF_P5_LIB			[label="PARAM.request"];
+ *   PNF_P5_LIB=>PNF_P5_CLIENT		[label="param_request", URL="\ref nfapi_pnf_config::param_req"];
+ *   PNF_P5_CLIENT=>FAPI			[label="fapi_param_request"];
+ *   PNF_P5_CLIENT<=FAPI			[label="fapi_param_response"];
+ *   PNF_P5_CLIENT=>PNF_P7_CLIENT	[label="<create>"];
+ *   PNF_P7_CLIENT=>PNF_P7_LIB		[label="nfapi_pnf_p7_create", URL="\ref nfapi_pnf_p7_config_create"];
+ *   PNF_P7_CLIENT=>PNF_P7_LIB		[label="nfapi_pnf_p7_start", URL="\ref nfapi_pnf_p7_start"];
+ *   PNF_P5_LIB<=PNF_P5_CLIENT		[label="nfapi_pnf_param_response", URL="\ref nfapi_pnf_param_resp"];
+ *   VNF_P5_LIB<-PNF_P5_LIB			[label="PARAM.response"];
+ *   VNF_P5_LIB=>VNF_P5_CLIENT		[label="param_response", URL="\ref nfapi_vnf_config::param_resp"];
+ *
+ *   VNF_P5_LIB<=VNF_P5_CLIENT		[label="nfapi_vnf_config_request", URL="\ref nfapi_vnf_config_req"];
+ *   VNF_P5_LIB->PNF_P5_LIB			[label="CONFIG.request"];
+ *   PNF_P5_LIB=>PNF_P5_CLIENT		[label="config_request", URL="\ref nfapi_pnf_config::config_req"];
+ *   PNF_P5_CLIENT=>FAPI			[label="fapi_config_request"];
+ *   FAPI note FAPI					[label="FAPI STATE : CONFIGURED"];
+ *   PNF_P5_CLIENT<=FAPI			[label="fapi_config_response"];
+ *   PNF_P5_LIB<=PNF_P5_CLIENT		[label="nfapi_pnf_config_response", URL="\ref nfapi_pnf_param_resp"];
+ *   VNF_P5_LIB<-PNF_P5_LIB			[label="CONFIG.response"];
+ *   VNF_P5_LIB=>VNF_P5_CLIENT		[label="config_response", URL="\ref nfapi_vnf_config::config_resp"];
+ *
+ *   VNF_P5_LIB<=VNF_P5_CLIENT		[label="nfapi_vnf_start_request", URL="\ref nfapi_vnf_start_req"];
+ *   VNF_P5_LIB->PNF_P5_LIB			[label="START.request"];
+ *   PNF_P5_LIB=>PNF_P5_CLIENT		[label="start_request", URL="\ref nfapi_pnf_config::start_req"];
+ *   PNF_P5_CLIENT=>FAPI			[label="fapi_start_request"];
+ *   FAPI note FAPI					[label="FAPI STATE : RUNNING"];
+ *   FAPI note FAPI					[label="FAPI will start sending subframe indications"];
+ *
+ *   --- [ label="For each 'phy' subframe"];
+ *   FAPI=>PNF_P7_CLIENT			[label="fapi_subframe_indication"];
+ *   PNF_P7_CLIENT=>PNF_P7_LIB		[label="nfapi_pnf_p7_subframe_ind", URL="\ref nfapi_pnf_p7_subframe_ind"];
+ *   ---;
+ *   PNF_P7_CLIENT=>PNF_P5_CLIENT	[label="<start_response>"];
+ *
+ *   PNF_P5_LIB<=PNF_P5_CLIENT		[label="nfapi_pnf_start_response", URL="\ref nfapi_pnf_start_resp"];
+ *   VNF_P5_LIB<-PNF_P5_LIB			[label="START.response"];
+ *   VNF_P5_LIB=>VNF_P5_CLIENT		[label="start_response", URL="\ref nfapi_vnf_config::start_resp"];
+ *   VNF_P5_CLIENT=>VNF_P7_CLIENT	[label="<p7_add_pnf>"];
+ *   VNF_P7_CLIENT=>VNF_P7_LIB		[label="nfapi_vnf_p7_add_pnf", URL="\ref nfapi_vnf_p7_add_pnf"];
+ *
+ *   VNF_P7_LIB->PNF_P7_LIB			[label="DL_NODE_SYNC"];
+ *   VNF_P7_LIB<-PNF_P7_LIB			[label="UL_NODE_SYNC"];
+ *   VNF_P7_LIB<-PNF_P7_LIB			[label="TIMING_INFO"];
+ *   VNF_P7_LIB note VNF_P7_LIB		[label="When sync is achieved"];
+ *
+ *   VNF_P7_LIB=>VNF_P7_CLIENT		[label="sync_indication", URL="\ref nfapi_vnf_p7_config::sync_indication"];
+ *
+ *   --- [ label="For each 'vnf phy' subframe"];
+ *   VNF_P7_LIB=>VNF_P7_CLIENT		[label="subframe_indication(tti=x)", URL="\ref nfapi_vnf_p7_config::subframe_indication"];
+ *   VNF_P7_CLIENT=>MAC				[label="subframe_indication"];
+ *   VNF_P7_CLIENT<=MAC				[label="dl_config_req"];
+ *   VNF_P7_CLIENT=>VNF_P7_LIB		[label="nfapi_vnf_p7_dl_config_req", URL="\ref nfapi_vnf_p7_dl_config_req"];
+ *   VNF_P7_LIB->PNF_P7_LIB			[label="DL_CONFIG.request"];
+ *   PNF_P7_LIB note PNF_P7_LIB		[label="Store in subframe buffer for tti x"];
+ *   VNF_P7_CLIENT<=MAC				[label="ul_config_req"];
+ *   VNF_P7_CLIENT=>VNF_P7_LIB		[label="nfapi_vnf_p7_ul_config_req", URL="\ref nfapi_vnf_p7_ul_config_req"];
+ *   VNF_P7_LIB->PNF_P7_LIB			[label="UL_CONFIG.request"];
+ *   PNF_P7_LIB note PNF_P7_LIB		[label="Store in subframe buffer for tti x"];
+ *   VNF_P7_CLIENT<=MAC				[label="hi_dci0_req"];
+ *   VNF_P7_CLIENT=>VNF_P7_LIB		[label="nfapi_vnf_p7_hi_dci0_req", URL="\ref nfapi_vnf_p7_hi_dci0_req"];
+ *   VNF_P7_LIB->PNF_P7_LIB			[label="HI_DCI0.request"];
+ *   PNF_P7_LIB note PNF_P7_LIB		[label="Store in subframe buffer for tti x"];
+ *   VNF_P7_CLIENT<=MAC				[label="tx_req"];
+ *   VNF_P7_CLIENT=>VNF_P7_LIB		[label="nfapi_vnf_p7_tx_req", URL="\ref nfapi_vnf_p7_tx_req"];
+ *   VNF_P7_LIB->PNF_P7_LIB			[label="TX.request"];
+ *   PNF_P7_LIB note PNF_P7_LIB		[label="Store in subframe buffer for tti x"];
+ *   ---;
+ *
+ *
+ *   --- [ label="For each 'phy' subframe"];
+ *
+ *   FAPI=>PNF_P7_CLIENT			[label="harq_indication"];
+ *   PNF_P7_CLIENT=>PNF_P7_LIB		[label="nfapi_pnf_p7_harq_ind", URL="\ref nfapi_pnf_p7_harq_ind"];
+ *   PNF_P7_LIB->VNF_P7_LIB			[label="HARQ.ind"];
+ *   VNF_P7_LIB=>VNF_P7_CLIENT		[label="harq_ind", URL="\ref nfapi_vnf_p7_config::harq_indication"];
+ *   VNF_P7_CLIENT=>MAC				[label="harq_ind"];
+ *
+ *   FAPI=>PNF_P7_CLIENT			[label="subframe_indication(tti=x)"];
+ *   PNF_P7_CLIENT=>PNF_P7_LIB		[label="nfapi_pnf_p7_subframe_ind", URL="\ref nfapi_pnf_p7_subframe_ind"];
+ *   PNF_P7_LIB note PNF_P7_LIB		[label="Send data from subframe buffer for tti x"];
+ *   PNF_P7_LIB=>PNF_P7_CLIENT		[label="dl_config_req", URL="\ref nfapi_pnf_p7_config::dl_config_req"];
+ *   PNF_P7_CLIENT=>FAPI			[label="dl_config_req"];
+ *   PNF_P7_LIB=>PNF_P7_CLIENT		[label="ul_config_req", URL="\ref nfapi_pnf_p7_config::ul_config_req"];
+ *   PNF_P7_CLIENT=>FAPI			[label="ul_config_req"];
+ *   PNF_P7_LIB=>PNF_P7_CLIENT		[label="hi_dci0_req", URL="\ref nfapi_pnf_p7_config::hi_dci0_req"];
+ *   PNF_P7_CLIENT=>FAPI			[label="hi_dci0_req"];
+ *   PNF_P7_LIB=>PNF_P7_CLIENT		[label="tx_req", URL="\ref nfapi_pnf_p7_config::tx_req"];
+ *   PNF_P7_CLIENT=>FAPI			[label="tx_req"];
+ *   ---;
+ *
+ * \endmsc
+ *
+ * \section seq_diag_bca BCA
+ *
+ * -#	The VNF_P5_CLIENT is created. If it left to the VRAN partner to define how that is done. The client is responsiable to creation of the thread with the correct priorities within the wider system.
+ * -#	The VNF_P5_CLIENT creates and initializes the VNF_P5_LIB (nfapi_vnf_config_create & nfapi_vnf_start) providing the address that it should listen on for incoming SCTP connections. It is expected that this would be provided by some VNF management system. The VNF_P5_CLIENT also provides information on the callbacks that the VNF_P5_LIB will use to inform the VNF_P5_CLIENT of the received messages
+ * \code
+ * nfapi_vnf_config_t* vnf_config = nfapi_vnf_config_create();
+ * vnf_config->pnf_connection_indication = &pnf_connection_indication;
+ * vnf_config->pnf_param_resp = &pnf_param_resp;
+ * nfapi_vnf_start(vnf_config);
+ * \endcode
+ * -#	It is FFS how the address information of the VNF P5 is passed to the PNF over P9, but assuming that has been done
+ * -#	The PNF_P5_CLIENT is created and then creates the PNF_P5_LIB (nfapi_pnf_init & nfapi_pnf_start) passing the address of the VNF to connect to. The PNF_P5_CLIENT also provides information on the callbacks that the PNF_P5_LIB will use to inform the PNF_P5_CLIENT of the received messages
+ * \code
+ * nfapi_pnf_config_t* pnf_config = nfapi_pnf_config_create();
+ * pnf_config->pnf_param_req = &pnf_param_req;
+ * nfapi_pnf_start(pnf_config);
+ * \endcode
+ * -#	The PNF_P5_LIB attempts to establish connection to the VNF_P5 endpoint
+ * -#	The VNF_P5_LIB receives the STCP connection request and indicates this to the VNF_P5_CLIENT (pnf_connection_indication). The VNF_P5_CLIENT can decide to accept or reject the connection.
+  * \code
+ * int pnf_connection_indication(nfapi_vnf_config_t* config, int p5_idx) {
+ *   // send the PNF_PARAM.request
+ *   nfapi_pnf_param_request_t req;
+ *   memset(&req, 0, sizeof(req));
+ *   req.header.message_id = NFAPI_PNF_PARAM_REQUEST;
+ *   nfapi_vnf_pnf_param_req(config, p5_idx, req);
+ *   return 0;
+ * }
+ * \endcode
+
+ * -#	The VNF and PNF then proceed to exchange the NFAPI PNF messages (PNF_PARAM, PNF_CONFIG and PNF_START). At each stage the LIB’s invoke callbacks on the CLIENT’s for them to handle message the return the appropriate response. 
+ * -#	Finally the VNF will send the PNF_START.req which will invoke the PNF_P5_CLIENT nfapi_pnf_start_request callback. This is the point at which it is expect that the PNF_CLIENT will create the FAPI module. The PNF_P5_CLIENT will need to perform the translation between NFAPI structures and vendor specific FAPI structures for messages sent between the PNF_P5_LIB and the FAPI interface.
+ * -#	The PNF_START.response will sent back to the VNF and at this point the VNF_P5_CLIENT will need to decide which VNF_P7 instance will handle the P7 connection. i.e. it needs to determine the IP address and port number of the P7 VNF instance. 
+ * -#	A new VNF_P7_CLIENT & VNF_P7_LIB should be configured and started if necessary.
+ * -#	The VNF_P5 will then send the PARAM.request to the PNF_P5 which will forward it onto the FAPI interface. This PARAM.request includes the VNF_P7 address. The PNF_P7_CLIENT must decide on the PNF P7 address. This information is used to create and initialize the PNF_P7_LIB. The PNF_P7 address is then returned by the PNF_P5 to the VNF_P5 in the PARAM.response.
+ * -#	The VNF_P5 will then exchange with the PNF_P5 the CONFIG.request/response which will be used to configure the PNF FAPI instance.
+ * -#	The VNF_P5 will then decide to start the PNF_P7 by sending the START.request.
+ * -#	The PNF_P5_CLIENT need to send the start request to the FAPI instance. The response which is the start of subframe indications from the FAPI. In receipt of the first subframe indication the PNF_P5_CLIENT will send the START.response to the VNF_P5 via the PNF_P5_LIB
+ * -#	The FAPI subframe indications should be forwarded to the PNF_P7_LIB by the PNF_P7_CLIENT. Until the VNF_P7 instance has sent the subframe configuration messages (dl_config, ul_config, etc) the PNF_P7_LIB will send ‘dummy’ subframe configuration messages. The contents of which are configurable by the PNF_P7_CLIENT.
+ * -#	When the VNF_P5_CLIENT receives the START.response it will need to ‘communicate’ with the VNF_P7_CLIENT to inform it that the PNF_P7 instance has started. The VNF_P7_CLIENT will call the nfapi_vnf_P7_add_pnf function passing the address details of the PNF_P7 instance.
+ * -#	The VNF_P7_LIB will then start the sync procedure to establish sub frame synchronization between the PNF_P7 and VNF_P7 instances. This involves sending the DL_NODE_SYNC and UL_NODE_SYNC to determine network latency and PNF processing latency to be able to request MAC generate sub frames in advance on when they are required by the FAPI interface.
+ * -#	When sync is achieved the VNF_P7_LIB will send the nfapi_sync_indication to the VNF_P7_CLIENT. 
+ * -#	The VNF_P7_LIB will then start issuing sub frame indications to the VNF_P7_CLIENT. The logical intent is that they indications are sent every millisecond. However due to the scheduling jitter that may be seen by the VNF these subframe indications may be less than or more than 1ms apart. How this is handled is one of the critical functions of the VNF_P7_LIB and may require specialization or requirements on the VNF environment i.e. CPU pinning.
+ * -#	The VNF_P7_LIB will send the subframe_indication to the VNF_P7_CLIENT for ‘x’ subframe’s inadvance of the current TTI at the PNF. The delta ‘x’ will be determined by the sync procedure and how far in advance the FAPI needs to receive messages before RF transmission. 
+ * -#	The VNF_P7_CLIENT is then responsible for communicating to the MAC layer to prepare the dl_config_request, ul_config_request, hi_dci0_request, tx_req in a timely manner and sending them to the VNF_P7_LIB
+ * -#	The VNF_P7_LIB will send them to the VNF_P7_LIB. 
+ * -#	The PNF_P7_LIB will store these messages in a subframe buffer or playout buffer in advance of when they are required by FAPI.
+ *  -#	The PNF_P7_LIB will monitor to see if these messages arrive too late and if they do trigger a TIMING_INFO response to the VNF_P7_LIB to reassess if the sync is still valid.
+ * -#	As some time in the future the FAPI will send a subframe indication for the TTI that the VNF_P7_LIB had previously requested.
+ * -#	The PNF_P7_LIB will then use the messages in the subframe buffer and send them too the FAPI interface for transmission. The PNF_P7_CLIENT will need to perform the translation between NFAPI structure and vendor specific FAPI structures
+ * -#	This subframe exchange will continue and allow high layer MAC and RRC function to bringup the cell and connect UE’s
+
+ */
diff --git a/nfapi/open-nFAPI/integration_tests/Makefile.am b/nfapi/open-nFAPI/integration_tests/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..2413590182596bea836252483d9ed1ccc4eb22af
--- /dev/null
+++ b/nfapi/open-nFAPI/integration_tests/Makefile.am
@@ -0,0 +1,29 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+#vnf unit test
+AM_CPPFLAGS = -I../nfapi/inc -I../nfapi/public_inc  -I../common/public_inc -I../vnf/public_inc $(CFLAGS_CUNIT) -Wall -Werror
+
+export LD_LIBRARY_PATH=/opt/gcc-4.7.3/lib
+check_PROGRAMS= nfapi_integration_tests
+nfapi_integration_tests_SOURCES = main.cpp ../common/src/debug.c   
+nfapi_integration_tests_LDADD= -L$(libdir) -lpthread -lrt  -lcunit
+
+
+
+LOG_DRIVER = $(top_srcdir)/tap-driver.sh
+TESTS=nfapi_integration_tests
+EXTRA_DIST=$(TESTS)
diff --git a/nfapi/open-nFAPI/integration_tests/main.cpp b/nfapi/open-nFAPI/integration_tests/main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..83c48afec3d086374bd8221ba6918f1c1c27845f
--- /dev/null
+++ b/nfapi/open-nFAPI/integration_tests/main.cpp
@@ -0,0 +1,269 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "CUnit.h"
+#include "Basic.h"
+#include "Automated.h"
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+int start_vnf_proc(int port)
+{
+	char port_str[10];
+	sprintf(port_str, "%d", port);
+
+	const char *argv[]  = {"vnfsim", port_str, "../xml/vnf_A.xml", NULL};
+	int pid = fork();
+
+	if(pid == 0)
+	{
+		int result = execv("../vnf_sim/vnfsim", (char* const*)argv); //, env_args);
+		if(result == -1)
+		{
+			printf("Failed to exec vnf process %d\n", errno);
+		}
+		exit(0);
+	}
+	else
+	{
+		return pid;
+	}
+}
+
+int start_pnf_proc(const char* addr, int port, const char* file)
+{
+	char port_str[10];
+	sprintf(port_str, "%d", port);
+
+	char filename[256];
+	sprintf(filename, "../xml/%s", file);
+
+	const char * argv[] = {"pnfsim", addr, port_str, filename, NULL};
+	int pid = fork();
+
+	if(pid == 0)
+	{
+		int result = execv("../pnf_sim/pnfsim", (char* const*)argv); //, env_args);
+		if(result == -1)
+		{
+			printf("Failed to exec pnf process %d\n", errno);
+		}
+		exit(0);
+	}
+	else
+	{
+		return pid;
+	}
+}
+
+int kill_proc(int pid)
+{
+	kill(pid, SIGKILL);
+
+	int status;
+	int waitpid_result = waitpid(pid, &status, 0);
+
+	return waitpid_result;
+}
+
+
+void test_1()
+{
+
+	int pnf_port = 5655;
+	const char* pnf_addr = "localhost";
+
+	printf("**** starting vnf *****\n");
+	int vnf_pid = start_vnf_proc(pnf_port);
+
+	printf("**** starting pnf *****\n");
+	int pnf1_pid = start_pnf_proc(pnf_addr, pnf_port, "pnf_phy_1_A.xml");
+
+
+	sleep(10);
+
+	printf ("*** Terminating ****\n");
+	kill_proc(vnf_pid);
+	kill_proc(pnf1_pid);
+}
+void test_1a()
+{
+
+	int pnf_port = 5655;
+	const char* pnf_addr = "localhost";
+
+	printf("**** starting vnf *****\n");
+	int vnf_pid = start_vnf_proc(pnf_port);
+
+	printf("**** starting pnf *****\n");
+	int pnf1_pid = start_pnf_proc(pnf_addr, pnf_port, "pnf_phy_2_A.xml");
+
+
+	sleep(10);
+
+	printf ("*** Terminating ****\n");
+	kill_proc(vnf_pid);
+	kill_proc(pnf1_pid);
+}
+
+
+void test_2()
+{
+	int pnf_port = 5655;
+	const char* pnf_addr = "127.0.0.1";
+
+	int vnf_pid = start_vnf_proc(pnf_port);
+	sleep(2);
+
+	int pnf1_pid = start_pnf_proc(pnf_addr, pnf_port, "pnf_phy_1_A.xml");	
+	int pnf2_pid = start_pnf_proc(pnf_addr, pnf_port, "pnf_phy_1_A.xml");	
+
+	sleep(2);
+
+	kill_proc(pnf2_pid);
+	kill_proc(pnf1_pid);
+	kill_proc(vnf_pid);
+}
+
+void test_32()
+{
+	int pnf_count = 32;
+	int pnf_pid[pnf_count];
+
+	int pnf_port = 5655;
+	const char* pnf_addr = "127.0.0.1";
+
+	int vnf_pid = start_vnf_proc(pnf_port);
+	sleep(2);
+
+	for(int i = 0; i < pnf_count; ++i)
+	{
+		pnf_pid[i] = start_pnf_proc(pnf_addr, pnf_port, "pnf_phy_1_A.xml");
+	}
+
+	sleep(5);
+
+	printf ("*** Terminating pnfs\n");
+
+	for(int i = 0; i < pnf_count; ++i)
+	{
+		kill_proc(pnf_pid[i]);
+	}
+	printf ("*** Terminating vnf\n");
+	kill_proc(vnf_pid);
+}
+
+
+int init_suite()
+{
+	return 0;
+}
+
+int clean_suite()
+{
+	return 0;
+}
+
+int main ( void )
+{
+   CU_pSuite pSuite = NULL;
+
+   /* initialize the CUnit test registry */
+   if ( CUE_SUCCESS != CU_initialize_registry() )
+      return CU_get_error();
+
+   /* add a suite to the registry */
+   pSuite = CU_add_suite( "integration_test_suite", init_suite, clean_suite );
+   if ( NULL == pSuite ) 
+   {
+      CU_cleanup_registry();
+      return CU_get_error();
+   }
+
+        //(NULL == CU_add_test(pSuite, "vnf_test_start_connect_2", vnf_test_start_connect_2)) 
+   /* add the tests to the suite */
+   if ( (NULL == CU_add_test(pSuite, "test_1a", test_1a))
+//        (NULL == CU_add_test(pSuite, "test_2", test_2)) ||
+//        (NULL == CU_add_test(pSuite, "test_32", test_32))
+      )
+   {
+      CU_cleanup_registry();
+      return CU_get_error();
+   }
+
+   // Run all tests using the basic interface
+   CU_basic_set_mode(CU_BRM_VERBOSE);
+   CU_set_output_filename("vnf_unit_test_results.xml");
+   CU_basic_run_tests();
+
+	CU_pSuite s = CU_get_registry()->pSuite;
+	int count = 0;
+	while(s)
+	{
+		CU_pTest t = s->pTest;
+		while(t)
+		{
+			count++;
+			t = t->pNext;
+		}
+		s = s->pNext;
+	}
+
+	printf("%d..%d\n", 1, count);
+
+
+
+	s = CU_get_registry()->pSuite;
+	count = 1;
+	while(s)
+	{
+		CU_pTest t = s->pTest;
+		while(t)
+		{
+			int pass = 1;
+			CU_FailureRecord* failures = CU_get_failure_list();
+			while(failures)
+			{
+				if(strcmp(failures->pSuite->pName, s->pName) == 0 &&
+				   strcmp(failures->pTest->pName, t->pName) == 0)
+				{
+					pass = 0;
+					failures = 0;
+				}
+				else
+				{
+					failures = failures->pNext;
+				}
+			}
+
+			if(pass)
+				printf("ok %d - %s:%s\n", count, s->pName, t->pName);
+			else 
+				printf("not ok %d - %s:%s\n", count, s->pName, t->pName);
+
+			count++;
+			t = t->pNext;
+		}
+		s = s->pNext;
+	}
+
+   CU_cleanup_registry();
+   return CU_get_error();
+
+}
diff --git a/nfapi/open-nFAPI/nfapi/Makefile.am b/nfapi/open-nFAPI/nfapi/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..853ee9ff80a35529fac8a3e4937c6707512f32c5
--- /dev/null
+++ b/nfapi/open-nFAPI/nfapi/Makefile.am
@@ -0,0 +1,30 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+AUTOMAKE_OPTIONS=subdir-objects
+AM_CPPFLAGS = -I$(top_srcdir)/nfapi/inc -I$(top_srcdir)/nfapi/public_inc  -I$(top_srcdir)/common/public_inc -I$(top_srcdir)/pnf/public_inc  $(BOOST_CPPFLAGS) -Wall -Werror -g
+
+noinst_LIBRARIES = libnfapi.a
+
+libnfapi_a_SOURCES = src/nfapi.c  src/nfapi_p5.c  src/nfapi_p7.c src/nfapi_p4.c
+libnfapi_a_CFLAGS =$(AM_CFLAGS)
+
+lib_LTLIBRARIES = libnfapi.la
+libnfapi_la_SOURCES =  src/nfapi.c  src/nfapi_p5.c  src/nfapi_p7.c src/nfapi_p4.c
+
+
+LDADD= ../pnf/src/libnfapi_pnf.a ../vnf/src/libnfapi_vnf.a ../common/bin/libnfapi_common.a 
+
diff --git a/nfapi/open-nFAPI/nfapi/inc/nfapi.h b/nfapi/open-nFAPI/nfapi/inc/nfapi.h
new file mode 100644
index 0000000000000000000000000000000000000000..65ad4dd1609653c85b67dd777f2491859de4ab63
--- /dev/null
+++ b/nfapi/open-nFAPI/nfapi/inc/nfapi.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef _NFAPI_H_
+#define _NFAPI_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+// todo : move to public_inc so can be used by vendor extensions
+
+#define MAX_BAD_TAG 3
+
+uint8_t push8(uint8_t in, uint8_t **out, uint8_t *end);
+uint8_t pushs8(int8_t in, uint8_t **out, uint8_t *end);
+uint8_t push16(uint16_t in, uint8_t **out, uint8_t *end);
+uint8_t pushs16(int16_t in, uint8_t **out, uint8_t *end);
+uint8_t push32(uint32_t in, uint8_t **out, uint8_t *end);
+uint8_t pushs32(int32_t in, uint8_t **out, uint8_t *end);
+
+uint8_t pull8(uint8_t **in, uint8_t *out, uint8_t *end);
+uint8_t pulls8(uint8_t **in, int8_t *out, uint8_t *end);
+uint8_t pull16(uint8_t **in, uint16_t *out, uint8_t *end);
+uint8_t pulls16(uint8_t **in, int16_t *out, uint8_t *end);
+uint8_t pull32(uint8_t **in, uint32_t *out, uint8_t *end);
+uint8_t pulls32(uint8_t **in, int32_t *out, uint8_t *end);
+
+
+uint32_t pullarray8(uint8_t **in, uint8_t out[], uint32_t max_len, uint32_t len, uint8_t *end);
+uint32_t pullarray16(uint8_t **in, uint16_t out[], uint32_t max_len, uint32_t len, uint8_t *end);
+uint32_t pullarrays16(uint8_t **in, int16_t out[], uint32_t max_len, uint32_t len, uint8_t *end);
+
+uint32_t pusharray8(uint8_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end);
+uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end);
+uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end);
+
+typedef uint8_t (*pack_array_elem_fn)(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end);
+uint8_t packarray(void* array, uint16_t elem_size, uint16_t max_count, uint16_t count, uint8_t **ppWritePackedMsg, uint8_t *end, pack_array_elem_fn fn);
+
+typedef uint8_t (*unpack_array_elem_fn)(void* elem, uint8_t **ppReadPackedMsg, uint8_t *end);
+uint8_t unpackarray(uint8_t **ppReadPackedMsg, void* array, uint16_t elem_size, uint16_t max_count, uint16_t count, uint8_t *end, unpack_array_elem_fn fn);
+
+uint8_t pack_tl(nfapi_tl_t *tl, uint8_t **ppWritePackedMsg, uint8_t *end);
+uint8_t unpack_tl(uint8_t **ppReadPackedMsg, nfapi_tl_t *tl, uint8_t *end);
+
+typedef uint8_t (*pack_tlv_fn)(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end);
+uint8_t pack_tlv(uint16_t tag, void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end, pack_tlv_fn fn);
+
+uint32_t pack_vendor_extension_tlv(nfapi_tl_t* ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config);
+int unpack_vendor_extension(nfapi_tl_t* tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config, nfapi_tl_t** ve_tlv);
+
+typedef uint8_t (*unpack_tlv_fn)(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end);
+typedef struct
+{
+	uint16_t tag;
+	void* tlv;
+	unpack_tlv_fn unpack_func;
+} unpack_tlv_t;
+
+int unpack_tlv_list(unpack_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t* packedMsgEnd, nfapi_p4_p5_codec_config_t* config, nfapi_tl_t** ve);
+
+uint32_t pack_p7_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config);
+typedef uint8_t (*unpack_p7_tlv_fn)(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t*);
+typedef struct
+{
+	uint16_t tag;
+	void* tlv;
+	unpack_p7_tlv_fn unpack_func;
+} unpack_p7_tlv_t;
+int unpack_p7_tlv_list(unpack_p7_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t* packedMsgEnd, nfapi_p7_codec_config_t* config, nfapi_tl_t** ve);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* _NFAPI_H_ */
diff --git a/nfapi/nfapi_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
similarity index 99%
rename from nfapi/nfapi_interface.h
rename to nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
index 45af99a50f3384725c167e93c064d7dc952fc2be..f665d11c8916f2ce82cea65080f3fad005284e4c 100644
--- a/nfapi/nfapi_interface.h
+++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
@@ -34,7 +34,7 @@
 #define NFAPI_MAX_NUM_ANTENNAS 8
 #define NFAPI_MAX_NUM_SUBBANDS 13
 #define NFAPI_MAX_BF_VECTORS 8
-#define NFAPI_MAX_CC 2
+#define NFAPI_MAX_CC 1
 #define NFAPI_MAX_NUM_PHYSICAL_ANTENNAS 8
 #define NFAPI_MAX_RSSI 8
 #define NFAPI_MAX_PSC_LIST 32
@@ -1689,7 +1689,7 @@ typedef struct {
 	uint16_t number_pdu;
 	uint8_t number_pdsch_rnti;
 	uint16_t transmission_power_pcfich;
-        nfapi_dl_config_request_pdu_t* dl_config_pdu_list;
+	nfapi_dl_config_request_pdu_t* dl_config_pdu_list;
 } nfapi_dl_config_request_body_t;
 #define NFAPI_DL_CONFIG_REQUEST_BODY_TAG 0x2000
 
@@ -1962,7 +1962,7 @@ typedef struct {
 } nfapi_ul_config_harq_information_rel8_fdd_t;
 #define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG 0x2019
 
-typedef struct {  
+typedef struct { 
 	nfapi_tl_t tl;
 	uint8_t harq_size;
 	uint8_t ack_nack_mode;
diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi.c b/nfapi/open-nFAPI/nfapi/src/nfapi.c
new file mode 100644
index 0000000000000000000000000000000000000000..3f017bc9a4a53b1fc40d939c308b78642cce2cca
--- /dev/null
+++ b/nfapi/open-nFAPI/nfapi/src/nfapi.c
@@ -0,0 +1,860 @@
+/*
+ * Copyright (c) 2001-2016, Cisco Systems, Inc.
+ * All rights reserved.
+ *  
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 
+ * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *  
+ * Neither the name of the Cisco Systems, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sched.h>
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <pthread.h>
+
+#include <nfapi_interface.h>
+#include <nfapi.h>
+#include <debug.h>
+
+
+// Fundamental routines
+
+uint8_t push8(uint8_t in, uint8_t **out, uint8_t *end)
+{
+	uint8_t *pOut = *out;
+
+	if((end - pOut) >= 1)
+	{
+		pOut[0] = in;
+
+		(*out)+=1;
+
+		return 1;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+
+}
+
+uint8_t pushs8(int8_t in, uint8_t **out, uint8_t *end)
+{
+	uint8_t *pOut = *out;
+
+	if((end - pOut) >= 1)
+	{
+		pOut[0] = in;
+
+		(*out)+=1;
+
+		return 1;
+	}
+	else 
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t push16(uint16_t in, uint8_t **out, uint8_t *end)
+{
+	uint8_t *pOut = *out;
+	
+	if((end - pOut) >= 2)
+	{
+		pOut[0] = (in & 0xFF00) >> 8;
+		pOut[1] = (in & 0xFF);
+
+		(*out)+=2;
+
+		return 2;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t pushs16(int16_t in, uint8_t **out, uint8_t *end)
+{
+	uint8_t *pOut = *out;
+
+	if((end - pOut) >= 2)
+	{
+		pOut[0] = (in & 0xFF00) >> 8;
+		pOut[1] = (in & 0xFF);
+
+		(*out)+=2;
+
+		return 2;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t push32(uint32_t in, uint8_t **out, uint8_t *end)
+{
+	uint8_t *pOut = *out;
+	if((end - pOut) >= 4)
+	{
+		pOut[0] = (in & 0xFF000000) >> 24;
+		pOut[1] = (in & 0xFF0000) >> 16;
+		pOut[2] = (in & 0xFF00) >> 8;
+		pOut[3] = (in & 0xFF);
+
+		(*out)+=4;
+
+		return 4;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t pushs32(int32_t in, uint8_t **out, uint8_t *end)
+{
+	uint8_t *pOut = *out;
+
+	if((end - pOut) >= 4)
+	{
+		pOut[0] = (in & 0xFF000000) >> 24;
+		pOut[1] = (in & 0xFF0000) >> 16;
+		pOut[2] = (in & 0xFF00) >> 8;
+		pOut[3] = (in & 0xFF);
+
+		(*out)+=4;
+
+		return 4;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t pull8(uint8_t **in, uint8_t *out, uint8_t *end)
+{
+	uint8_t *pIn = *in;
+
+	if((end - pIn) >= 1 )
+	{
+		*out = *pIn;
+
+		(*in)+=1;
+
+		return 1;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t pulls8(uint8_t **in, int8_t *out, uint8_t *end)
+{
+	uint8_t *pIn = *in;
+
+	if((end - pIn) >= 1 )
+	{
+		*out = *pIn;
+
+		(*in)+=1;
+
+		return 1;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t pull16(uint8_t **in, uint16_t *out, uint8_t *end)
+{
+	uint8_t *pIn = *in;
+
+	if((end - pIn) >=2 )
+	{
+		*out = ((pIn[0]) << 8) | pIn[1];
+		(*in)+=2;
+
+		return 2;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t pulls16(uint8_t **in, int16_t *out, uint8_t *end)
+{
+	uint8_t *pIn = *in;
+
+	if((end - pIn) >=2 )
+	{
+		*out = ((pIn[0]) << 8) | pIn[1];
+
+		(*in)+=2;
+
+		return 2;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t pull32(uint8_t **in, uint32_t *out, uint8_t *end)
+{
+	uint8_t *pIn = *in;
+
+	if((end - pIn) >=4 )
+	{
+		*out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
+
+		(*in)+=4;
+
+		return 4;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n",  __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t pulls32(uint8_t **in, int32_t *out, uint8_t *end)
+{
+	uint8_t *pIn = *in;
+
+	if((end - pIn) >=4 )
+	{
+		*out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
+
+		(*in)+=4;
+
+		return 4;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+/*
+inline void pusharray16(uint8_t **, uint16_t, uint32_t len)
+{
+}
+*/
+
+uint32_t pullarray16(uint8_t **in, uint16_t out[], uint32_t max_len, uint32_t len, uint8_t *end)
+{
+	if(len == 0)
+		return 1;
+
+	if(len > max_len)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+		return 0;
+	}
+
+	if((end - (*in)) >= sizeof(uint16_t) * len)
+	{
+		uint32_t idx;
+		for(idx = 0; idx < len; ++idx)
+		{
+			if(!pull16(in, &out[idx], end))
+				return 0;
+		}
+
+		return sizeof(uint16_t) * len;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint32_t pullarrays16(uint8_t **in, int16_t out[], uint32_t max_len, uint32_t len, uint8_t *end)
+{
+	if(len == 0)
+		return 1;
+
+	if(len > max_len)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+		return 0;
+	}
+
+	if((end - (*in)) >= sizeof(uint16_t) * len)
+	{
+		uint32_t idx;
+		for(idx = 0; idx < len; ++idx)
+		{
+			if(!pulls16(in, &out[idx], end))
+			return 0;
+		}
+
+		return sizeof(uint16_t) * len;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end)
+{
+	if(len == 0)
+		return 1;
+
+	if(len > max_len)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+		return 0;
+	}
+
+	if((end - (*out)) >= sizeof(uint16_t) * len)
+	{
+		uint32_t idx;
+		for(idx = 0; idx < len; ++idx)
+		{
+			if(!push16(in[idx], out, end))
+				return 0;
+		}
+		return sizeof(uint16_t) * len;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end)
+{
+	if(len == 0)
+		return 1;
+
+	if(len > max_len)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+		return 0;
+	}
+
+	if((end - (*out)) >= sizeof(uint16_t) * len)
+	{
+		uint32_t idx;
+		for(idx = 0; idx < len; ++idx)
+		{
+			pushs16(in[idx], out, end);
+		}
+		return sizeof(uint16_t) * len;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint32_t pullarray8(uint8_t **in, uint8_t out[], uint32_t max_len, uint32_t len, uint8_t *end)
+{
+	if(len == 0)
+		return 1;
+
+	if(len > max_len)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+		return 0;
+	}
+
+	if((end - out) >= sizeof(uint8_t) * len)
+	{
+		memcpy(out, (*in), len);
+		(*in)+=len;
+
+		return sizeof(uint8_t) * len;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint32_t pusharray8(uint8_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end)
+{
+	if(len == 0)
+		return 1;
+
+	if(len > max_len)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+		return 0;
+	}
+
+	if((end - (*out)) >= sizeof(uint8_t) * len)
+	{
+		memcpy((*out), in, len);
+		(*out)+=len;
+
+		return sizeof(uint8_t) * len;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+		return 0;
+	}
+}
+
+uint8_t packarray(void* array, uint16_t array_element_size, uint16_t max_count, uint16_t count, uint8_t **ppwritepackedmsg, uint8_t *end, pack_array_elem_fn fn)
+{
+	if(count > max_count)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, count, max_count);
+		return 0;
+	}
+
+	uint16_t i = 0;
+	for(i = 0; i < count; ++i)
+	{
+		if((fn)(array, ppwritepackedmsg, end) == 0)
+			return 0;
+
+		array += array_element_size;
+	}
+
+	return 1;
+}
+
+uint8_t unpackarray(uint8_t **ppReadPackedMsg, void* array, uint16_t array_element_size, uint16_t max_count, uint16_t count, uint8_t *end, unpack_array_elem_fn fn)
+{
+	if(count > max_count)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, count, max_count);
+		return 0;
+	}
+
+	uint16_t i = 0;
+	for(i = 0; i < count; ++i)
+	{
+		if((fn)(array, ppReadPackedMsg, end) == 0)
+			return 0;
+
+		array += array_element_size;
+	}
+
+	return 1;
+}
+
+
+uint32_t pack_vendor_extension_tlv(nfapi_tl_t* ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	if(ve != 0 && config != 0)
+	{
+		if(config->pack_vendor_extension_tlv)
+		{
+
+			uint8_t* pStartOfTlv = *ppWritePackedMsg;
+			if(pack_tl(ve, ppWritePackedMsg, end) == 0)
+				return 0;
+
+			uint8_t* pStartOfValue = *ppWritePackedMsg;
+			if((config->pack_vendor_extension_tlv)(ve, ppWritePackedMsg, end, config) == 0)
+				return 0;
+
+			ve->length = (*ppWritePackedMsg) - pStartOfValue;
+
+			pack_tl(ve, &pStartOfTlv, end);
+
+			return 1;
+
+		}
+	}
+	return 1;
+}
+
+uint32_t unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config, nfapi_tl_t** ve_tlv)
+{
+	if(ve_tlv != 0 && config != 0)
+	{
+		if(config->unpack_vendor_extension_tlv)
+		{
+			return (config->unpack_vendor_extension_tlv)(tl, ppReadPackedMsg, end, (void**)ve_tlv, config);
+		}
+	}
+	return 1;
+}
+
+uint32_t pack_p7_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end ,nfapi_p7_codec_config_t* config)
+{
+	if(ve != 0 && config != 0)
+	{
+		if(config->pack_vendor_extension_tlv)
+		{
+			uint8_t* pStartOfTlv = *ppWritePackedMsg;
+			if(pack_tl(ve, ppWritePackedMsg, end) == 0)
+				return 0;
+
+			uint8_t* pStartOfValue = *ppWritePackedMsg;
+			if((config->pack_vendor_extension_tlv)(ve, ppWritePackedMsg, end, config) == 0)
+				return 0;
+
+			ve->length = (*ppWritePackedMsg) - pStartOfValue;
+
+			pack_tl(ve, &pStartOfTlv, end);
+
+			return 1;
+			
+		}
+	}
+	return 1;
+}
+
+int unpack_p7_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config, nfapi_tl_t** ve_tlv)
+{
+	if(ve_tlv != 0 && config != 0)
+	{
+		if(config->unpack_vendor_extension_tlv)
+		{
+			return (config->unpack_vendor_extension_tlv)(tl, ppReadPackedMsg, end, (void**)ve_tlv, config);
+		}
+	}
+	return 1;
+}
+
+
+uint8_t pack_tl(nfapi_tl_t *tl, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return (push16(tl->tag, ppWritePackedMsg, end) &&
+			push16(tl->length, ppWritePackedMsg, end));
+}
+
+uint8_t unpack_tl(uint8_t **ppReadPackedMsg, nfapi_tl_t *tl, uint8_t *end)
+{
+	return (pull16(ppReadPackedMsg, &tl->tag, end) &&
+			pull16(ppReadPackedMsg, &tl->length, end));
+}
+
+int unpack_tlv_list(unpack_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t* end, nfapi_p4_p5_codec_config_t* config, nfapi_tl_t** ve)
+{
+	nfapi_tl_t generic_tl;
+	uint8_t numBadTags = 0;
+	uint16_t idx = 0;
+
+	while ((uint8_t*)(*ppReadPackedMsg) < end)
+	{
+		// unpack the tl and process the values accordingly
+		if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
+			return 0;
+
+		uint8_t tagMatch = 0;
+
+		uint8_t* pStartOfValue = *ppReadPackedMsg;
+
+		for(idx = 0; idx < size; ++idx)
+		{
+			if(unpack_fns[idx].tag == generic_tl.tag)
+			{
+				tagMatch = 1;
+				nfapi_tl_t* tl = (nfapi_tl_t*)(unpack_fns[idx].tlv);
+				tl->tag = generic_tl.tag;
+				tl->length = generic_tl.length;
+
+				int result = (*unpack_fns[idx].unpack_func)(tl, ppReadPackedMsg, end);
+
+				if(result == 0)
+				{
+					return 0;
+				}
+
+				// check if the length was right;
+				if(tl->length != (*ppReadPackedMsg - pStartOfValue))
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning tlv tag 0x%x length %d not equal to unpack %d\n", tl->tag, tl->length, (*ppReadPackedMsg - pStartOfValue));
+				}
+			}
+		}
+
+		if(tagMatch == 0)
+		{
+
+			if(generic_tl.tag >= NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE && 
+			   generic_tl.tag <= NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE)
+			{
+				int result = unpack_vendor_extension_tlv(&generic_tl, ppReadPackedMsg, end, config, ve);
+				if(result == 0)
+				{
+					// got tot the end.
+					return 0;
+				}
+				else if(result < 0)
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown VE TAG value: 0x%04x\n", generic_tl.tag);
+
+					if (++numBadTags > MAX_BAD_TAG)
+					{
+						NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
+						return 0;
+					}
+
+					if((end - *ppReadPackedMsg) >= generic_tl.length)
+					{
+						// Advance past the unknown TLV
+						(*ppReadPackedMsg) += generic_tl.length;
+					}
+					else
+					{
+						// go to the end
+						return 0;
+					}
+				}
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag);
+
+				if (++numBadTags > MAX_BAD_TAG)
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
+					return 0;
+				}
+
+				if((end - *ppReadPackedMsg) >= generic_tl.length)
+				{
+					// Advance past the unknown TLV
+					(*ppReadPackedMsg) += generic_tl.length;
+				}
+				else
+				{
+					// go to the end
+					return 0;
+				}
+			}
+
+		}
+	}
+
+	return 1;
+}
+int unpack_p7_tlv_list(unpack_p7_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t* end, nfapi_p7_codec_config_t* config, nfapi_tl_t** ve)
+{
+	nfapi_tl_t generic_tl;
+	uint8_t numBadTags = 0;
+	uint16_t idx = 0;
+
+	while ((uint8_t*)(*ppReadPackedMsg) < end)
+	{
+		// unpack the tl and process the values accordingly
+		if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
+			return 0;
+
+		uint8_t tagMatch = 0;
+
+		uint8_t* pStartOfValue = *ppReadPackedMsg;
+
+		for(idx = 0; idx < size; ++idx)
+		{
+			if(unpack_fns[idx].tag == generic_tl.tag)
+			{
+				tagMatch = 1;
+				nfapi_tl_t* tl = (nfapi_tl_t*)(unpack_fns[idx].tlv);
+				tl->tag = generic_tl.tag;
+				tl->length = generic_tl.length;
+
+				int result = (*unpack_fns[idx].unpack_func)(tl, ppReadPackedMsg, end , config);
+
+				if(result == 0)
+				{
+					return  0;
+				}
+
+				// check if the length was right;
+				if(tl->length != (*ppReadPackedMsg - pStartOfValue))
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning tlv tag 0x%x length %d not equal to unpack %d\n", tl->tag, tl->length, (*ppReadPackedMsg - pStartOfValue));
+				}
+			}
+		}
+
+		if(tagMatch == 0)
+		{
+
+			if(generic_tl.tag >= NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE && 
+			   generic_tl.tag <= NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE)
+			{
+				int result = unpack_p7_vendor_extension_tlv(&generic_tl, ppReadPackedMsg, end, config, ve);
+				if(result == 0)
+				{
+					// got to end
+					return 0;
+				}
+				else if(result < 0)
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag);
+
+					if (++numBadTags > MAX_BAD_TAG)
+					{
+						NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
+						return -1;
+					}
+
+					if((end - *ppReadPackedMsg) >= generic_tl.length)
+					{
+						// Advance past the unknown TLV
+						(*ppReadPackedMsg) += generic_tl.length;
+					}
+					else
+					{
+						// got ot the dn
+						return 0;
+					}
+				}
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag);
+
+				if (++numBadTags > MAX_BAD_TAG)
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
+					return -1;
+				}
+
+				if((end - *ppReadPackedMsg) >= generic_tl.length)
+				{
+					// Advance past the unknown TLV
+					(*ppReadPackedMsg) += generic_tl.length;
+				}
+				else
+				{
+					// got ot the dn
+					return 0;
+				}
+
+			}
+
+		}
+	}
+
+	return 1;
+}
+
+// This intermediate function deals with calculating the length of the value
+// and writing into the tlv header.
+uint8_t pack_tlv(uint16_t tag, void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end, pack_tlv_fn fn)
+{
+	nfapi_tl_t* tl = (nfapi_tl_t*)tlv;
+
+	// If the tag is defined
+	if(tl->tag == tag)
+	{
+		uint8_t* pStartOfTlv = *ppWritePackedMsg;
+
+		// write a dumy tlv header
+		if(pack_tl(tl, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		// Record the start of the value
+		uint8_t* pStartOfValue = *ppWritePackedMsg;
+
+		// pack the tlv value
+		if(fn(tlv, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		// calculate the length of the value and rewrite the tl header
+		tl->length = (*ppWritePackedMsg) - pStartOfValue;
+
+		// rewrite the header with the correct length
+		pack_tl(tl, &pStartOfTlv, end);
+	}
+	else
+	{
+		if(tl->tag != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_WARN, "Warning pack_tlv tag 0x%x does not match expected 0x%x\n", tl->tag, tag);
+		}
+                else
+                {
+			//NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning pack_tlv tag 0x%x ZERO does not match expected 0x%x\n", tl->tag, tag);
+                }
+	}
+
+	return 1;
+}
+
+const char* nfapi_error_code_to_str(nfapi_error_code_e value)
+{
+	switch(value)
+	{
+		case NFAPI_MSG_OK:
+			return "NFAPI_MSG_OK";
+		case NFAPI_MSG_INVALID_STATE:
+			return "NFAPI_MSG_INVALID_STATE";
+		case NFAPI_MSG_INVALID_CONFIG:
+			return "NFAPI_MSG_INVALID_CONFIG";
+		case NFAPI_SFN_OUT_OF_SYNC:
+			return "NFAPI_SFN_OUT_OF_SYNC";
+		case NFAPI_MSG_SUBFRAME_ERR:
+			return "NFAPI_MSG_SUBFRAME_ERR";
+		case NFAPI_MSG_BCH_MISSING:
+			return "NFAPI_MSG_BCH_MISSING";
+		case NFAPI_MSG_INVALID_SFN:
+			return "NFAPI_MSG_INVALID_SFN";
+		case NFAPI_MSG_HI_ERR:
+			return "NFAPI_MSG_HI_ERR";
+		case NFAPI_MSG_TX_ERR:
+			return "NFAPI_MSG_TX_ERR";
+		default:
+			return "UNKNOWN";
+	}
+}
diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p4.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p4.c
new file mode 100644
index 0000000000000000000000000000000000000000..1eb85e6254b0c7ee9a23e0d642cb0dbf67122c74
--- /dev/null
+++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p4.c
@@ -0,0 +1,2084 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <arpa/inet.h> // need for uintptr_t?
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <nfapi_interface.h>
+#include <nfapi.h>
+#include <debug.h>
+
+static uint32_t get_packed_msg_len(uintptr_t msgHead, uintptr_t msgEnd)
+{
+	if (msgEnd < msgHead)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "get_packed_msg_len: Error in pointers supplied %d, %d\n", msgHead, msgEnd);
+		return 0;
+	}
+
+	return (msgEnd - msgHead);
+}
+
+static uint8_t pack_opaque_data_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_opaqaue_data_t* value = (nfapi_opaqaue_data_t*)tlv;
+	return pusharray8(value->value, NFAPI_MAX_OPAQUE_DATA, value->length, ppWritePackedMsg, end);
+}
+
+static uint8_t unpack_opaque_data_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_opaqaue_data_t* value = (nfapi_opaqaue_data_t*)tlv;
+	value->length = value->tl.length;
+	if(value->length <= NFAPI_MAX_OPAQUE_DATA)
+	{
+		if(!pullarray8(ppReadPackedMsg, value->value, NFAPI_MAX_OPAQUE_DATA, value->length, end))
+			return 0;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Opaque date to long %d \n", value->length);
+		return 0;
+	}
+
+	return 1;
+
+}
+
+static uint8_t pack_lte_rssi_request_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lte_rssi_request_t* value = (nfapi_lte_rssi_request_t*)tlv;
+
+	return (push8(value->frequency_band_indicator, ppWritePackedMsg, end) &&
+			push16(value->measurement_period, ppWritePackedMsg, end) &&
+			push8(value->bandwidth, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end) &&
+			push8(value->number_of_earfcns, ppWritePackedMsg, end) &&
+			pusharray16(value->earfcn, NFAPI_MAX_CARRIER_LIST, value->number_of_earfcns, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_utran_rssi_request_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_utran_rssi_request_t* value = (nfapi_utran_rssi_request_t*)tlv;
+
+	return (push8(value->frequency_band_indicator, ppWritePackedMsg, end) &&
+			push16(value->measurement_period, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end) &&
+			push8(value->number_of_uarfcns, ppWritePackedMsg, end) &&
+			pusharray16(value->uarfcn, NFAPI_MAX_CARRIER_LIST, value->number_of_uarfcns, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_geran_rssi_request_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_geran_rssi_request_t* value = (nfapi_geran_rssi_request_t*)tlv;
+	uint16_t idx = 0;
+
+	if(!(push8(value->frequency_band_indicator, ppWritePackedMsg, end) &&
+		 push16(value->measurement_period, ppWritePackedMsg, end) &&
+		 push32(value->timeout, ppWritePackedMsg, end) &&
+		 push8(value->number_of_arfcns, ppWritePackedMsg, end)))
+		return 0;
+
+	for(;idx < value->number_of_arfcns; ++idx)
+	{
+		if(!(push16(value->arfcn[idx].arfcn, ppWritePackedMsg, end) &&
+			push8(value->arfcn[idx].direction, ppWritePackedMsg, end)))
+			return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t pack_nb_iot_rssi_request_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_rssi_request_t* value = (nfapi_nb_iot_rssi_request_t*)tlv;
+	uint16_t idx = 0;
+
+	if(!(push8(value->frequency_band_indicator, ppWritePackedMsg, end) &&
+		 push16(value->measurement_period, ppWritePackedMsg, end) &&
+		 push32(value->timeout, ppWritePackedMsg, end) &&
+		 push8(value->number_of_earfcns, ppWritePackedMsg, end)))
+		return 0;
+
+	for(;idx < value->number_of_earfcns; ++idx)
+	{
+		if(!(push16(value->earfcn[idx].earfcn, ppWritePackedMsg, end) &&
+			 push8(value->earfcn[idx].number_of_ro_dl, ppWritePackedMsg, end)))
+			return 0;
+			
+		uint8_t ro_dl_idx = 0;
+		for(ro_dl_idx = 0; ro_dl_idx < value->earfcn[idx].number_of_ro_dl; ++ro_dl_idx)
+		{
+			if(!push8(value->earfcn[idx].ro_dl[ro_dl_idx], ppWritePackedMsg, end))
+				return 0;
+		}
+	}
+
+	return 1;
+}
+
+
+
+static uint8_t pack_rssi_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_rssi_request_t *pNfapiMsg = (nfapi_rssi_request_t*)msg;
+
+	if(push8(pNfapiMsg->rat_type, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	switch(pNfapiMsg->rat_type)
+	{
+		case NFAPI_RAT_TYPE_LTE:
+			if(pack_tlv(NFAPI_LTE_RSSI_REQUEST_TAG, &pNfapiMsg->lte_rssi_request, ppWritePackedMsg, end, &pack_lte_rssi_request_value) == 0)
+				return 0;
+			break;
+		case NFAPI_RAT_TYPE_UTRAN:
+			if(pack_tlv(NFAPI_UTRAN_RSSI_REQUEST_TAG, &pNfapiMsg->utran_rssi_request, ppWritePackedMsg, end, &pack_utran_rssi_request_value) == 0)
+				return 0;
+			break;
+		case NFAPI_RAT_TYPE_GERAN:
+			if(pack_tlv(NFAPI_GERAN_RSSI_REQUEST_TAG, &pNfapiMsg->geran_rssi_request, ppWritePackedMsg, end, &pack_geran_rssi_request_value) == 0)
+				return 0;
+			break;
+		case NFAPI_RAT_TYPE_NB_IOT:
+			if(pack_tlv(NFAPI_NB_IOT_RSSI_REQUEST_TAG, &pNfapiMsg->nb_iot_rssi_request, ppWritePackedMsg, end, &pack_nb_iot_rssi_request_value) == 0)
+				return 0;
+			break;
+	}
+
+	return pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
+}
+
+static uint8_t pack_rssi_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_rssi_response_t *pNfapiMsg = (nfapi_rssi_response_t*)msg;
+	
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_rssi_indication_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_rssi_indication_body_t* value = (nfapi_rssi_indication_body_t*)tlv;
+
+	return (push16(value->number_of_rssi, ppWritePackedMsg, end) &&
+			pusharrays16(value->rssi, NFAPI_MAX_RSSI, value->number_of_rssi, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_rssi_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_rssi_indication_t *pNfapiMsg = (nfapi_rssi_indication_t*)msg;
+
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_tlv(NFAPI_RSSI_INDICATION_TAG, &pNfapiMsg->rssi_indication_body, ppWritePackedMsg, end, &pack_rssi_indication_body_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+
+static uint8_t pack_lte_cell_search_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lte_cell_search_request_t* value = (nfapi_lte_cell_search_request_t*)msg;
+
+	return (push16(value->earfcn, ppWritePackedMsg, end) &&
+			push8(value->measurement_bandwidth,  ppWritePackedMsg, end) &&
+			push8(value->exhaustive_search, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end) &&
+			push8(value->number_of_pci, ppWritePackedMsg, end) &&
+			pusharray16(value->pci, NFAPI_MAX_PCI_LIST, value->number_of_pci, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_utran_cell_search_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_utran_cell_search_request_t* value = (nfapi_utran_cell_search_request_t*)msg;
+
+	return (push16(value->uarfcn, ppWritePackedMsg, end) &&
+			push8(value->exhaustive_search, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end) &&
+			push8(value->number_of_psc, ppWritePackedMsg, end) &&
+			pusharray16(value->psc, NFAPI_MAX_PSC_LIST, value->number_of_psc, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_geran_cell_search_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_geran_cell_search_request_t* value = (nfapi_geran_cell_search_request_t*)msg;
+
+	return (push32(value->timeout, ppWritePackedMsg, end) &&
+			push8(value->number_of_arfcn, ppWritePackedMsg, end) &&
+			pusharray16(value->arfcn, NFAPI_MAX_ARFCN_LIST, value->number_of_arfcn, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_nb_iot_cell_search_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_cell_search_request_t* value = (nfapi_nb_iot_cell_search_request_t*)msg;
+
+	return (push16(value->earfcn, ppWritePackedMsg, end) &&
+			push8(value->ro_dl, ppWritePackedMsg, end) &&
+			push8(value->exhaustive_search, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end) &&
+			push8(value->number_of_pci, ppWritePackedMsg, end) &&
+			pusharray16(value->pci, NFAPI_MAX_PCI_LIST, value->number_of_pci, ppWritePackedMsg, end));
+}
+
+
+static uint8_t pack_cell_search_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_cell_search_request_t *pNfapiMsg = (nfapi_cell_search_request_t*)msg;
+
+	if(push8(pNfapiMsg->rat_type, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	switch(pNfapiMsg->rat_type)
+	{
+		case NFAPI_RAT_TYPE_LTE:
+			{
+				if(pack_tlv(NFAPI_LTE_CELL_SEARCH_REQUEST_TAG, &pNfapiMsg->lte_cell_search_request, ppWritePackedMsg, end, &pack_lte_cell_search_request_value) == 0)
+					return 0;
+			}
+			break;
+		case NFAPI_RAT_TYPE_UTRAN:
+			{
+				if(pack_tlv(NFAPI_UTRAN_CELL_SEARCH_REQUEST_TAG, &pNfapiMsg->utran_cell_search_request, ppWritePackedMsg, end, &pack_utran_cell_search_request_value) == 0)
+					return 0;
+			}
+			break;
+		case NFAPI_RAT_TYPE_GERAN:
+			{
+				if(pack_tlv(NFAPI_GERAN_CELL_SEARCH_REQUEST_TAG, &pNfapiMsg->geran_cell_search_request, ppWritePackedMsg, end, &pack_geran_cell_search_request_value) == 0)
+					return 0;
+			}
+			break;
+		case NFAPI_RAT_TYPE_NB_IOT:
+			{
+				if(pack_tlv(NFAPI_NB_IOT_CELL_SEARCH_REQUEST_TAG, &pNfapiMsg->nb_iot_cell_search_request, ppWritePackedMsg, end, &pack_nb_iot_cell_search_request_value) == 0)
+					return 0;
+			}
+			break;
+	};
+	
+	return (pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_cell_search_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_cell_search_response_t *pNfapiMsg = (nfapi_cell_search_response_t*)msg;
+	
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_lte_cell_search_indication_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lte_cell_search_indication_t* value = (nfapi_lte_cell_search_indication_t*)msg;
+	uint16_t idx = 0;
+
+	if(push16(value->number_of_lte_cells_found, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	for(idx = 0; idx < value->number_of_lte_cells_found; ++idx)
+	{
+		if(!(push16(value->lte_found_cells[idx].pci, ppWritePackedMsg, end) &&
+			 push8(value->lte_found_cells[idx].rsrp, ppWritePackedMsg, end) &&
+			 push8(value->lte_found_cells[idx].rsrq, ppWritePackedMsg, end) &&
+			 pushs16(value->lte_found_cells[idx].frequency_offset, ppWritePackedMsg, end)))
+			return 0;
+	}
+	return 1;
+}
+
+static uint8_t pack_utran_cell_search_indication_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_utran_cell_search_indication_t* value = (nfapi_utran_cell_search_indication_t*)msg;
+	uint16_t idx = 0;
+
+	if(push16(value->number_of_utran_cells_found, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	for(idx = 0; idx < value->number_of_utran_cells_found; ++idx)
+	{
+		if(!(push16(value->utran_found_cells[idx].psc, ppWritePackedMsg, end) &&
+			 push8(value->utran_found_cells[idx].rscp, ppWritePackedMsg, end) &&
+			 push8(value->utran_found_cells[idx].ecno, ppWritePackedMsg, end) &&
+			 pushs16(value->utran_found_cells[idx].frequency_offset, ppWritePackedMsg, end)))
+			return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t pack_geran_cell_search_indication_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_geran_cell_search_indication_t* value = (nfapi_geran_cell_search_indication_t*)msg;
+	uint16_t idx = 0;
+
+	if(push16(value->number_of_gsm_cells_found, ppWritePackedMsg, end) == 0)
+		return 0;
+ 
+	for(idx = 0; idx < value->number_of_gsm_cells_found; ++idx)
+	{
+		if(!(push16(value->gsm_found_cells[idx].arfcn, ppWritePackedMsg, end) &&
+			 push8(value->gsm_found_cells[idx].bsic, ppWritePackedMsg, end) &&
+			 push8(value->gsm_found_cells[idx].rxlev, ppWritePackedMsg, end) &&
+			 push8(value->gsm_found_cells[idx].rxqual, ppWritePackedMsg, end) &&
+			 pushs16(value->gsm_found_cells[idx].frequency_offset, ppWritePackedMsg, end) &&
+			 push32(value->gsm_found_cells[idx].sfn_offset, ppWritePackedMsg, end)))
+			return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t pack_nb_iot_cell_search_indication_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_cell_search_indication_t* value = (nfapi_nb_iot_cell_search_indication_t*)msg;
+	uint16_t idx = 0;
+
+	if(push16(value->number_of_nb_iot_cells_found, ppWritePackedMsg, end) == 0)
+		return 0;
+ 
+	for(idx = 0; idx < value->number_of_nb_iot_cells_found; ++idx)
+	{
+		if(!(push16(value->nb_iot_found_cells[idx].pci, ppWritePackedMsg, end) &&
+			 push8(value->nb_iot_found_cells[idx].rsrp, ppWritePackedMsg, end) &&
+			 push8(value->nb_iot_found_cells[idx].rsrq, ppWritePackedMsg, end) &&
+			 pushs16(value->nb_iot_found_cells[idx].frequency_offset, ppWritePackedMsg, end)))
+			return 0;
+	}
+
+	return 1;
+}
+static uint8_t pack_cell_search_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_cell_search_indication_t *pNfapiMsg = (nfapi_cell_search_indication_t*)msg;
+
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_tlv(NFAPI_LTE_CELL_SEARCH_INDICATION_TAG, &pNfapiMsg->lte_cell_search_indication, ppWritePackedMsg, end, &pack_lte_cell_search_indication_value) &&
+			pack_tlv(NFAPI_UTRAN_CELL_SEARCH_INDICATION_TAG, &pNfapiMsg->utran_cell_search_indication, ppWritePackedMsg, end, &pack_utran_cell_search_indication_value) &&
+			pack_tlv(NFAPI_GERAN_CELL_SEARCH_INDICATION_TAG, &pNfapiMsg->geran_cell_search_indication, ppWritePackedMsg, end, &pack_geran_cell_search_indication_value) &&
+			pack_tlv(NFAPI_PNF_CELL_SEARCH_STATE_TAG, &pNfapiMsg->pnf_cell_search_state, ppWritePackedMsg, end, &pack_opaque_data_value) &&
+			pack_tlv(NFAPI_NB_IOT_CELL_SEARCH_INDICATION_TAG, &pNfapiMsg->nb_iot_cell_search_indication, ppWritePackedMsg, end, &pack_nb_iot_cell_search_indication_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+
+}
+
+static uint8_t pack_lte_broadcast_detect_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lte_broadcast_detect_request_t* value = (nfapi_lte_broadcast_detect_request_t*)msg;
+
+	return (push16(value->earfcn, ppWritePackedMsg, end) &&
+			push16(value->pci, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_utran_broadcast_detect_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_utran_broadcast_detect_request_t* value = (nfapi_utran_broadcast_detect_request_t*)msg;
+
+	return (push16(value->uarfcn, ppWritePackedMsg, end) &&
+			push16(value->psc, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_nb_iot_broadcast_detect_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_broadcast_detect_request_t* value = (nfapi_nb_iot_broadcast_detect_request_t*)msg;
+
+	return (push16(value->earfcn, ppWritePackedMsg, end) &&
+			push8(value->ro_dl, ppWritePackedMsg, end) &&
+			push16(value->pci, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_broadcast_detect_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t * end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_broadcast_detect_request_t *pNfapiMsg = (nfapi_broadcast_detect_request_t*)msg;
+
+	if(push8(pNfapiMsg->rat_type, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	switch(pNfapiMsg->rat_type)
+	{
+		case NFAPI_RAT_TYPE_LTE:
+			if(pack_tlv(NFAPI_LTE_BROADCAST_DETECT_REQUEST_TAG, &pNfapiMsg->lte_broadcast_detect_request, ppWritePackedMsg, end ,&pack_lte_broadcast_detect_request_value) == 0)
+				return 0;
+			break;
+		case NFAPI_RAT_TYPE_UTRAN:
+			if(pack_tlv(NFAPI_UTRAN_BROADCAST_DETECT_REQUEST_TAG, &pNfapiMsg->utran_broadcast_detect_request, ppWritePackedMsg, end, &pack_utran_broadcast_detect_request_value) == 0)
+				return 0;
+			break;
+		case NFAPI_RAT_TYPE_NB_IOT:
+			if(pack_tlv(NFAPI_NB_IOT_BROADCAST_DETECT_REQUEST_TAG, &pNfapiMsg->nb_iot_broadcast_detect_request, ppWritePackedMsg, end, &pack_nb_iot_broadcast_detect_request_value) == 0)
+				return 0;
+			break;
+			
+	}
+
+	return (pack_tlv(NFAPI_PNF_CELL_SEARCH_STATE_TAG, &pNfapiMsg->pnf_cell_search_state, ppWritePackedMsg, end, &pack_opaque_data_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_broadcast_detect_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_broadcast_detect_response_t *pNfapiMsg = (nfapi_broadcast_detect_response_t*)msg;
+	
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_lte_broadcast_detect_indication_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lte_broadcast_detect_indication_t* value = (nfapi_lte_broadcast_detect_indication_t*)msg;
+
+	return (push8(value->number_of_tx_antenna, ppWritePackedMsg, end) &&
+			push16(value->mib_length, ppWritePackedMsg, end) &&
+			pusharray8(value->mib, NFAPI_MAX_MIB_LENGTH, value->mib_length, ppWritePackedMsg, end) &&
+			push32(value->sfn_offset, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_utran_broadcast_detect_indication_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_utran_broadcast_detect_indication_t* value = (nfapi_utran_broadcast_detect_indication_t*)msg;
+
+	return (push16(value->mib_length, ppWritePackedMsg, end) &&
+			pusharray8(value->mib, NFAPI_MAX_MIB_LENGTH, value->mib_length, ppWritePackedMsg, end) &&
+			push32(value->sfn_offset, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_nb_iot_broadcast_detect_indication_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_broadcast_detect_indication_t* value = (nfapi_nb_iot_broadcast_detect_indication_t*)msg;
+
+	return (push8(value->number_of_tx_antenna, ppWritePackedMsg, end) &&
+			push16(value->mib_length, ppWritePackedMsg, end) &&
+			pusharray8(value->mib, NFAPI_MAX_MIB_LENGTH, value->mib_length, ppWritePackedMsg, end) &&
+			push32(value->sfn_offset, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_broadcast_detect_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_broadcast_detect_indication_t *pNfapiMsg = (nfapi_broadcast_detect_indication_t*)msg;
+
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_tlv(NFAPI_LTE_BROADCAST_DETECT_INDICATION_TAG, &pNfapiMsg->lte_broadcast_detect_indication, ppWritePackedMsg, end, &pack_lte_broadcast_detect_indication_value) &&
+			pack_tlv(NFAPI_UTRAN_BROADCAST_DETECT_INDICATION_TAG, &pNfapiMsg->utran_broadcast_detect_indication, ppWritePackedMsg, end, &pack_utran_broadcast_detect_indication_value) &&
+			pack_tlv(NFAPI_PNF_CELL_BROADCAST_STATE_TAG, &pNfapiMsg->pnf_cell_broadcast_state, ppWritePackedMsg, end, &pack_opaque_data_value) &&
+			pack_tlv(NFAPI_NB_IOT_BROADCAST_DETECT_INDICATION_TAG, &pNfapiMsg->nb_iot_broadcast_detect_indication, ppWritePackedMsg, end, &pack_nb_iot_broadcast_detect_indication_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_lte_system_information_schedule_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lte_system_information_schedule_request_t* value = (nfapi_lte_system_information_schedule_request_t*)msg;
+
+	return (push16(value->earfcn, ppWritePackedMsg, end) &&
+			push16(value->pci, ppWritePackedMsg, end) &&
+			push16(value->downlink_channel_bandwidth, ppWritePackedMsg, end) &&
+			push8(value->phich_configuration, ppWritePackedMsg, end) &&
+			push8(value->number_of_tx_antenna, ppWritePackedMsg, end) &&
+			push8(value->retry_count, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_nb_iot_system_information_schedule_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_system_information_schedule_request_t* value = (nfapi_nb_iot_system_information_schedule_request_t*)msg;
+
+	return (push16(value->earfcn, ppWritePackedMsg, end) &&
+			push8(value->ro_dl, ppWritePackedMsg, end) &&
+			push16(value->pci, ppWritePackedMsg, end) &&
+			push8(value->scheduling_info_sib1_nb, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end));
+}
+
+
+static uint8_t pack_system_information_schedule_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_schedule_request_t *pNfapiMsg = (nfapi_system_information_schedule_request_t*)msg;
+
+	if(push8(pNfapiMsg->rat_type, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	switch(pNfapiMsg->rat_type)
+	{
+		case NFAPI_RAT_TYPE_LTE:
+			if(pack_tlv(NFAPI_LTE_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG, &pNfapiMsg->lte_system_information_schedule_request, ppWritePackedMsg, end, &pack_lte_system_information_schedule_request_value) == 0)
+				return 0;
+			break;
+		case NFAPI_RAT_TYPE_NB_IOT:
+			if(pack_tlv(NFAPI_NB_IOT_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG, &pNfapiMsg->nb_iot_system_information_schedule_request, ppWritePackedMsg, end, &pack_nb_iot_system_information_schedule_request_value) == 0)
+				return 0;
+			break;
+	}
+
+	return (pack_tlv(NFAPI_PNF_CELL_BROADCAST_STATE_TAG, &pNfapiMsg->pnf_cell_broadcast_state, ppWritePackedMsg, end, &pack_opaque_data_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+
+}
+
+static uint8_t pack_system_information_schedule_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_schedule_response_t *pNfapiMsg = (nfapi_system_information_schedule_response_t*)msg;
+	
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_lte_system_information_indication_value(void* msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lte_system_information_indication_t* value = (nfapi_lte_system_information_indication_t*)msg;
+
+	return (push8(value->sib_type, ppWritePackedMsg, end) &&
+			push16(value->sib_length, ppWritePackedMsg, end) &&
+			pusharray8(value->sib, NFAPI_MAX_SIB_LENGTH, value->sib_length, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_nb_iot_system_information_indication_value(void* msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_system_information_indication_t* value = (nfapi_nb_iot_system_information_indication_t*)msg;
+
+	return (push8(value->sib_type, ppWritePackedMsg, end) &&
+			push16(value->sib_length, ppWritePackedMsg, end) &&
+			pusharray8(value->sib, NFAPI_MAX_SIB_LENGTH, value->sib_length, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_system_information_schedule_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_schedule_indication_t *pNfapiMsg = (nfapi_system_information_schedule_indication_t*)msg;
+
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_tlv(NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->lte_system_information_indication, ppWritePackedMsg, end, &pack_lte_system_information_indication_value) &&
+			pack_tlv(NFAPI_NB_IOT_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->nb_iot_system_information_indication, ppWritePackedMsg, end, &pack_nb_iot_system_information_indication_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_lte_system_information_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lte_system_information_request_t* value = (nfapi_lte_system_information_request_t*)msg;
+	uint16_t idx = 0;
+
+	if(!(push16(value->earfcn, ppWritePackedMsg, end) &&
+		 push16(value->pci, ppWritePackedMsg, end) &&
+		 push16(value->downlink_channel_bandwidth, ppWritePackedMsg, end) &&
+		 push8(value->phich_configuration, ppWritePackedMsg, end) &&
+		 push8(value->number_of_tx_antenna, ppWritePackedMsg, end) &&
+		 push8(value->number_of_si_periodicity, ppWritePackedMsg, end)))
+		return 0;
+
+	for(idx = 0; idx < value->number_of_si_periodicity; ++idx)
+	{
+		if(!(push8(value->si_periodicity[idx].si_periodicity, ppWritePackedMsg, end) &&
+			 push8(value->si_periodicity[idx].si_index, ppWritePackedMsg, end)))
+			return 0;
+	}
+
+	return (push8(value->si_window_length, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end));
+}
+static uint8_t pack_utran_system_information_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_utran_system_information_request_t* value = (nfapi_utran_system_information_request_t*)msg;
+
+	return (push16(value->uarfcn, ppWritePackedMsg, end) &&
+			push16(value->psc, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end));
+}
+static uint8_t pack_geran_system_information_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_geran_system_information_request_t* value = (nfapi_geran_system_information_request_t*)msg;
+
+	return (push16(value->arfcn, ppWritePackedMsg, end) &&
+			push8(value->bsic, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end));
+}
+static uint8_t pack_nb_iot_system_information_request_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_system_information_request_t* value = (nfapi_nb_iot_system_information_request_t*)msg;
+	uint16_t idx = 0;
+
+	if(!(push16(value->earfcn, ppWritePackedMsg, end) &&
+		 push8(value->ro_dl, ppWritePackedMsg, end) &&
+		 push16(value->pci, ppWritePackedMsg, end) &&
+		 push8(value->number_of_si_periodicity, ppWritePackedMsg, end)))
+		return 0;
+
+	for(idx = 0; idx < value->number_of_si_periodicity; ++idx)
+	{
+		if(!(push8(value->si_periodicity[idx].si_periodicity, ppWritePackedMsg, end) &&
+			 push8(value->si_periodicity[idx].si_repetition_pattern, ppWritePackedMsg, end) &&
+			 push8(value->si_periodicity[idx].si_tb_size, ppWritePackedMsg, end) &&
+			 push8(value->si_periodicity[idx].number_of_si_index, ppWritePackedMsg, end)))
+			return 0;
+			
+		uint8_t si_idx;	
+		for(si_idx = 0; si_idx < value->si_periodicity[idx].number_of_si_index; ++si_idx)
+		{
+			if(!(push8(value->si_periodicity[idx].si_index[si_idx], ppWritePackedMsg, end)))
+				return 0;
+		}
+	}
+
+	return (push8(value->si_window_length, ppWritePackedMsg, end) &&
+			push32(value->timeout, ppWritePackedMsg, end));
+}
+
+
+static uint8_t pack_system_information_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_request_t *pNfapiMsg = (nfapi_system_information_request_t*)msg;
+
+	if(push8(pNfapiMsg->rat_type, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	switch(pNfapiMsg->rat_type)
+	{
+		case NFAPI_RAT_TYPE_LTE:
+			if(pack_tlv(NFAPI_LTE_SYSTEM_INFORMATION_REQUEST_TAG, &pNfapiMsg->lte_system_information_request, ppWritePackedMsg, end, &pack_lte_system_information_request_value) == 0)
+				return 0;
+			break;
+		case NFAPI_RAT_TYPE_UTRAN:
+			if(pack_tlv(NFAPI_UTRAN_SYSTEM_INFORMATION_REQUEST_TAG, &pNfapiMsg->utran_system_information_request, ppWritePackedMsg, end, &pack_utran_system_information_request_value) == 0)
+				return 0;
+			break;
+		case NFAPI_RAT_TYPE_GERAN:
+			if(pack_tlv(NFAPI_GERAN_SYSTEM_INFORMATION_REQUEST_TAG, &pNfapiMsg->geran_system_information_request, ppWritePackedMsg, end, &pack_geran_system_information_request_value) == 0)
+				return 0;
+			break;
+		case NFAPI_RAT_TYPE_NB_IOT:
+			if(pack_tlv(NFAPI_NB_IOT_SYSTEM_INFORMATION_REQUEST_TAG, &pNfapiMsg->nb_iot_system_information_request, ppWritePackedMsg, end, &pack_nb_iot_system_information_request_value) == 0)
+				return 0;
+			break;
+	}
+
+	return (pack_tlv(NFAPI_PNF_CELL_BROADCAST_STATE_TAG, &pNfapiMsg->pnf_cell_broadcast_state, ppWritePackedMsg, end, &pack_opaque_data_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_system_information_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end,  nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_response_t *pNfapiMsg = (nfapi_system_information_response_t*)msg;
+	
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_utran_system_information_indication_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_utran_system_information_indication_t* value = (nfapi_utran_system_information_indication_t*)msg;
+	
+	return (push16(value->sib_length, ppWritePackedMsg, end) &&
+			pusharray8(value->sib, NFAPI_MAX_SIB_LENGTH, value->sib_length, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_geran_system_information_indication_value(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_geran_system_information_indication_t* value = (nfapi_geran_system_information_indication_t*)msg;
+
+	return (push16(value->si_length, ppWritePackedMsg, end) &&
+			pusharray8(value->si, NFAPI_MAX_SIB_LENGTH, value->si_length, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_system_information_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_indication_t *pNfapiMsg = (nfapi_system_information_indication_t*)msg;
+	
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_tlv(NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->lte_system_information_indication, ppWritePackedMsg, end, &pack_lte_system_information_indication_value) &&
+			pack_tlv(NFAPI_UTRAN_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->utran_system_information_indication, ppWritePackedMsg, end, &pack_utran_system_information_indication_value) &&
+			pack_tlv(NFAPI_GERAN_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->geran_system_information_indication, ppWritePackedMsg, end, &pack_geran_system_information_indication_value) &&
+			pack_tlv(NFAPI_NB_IOT_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->nb_iot_system_information_indication, ppWritePackedMsg, end, &pack_nb_iot_system_information_indication_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+	
+static uint8_t pack_nmm_stop_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_nmm_stop_request_t *pNfapiMsg = (nfapi_nmm_stop_request_t*)msg;
+
+	return (pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_nmm_stop_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_nmm_stop_response_t *pNfapiMsg = (nfapi_nmm_stop_response_t*)msg;
+	
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t unpack_lte_rssi_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	//int result = 0;
+	nfapi_lte_rssi_request_t* value = (nfapi_lte_rssi_request_t*)tlv;
+
+	if(!(pull8(ppReadPackedMsg, &value->frequency_band_indicator, end) &&
+		 pull16(ppReadPackedMsg, &value->measurement_period, end) &&
+		 pull8(ppReadPackedMsg, &value->bandwidth, end) &&
+		 pull32(ppReadPackedMsg, &value->timeout, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_earfcns, end)))
+		return 0;
+
+	if(value->number_of_earfcns <= NFAPI_MAX_CARRIER_LIST)
+	{
+		if(pullarray16(ppReadPackedMsg, value->earfcn, NFAPI_MAX_CARRIER_LIST, value->number_of_earfcns, end) == 0)
+			return 0;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More EARFCN's than we can decode %d \n", value->number_of_earfcns);
+		return 0;
+	}
+
+	return 1;
+
+}
+
+static uint8_t unpack_utran_rssi_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_utran_rssi_request_t* value = (nfapi_utran_rssi_request_t*)tlv;
+
+	if(!(pull8(ppReadPackedMsg, &value->frequency_band_indicator, end) &&
+		 pull16(ppReadPackedMsg, &value->measurement_period, end) &&
+		 pull32(ppReadPackedMsg, &value->timeout, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_uarfcns, end)))
+		return 0;
+
+	if(value->number_of_uarfcns <= NFAPI_MAX_CARRIER_LIST)
+	{
+		if(pullarray16(ppReadPackedMsg, value->uarfcn, NFAPI_MAX_CARRIER_LIST, value->number_of_uarfcns, end) == 0)
+			return 0;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More UARFCN's than we can decode %d \n", value->number_of_uarfcns);
+		return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_geran_rssi_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_geran_rssi_request_t* value = (nfapi_geran_rssi_request_t*)tlv;
+	uint16_t idx = 0;
+
+	if(!(pull8(ppReadPackedMsg, &value->frequency_band_indicator, end) &&
+	 	 pull16(ppReadPackedMsg, &value->measurement_period, end) &&
+		 pull32(ppReadPackedMsg, &value->timeout, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_arfcns, end)))
+		return 0;
+
+	if(value->number_of_arfcns <= NFAPI_MAX_CARRIER_LIST)
+	{
+		for(idx = 0; idx < value->number_of_arfcns; ++idx)
+		{
+			if(!(pull16(ppReadPackedMsg, &value->arfcn[idx].arfcn, end) &&
+			 	 pull8(ppReadPackedMsg, &value->arfcn[idx].direction, end)))
+				return 0;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More ARFCN's than we can decode %d \n", value->number_of_arfcns);
+		return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_nb_iot_rssi_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_rssi_request_t* value = (nfapi_nb_iot_rssi_request_t*)tlv;
+	uint16_t idx = 0;
+
+	if(!(pull8(ppReadPackedMsg, &value->frequency_band_indicator, end) &&
+	 	 pull16(ppReadPackedMsg, &value->measurement_period, end) &&
+		 pull32(ppReadPackedMsg, &value->timeout, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_earfcns, end)))
+		return 0;
+
+	if(value->number_of_earfcns <= NFAPI_MAX_CARRIER_LIST)
+	{
+		for(idx = 0; idx < value->number_of_earfcns; ++idx)
+		{
+			if(!(pull16(ppReadPackedMsg, &value->earfcn[idx].earfcn, end) &&
+			 	 pull8(ppReadPackedMsg, &value->earfcn[idx].number_of_ro_dl, end)))
+				return 0;
+				
+			if(value->earfcn[idx].number_of_ro_dl <= NFAPI_MAX_RO_DL)
+			{
+				uint8_t ro_dl_idx = 0;
+				for(ro_dl_idx = 0; ro_dl_idx < value->earfcn[idx].number_of_ro_dl; ++ro_dl_idx)
+				{
+					if(!pull8(ppReadPackedMsg, &value->earfcn[idx].ro_dl[ro_dl_idx], end))
+						return 0;
+				}
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "More ROdl's than we can decode %d \n", value->earfcn[idx].number_of_ro_dl);
+				return 0;
+			}
+			
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More EARFCN's than we can decode %d \n", value->number_of_earfcns);
+		return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_rssi_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_rssi_request_t *pNfapiMsg = (nfapi_rssi_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LTE_RSSI_REQUEST_TAG, &pNfapiMsg->lte_rssi_request, &unpack_lte_rssi_request_value},
+		{ NFAPI_UTRAN_RSSI_REQUEST_TAG, &pNfapiMsg->utran_rssi_request, &unpack_utran_rssi_request_value},
+		{ NFAPI_GERAN_RSSI_REQUEST_TAG, &pNfapiMsg->geran_rssi_request, &unpack_geran_rssi_request_value},
+		{ NFAPI_NB_IOT_RSSI_REQUEST_TAG, &pNfapiMsg->nb_iot_rssi_request, &unpack_nb_iot_rssi_request_value},
+	};
+
+	int result = 0;
+
+	result = (pull8(ppReadPackedMsg, &pNfapiMsg->rat_type, end) &&
+			  unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension)));
+
+
+	// Verify that the rat type and the tlv match
+	if(result == 1 &&
+	   !((pNfapiMsg->rat_type == NFAPI_RAT_TYPE_LTE && pNfapiMsg->lte_rssi_request.tl.tag == NFAPI_LTE_RSSI_REQUEST_TAG) ||
+	    (pNfapiMsg->rat_type == NFAPI_RAT_TYPE_UTRAN && pNfapiMsg->utran_rssi_request.tl.tag == NFAPI_UTRAN_RSSI_REQUEST_TAG) ||
+	    (pNfapiMsg->rat_type == NFAPI_RAT_TYPE_GERAN && pNfapiMsg->geran_rssi_request.tl.tag == NFAPI_GERAN_RSSI_REQUEST_TAG) ||
+	    (pNfapiMsg->rat_type == NFAPI_RAT_TYPE_NB_IOT && pNfapiMsg->nb_iot_rssi_request.tl.tag == NFAPI_NB_IOT_RSSI_REQUEST_TAG)))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Mismatch RAT Type: %d and TAG value: 0x%04x \n", pNfapiMsg->rat_type, pNfapiMsg->lte_rssi_request.tl.tag);
+		result = 0;
+	}
+	
+	return result;
+}
+
+static uint8_t unpack_rssi_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_rssi_response_t *pNfapiMsg = (nfapi_rssi_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension)));
+}
+
+static uint8_t unpack_rssi_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_rssi_indication_body_t* value = (nfapi_rssi_indication_body_t*)tlv;
+
+	if(pull16(ppReadPackedMsg, &value->number_of_rssi, end) == 0)
+		return 0;
+
+	if(value->number_of_rssi <= NFAPI_MAX_RSSI)
+	{
+		if(pullarrays16(ppReadPackedMsg, value->rssi, NFAPI_MAX_RSSI, value->number_of_rssi, end) == 0)
+			return 0;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More RSSI's than we can decode %d \n", value->number_of_rssi);
+		return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_rssi_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_rssi_indication_t *pNfapiMsg = (nfapi_rssi_indication_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_RSSI_INDICATION_TAG, &pNfapiMsg->rssi_indication_body, &unpack_rssi_indication_value},
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+		    unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_lte_cell_search_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lte_cell_search_request_t* value = (nfapi_lte_cell_search_request_t*)tlv;
+
+	if(!(pull16(ppReadPackedMsg, &value->earfcn, end) &&
+		 pull8(ppReadPackedMsg, &value->measurement_bandwidth, end) &&
+		 pull8(ppReadPackedMsg, &value->exhaustive_search, end) &&
+		 pull32(ppReadPackedMsg, &value->timeout, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_pci, end)))
+		return 0;
+
+	if(value->number_of_pci <= NFAPI_MAX_PCI_LIST)
+	{
+		if(pullarray16(ppReadPackedMsg, value->pci, NFAPI_MAX_PCI_LIST, value->number_of_pci, end) == 0)
+			return 0;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More PCI's than we can decode %d \n", value->number_of_pci);
+		return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_utran_cell_search_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_utran_cell_search_request_t* value = (nfapi_utran_cell_search_request_t*)tlv;
+
+	if(!(pull16(ppReadPackedMsg, &value->uarfcn, end) &&
+		 pull8(ppReadPackedMsg, &value->exhaustive_search, end) &&
+		 pull32(ppReadPackedMsg, &value->timeout, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_psc, end)))
+		return 0;
+
+	if(value->number_of_psc <= NFAPI_MAX_PSC_LIST)
+	{
+		if(pullarray16(ppReadPackedMsg, value->psc, NFAPI_MAX_PSC_LIST, value->number_of_psc, end) == 0)
+			return 0;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More PSC's than we can decode %d \n", value->number_of_psc);
+		return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_geran_cell_search_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_geran_cell_search_request_t* value = (nfapi_geran_cell_search_request_t*)tlv;
+
+	if(!(pull32(ppReadPackedMsg, &value->timeout, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_arfcn, end)))
+		return 0;
+
+	if(value->number_of_arfcn <= NFAPI_MAX_ARFCN_LIST)
+	{
+		if(pullarray16(ppReadPackedMsg, value->arfcn, NFAPI_MAX_ARFCN_LIST, value->number_of_arfcn, end) == 0)
+			return 0;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More ARFCN's than we can decode %d \n", value->number_of_arfcn);
+		return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_nb_iot_cell_search_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_cell_search_request_t* value = (nfapi_nb_iot_cell_search_request_t*)tlv;
+
+	if(!(pull16(ppReadPackedMsg, &value->earfcn, end) &&
+		 pull8(ppReadPackedMsg, &value->ro_dl, end) &&
+		 pull8(ppReadPackedMsg, &value->exhaustive_search, end) &&
+		 pull32(ppReadPackedMsg, &value->timeout, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_pci, end)))
+		return 0;
+
+	if(value->number_of_pci <= NFAPI_MAX_PCI_LIST)
+	{
+		if(pullarray16(ppReadPackedMsg, value->pci, NFAPI_MAX_PCI_LIST, value->number_of_pci, end) == 0)
+			return 0;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More PCI's than we can decode %d \n", value->number_of_pci);
+		return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_cell_search_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_cell_search_request_t *pNfapiMsg = (nfapi_cell_search_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LTE_CELL_SEARCH_REQUEST_TAG, &pNfapiMsg->lte_cell_search_request, &unpack_lte_cell_search_request_value},
+		{ NFAPI_UTRAN_CELL_SEARCH_REQUEST_TAG, &pNfapiMsg->utran_cell_search_request, &unpack_utran_cell_search_request_value},
+		{ NFAPI_GERAN_CELL_SEARCH_REQUEST_TAG, &pNfapiMsg->geran_cell_search_request, &unpack_geran_cell_search_request_value},
+		{ NFAPI_NB_IOT_CELL_SEARCH_REQUEST_TAG, &pNfapiMsg->nb_iot_cell_search_request, &unpack_nb_iot_cell_search_request_value},
+	};
+
+	int result = (pull8(ppReadPackedMsg, &pNfapiMsg->rat_type, end) &&
+			  unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+
+	// Verify that the rat type and the tlv match
+	if(result == 1 &&
+	   !((pNfapiMsg->rat_type == NFAPI_RAT_TYPE_LTE && pNfapiMsg->lte_cell_search_request.tl.tag == NFAPI_LTE_CELL_SEARCH_REQUEST_TAG) ||
+	    (pNfapiMsg->rat_type == NFAPI_RAT_TYPE_UTRAN && pNfapiMsg->utran_cell_search_request.tl.tag == NFAPI_UTRAN_CELL_SEARCH_REQUEST_TAG) ||
+	    (pNfapiMsg->rat_type == NFAPI_RAT_TYPE_GERAN && pNfapiMsg->geran_cell_search_request.tl.tag == NFAPI_GERAN_CELL_SEARCH_REQUEST_TAG) ||
+	    (pNfapiMsg->rat_type == NFAPI_RAT_TYPE_NB_IOT && pNfapiMsg->nb_iot_cell_search_request.tl.tag == NFAPI_NB_IOT_CELL_SEARCH_REQUEST_TAG)))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Mismatch RAT Type: %d and TAG value: 0x%04x \n", pNfapiMsg->rat_type, pNfapiMsg->lte_cell_search_request.tl.tag);
+		result = 0;
+	}
+	
+	return result;
+}
+
+static uint8_t unpack_cell_search_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_cell_search_response_t *pNfapiMsg = (nfapi_cell_search_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_lte_cell_search_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lte_cell_search_indication_t* value = (nfapi_lte_cell_search_indication_t*)tlv;
+
+	uint16_t idx = 0;
+	if(pull16(ppReadPackedMsg, &value->number_of_lte_cells_found, end) == 0)
+		return 0;
+
+	if(value->number_of_lte_cells_found <= NFAPI_MAX_LTE_CELLS_FOUND)
+	{
+		for(idx = 0; idx < value->number_of_lte_cells_found; ++idx)
+		{
+			if(!(pull16(ppReadPackedMsg, &value->lte_found_cells[idx].pci, end) &&
+				 pull8(ppReadPackedMsg, &value->lte_found_cells[idx].rsrp, end) &&
+				 pull8(ppReadPackedMsg, &value->lte_found_cells[idx].rsrq, end) &&
+				 pulls16(ppReadPackedMsg, &value->lte_found_cells[idx].frequency_offset, end)))
+				return 0;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More found LTE cells than we can decode %d \n", value->number_of_lte_cells_found);
+		return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_utran_cell_search_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_utran_cell_search_indication_t* value = (nfapi_utran_cell_search_indication_t*)tlv;
+
+	uint16_t idx = 0;
+	if(pull16(ppReadPackedMsg, &value->number_of_utran_cells_found, end) == 0)
+		return 0;
+
+	if(value->number_of_utran_cells_found <= NFAPI_MAX_UTRAN_CELLS_FOUND)
+	{
+		for(idx = 0; idx < value->number_of_utran_cells_found; ++idx)
+		{
+			if(!(pull16(ppReadPackedMsg, &value->utran_found_cells[idx].psc, end) &&
+				 pull8(ppReadPackedMsg, &value->utran_found_cells[idx].rscp, end) &&
+				 pull8(ppReadPackedMsg, &value->utran_found_cells[idx].ecno, end) &&
+				 pulls16(ppReadPackedMsg, &value->utran_found_cells[idx].frequency_offset, end)))
+				return 0;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More found UTRAN cells than we can decode %d \n", value->number_of_utran_cells_found);
+		return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_geran_cell_search_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_geran_cell_search_indication_t* value = (nfapi_geran_cell_search_indication_t*)tlv;
+
+	uint16_t idx = 0;
+	if(pull16(ppReadPackedMsg, &value->number_of_gsm_cells_found, end) == 0)
+		return 0;
+
+	if(value->number_of_gsm_cells_found <= NFAPI_MAX_GSM_CELLS_FOUND)
+	{
+		for(idx = 0; idx < value->number_of_gsm_cells_found; ++idx)
+		{
+			if(!(pull16(ppReadPackedMsg, &value->gsm_found_cells[idx].arfcn, end) &&
+				 pull8(ppReadPackedMsg, &value->gsm_found_cells[idx].bsic, end) &&
+				 pull8(ppReadPackedMsg, &value->gsm_found_cells[idx].rxlev, end) &&
+				 pull8(ppReadPackedMsg, &value->gsm_found_cells[idx].rxqual, end) &&
+				 pulls16(ppReadPackedMsg, &value->gsm_found_cells[idx].frequency_offset, end) &&
+				 pull32(ppReadPackedMsg, &value->gsm_found_cells[idx].sfn_offset, end)))
+				return 0;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More found GSM cells than we can decode %d \n", value->number_of_gsm_cells_found);
+		return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_nb_iot_cell_search_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_cell_search_indication_t* value = (nfapi_nb_iot_cell_search_indication_t*)tlv;
+
+	uint16_t idx = 0;
+	if(pull16(ppReadPackedMsg, &value->number_of_nb_iot_cells_found, end) == 0)
+		return 0;
+
+	if(value->number_of_nb_iot_cells_found <= NFAPI_MAX_NB_IOT_CELLS_FOUND)
+	{
+		for(idx = 0; idx < value->number_of_nb_iot_cells_found; ++idx)
+		{
+			if(!(pull16(ppReadPackedMsg, &value->nb_iot_found_cells[idx].pci, end) &&
+				 pull8(ppReadPackedMsg, &value->nb_iot_found_cells[idx].rsrp, end) &&
+				 pull8(ppReadPackedMsg, &value->nb_iot_found_cells[idx].rsrq, end) &&
+				 pulls16(ppReadPackedMsg, &value->nb_iot_found_cells[idx].frequency_offset, end)))
+				return 0;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More found NB_IOT cells than we can decode %d \n", value->number_of_nb_iot_cells_found);
+		return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_cell_search_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_cell_search_indication_t *pNfapiMsg = (nfapi_cell_search_indication_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LTE_CELL_SEARCH_INDICATION_TAG, &pNfapiMsg->lte_cell_search_indication, &unpack_lte_cell_search_indication_value},
+		{ NFAPI_UTRAN_CELL_SEARCH_INDICATION_TAG, &pNfapiMsg->utran_cell_search_indication, &unpack_utran_cell_search_indication_value},
+		{ NFAPI_GERAN_CELL_SEARCH_INDICATION_TAG, &pNfapiMsg->geran_cell_search_indication, &unpack_geran_cell_search_indication_value},
+		{ NFAPI_PNF_CELL_SEARCH_STATE_TAG, &pNfapiMsg->pnf_cell_search_state, &unpack_opaque_data_value},
+		{ NFAPI_NB_IOT_CELL_SEARCH_INDICATION_TAG, &pNfapiMsg->nb_iot_cell_search_indication, &unpack_nb_iot_cell_search_indication_value},
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+		
+}
+
+static uint8_t unpack_lte_broadcast_detect_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lte_broadcast_detect_request_t* value = (nfapi_lte_broadcast_detect_request_t*)tlv;
+
+	return (pull16(ppReadPackedMsg, &value->earfcn, end) &&
+			pull16(ppReadPackedMsg, &value->pci, end) &&
+			pull32(ppReadPackedMsg, &value->timeout, end));
+}
+
+static uint8_t unpack_utran_broadcast_detect_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_utran_broadcast_detect_request_t* value = (nfapi_utran_broadcast_detect_request_t*)tlv;
+
+	return (pull16(ppReadPackedMsg, &value->uarfcn, end) &&
+			pull16(ppReadPackedMsg, &value->psc, end) &&
+			pull32(ppReadPackedMsg, &value->timeout, end));
+}
+
+static uint8_t unpack_nb_iot_broadcast_detect_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_broadcast_detect_request_t* value = (nfapi_nb_iot_broadcast_detect_request_t*)tlv;
+
+	return (pull16(ppReadPackedMsg, &value->earfcn, end) &&
+			pull8(ppReadPackedMsg, &value->ro_dl, end) &&
+			pull16(ppReadPackedMsg, &value->pci, end) &&
+			pull32(ppReadPackedMsg, &value->timeout, end));
+}
+
+static uint8_t unpack_broadcast_detect_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_broadcast_detect_request_t *pNfapiMsg = (nfapi_broadcast_detect_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LTE_BROADCAST_DETECT_REQUEST_TAG, &pNfapiMsg->lte_broadcast_detect_request, &unpack_lte_broadcast_detect_request_value},
+		{ NFAPI_UTRAN_BROADCAST_DETECT_REQUEST_TAG, &pNfapiMsg->utran_broadcast_detect_request, &unpack_utran_broadcast_detect_request_value},
+		{ NFAPI_PNF_CELL_SEARCH_STATE_TAG, &pNfapiMsg->pnf_cell_search_state, &unpack_opaque_data_value},
+		{ NFAPI_NB_IOT_BROADCAST_DETECT_REQUEST_TAG, &pNfapiMsg->nb_iot_broadcast_detect_request, &unpack_nb_iot_broadcast_detect_request_value}
+	};
+
+	return (pull8(ppReadPackedMsg, &pNfapiMsg->rat_type, end) &&	
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_broadcast_detect_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_broadcast_detect_response_t *pNfapiMsg = (nfapi_broadcast_detect_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_lte_broadcast_detect_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lte_broadcast_detect_indication_t* value = (nfapi_lte_broadcast_detect_indication_t*)tlv;
+
+	if(!(pull8(ppReadPackedMsg, &value->number_of_tx_antenna, end) &&
+	 	 pull16(ppReadPackedMsg, &value->mib_length, end)))
+		return 0;
+
+	if(value->mib_length > NFAPI_MAX_MIB_LENGTH)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "MIB too long %d \n", value->mib_length);
+		return 0;
+	}
+	
+	return (pullarray8(ppReadPackedMsg, value->mib, NFAPI_MAX_MIB_LENGTH, value->mib_length, end) &&
+			pull32(ppReadPackedMsg, &value->sfn_offset, end));
+}
+
+static uint8_t unpack_utran_broadcast_detect_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_utran_broadcast_detect_indication_t* value = (nfapi_utran_broadcast_detect_indication_t*)tlv;
+
+	if(pull16(ppReadPackedMsg, &value->mib_length, end) == 0)
+		return 0;
+
+	if(value->mib_length > NFAPI_MAX_MIB_LENGTH)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "MIB too long %d \n", value->mib_length);
+		return 0;
+	}
+
+	return (pullarray8(ppReadPackedMsg, value->mib, NFAPI_MAX_MIB_LENGTH, value->mib_length, end) &&
+			pull32(ppReadPackedMsg, &value->sfn_offset, end));
+}
+
+static uint8_t unpack_nb_iot_broadcast_detect_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_broadcast_detect_indication_t* value = (nfapi_nb_iot_broadcast_detect_indication_t*)tlv;
+
+	if(!(pull8(ppReadPackedMsg, &value->number_of_tx_antenna, end) && 
+		 pull16(ppReadPackedMsg, &value->mib_length, end)))
+		return 0;
+
+	if(value->mib_length > NFAPI_MAX_MIB_LENGTH)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "MIB too long %d \n", value->mib_length);
+		return 0;
+	}
+
+	return (pullarray8(ppReadPackedMsg, value->mib, NFAPI_MAX_MIB_LENGTH, value->mib_length, end) &&
+			pull32(ppReadPackedMsg, &value->sfn_offset, end));
+}
+
+static uint8_t unpack_broadcast_detect_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_broadcast_detect_indication_t *pNfapiMsg = (nfapi_broadcast_detect_indication_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LTE_BROADCAST_DETECT_INDICATION_TAG, &pNfapiMsg->lte_broadcast_detect_indication, &unpack_lte_broadcast_detect_indication_value},
+		{ NFAPI_UTRAN_BROADCAST_DETECT_INDICATION_TAG, &pNfapiMsg->utran_broadcast_detect_indication, &unpack_utran_broadcast_detect_indication_value},
+		{ NFAPI_NB_IOT_BROADCAST_DETECT_INDICATION_TAG, &pNfapiMsg->nb_iot_broadcast_detect_indication, &unpack_nb_iot_broadcast_detect_indication_value},
+		{ NFAPI_PNF_CELL_BROADCAST_STATE_TAG, &pNfapiMsg->pnf_cell_broadcast_state, &unpack_opaque_data_value}
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_lte_system_information_schedule_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lte_system_information_schedule_request_t* value = (nfapi_lte_system_information_schedule_request_t*)tlv;
+
+	return (pull16(ppReadPackedMsg, &value->earfcn, end) &&
+			pull16(ppReadPackedMsg, &value->pci, end) &&
+			pull16(ppReadPackedMsg, &value->downlink_channel_bandwidth, end) &&
+			pull8(ppReadPackedMsg, &value->phich_configuration, end) &&
+			pull8(ppReadPackedMsg, &value->number_of_tx_antenna, end) &&
+			pull8(ppReadPackedMsg, &value->retry_count, end) &&
+			pull32(ppReadPackedMsg, &value->timeout, end));
+}
+
+static uint8_t unpack_nb_iot_system_information_schedule_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_system_information_schedule_request_t* value = (nfapi_nb_iot_system_information_schedule_request_t*)tlv;
+
+	return (pull16(ppReadPackedMsg, &value->earfcn, end) &&
+			pull8(ppReadPackedMsg, &value->ro_dl, end) &&	
+			pull16(ppReadPackedMsg, &value->pci, end) &&
+			pull8(ppReadPackedMsg, &value->scheduling_info_sib1_nb, end) &&
+			pull32(ppReadPackedMsg, &value->timeout, end));
+}
+
+static uint8_t unpack_system_information_schedule_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_schedule_request_t *pNfapiMsg = (nfapi_system_information_schedule_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LTE_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG, &pNfapiMsg->lte_system_information_schedule_request, &unpack_lte_system_information_schedule_request_value},
+		{ NFAPI_NB_IOT_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG, &pNfapiMsg->nb_iot_system_information_schedule_request, &unpack_nb_iot_system_information_schedule_request_value},
+		{ NFAPI_PNF_CELL_BROADCAST_STATE_TAG, &pNfapiMsg->pnf_cell_broadcast_state, &unpack_opaque_data_value}
+	};
+
+	return (pull8(ppReadPackedMsg, &pNfapiMsg->rat_type, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_system_information_schedule_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_schedule_response_t *pNfapiMsg = (nfapi_system_information_schedule_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_lte_system_information_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lte_system_information_indication_t* value = (nfapi_lte_system_information_indication_t*)tlv;
+
+	if(!(pull8(ppReadPackedMsg, &value->sib_type, end) &&
+		 pull16(ppReadPackedMsg, &value->sib_length, end)))
+		return 0;
+
+	if(value->sib_length > NFAPI_MAX_SIB_LENGTH)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "SIB too long %d \n", value->sib_length);
+		return 0;
+	}
+	
+	if(pullarray8(ppReadPackedMsg, value->sib, NFAPI_MAX_SIB_LENGTH,  value->sib_length, end) == 0)
+		return 0;
+
+	return 1;
+}
+
+static uint8_t unpack_nb_iot_system_information_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_system_information_indication_t* value = (nfapi_nb_iot_system_information_indication_t*)tlv;
+
+	if(!(pull8(ppReadPackedMsg, &value->sib_type, end) &&
+		 pull16(ppReadPackedMsg, &value->sib_length, end)))
+		return 0;
+
+	if(value->sib_length > NFAPI_MAX_SIB_LENGTH)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "SIB too long %d \n", value->sib_length);
+		return 0;
+	}
+	
+	if(pullarray8(ppReadPackedMsg, value->sib, NFAPI_MAX_SIB_LENGTH,  value->sib_length, end) == 0)
+		return 0;
+
+	return 1;
+}
+
+static uint8_t unpack_system_information_schedule_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_schedule_indication_t *pNfapiMsg = (nfapi_system_information_schedule_indication_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->lte_system_information_indication, &unpack_lte_system_information_indication_value},
+		{ NFAPI_NB_IOT_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->nb_iot_system_information_indication, &unpack_nb_iot_system_information_indication_value},
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_lte_system_information_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lte_system_information_request_t* value = (nfapi_lte_system_information_request_t*)tlv;
+	uint16_t idx = 0;
+
+	if(!(pull16(ppReadPackedMsg, &value->earfcn, end) &&
+		 pull16(ppReadPackedMsg, &value->pci, end) &&
+		 pull16(ppReadPackedMsg, &value->downlink_channel_bandwidth, end) &&
+		 pull8(ppReadPackedMsg, &value->phich_configuration, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_tx_antenna, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_si_periodicity, end)))
+		return 0;
+
+	if(value->number_of_si_periodicity > NFAPI_MAX_SI_PERIODICITY)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More found SI periodicity than we can decode %d \n", value->number_of_si_periodicity);
+		return 0;
+	}
+
+	for(idx = 0; idx < value->number_of_si_periodicity; ++idx)
+	{
+		if(!(pull8(ppReadPackedMsg, &value->si_periodicity[idx].si_periodicity, end) &&
+			 pull8(ppReadPackedMsg, &value->si_periodicity[idx].si_index, end)))
+			return 0;
+	}
+
+	if(!(pull8(ppReadPackedMsg, &value->si_window_length, end) &&
+	 	 pull32(ppReadPackedMsg, &value->timeout, end)))
+		return 0;
+
+	return 1;
+}
+
+static uint8_t unpack_utran_system_information_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_utran_system_information_request_t* value = (nfapi_utran_system_information_request_t*)tlv;
+
+	return (pull16(ppReadPackedMsg, &value->uarfcn, end) &&
+			pull16(ppReadPackedMsg, &value->psc, end) &&
+			pull32(ppReadPackedMsg, &value->timeout, end));
+}
+
+static uint8_t unpack_geran_system_information_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_geran_system_information_request_t* value = (nfapi_geran_system_information_request_t*)tlv;
+
+	return (pull16(ppReadPackedMsg, &value->arfcn, end) &&
+			pull8(ppReadPackedMsg, &value->bsic, end) &&
+			pull32(ppReadPackedMsg, &value->timeout, end));
+}
+
+static uint8_t unpack_nb_iot_system_information_request_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nb_iot_system_information_request_t* value = (nfapi_nb_iot_system_information_request_t*)tlv;
+	uint16_t idx = 0;
+
+	if(!(pull16(ppReadPackedMsg, &value->earfcn, end) &&
+		 pull8(ppReadPackedMsg, &value->ro_dl, end) &&
+		 pull16(ppReadPackedMsg, &value->pci, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_si_periodicity, end)))
+		return 0;
+
+	if(value->number_of_si_periodicity > NFAPI_MAX_SI_PERIODICITY)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "More found SI periodicity than we can decode %d \n", value->number_of_si_periodicity);
+		return 0;
+	}
+
+	for(idx = 0; idx < value->number_of_si_periodicity; ++idx)
+	{
+		if(!(pull8(ppReadPackedMsg, &value->si_periodicity[idx].si_periodicity, end) &&
+			 pull8(ppReadPackedMsg, &value->si_periodicity[idx].si_repetition_pattern, end) &&
+			 pull8(ppReadPackedMsg, &value->si_periodicity[idx].si_tb_size, end) &&
+			 pull8(ppReadPackedMsg, &value->si_periodicity[idx].number_of_si_index, end)))
+			return 0;
+			
+		uint8_t si_idx;
+		for(si_idx = 0; si_idx < value->si_periodicity[idx].number_of_si_index; ++si_idx)
+		{
+			if(!(pull8(ppReadPackedMsg, &value->si_periodicity[idx].si_index[si_idx], end)))
+				return 0;
+			
+		}
+	}
+
+	if(!(pull8(ppReadPackedMsg, &value->si_window_length, end) &&
+	 	 pull32(ppReadPackedMsg, &value->timeout, end)))
+		return 0;
+
+	return 1;
+}
+
+static uint8_t unpack_system_information_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_request_t *pNfapiMsg = (nfapi_system_information_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LTE_SYSTEM_INFORMATION_REQUEST_TAG, &pNfapiMsg->lte_system_information_request, &unpack_lte_system_information_request_value},
+		{ NFAPI_UTRAN_SYSTEM_INFORMATION_REQUEST_TAG, &pNfapiMsg->utran_system_information_request, &unpack_utran_system_information_request_value},
+		{ NFAPI_GERAN_SYSTEM_INFORMATION_REQUEST_TAG, &pNfapiMsg->geran_system_information_request, &unpack_geran_system_information_request_value},
+		{ NFAPI_NB_IOT_SYSTEM_INFORMATION_REQUEST_TAG, &pNfapiMsg->nb_iot_system_information_request, &unpack_nb_iot_system_information_request_value},
+		{ NFAPI_PNF_CELL_BROADCAST_STATE_TAG, &pNfapiMsg->pnf_cell_broadcast_state, &unpack_opaque_data_value}
+	};
+
+
+	int result = (pull8(ppReadPackedMsg, &pNfapiMsg->rat_type, end) &&
+				  unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+
+	// Verify that the rat type and the tlv match
+	if(result == 1 &&
+	   !((pNfapiMsg->rat_type == NFAPI_RAT_TYPE_LTE && pNfapiMsg->lte_system_information_request.tl.tag == NFAPI_LTE_SYSTEM_INFORMATION_REQUEST_TAG) ||
+	    (pNfapiMsg->rat_type == NFAPI_RAT_TYPE_UTRAN && pNfapiMsg->utran_system_information_request.tl.tag == NFAPI_UTRAN_SYSTEM_INFORMATION_REQUEST_TAG) ||
+	    (pNfapiMsg->rat_type == NFAPI_RAT_TYPE_GERAN && pNfapiMsg->geran_system_information_request.tl.tag == NFAPI_GERAN_SYSTEM_INFORMATION_REQUEST_TAG)))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Mismatch RAT Type: %d and TAG value: 0x%04x \n", pNfapiMsg->rat_type, pNfapiMsg->lte_system_information_request.tl.tag);
+		result = 0;
+	}
+	
+	return result;
+}
+
+static uint8_t unpack_system_information_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_response_t *pNfapiMsg = (nfapi_system_information_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_utran_system_information_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_utran_system_information_indication_t* value = (nfapi_utran_system_information_indication_t*)tlv;
+
+	if(pull16(ppReadPackedMsg, &value->sib_length, end) == 0)
+		return 0;
+
+	if(value->sib_length > NFAPI_MAX_SIB_LENGTH)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "SIB too long %d \n", value->sib_length);
+		return 0;
+	}
+	
+	if(pullarray8(ppReadPackedMsg, value->sib, NFAPI_MAX_SIB_LENGTH, value->sib_length, end) == 0)
+		return 0;
+
+	return 1;
+}
+
+static uint8_t unpack_geran_system_information_indication_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_geran_system_information_indication_t* value = (nfapi_geran_system_information_indication_t*)tlv;
+
+	if(pull16(ppReadPackedMsg, &value->si_length, end) == 0)
+		return 0;
+
+	if(value->si_length > NFAPI_MAX_SI_LENGTH)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "SIB too long %d \n", value->si_length);
+		return 0;
+	}
+
+	if(pullarray8(ppReadPackedMsg, value->si, NFAPI_MAX_SI_LENGTH, value->si_length, end) == 0)
+		return 0;
+
+	return 1;
+}
+
+static uint8_t unpack_system_information_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_system_information_indication_t *pNfapiMsg = (nfapi_system_information_indication_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->lte_system_information_indication, &unpack_lte_system_information_indication_value},
+		{ NFAPI_UTRAN_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->utran_system_information_indication, &unpack_utran_system_information_indication_value},
+		{ NFAPI_GERAN_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->geran_system_information_indication, &unpack_geran_system_information_indication_value},
+		{ NFAPI_NB_IOT_SYSTEM_INFORMATION_INDICATION_TAG, &pNfapiMsg->nb_iot_system_information_indication, &unpack_nb_iot_system_information_indication_value},
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+
+}
+
+static uint8_t unpack_nmm_stop_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_nmm_stop_request_t *pNfapiMsg = (nfapi_nmm_stop_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension);
+}
+
+static uint8_t unpack_nmm_stop_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_nmm_stop_response_t *pNfapiMsg = (nfapi_nmm_stop_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+
+static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen)
+{
+	int retLen = 0;
+
+	switch (msgId)
+	{
+		case NFAPI_RSSI_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_rssi_request_t))
+				retLen = sizeof(nfapi_rssi_request_t);
+			break;
+
+		case NFAPI_RSSI_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_rssi_response_t))
+				retLen = sizeof(nfapi_rssi_response_t);
+			break;
+
+		case NFAPI_RSSI_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_rssi_indication_t))
+				retLen = sizeof(nfapi_rssi_indication_t);
+			break;
+
+		case NFAPI_CELL_SEARCH_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_cell_search_request_t))
+				retLen = sizeof(nfapi_cell_search_request_t);
+			break;
+
+		case NFAPI_CELL_SEARCH_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_cell_search_response_t))
+				retLen = sizeof(nfapi_cell_search_response_t);
+			break;
+
+		case NFAPI_CELL_SEARCH_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_cell_search_indication_t))
+				retLen = sizeof(nfapi_cell_search_indication_t);
+			break;
+
+		case NFAPI_BROADCAST_DETECT_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_broadcast_detect_request_t))
+				retLen = sizeof(nfapi_broadcast_detect_request_t);
+			break;
+
+		case NFAPI_BROADCAST_DETECT_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_broadcast_detect_response_t))
+				retLen = sizeof(nfapi_broadcast_detect_response_t);
+			break;
+
+		case NFAPI_BROADCAST_DETECT_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_broadcast_detect_indication_t))
+				retLen = sizeof(nfapi_broadcast_detect_indication_t);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_system_information_schedule_request_t))
+				retLen = sizeof(nfapi_system_information_schedule_request_t);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_system_information_schedule_response_t))
+				retLen = sizeof(nfapi_system_information_schedule_response_t);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_system_information_schedule_indication_t))
+				retLen = sizeof(nfapi_system_information_schedule_indication_t);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_system_information_request_t))
+				retLen = sizeof(nfapi_system_information_request_t);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_system_information_response_t))
+				retLen = sizeof(nfapi_system_information_response_t);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_system_information_indication_t))
+				retLen = sizeof(nfapi_system_information_indication_t);
+			break;
+
+		case NFAPI_NMM_STOP_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_nmm_stop_request_t))
+				retLen = sizeof(nfapi_nmm_stop_request_t);
+			break;
+
+		case NFAPI_NMM_STOP_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_nmm_stop_response_t))
+				retLen = sizeof(nfapi_nmm_stop_response_t);
+			break;
+
+		default:
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown message ID %d\n", msgId);
+			break;
+	}
+
+	return retLen;
+}
+
+int nfapi_p4_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_p4_p5_message_header_t *pMessageHeader = pMessageBuf;
+	uint8_t *end = pPackedBuf + packedBufLen;
+	uint8_t *pWritePackedMessage = pPackedBuf;
+	uint8_t *pPackedLengthField = &pWritePackedMessage[4];
+	uint32_t packedMsgLen;
+	uint16_t packedMsgLen16;
+
+	if (pMessageBuf == NULL || pPackedBuf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P4 Pack supplied pointers are null\n");
+		return -1;
+	}
+
+	// process the header
+	if(!(push16(pMessageHeader->phy_id, &pWritePackedMessage, end) &&
+		 push16(pMessageHeader->message_id, &pWritePackedMessage, end) &&
+		 push16(0/*pMessageHeader->message_length*/, &pWritePackedMessage, end) &&
+		 push16(pMessageHeader->spare, &pWritePackedMessage, end)))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to pack p4 message header\n");
+		return -1;
+	}
+
+	// look for the specific message
+	uint8_t result = 0;
+	switch (pMessageHeader->message_id)
+	{
+		case NFAPI_RSSI_REQUEST:
+			result = pack_rssi_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_RSSI_RESPONSE:
+			result = pack_rssi_response(pMessageHeader, &pWritePackedMessage,  end,config);
+			break;
+
+		case NFAPI_RSSI_INDICATION:
+			result = pack_rssi_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_CELL_SEARCH_REQUEST:
+			result = pack_cell_search_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_CELL_SEARCH_RESPONSE:
+			result = pack_cell_search_response(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_CELL_SEARCH_INDICATION:
+			result = pack_cell_search_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_BROADCAST_DETECT_REQUEST:
+			result = pack_broadcast_detect_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_BROADCAST_DETECT_RESPONSE:
+			result = pack_broadcast_detect_response(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_BROADCAST_DETECT_INDICATION:
+			result = pack_broadcast_detect_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST:
+			result = pack_system_information_schedule_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE:
+			result = pack_system_information_schedule_response(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION:
+			result = pack_system_information_schedule_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_REQUEST:
+			result = pack_system_information_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_RESPONSE:
+			result = pack_system_information_response(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_INDICATION:
+			result = pack_system_information_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_NMM_STOP_REQUEST:
+			result = pack_nmm_stop_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_NMM_STOP_RESPONSE:
+			result = pack_nmm_stop_response(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		default:
+			{
+				if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
+				   pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MIN)
+				{
+					if(config && config->pack_p4_p5_vendor_extension)
+					{
+						result =(config->pack_p4_p5_vendor_extension)(pMessageHeader, &pWritePackedMessage, end, config);
+					}
+					else
+					{
+						NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve encoder provided\n", __FUNCTION__, pMessageHeader->message_id);
+					}
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id);
+				}
+			}
+			break;
+	}	
+	
+	// return the packed length
+	if(result == 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Result is 0\n");
+		return -1;
+	}
+
+
+	// check for a valid message length
+	packedMsgLen = get_packed_msg_len((uintptr_t)pPackedBuf, (uintptr_t)pWritePackedMessage);
+	if (packedMsgLen > 0xFFFF || packedMsgLen > packedBufLen)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Packed message length error %d, buffer supplied %d\n", packedMsgLen, packedBufLen);
+		return -1;
+	}
+	else
+	{
+		packedMsgLen16 = (uint16_t)packedMsgLen;
+	}
+
+	// Update the message length in the header
+	if(push16(packedMsgLen16, &pPackedLengthField, end) == 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to pack p4 message header lengt\n");
+		return -1;
+	}
+
+	return (packedMsgLen);
+
+}
+
+// Main unpack functions - public
+
+int nfapi_p4_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_p4_p5_message_header_t *pMessageHeader = pUnpackedBuf;
+	uint8_t *pReadPackedMessage = pMessageBuf;
+	uint8_t *end = pMessageBuf + messageBufLen;
+
+	if (pMessageBuf == NULL || pUnpackedBuf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P4 header unpack supplied pointers are null\n");
+		return -1;
+	}
+
+	if (messageBufLen < NFAPI_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p4_p5_message_header_t))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 header unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen);
+		return -1;
+	}
+
+	// process the headei
+	if (pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) &&
+		pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) &&
+		pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) &&
+		pull16(&pReadPackedMessage, &pMessageHeader->spare, end))
+		return -1;
+
+	return 0;
+}
+
+int nfapi_p4_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config)
+{
+	int result = 0;
+	nfapi_p4_p5_message_header_t *pMessageHeader = pUnpackedBuf;
+	uint8_t *pReadPackedMessage = pMessageBuf;
+	uint8_t *end = pMessageBuf + messageBufLen;
+
+	if (pMessageBuf == NULL || pUnpackedBuf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P4 unpack supplied pointers are null\n");
+		return -1;
+	}
+
+	if (messageBufLen < NFAPI_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p4_p5_message_header_t))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P4 unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen);
+		return -1;
+	}
+
+	// clean the supplied buffer for - tag value blanking
+	(void)memset(pUnpackedBuf, 0, unpackedBufLen);
+
+	// process the header
+	if(!(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) &&
+	 	 pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) &&
+		 pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) &&
+		 pull16(&pReadPackedMessage, &pMessageHeader->spare, end)))
+		return -1;
+
+	// look for the specific message
+	switch (pMessageHeader->message_id)
+	{
+		case NFAPI_RSSI_REQUEST:
+			if (check_unpack_length(NFAPI_RSSI_REQUEST, unpackedBufLen))
+				result = unpack_rssi_request(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_RSSI_RESPONSE:
+			if (check_unpack_length(NFAPI_RSSI_RESPONSE, unpackedBufLen))
+				result = unpack_rssi_response(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_RSSI_INDICATION:
+			if (check_unpack_length(NFAPI_RSSI_INDICATION, unpackedBufLen))
+				result = unpack_rssi_indication(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_CELL_SEARCH_REQUEST:
+			if (check_unpack_length(NFAPI_CELL_SEARCH_REQUEST, unpackedBufLen))
+				result = unpack_cell_search_request(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_CELL_SEARCH_RESPONSE:
+			if (check_unpack_length(NFAPI_CELL_SEARCH_RESPONSE, unpackedBufLen))
+				result = unpack_cell_search_response(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_CELL_SEARCH_INDICATION:
+			if (check_unpack_length(NFAPI_CELL_SEARCH_INDICATION, unpackedBufLen))
+				result = unpack_cell_search_indication(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_BROADCAST_DETECT_REQUEST:
+			if (check_unpack_length(NFAPI_BROADCAST_DETECT_REQUEST, unpackedBufLen))
+				result = unpack_broadcast_detect_request(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_BROADCAST_DETECT_RESPONSE:
+			if (check_unpack_length(NFAPI_BROADCAST_DETECT_RESPONSE, unpackedBufLen))
+				result = unpack_broadcast_detect_response(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_BROADCAST_DETECT_INDICATION:
+			if (check_unpack_length(NFAPI_BROADCAST_DETECT_INDICATION, unpackedBufLen))
+				result = unpack_broadcast_detect_indication(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST:
+			if (check_unpack_length(NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST, unpackedBufLen))
+				result = unpack_system_information_schedule_request(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+			
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE:
+			if (check_unpack_length(NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE, unpackedBufLen))
+				result = unpack_system_information_schedule_response(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION:
+			if (check_unpack_length(NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION, unpackedBufLen))
+				result = unpack_system_information_schedule_indication(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_REQUEST:
+			if (check_unpack_length(NFAPI_SYSTEM_INFORMATION_REQUEST, unpackedBufLen))
+				result = unpack_system_information_request(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_RESPONSE:
+			if (check_unpack_length(NFAPI_SYSTEM_INFORMATION_RESPONSE, unpackedBufLen))
+				result = unpack_system_information_response(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result =  -1;
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_INDICATION:
+			if (check_unpack_length(NFAPI_SYSTEM_INFORMATION_INDICATION, unpackedBufLen))
+				result = unpack_system_information_indication(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result =  -1;
+			break;
+
+		case NFAPI_NMM_STOP_REQUEST:
+			if (check_unpack_length(NFAPI_NMM_STOP_REQUEST, unpackedBufLen))
+				result = unpack_nmm_stop_request(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		case NFAPI_NMM_STOP_RESPONSE:
+			if (check_unpack_length(NFAPI_NMM_STOP_RESPONSE, unpackedBufLen))
+				result = unpack_nmm_stop_response(&pReadPackedMessage, end , pMessageHeader, config);
+			else
+				result = -1;
+			break;
+
+		default:
+			if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && 
+			   pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
+			{
+				if(config && config->unpack_p4_p5_vendor_extension)
+				{
+					result = (config->unpack_p4_p5_vendor_extension)(pMessageHeader, &pReadPackedMessage, end, config);
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve decoder provided\n", __FUNCTION__, pMessageHeader->message_id);
+				}
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown P4 message ID %d\n", __FUNCTION__, pMessageHeader->message_id);
+			}
+			break;
+	}
+
+	if(result == 0)
+		return -1;
+
+	return result;
+}
diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
new file mode 100644
index 0000000000000000000000000000000000000000..b3b9b534917a8e167d2d531ad8385bd96da28fa9
--- /dev/null
+++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
@@ -0,0 +1,1799 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sched.h>
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <pthread.h>
+
+#include <nfapi_interface.h>
+#include <nfapi.h>
+#include <debug.h>
+
+
+// Pack routines
+
+static uint8_t pack_pnf_param_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_param_request_t* request = (nfapi_pnf_param_request_t*)msg;
+	return pack_vendor_extension_tlv(request->vendor_extension, ppWritePackedMsg, end, config);
+}
+
+static uint8_t pack_pnf_param_general_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_param_general_t* value = (nfapi_pnf_param_general_t*)tlv;
+
+	return ( push8(value->nfapi_sync_mode, ppWritePackedMsg, end) &&
+			 push8(value->location_mode, ppWritePackedMsg, end) &&
+			 push16(value->location_coordinates_length, ppWritePackedMsg, end) &&
+			 pusharray8(value->location_coordinates, NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH, value->location_coordinates_length, ppWritePackedMsg, end) &&
+			 push32(value->dl_config_timing, ppWritePackedMsg, end) &&
+			 push32(value->tx_timing, ppWritePackedMsg, end) &&
+			 push32(value->ul_config_timing, ppWritePackedMsg, end) &&
+			 push32(value->hi_dci0_timing, ppWritePackedMsg, end) &&
+			 push16(value->maximum_number_phys, ppWritePackedMsg, end) &&
+			 push16(value->maximum_total_bandwidth, ppWritePackedMsg, end) &&
+			 push8(value->maximum_total_number_dl_layers, ppWritePackedMsg, end) &&
+			 push8(value->maximum_total_number_ul_layers, ppWritePackedMsg, end) &&
+			 push8(value->shared_bands, ppWritePackedMsg, end) &&
+			 push8(value->shared_pa, ppWritePackedMsg, end) &&
+			 pushs16(value->maximum_total_power, ppWritePackedMsg, end) &&
+			 pusharray8(value->oui, NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH, NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_rf_config_info(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_rf_config_info_t* rf = (nfapi_rf_config_info_t*)elem;
+
+	return (push16(rf->rf_config_index, ppWritePackedMsg, end));
+}
+
+
+static uint8_t pack_pnf_phy_info(void* elem, uint8_t **ppWritePackedMsg, uint8_t* end)
+{
+	nfapi_pnf_phy_info_t* phy = (nfapi_pnf_phy_info_t*)elem;
+
+	return (  push16(phy->phy_config_index, ppWritePackedMsg, end) &&
+			  push16(phy->number_of_rfs, ppWritePackedMsg, end) &&
+			  packarray(phy->rf_config, sizeof(nfapi_rf_config_info_t), NFAPI_MAX_PNF_PHY_RF_CONFIG, phy->number_of_rfs, ppWritePackedMsg, end, &pack_rf_config_info) &&
+			  push16(phy->number_of_rf_exclusions, ppWritePackedMsg, end) &&
+			  packarray(phy->excluded_rf_config, sizeof(nfapi_rf_config_info_t), NFAPI_MAX_PNF_PHY_RF_CONFIG, phy->number_of_rf_exclusions, ppWritePackedMsg, end, &pack_rf_config_info) &&
+			  push16(phy->downlink_channel_bandwidth_supported, ppWritePackedMsg, end) &&
+			  push16(phy->uplink_channel_bandwidth_supported, ppWritePackedMsg, end) &&
+			  push8(phy->number_of_dl_layers_supported, ppWritePackedMsg, end) &&
+			  push8(phy->number_of_ul_layers_supported, ppWritePackedMsg, end) &&
+			  push16(phy->maximum_3gpp_release_supported, ppWritePackedMsg, end) &&
+			  push8(phy->nmm_modes_supported, ppWritePackedMsg, end));
+
+
+}
+
+static uint8_t pack_pnf_phy_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_t* value = (nfapi_pnf_phy_t*)tlv;
+
+	return ( push16(value->number_of_phys, ppWritePackedMsg, end) &&
+			 packarray(value->phy, sizeof(nfapi_pnf_phy_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, ppWritePackedMsg, end, &pack_pnf_phy_info));
+}
+
+static uint8_t pack_pnf_rf_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_rf_t* value = (nfapi_pnf_rf_t*)tlv;
+	uint16_t rf_index = 0;
+
+	if(push16(value->number_of_rfs, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	for(; rf_index < value->number_of_rfs; ++rf_index)
+	{
+		if( !(push16(value->rf[rf_index].rf_config_index, ppWritePackedMsg, end) &&
+			  push16(value->rf[rf_index].band, ppWritePackedMsg, end) &&
+			  pushs16(value->rf[rf_index].maximum_transmit_power, ppWritePackedMsg, end) &&
+			  pushs16(value->rf[rf_index].minimum_transmit_power, ppWritePackedMsg, end) &&
+			  push8(value->rf[rf_index].number_of_antennas_suppported, ppWritePackedMsg, end) &&
+			  push32(value->rf[rf_index].minimum_downlink_frequency, ppWritePackedMsg, end) &&
+			  push32(value->rf[rf_index].maximum_downlink_frequency, ppWritePackedMsg, end) &&
+			  push32(value->rf[rf_index].minimum_uplink_frequency, ppWritePackedMsg, end) &&
+			  push32(value->rf[rf_index].maximum_uplink_frequency, ppWritePackedMsg, end)))
+			return 0;
+	}
+
+	return 1;
+}
+static uint8_t pack_pnf_phy_rel10_info(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel10_info_t* phy = (nfapi_pnf_phy_rel10_info_t*)elem;
+
+	return(push16(phy->phy_config_index, ppWritePackedMsg, end) &&
+		   push16(phy->transmission_mode_7_supported, ppWritePackedMsg, end) &&
+		   push16(phy->transmission_mode_8_supported, ppWritePackedMsg, end) &&
+		   push16(phy->two_antenna_ports_for_pucch, ppWritePackedMsg, end) &&
+		   push16(phy->transmission_mode_9_supported, ppWritePackedMsg, end) &&
+		   push16(phy->simultaneous_pucch_pusch, ppWritePackedMsg, end) &&
+		   push16(phy->four_layer_tx_with_tm3_and_tm4, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_pnf_phy_rel10_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel10_t* value = (nfapi_pnf_phy_rel10_t*)tlv;
+
+	return (push16(value->number_of_phys, ppWritePackedMsg, end) &&
+			packarray(value->phy, sizeof(nfapi_pnf_phy_rel10_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, ppWritePackedMsg, end, &pack_pnf_phy_rel10_info));
+
+}
+
+static uint8_t pack_pnf_phy_rel11_info(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel11_info_t* phy = (nfapi_pnf_phy_rel11_info_t*)elem;
+		
+	return (push16(phy->phy_config_index, ppWritePackedMsg, end) &&
+			push16(phy->edpcch_supported, ppWritePackedMsg, end) &&
+			push16(phy->multi_ack_csi_reporting, ppWritePackedMsg, end) &&
+			push16(phy->pucch_tx_diversity, ppWritePackedMsg, end) &&
+			push16(phy->ul_comp_supported, ppWritePackedMsg, end) &&
+			push16(phy->transmission_mode_5_supported, ppWritePackedMsg, end ));
+}
+static uint8_t pack_pnf_phy_rel11_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel11_t* value = (nfapi_pnf_phy_rel11_t*)tlv;
+
+	return (push16(value->number_of_phys, ppWritePackedMsg, end) &&
+			packarray(value->phy, sizeof(nfapi_pnf_phy_rel11_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, ppWritePackedMsg, end, &pack_pnf_phy_rel11_info));
+}
+static uint8_t pack_pnf_phy_rel12_info(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel12_info_t* phy = (nfapi_pnf_phy_rel12_info_t*)elem;
+
+	return( push16(phy->phy_config_index, ppWritePackedMsg, end) &&
+			push16(phy->csi_subframe_set, ppWritePackedMsg, end) &&
+			push16(phy->enhanced_4tx_codebook, ppWritePackedMsg, end) &&
+			push16(phy->drs_supported, ppWritePackedMsg, end) &&
+			push16(phy->ul_64qam_supported, ppWritePackedMsg, end) &&
+			push16(phy->transmission_mode_10_supported, ppWritePackedMsg, end) &&
+			push16(phy->alternative_bts_indices, ppWritePackedMsg, end));
+}
+static uint8_t pack_pnf_phy_rel12_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel12_t* value = (nfapi_pnf_phy_rel12_t*)tlv;
+
+	return (push16(value->number_of_phys, ppWritePackedMsg, end) &&
+			packarray(value->phy, sizeof(nfapi_pnf_phy_rel12_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, ppWritePackedMsg, end, &pack_pnf_phy_rel12_info));
+
+}
+
+static uint8_t pack_pnf_phy_rel13_info(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel13_info_t* phy = (nfapi_pnf_phy_rel13_info_t*)elem;
+		
+	return( push16(phy->phy_config_index, ppWritePackedMsg, end) &&
+			push16(phy->pucch_format4_supported, ppWritePackedMsg, end) &&
+			push16(phy->pucch_format5_supported, ppWritePackedMsg, end) &&
+			push16(phy->more_than_5_ca_support, ppWritePackedMsg, end) &&
+			push16(phy->laa_supported, ppWritePackedMsg, end) &&
+			push16(phy->laa_ending_in_dwpts_supported, ppWritePackedMsg, end) &&
+			push16(phy->laa_starting_in_second_slot_supported, ppWritePackedMsg, end) &&
+			push16(phy->beamforming_supported, ppWritePackedMsg, end) &&
+			push16(phy->csi_rs_enhancement_supported, ppWritePackedMsg, end) &&
+			push16(phy->drms_enhancement_supported, ppWritePackedMsg, end) &&
+			push16(phy->srs_enhancement_supported, ppWritePackedMsg, end) );
+}
+
+static uint8_t pack_pnf_phy_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel13_t* value = (nfapi_pnf_phy_rel13_t*)tlv;
+
+	return (push16(value->number_of_phys, ppWritePackedMsg, end) &&
+	        packarray(value->phy, sizeof(nfapi_pnf_phy_rel13_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, ppWritePackedMsg, end, &pack_pnf_phy_rel13_info));
+}
+
+static uint8_t pack_pnf_phy_rel13_nb_iot_info(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel13_nb_iot_info_t* phy = (nfapi_pnf_phy_rel13_nb_iot_info_t*)elem;
+		
+	return( push16(phy->phy_config_index, ppWritePackedMsg, end) &&
+			push16(phy->number_of_rfs, ppWritePackedMsg, end) &&
+			packarray(phy->rf_config, sizeof(nfapi_rf_config_info_t), NFAPI_MAX_PNF_PHY_RF_CONFIG, phy->number_of_rfs, ppWritePackedMsg, end, &pack_rf_config_info) &&
+			push16(phy->number_of_rf_exclusions, ppWritePackedMsg, end) &&
+			packarray(phy->excluded_rf_config, sizeof(nfapi_rf_config_info_t), NFAPI_MAX_PNF_PHY_RF_CONFIG, phy->number_of_rf_exclusions, ppWritePackedMsg, end, &pack_rf_config_info) &&
+			push8(phy->number_of_dl_layers_supported, ppWritePackedMsg, end) &&
+			push8(phy->number_of_ul_layers_supported, ppWritePackedMsg, end) &&
+			push16(phy->maximum_3gpp_release_supported, ppWritePackedMsg, end) &&
+			push8(phy->nmm_modes_supported, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_pnf_phy_rel13_nb_iot_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel13_nb_iot_t* value = (nfapi_pnf_phy_rel13_nb_iot_t*)tlv;
+
+	return (push16(value->number_of_phys, ppWritePackedMsg, end) &&
+	        packarray(value->phy, sizeof(nfapi_pnf_phy_rel13_nb_iot_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, ppWritePackedMsg, end, &pack_pnf_phy_rel13_nb_iot_info));
+}
+
+
+static uint8_t pack_pnf_param_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_param_response_t *pNfapiMsg = (nfapi_pnf_param_response_t*)msg;
+
+	return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_tlv(NFAPI_PNF_PARAM_GENERAL_TAG, &pNfapiMsg->pnf_param_general, ppWritePackedMsg, end, &pack_pnf_param_general_value) &&
+			pack_tlv(NFAPI_PNF_PHY_TAG, &pNfapiMsg->pnf_phy, ppWritePackedMsg, end, &pack_pnf_phy_value) &&
+			pack_tlv(NFAPI_PNF_RF_TAG, &pNfapiMsg->pnf_rf, ppWritePackedMsg, end, &pack_pnf_rf_value) &&
+			pack_tlv(NFAPI_PNF_PHY_REL10_TAG, &pNfapiMsg->pnf_phy_rel10, ppWritePackedMsg, end, &pack_pnf_phy_rel10_value) &&
+			pack_tlv(NFAPI_PNF_PHY_REL11_TAG, &pNfapiMsg->pnf_phy_rel11, ppWritePackedMsg, end, &pack_pnf_phy_rel11_value) &&
+			pack_tlv(NFAPI_PNF_PHY_REL12_TAG, &pNfapiMsg->pnf_phy_rel12, ppWritePackedMsg, end, &pack_pnf_phy_rel12_value) &&
+			pack_tlv(NFAPI_PNF_PHY_REL13_TAG, &pNfapiMsg->pnf_phy_rel13, ppWritePackedMsg, end, &pack_pnf_phy_rel13_value) &&
+			pack_tlv(NFAPI_PNF_PHY_REL13_NB_IOT_TAG, &pNfapiMsg->pnf_phy_rel13_nb_iot, ppWritePackedMsg, end, &pack_pnf_phy_rel13_nb_iot_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_phy_rf_config_info(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_phy_rf_config_info_t* rf = (nfapi_phy_rf_config_info_t*)elem;
+		
+	return (push16(rf->phy_id, ppWritePackedMsg, end) &&
+			push16(rf->phy_config_index, ppWritePackedMsg, end) &&
+			push16(rf->rf_config_index, ppWritePackedMsg, end));
+}
+		
+
+static uint8_t pack_pnf_phy_rf_config_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rf_config_t *value = (nfapi_pnf_phy_rf_config_t*)tlv;
+
+	return(push16(value->number_phy_rf_config_info, ppWritePackedMsg, end) &&
+		   packarray(value->phy_rf_config, sizeof(nfapi_phy_rf_config_info_t), NFAPI_MAX_PHY_RF_INSTANCES, value->number_phy_rf_config_info, ppWritePackedMsg, end, &pack_phy_rf_config_info));
+
+}
+
+static uint8_t pack_pnf_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_config_request_t *pNfapiMsg = (nfapi_pnf_config_request_t*)msg;
+	return ( pack_tlv(NFAPI_PNF_PHY_RF_TAG, &pNfapiMsg->pnf_phy_rf_config, ppWritePackedMsg, end, &pack_pnf_phy_rf_config_value) && 
+			 pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end , config));
+}
+
+
+static uint8_t pack_pnf_config_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_config_response_t *pNfapiMsg = (nfapi_pnf_config_response_t*)msg;
+
+	return ( push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			 pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_pnf_start_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_start_request_t *pNfapiMsg = (nfapi_pnf_start_request_t*)msg;
+	return ( pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_pnf_start_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_start_response_t *pNfapiMsg = (nfapi_pnf_start_response_t*)msg;
+
+	return( push32(pNfapiMsg->error_code, ppWritePackedMsg, end) && 
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_pnf_stop_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_stop_request_t *pNfapiMsg = (nfapi_pnf_stop_request_t*)msg;
+	return ( pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) );
+}
+
+static uint8_t pack_pnf_stop_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_stop_response_t *pNfapiMsg = (nfapi_pnf_stop_response_t*)msg;
+
+	return ( push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+		 	 pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_param_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_param_request_t *pNfapiMsg = (nfapi_param_request_t*)msg;
+	return (pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_uint16_tlv_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_uint16_tlv_t* value = (nfapi_uint16_tlv_t*)tlv;
+	return push16(value->value, ppWritePackedMsg, end);
+}
+
+static uint8_t unpack_uint16_tlv_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_uint16_tlv_t* value = (nfapi_uint16_tlv_t*)tlv;
+	return pull16(ppReadPackedMsg, &value->value, end);
+}
+static uint8_t pack_int16_tlv_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_int16_tlv_t* value = (nfapi_int16_tlv_t*)tlv;
+	return pushs16(value->value, ppWritePackedMsg, end);
+}
+
+static uint8_t unpack_int16_tlv_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_int16_tlv_t* value = (nfapi_int16_tlv_t*)tlv;
+	return pulls16(ppReadPackedMsg, &value->value, end);
+}
+
+static uint8_t pack_uint8_tlv_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_uint8_tlv_t* value = (nfapi_uint8_tlv_t*)tlv;
+	return push8(value->value, ppWritePackedMsg, end);
+}
+static uint8_t unpack_uint8_tlv_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_uint8_tlv_t* value = (nfapi_uint8_tlv_t*)tlv;
+	return pull8(ppReadPackedMsg, &value->value, end);
+}
+
+static uint8_t pack_ipv4_address_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ipv4_address_t* value = (nfapi_ipv4_address_t*)tlv;
+	return pusharray8(value->address, NFAPI_IPV4_ADDRESS_LENGTH, NFAPI_IPV4_ADDRESS_LENGTH, ppWritePackedMsg, end);
+}
+static uint8_t unpack_ipv4_address_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ipv4_address_t* value = (nfapi_ipv4_address_t*)tlv;
+	return pullarray8(ppReadPackedMsg, value->address, NFAPI_IPV4_ADDRESS_LENGTH, NFAPI_IPV4_ADDRESS_LENGTH, end);
+}
+static uint8_t pack_ipv6_address_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ipv6_address_t* value = (nfapi_ipv6_address_t*)tlv;
+	return pusharray8(value->address, NFAPI_IPV6_ADDRESS_LENGTH, NFAPI_IPV6_ADDRESS_LENGTH, ppWritePackedMsg, end);
+}
+static uint8_t unpack_ipv6_address_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ipv4_address_t* value = (nfapi_ipv4_address_t*)tlv;
+	return pullarray8(ppReadPackedMsg, value->address, NFAPI_IPV6_ADDRESS_LENGTH, NFAPI_IPV6_ADDRESS_LENGTH, end);
+}
+
+static uint8_t pack_rf_bands_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_rf_bands_t* value = (nfapi_rf_bands_t*)tlv;
+	
+	return ( push16(value->number_rf_bands, ppWritePackedMsg, end) &&
+			 pusharray16(value->rf_band, NFAPI_MAX_NUM_RF_BANDS, value->number_rf_bands, ppWritePackedMsg, end));
+}
+static uint8_t unpack_rf_bands_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t* end)
+{
+	nfapi_rf_bands_t* value = (nfapi_rf_bands_t*)tlv;
+
+	return ( pull16(ppReadPackedMsg, &value->number_rf_bands, end) &&
+			 pullarray16(ppReadPackedMsg, value->rf_band, NFAPI_MAX_NUM_RF_BANDS, value->number_rf_bands, end));
+}
+
+static uint8_t pack_nmm_frequency_bands_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nmm_frequency_bands_t* value = (nfapi_nmm_frequency_bands_t*)tlv;
+	
+	return( push16(value->number_of_rf_bands, ppWritePackedMsg, end) &&
+			pusharray16(value->bands, NFAPI_MAX_NMM_FREQUENCY_BANDS, value->number_of_rf_bands, ppWritePackedMsg, end));
+}
+static uint8_t unpack_nmm_frequency_bands_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nmm_frequency_bands_t* value = (nfapi_nmm_frequency_bands_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &value->number_of_rf_bands, end) &&
+			 pullarray16(ppReadPackedMsg, value->bands, NFAPI_MAX_NMM_FREQUENCY_BANDS, value->number_of_rf_bands, end));
+}
+
+static uint8_t pack_param_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_param_response_t *pNfapiMsg = (nfapi_param_response_t*)msg;
+
+	return( push8(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			push8(pNfapiMsg->num_tlv, ppWritePackedMsg, end) &&
+			pack_tlv(NFAPI_L1_STATUS_PHY_STATE_TAG,  &pNfapiMsg->l1_status.phy_state, ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			// Do we check the phy state and then just fill those sepecified, however
+			// we do not know the duplex mode, so just attempt to pack all and assumme
+			// that the callee has set the right tlvs
+
+			pack_tlv(NFAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG, &(pNfapiMsg->phy_capabilities.dl_bandwidth_support), ppWritePackedMsg, end, &pack_uint16_tlv_value) && 
+			pack_tlv(NFAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG, &(pNfapiMsg->phy_capabilities.ul_bandwidth_support), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PHY_CAPABILITIES_DL_MODULATION_SUPPORT_TAG, &(pNfapiMsg->phy_capabilities.dl_modulation_support), ppWritePackedMsg, end, &pack_uint16_tlv_value) && 
+			pack_tlv(NFAPI_PHY_CAPABILITIES_UL_MODULATION_SUPPORT_TAG, &(pNfapiMsg->phy_capabilities.ul_modulation_support), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PHY_CAPABILITIES_PHY_ANTENNA_CAPABILITY_TAG, &(pNfapiMsg->phy_capabilities.phy_antenna_capability), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PHY_CAPABILITIES_RELEASE_CAPABILITY_TAG, &(pNfapiMsg->phy_capabilities.release_capability), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PHY_CAPABILITIES_MBSFN_CAPABILITY_TAG, &(pNfapiMsg->phy_capabilities.mbsfn_capability), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			// laa capability
+
+			pack_tlv(NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG, &(pNfapiMsg->subframe_config.duplex_mode), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG, &(pNfapiMsg->subframe_config.pcfich_power_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value)&&
+			pack_tlv(NFAPI_SUBFRAME_CONFIG_PB_TAG, &(pNfapiMsg->subframe_config.pb), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG, &(pNfapiMsg->subframe_config.dl_cyclic_prefix_type), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG, &(pNfapiMsg->subframe_config.ul_cyclic_prefix_type), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG, &(pNfapiMsg->rf_config.dl_channel_bandwidth), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG, &(pNfapiMsg->rf_config.ul_channel_bandwidth), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG, &(pNfapiMsg->rf_config.reference_signal_power), ppWritePackedMsg, end, &pack_uint16_tlv_value) && 
+			pack_tlv(NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG, &(pNfapiMsg->rf_config.tx_antenna_ports), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG, &(pNfapiMsg->rf_config.rx_antenna_ports), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG, &(pNfapiMsg->phich_config.phich_resource), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG, &(pNfapiMsg->phich_config.phich_duration), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG, &(pNfapiMsg->phich_config.phich_power_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, &(pNfapiMsg->sch_config.primary_synchronization_signal_epre_eprers), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, &(pNfapiMsg->sch_config.secondary_synchronization_signal_epre_eprers), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG, &(pNfapiMsg->sch_config.physical_cell_id), ppWritePackedMsg, end ,&pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG, &(pNfapiMsg->prach_config.configuration_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG, &(pNfapiMsg->prach_config.root_sequence_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG, &(pNfapiMsg->prach_config.zero_correlation_zone_configuration), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG, &(pNfapiMsg->prach_config.high_speed_flag), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG, &(pNfapiMsg->prach_config.frequency_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG, &(pNfapiMsg->pusch_config.hopping_mode), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG, &(pNfapiMsg->pusch_config.hopping_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG, &(pNfapiMsg->pusch_config.number_of_subbands), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG, &(pNfapiMsg->pucch_config.delta_pucch_shift), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG, &(pNfapiMsg->pucch_config.n_cqi_rb), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PUCCH_CONFIG_N_AN_CS_TAG, &(pNfapiMsg->pucch_config.n_an_cs), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG, &(pNfapiMsg->pucch_config.n1_pucch_an), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG, &(pNfapiMsg->srs_config.bandwidth_configuration), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG, &(pNfapiMsg->srs_config.max_up_pts), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG, &(pNfapiMsg->srs_config.srs_subframe_configuration), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG, &(pNfapiMsg->srs_config.srs_acknack_srs_simultaneous_transmission), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG, &(pNfapiMsg->uplink_reference_signal_config.uplink_rs_hopping), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG, &(pNfapiMsg->uplink_reference_signal_config.group_assignment), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG, &(pNfapiMsg->uplink_reference_signal_config.cyclic_shift_1_for_drms), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG, &(pNfapiMsg->tdd_frame_structure_config.subframe_assignment), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG, &(pNfapiMsg->tdd_frame_structure_config.special_subframe_patterns), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG, &(pNfapiMsg->l23_config.data_report_mode), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_L23_CONFIG_SFNSF_TAG, &(pNfapiMsg->l23_config.sfnsf), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4), ppWritePackedMsg, end, &pack_ipv4_address_value) &&
+			pack_tlv(NFAPI_NFAPI_P7_VNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6), ppWritePackedMsg, end, &pack_ipv6_address_value) &&
+
+			pack_tlv(NFAPI_NFAPI_P7_VNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_port), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4), ppWritePackedMsg, end, &pack_ipv4_address_value) &&
+			pack_tlv(NFAPI_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), ppWritePackedMsg, end, &pack_ipv6_address_value) &&
+
+			pack_tlv(NFAPI_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			pack_tlv(NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.dl_ue_per_sf), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+			pack_tlv(NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.ul_ue_per_sf), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+
+			pack_tlv(NFAPI_NFAPI_RF_BANDS_TAG, &(pNfapiMsg->nfapi_config.rf_bands), ppWritePackedMsg, end, &pack_rf_bands_value) &&
+
+			pack_tlv(NFAPI_NFAPI_TIMING_WINDOW_TAG, &(pNfapiMsg->nfapi_config.timing_window), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+			pack_tlv(NFAPI_NFAPI_TIMING_INFO_MODE_TAG, &(pNfapiMsg->nfapi_config.timing_info_mode), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+			pack_tlv(NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG, &(pNfapiMsg->nfapi_config.timing_info_period), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+
+			pack_tlv(NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, &(pNfapiMsg->nfapi_config.max_transmit_power), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_NFAPI_EARFCN_TAG, &(pNfapiMsg->nfapi_config.earfcn), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+
+			pack_tlv(NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_gsm_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) &&
+			pack_tlv(NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_umts_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) &&
+			pack_tlv(NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_lte_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) &&
+			pack_tlv(NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG, &(pNfapiMsg->nfapi_config.nmm_uplink_rssi_supported), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) );
+
+}
+
+static uint8_t pack_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_config_request_t *pNfapiMsg = (nfapi_config_request_t*)msg;
+
+	return ( push8(pNfapiMsg->num_tlv, ppWritePackedMsg, end) &&
+
+			 // Do we check the phy state and then just fill those sepecified, however
+			 // we do not know the duplex mode, so just attempt to pack all and assumme
+			 // that the callee has set the right tlvs
+
+			 pack_tlv(NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG, &(pNfapiMsg->subframe_config.duplex_mode), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG, &(pNfapiMsg->subframe_config.pcfich_power_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_SUBFRAME_CONFIG_PB_TAG, &(pNfapiMsg->subframe_config.pb), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG, &(pNfapiMsg->subframe_config.dl_cyclic_prefix_type), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG, &(pNfapiMsg->subframe_config.ul_cyclic_prefix_type), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG, &(pNfapiMsg->rf_config.dl_channel_bandwidth), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG, &(pNfapiMsg->rf_config.ul_channel_bandwidth), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG, &(pNfapiMsg->rf_config.reference_signal_power), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG, &(pNfapiMsg->rf_config.tx_antenna_ports), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG, &(pNfapiMsg->rf_config.rx_antenna_ports), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG, &(pNfapiMsg->phich_config.phich_resource), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG, &(pNfapiMsg->phich_config.phich_duration), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG, &(pNfapiMsg->phich_config.phich_power_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, &(pNfapiMsg->sch_config.primary_synchronization_signal_epre_eprers), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, &(pNfapiMsg->sch_config.secondary_synchronization_signal_epre_eprers), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG, &(pNfapiMsg->sch_config.physical_cell_id), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG, &(pNfapiMsg->prach_config.configuration_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG, &(pNfapiMsg->prach_config.root_sequence_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG, &(pNfapiMsg->prach_config.zero_correlation_zone_configuration), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG, &(pNfapiMsg->prach_config.high_speed_flag), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG, &(pNfapiMsg->prach_config.frequency_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG, &(pNfapiMsg->pusch_config.hopping_mode), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG, &(pNfapiMsg->pusch_config.hopping_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG, &(pNfapiMsg->pusch_config.number_of_subbands), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG, &(pNfapiMsg->pucch_config.delta_pucch_shift), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG, &(pNfapiMsg->pucch_config.n_cqi_rb), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PUCCH_CONFIG_N_AN_CS_TAG, &(pNfapiMsg->pucch_config.n_an_cs), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG, &(pNfapiMsg->pucch_config.n1_pucch_an), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG, &(pNfapiMsg->srs_config.bandwidth_configuration), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG, &(pNfapiMsg->srs_config.max_up_pts), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG, &(pNfapiMsg->srs_config.srs_subframe_configuration), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG, &(pNfapiMsg->srs_config.srs_acknack_srs_simultaneous_transmission), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG, &(pNfapiMsg->uplink_reference_signal_config.uplink_rs_hopping), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG, &(pNfapiMsg->uplink_reference_signal_config.group_assignment), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG, &(pNfapiMsg->uplink_reference_signal_config.cyclic_shift_1_for_drms), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_PDSCH_TAG, &(pNfapiMsg->laa_config.ed_threshold_lbt_pdsch), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_DRS_TAG, &(pNfapiMsg->laa_config.ed_threshold_lbt_drs), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_LAA_CONFIG_PD_THRESHOLD_TAG, &(pNfapiMsg->laa_config.pd_threshold), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_LAA_CONFIG_MULTI_CARRIER_TYPE_TAG, &(pNfapiMsg->laa_config.multi_carrier_type), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_LAA_CONFIG_MULTI_CARRIER_TX_TAG, &(pNfapiMsg->laa_config.multi_carrier_tx), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_LAA_CONFIG_MULTI_CARRIER_FREEZE_TAG, &(pNfapiMsg->laa_config.multi_carrier_freeze), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_LAA_CONFIG_TX_ANTENNA_PORTS_FOR_DRS_TAG, &(pNfapiMsg->laa_config.tx_antenna_ports_drs), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_LAA_CONFIG_TRANSMISSION_POWER_FOR_DRS_TAG, &(pNfapiMsg->laa_config.tx_power_drs), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG, &(pNfapiMsg->emtc_config.pbch_repetitions_enable_r13), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CATM_ROOT_SEQUENCE_INDEX_TAG, &(pNfapiMsg->emtc_config.prach_catm_root_sequence_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CATM_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG, &(pNfapiMsg->emtc_config.prach_catm_zero_correlation_zone_configuration), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CATM_HIGH_SPEED_FLAG, &(pNfapiMsg->emtc_config.prach_catm_high_speed_flag), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_0_enable), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_0_configuration_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_0_frequency_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_0_starting_subframe_periodicity), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_0_hopping_enable), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_0_hopping_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_1_enable), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_1_configuration_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_1_frequency_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_1_starting_subframe_periodicity), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_1_hopping_enable), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_1_hopping_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_2_enable), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_2_configuration_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_2_frequency_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_2_starting_subframe_periodicity), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_2_hopping_enable), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_2_hopping_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_3_enable), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_3_configuration_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_3_frequency_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_3_starting_subframe_periodicity), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_3_hopping_enable), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG, &(pNfapiMsg->emtc_config.prach_ce_level_3_hopping_offset), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG, &(pNfapiMsg->emtc_config.pucch_interval_ulhoppingconfigcommonmodea), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG, &(pNfapiMsg->emtc_config.pucch_interval_ulhoppingconfigcommonmodeb), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG, &(pNfapiMsg->tdd_frame_structure_config.subframe_assignment), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG, &(pNfapiMsg->tdd_frame_structure_config.special_subframe_patterns), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+			 pack_tlv(NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG, &(pNfapiMsg->l23_config.data_report_mode), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_L23_CONFIG_SFNSF_TAG, &(pNfapiMsg->l23_config.sfnsf), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+
+			 pack_tlv(NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4), ppWritePackedMsg, end, &pack_ipv4_address_value) &&
+			 pack_tlv(NFAPI_NFAPI_P7_VNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6), ppWritePackedMsg, end, &pack_ipv6_address_value) &&
+			 pack_tlv(NFAPI_NFAPI_P7_VNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_port), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4), ppWritePackedMsg, end, &pack_ipv4_address_value) &&
+			 pack_tlv(NFAPI_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), ppWritePackedMsg, end, &pack_ipv6_address_value) &&
+			 pack_tlv(NFAPI_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.dl_ue_per_sf), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+			 pack_tlv(NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.ul_ue_per_sf), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+
+			 pack_tlv(NFAPI_PHY_RF_BANDS_TAG, &(pNfapiMsg->nfapi_config.rf_bands), ppWritePackedMsg, end, &pack_rf_bands_value) &&
+
+			 pack_tlv(NFAPI_NFAPI_TIMING_WINDOW_TAG, &(pNfapiMsg->nfapi_config.timing_window), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+			 pack_tlv(NFAPI_NFAPI_TIMING_INFO_MODE_TAG, &(pNfapiMsg->nfapi_config.timing_info_mode), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+			 pack_tlv(NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG, &(pNfapiMsg->nfapi_config.timing_info_period), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+
+			 pack_tlv(NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, &(pNfapiMsg->nfapi_config.max_transmit_power), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			 pack_tlv(NFAPI_NFAPI_EARFCN_TAG, &(pNfapiMsg->nfapi_config.earfcn), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+
+
+			 pack_tlv(NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_gsm_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) &&
+			 pack_tlv(NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_umts_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) &&
+			 pack_tlv(NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_lte_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) &&
+			 pack_tlv(NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG, &(pNfapiMsg->nfapi_config.nmm_uplink_rssi_supported), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
+
+			 pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) );
+}
+
+static uint8_t pack_config_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_config_response_t *pNfapiMsg = (nfapi_config_response_t*)msg;
+
+	return ( push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			 pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) );
+}
+
+static uint8_t pack_start_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_start_request_t *pNfapiMsg = (nfapi_start_request_t*)msg;
+	return pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
+}
+
+static uint8_t pack_start_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_start_response_t *pNfapiMsg = (nfapi_start_response_t*)msg;
+
+	return ( push32(pNfapiMsg->error_code, ppWritePackedMsg, end ) &&
+			 pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) );
+}
+
+static uint8_t pack_stop_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_stop_request_t *pNfapiMsg = (nfapi_stop_request_t*)msg;
+	return pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
+}
+
+static uint8_t pack_stop_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_stop_response_t *pNfapiMsg = (nfapi_stop_response_t*)msg;
+
+	return ( push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			 pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) );
+}
+
+static uint8_t pack_measurement_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_measurement_request_t *pNfapiMsg = (nfapi_measurement_request_t*)msg;
+
+	return( pack_tlv(NFAPI_MEASUREMENT_REQUEST_DL_RS_XTX_POWER_TAG, &(pNfapiMsg->dl_rs_tx_power), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_MEASUREMENT_REQUEST_RECEIVED_INTERFERENCE_POWER_TAG, &(pNfapiMsg->received_interference_power), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_tlv(NFAPI_MEASUREMENT_REQUEST_THERMAL_NOISE_POWER_TAG, &(pNfapiMsg->thermal_noise_power), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_recevied_interference_power_measurement_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_received_interference_power_measurement_t* value = (nfapi_received_interference_power_measurement_t*)tlv;
+	
+	return  ( push16(value->number_of_resource_blocks, ppWritePackedMsg, end) &&
+			  pusharrays16(value->received_interference_power, NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS, value->number_of_resource_blocks, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_measurement_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_measurement_response_t *pNfapiMsg = (nfapi_measurement_response_t*)msg;
+
+	return( push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
+			pack_tlv(NFAPI_MEASUREMENT_RESPONSE_DL_RS_POWER_MEASUREMENT_TAG, &(pNfapiMsg->dl_rs_tx_power_measurement), ppWritePackedMsg, end, &pack_int16_tlv_value) &&
+			pack_tlv(NFAPI_MEASUREMENT_RESPONSE_RECEIVED_INTERFERENCE_POWER_MEASUREMENT_TAG, &(pNfapiMsg->received_interference_power_measurement), ppWritePackedMsg, end, &pack_recevied_interference_power_measurement_value) &&
+			pack_tlv(NFAPI_MEASUREMENT_RESPONSE_THERMAL_NOISE_MEASUREMENT_TAG, &(pNfapiMsg->thermal_noise_power_measurement), ppWritePackedMsg, end, &pack_uint16_tlv_value) && 
+			pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_p5_message_body(nfapi_p4_p5_message_header_t *header, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	uint8_t result = 0;
+	// look for the specific message
+	switch (header->message_id)
+	{
+		case NFAPI_PNF_PARAM_REQUEST:
+			result = pack_pnf_param_request(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_PNF_PARAM_RESPONSE:
+			result = pack_pnf_param_response(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_PNF_CONFIG_REQUEST:
+			result = pack_pnf_config_request(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_PNF_CONFIG_RESPONSE:
+			result = pack_pnf_config_response(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_PNF_START_REQUEST:
+			result = pack_pnf_start_request(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_PNF_START_RESPONSE:
+			result = pack_pnf_start_response(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_PNF_STOP_REQUEST:
+			result = pack_pnf_stop_request(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_PNF_STOP_RESPONSE:
+			result = pack_pnf_stop_response(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_PARAM_REQUEST:
+			result = pack_param_request(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_PARAM_RESPONSE:
+			result = pack_param_response(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_CONFIG_REQUEST:
+			result = pack_config_request(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_CONFIG_RESPONSE:
+			result = pack_config_response(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_START_REQUEST:
+			result = pack_start_request(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_START_RESPONSE:
+			result = pack_start_response(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_STOP_REQUEST:
+			result = pack_stop_request(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_STOP_RESPONSE:
+			result = pack_stop_response(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_MEASUREMENT_REQUEST:
+			result = pack_measurement_request(header, ppWritePackedMsg, end, config);
+			break;
+
+		case NFAPI_MEASUREMENT_RESPONSE:
+			result = pack_measurement_response(header, ppWritePackedMsg, end, config);
+			break;
+
+		default:
+			{
+				if(header->message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
+				   header->message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
+				{
+					if(config && config->pack_p4_p5_vendor_extension)
+					{
+						result = (config->pack_p4_p5_vendor_extension)(header, ppWritePackedMsg, end, config);
+					}
+					else
+					{
+						NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve ecoder provided\n", __FUNCTION__, header->message_id);
+					}
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, header->message_id);
+				}
+			}
+			break;
+	}
+
+	return result;
+}
+
+
+// helper function for message length calculation -
+// takes the pointers to the start of message to end of message
+
+static uint32_t get_packed_msg_len(uintptr_t msgHead, uintptr_t msgEnd)
+{
+	if (msgEnd < msgHead)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "get_packed_msg_len: Error in pointers supplied %d, %d\n", msgHead, msgEnd);
+		return 0;
+	}
+
+	return (msgEnd - msgHead);
+}
+
+// Main pack function - public
+
+int nfapi_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_p4_p5_message_header_t *pMessageHeader = pMessageBuf;
+	uint8_t *pWritePackedMessage = pPackedBuf;
+	uint8_t *pPackMessageEnd = pPackedBuf + packedBufLen;
+	uint8_t *pPackedLengthField = &pWritePackedMessage[4];
+	uint32_t packedMsgLen;
+	uint16_t packedMsgLen16;
+
+	if (pMessageBuf == NULL || pPackedBuf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 Pack supplied pointers are null\n");
+		return -1;
+	}
+
+	// pack the message
+	if(push16(pMessageHeader->phy_id, &pWritePackedMessage, pPackMessageEnd) &&
+	   push16(pMessageHeader->message_id, &pWritePackedMessage, pPackMessageEnd) &&
+	   push16(0/*pMessageHeader->message_length*/, &pWritePackedMessage, pPackMessageEnd) &&
+	   push16(pMessageHeader->spare, &pWritePackedMessage, pPackMessageEnd) &&
+	   pack_p5_message_body(pMessageHeader, &pWritePackedMessage, pPackMessageEnd, config))
+	{
+		// check for a valid message length
+		packedMsgLen = get_packed_msg_len((uintptr_t)pPackedBuf, (uintptr_t)pWritePackedMessage);
+		if (packedMsgLen > 0xFFFF || packedMsgLen > packedBufLen)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "Packed message length error %d, buffer supplied %d\n", packedMsgLen, packedBufLen);
+			return -1;
+		}
+		else
+		{
+			packedMsgLen16 = (uint16_t)packedMsgLen;
+		}
+
+		// Update the message length in the header
+		if(!push16(packedMsgLen16, &pPackedLengthField, pPackMessageEnd))
+			return -1;
+
+		// return the packed length
+		return (packedMsgLen);
+	}
+	else
+	{
+		// Failed to pack the meassage
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 Failed to pack message\n");
+		return -1;
+    }
+
+}
+
+
+
+// Unpack routines
+static uint8_t  unpack_pnf_param_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_param_request_t *pNfapiMsg = (nfapi_pnf_param_request_t*)msg;
+	
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+	
+	return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_pnf_param_general_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_param_general_t* value = (nfapi_pnf_param_general_t*)tlv;
+	
+	return( pull8(ppReadPackedMsg, &value->nfapi_sync_mode, end) &&
+			pull8(ppReadPackedMsg, &value->location_mode, end) &&
+			pull16(ppReadPackedMsg, &value->location_coordinates_length, end) &&
+			pullarray8(ppReadPackedMsg, value->location_coordinates, NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH, value->location_coordinates_length, end) &&
+			pull32(ppReadPackedMsg, &value->dl_config_timing, end) &&
+			pull32(ppReadPackedMsg, &value->tx_timing, end) &&
+			pull32(ppReadPackedMsg, &value->ul_config_timing, end) &&
+			pull32(ppReadPackedMsg, &value->hi_dci0_timing, end) &&
+			pull16(ppReadPackedMsg, &value->maximum_number_phys, end) &&
+			pull16(ppReadPackedMsg, &value->maximum_total_bandwidth, end) &&
+			pull8(ppReadPackedMsg, &value->maximum_total_number_dl_layers, end) &&
+			pull8(ppReadPackedMsg, &value->maximum_total_number_ul_layers, end) &&
+			pull8(ppReadPackedMsg, &value->shared_bands, end) &&
+			pull8(ppReadPackedMsg, &value->shared_pa, end) &&
+			pulls16(ppReadPackedMsg, &value->maximum_total_power, end) &&
+			pullarray8(ppReadPackedMsg, value->oui, NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH, NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH, end));
+}
+
+static uint8_t unpack_rf_config_info(void* elem, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_rf_config_info_t* info = (nfapi_rf_config_info_t*)elem;
+	return pull16(ppReadPackedMsg, &info->rf_config_index, end);
+}
+
+static uint8_t unpack_pnf_phy_info(void* elem, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_info_t* phy = (nfapi_pnf_phy_info_t*)elem;
+
+	return ( pull16(ppReadPackedMsg, &phy->phy_config_index, end) && 
+			 pull16(ppReadPackedMsg, &phy->number_of_rfs, end) &&
+			 unpackarray(ppReadPackedMsg, phy->rf_config, sizeof(nfapi_rf_config_info_t), NFAPI_MAX_PNF_PHY_RF_CONFIG, phy->number_of_rfs, end, &unpack_rf_config_info) &&
+			 pull16(ppReadPackedMsg, &phy->number_of_rf_exclusions, end) &&
+			 unpackarray(ppReadPackedMsg, phy->excluded_rf_config, sizeof(nfapi_rf_config_info_t), NFAPI_MAX_PNF_PHY_RF_CONFIG, phy->number_of_rf_exclusions, end, &unpack_rf_config_info) &&
+			 pull16(ppReadPackedMsg, &phy->downlink_channel_bandwidth_supported, end) &&
+			 pull16(ppReadPackedMsg, &phy->uplink_channel_bandwidth_supported, end) &&
+			 pull8(ppReadPackedMsg, &phy->number_of_dl_layers_supported, end) &&
+			 pull8(ppReadPackedMsg, &phy->number_of_ul_layers_supported, end) &&
+			 pull16(ppReadPackedMsg, &phy->maximum_3gpp_release_supported, end) &&
+			 pull8(ppReadPackedMsg, &phy->nmm_modes_supported, end));
+}
+
+
+static uint8_t unpack_pnf_phy_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_t* value = (nfapi_pnf_phy_t*)tlv;
+	return ( pull16(ppReadPackedMsg, &value->number_of_phys, end) && 
+			 unpackarray(ppReadPackedMsg, value->phy, sizeof(nfapi_pnf_phy_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, end, &unpack_pnf_phy_info));
+}
+
+static uint8_t unpack_pnf_rf_info(void* elem, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_rf_info_t* rf = (nfapi_pnf_rf_info_t*)elem;
+		
+	return( pull16(ppReadPackedMsg, &rf->rf_config_index, end) &&
+			pull16(ppReadPackedMsg, &rf->band, end) &&
+			pulls16(ppReadPackedMsg, &rf->maximum_transmit_power, end) &&
+			pulls16(ppReadPackedMsg, &rf->minimum_transmit_power, end) &&
+			pull8(ppReadPackedMsg, &rf->number_of_antennas_suppported, end) &&
+			pull32(ppReadPackedMsg, &rf->minimum_downlink_frequency, end) &&
+			pull32(ppReadPackedMsg, &rf->maximum_downlink_frequency, end) &&
+			pull32(ppReadPackedMsg, &rf->minimum_uplink_frequency, end) &&
+			pull32(ppReadPackedMsg, &rf->maximum_uplink_frequency, end));
+
+}
+static uint8_t unpack_pnf_rf_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_rf_t* value = (nfapi_pnf_rf_t*)tlv;
+
+	return ( pull16(ppReadPackedMsg, &value->number_of_rfs, end) &&
+		     unpackarray(ppReadPackedMsg, value->rf, sizeof(nfapi_pnf_rf_info_t), NFAPI_MAX_PNF_RF, value->number_of_rfs, end, &unpack_pnf_rf_info));
+}
+
+static uint8_t unpack_pnf_phy_rel10_info(void* elem, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel10_info_t* phy = (nfapi_pnf_phy_rel10_info_t*)elem;
+		
+	return( pull16(ppReadPackedMsg, &phy->phy_config_index, end) &&
+			pull16(ppReadPackedMsg, &phy->transmission_mode_7_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->transmission_mode_8_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->two_antenna_ports_for_pucch, end) &&
+			pull16(ppReadPackedMsg, &phy->transmission_mode_9_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->simultaneous_pucch_pusch, end) &&
+			pull16(ppReadPackedMsg, &phy->four_layer_tx_with_tm3_and_tm4, end));
+
+
+}
+static uint8_t unpack_pnf_phy_rel10_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel10_t* value = (nfapi_pnf_phy_rel10_t*)tlv;
+
+	return ( pull16(ppReadPackedMsg, &value->number_of_phys, end) &&
+			 unpackarray(ppReadPackedMsg, value->phy, sizeof(nfapi_pnf_phy_rel10_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, end, &unpack_pnf_phy_rel10_info));
+
+}
+
+
+static uint8_t unpack_pnf_phy_rel11_info(void* elem, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel11_info_t* phy = (nfapi_pnf_phy_rel11_info_t*)elem;
+
+	return( pull16(ppReadPackedMsg, &phy->phy_config_index, end) &&
+			pull16(ppReadPackedMsg, &phy->edpcch_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->multi_ack_csi_reporting, end ) &&
+			pull16(ppReadPackedMsg, &phy->pucch_tx_diversity, end) &&
+			pull16(ppReadPackedMsg, &phy->ul_comp_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->transmission_mode_5_supported, end));
+}
+
+static uint8_t unpack_pnf_phy_rel11_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel11_t* value = (nfapi_pnf_phy_rel11_t*)tlv;
+
+	return ( pull16(ppReadPackedMsg, &value->number_of_phys, end) &&
+			 unpackarray(ppReadPackedMsg, value->phy, sizeof(nfapi_pnf_phy_rel11_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, end, &unpack_pnf_phy_rel11_info));
+
+}
+
+static uint8_t unpack_phy_phy_rel12_info(void* elem, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel12_info_t* phy = (nfapi_pnf_phy_rel12_info_t*)elem;
+
+	return( pull16(ppReadPackedMsg, &phy->phy_config_index, end) &&
+			pull16(ppReadPackedMsg, &phy->csi_subframe_set, end) &&
+			pull16(ppReadPackedMsg, &phy->enhanced_4tx_codebook, end) &&
+			pull16(ppReadPackedMsg, &phy->drs_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->ul_64qam_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->transmission_mode_10_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->alternative_bts_indices, end));
+}
+
+static uint8_t unpack_pnf_phy_rel12_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel12_t* value = (nfapi_pnf_phy_rel12_t*)tlv;
+
+	return (pull16(ppReadPackedMsg, &value->number_of_phys, end) &&
+			unpackarray(ppReadPackedMsg, value->phy, sizeof(nfapi_pnf_phy_rel12_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, end, &unpack_phy_phy_rel12_info));
+
+}
+
+static uint8_t unpack_pnf_phy_rel13_info(void *elem, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel13_info_t* phy = (nfapi_pnf_phy_rel13_info_t*)elem;
+
+	return( pull16(ppReadPackedMsg, &phy->phy_config_index, end) &&
+			pull16(ppReadPackedMsg, &phy->pucch_format4_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->pucch_format5_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->more_than_5_ca_support, end) &&
+			pull16(ppReadPackedMsg, &phy->laa_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->laa_ending_in_dwpts_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->laa_starting_in_second_slot_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->beamforming_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->csi_rs_enhancement_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->drms_enhancement_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->srs_enhancement_supported, end));
+}
+
+static uint8_t unpack_pnf_phy_rel13_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel13_t* value = (nfapi_pnf_phy_rel13_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &value->number_of_phys, end) &&
+			 unpackarray(ppReadPackedMsg, value->phy, sizeof(nfapi_pnf_phy_rel13_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, end, &unpack_pnf_phy_rel13_info));
+}
+
+static uint8_t unpack_pnf_phy_rel13_nb_info_info(void *elem, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel13_nb_iot_info_t* phy = (nfapi_pnf_phy_rel13_nb_iot_info_t*)elem;
+
+	return( pull16(ppReadPackedMsg, &phy->phy_config_index, end) &&
+			pull16(ppReadPackedMsg, &phy->number_of_rfs, end) &&
+			unpackarray(ppReadPackedMsg, phy->rf_config, sizeof(nfapi_rf_config_info_t), NFAPI_MAX_PNF_PHY_RF_CONFIG, phy->number_of_rfs, end, &unpack_rf_config_info) &&
+			pull16(ppReadPackedMsg, &phy->number_of_rf_exclusions, end) &&
+			unpackarray(ppReadPackedMsg, phy->excluded_rf_config, sizeof(nfapi_rf_config_info_t), NFAPI_MAX_PNF_PHY_RF_CONFIG, phy->number_of_rf_exclusions, end, &unpack_rf_config_info) &&
+			pull8(ppReadPackedMsg, &phy->number_of_dl_layers_supported, end) &&
+			pull8(ppReadPackedMsg, &phy->number_of_ul_layers_supported, end) &&
+			pull16(ppReadPackedMsg, &phy->maximum_3gpp_release_supported, end) &&
+			pull8(ppReadPackedMsg, &phy->nmm_modes_supported, end));
+}
+
+static uint8_t unpack_pnf_phy_rel13_nb_iot_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rel13_nb_iot_t* value = (nfapi_pnf_phy_rel13_nb_iot_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &value->number_of_phys, end) &&
+			 unpackarray(ppReadPackedMsg, value->phy, sizeof(nfapi_pnf_phy_rel13_nb_iot_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, end, &unpack_pnf_phy_rel13_nb_info_info));
+}
+
+
+
+static uint8_t unpack_pnf_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_param_response_t *pNfapiMsg = (nfapi_pnf_param_response_t*)msg;
+	
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_PNF_PARAM_GENERAL_TAG, &pNfapiMsg->pnf_param_general, &unpack_pnf_param_general_value},
+		{ NFAPI_PNF_PHY_TAG, &pNfapiMsg->pnf_phy, &unpack_pnf_phy_value},
+		{ NFAPI_PNF_RF_TAG, &pNfapiMsg->pnf_rf, &unpack_pnf_rf_value},
+		{ NFAPI_PNF_PHY_REL10_TAG, &pNfapiMsg->pnf_phy_rel10, &unpack_pnf_phy_rel10_value},
+		{ NFAPI_PNF_PHY_REL11_TAG, &pNfapiMsg->pnf_phy_rel11, &unpack_pnf_phy_rel11_value},
+		{ NFAPI_PNF_PHY_REL12_TAG, &pNfapiMsg->pnf_phy_rel12, &unpack_pnf_phy_rel12_value},
+		{ NFAPI_PNF_PHY_REL13_TAG, &pNfapiMsg->pnf_phy_rel13, &unpack_pnf_phy_rel13_value},
+		{ NFAPI_PNF_PHY_REL13_NB_IOT_TAG, &pNfapiMsg->pnf_phy_rel13_nb_iot, &unpack_pnf_phy_rel13_nb_iot_value},
+	};
+
+	return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			 unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_phy_rf_config_info(void* elem, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_phy_rf_config_info_t* rf = (nfapi_phy_rf_config_info_t*)elem;
+		
+	return( pull16(ppReadPackedMsg, &rf->phy_id, end) &&
+			pull16(ppReadPackedMsg, &rf->phy_config_index, end) &&
+			pull16(ppReadPackedMsg, &rf->rf_config_index, end));
+
+}
+
+static uint8_t unpack_pnf_phy_rf_config_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_pnf_phy_rf_config_t* value = (nfapi_pnf_phy_rf_config_t*)tlv;
+
+	return ( pull16(ppReadPackedMsg, &value->number_phy_rf_config_info, end) &&
+			 unpackarray(ppReadPackedMsg, value->phy_rf_config, sizeof(nfapi_phy_rf_config_info_t), NFAPI_MAX_PHY_RF_INSTANCES, value->number_phy_rf_config_info, end, &unpack_phy_rf_config_info));
+}
+
+static uint8_t unpack_pnf_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_config_request_t *pNfapiMsg = (nfapi_pnf_config_request_t*)msg;
+	
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_PNF_PHY_RF_TAG, &pNfapiMsg->pnf_phy_rf_config, &unpack_pnf_phy_rf_config_value},
+	};
+
+	return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension);
+}
+
+static uint8_t unpack_pnf_config_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_config_response_t *pNfapiMsg = (nfapi_pnf_config_response_t*)msg;
+	
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			 unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension)));
+
+}
+
+static uint8_t unpack_pnf_start_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_start_request_t *pNfapiMsg = (nfapi_pnf_start_request_t*)msg;
+	
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_pnf_start_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_start_response_t *pNfapiMsg = (nfapi_pnf_start_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end ) &&
+			 unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension)));
+}
+
+static uint8_t unpack_pnf_stop_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_stop_request_t *pNfapiMsg = (nfapi_pnf_stop_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_pnf_stop_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_pnf_stop_response_t *pNfapiMsg = (nfapi_pnf_stop_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			 unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension)));
+
+}
+
+static uint8_t unpack_param_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_param_request_t *pNfapiMsg = (nfapi_param_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_param_response_t *pNfapiMsg = (nfapi_param_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_L1_STATUS_PHY_STATE_TAG, &pNfapiMsg->l1_status.phy_state, &unpack_uint16_tlv_value},
+
+		{ NFAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG, &pNfapiMsg->phy_capabilities.dl_bandwidth_support, &unpack_uint16_tlv_value},
+		{ NFAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG, &pNfapiMsg->phy_capabilities.ul_bandwidth_support, &unpack_uint16_tlv_value},
+		{ NFAPI_PHY_CAPABILITIES_DL_MODULATION_SUPPORT_TAG, &pNfapiMsg->phy_capabilities.dl_modulation_support, &unpack_uint16_tlv_value},
+		{ NFAPI_PHY_CAPABILITIES_UL_MODULATION_SUPPORT_TAG, &pNfapiMsg->phy_capabilities.ul_modulation_support, &unpack_uint16_tlv_value},
+		{ NFAPI_PHY_CAPABILITIES_PHY_ANTENNA_CAPABILITY_TAG, &pNfapiMsg->phy_capabilities.phy_antenna_capability, &unpack_uint16_tlv_value},
+		{ NFAPI_PHY_CAPABILITIES_RELEASE_CAPABILITY_TAG, &pNfapiMsg->phy_capabilities.release_capability, &unpack_uint16_tlv_value},
+		{ NFAPI_PHY_CAPABILITIES_MBSFN_CAPABILITY_TAG, &pNfapiMsg->phy_capabilities.mbsfn_capability, &unpack_uint16_tlv_value},
+
+		{ NFAPI_LAA_CAPABILITY_LAA_SUPPORT_TAG, &pNfapiMsg->laa_capability.laa_support, &unpack_uint16_tlv_value},
+		{ NFAPI_LAA_CAPABILITY_PD_SENSING_LBT_SUPPORT_TAG, &pNfapiMsg->laa_capability.pd_sensing_lbt_support, &unpack_uint16_tlv_value},
+		{ NFAPI_LAA_CAPABILITY_MULTI_CARRIER_LBT_SUPPORT_TAG, &pNfapiMsg->laa_capability.multi_carrier_lbt_support, &unpack_uint16_tlv_value},
+		{ NFAPI_LAA_CAPABILITY_PARTIAL_SF_SUPPORT_TAG, &pNfapiMsg->laa_capability.partial_sf_support, &unpack_uint16_tlv_value},
+
+		{ NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG, &pNfapiMsg->subframe_config.duplex_mode, &unpack_uint16_tlv_value},
+		{ NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG, &pNfapiMsg->subframe_config.pcfich_power_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_SUBFRAME_CONFIG_PB_TAG, &pNfapiMsg->subframe_config.pb, &unpack_uint16_tlv_value},
+		{ NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG, &pNfapiMsg->subframe_config.dl_cyclic_prefix_type, &unpack_uint16_tlv_value},
+		{ NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG, &pNfapiMsg->subframe_config.ul_cyclic_prefix_type, &unpack_uint16_tlv_value},
+
+		{ NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG, &pNfapiMsg->rf_config.dl_channel_bandwidth, &unpack_uint16_tlv_value},
+		{ NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG, &pNfapiMsg->rf_config.ul_channel_bandwidth, &unpack_uint16_tlv_value},
+		{ NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG, &pNfapiMsg->rf_config.reference_signal_power, &unpack_uint16_tlv_value},
+		{ NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG, &pNfapiMsg->rf_config.tx_antenna_ports, &unpack_uint16_tlv_value},
+		{ NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG, &pNfapiMsg->rf_config.rx_antenna_ports, &unpack_uint16_tlv_value},
+
+		{ NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG, &pNfapiMsg->phich_config.phich_resource, &unpack_uint16_tlv_value},
+		{ NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG, &pNfapiMsg->phich_config.phich_duration, &unpack_uint16_tlv_value},
+		{ NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG, &pNfapiMsg->phich_config.phich_power_offset, &unpack_uint16_tlv_value},
+
+		{ NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, &pNfapiMsg->sch_config.primary_synchronization_signal_epre_eprers, &unpack_uint16_tlv_value},
+		{ NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, &pNfapiMsg->sch_config.secondary_synchronization_signal_epre_eprers, &unpack_uint16_tlv_value},
+		{ NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG, &pNfapiMsg->sch_config.physical_cell_id, &unpack_uint16_tlv_value},
+
+		{ NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG, &pNfapiMsg->prach_config.configuration_index, &unpack_uint16_tlv_value},
+		{ NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG, &pNfapiMsg->prach_config.root_sequence_index, &unpack_uint16_tlv_value},
+		{ NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG, &pNfapiMsg->prach_config.zero_correlation_zone_configuration, &unpack_uint16_tlv_value},
+		{ NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG, &pNfapiMsg->prach_config.high_speed_flag, &unpack_uint16_tlv_value},
+		{ NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG, &pNfapiMsg->prach_config.frequency_offset, &unpack_uint16_tlv_value},
+
+		{ NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG, &pNfapiMsg->pusch_config.hopping_mode, &unpack_uint16_tlv_value},
+		{ NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG, &pNfapiMsg->pusch_config.hopping_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG, &pNfapiMsg->pusch_config.number_of_subbands, &unpack_uint16_tlv_value},
+
+		{ NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG, &pNfapiMsg->pucch_config.delta_pucch_shift, &unpack_uint16_tlv_value},
+		{ NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG, &pNfapiMsg->pucch_config.n_cqi_rb, &unpack_uint16_tlv_value},
+		{ NFAPI_PUCCH_CONFIG_N_AN_CS_TAG, &pNfapiMsg->pucch_config.n_an_cs, &unpack_uint16_tlv_value},
+		{ NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG, &pNfapiMsg->pucch_config.n1_pucch_an, &unpack_uint16_tlv_value},
+
+		{ NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG, &pNfapiMsg->srs_config.bandwidth_configuration, &unpack_uint16_tlv_value},
+		{ NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG, &pNfapiMsg->srs_config.max_up_pts, &unpack_uint16_tlv_value},
+		{ NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG, &pNfapiMsg->srs_config.srs_subframe_configuration, &unpack_uint16_tlv_value},
+		{ NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG, &pNfapiMsg->srs_config.srs_acknack_srs_simultaneous_transmission, &unpack_uint16_tlv_value},
+
+		{ NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG, &pNfapiMsg->uplink_reference_signal_config.uplink_rs_hopping, &unpack_uint16_tlv_value},
+		{ NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG, &pNfapiMsg->uplink_reference_signal_config.group_assignment, &unpack_uint16_tlv_value},
+		{ NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG, &pNfapiMsg->uplink_reference_signal_config.cyclic_shift_1_for_drms, &unpack_uint16_tlv_value},
+
+		{ NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG, &pNfapiMsg->tdd_frame_structure_config.subframe_assignment, &unpack_uint16_tlv_value},
+		{ NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG, &pNfapiMsg->tdd_frame_structure_config.special_subframe_patterns, &unpack_uint16_tlv_value},
+
+		{ NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG, &pNfapiMsg->l23_config.data_report_mode, &unpack_uint16_tlv_value},
+		{ NFAPI_L23_CONFIG_SFNSF_TAG, &pNfapiMsg->l23_config.sfnsf, &unpack_uint16_tlv_value},
+
+		{ NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG, &pNfapiMsg->nfapi_config.p7_vnf_address_ipv4, &unpack_ipv4_address_value},
+		{ NFAPI_NFAPI_P7_VNF_ADDRESS_IPV6_TAG, &pNfapiMsg->nfapi_config.p7_vnf_address_ipv6, &unpack_ipv6_address_value},
+		{ NFAPI_NFAPI_P7_VNF_PORT_TAG, &pNfapiMsg->nfapi_config.p7_vnf_port, &unpack_uint16_tlv_value},
+		{ NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &pNfapiMsg->nfapi_config.p7_pnf_address_ipv4, &unpack_ipv4_address_value},
+		{ NFAPI_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &pNfapiMsg->nfapi_config.p7_pnf_address_ipv6, &unpack_ipv6_address_value},
+		{ NFAPI_NFAPI_P7_PNF_PORT_TAG, &pNfapiMsg->nfapi_config.p7_pnf_port, &unpack_uint16_tlv_value},
+		{ NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, &pNfapiMsg->nfapi_config.dl_ue_per_sf, &unpack_uint8_tlv_value},
+		{ NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG, &pNfapiMsg->nfapi_config.ul_ue_per_sf, &unpack_uint8_tlv_value},
+		{ NFAPI_NFAPI_RF_BANDS_TAG, &pNfapiMsg->nfapi_config.rf_bands, &unpack_rf_bands_value},
+		{ NFAPI_NFAPI_TIMING_WINDOW_TAG, &pNfapiMsg->nfapi_config.timing_window, &unpack_uint8_tlv_value},
+		{ NFAPI_NFAPI_TIMING_INFO_MODE_TAG, &pNfapiMsg->nfapi_config.timing_info_mode, &unpack_uint8_tlv_value},
+		{ NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG, &pNfapiMsg->nfapi_config.timing_info_period, &unpack_uint8_tlv_value},
+		{ NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, &pNfapiMsg->nfapi_config.max_transmit_power, &unpack_uint16_tlv_value},
+		{ NFAPI_NFAPI_EARFCN_TAG, &pNfapiMsg->nfapi_config.earfcn, &unpack_uint16_tlv_value},
+		{ NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG, &pNfapiMsg->nfapi_config.nmm_gsm_frequency_bands, &unpack_nmm_frequency_bands_value},
+		{ NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG, &pNfapiMsg->nfapi_config.nmm_umts_frequency_bands, &unpack_nmm_frequency_bands_value},
+		{ NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG, &pNfapiMsg->nfapi_config.nmm_lte_frequency_bands, &unpack_nmm_frequency_bands_value},
+		{ NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG, &pNfapiMsg->nfapi_config.nmm_uplink_rssi_supported, &unpack_uint8_tlv_value},
+
+	};
+
+	return ( pull8(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			 pull8(ppReadPackedMsg, &pNfapiMsg->num_tlv, end) &&
+			 unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+
+}
+
+static uint8_t unpack_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_config_request_t *pNfapiMsg = (nfapi_config_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG, &pNfapiMsg->subframe_config.duplex_mode, &unpack_uint16_tlv_value},
+		{ NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG, &pNfapiMsg->subframe_config.pcfich_power_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_SUBFRAME_CONFIG_PB_TAG, &pNfapiMsg->subframe_config.pb, &unpack_uint16_tlv_value},
+		{ NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG, &pNfapiMsg->subframe_config.dl_cyclic_prefix_type, &unpack_uint16_tlv_value},
+		{ NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG, &pNfapiMsg->subframe_config.ul_cyclic_prefix_type, &unpack_uint16_tlv_value},
+
+		{ NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG, &pNfapiMsg->rf_config.dl_channel_bandwidth, &unpack_uint16_tlv_value},
+		{ NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG, &pNfapiMsg->rf_config.ul_channel_bandwidth, &unpack_uint16_tlv_value},
+		{ NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG, &pNfapiMsg->rf_config.reference_signal_power, &unpack_uint16_tlv_value},
+		{ NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG, &pNfapiMsg->rf_config.tx_antenna_ports, &unpack_uint16_tlv_value},
+		{ NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG, &pNfapiMsg->rf_config.rx_antenna_ports, &unpack_uint16_tlv_value},
+
+		{ NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG, &pNfapiMsg->phich_config.phich_resource, &unpack_uint16_tlv_value},
+		{ NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG, &pNfapiMsg->phich_config.phich_duration, &unpack_uint16_tlv_value},
+		{ NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG, &pNfapiMsg->phich_config.phich_power_offset, &unpack_uint16_tlv_value},
+
+		{ NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, &pNfapiMsg->sch_config.primary_synchronization_signal_epre_eprers, &unpack_uint16_tlv_value},
+		{ NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, &pNfapiMsg->sch_config.secondary_synchronization_signal_epre_eprers, &unpack_uint16_tlv_value},
+		{ NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG, &pNfapiMsg->sch_config.physical_cell_id, &unpack_uint16_tlv_value},
+
+		{ NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG, &pNfapiMsg->prach_config.configuration_index, &unpack_uint16_tlv_value},
+		{ NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG, &pNfapiMsg->prach_config.root_sequence_index, &unpack_uint16_tlv_value},
+		{ NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG, &pNfapiMsg->prach_config.zero_correlation_zone_configuration, &unpack_uint16_tlv_value},
+		{ NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG, &pNfapiMsg->prach_config.high_speed_flag, &unpack_uint16_tlv_value},
+		{ NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG, &pNfapiMsg->prach_config.frequency_offset, &unpack_uint16_tlv_value},
+
+		{ NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG, &pNfapiMsg->pusch_config.hopping_mode, &unpack_uint16_tlv_value},
+		{ NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG, &pNfapiMsg->pusch_config.hopping_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG, &pNfapiMsg->pusch_config.number_of_subbands, &unpack_uint16_tlv_value},
+
+		{ NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG, &pNfapiMsg->pucch_config.delta_pucch_shift, &unpack_uint16_tlv_value},
+		{ NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG, &pNfapiMsg->pucch_config.n_cqi_rb, &unpack_uint16_tlv_value},
+		{ NFAPI_PUCCH_CONFIG_N_AN_CS_TAG, &pNfapiMsg->pucch_config.n_an_cs, &unpack_uint16_tlv_value},
+		{ NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG, &pNfapiMsg->pucch_config.n1_pucch_an, &unpack_uint16_tlv_value},
+
+		{ NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG, &pNfapiMsg->srs_config.bandwidth_configuration, &unpack_uint16_tlv_value},
+		{ NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG, &pNfapiMsg->srs_config.max_up_pts, &unpack_uint16_tlv_value},
+		{ NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG, &pNfapiMsg->srs_config.srs_subframe_configuration, &unpack_uint16_tlv_value},
+		{ NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG, &pNfapiMsg->srs_config.srs_acknack_srs_simultaneous_transmission, &unpack_uint16_tlv_value},
+
+		{ NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG, &pNfapiMsg->uplink_reference_signal_config.uplink_rs_hopping, &unpack_uint16_tlv_value},
+		{ NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG, &pNfapiMsg->uplink_reference_signal_config.group_assignment, &unpack_uint16_tlv_value},
+		{ NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG, &pNfapiMsg->uplink_reference_signal_config.cyclic_shift_1_for_drms, &unpack_uint16_tlv_value},
+
+
+		{ NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_PDSCH_TAG, &pNfapiMsg->laa_config.ed_threshold_lbt_pdsch, &unpack_uint16_tlv_value},
+		{ NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_DRS_TAG, &pNfapiMsg->laa_config.ed_threshold_lbt_drs, &unpack_uint16_tlv_value},
+		{ NFAPI_LAA_CONFIG_PD_THRESHOLD_TAG, &pNfapiMsg->laa_config.pd_threshold, &unpack_uint16_tlv_value},
+		{ NFAPI_LAA_CONFIG_MULTI_CARRIER_TYPE_TAG, &pNfapiMsg->laa_config.multi_carrier_type, &unpack_uint16_tlv_value},
+		{ NFAPI_LAA_CONFIG_MULTI_CARRIER_TX_TAG, &pNfapiMsg->laa_config.multi_carrier_tx, &unpack_uint16_tlv_value},
+		{ NFAPI_LAA_CONFIG_MULTI_CARRIER_FREEZE_TAG, &pNfapiMsg->laa_config.multi_carrier_freeze, &unpack_uint16_tlv_value},
+		{ NFAPI_LAA_CONFIG_TX_ANTENNA_PORTS_FOR_DRS_TAG, &pNfapiMsg->laa_config.tx_antenna_ports_drs, &unpack_uint16_tlv_value},
+		{ NFAPI_LAA_CONFIG_TRANSMISSION_POWER_FOR_DRS_TAG, &pNfapiMsg->laa_config.tx_power_drs, &unpack_uint16_tlv_value},
+
+		{ NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG, &pNfapiMsg->emtc_config.pbch_repetitions_enable_r13, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CATM_ROOT_SEQUENCE_INDEX_TAG, &pNfapiMsg->emtc_config.prach_catm_root_sequence_index, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CATM_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG, &pNfapiMsg->emtc_config.prach_catm_zero_correlation_zone_configuration, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CATM_HIGH_SPEED_FLAG, &pNfapiMsg->emtc_config.prach_catm_high_speed_flag, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG, &pNfapiMsg->emtc_config.prach_ce_level_0_enable, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG, &pNfapiMsg->emtc_config.prach_ce_level_0_configuration_index, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG, &pNfapiMsg->emtc_config.prach_ce_level_0_frequency_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, &pNfapiMsg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG, &pNfapiMsg->emtc_config.prach_ce_level_0_starting_subframe_periodicity, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG, &pNfapiMsg->emtc_config.prach_ce_level_0_hopping_enable, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG, &pNfapiMsg->emtc_config.prach_ce_level_0_hopping_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG, &pNfapiMsg->emtc_config.prach_ce_level_1_enable, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG, &pNfapiMsg->emtc_config.prach_ce_level_1_configuration_index, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG, &pNfapiMsg->emtc_config.prach_ce_level_1_frequency_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, &pNfapiMsg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG, &pNfapiMsg->emtc_config.prach_ce_level_1_starting_subframe_periodicity, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG, &pNfapiMsg->emtc_config.prach_ce_level_1_hopping_enable, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG, &pNfapiMsg->emtc_config.prach_ce_level_1_hopping_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG, &pNfapiMsg->emtc_config.prach_ce_level_2_enable, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG, &pNfapiMsg->emtc_config.prach_ce_level_2_configuration_index, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG, &pNfapiMsg->emtc_config.prach_ce_level_2_frequency_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, &pNfapiMsg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG, &pNfapiMsg->emtc_config.prach_ce_level_2_starting_subframe_periodicity, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG, &pNfapiMsg->emtc_config.prach_ce_level_2_hopping_enable, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG, &pNfapiMsg->emtc_config.prach_ce_level_2_hopping_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG, &pNfapiMsg->emtc_config.prach_ce_level_3_enable, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG, &pNfapiMsg->emtc_config.prach_ce_level_3_configuration_index, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG, &pNfapiMsg->emtc_config.prach_ce_level_3_frequency_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, &pNfapiMsg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG, &pNfapiMsg->emtc_config.prach_ce_level_3_starting_subframe_periodicity, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG, &pNfapiMsg->emtc_config.prach_ce_level_3_hopping_enable, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG, &pNfapiMsg->emtc_config.prach_ce_level_3_hopping_offset, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG, &pNfapiMsg->emtc_config.pucch_interval_ulhoppingconfigcommonmodea, &unpack_uint16_tlv_value},
+		{ NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG, &pNfapiMsg->emtc_config.pucch_interval_ulhoppingconfigcommonmodeb, &unpack_uint16_tlv_value},
+
+		{ NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG, &pNfapiMsg->tdd_frame_structure_config.subframe_assignment, &unpack_uint16_tlv_value},
+		{ NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG, &pNfapiMsg->tdd_frame_structure_config.special_subframe_patterns, &unpack_uint16_tlv_value},
+
+		{ NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG, &pNfapiMsg->l23_config.data_report_mode, &unpack_uint16_tlv_value},
+		{ NFAPI_L23_CONFIG_SFNSF_TAG, &pNfapiMsg->l23_config.sfnsf, &unpack_uint16_tlv_value},
+
+		{ NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG, &pNfapiMsg->nfapi_config.p7_vnf_address_ipv4, &unpack_ipv4_address_value},
+		{ NFAPI_NFAPI_P7_VNF_ADDRESS_IPV6_TAG, &pNfapiMsg->nfapi_config.p7_vnf_address_ipv6, &unpack_ipv6_address_value},
+		{ NFAPI_NFAPI_P7_VNF_PORT_TAG, &pNfapiMsg->nfapi_config.p7_vnf_port, &unpack_uint16_tlv_value},
+		{ NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &pNfapiMsg->nfapi_config.p7_pnf_address_ipv4, &unpack_ipv4_address_value},
+		{ NFAPI_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &pNfapiMsg->nfapi_config.p7_pnf_address_ipv6, &unpack_ipv6_address_value},
+		{ NFAPI_NFAPI_P7_PNF_PORT_TAG, &pNfapiMsg->nfapi_config.p7_pnf_port, &unpack_uint16_tlv_value},
+		{ NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, &pNfapiMsg->nfapi_config.dl_ue_per_sf, &unpack_uint8_tlv_value},
+		{ NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG, &pNfapiMsg->nfapi_config.ul_ue_per_sf, &unpack_uint8_tlv_value},
+		{ NFAPI_NFAPI_RF_BANDS_TAG, &pNfapiMsg->nfapi_config.rf_bands, &unpack_rf_bands_value},
+		{ NFAPI_NFAPI_TIMING_WINDOW_TAG, &pNfapiMsg->nfapi_config.timing_window, &unpack_uint8_tlv_value},
+		{ NFAPI_NFAPI_TIMING_INFO_MODE_TAG, &pNfapiMsg->nfapi_config.timing_info_mode, &unpack_uint8_tlv_value},
+		{ NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG, &pNfapiMsg->nfapi_config.timing_info_period, &unpack_uint8_tlv_value},
+		{ NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, &pNfapiMsg->nfapi_config.max_transmit_power, &unpack_uint16_tlv_value},
+		{ NFAPI_NFAPI_EARFCN_TAG, &pNfapiMsg->nfapi_config.earfcn, &unpack_uint16_tlv_value},
+		{ NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG, &pNfapiMsg->nfapi_config.nmm_gsm_frequency_bands, &unpack_nmm_frequency_bands_value},
+		{ NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG, &pNfapiMsg->nfapi_config.nmm_umts_frequency_bands, &unpack_nmm_frequency_bands_value},
+		{ NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG, &pNfapiMsg->nfapi_config.nmm_lte_frequency_bands, &unpack_nmm_frequency_bands_value},
+		{ NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG, &pNfapiMsg->nfapi_config.nmm_uplink_rssi_supported, &unpack_uint8_tlv_value},
+
+	};
+
+	return ( pull8(ppReadPackedMsg, &pNfapiMsg->num_tlv, end) &&
+		     unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+
+}
+
+static uint8_t unpack_config_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_config_response_t *pNfapiMsg = (nfapi_config_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) && 
+			 unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension)));
+}
+
+static uint8_t unpack_start_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_start_request_t *pNfapiMsg = (nfapi_start_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_start_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_start_response_t *pNfapiMsg = (nfapi_start_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			 unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension)));
+
+}
+
+static uint8_t unpack_stop_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_stop_request_t *pNfapiMsg = (nfapi_stop_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_stop_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_stop_response_t *pNfapiMsg = (nfapi_stop_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+	};
+
+	return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			 unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension)));
+
+}
+static uint8_t unpack_measurement_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_measurement_request_t *pNfapiMsg = (nfapi_measurement_request_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_MEASUREMENT_REQUEST_DL_RS_XTX_POWER_TAG, &pNfapiMsg->dl_rs_tx_power, &unpack_uint16_tlv_value},
+		{ NFAPI_MEASUREMENT_REQUEST_RECEIVED_INTERFERENCE_POWER_TAG, &pNfapiMsg->received_interference_power, &unpack_uint16_tlv_value},
+		{ NFAPI_MEASUREMENT_REQUEST_THERMAL_NOISE_POWER_TAG, &pNfapiMsg->thermal_noise_power, &unpack_uint16_tlv_value},
+	};
+
+	return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension));
+
+}
+
+static uint8_t unpack_received_interference_power_measurement_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_received_interference_power_measurement_t* value = (nfapi_received_interference_power_measurement_t*)tlv;
+
+	return ( pull16(ppReadPackedMsg, &value->number_of_resource_blocks, end) &&
+			 pullarrays16(ppReadPackedMsg, value->received_interference_power,  NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS, value->number_of_resource_blocks, end)); 
+}
+
+
+static uint8_t unpack_measurement_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_measurement_response_t *pNfapiMsg = (nfapi_measurement_response_t*)msg;
+
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_MEASUREMENT_RESPONSE_DL_RS_POWER_MEASUREMENT_TAG, &pNfapiMsg->dl_rs_tx_power_measurement, &unpack_int16_tlv_value},
+		{ NFAPI_MEASUREMENT_RESPONSE_RECEIVED_INTERFERENCE_POWER_MEASUREMENT_TAG, &pNfapiMsg->received_interference_power_measurement, &unpack_received_interference_power_measurement_value},
+		{ NFAPI_MEASUREMENT_RESPONSE_THERMAL_NOISE_MEASUREMENT_TAG, &pNfapiMsg->thermal_noise_power_measurement, &unpack_int16_tlv_value},
+	};
+
+	return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
+			 unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+
+}
+
+// unpack length check
+
+static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen)
+{
+	int retLen = 0;
+
+	switch (msgId)
+	{
+		case NFAPI_PNF_PARAM_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_pnf_param_request_t))
+				retLen = sizeof(nfapi_pnf_param_request_t);
+			break;
+
+		case NFAPI_PNF_PARAM_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_pnf_param_response_t))
+				retLen = sizeof(nfapi_pnf_param_response_t);
+			break;
+
+		case NFAPI_PNF_CONFIG_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_pnf_config_request_t))
+				retLen = sizeof(nfapi_pnf_config_request_t);
+			break;
+
+		case NFAPI_PNF_CONFIG_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_pnf_config_response_t))
+				retLen = sizeof(nfapi_pnf_config_response_t);
+			break;
+
+		case NFAPI_PNF_START_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_pnf_start_request_t))
+				retLen = sizeof(nfapi_pnf_start_request_t);
+			break;
+
+		case NFAPI_PNF_START_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_pnf_start_response_t))
+				retLen = sizeof(nfapi_pnf_start_response_t);
+			break;
+
+		case NFAPI_PNF_STOP_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_pnf_stop_request_t))
+				retLen = sizeof(nfapi_pnf_stop_request_t);
+			break;
+
+		case NFAPI_PNF_STOP_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_pnf_stop_response_t))
+				retLen = sizeof(nfapi_pnf_stop_response_t);
+			break;
+
+		case NFAPI_PARAM_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_param_request_t))
+				retLen = sizeof(nfapi_param_request_t);
+			break;
+
+		case NFAPI_PARAM_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_param_response_t))
+				retLen = sizeof(nfapi_param_response_t);
+			break;
+
+		case NFAPI_CONFIG_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_config_request_t))
+				retLen = sizeof(nfapi_config_request_t);
+			break;
+
+		case NFAPI_CONFIG_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_config_response_t))
+				retLen = sizeof(nfapi_config_response_t);
+			break;
+
+		case NFAPI_START_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_start_request_t))
+				retLen = sizeof(nfapi_start_request_t);
+			break;
+
+		case NFAPI_START_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_start_response_t))
+				retLen = sizeof(nfapi_start_response_t);
+			break;
+
+		case NFAPI_STOP_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_stop_request_t))
+				retLen = sizeof(nfapi_stop_request_t);
+			break;
+
+		case NFAPI_STOP_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_stop_response_t))
+				retLen = sizeof(nfapi_stop_response_t);
+			break;
+
+		case NFAPI_MEASUREMENT_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_measurement_request_t))
+				retLen = sizeof(nfapi_measurement_request_t);
+			break;
+
+		case NFAPI_MEASUREMENT_RESPONSE:
+			if (unpackedBufLen >= sizeof(nfapi_measurement_response_t))
+				retLen = sizeof(nfapi_measurement_response_t);
+			break;
+
+		default:
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s Unknown message ID %d\n", __FUNCTION__, msgId);
+			break;
+	}
+
+	return retLen;
+}
+
+
+// Main unpack functions - public
+
+int nfapi_p5_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_p4_p5_message_header_t *pMessageHeader = pUnpackedBuf;
+	uint8_t *pReadPackedMessage = pMessageBuf;
+	uint8_t *end = pMessageBuf + messageBufLen;
+
+	if (pMessageBuf == NULL || pUnpackedBuf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 header unpack supplied pointers are null\n");
+		return -1;
+	}
+
+	if (messageBufLen < NFAPI_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p4_p5_message_header_t))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 header unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen);
+		return -1;
+	}
+
+	// process the header
+	return ( pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) &&
+			 pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) &&
+			 pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) &&
+			 pull16(&pReadPackedMessage, &pMessageHeader->spare, end) );
+
+}
+
+int nfapi_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config)
+{
+	nfapi_p4_p5_message_header_t *pMessageHeader = pUnpackedBuf;
+	uint8_t *pReadPackedMessage = pMessageBuf;
+	uint8_t *end = pMessageBuf + messageBufLen;
+
+	if (pMessageBuf == NULL || pUnpackedBuf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 unpack supplied pointers are null\n");
+		return -1;
+	}
+
+	if (messageBufLen < NFAPI_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p4_p5_message_header_t))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen);
+		return -1;
+	}
+
+	// clean the supplied buffer for - tag value blanking
+	(void)memset(pUnpackedBuf, 0, unpackedBufLen);
+
+	// process the header
+	if( !(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end ) && 
+		  pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) &&
+		  pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) &&
+		  pull16(&pReadPackedMessage, &pMessageHeader->spare, end)))
+	{
+		// failed to read the header
+		return -1;
+	}
+
+	int result = -1;
+
+
+	if(check_unpack_length(pMessageHeader->message_id, unpackedBufLen) == 0)
+	{
+		// the unpack buffer is not big enough for the struct 
+		return -1;
+	}
+
+	// look for the specific message
+	switch (pMessageHeader->message_id)
+	{
+		case NFAPI_PNF_PARAM_REQUEST:
+			result = unpack_pnf_param_request(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_PNF_PARAM_RESPONSE:
+			result = unpack_pnf_param_response(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_PNF_CONFIG_REQUEST:
+			result = unpack_pnf_config_request(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_PNF_CONFIG_RESPONSE:
+			result = unpack_pnf_config_response(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_PNF_START_REQUEST:
+			result = unpack_pnf_start_request(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_PNF_START_RESPONSE:
+			result = unpack_pnf_start_response(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_PNF_STOP_REQUEST:
+			result = unpack_pnf_stop_request(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_PNF_STOP_RESPONSE:
+			result = unpack_pnf_stop_response(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_PARAM_REQUEST:
+			result = unpack_param_request(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_PARAM_RESPONSE:
+			result = unpack_param_response(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_CONFIG_REQUEST:
+			result = unpack_config_request(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_CONFIG_RESPONSE:
+			result = unpack_config_response(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_START_REQUEST:
+			result = unpack_start_request(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_START_RESPONSE:
+			result = unpack_start_response(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_STOP_REQUEST:
+			result = unpack_stop_request(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_STOP_RESPONSE:
+			result = unpack_stop_response(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_MEASUREMENT_REQUEST:
+			result = unpack_measurement_request(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		case NFAPI_MEASUREMENT_RESPONSE:
+			result = unpack_measurement_response(&pReadPackedMessage, end, pMessageHeader, config);
+			break;
+
+		default:
+			if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && 
+			   pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
+			{
+				if(config && config->unpack_p4_p5_vendor_extension)
+				{
+					result = (config->unpack_p4_p5_vendor_extension)(pMessageHeader, &pReadPackedMessage, end, config);
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve decoder provided\n", __FUNCTION__, pMessageHeader->message_id);
+				}
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown P5 message ID %d\n", __FUNCTION__, pMessageHeader->message_id);
+			}
+			break;
+	}
+
+	return result;
+}
+
diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
new file mode 100644
index 0000000000000000000000000000000000000000..69ff86077446d7ba89fe5c3d30f6230526b137aa
--- /dev/null
+++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
@@ -0,0 +1,6184 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <assert.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <zlib.h>
+#include <sched.h>
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <pthread.h>
+
+#include <nfapi_interface.h>
+#include <nfapi.h>
+#include <debug.h>
+
+extern int nfapi_unpack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t **ppReadPackedMsg, void* user_data);
+extern int nfapi_pack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t **ppWritePackedMsg, void* user_data);
+
+uint32_t nfapi_calculate_checksum(uint8_t* buffer, uint16_t len)
+{
+	uint32_t chksum = 0;
+	// calcaulte upto the checksum
+	chksum = crc32(chksum, buffer, 8);
+	
+	// skip the checksum
+	uint8_t zeros[4] = {0, 0, 0, 0};
+	chksum = crc32(chksum, zeros, 4);
+	
+	// continu with the rest of the mesage
+	chksum = crc32(chksum, &buffer[NFAPI_P7_HEADER_LENGTH], len - NFAPI_P7_HEADER_LENGTH);
+	
+	// return the inverse
+	return ~(chksum);
+}
+
+int nfapi_p7_update_checksum(uint8_t* buffer, uint32_t len)
+{
+	uint32_t checksum = nfapi_calculate_checksum(buffer, len);
+
+	uint8_t* p_write = &buffer[8];
+	return (push32(checksum, &p_write, buffer + len) > 0 ? 0 : -1);
+}
+
+int nfapi_p7_update_transmit_timestamp(uint8_t* buffer, uint32_t timestamp)
+{
+	uint8_t* p_write = &buffer[12];
+	return (push32(timestamp, &p_write, buffer + 16) > 0 ? 0 : -1);
+}
+
+uint32_t nfapi_p7_calculate_checksum(uint8_t* buffer, uint32_t len)
+{
+	return nfapi_calculate_checksum(buffer, len);
+}
+
+void* nfapi_p7_allocate(size_t size, nfapi_p7_codec_config_t* config)
+{
+	if(size == 0)
+		return 0;
+
+	if(config && config->allocate)
+	{
+		return (config->allocate)(size);
+	}
+	else
+	{
+		return calloc(1, size);
+	}
+}
+
+void nfapi_p7_deallocate(void* ptr, nfapi_p7_codec_config_t* config)
+{
+	if(ptr == NULL)
+		return;
+
+	if(config && config->deallocate)
+	{
+		return (config->deallocate)(ptr);
+	}
+	else
+	{
+		return free(ptr);
+	}
+}
+// Pack routines
+
+
+static uint8_t pack_dl_config_dci_dl_pdu_rel8_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel8_t* value = (nfapi_dl_config_dci_dl_pdu_rel8_t*)tlv;
+	
+        //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() dci_format:%u\n", __FUNCTION__, value->dci_format);
+
+	return ( push8(value->dci_format, ppWritePackedMsg, end) &&
+			 push8(value->cce_idx, ppWritePackedMsg, end) &&
+			 push8(value->aggregation_level, ppWritePackedMsg, end) &&
+			 push16(value->rnti, ppWritePackedMsg, end) &&
+			 push8(value->resource_allocation_type, ppWritePackedMsg, end) &&
+			 push8(value->virtual_resource_block_assignment_flag, ppWritePackedMsg, end) &&
+			 push32(value->resource_block_coding, ppWritePackedMsg, end) &&
+			 push8(value->mcs_1, ppWritePackedMsg, end) &&
+			 push8(value->redundancy_version_1, ppWritePackedMsg, end) &&
+			 push8(value->new_data_indicator_1, ppWritePackedMsg, end) &&
+			 push8(value->transport_block_to_codeword_swap_flag, ppWritePackedMsg, end) &&
+			 push8(value->mcs_2, ppWritePackedMsg, end) &&
+			 push8(value->redundancy_version_2, ppWritePackedMsg, end) &&
+			 push8(value->new_data_indicator_2, ppWritePackedMsg, end) &&
+			 push8(value->harq_process, ppWritePackedMsg, end) &&
+			 push8(value->tpmi, ppWritePackedMsg, end) &&
+			 push8(value->pmi, ppWritePackedMsg, end) &&
+			 push8(value->precoding_information, ppWritePackedMsg, end) &&
+			 push8(value->tpc, ppWritePackedMsg, end) &&
+			 push8(value->downlink_assignment_index, ppWritePackedMsg, end) &&
+			 push8(value->ngap, ppWritePackedMsg, end) &&
+			 push8(value->transport_block_size_index, ppWritePackedMsg, end) &&
+			 push8(value->downlink_power_offset, ppWritePackedMsg, end) &&
+			 push8(value->allocate_prach_flag, ppWritePackedMsg, end) &&
+			 push8(value->preamble_index, ppWritePackedMsg, end) &&
+			 push8(value->prach_mask_index, ppWritePackedMsg, end) &&
+			 push8(value->rnti_type, ppWritePackedMsg, end) &&
+			 push16(value->transmission_power, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_dl_config_dci_dl_pdu_rel9_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel9_t* value = (nfapi_dl_config_dci_dl_pdu_rel9_t*)tlv;
+
+	return( push8(value->mcch_flag, ppWritePackedMsg, end) &&
+			push8(value->mcch_change_notification, ppWritePackedMsg, end) &&
+			push8(value->scrambling_identity, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_dl_config_dci_dl_pdu_rel10_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel10_t* value = (nfapi_dl_config_dci_dl_pdu_rel10_t*)tlv;
+	
+	return ( push8(value->cross_carrier_scheduling_flag, ppWritePackedMsg, end) &&
+			 push8(value->carrier_indicator, ppWritePackedMsg, end) &&
+			 push8(value->srs_flag, ppWritePackedMsg, end) &&
+			 push8(value->srs_request, ppWritePackedMsg, end) &&
+			 push8(value->antenna_ports_scrambling_and_layers, ppWritePackedMsg, end) &&
+			 push8(value->total_dci_length_including_padding, ppWritePackedMsg, end) && 
+			 push8(value->n_dl_rb, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_dl_config_dci_dl_pdu_rel11_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel11_t* value = (nfapi_dl_config_dci_dl_pdu_rel11_t*)tlv;
+	
+	return ( push8(value->harq_ack_resource_offset, ppWritePackedMsg, end) &&
+		 	 push8(value->pdsch_re_mapping_quasi_co_location_indicator, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_dl_config_dci_dl_pdu_rel12_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel12_t* value = (nfapi_dl_config_dci_dl_pdu_rel12_t*)tlv;
+	
+	return ( push8(value->primary_cell_type, ppWritePackedMsg, end) &&
+			 push8(value->ul_dl_configuration_flag, ppWritePackedMsg, end) &&
+			 push8(value->number_ul_dl_configurations, ppWritePackedMsg, end) &&
+			 pusharray8(value->ul_dl_configuration_indication, NFAPI_MAX_UL_DL_CONFIGURATIONS, value->number_ul_dl_configurations, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_tpm_value(nfapi_dl_config_dci_dl_tpm_t* value, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	if (!( push8(value->num_prb_per_subband, ppWritePackedMsg, end) &&
+	       push8(value->number_of_subbands, ppWritePackedMsg, end) &&
+	       push8(value->num_antennas, ppWritePackedMsg, end)))
+		return 0;
+	
+	uint8_t idx = 0;
+	for(idx = 0; idx < value->number_of_subbands; ++idx)
+	{
+		nfapi_dl_config_dci_dl_tpm_subband_info_t* subband_info = &(value->subband_info[idx]);
+		
+		if(!(push8(subband_info->subband_index, ppWritePackedMsg, end) &&
+			 push8(subband_info->scheduled_ues, ppWritePackedMsg, end)))
+			return 0;	
+		
+
+		uint8_t antenna_idx = 0;
+		uint8_t scheduled_ue_idx = 0;
+		
+		for(antenna_idx = 0; antenna_idx < value->num_antennas; ++antenna_idx)
+		{
+			for(scheduled_ue_idx = 0; scheduled_ue_idx < subband_info->scheduled_ues; ++scheduled_ue_idx)
+			{
+				if(!push16(subband_info->precoding_value[antenna_idx][scheduled_ue_idx], ppWritePackedMsg, end))
+					return 0;
+			}
+		}
+
+	}
+	
+	
+	return 1;			
+	
+}
+
+static uint8_t pack_dl_config_dci_dl_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel13_t* value = (nfapi_dl_config_dci_dl_pdu_rel13_t*)tlv;
+
+	return( push8(value->laa_end_partial_sf_flag, ppWritePackedMsg, end) &&
+			push8(value->laa_end_partial_sf_configuration, ppWritePackedMsg, end) &&
+			push8(value->initial_lbt_sf, ppWritePackedMsg, end) &&
+			push8(value->codebook_size_determination, ppWritePackedMsg, end) &&
+			push8(value->drms_table_flag, ppWritePackedMsg, end) &&
+			push8(value->tpm_struct_flag, ppWritePackedMsg, end) &&
+			(value->tpm_struct_flag == 1 ? pack_tpm_value(&(value->tpm), ppWritePackedMsg, end) : 1));
+}
+
+static uint8_t pack_dl_config_bch_pdu_rel8_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_bch_pdu_rel8_t* value = (nfapi_dl_config_bch_pdu_rel8_t*)tlv;
+	
+        //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s()\n", __FUNCTION__);
+
+	return( push16(value->length, ppWritePackedMsg, end) &&
+			push16(value->pdu_index, ppWritePackedMsg, end) &&
+			push16(value->transmission_power, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_mch_pdu_rel8_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_mch_pdu_rel8_t* value = (nfapi_dl_config_mch_pdu_rel8_t*)tlv;
+
+	return ( push16(value->length, ppWritePackedMsg, end) &&
+			 push16(value->pdu_index, ppWritePackedMsg, end) &&
+			 push16(value->rnti, ppWritePackedMsg, end) &&
+			 push8(value->resource_allocation_type, ppWritePackedMsg, end) &&
+			 push32(value->resource_block_coding, ppWritePackedMsg, end) &&
+			 push8(value->modulation, ppWritePackedMsg, end) &&
+			 push16(value->transmission_power, ppWritePackedMsg, end) &&
+			 push16(value->mbsfn_area_id, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_bf_vector_info(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_bf_vector_t* bf = (nfapi_bf_vector_t*)elem;
+
+	return ( push8(bf->subband_index, ppWritePackedMsg, end) &&
+			 push8(bf->num_antennas, ppWritePackedMsg, end) &&
+			 pusharray16(bf->bf_value, NFAPI_MAX_NUM_ANTENNAS, bf->num_antennas, ppWritePackedMsg, end));
+
+	
+}
+static uint8_t pack_dl_config_dlsch_pdu_rel8_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel8_t* value = (nfapi_dl_config_dlsch_pdu_rel8_t*)tlv;
+
+	return ( push16(value->length, ppWritePackedMsg, end) && 
+			 push16(value->pdu_index, ppWritePackedMsg, end) &&
+			 push16(value->rnti, ppWritePackedMsg, end) &&
+			 push8(value->resource_allocation_type, ppWritePackedMsg, end) &&
+			 push8(value->virtual_resource_block_assignment_flag, ppWritePackedMsg, end) &&
+			 push32(value->resource_block_coding, ppWritePackedMsg, end) &&
+			 push8(value->modulation, ppWritePackedMsg, end) &&
+			 push8(value->redundancy_version, ppWritePackedMsg, end) &&
+			 push8(value->transport_blocks, ppWritePackedMsg, end) &&
+			 push8(value->transport_block_to_codeword_swap_flag, ppWritePackedMsg, end) &&
+			 push8(value->transmission_scheme, ppWritePackedMsg, end) &&
+			 push8(value->number_of_layers, ppWritePackedMsg, end) &&
+			 push8(value->number_of_subbands, ppWritePackedMsg, end) &&
+			 pusharray8(value->codebook_index, NFAPI_MAX_NUM_SUBBANDS, value->number_of_subbands, ppWritePackedMsg, end) &&
+			 push8(value->ue_category_capacity, ppWritePackedMsg, end) &&
+			 push8(value->pa, ppWritePackedMsg, end) &&
+			 push8(value->delta_power_offset_index, ppWritePackedMsg, end) &&
+			 push8(value->ngap, ppWritePackedMsg, end) &&
+			 push8(value->nprb, ppWritePackedMsg, end) &&
+			 push8(value->transmission_mode, ppWritePackedMsg, end) &&
+			 push8(value->num_bf_prb_per_subband, ppWritePackedMsg, end) &&
+			 push8(value->num_bf_vector, ppWritePackedMsg, end) &&
+			 packarray(value->bf_vector, sizeof(nfapi_bf_vector_t), NFAPI_MAX_BF_VECTORS, value->num_bf_vector, ppWritePackedMsg, end, &pack_bf_vector_info));
+
+}
+static uint8_t pack_dl_config_dlsch_pdu_rel9_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel9_t* value = (nfapi_dl_config_dlsch_pdu_rel9_t*)tlv;
+	return ( push8(value->nscid, ppWritePackedMsg, end) );
+}
+static uint8_t pack_dl_config_dlsch_pdu_rel10_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel10_t* value = (nfapi_dl_config_dlsch_pdu_rel10_t*)tlv;
+	
+	return ( push8(value->csi_rs_flag, ppWritePackedMsg, end) &&
+			 push8(value->csi_rs_resource_config_r10, ppWritePackedMsg, end) &&
+			 push16(value->csi_rs_zero_tx_power_resource_config_bitmap_r10, ppWritePackedMsg, end) &&
+			 push8(value->csi_rs_number_nzp_configuration, ppWritePackedMsg, end) &&
+			 pusharray8(value->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, value->csi_rs_number_nzp_configuration, ppWritePackedMsg, end) &&
+			 push8(value->pdsch_start, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_dlsch_pdu_rel11_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel11_t* value = (nfapi_dl_config_dlsch_pdu_rel11_t*)tlv;
+	
+	return( push8(value->drms_config_flag, ppWritePackedMsg, end) &&
+			push16(value->drms_scrambling, ppWritePackedMsg, end) &&
+			push8(value->csi_config_flag, ppWritePackedMsg, end) &&
+			push16(value->csi_scrambling, ppWritePackedMsg, end) &&
+			push8(value->pdsch_re_mapping_flag, ppWritePackedMsg, end) &&
+			push8(value->pdsch_re_mapping_atenna_ports, ppWritePackedMsg, end) &&
+			push8(value->pdsch_re_mapping_freq_shift, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_dlsch_pdu_rel12_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel12_t* value = (nfapi_dl_config_dlsch_pdu_rel12_t*)tlv;
+
+	return( push8(value->altcqi_table_r12, ppWritePackedMsg, end) &&
+			push8(value->maxlayers, ppWritePackedMsg, end) &&
+			push8(value->n_dl_harq, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_dlsch_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel13_t* value = (nfapi_dl_config_dlsch_pdu_rel13_t*)tlv;
+	
+	return( push8(value->dwpts_symbols, ppWritePackedMsg, end) &&
+			push8(value->initial_lbt_sf, ppWritePackedMsg, end) &&
+			push8(value->ue_type, ppWritePackedMsg, end) &&
+			push8(value->pdsch_payload_type, ppWritePackedMsg, end) &&
+			push16(value->initial_transmission_sf_io, ppWritePackedMsg, end) &&
+			push8(value->drms_table_flag, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_pch_pdu_rel8_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_pch_pdu_rel8_t* value = (nfapi_dl_config_pch_pdu_rel8_t*)tlv;
+	
+	return( push16(value->length, ppWritePackedMsg, end) &&
+			push16(value->pdu_index, ppWritePackedMsg, end) &&
+			push16(value->p_rnti, ppWritePackedMsg, end) &&
+			push8(value->resource_allocation_type, ppWritePackedMsg, end) &&
+			push8(value->virtual_resource_block_assignment_flag, ppWritePackedMsg, end) &&
+			push32(value->resource_block_coding, ppWritePackedMsg, end) &&
+			push8(value->mcs, ppWritePackedMsg, end) &&
+			push8(value->redundancy_version, ppWritePackedMsg, end) &&
+			push8(value->number_of_transport_blocks, ppWritePackedMsg, end) &&
+			push8(value->transport_block_to_codeword_swap_flag, ppWritePackedMsg, end) &&
+			push8(value->transmission_scheme, ppWritePackedMsg, end) &&
+			push8(value->number_of_layers, ppWritePackedMsg, end) &&
+			push8(value->codebook_index, ppWritePackedMsg, end) &&
+			push8(value->ue_category_capacity, ppWritePackedMsg, end) &&
+			push8(value->pa, ppWritePackedMsg, end) &&
+			push16(value->transmission_power, ppWritePackedMsg, end) &&
+			push8(value->nprb, ppWritePackedMsg, end) &&
+			push8(value->ngap, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_pch_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_pch_pdu_rel13_t* value = (nfapi_dl_config_pch_pdu_rel13_t*)tlv;
+
+	return ( push8(value->ue_mode, ppWritePackedMsg, end) &&
+		 	 push16(value->initial_transmission_sf_io, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_prs_pdu_rel9_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_prs_pdu_rel9_t* value = (nfapi_dl_config_prs_pdu_rel9_t*)tlv;
+
+	return( push16(value->transmission_power, ppWritePackedMsg, end) &&
+			push8(value->prs_bandwidth, ppWritePackedMsg, end) &&
+			push8(value->prs_cyclic_prefix_type, ppWritePackedMsg, end) &&
+			push8(value->prs_muting, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_csi_rs_pdu_rel10_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_csi_rs_pdu_rel10_t* value = (nfapi_dl_config_csi_rs_pdu_rel10_t*)tlv;
+
+	return( push8(value->csi_rs_antenna_port_count_r10, ppWritePackedMsg, end) &&
+			push8(value->csi_rs_resource_config_r10, ppWritePackedMsg, end) &&
+			push16(value->transmission_power, ppWritePackedMsg, end) &&
+			push16(value->csi_rs_zero_tx_power_resource_config_bitmap_r10, ppWritePackedMsg, end) &&
+			push8(value->csi_rs_number_of_nzp_configuration, ppWritePackedMsg, end) &&
+			pusharray8(value->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, value->csi_rs_number_of_nzp_configuration, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_csi_rs_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_csi_rs_pdu_rel13_t* value = (nfapi_dl_config_csi_rs_pdu_rel13_t*)tlv;
+
+	if(!(push8(value->csi_rs_class, ppWritePackedMsg, end) &&
+		 	 push8(value->cdm_type, ppWritePackedMsg, end) &&
+		 	 push8(value->num_bf_vector, ppWritePackedMsg, end)))
+	{
+		return 0;
+	}
+
+	uint16_t i; 
+	for(i = 0; i < value->num_bf_vector; ++i)
+	{
+		if(!(push8(value->bf_vector[i].csi_rs_resource_index, ppWritePackedMsg, end) &&
+		     pusharray16(value->bf_vector[i].bf_value, NFAPI_MAX_ANTENNA_PORT_COUNT, NFAPI_MAX_ANTENNA_PORT_COUNT, ppWritePackedMsg, end)))
+			return 0;
+	}
+
+	return 1;
+}
+static uint8_t pack_bf_vector(nfapi_bf_vector_t* vector, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( push8(vector->subband_index, ppWritePackedMsg, end) &&
+			 push8(vector->num_antennas, ppWritePackedMsg, end) &&
+		 	 pusharray16(vector->bf_value, NFAPI_MAX_NUM_ANTENNAS, vector->num_antennas, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_dl_config_epdcch_parameters_rel11_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_epdcch_parameters_rel11_t* value = (nfapi_dl_config_epdcch_parameters_rel11_t*)tlv;
+
+	return ( push8(value->epdcch_resource_assignment_flag, ppWritePackedMsg, end) &&
+			push16(value->epdcch_id, ppWritePackedMsg, end) &&
+			push8(value->epdcch_start_symbol, ppWritePackedMsg, end) &&
+			push8(value->epdcch_num_prb, ppWritePackedMsg, end) &&
+			pusharray8(value->epdcch_prb_index, NFAPI_MAX_EPDCCH_PRB, value->epdcch_num_prb, ppWritePackedMsg, end) &&
+			pack_bf_vector(&value->bf_vector, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_epdcch_parameters_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_epdcch_parameters_rel13_t* value = (nfapi_dl_config_epdcch_parameters_rel13_t*)tlv;
+	
+	return (push8(value->dwpts_symbols, ppWritePackedMsg, end) &&
+		 	push8(value->initial_lbt_sf, ppWritePackedMsg, end));
+}
+static uint8_t pack_dl_config_mpdcch_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_mpdcch_pdu_rel13_t* value = (nfapi_dl_config_mpdcch_pdu_rel13_t*)tlv;
+	
+	return ( push8(value->mpdcch_narrow_band, ppWritePackedMsg, end) &&
+			 push8(value->number_of_prb_pairs, ppWritePackedMsg, end) &&
+			 push8(value->resource_block_assignment, ppWritePackedMsg, end) &&
+			 push8(value->mpdcch_tansmission_type, ppWritePackedMsg, end) &&
+			 push8(value->start_symbol, ppWritePackedMsg, end) &&
+			 push8(value->ecce_index, ppWritePackedMsg, end) &&
+			 push8(value->aggregation_level, ppWritePackedMsg, end) &&
+			 push8(value->rnti_type, ppWritePackedMsg, end) &&
+			 push16(value->rnti, ppWritePackedMsg, end) &&
+			 push8(value->ce_mode, ppWritePackedMsg, end) &&
+			 push16(value->drms_scrambling_init, ppWritePackedMsg, end) &&
+			 push16(value->initial_transmission_sf_io, ppWritePackedMsg, end) &&
+			 push16(value->transmission_power, ppWritePackedMsg, end) &&
+			 push8(value->dci_format, ppWritePackedMsg, end) &&
+			 push16(value->resource_block_coding, ppWritePackedMsg, end) &&
+			 push8(value->mcs, ppWritePackedMsg, end) &&
+			 push8(value->pdsch_reptition_levels, ppWritePackedMsg, end) &&
+			 push8(value->redundancy_version, ppWritePackedMsg, end) &&
+			 push8(value->new_data_indicator, ppWritePackedMsg, end) &&
+			 push8(value->harq_process, ppWritePackedMsg, end) &&
+			 push8(value->tpmi_length, ppWritePackedMsg, end) &&
+			 push8(value->tpmi, ppWritePackedMsg, end) &&
+			 push8(value->pmi_flag, ppWritePackedMsg, end) &&
+			 push8(value->pmi, ppWritePackedMsg, end) &&
+			 push8(value->harq_resource_offset, ppWritePackedMsg, end) &&
+			 push8(value->dci_subframe_repetition_number, ppWritePackedMsg, end) &&
+			 push8(value->tpc, ppWritePackedMsg, end) &&
+			 push8(value->downlink_assignment_index_length, ppWritePackedMsg, end) &&
+			 push8(value->downlink_assignment_index, ppWritePackedMsg, end) &&
+			 push8(value->allocate_prach_flag, ppWritePackedMsg, end) &&
+			 push8(value->preamble_index, ppWritePackedMsg, end) &&
+			 push8(value->prach_mask_index, ppWritePackedMsg, end) &&
+			 push8(value->starting_ce_level, ppWritePackedMsg, end) &&
+			 push8(value->srs_request, ppWritePackedMsg, end) &&
+			 push8(value->antenna_ports_and_scrambling_identity_flag, ppWritePackedMsg, end) &&
+			 push8(value->antenna_ports_and_scrambling_identity, ppWritePackedMsg, end) &&
+			 push8(value->frequency_hopping_enabled_flag, ppWritePackedMsg, end) &&
+			 push8(value->paging_direct_indication_differentiation_flag, ppWritePackedMsg, end) &&
+			 push8(value->direct_indication, ppWritePackedMsg, end) &&
+			 push8(value->total_dci_length_including_padding, ppWritePackedMsg, end) &&
+			 push8(value->number_of_tx_antenna_ports, ppWritePackedMsg, end) &&
+			 pusharray16(value->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, value->number_of_tx_antenna_ports, ppWritePackedMsg, end));
+}
+
+
+static uint8_t pack_dl_config_nbch_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_nbch_pdu_rel13_t* value = (nfapi_dl_config_nbch_pdu_rel13_t*)tlv;
+	
+	return (push16(value->length, ppWritePackedMsg, end) &&
+		 	push16(value->pdu_index, ppWritePackedMsg, end) &&
+		 	push16(value->transmission_power, ppWritePackedMsg, end) &&
+		 	push16(value->hyper_sfn_2_lsbs, ppWritePackedMsg, end));
+}
+
+
+static uint8_t pack_dl_config_npdcch_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_npdcch_pdu_rel13_t* value = (nfapi_dl_config_npdcch_pdu_rel13_t*)tlv;
+	
+	return (push16(value->length, ppWritePackedMsg, end) &&
+			push16(value->pdu_index, ppWritePackedMsg, end) &&
+			push8(value->ncce_index, ppWritePackedMsg, end) &&
+			push8(value->aggregation_level, ppWritePackedMsg, end) &&
+			push8(value->start_symbol, ppWritePackedMsg, end) &&
+			push8(value->rnti_type, ppWritePackedMsg, end) &&
+			push16(value->rnti, ppWritePackedMsg, end) &&
+			push8(value->scrambling_reinitialization_batch_index, ppWritePackedMsg, end) &&
+			push8(value->nrs_antenna_ports_assumed_by_the_ue, ppWritePackedMsg, end) &&
+			push8(value->dci_format, ppWritePackedMsg, end) &&
+			push8(value->scheduling_delay, ppWritePackedMsg, end) &&
+			push8(value->resource_assignment, ppWritePackedMsg, end) &&
+			push8(value->repetition_number, ppWritePackedMsg, end) &&
+			push8(value->mcs, ppWritePackedMsg, end) &&
+			push8(value->new_data_indicator, ppWritePackedMsg, end) &&
+			push8(value->harq_ack_resource, ppWritePackedMsg, end) &&
+			push8(value->npdcch_order_indication, ppWritePackedMsg, end) &&
+			push8(value->starting_number_of_nprach_repetitions, ppWritePackedMsg, end) &&
+			push8(value->subcarrier_indication_of_nprach, ppWritePackedMsg, end) &&
+			push8(value->paging_direct_indication_differentation_flag, ppWritePackedMsg, end) &&
+			push8(value->direct_indication, ppWritePackedMsg, end) &&
+			push8(value->dci_subframe_repetition_number, ppWritePackedMsg, end) &&
+			push8(value->total_dci_length_including_padding, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_dl_config_ndlsch_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_ndlsch_pdu_rel13_t* value = (nfapi_dl_config_ndlsch_pdu_rel13_t*)tlv;
+	
+	return (push16(value->length, ppWritePackedMsg, end) &&
+			push16(value->pdu_index, ppWritePackedMsg, end) &&
+			push8(value->start_symbol, ppWritePackedMsg, end) &&
+			push8(value->rnti_type, ppWritePackedMsg, end) &&
+			push16(value->rnti, ppWritePackedMsg, end) &&
+			push16(value->resource_assignment, ppWritePackedMsg, end) &&
+			push16(value->repetition_number, ppWritePackedMsg, end) &&
+			push8(value->modulation, ppWritePackedMsg, end) &&
+			push8(value->number_of_subframes_for_resource_assignment, ppWritePackedMsg, end) &&
+			push8(value->scrambling_sequence_initialization_cinit, ppWritePackedMsg, end) &&
+			push16(value->sf_idx, ppWritePackedMsg, end) &&
+			push8(value->nrs_antenna_ports_assumed_by_the_ue, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_dl_config_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_request_body_t* value = (nfapi_dl_config_request_body_t*)tlv;
+
+        //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() dci:%u pdu:%u pdsch:%u rnti:%u pcfich:%u\n", __FUNCTION__, value->number_dci, value->number_pdu, value->number_pdsch_rnti, value->transmission_power_pcfich);
+
+	if(!(push8(value->number_pdcch_ofdm_symbols, ppWritePackedMsg, end) &&
+		 push8(value->number_dci, ppWritePackedMsg, end) &&
+		 push16(value->number_pdu, ppWritePackedMsg, end) &&
+		 push8(value->number_pdsch_rnti, ppWritePackedMsg, end) &&
+		 push16(value->transmission_power_pcfich, ppWritePackedMsg, end)))
+	{
+		return 0;
+	}
+
+	uint16_t i = 0;
+	uint16_t total_number_of_pdus = value->number_pdu;
+	for(; i < total_number_of_pdus; ++i)
+	{
+		nfapi_dl_config_request_pdu_t* pdu = &(value->dl_config_pdu_list[i]);
+
+		if(push8(pdu->pdu_type, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		// Put a 0 size in and then determine the size after the pdu 
+		// has been writen and write the calculated size
+		uint8_t* pWritePackedMsgPduSize = *ppWritePackedMsg;
+		pdu->pdu_size = 0;
+		if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		switch(pdu->pdu_type)
+		{
+			case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
+				{
+                                  //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE\n", __FUNCTION__);
+
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel8_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel9_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel10_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel11, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel11_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel12, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel12_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel13_value)))
+					{
+						return 0;
+					}
+				}
+				break;
+			case NFAPI_DL_CONFIG_BCH_PDU_TYPE:
+				{
+                                  //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() NFAPI_DL_CONFIG_BCH_PDU_TYPE\n", __FUNCTION__);
+
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG, &pdu->bch_pdu.bch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_bch_pdu_rel8_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_DL_CONFIG_MCH_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG, &pdu->mch_pdu.mch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_mch_pdu_rel8_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel8_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel9_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel10_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel11, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel11_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel12, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel12_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel13_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_DL_CONFIG_PCH_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG, &pdu->pch_pdu.pch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_pch_pdu_rel8_value) &&
+					pack_tlv(NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG, &pdu->pch_pdu.pch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_pch_pdu_rel13_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_DL_CONFIG_PRS_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG, &pdu->prs_pdu.prs_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_prs_pdu_rel9_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel10, ppWritePackedMsg, end,  &pack_dl_config_csi_rs_pdu_rel10_value) &&
+						 pack_tlv(NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel13, ppWritePackedMsg, end,  &pack_dl_config_csi_rs_pdu_rel13_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel8_value) &&
+						 pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel9_value) &&
+						 pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel10_value) &&
+						 pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel11, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel11_value) &&
+						 pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel12, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel12_value) &&
+						 pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel13_value) &&
+						 pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG, &pdu->epdcch_pdu.epdcch_params_rel11, ppWritePackedMsg, end, &pack_dl_config_epdcch_parameters_rel11_value) &
+						 pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG, &pdu->epdcch_pdu.epdcch_params_rel13, ppWritePackedMsg, end, &pack_dl_config_epdcch_parameters_rel13_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG, &pdu->mpdcch_pdu.mpdcch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_mpdcch_pdu_rel13_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_DL_CONFIG_NBCH_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG, &pdu->nbch_pdu.nbch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_nbch_pdu_rel13_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG, &pdu->npdcch_pdu.npdcch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_npdcch_pdu_rel13_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG, &pdu->ndlsch_pdu.ndlsch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_ndlsch_pdu_rel13_value)))
+						return 0;
+				}
+				break;
+			default:
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type );
+				}
+				break;
+		};
+
+		// add 1 for the pdu_type. The delta will include the pdu_size
+		pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize);
+		push8(pdu->pdu_size, &pWritePackedMsgPduSize, end);
+	}
+
+	return 1;
+}
+
+static uint8_t pack_dl_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_dl_config_request_t *pNfapiMsg = (nfapi_dl_config_request_t*)msg;
+	
+	//return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 //pack_tlv(NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, ppWritePackedMsg, end, &pack_dl_config_request_body_value) &&
+			 //pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+        { 
+          uint8_t x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end);
+          uint8_t y = pack_tlv(NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, ppWritePackedMsg, end, &pack_dl_config_request_body_value);
+          uint8_t z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
+
+          if (!x || !y || !z)
+          {
+            NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST x:%u y:%u z:%u \n", __FUNCTION__,x,y,z);
+          }
+
+          return x && y && z;
+        }
+}
+
+static uint8_t pack_ul_config_request_ulsch_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t * end)
+{
+	nfapi_ul_config_ulsch_pdu_rel8_t* ulsch_pdu_rel8 = (nfapi_ul_config_ulsch_pdu_rel8_t*)tlv;
+	
+	return( push32(ulsch_pdu_rel8->handle, ppWritePackedMsg, end) &&
+			push16(ulsch_pdu_rel8->size, ppWritePackedMsg, end) &&
+			push16(ulsch_pdu_rel8->rnti, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->resource_block_start, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->number_of_resource_blocks, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->modulation_type, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->cyclic_shift_2_for_drms, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->frequency_hopping_enabled_flag, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->frequency_hopping_bits, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->new_data_indication, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->redundancy_version, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->harq_process_number, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->ul_tx_mode, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->current_tx_nb, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel8->n_srs, ppWritePackedMsg, end));
+}
+static uint8_t pack_ul_config_request_ulsch_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_pdu_rel10_t* ulsch_pdu_rel10 = (nfapi_ul_config_ulsch_pdu_rel10_t*)tlv;
+	
+	return (push8(ulsch_pdu_rel10->resource_allocation_type, ppWritePackedMsg, end) &&
+			push32(ulsch_pdu_rel10->resource_block_coding, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel10->transport_blocks, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel10->transmission_scheme, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel10->number_of_layers, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel10->codebook_index, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel10->disable_sequence_hopping_flag, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_ulsch_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_pdu_rel11_t* ulsch_pdu_rel11 = (nfapi_ul_config_ulsch_pdu_rel11_t*)tlv;
+	
+	return (push8(ulsch_pdu_rel11->virtual_cell_id_enabled_flag, ppWritePackedMsg, end) &&
+			push16(ulsch_pdu_rel11->npusch_identity, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel11->dmrs_config_flag, ppWritePackedMsg, end) &&
+			push16(ulsch_pdu_rel11->ndmrs_csh_identity, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_ulsch_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_pdu_rel13_t* ulsch_pdu_rel13 = (nfapi_ul_config_ulsch_pdu_rel13_t*)tlv;
+
+	return (push8(ulsch_pdu_rel13->ue_type, ppWritePackedMsg, end) &&
+			push16(ulsch_pdu_rel13->total_number_of_repetitions, ppWritePackedMsg, end) &&
+			push16(ulsch_pdu_rel13->repetition_number, ppWritePackedMsg, end) &&
+			push16(ulsch_pdu_rel13->initial_transmission_sf_io, ppWritePackedMsg, end) &&
+			push8(ulsch_pdu_rel13->empty_symbols_due_to_re_tunning, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_ulsch_pdu(nfapi_ul_config_ulsch_pdu* ulsch_pdu, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG, &ulsch_pdu->ulsch_pdu_rel8, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel8_value) &&
+			pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG, &ulsch_pdu->ulsch_pdu_rel10, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel10_value) &&
+			pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG, &ulsch_pdu->ulsch_pdu_rel11, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel11_value) &&
+			pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG, &ulsch_pdu->ulsch_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel13_value));
+}
+
+static uint8_t pack_ul_config_request_cqi_ri_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_ri_information_rel8_t* cqi_ri_info_rel8 = (nfapi_ul_config_cqi_ri_information_rel8_t*)tlv;
+
+	return ( push8(cqi_ri_info_rel8->dl_cqi_pmi_size_rank_1, ppWritePackedMsg, end) &&
+			 push8(cqi_ri_info_rel8->dl_cqi_pmi_size_rank_greater_1, ppWritePackedMsg, end) &&
+			 push8(cqi_ri_info_rel8->ri_size, ppWritePackedMsg, end) &&
+			 push8(cqi_ri_info_rel8->delta_offset_cqi, ppWritePackedMsg, end) &&
+			 push8(cqi_ri_info_rel8->delta_offset_ri, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_cqi_ri_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_ri_information_rel9_t* cqi_ri_info_rel9 = (nfapi_ul_config_cqi_ri_information_rel9_t*)tlv;
+
+	if(!(push8(cqi_ri_info_rel9->report_type, ppWritePackedMsg, end) &&
+		 push8(cqi_ri_info_rel9->delta_offset_cqi, ppWritePackedMsg, end) &&
+		 push8(cqi_ri_info_rel9->delta_offset_ri, ppWritePackedMsg, end)))
+	{
+		return 0;
+	}
+
+	switch(cqi_ri_info_rel9->report_type)
+	{
+		case NFAPI_CSI_REPORT_TYPE_PERIODIC:
+			{
+				if(!(push8(cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size, ppWritePackedMsg, end) &&
+					 push8(cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.control_type, ppWritePackedMsg, end)))
+				{
+					return 0;
+				}
+			}
+			break;
+		case NFAPI_CSI_REPORT_TYPE_APERIODIC:
+			{
+				if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc, ppWritePackedMsg, end) == 0)
+					return 0;
+
+				uint8_t i;
+				for(i = 0; i < cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc; ++i)
+				{
+					if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].ri_size, ppWritePackedMsg, end) == 0)
+						return 0;
+
+                                        uint8_t j;
+                                        for(j = 0; j < 8; ++j)
+					{
+                                              if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].dl_cqi_pmi_size[j], ppWritePackedMsg, end) == 0)
+							return 0;
+					}
+				}
+			}
+			break;
+		default:
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid report type %d \n", cqi_ri_info_rel9->report_type );
+			}
+			break;
+	};
+
+	return 1;
+}
+
+static uint8_t pack_ul_config_request_cqi_ri_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_ri_information_rel13_t* cqi_ri_info_rel13 = (nfapi_ul_config_cqi_ri_information_rel13_t*)tlv;
+
+	switch(cqi_ri_info_rel13->report_type)
+	{
+		case NFAPI_CSI_REPORT_TYPE_PERIODIC:
+			{
+				if(push16(cqi_ri_info_rel13->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size_2, ppWritePackedMsg, end) == 0)
+					return 0;
+			}
+			break;
+		case NFAPI_CSI_REPORT_TYPE_APERIODIC:
+			{
+				// No parameters
+			}
+			break;
+		default:
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid report type %d \n", cqi_ri_info_rel13->report_type );
+			}
+			break;
+	};
+
+	return 1;
+}
+
+static uint8_t pack_ul_config_request_cqi_ri_information(nfapi_ul_config_cqi_ri_information* cqi_ri_info, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return (pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG, &cqi_ri_info->cqi_ri_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_cqi_ri_rel8_value) &&
+			pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG, &cqi_ri_info->cqi_ri_information_rel9, ppWritePackedMsg, end, &pack_ul_config_request_cqi_ri_rel9_value) &&
+			pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG, &cqi_ri_info->cqi_ri_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_cqi_ri_rel13_value));
+
+}
+
+static uint8_t pack_ul_config_request_init_tx_params_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_initial_transmission_parameters_rel8_t* init_tx_params_rel8 = (nfapi_ul_config_initial_transmission_parameters_rel8_t*)tlv;
+	
+	return (push8(init_tx_params_rel8->n_srs_initial, ppWritePackedMsg, end) &&
+		 	push8(init_tx_params_rel8->initial_number_of_resource_blocks, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_initial_transmission_parameters(nfapi_ul_config_initial_transmission_parameters* init_tx_params, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return pack_tlv(NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG, &init_tx_params->initial_transmission_parameters_rel8, ppWritePackedMsg, end, &pack_ul_config_request_init_tx_params_rel8_value);
+}
+
+static uint8_t pack_ul_config_request_ulsch_harq_info_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_harq_information_rel10_t* harq_info_rel10 = (nfapi_ul_config_ulsch_harq_information_rel10_t*)tlv;
+	
+	return (push8(harq_info_rel10->harq_size, ppWritePackedMsg, end) &&
+			push8(harq_info_rel10->delta_offset_harq, ppWritePackedMsg, end) &&
+			push8(harq_info_rel10->ack_nack_mode, ppWritePackedMsg, end));
+}
+static uint8_t pack_ul_config_request_ulsch_harq_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_harq_information_rel13_t* harq_info_rel13 = (nfapi_ul_config_ulsch_harq_information_rel13_t*)tlv;
+	
+	return (push16(harq_info_rel13->harq_size_2, ppWritePackedMsg, end) &&
+		 	push8(harq_info_rel13->delta_offset_harq_2, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_ulsch_harq_information(nfapi_ul_config_ulsch_harq_information* harq_info, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG, &harq_info->harq_information_rel10, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_harq_info_rel10_value) &&
+			 pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG, &harq_info->harq_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_harq_info_rel13_value));
+}
+
+static uint8_t pack_ul_config_request_ue_info_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ue_information_rel8_t* ue_info_rel8 = (nfapi_ul_config_ue_information_rel8_t*)tlv;
+	
+	return ( push32(ue_info_rel8->handle, ppWritePackedMsg, end) &&
+		 	 push16(ue_info_rel8->rnti, ppWritePackedMsg, end));
+}
+static uint8_t pack_ul_config_request_ue_info_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ue_information_rel11_t* ue_info_rel11 = (nfapi_ul_config_ue_information_rel11_t*)tlv;
+
+	return ( push8(ue_info_rel11->virtual_cell_id_enabled_flag, ppWritePackedMsg, end) &&
+		 	 push16(ue_info_rel11->npusch_identity, ppWritePackedMsg, end));
+}
+static uint8_t pack_ul_config_request_ue_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ue_information_rel13_t* ue_info_rel13 = (nfapi_ul_config_ue_information_rel13_t*)tlv;
+
+	return ( push8(ue_info_rel13->ue_type, ppWritePackedMsg, end) &&
+			 push8(ue_info_rel13->empty_symbols, ppWritePackedMsg, end) &&
+			 push16(ue_info_rel13->total_number_of_repetitions, ppWritePackedMsg, end) &&
+			 push16(ue_info_rel13->repetition_number, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_ue_information(nfapi_ul_config_ue_information* ue_info, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG, &ue_info->ue_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_ue_info_rel8_value) &&
+	pack_tlv(NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG, &ue_info->ue_information_rel11, ppWritePackedMsg, end, &pack_ul_config_request_ue_info_rel11_value) &&
+	pack_tlv(NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG, &ue_info->ue_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_ue_info_rel13_value));
+}
+
+static uint8_t pack_ul_config_request_harq_info_rel10_tdd_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_harq_information_rel10_tdd_t* harq_info_rel10_tdd = (nfapi_ul_config_harq_information_rel10_tdd_t*)tlv;
+
+	return ( push8(harq_info_rel10_tdd->harq_size, ppWritePackedMsg, end) &&
+			push8(harq_info_rel10_tdd->ack_nack_mode, ppWritePackedMsg, end) &&
+			push8(harq_info_rel10_tdd->number_of_pucch_resources, ppWritePackedMsg, end) &&
+			push16(harq_info_rel10_tdd->n_pucch_1_0, ppWritePackedMsg, end) &&
+			push16(harq_info_rel10_tdd->n_pucch_1_1, ppWritePackedMsg, end) &&
+			push16(harq_info_rel10_tdd->n_pucch_1_2, ppWritePackedMsg, end) &&
+			push16(harq_info_rel10_tdd->n_pucch_1_3, ppWritePackedMsg, end));
+}
+static uint8_t pack_ul_config_request_harq_info_rel8_fdd_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_harq_information_rel8_fdd_t* harq_info_rel8_fdd = (nfapi_ul_config_harq_information_rel8_fdd_t*)tlv;
+
+	return ( push16(harq_info_rel8_fdd->n_pucch_1_0, ppWritePackedMsg, end) &&
+			push8(harq_info_rel8_fdd->harq_size, ppWritePackedMsg, end));
+}
+static uint8_t pack_ul_config_request_harq_info_rel9_fdd_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_harq_information_rel9_fdd_t* harq_info_rel9_fdd = (nfapi_ul_config_harq_information_rel9_fdd_t*)tlv;
+	
+	return ( push8(harq_info_rel9_fdd->harq_size, ppWritePackedMsg, end) &&
+			push8(harq_info_rel9_fdd->ack_nack_mode, ppWritePackedMsg, end) &&
+			push8(harq_info_rel9_fdd->number_of_pucch_resources, ppWritePackedMsg, end) &&
+			push16(harq_info_rel9_fdd->n_pucch_1_0, ppWritePackedMsg, end) &&
+			push16(harq_info_rel9_fdd->n_pucch_1_1, ppWritePackedMsg, end) &&
+			push16(harq_info_rel9_fdd->n_pucch_1_2, ppWritePackedMsg, end) &&
+			push16(harq_info_rel9_fdd->n_pucch_1_3, ppWritePackedMsg, end));
+}
+static uint8_t pack_ul_config_request_harq_info_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_harq_information_rel11_t* harq_info_rel11 = (nfapi_ul_config_harq_information_rel11_t*)tlv;
+	
+	return ( push8(harq_info_rel11->num_ant_ports, ppWritePackedMsg, end) &&
+			push16(harq_info_rel11->n_pucch_2_0, ppWritePackedMsg, end) &&
+			push16(harq_info_rel11->n_pucch_2_1, ppWritePackedMsg, end) &&
+			push16(harq_info_rel11->n_pucch_2_2, ppWritePackedMsg, end) &&
+			push16(harq_info_rel11->n_pucch_2_3, ppWritePackedMsg, end));
+}
+static uint8_t pack_ul_config_request_harq_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_harq_information_rel13_t* harq_info_rel13 = (nfapi_ul_config_harq_information_rel13_t*)tlv;
+	
+	return ( push16(harq_info_rel13->harq_size_2, ppWritePackedMsg, end) &&
+			push8(harq_info_rel13->starting_prb, ppWritePackedMsg, end) &&
+			push8(harq_info_rel13->n_prb, ppWritePackedMsg, end) &&
+			push8(harq_info_rel13->cdm_index, ppWritePackedMsg, end) &&
+			push8(harq_info_rel13->n_srs, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_harq_information(nfapi_ul_config_harq_information* harq_info, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG, &harq_info->harq_information_rel10_tdd, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel10_tdd_value) &&
+	pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG, &harq_info->harq_information_rel8_fdd, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel8_fdd_value) &&
+	pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG, &harq_info->harq_information_rel9_fdd, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel9_fdd_value) &&
+	pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG, &harq_info->harq_information_rel11, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel11_value) &&
+	pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG, &harq_info->harq_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel13_value));
+
+}
+
+static uint8_t pack_ul_config_request_cqi_info_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_information_rel8_t* cqi_info_rel8 = (nfapi_ul_config_cqi_information_rel8_t*)tlv;
+
+	return ( push16(cqi_info_rel8->pucch_index, ppWritePackedMsg, end) &&
+			 push8(cqi_info_rel8->dl_cqi_pmi_size, ppWritePackedMsg, end));
+}
+static uint8_t pack_ul_config_request_cqi_info_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_information_rel10_t* cqi_info_rel10 = (nfapi_ul_config_cqi_information_rel10_t*)tlv;
+	
+	return ( push8(cqi_info_rel10->number_of_pucch_resource, ppWritePackedMsg, end) &&
+			 push16(cqi_info_rel10->pucch_index_p1, ppWritePackedMsg, end));
+}
+static uint8_t pack_ul_config_request_cqi_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_information_rel13_t* cqi_info_rel13 = (nfapi_ul_config_cqi_information_rel13_t*)tlv;
+	
+	return ( push8(cqi_info_rel13->csi_mode, ppWritePackedMsg, end) &&
+			push16(cqi_info_rel13->dl_cqi_pmi_size_2, ppWritePackedMsg, end) &&
+			push8(cqi_info_rel13->starting_prb, ppWritePackedMsg, end) &&
+			push8(cqi_info_rel13->n_prb, ppWritePackedMsg, end) &&
+			push8(cqi_info_rel13->cdm_index, ppWritePackedMsg, end) &&
+			push8(cqi_info_rel13->n_srs, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_cqi_information(nfapi_ul_config_cqi_information* cqi_info, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG, &cqi_info->cqi_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_cqi_info_rel8_value) && 
+	pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG, &cqi_info->cqi_information_rel10, ppWritePackedMsg, end, &pack_ul_config_request_cqi_info_rel10_value) &&
+	pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG, &cqi_info->cqi_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_cqi_info_rel13_value));
+
+}
+
+static uint8_t pack_ul_config_request_sr_info_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_sr_information_rel8_t* sr_info_rel8 = (nfapi_ul_config_sr_information_rel8_t*)tlv;
+	return push16(sr_info_rel8->pucch_index, ppWritePackedMsg, end);
+}
+static uint8_t pack_ul_config_request_sr_info_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_sr_information_rel10_t* sr_info_rel10 = (nfapi_ul_config_sr_information_rel10_t*)tlv;
+
+	return ( push8(sr_info_rel10->number_of_pucch_resources, ppWritePackedMsg, end) &&
+		 	 push16(sr_info_rel10->pucch_index_p1, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_sr_information(nfapi_ul_config_sr_information* sr_info, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG, &sr_info->sr_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_sr_info_rel8_value) &&
+	pack_tlv(NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG, &sr_info->sr_information_rel10, ppWritePackedMsg, end, &pack_ul_config_request_sr_info_rel10_value));
+}
+
+static uint8_t pack_ul_config_request_srs_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_srs_pdu_rel8_t* srs_pdu_rel8 = (nfapi_ul_config_srs_pdu_rel8_t*)tlv;
+	
+	return (push32(srs_pdu_rel8->handle, ppWritePackedMsg, end) &&
+			push16(srs_pdu_rel8->size, ppWritePackedMsg, end) &&
+			push16(srs_pdu_rel8->rnti, ppWritePackedMsg, end) &&
+			push8(srs_pdu_rel8->srs_bandwidth, ppWritePackedMsg, end) &&
+			push8(srs_pdu_rel8->frequency_domain_position, ppWritePackedMsg, end) &&
+			push8(srs_pdu_rel8->srs_hopping_bandwidth, ppWritePackedMsg, end) &&
+			push8(srs_pdu_rel8->transmission_comb, ppWritePackedMsg, end) &&
+			push16(srs_pdu_rel8->i_srs, ppWritePackedMsg, end) &&
+			push8(srs_pdu_rel8->sounding_reference_cyclic_shift, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_srs_pdu_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_srs_pdu_rel10_t* srs_pdu_rel10 = (nfapi_ul_config_srs_pdu_rel10_t*)tlv;
+	return push8(srs_pdu_rel10->antenna_port, ppWritePackedMsg, end);
+}
+
+static uint8_t pack_ul_config_request_srs_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_srs_pdu_rel13_t* srs_pdu_rel13 = (nfapi_ul_config_srs_pdu_rel13_t*)tlv;
+	
+	return ( push8(srs_pdu_rel13->number_of_combs, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_nb_harq_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_nb_harq_information_rel13_fdd_t* nb_harq_pdu_rel13 = (nfapi_ul_config_nb_harq_information_rel13_fdd_t*)tlv;
+	
+	return ( push8(nb_harq_pdu_rel13->harq_ack_resource, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_config_request_nulsch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_nulsch_pdu_rel13_t* nulsch_pdu_rel13 = (nfapi_ul_config_nulsch_pdu_rel13_t*)tlv;
+	
+	return (push8(nulsch_pdu_rel13->nulsch_format, ppWritePackedMsg, end) &&
+		    push32(nulsch_pdu_rel13->handle, ppWritePackedMsg, end) &&
+		    push16(nulsch_pdu_rel13->size, ppWritePackedMsg, end) &&
+		    push16(nulsch_pdu_rel13->rnti, ppWritePackedMsg, end) &&
+		    push8(nulsch_pdu_rel13->subcarrier_indication, ppWritePackedMsg, end) &&
+		    push8(nulsch_pdu_rel13->resource_assignment, ppWritePackedMsg, end) &&
+		    push8(nulsch_pdu_rel13->mcs, ppWritePackedMsg, end) &&
+		    push8(nulsch_pdu_rel13->redudancy_version, ppWritePackedMsg, end) &&
+		    push8(nulsch_pdu_rel13->repetition_number, ppWritePackedMsg, end) &&
+		    push8(nulsch_pdu_rel13->new_data_indication, ppWritePackedMsg, end) &&
+		    push8(nulsch_pdu_rel13->n_srs, ppWritePackedMsg, end) &&
+		    push16(nulsch_pdu_rel13->scrambling_sequence_initialization_cinit, ppWritePackedMsg, end) &&
+		    push16(nulsch_pdu_rel13->sf_idx, ppWritePackedMsg, end) && 
+		    pack_ul_config_request_ue_information(&(nulsch_pdu_rel13->ue_information), ppWritePackedMsg, end) &&
+		    pack_tlv(NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG, &nulsch_pdu_rel13->nb_harq_information.nb_harq_information_rel13_fdd, ppWritePackedMsg, end, &pack_ul_config_request_nb_harq_rel13_value));
+}
+static uint8_t pack_ul_config_request_nrach_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_nrach_pdu_rel13_t* nrach_pdu_rel13 = (nfapi_ul_config_nrach_pdu_rel13_t*)tlv;
+	
+	return ( push8(nrach_pdu_rel13->nprach_config_0, ppWritePackedMsg, end) &&
+			 push8(nrach_pdu_rel13->nprach_config_1, ppWritePackedMsg, end) &&
+			 push8(nrach_pdu_rel13->nprach_config_2, ppWritePackedMsg, end));
+	
+}
+
+static uint8_t pack_ul_config_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_request_body_t* value = (nfapi_ul_config_request_body_t*)tlv;
+
+	if(!(push8(value->number_of_pdus, ppWritePackedMsg, end) &&
+	 	 push8(value->rach_prach_frequency_resources, ppWritePackedMsg, end) &&
+		 push8(value->srs_present, ppWritePackedMsg, end)))
+		return 0;
+
+	uint16_t i = 0;
+	for(i = 0; i < value->number_of_pdus; ++i)
+	{
+		nfapi_ul_config_request_pdu_t* pdu = &(value->ul_config_pdu_list[i]);
+
+		if(push8(pdu->pdu_type, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		// Put a 0 size in and then determine the size after the pdu 
+		// has been writen and write the calculated size
+		uint8_t* pWritePackedMsgPduSize = *ppWritePackedMsg;
+		pdu->pdu_size = 0;
+		if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		switch(pdu->pdu_type)
+		{
+			case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE:
+				{
+					if(!pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_pdu), ppWritePackedMsg, end))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_cqi_ri_pdu.ulsch_pdu), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_cqi_ri_information(&(pdu->ulsch_cqi_ri_pdu.cqi_ri_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_initial_transmission_parameters(&(pdu->ulsch_cqi_ri_pdu.initial_transmission_parameters), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_harq_pdu.ulsch_pdu), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_ulsch_harq_information(&(pdu->ulsch_harq_pdu.harq_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_initial_transmission_parameters(&(pdu->ulsch_harq_pdu.initial_transmission_parameters), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_cqi_ri_information(&(pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_ulsch_harq_information(&(pdu->ulsch_cqi_harq_ri_pdu.harq_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_initial_transmission_parameters(&(pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_pdu.ue_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_cqi_information(&(pdu->uci_cqi_pdu.cqi_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ue_information(&(pdu->uci_sr_pdu.ue_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_sr_information(&(pdu->uci_sr_pdu.sr_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ue_information(&(pdu->uci_harq_pdu.ue_information), ppWritePackedMsg, end) &&
+	 					 pack_ul_config_request_harq_information(&(pdu->uci_harq_pdu.harq_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ue_information(&(pdu->uci_sr_harq_pdu.ue_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_sr_information(&(pdu->uci_sr_harq_pdu.sr_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_harq_information(&(pdu->uci_sr_harq_pdu.harq_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_harq_pdu.ue_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_cqi_information(&(pdu->uci_cqi_harq_pdu.cqi_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_harq_information(&(pdu->uci_cqi_harq_pdu.harq_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_sr_pdu.ue_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_cqi_information(&(pdu->uci_cqi_sr_pdu.cqi_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_sr_information(&(pdu->uci_cqi_sr_pdu.sr_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_sr_harq_pdu.ue_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_cqi_information(&(pdu->uci_cqi_sr_harq_pdu.cqi_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_sr_information(&(pdu->uci_cqi_sr_harq_pdu.sr_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_harq_information(&(pdu->uci_cqi_sr_harq_pdu.harq_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_SRS_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG, &pdu->srs_pdu.srs_pdu_rel8, ppWritePackedMsg, end, &pack_ul_config_request_srs_pdu_rel8_value) &&
+						 pack_tlv(NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG, &pdu->srs_pdu.srs_pdu_rel10, ppWritePackedMsg, end, &pack_ul_config_request_srs_pdu_rel10_value) &&
+						 pack_tlv(NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG, &pdu->srs_pdu.srs_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_srs_pdu_rel13_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ue_information(&(pdu->harq_buffer_pdu.ue_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_uci_csi_pdu.ulsch_pdu), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_cqi_information(&(pdu->ulsch_uci_csi_pdu.csi_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_uci_harq_pdu.ulsch_pdu), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_harq_information(&(pdu->ulsch_uci_harq_pdu.harq_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE:
+				{
+					if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_csi_uci_harq_pdu.ulsch_pdu), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_cqi_information(&(pdu->ulsch_csi_uci_harq_pdu.csi_information), ppWritePackedMsg, end) &&
+						 pack_ul_config_request_harq_information(&(pdu->ulsch_csi_uci_harq_pdu.harq_information), ppWritePackedMsg, end)))
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG, &pdu->nulsch_pdu.nulsch_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_nulsch_pdu_rel13_value)))	
+						return 0;
+				}
+				break;
+			case NFAPI_UL_CONFIG_NRACH_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG, &pdu->nrach_pdu.nrach_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_nrach_pdu_rel13_value)))
+						return 0;
+				}
+				break;				
+			default:
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type );
+				}
+				break;
+		};
+
+		// add 1 for the pdu_type. The delta will include the pdu_size
+		pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize);
+		push8(pdu->pdu_size, &pWritePackedMsgPduSize, end);
+		
+	}
+	return 1;
+}
+
+static uint8_t pack_ul_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_ul_config_request_t *pNfapiMsg = (nfapi_ul_config_request_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_UL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->ul_config_request_body, ppWritePackedMsg, end, &pack_ul_config_request_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)) ;
+}
+
+static uint8_t pack_hi_dci0_hi_rel8_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_hi_pdu_rel8_t* hi_pdu_rel8 = (nfapi_hi_dci0_hi_pdu_rel8_t*)tlv;
+	
+	return ( push8(hi_pdu_rel8->resource_block_start, ppWritePackedMsg, end) &&
+			 push8(hi_pdu_rel8->cyclic_shift_2_for_drms, ppWritePackedMsg, end) &&
+			 push8(hi_pdu_rel8->hi_value, ppWritePackedMsg, end) &&
+			 push8(hi_pdu_rel8->i_phich, ppWritePackedMsg, end) &&
+			 push16(hi_pdu_rel8->transmission_power, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_hi_dci0_hi_rel10_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_hi_pdu_rel10_t* hi_pdu_rel10 = (nfapi_hi_dci0_hi_pdu_rel10_t*)tlv;
+	
+	return ( push8(hi_pdu_rel10->flag_tb2, ppWritePackedMsg, end) &&
+			 push8(hi_pdu_rel10->hi_value_2, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_hi_dci0_dci_rel8_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_dci_pdu_rel8_t* dci_pdu_rel8 = (nfapi_hi_dci0_dci_pdu_rel8_t*)tlv;
+	
+	return ( push8(dci_pdu_rel8->dci_format, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->cce_index, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->aggregation_level, ppWritePackedMsg, end) &&
+			 push16(dci_pdu_rel8->rnti, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->resource_block_start, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->number_of_resource_block, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->mcs_1, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->cyclic_shift_2_for_drms, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->frequency_hopping_enabled_flag, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->frequency_hopping_bits, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->new_data_indication_1, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->ue_tx_antenna_seleciton, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->tpc, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->cqi_csi_request, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->ul_index, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel8->dl_assignment_index, ppWritePackedMsg, end) &&
+			 push32(dci_pdu_rel8->tpc_bitmap, ppWritePackedMsg, end) &&
+			 push16(dci_pdu_rel8->transmission_power, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_hi_dci0_dci_rel10_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_dci_pdu_rel10_t* dci_pdu_rel10 = (nfapi_hi_dci0_dci_pdu_rel10_t*)tlv;
+	
+	return ( push8(dci_pdu_rel10->cross_carrier_scheduling_flag, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->carrier_indicator, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->size_of_cqi_csi_feild, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->srs_flag, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->srs_request, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->resource_allocation_flag, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->resource_allocation_type, ppWritePackedMsg, end) &&
+			 push32(dci_pdu_rel10->resource_block_coding, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->mcs_2, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->new_data_indication_2, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->number_of_antenna_ports, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->tpmi, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->total_dci_length_including_padding, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel10->n_ul_rb, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_hi_dci0_dci_rel12_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_dci_pdu_rel12_t* dci_pdu_rel12 = (nfapi_hi_dci0_dci_pdu_rel12_t*)tlv;
+	
+	return ( push8(dci_pdu_rel12->pscch_resource, ppWritePackedMsg, end) &&
+			 push8(dci_pdu_rel12->time_resource_pattern, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_hi_dci0_mpdcch_dci_rel13_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t* mpdcch_dci_pdu_rel13 = (nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t*)tlv;
+	
+	return ( push8(mpdcch_dci_pdu_rel13->mpdcch_narrowband, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->number_of_prb_pairs, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->resource_block_assignment, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->mpdcch_transmission_type, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->start_symbol, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->ecce_index, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->aggreagation_level, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->rnti_type, ppWritePackedMsg, end) &&
+			 push16(mpdcch_dci_pdu_rel13->rnti, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->ce_mode, ppWritePackedMsg, end) &&
+			 push16(mpdcch_dci_pdu_rel13->drms_scrambling_init, ppWritePackedMsg, end) &&
+			 push16(mpdcch_dci_pdu_rel13->initial_transmission_sf_io, ppWritePackedMsg, end) &&
+			 push16(mpdcch_dci_pdu_rel13->transmission_power, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->dci_format, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->resource_block_start, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->number_of_resource_blocks, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->mcs, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->pusch_repetition_levels, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->frequency_hopping_flag, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->new_data_indication, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->harq_process, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->redudency_version, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->tpc, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->csi_request, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->ul_inex, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->dai_presence_flag, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->dl_assignment_index, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->srs_request, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->dci_subframe_repetition_number, ppWritePackedMsg, end) &&
+			 push32(mpdcch_dci_pdu_rel13->tcp_bitmap, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->total_dci_length_include_padding, ppWritePackedMsg, end) &&
+			 push8(mpdcch_dci_pdu_rel13->number_of_tx_antenna_ports, ppWritePackedMsg, end) &&
+			 pusharray16(mpdcch_dci_pdu_rel13->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, mpdcch_dci_pdu_rel13->number_of_tx_antenna_ports, ppWritePackedMsg, end));
+	
+}
+
+static uint8_t pack_hi_dci0_npdcch_dci_rel13_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_npdcch_dci_pdu_rel13_t* npdcch_dci_pdu_rel13 = (nfapi_hi_dci0_npdcch_dci_pdu_rel13_t*)tlv;
+	
+	return ( push8(npdcch_dci_pdu_rel13->ncce_index, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->aggregation_level, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->start_symbol, ppWritePackedMsg, end) &&
+			 push16(npdcch_dci_pdu_rel13->rnti, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->scrambling_reinitialization_batch_index, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->nrs_antenna_ports_assumed_by_the_ue, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->subcarrier_indication, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->resource_assignment, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->scheduling_delay, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->mcs, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->redudancy_version, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->repetition_number, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->new_data_indicator, ppWritePackedMsg, end) &&
+			 push8(npdcch_dci_pdu_rel13->dci_subframe_repetition_number, ppWritePackedMsg, end));
+}
+
+
+static uint8_t pack_hi_dci0_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_request_body_t* value = (nfapi_hi_dci0_request_body_t*)tlv;
+
+	if(!(push16(value->sfnsf, ppWritePackedMsg, end) &&
+		 push8(value->number_of_dci, ppWritePackedMsg, end) &&
+		 push8(value->number_of_hi, ppWritePackedMsg, end)))
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_pdus = value->number_of_dci + value->number_of_hi;
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_hi_dci0_request_pdu_t* pdu = &(value->hi_dci0_pdu_list[i]);
+
+		if(push8(pdu->pdu_type, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		// Put a 0 size in and then determine the size after the pdu 
+		// has been writen and write the calculated size
+		uint8_t* pWritePackedMsgPduSize = *ppWritePackedMsg;
+		pdu->pdu_size = 0;
+		if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		switch(pdu->pdu_type)
+		{
+			case NFAPI_HI_DCI0_HI_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG, &pdu->hi_pdu.hi_pdu_rel8, ppWritePackedMsg, end, pack_hi_dci0_hi_rel8_pdu_value) &&
+						 pack_tlv(NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG, &pdu->hi_pdu.hi_pdu_rel10, ppWritePackedMsg, end, pack_hi_dci0_hi_rel10_pdu_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_HI_DCI0_DCI_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG, &pdu->dci_pdu.dci_pdu_rel8, ppWritePackedMsg, end, pack_hi_dci0_dci_rel8_pdu_value) &&
+						 pack_tlv(NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG, &pdu->dci_pdu.dci_pdu_rel10, ppWritePackedMsg, end, pack_hi_dci0_dci_rel10_pdu_value) &&
+						 pack_tlv(NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG, &pdu->dci_pdu.dci_pdu_rel12, ppWritePackedMsg, end, pack_hi_dci0_dci_rel12_pdu_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel8, ppWritePackedMsg, end, pack_hi_dci0_dci_rel8_pdu_value) &&
+						 pack_tlv(NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel10, ppWritePackedMsg, end, pack_hi_dci0_dci_rel10_pdu_value) &&
+						 pack_tlv(NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG, &pdu->epdcch_dci_pdu.epdcch_parameters_rel11, ppWritePackedMsg, end, pack_dl_config_epdcch_parameters_rel11_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG, &pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13, ppWritePackedMsg, end, pack_hi_dci0_mpdcch_dci_rel13_pdu_value)))
+						return 0;
+				}
+				break;
+			case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE:
+				{
+					if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG, &pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13, ppWritePackedMsg, end, pack_hi_dci0_npdcch_dci_rel13_pdu_value)))
+						return 0;
+				}
+				break;				
+			default:
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type );
+				}
+				break;
+		};
+
+		// add 1 for the pdu_type. The delta will include the pdu_size
+		pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize);
+		push8(pdu->pdu_size, &pWritePackedMsgPduSize, end);
+		
+	}
+
+	return 1;
+}
+
+static uint8_t pack_hi_dci0_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_hi_dci0_request_t *pNfapiMsg = (nfapi_hi_dci0_request_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_HI_DCI0_REQUEST_BODY_TAG, &pNfapiMsg->hi_dci0_request_body, ppWritePackedMsg, end, &pack_hi_dci0_request_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_tx_request_body_t* value = (nfapi_tx_request_body_t*)tlv;
+	
+	if(push16(value->number_of_pdus, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_pdus = value->number_of_pdus;
+	for(; i < total_number_of_pdus; ++i)
+	{
+		nfapi_tx_request_pdu_t* pdu = &(value->tx_pdu_list[i]);
+				
+		if(!(push16(pdu->pdu_length, ppWritePackedMsg, end) &&
+			 push16(pdu->pdu_index, ppWritePackedMsg, end)))
+			return 0;
+
+		uint8_t j;
+		for(j = 0; j < pdu->num_segments; ++j)
+		{
+			// Use -1 as it is unbounded 
+			// DJP - does not handle -1
+                        // DJP - if(pusharray8(pdu->segments[j].segment_data, (uint32_t)(-1), pdu->segments[j].segment_length, ppWritePackedMsg, end) == 0)
+			int push_ret = pusharray8(pdu->segments[j].segment_data, 65535, pdu->segments[j].segment_length, ppWritePackedMsg, end);
+                        
+                        if (0 && pdu->segments[j].segment_length == 3)
+                        {
+                          NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, 
+                          pdu->segments[j].segment_data[0], 
+                          pdu->segments[j].segment_data[1], 
+                          pdu->segments[j].segment_data[2]
+                          );
+                        }
+                        //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() segment_data:%p segment_length:%u pusharray8()=%d\n", __FUNCTION__, pdu->segments[j].segment_data, pdu->segments[j].segment_length, push_ret);
+
+                        if (push_ret == 0)
+			{
+				return 0;
+			}
+		}
+	}
+
+	return 1;
+}
+
+static uint8_t pack_tx_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_tx_request_t *pNfapiMsg = (nfapi_tx_request_t*)msg;
+	
+	int x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end);
+        int y = pack_tlv(NFAPI_TX_REQUEST_BODY_TAG, &pNfapiMsg->tx_request_body, ppWritePackedMsg, end, &pack_tx_request_body_value);
+        int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
+
+        //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() x:%d y:%d z:%d\n", __FUNCTION__, x, y, z);
+
+        return x && y && z;
+}
+
+static uint8_t pack_rx_ue_information_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_rx_ue_information* value = (nfapi_rx_ue_information*)tlv;
+	
+	return ( push32(value->handle, ppWritePackedMsg, end) &&
+			 push16(value->rnti, ppWritePackedMsg, end) );
+}
+
+static uint8_t unpack_rx_ue_information_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_rx_ue_information* value = (nfapi_rx_ue_information*)tlv;
+	
+	return ( pull32(ppReadPackedMsg, &value->handle, end) &&
+			 pull16(ppReadPackedMsg, &value->rnti, end));
+}
+
+static uint8_t pack_harq_indication_tdd_harq_data_bundling(nfapi_harq_indication_tdd_harq_data_bundling_t* data, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( push8(data->value_0, ppWritePackedMsg, end) &&
+			 push8(data->value_1, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_harq_indication_tdd_harq_data_multiplexing(nfapi_harq_indication_tdd_harq_data_multiplexing_t* data, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( push8(data->value_0, ppWritePackedMsg, end) &&
+			 push8(data->value_1, ppWritePackedMsg, end) &&
+			 push8(data->value_2, ppWritePackedMsg, end) &&
+			 push8(data->value_3, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_harq_indication_tdd_harq_data_special_bundling(nfapi_harq_indication_tdd_harq_data_special_bundling_t* data, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( push8(data->value_0, ppWritePackedMsg, end) );
+}
+
+static uint8_t pack_harq_indication_tdd_harq_data(nfapi_harq_indication_tdd_harq_data_t* data, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	return ( push8(data->value_0, ppWritePackedMsg, end) );
+}
+
+static uint8_t pack_harq_indication_tdd_rel8_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_tdd_rel8_t* harq_indication_tdd_rel8 = (nfapi_harq_indication_tdd_rel8_t*)tlv;
+	
+	if(!(push8(harq_indication_tdd_rel8->mode, ppWritePackedMsg, end) &&
+		 push8(harq_indication_tdd_rel8->number_of_ack_nack, ppWritePackedMsg, end)))
+			return 0;
+
+	uint8_t result = 0;
+	switch(harq_indication_tdd_rel8->mode)
+	{
+		case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING:
+			result = pack_harq_indication_tdd_harq_data_bundling(&harq_indication_tdd_rel8->harq_data.bundling, ppWritePackedMsg, end);
+			break;
+		case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING:
+			result = pack_harq_indication_tdd_harq_data_multiplexing(&harq_indication_tdd_rel8->harq_data.multiplex, ppWritePackedMsg, end);
+			break;
+		case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING:
+			result = pack_harq_indication_tdd_harq_data_special_bundling(&harq_indication_tdd_rel8->harq_data.special_bundling, ppWritePackedMsg, end);
+			break;
+		case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION:
+		case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3:
+			result = 1;
+			break;			
+		default:
+			// err....
+			break;
+	}
+
+	return result;
+	
+}
+
+static uint8_t pack_harq_indication_tdd_rel9_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_tdd_rel9_t* harq_indication_tdd_rel9 = (nfapi_harq_indication_tdd_rel9_t*)tlv;
+	
+	if(!(push8(harq_indication_tdd_rel9->mode, ppWritePackedMsg, end) &&
+		 push8(harq_indication_tdd_rel9->number_of_ack_nack, ppWritePackedMsg, end)))
+		return 0;
+
+	uint8_t idx; 
+	for(idx = 0; idx < harq_indication_tdd_rel9->number_of_ack_nack; ++idx)
+	{
+		uint8_t result = 0;
+
+		switch(harq_indication_tdd_rel9->mode)
+		{
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING:
+				result = pack_harq_indication_tdd_harq_data(&(harq_indication_tdd_rel9->harq_data[idx].bundling), ppWritePackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING:
+				result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel9->harq_data[idx].multiplex, ppWritePackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING:
+				result = pack_harq_indication_tdd_harq_data_special_bundling(&harq_indication_tdd_rel9->harq_data[idx].special_bundling, ppWritePackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION:
+				result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel9->harq_data[idx].channel_selection, ppWritePackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3:
+				result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel9->harq_data[idx].format_3, ppWritePackedMsg, end);
+				break;
+			default:
+				// err....
+				break;
+		}
+
+		if(result == 0)
+			return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t pack_harq_indication_tdd_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_tdd_rel13_t* harq_indication_tdd_rel13 = (nfapi_harq_indication_tdd_rel13_t*)tlv;
+	
+	if(!(push8(harq_indication_tdd_rel13->mode, ppWritePackedMsg, end) &&
+		 push16(harq_indication_tdd_rel13->number_of_ack_nack, ppWritePackedMsg, end)))
+		return 0;
+
+	uint8_t idx; 
+	for(idx = 0; idx < harq_indication_tdd_rel13->number_of_ack_nack; ++idx)
+	{
+		uint8_t result = 0;
+		switch(harq_indication_tdd_rel13->mode)
+		{
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING:
+				result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].bundling, ppWritePackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING:
+				result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].multiplex, ppWritePackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING:
+				result = pack_harq_indication_tdd_harq_data_special_bundling(&harq_indication_tdd_rel13->harq_data[idx].special_bundling, ppWritePackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION:
+				result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].channel_selection, ppWritePackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3:
+				result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].format_3, ppWritePackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4:
+				result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].format_4, ppWritePackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5:
+				result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].format_5, ppWritePackedMsg, end);
+				break;
+			default:
+				// err....
+				break;
+		}
+
+		if(result == 0)
+			return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t pack_harq_indication_fdd_rel8_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_fdd_rel8_t* harq_indication_fdd_rel8 = (nfapi_harq_indication_fdd_rel8_t*)tlv;
+	
+	return ( push8(harq_indication_fdd_rel8->harq_tb1, ppWritePackedMsg, end) &&
+			 push8(harq_indication_fdd_rel8->harq_tb2, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_harq_indication_fdd_rel9_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_fdd_rel9_t* harq_indication_fdd_rel9 = (nfapi_harq_indication_fdd_rel9_t*)tlv;
+	
+	return ( push8(harq_indication_fdd_rel9->mode, ppWritePackedMsg, end) &&
+			 push8(harq_indication_fdd_rel9->number_of_ack_nack, ppWritePackedMsg, end) &&
+			 pusharray8(harq_indication_fdd_rel9->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL9_MAX, harq_indication_fdd_rel9->number_of_ack_nack, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_harq_indication_fdd_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_fdd_rel13_t* harq_indication_fdd_rel13 = (nfapi_harq_indication_fdd_rel13_t*)tlv;
+	
+	return ( push8(harq_indication_fdd_rel13->mode, ppWritePackedMsg, end) &&
+			 push16(harq_indication_fdd_rel13->number_of_ack_nack, ppWritePackedMsg, end) &&
+			 pusharray8(harq_indication_fdd_rel13->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL13_MAX, harq_indication_fdd_rel13->number_of_ack_nack, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_ul_cqi_information_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_ul_cqi_information_t* value = (nfapi_ul_cqi_information_t*)tlv;
+	
+	return ( push8(value->ul_cqi, ppWritePackedMsg, end) &&
+			 push8(value->channel, ppWritePackedMsg, end));
+
+}
+
+static uint8_t pack_harq_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_body_t* value = (nfapi_harq_indication_body_t*)tlv;
+	
+	if(push16(value->number_of_harqs, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_pdus = value->number_of_harqs;
+	for(; i < total_number_of_pdus; ++i)
+	{
+		nfapi_harq_indication_pdu_t* pdu = &(value->harq_pdu_list[i]);
+
+		uint8_t* instance_length_p = *ppWritePackedMsg;
+		if(!push16(pdu->instance_length, ppWritePackedMsg, end))
+			return 0;
+
+		if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) &&
+			 pack_tlv(NFAPI_HARQ_INDICATION_TDD_REL8_TAG, &pdu->harq_indication_tdd_rel8, ppWritePackedMsg, end, pack_harq_indication_tdd_rel8_value) &&
+			 pack_tlv(NFAPI_HARQ_INDICATION_TDD_REL9_TAG, &pdu->harq_indication_tdd_rel9, ppWritePackedMsg, end, pack_harq_indication_tdd_rel9_value) &&
+			 pack_tlv(NFAPI_HARQ_INDICATION_TDD_REL13_TAG, &pdu->harq_indication_tdd_rel13, ppWritePackedMsg, end, pack_harq_indication_tdd_rel13_value) &&
+			 pack_tlv(NFAPI_HARQ_INDICATION_FDD_REL8_TAG, &pdu->harq_indication_fdd_rel8, ppWritePackedMsg, end, pack_harq_indication_fdd_rel8_value) &&
+			 pack_tlv(NFAPI_HARQ_INDICATION_FDD_REL9_TAG, &pdu->harq_indication_fdd_rel9, ppWritePackedMsg, end, pack_harq_indication_fdd_rel9_value) &&
+			 pack_tlv(NFAPI_HARQ_INDICATION_FDD_REL13_TAG, &pdu->harq_indication_fdd_rel13, ppWritePackedMsg, end, pack_harq_indication_fdd_rel13_value) &&
+			 pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value)))
+			return 0;
+
+		// calculate the instance length subtracting the size of the instance
+		// length feild
+		uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2;
+		push16(instance_length, &instance_length_p, end);
+	}
+
+	return 1;
+}
+
+static uint8_t pack_harq_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_harq_indication_t *pNfapiMsg = (nfapi_harq_indication_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->harq_indication_body, ppWritePackedMsg, end, pack_harq_indication_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_crc_indication_rel8_body(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_crc_indication_rel8_t* crc_indication_rel8 = (nfapi_crc_indication_rel8_t*)tlv;
+	
+	return ( push8(crc_indication_rel8->crc_flag, ppWritePackedMsg, end) );
+}
+
+static uint8_t pack_crc_indication_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_crc_indication_body_t* value = (nfapi_crc_indication_body_t*)tlv;
+	
+	if(push16(value->number_of_crcs, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_pdus = value->number_of_crcs;
+	for(; i < total_number_of_pdus; ++i)
+	{
+		nfapi_crc_indication_pdu_t* pdu = &(value->crc_pdu_list[i]);
+		
+		uint8_t* instance_length_p = *ppWritePackedMsg;
+		if(!push16(pdu->instance_length, ppWritePackedMsg, end))
+			return 0;
+		
+		if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) &&
+			 pack_tlv(NFAPI_CRC_INDICATION_REL8_TAG, &pdu->crc_indication_rel8, ppWritePackedMsg, end, pack_crc_indication_rel8_body)))
+			return 0;
+
+		// calculate the instance length subtracting the size of the instance
+		// length feild
+		uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2;
+		push16(instance_length, &instance_length_p, end);
+	}
+	return 1;
+}
+
+static uint8_t pack_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_crc_indication_t *pNfapiMsg = (nfapi_crc_indication_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_CRC_INDICATION_BODY_TAG, &pNfapiMsg->crc_indication_body, ppWritePackedMsg, end, &pack_crc_indication_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+
+}
+static uint8_t pack_rx_indication_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_rx_indication_rel8_t* value = (nfapi_rx_indication_rel8_t*)tlv;
+	
+	return ( push16(value->length, ppWritePackedMsg, end) &&
+			 push16(value->offset, ppWritePackedMsg, end) &&
+			 push8(value->ul_cqi, ppWritePackedMsg, end) &&
+			 push16(value->timing_advance, ppWritePackedMsg, end));
+}
+static uint8_t pack_rx_indication_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_rx_indication_rel9_t* value = (nfapi_rx_indication_rel9_t*)tlv;
+	
+	return ( push16(value->timing_advance_r9, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_rx_indication_body_t* value = (nfapi_rx_indication_body_t*)tlv;
+
+        //printf("RX ULSCH BODY\n");
+
+	if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	// need to calculate the data offset's. 
+	uint16_t i = 0;
+	uint16_t offset = 2; // taking into account the number_of_pdus
+	uint16_t total_number_of_pdus = value->number_of_pdus;
+        //printf("ULSCH:pdus:%d\n", total_number_of_pdus);
+
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_rx_indication_pdu_t* pdu = &(value->rx_pdu_list[i]);
+		if(pdu->rx_ue_information.tl.tag == NFAPI_RX_UE_INFORMATION_TAG)
+		{
+                  //printf("NFAPI_RX_UE_INFORMATION_TAG\n");
+			offset += 4 + 6; 
+		}
+				
+		if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG)
+		{
+                  //printf("NFAPI_RX_INDICATION_REL8_TAG\n");
+			offset += 4 + 7;
+		}
+
+		if(pdu->rx_indication_rel9.tl.tag == NFAPI_RX_INDICATION_REL9_TAG)
+		{
+                  //printf("NFAPI_RX_INDICATION_REL9_TAG\n");
+			offset += 4 + 2;
+		}
+	}
+
+	// Now update the structure to include the offset
+	for(i =0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_rx_indication_pdu_t* pdu = &(value->rx_pdu_list[i]);
+				
+		if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG)
+		{
+			if(pdu->rx_indication_rel8.offset == 1)
+			{
+				pdu->rx_indication_rel8.offset = offset;
+				offset += pdu->rx_indication_rel8.length;
+			}
+		}
+	}
+	
+	// Write out the pdu
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_rx_indication_pdu_t* pdu = &(value->rx_pdu_list[i]);
+		if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) &&
+			 pack_tlv(NFAPI_RX_INDICATION_REL8_TAG, &pdu->rx_indication_rel8, ppWritePackedMsg, end, pack_rx_indication_rel8_value) &&
+			 pack_tlv(NFAPI_RX_INDICATION_REL9_TAG, &pdu->rx_indication_rel9, ppWritePackedMsg, end, pack_rx_indication_rel9_value)))
+			return 0;
+	}
+
+	// Write out the pdu data
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		uint16_t length = 0;
+		nfapi_rx_indication_pdu_t* pdu = &(value->rx_pdu_list[i]);
+
+		if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG)
+		{
+			length = pdu->rx_indication_rel8.length;
+		}
+
+		if( pusharray8(value->rx_pdu_list[i].data, length, length, ppWritePackedMsg, end) == 0)
+			return 0;
+	}
+	return 1;
+}
+
+
+static uint8_t pack_rx_ulsch_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_rx_indication_t *pNfapiMsg = (nfapi_rx_indication_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_RX_INDICATION_BODY_TAG, &pNfapiMsg->rx_indication_body, ppWritePackedMsg, end, pack_rx_ulsch_indication_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_preamble_pdu_rel8_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_preamble_pdu_rel8_t* preamble_rel8 = (nfapi_preamble_pdu_rel8_t*)tlv;
+	
+	return ( push16(preamble_rel8->rnti, ppWritePackedMsg, end) &&
+			 push8(preamble_rel8->preamble, ppWritePackedMsg, end) &&
+			 push16(preamble_rel8->timing_advance, ppWritePackedMsg, end));
+}
+static uint8_t pack_preamble_pdu_rel9_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_preamble_pdu_rel9_t* preamble_rel9 = (nfapi_preamble_pdu_rel9_t*)tlv;
+	
+	return ( push16(preamble_rel9->timing_advance_r9, ppWritePackedMsg, end) );
+}
+static uint8_t pack_preamble_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_preamble_pdu_rel13_t* preamble_rel13 = (nfapi_preamble_pdu_rel13_t*)tlv;
+	
+	return ( push8(preamble_rel13->rach_resource_type, ppWritePackedMsg, end) );
+}
+
+static uint8_t pack_rach_indication_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_rach_indication_body_t* value = (nfapi_rach_indication_body_t*)tlv;
+	
+	if( push16(value->number_of_preambles, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_pdus = value->number_of_preambles;
+	for(; i < total_number_of_pdus; ++i)
+	{
+		nfapi_preamble_pdu_t* pdu = &(value->preamble_list[i]);
+		
+		uint8_t* instance_length_p = *ppWritePackedMsg;
+		if(!push16(pdu->instance_length, ppWritePackedMsg, end))
+			return 0;
+		
+		if(!(pack_tlv(NFAPI_PREAMBLE_REL8_TAG, &pdu->preamble_rel8, ppWritePackedMsg, end, pack_preamble_pdu_rel8_value) &&
+			 pack_tlv(NFAPI_PREAMBLE_REL9_TAG, &pdu->preamble_rel9, ppWritePackedMsg, end, pack_preamble_pdu_rel9_value) &&
+			 pack_tlv(NFAPI_PREAMBLE_REL13_TAG, &pdu->preamble_rel13, ppWritePackedMsg, end, pack_preamble_pdu_rel13_value)))
+			return 0;
+
+		// calculate the instance length subtracting the size of the instance
+		// length feild
+		uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2;
+		push16(instance_length, &instance_length_p, end);
+	}
+
+	return 1;
+}
+
+static uint8_t pack_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_rach_indication_t *pNfapiMsg = (nfapi_rach_indication_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_RACH_INDICATION_BODY_TAG, &pNfapiMsg->rach_indication_body, ppWritePackedMsg, end, pack_rach_indication_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_srs_indication_fdd_rel8_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_srs_indication_fdd_rel8_t* srs_pdu_rel8 = (nfapi_srs_indication_fdd_rel8_t*)tlv;
+	
+	return ( push16(srs_pdu_rel8->doppler_estimation, ppWritePackedMsg, end) &&
+			 push16(srs_pdu_rel8->timing_advance, ppWritePackedMsg, end) &&
+			 push8(srs_pdu_rel8->number_of_resource_blocks, ppWritePackedMsg, end) &&
+			 push8(srs_pdu_rel8->rb_start, ppWritePackedMsg, end) &&
+			 pusharray8(srs_pdu_rel8->snr, NFAPI_NUM_RB_MAX, srs_pdu_rel8->number_of_resource_blocks, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_srs_indication_fdd_rel9_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_srs_indication_fdd_rel9_t* srs_pdu_rel9 = (nfapi_srs_indication_fdd_rel9_t*)tlv;
+	
+	return ( push16(srs_pdu_rel9->timing_advance_r9, ppWritePackedMsg, end) );
+}
+
+static uint8_t pack_srs_indication_tdd_rel10_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_srs_indication_ttd_rel10_t* srs_pdu_rel10 = (nfapi_srs_indication_ttd_rel10_t*)tlv;
+	
+	return ( push8(srs_pdu_rel10->uppts_symbol, ppWritePackedMsg, end) );
+	
+}
+
+static uint8_t pack_srs_indication_fdd_rel11_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_srs_indication_fdd_rel11_t* srs_pdu_rel11 = (nfapi_srs_indication_fdd_rel11_t*)tlv;
+	
+	return ( push16(srs_pdu_rel11->ul_rtoa, ppWritePackedMsg, end) ) ;
+}
+
+static uint8_t pack_tdd_channel_measurement_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_tdd_channel_measurement_t* value = (nfapi_tdd_channel_measurement_t*)tlv;
+
+	if(!(push8(value->num_prb_per_subband, ppWritePackedMsg, end) &&
+		 push8(value->number_of_subbands, ppWritePackedMsg, end) &&
+		 push8(value->num_atennas, ppWritePackedMsg, end)))
+		return 0;
+
+	uint8_t idx = 0;
+	for(idx = 0; idx < value->number_of_subbands; ++idx)
+	{
+		if(!(push8(value->subands[idx].subband_index, ppWritePackedMsg, end) &&
+			 pusharray16(value->subands[idx].channel, NFAPI_MAX_NUM_PHYSICAL_ANTENNAS, value->num_atennas, ppWritePackedMsg, end)))
+			return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t pack_srs_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg,  uint8_t *end)
+{
+	nfapi_srs_indication_body_t *value = (nfapi_srs_indication_body_t*)tlv;
+
+	if( push8(value->number_of_ues, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_pdus = value->number_of_ues;
+	for(; i < total_number_of_pdus; ++i)
+	{
+		nfapi_srs_indication_pdu_t* pdu = &(value->srs_pdu_list[i]);
+		
+		uint8_t* instance_length_p = *ppWritePackedMsg;
+		if(!push16(pdu->instance_length, ppWritePackedMsg, end))
+			return 0;
+		
+		if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, &pack_rx_ue_information_value) &&
+			 pack_tlv(NFAPI_SRS_INDICATION_FDD_REL8_TAG, &pdu->srs_indication_fdd_rel8, ppWritePackedMsg, end, &pack_srs_indication_fdd_rel8_value) &&
+			 pack_tlv(NFAPI_SRS_INDICATION_FDD_REL9_TAG, &pdu->srs_indication_fdd_rel9, ppWritePackedMsg, end, &pack_srs_indication_fdd_rel9_value) &&
+			 pack_tlv(NFAPI_SRS_INDICATION_TDD_REL10_TAG, &pdu->srs_indication_tdd_rel10, ppWritePackedMsg, end, &pack_srs_indication_tdd_rel10_value) &&
+			 pack_tlv(NFAPI_SRS_INDICATION_FDD_REL11_TAG, &pdu->srs_indication_fdd_rel11, ppWritePackedMsg, end, &pack_srs_indication_fdd_rel11_value) &&
+			 pack_tlv(NFAPI_TDD_CHANNEL_MEASUREMENT_TAG, &pdu->tdd_channel_measurement, ppWritePackedMsg, end, &pack_tdd_channel_measurement_value)))
+			return 0;
+
+		// calculate the instance length subtracting the size of the instance
+		// length feild
+		uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2;
+		push16(instance_length, &instance_length_p, end);
+	}
+
+	return 1;
+}
+
+static uint8_t pack_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_srs_indication_t *pNfapiMsg = (nfapi_srs_indication_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_SRS_INDICATION_BODY_TAG, &pNfapiMsg->srs_indication_body, ppWritePackedMsg, end, &pack_srs_indication_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+
+}
+
+static uint8_t pack_sr_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_sr_indication_body_t* value = (nfapi_sr_indication_body_t*)tlv;
+
+	if(push16(value->number_of_srs, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_pdus = value->number_of_srs;
+	for(; i < total_number_of_pdus; ++i)
+	{
+		nfapi_sr_indication_pdu_t* pdu = &(value->sr_pdu_list[i]);
+
+		uint8_t* instance_length_p = *ppWritePackedMsg;
+		if(!push16(pdu->instance_length, ppWritePackedMsg, end))
+			return 0;
+
+		if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) &&
+			 pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value)))
+			return 0;
+
+		// calculate the instance length subtracting the size of the instance
+		// length feild
+		uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2;
+		push16(instance_length, &instance_length_p, end);
+	}
+	return 1;
+}
+
+static uint8_t pack_sr_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_sr_indication_t *pNfapiMsg = (nfapi_sr_indication_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_SR_INDICATION_BODY_TAG, &pNfapiMsg->sr_indication_body, ppWritePackedMsg, end, &pack_sr_indication_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+
+}
+
+static uint8_t pack_cqi_indication_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_cqi_indication_rel8_t* cqi_pdu_rel8 = (nfapi_cqi_indication_rel8_t*)tlv;
+	
+	return ( push16(cqi_pdu_rel8->length, ppWritePackedMsg, end) &&
+			 push16(cqi_pdu_rel8->data_offset, ppWritePackedMsg, end) &&
+			 push8(cqi_pdu_rel8->ul_cqi, ppWritePackedMsg, end) &&
+			 push8(cqi_pdu_rel8->ri, ppWritePackedMsg, end) &&
+			 push16(cqi_pdu_rel8->timing_advance, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_cqi_indication_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_cqi_indication_rel9_t* cqi_pdu_rel9 = (nfapi_cqi_indication_rel9_t*)tlv;
+	
+	return  ( push16(cqi_pdu_rel9->length, ppWritePackedMsg, end) &&
+			  push16(cqi_pdu_rel9->data_offset, ppWritePackedMsg, end) &&
+			  push8(cqi_pdu_rel9->ul_cqi, ppWritePackedMsg, end) &&
+			  push8(cqi_pdu_rel9->number_of_cc_reported, ppWritePackedMsg, end) &&
+			  pusharray8(cqi_pdu_rel9->ri, NFAPI_CC_MAX, cqi_pdu_rel9->number_of_cc_reported, ppWritePackedMsg, end) &&
+			  push16(cqi_pdu_rel9->timing_advance, ppWritePackedMsg, end) &&
+			  push16(cqi_pdu_rel9->timing_advance_r9, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_cqi_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_cqi_indication_body_t* value = (nfapi_cqi_indication_body_t*)tlv;
+
+	if( push16(value->number_of_cqis, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	// need to calculate the data offset's. This very bittle due the hardcoding
+	// of the sizes. can not use the sizeof as we have an array for the Rel9
+	// info
+	uint16_t i = 0;
+	uint16_t offset = 2; // taking into account the number_of_cqis
+	uint16_t total_number_of_pdus = value->number_of_cqis;
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_cqi_indication_pdu_t* pdu = &(value->cqi_pdu_list[i]);
+		
+		offset += 2; // for the instance length
+		
+		if(pdu->rx_ue_information.tl.tag == NFAPI_RX_UE_INFORMATION_TAG)
+		{
+			offset += 4 + 6; // sizeof(nfapi_rx_ue_information) - sizeof(nfapi_tl_t)
+		}
+				
+		if(pdu->cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG)
+		{
+			offset += 4 + 8;
+		}
+
+		if(pdu->cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG)
+		{
+			offset += 4 + 10 + pdu->cqi_indication_rel9.number_of_cc_reported;
+		}
+
+		if(pdu->ul_cqi_information.tl.tag == NFAPI_UL_CQI_INFORMATION_TAG)
+		{
+			offset += 4 + 2;
+		}
+	}
+
+	// Now update the structure to include the offset
+	for(i =0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_cqi_indication_pdu_t* pdu = &(value->cqi_pdu_list[i]);
+				
+		if(pdu->cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG)
+		{
+			if(pdu->cqi_indication_rel8.data_offset == 1)
+			{
+				pdu->cqi_indication_rel8.data_offset = offset;
+				offset += pdu->cqi_indication_rel8.length;
+			}
+		}
+
+		if(pdu->cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG)
+		{
+			if(pdu->cqi_indication_rel9.data_offset == 1)
+			{
+				pdu->cqi_indication_rel9.data_offset = offset;
+				offset += pdu->cqi_indication_rel9.length;
+			}
+		}
+
+	}
+	
+	// Write out the cqi information
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_cqi_indication_pdu_t* pdu = &(value->cqi_pdu_list[i]);
+
+		uint8_t* instance_length_p = *ppWritePackedMsg;
+		if(!push16(pdu->instance_length, ppWritePackedMsg, end))
+			return 0;
+		
+		if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end ,pack_rx_ue_information_value) &&
+			 pack_tlv(NFAPI_CQI_INDICATION_REL8_TAG, &pdu->cqi_indication_rel8, ppWritePackedMsg, end, pack_cqi_indication_rel8_value) &&
+			 pack_tlv(NFAPI_CQI_INDICATION_REL9_TAG, &pdu->cqi_indication_rel9, ppWritePackedMsg, end, pack_cqi_indication_rel9_value) &&
+			 pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value)))
+			return 0;
+
+		// calculate the instance length subtracting the size of the instance
+		// length feild
+		uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2;
+		push16(instance_length, &instance_length_p, end);
+		
+	}
+
+	// Write out the cqi raw data
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		uint16_t length = 0;
+		nfapi_cqi_indication_pdu_t* pdu = &(value->cqi_pdu_list[i]);
+
+		if(pdu->cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG)
+		{
+			length = pdu->cqi_indication_rel8.length;
+		}
+
+		if(pdu->cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG)
+		{
+			length = pdu->cqi_indication_rel9.length;
+		}
+
+		if( pusharray8(value->cqi_raw_pdu_list[i].pdu, NFAPI_CQI_RAW_MAX_LEN, length, ppWritePackedMsg, end) == 0)
+			return 0;
+	}
+
+	return 1; 
+}
+
+static uint8_t pack_cqi_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_cqi_indication_t *pNfapiMsg = (nfapi_cqi_indication_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_CQI_INDICATION_BODY_TAG, &pNfapiMsg->cqi_indication_body, ppWritePackedMsg, end, pack_cqi_indication_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+
+}
+
+static uint8_t pack_lbt_pdsch_req_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lbt_pdsch_req_pdu_rel13_t* value = (nfapi_lbt_pdsch_req_pdu_rel13_t*)tlv;
+	
+	return ( push32(value->handle, ppWritePackedMsg, end) &&
+			 push32(value->mp_cca, ppWritePackedMsg, end) &&
+			 push32(value->n_cca, ppWritePackedMsg, end) &&
+			 push32(value->offset, ppWritePackedMsg, end) &&
+			 push32(value->lte_txop_sf, ppWritePackedMsg, end) &&
+			 push16(value->txop_sfn_sf_end, ppWritePackedMsg, end) &&
+			 push32(value->lbt_mode, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_lbt_drs_req_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lbt_drs_req_pdu_rel13_t* value = (nfapi_lbt_drs_req_pdu_rel13_t*)tlv;
+	
+	return ( push32(value->handle, ppWritePackedMsg, end) &&
+			 push32(value->offset, ppWritePackedMsg, end) &&
+			 push16(value->sfn_sf_end, ppWritePackedMsg, end) &&
+			 push32(value->lbt_mode, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_lbt_dl_config_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lbt_dl_config_request_body_t* value = (nfapi_lbt_dl_config_request_body_t*)tlv;
+	
+	if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_pdus = value->number_of_pdus;
+	for(; i < total_number_of_pdus; ++i)
+	{
+		nfapi_lbt_dl_config_request_pdu_t* pdu = &(value->lbt_dl_config_req_pdu_list[i]);
+		
+		if( push8(pdu->pdu_type, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		// Put a 0 size in and then determine the size after the pdu 
+		// has been writen and write the calculated size
+		uint8_t* pWritePackedMsgPduSize = *ppWritePackedMsg;
+		pdu->pdu_size = 0;
+		if( push8(pdu->pdu_size, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		switch(pdu->pdu_type)
+		{
+			case NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE:
+				{
+					if( pack_tlv(NFAPI_LBT_PDSCH_REQ_PDU_REL13_TAG, &pdu->lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13, ppWritePackedMsg, end, pack_lbt_pdsch_req_pdu_rel13_value) == 0)
+						return 0;
+				}
+				break;
+			case NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE:
+				{
+					if(pack_tlv(NFAPI_LBT_DRS_REQ_PDU_REL13_TAG, &pdu->lbt_drs_req_pdu.lbt_drs_req_pdu_rel13, ppWritePackedMsg, end, pack_lbt_drs_req_pdu_rel13_value) == 0)
+						return 0;
+				}
+				break;
+			default:
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL_CONFIG.request invalid pdu type %d \n", pdu->pdu_type );
+				}
+				break;
+		};
+
+		// add 1 for the pdu_type. The delta will include the pdu_size
+		pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize);
+		push8(pdu->pdu_size, &pWritePackedMsgPduSize, end);
+	}
+
+	return 1;
+}
+
+static uint8_t pack_lbt_pdsch_rsp_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lbt_pdsch_rsp_pdu_rel13_t* value = (nfapi_lbt_pdsch_rsp_pdu_rel13_t*)tlv;
+	
+	return ( push32(value->handle, ppWritePackedMsg, end) &&
+			 push32(value->result, ppWritePackedMsg, end) &&
+			 push32(value->lte_txop_symbols, ppWritePackedMsg, end) &&
+			 push32(value->initial_partial_sf, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_lbt_drs_rsp_pdu_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lbt_drs_rsp_pdu_rel13_t* value = (nfapi_lbt_drs_rsp_pdu_rel13_t*)tlv;
+	
+	return ( push32(value->handle, ppWritePackedMsg, end) &&
+			 push32(value->result, ppWritePackedMsg, end));
+}
+
+static uint8_t pack_lbt_dl_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_lbt_dl_config_request_t *pNfapiMsg = (nfapi_lbt_dl_config_request_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_LBT_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->lbt_dl_config_request_body, ppWritePackedMsg, end, &pack_lbt_dl_config_request_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_lbt_dl_config_indication_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_lbt_dl_indication_body_t* value = (nfapi_lbt_dl_indication_body_t*)tlv;
+	
+	if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_pdus = value->number_of_pdus;
+	for(; i < total_number_of_pdus; ++i)
+	{
+		nfapi_lbt_dl_indication_pdu_t* pdu = &(value->lbt_indication_pdu_list[i]);
+		
+		if( push8(pdu->pdu_type, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		// Put a 0 size in and then determine the size after the pdu 
+		// has been writen and write the calculated size
+		uint8_t* pWritePackedMsgPduSize = *ppWritePackedMsg;
+		pdu->pdu_size = 0;
+		
+		if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0)
+			return 0;
+
+		switch(pdu->pdu_type)
+		{
+			case NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE:
+				{
+					if( pack_tlv(NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG, &pdu->lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13, ppWritePackedMsg, end, pack_lbt_pdsch_rsp_pdu_rel13_value) == 0)
+						return 0;
+				}
+				break;
+			case NFAPI_LBT_DL_RSP_DRS_PDU_TYPE:
+				{
+					if( pack_tlv(NFAPI_LBT_DRS_RSP_PDU_REL13_TAG, &pdu->lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13, ppWritePackedMsg, end, pack_lbt_drs_rsp_pdu_rel13_value) == 0)
+						return 0;
+				}
+				break;
+			default:
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL.indication body invalid pdu type %d \n", pdu->pdu_type );
+				}
+				break;
+		};
+
+		// add 1 for the pdu_type. The delta will include the pdu_size
+		pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize);
+		push8(pdu->pdu_size, &pWritePackedMsgPduSize, end);
+	}
+
+	return 1;
+}
+
+static uint8_t pack_lbt_dl_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_lbt_dl_indication_t *pNfapiMsg = (nfapi_lbt_dl_indication_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_LBT_DL_INDICATION_BODY_TAG, &pNfapiMsg->lbt_dl_indication_body, ppWritePackedMsg, end, &pack_lbt_dl_config_indication_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_nb_harq_indication_fdd_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nb_harq_indication_fdd_rel13_t* nb_harq_indication_fdd_rel13 = (nfapi_nb_harq_indication_fdd_rel13_t*)tlv;
+	
+	return ( push8(nb_harq_indication_fdd_rel13->harq_tb1, ppWritePackedMsg, end) );
+}
+
+static uint8_t pack_nb_harq_indication_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nb_harq_indication_body_t* value = (nfapi_nb_harq_indication_body_t*)tlv;
+	
+	if( push16(value->number_of_harqs, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_harqs = value->number_of_harqs;
+	for(; i < total_number_of_harqs; ++i)
+	{
+		nfapi_nb_harq_indication_pdu_t* pdu = &(value->nb_harq_pdu_list[i]);
+		
+		uint8_t* instance_length_p = *ppWritePackedMsg;
+		if(!push16(pdu->instance_length, ppWritePackedMsg, end))
+			return 0;
+
+		if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) &&
+			 pack_tlv(NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG, &pdu->nb_harq_indication_fdd_rel13, ppWritePackedMsg, end, pack_nb_harq_indication_fdd_rel13_value) &&
+			 pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value)))
+			return 0;
+			
+		// calculate the instance length subtracting the size of the instance
+		// length feild
+		uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2;
+		push16(instance_length, &instance_length_p, end);
+	}
+
+	return 1;
+}
+
+
+static uint8_t pack_nb_harq_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_nb_harq_indication_t *pNfapiMsg = (nfapi_nb_harq_indication_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_NB_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->nb_harq_indication_body, ppWritePackedMsg, end, &pack_nb_harq_indication_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_nrach_indication_rel13_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nrach_indication_pdu_rel13_t* nrach_indication_fdd_rel13 = (nfapi_nrach_indication_pdu_rel13_t*)tlv;
+	
+	return ( push16(nrach_indication_fdd_rel13->rnti, ppWritePackedMsg, end) &&
+			 push8(nrach_indication_fdd_rel13->initial_sc, ppWritePackedMsg, end) &&
+			 push16(nrach_indication_fdd_rel13->timing_advance, ppWritePackedMsg, end) &&
+			 push8(nrach_indication_fdd_rel13->nrach_ce_level, ppWritePackedMsg, end));
+}
+
+
+static uint8_t pack_nrach_indication_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+{
+	nfapi_nrach_indication_body_t* value = (nfapi_nrach_indication_body_t*)tlv;
+	
+	if( push8(value->number_of_initial_scs_detected, ppWritePackedMsg, end) == 0)
+		return 0;
+
+	uint16_t i = 0;
+	uint16_t total_number_of_initial_scs_detected = value->number_of_initial_scs_detected;
+	for(; i < total_number_of_initial_scs_detected; ++i)
+	{
+		nfapi_nrach_indication_pdu_t* pdu = &(value->nrach_pdu_list[i]);
+		
+		//uint8_t* instance_length_p = *ppWritePackedMsg;
+		//if(!push16(pdu->instance_length, ppWritePackedMsg, end))
+		//	return 0;
+
+		if(!(pack_tlv(NFAPI_NRACH_INDICATION_REL13_TAG, &pdu->nrach_indication_rel13, ppWritePackedMsg, end, pack_nrach_indication_rel13_value)))
+			return 0;
+			
+		// calculate the instance length subtracting the size of the instance
+		// length feild
+		//uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2;
+		//push16(instance_length, &instance_length_p, end);
+	}
+
+	return 1;
+}
+
+static uint8_t pack_nrach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_nrach_indication_t *pNfapiMsg = (nfapi_nrach_indication_t*)msg;
+	
+	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+			 pack_tlv(NFAPI_NRACH_INDICATION_BODY_TAG, &pNfapiMsg->nrach_indication_body, ppWritePackedMsg, end, &pack_nrach_indication_body_value) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_dl_node_sync(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_dl_node_sync_t *pNfapiMsg = (nfapi_dl_node_sync_t*)msg;
+
+	return ( push32(pNfapiMsg->t1, ppWritePackedMsg, end) &&
+			 pushs32(pNfapiMsg->delta_sfn_sf, ppWritePackedMsg, end) &&
+			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_ul_node_sync(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_ul_node_sync_t *pNfapiMsg = (nfapi_ul_node_sync_t*)msg;
+
+	return (push32(pNfapiMsg->t1, ppWritePackedMsg, end) &&
+			push32(pNfapiMsg->t2, ppWritePackedMsg, end) &&
+			push32(pNfapiMsg->t3, ppWritePackedMsg, end) &&
+			pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+static uint8_t pack_timing_info(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_timing_info_t *pNfapiMsg = (nfapi_timing_info_t*)msg;
+
+	return (push32(pNfapiMsg->last_sfn_sf, ppWritePackedMsg, end) &&
+			push32(pNfapiMsg->time_since_last_timing_info, ppWritePackedMsg, end) &&
+			push32(pNfapiMsg->dl_config_jitter, ppWritePackedMsg, end) &&
+			push32(pNfapiMsg->tx_request_jitter, ppWritePackedMsg, end) &&
+			push32(pNfapiMsg->ul_config_jitter, ppWritePackedMsg, end) &&
+			push32(pNfapiMsg->hi_dci0_jitter, ppWritePackedMsg, end) &&
+			pushs32(pNfapiMsg->dl_config_latest_delay, ppWritePackedMsg, end) &&
+			pushs32(pNfapiMsg->tx_request_latest_delay, ppWritePackedMsg, end) &&
+			pushs32(pNfapiMsg->ul_config_latest_delay, ppWritePackedMsg, end) &&
+			pushs32(pNfapiMsg->hi_dci0_latest_delay, ppWritePackedMsg, end) &&
+			pushs32(pNfapiMsg->dl_config_earliest_arrival, ppWritePackedMsg, end) &&
+			pushs32(pNfapiMsg->tx_request_earliest_arrival, ppWritePackedMsg, end) &&
+			pushs32(pNfapiMsg->ul_config_earliest_arrival, ppWritePackedMsg, end) &&
+			pushs32(pNfapiMsg->hi_dci0_earliest_arrival, ppWritePackedMsg, end) &&
+			pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
+}
+
+
+// Main pack function - public
+
+int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t* config)
+{
+	nfapi_p7_message_header_t *pMessageHeader = pMessageBuf;
+	uint8_t *pWritePackedMessage = pPackedBuf;
+	uint8_t *pPackedLengthField = &pWritePackedMessage[4];
+	uint8_t *end = pPackedBuf + packedBufLen;
+
+	if (pMessageBuf == NULL || pPackedBuf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack supplied pointers are null\n");
+		return -1;
+	}
+
+	// process the header
+	if(!(push16(pMessageHeader->phy_id, &pWritePackedMessage, end) &&
+		 push16(pMessageHeader->message_id, &pWritePackedMessage, end) &&
+		 push16(0/*pMessageHeader->message_length*/, &pWritePackedMessage, end) &&
+		 push16(pMessageHeader->m_segment_sequence, &pWritePackedMessage, end) &&
+		 push32(0/*pMessageHeader->checksum*/, &pWritePackedMessage, end) &&
+		 push32(pMessageHeader->transmit_timestamp, &pWritePackedMessage, end)))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack header failed\n");
+		return -1;
+	}
+
+        if (pMessageHeader->message_id != NFAPI_TIMING_INFO)
+        {
+          //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() message_id:0x%04x phy_id:%u m_segment_sequence:%u timestamp:%u\n", __FUNCTION__, pMessageHeader->message_id, pMessageHeader->phy_id, pMessageHeader->m_segment_sequence, pMessageHeader->transmit_timestamp);
+        }
+	// look for the specific message
+	uint8_t result = 0;
+	switch (pMessageHeader->message_id)
+	{
+		case NFAPI_DL_CONFIG_REQUEST:
+                  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST\n", __FUNCTION__);
+			result = pack_dl_config_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_UL_CONFIG_REQUEST:
+			result = pack_ul_config_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_HI_DCI0_REQUEST:
+			result = pack_hi_dci0_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_TX_REQUEST:
+                        //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_TX_REQUEST\n", __FUNCTION__);
+			result = pack_tx_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_HARQ_INDICATION:
+			result = pack_harq_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_CRC_INDICATION:
+			result = pack_crc_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_RX_ULSCH_INDICATION:
+                        //printf("RX ULSCH\n");
+			result = pack_rx_ulsch_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_RACH_INDICATION:
+			result = pack_rach_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_SRS_INDICATION:
+			result = pack_srs_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_RX_SR_INDICATION:
+			result = pack_sr_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_RX_CQI_INDICATION:
+			result = pack_cqi_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_LBT_DL_CONFIG_REQUEST:
+			result = pack_lbt_dl_config_request(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_LBT_DL_INDICATION:
+			result = pack_lbt_dl_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_NB_HARQ_INDICATION:
+			result = pack_nb_harq_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_NRACH_INDICATION:
+			result = pack_nrach_indication(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_DL_NODE_SYNC:
+			result = pack_dl_node_sync(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_UL_NODE_SYNC:
+			result = pack_ul_node_sync(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		case NFAPI_TIMING_INFO:
+			result = pack_timing_info(pMessageHeader, &pWritePackedMessage, end, config);
+			break;
+
+		default:
+			{
+				if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
+				   pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
+				{
+					if(config && config->pack_p7_vendor_extension)
+					{
+						result = (config->pack_p7_vendor_extension)(pMessageHeader, &pWritePackedMessage, end, config);
+					}
+					else
+					{
+						NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve ecoder provided\n", __FUNCTION__, pMessageHeader->message_id);
+					}
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id);
+				}
+			}
+			break;
+	}
+
+	if(result == 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack failed to pack message\n");
+		return -1;
+	}
+
+	// check for a valid message length
+	uintptr_t msgHead = (uintptr_t)pPackedBuf;
+	uintptr_t msgEnd = (uintptr_t)pWritePackedMessage;
+	uint32_t packedMsgLen = msgEnd - msgHead;
+	uint16_t packedMsgLen16;
+	if (packedMsgLen > 0xFFFF || packedMsgLen > packedBufLen)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Packed message length error %d, buffer supplied %d\n", packedMsgLen, packedBufLen);
+		return -1;
+	}
+	else
+	{
+		packedMsgLen16 = (uint16_t)packedMsgLen;
+	}
+
+	// Update the message length in the header
+	pMessageHeader->message_length = packedMsgLen16;
+	
+	if(!push16(packedMsgLen16, &pPackedLengthField, end))
+		return -1;
+		
+	if(1)
+	{
+		//quick test
+		if(pMessageHeader->message_length != packedMsgLen)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi packedMsgLen(%d) != message_length(%d) id %d\n", packedMsgLen, pMessageHeader->message_length, pMessageHeader->message_id);
+		}
+	}
+
+	return (packedMsgLen);
+}
+
+
+
+// Unpack routines
+
+static uint8_t unpack_dl_config_dci_dl_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel8_t* dci_dl_pdu_rel8 = (nfapi_dl_config_dci_dl_pdu_rel8_t*)tlv; 
+
+	return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->dci_format, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->cce_idx, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->aggregation_level, end) &&
+			pull16(ppReadPackedMsg, &dci_dl_pdu_rel8->rnti, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->resource_allocation_type, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->virtual_resource_block_assignment_flag, end) &&
+			pull32(ppReadPackedMsg, &dci_dl_pdu_rel8->resource_block_coding, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->mcs_1, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->redundancy_version_1, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->new_data_indicator_1, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->transport_block_to_codeword_swap_flag, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->mcs_2, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->redundancy_version_2, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->new_data_indicator_2, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->harq_process, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->tpmi, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->pmi, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->precoding_information, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->tpc, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->downlink_assignment_index, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->ngap, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->transport_block_size_index, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->downlink_power_offset, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->allocate_prach_flag, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->preamble_index, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->prach_mask_index, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->rnti_type, end) &&
+			pull16(ppReadPackedMsg, &dci_dl_pdu_rel8->transmission_power, end));
+
+}
+
+static uint8_t unpack_dl_config_dci_dl_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel9_t* dci_dl_pdu_rel9 = (nfapi_dl_config_dci_dl_pdu_rel9_t*)tlv;
+	
+	return ( pull8(ppReadPackedMsg, &dci_dl_pdu_rel9->mcch_flag, end) &&
+			 pull8(ppReadPackedMsg, &dci_dl_pdu_rel9->mcch_change_notification, end) &&
+			 pull8(ppReadPackedMsg, &dci_dl_pdu_rel9->scrambling_identity, end));
+}
+
+static uint8_t unpack_dl_config_dci_dl_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel10_t* dci_dl_pdu_rel10 = (nfapi_dl_config_dci_dl_pdu_rel10_t*)tlv;
+
+	return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->cross_carrier_scheduling_flag, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->carrier_indicator, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->srs_flag, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->srs_request, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->antenna_ports_scrambling_and_layers, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->total_dci_length_including_padding, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->n_dl_rb, end));
+}
+
+static uint8_t unpack_dl_config_dci_dl_pdu_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel11_t* dci_dl_pdu_rel11 = (nfapi_dl_config_dci_dl_pdu_rel11_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel11->harq_ack_resource_offset, end) && 
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel11->pdsch_re_mapping_quasi_co_location_indicator, end));
+}
+
+static uint8_t unpack_dl_config_dci_dl_pdu_rel12_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel12_t* dci_dl_pdu_rel12 = (nfapi_dl_config_dci_dl_pdu_rel12_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel12->primary_cell_type, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel12->ul_dl_configuration_flag, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel12->number_ul_dl_configurations, end) &&
+			pullarray8(ppReadPackedMsg, dci_dl_pdu_rel12->ul_dl_configuration_indication, NFAPI_MAX_UL_DL_CONFIGURATIONS, dci_dl_pdu_rel12->number_ul_dl_configurations, end));
+}
+
+static uint8_t unpack_tpm_value(uint8_t **ppReadPackedMsg, nfapi_dl_config_dci_dl_tpm_t *value, uint8_t *end)
+{
+	if(!(pull8(ppReadPackedMsg, &value->num_prb_per_subband, end) && 
+		 pull8(ppReadPackedMsg, &value->number_of_subbands, end) &&
+		 pull8(ppReadPackedMsg, &value->num_antennas, end)))
+		return 0;
+	
+	
+	uint8_t idx = 0;
+	for(idx = 0; idx < value->number_of_subbands; ++idx)
+	{
+		nfapi_dl_config_dci_dl_tpm_subband_info_t* subband_info = &(value->subband_info[idx]);
+		
+		if(!(pull8(ppReadPackedMsg, &subband_info->subband_index, end) &&
+			 pull8(ppReadPackedMsg, &subband_info->scheduled_ues, end)))
+			return 0;
+			
+		uint8_t antenna_idx = 0;
+		uint8_t scheduled_ue_idx = 0;
+		
+		for(antenna_idx = 0; antenna_idx < value->num_antennas; ++antenna_idx)
+		{
+			for(scheduled_ue_idx = 0; scheduled_ue_idx < subband_info->scheduled_ues; ++scheduled_ue_idx)
+			{
+				if(!pull16(ppReadPackedMsg, &(subband_info->precoding_value[antenna_idx][scheduled_ue_idx]), end))
+					return 0;
+			}
+		}
+
+	}
+	
+	
+	return 1;
+			
+}
+
+
+static uint8_t unpack_dl_config_dci_dl_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dci_dl_pdu_rel13_t* dci_dl_pdu_rel13 = (nfapi_dl_config_dci_dl_pdu_rel13_t*)tlv;
+	
+	// If the length is greater than 5 then the TPM struct flag and possiably the TPM structure have been 
+	// added
+	uint8_t tpm_struct_flag_present = dci_dl_pdu_rel13->tl.length > 5;
+	dci_dl_pdu_rel13->tpm_struct_flag = 0;
+	
+	return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->laa_end_partial_sf_flag, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->laa_end_partial_sf_configuration, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->initial_lbt_sf, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->codebook_size_determination, end) &&
+			pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->drms_table_flag, end) && 
+			( (tpm_struct_flag_present == 1) ? pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->tpm_struct_flag, end) : 1) &&
+			( (tpm_struct_flag_present == 1 &&  dci_dl_pdu_rel13->tpm_struct_flag == 1) ? unpack_tpm_value(ppReadPackedMsg, &dci_dl_pdu_rel13->tpm, end) : 1));
+			
+}
+
+static uint8_t unpack_dl_config_bch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_bch_pdu_rel8_t* bch_pdu_rel8 = (nfapi_dl_config_bch_pdu_rel8_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &bch_pdu_rel8->length, end) &&
+			 pull16(ppReadPackedMsg, &bch_pdu_rel8->pdu_index, end) &&
+			 pull16(ppReadPackedMsg, &bch_pdu_rel8->transmission_power, end));
+}
+
+static uint8_t unpack_dl_config_mch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_mch_pdu_rel8_t* mch_pdu_rel8 = (nfapi_dl_config_mch_pdu_rel8_t*)tlv;
+	
+	return (pull16(ppReadPackedMsg, &mch_pdu_rel8->length, end) &&
+			pull16(ppReadPackedMsg, &mch_pdu_rel8->pdu_index, end) &&
+			pull16(ppReadPackedMsg, &mch_pdu_rel8->rnti, end) &&
+			pull8(ppReadPackedMsg, &mch_pdu_rel8->resource_allocation_type, end) &&
+			pull32(ppReadPackedMsg, &mch_pdu_rel8->resource_block_coding, end) &&
+			pull8(ppReadPackedMsg, &mch_pdu_rel8->modulation, end) &&
+			pull16(ppReadPackedMsg, &mch_pdu_rel8->transmission_power, end) &&
+			pull16(ppReadPackedMsg, &mch_pdu_rel8->mbsfn_area_id, end));
+}
+
+static uint8_t unpack_dl_config_dlsch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel8_t* dlsch_pdu_rel8 = (nfapi_dl_config_dlsch_pdu_rel8_t*)tlv;
+	
+	if (!(pull16(ppReadPackedMsg, &dlsch_pdu_rel8->length, end) &&
+		  pull16(ppReadPackedMsg, &dlsch_pdu_rel8->pdu_index, end) &&
+		  pull16(ppReadPackedMsg, &dlsch_pdu_rel8->rnti, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->resource_allocation_type, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->virtual_resource_block_assignment_flag, end) &&
+		  pull32(ppReadPackedMsg, &dlsch_pdu_rel8->resource_block_coding, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->modulation, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->redundancy_version, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transport_blocks, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transport_block_to_codeword_swap_flag, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transmission_scheme, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->number_of_layers, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->number_of_subbands, end) &&
+		  pullarray8(ppReadPackedMsg, dlsch_pdu_rel8->codebook_index, NFAPI_MAX_NUM_SUBBANDS, dlsch_pdu_rel8->number_of_subbands, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->ue_category_capacity, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->pa, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->delta_power_offset_index, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->ngap, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->nprb, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transmission_mode, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->num_bf_prb_per_subband, end) &&
+		  pull8(ppReadPackedMsg, &dlsch_pdu_rel8->num_bf_vector, end)))
+		return 0;
+
+	uint16_t j = 0;
+	for(j = 0; j < dlsch_pdu_rel8->num_bf_vector; ++j)
+	{								
+		if(!(pull8(ppReadPackedMsg, &dlsch_pdu_rel8->bf_vector[j].subband_index, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel8->bf_vector[j].num_antennas, end) &&
+			 pullarray16(ppReadPackedMsg, dlsch_pdu_rel8->bf_vector[j].bf_value, NFAPI_MAX_NUM_ANTENNAS, dlsch_pdu_rel8->bf_vector[j].num_antennas, end)))
+			return 0;
+	}
+	return 1;
+}
+static uint8_t unpack_dl_config_dlsch_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel9_t* dlsch_pdu_rel9 = (nfapi_dl_config_dlsch_pdu_rel9_t*)tlv;
+	return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel9->nscid, end) );
+}
+static uint8_t unpack_dl_config_dlsch_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel10_t* dlsch_pdu_rel10 = (nfapi_dl_config_dlsch_pdu_rel10_t*)tlv;
+	
+	return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_flag, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_resource_config_r10, end) &&
+			 pull16(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_zero_tx_power_resource_config_bitmap_r10, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_number_nzp_configuration, end) &&
+			 pullarray8(ppReadPackedMsg, dlsch_pdu_rel10->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, dlsch_pdu_rel10->csi_rs_number_nzp_configuration, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel10->pdsch_start, end)) ;
+}
+static uint8_t unpack_dl_config_dlsch_pdu_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel11_t* dlsch_pdu_rel11 = (nfapi_dl_config_dlsch_pdu_rel11_t*)tlv;
+	
+	return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel11->drms_config_flag, end) &&
+			 pull16(ppReadPackedMsg, &dlsch_pdu_rel11->drms_scrambling, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel11->csi_config_flag, end) &&
+			 pull16(ppReadPackedMsg, &dlsch_pdu_rel11->csi_scrambling, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel11->pdsch_re_mapping_flag, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel11->pdsch_re_mapping_atenna_ports, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel11->pdsch_re_mapping_freq_shift, end));
+}
+static uint8_t unpack_dl_config_dlsch_pdu_rel12_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel12_t* dlsch_pdu_rel12 = (nfapi_dl_config_dlsch_pdu_rel12_t*)tlv;
+	
+	return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel12->altcqi_table_r12, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel12->maxlayers, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel12->n_dl_harq, end));
+}
+static uint8_t unpack_dl_config_dlsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_dlsch_pdu_rel13_t* dlsch_pdu_rel13 = (nfapi_dl_config_dlsch_pdu_rel13_t*)tlv;
+	
+	return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel13->dwpts_symbols, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel13->initial_lbt_sf, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel13->ue_type, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel13->pdsch_payload_type, end) &&
+			 pull16(ppReadPackedMsg, &dlsch_pdu_rel13->initial_transmission_sf_io, end) &&
+			 pull8(ppReadPackedMsg, &dlsch_pdu_rel13->drms_table_flag, end));
+}
+
+static uint8_t unpack_dl_config_pch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_pch_pdu_rel8_t* pch_pdu_rel8 = (nfapi_dl_config_pch_pdu_rel8_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &pch_pdu_rel8->length, end) &&
+			 pull16(ppReadPackedMsg, &pch_pdu_rel8->pdu_index, end) &&
+			 pull16(ppReadPackedMsg, &pch_pdu_rel8->p_rnti, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->resource_allocation_type, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->virtual_resource_block_assignment_flag, end) &&
+			 pull32(ppReadPackedMsg, &pch_pdu_rel8->resource_block_coding, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->mcs, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->redundancy_version, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->number_of_transport_blocks, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->transport_block_to_codeword_swap_flag, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->transmission_scheme, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->number_of_layers, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->codebook_index, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->ue_category_capacity, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->pa, end) &&
+			 pull16(ppReadPackedMsg, &pch_pdu_rel8->transmission_power, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->nprb, end) &&
+			 pull8(ppReadPackedMsg, &pch_pdu_rel8->ngap, end));
+}
+static uint8_t unpack_dl_config_pch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_pch_pdu_rel13_t* pch_pdu_rel13 = (nfapi_dl_config_pch_pdu_rel13_t*)tlv;
+	
+	return ( pull8(ppReadPackedMsg, &pch_pdu_rel13->ue_mode, end) &&
+			 pull16(ppReadPackedMsg, &pch_pdu_rel13->initial_transmission_sf_io, end));
+}
+
+static uint8_t unpack_dl_config_prs_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_prs_pdu_rel9_t* prs_pdu_rel9 = (nfapi_dl_config_prs_pdu_rel9_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &prs_pdu_rel9->transmission_power, end) &&
+			 pull8(ppReadPackedMsg, &prs_pdu_rel9->prs_bandwidth, end) &&
+			 pull8(ppReadPackedMsg, &prs_pdu_rel9->prs_cyclic_prefix_type, end) &&
+			 pull8(ppReadPackedMsg, &prs_pdu_rel9->prs_muting, end));
+}
+
+static uint8_t unpack_dl_config_csi_rs_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_csi_rs_pdu_rel10_t* csi_rs_pdu_rel10 = (nfapi_dl_config_csi_rs_pdu_rel10_t*)tlv;
+	
+	return ( pull8(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_antenna_port_count_r10, end) &&
+			 pull8(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_resource_config_r10, end) &&
+			 pull16(ppReadPackedMsg, &csi_rs_pdu_rel10->transmission_power, end) &&
+			 pull16(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_zero_tx_power_resource_config_bitmap_r10, end) &&
+			 pull8(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_number_of_nzp_configuration, end) &&
+			 pullarray8(ppReadPackedMsg, csi_rs_pdu_rel10->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, csi_rs_pdu_rel10->csi_rs_number_of_nzp_configuration, end));
+}
+
+static uint8_t unpack_dl_config_csi_rs_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_csi_rs_pdu_rel13_t* csi_rs_pdu_rel13 = (nfapi_dl_config_csi_rs_pdu_rel13_t*)tlv;
+	
+	if (!(pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->csi_rs_class, end) &&
+		  pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->cdm_type, end) &&
+		  pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->num_bf_vector, end)))
+		return 0;
+
+	
+	uint16_t idx =0;
+	for(idx = 0; idx < csi_rs_pdu_rel13->num_bf_vector; ++idx)
+	{
+		if(!(pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->bf_vector[idx].csi_rs_resource_index, end)))
+			return 0;
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : HOW TO DECODE BF VALUE \n");
+		//pullarray16(ppReadPackedMsg, &csi_rs_pdu_rel13->bf_vector[idx].bf_vector, ??);
+	}
+	return 1;
+}
+
+static uint8_t unpack_dl_config_epdcch_params_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_epdcch_parameters_rel11_t* epdcch_params_rel11 = (nfapi_dl_config_epdcch_parameters_rel11_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &epdcch_params_rel11->epdcch_resource_assignment_flag, end) &&
+			pull16(ppReadPackedMsg, &epdcch_params_rel11->epdcch_id, end) &&
+			pull8(ppReadPackedMsg, &epdcch_params_rel11->epdcch_start_symbol, end) &&
+			pull8(ppReadPackedMsg, &epdcch_params_rel11->epdcch_num_prb, end) &&
+			pullarray8(ppReadPackedMsg, epdcch_params_rel11->epdcch_prb_index, NFAPI_MAX_EPDCCH_PRB, epdcch_params_rel11->epdcch_num_prb, end) &&
+			pull8(ppReadPackedMsg, &epdcch_params_rel11->bf_vector.subband_index, end) &&
+			pull8(ppReadPackedMsg, &epdcch_params_rel11->bf_vector.num_antennas, end) &&
+			pullarray16(ppReadPackedMsg, epdcch_params_rel11->bf_vector.bf_value, NFAPI_MAX_NUM_ANTENNAS, epdcch_params_rel11->bf_vector.num_antennas, end));
+}
+
+static uint8_t unpack_dl_config_epdcch_params_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_epdcch_parameters_rel13_t* epdcch_params_rel13 = (nfapi_dl_config_epdcch_parameters_rel13_t*)tlv;
+	
+	return ( pull8(ppReadPackedMsg, &epdcch_params_rel13->dwpts_symbols, end) &&
+			 pull8(ppReadPackedMsg, &epdcch_params_rel13->initial_lbt_sf, end));
+}
+
+static uint8_t unpack_dl_config_mpdcch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_mpdcch_pdu_rel13_t* mpdcch_params_rel13 = (nfapi_dl_config_mpdcch_pdu_rel13_t*)tlv;
+	
+	
+	return ( pull8(ppReadPackedMsg, &mpdcch_params_rel13->mpdcch_narrow_band, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->number_of_prb_pairs, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->resource_block_assignment, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->mpdcch_tansmission_type, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->start_symbol, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->ecce_index, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->aggregation_level, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->rnti_type, end) &&
+			 pull16(ppReadPackedMsg, &mpdcch_params_rel13->rnti, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->ce_mode, end) &&
+			 pull16(ppReadPackedMsg, &mpdcch_params_rel13->drms_scrambling_init, end) &&
+			 pull16(ppReadPackedMsg, &mpdcch_params_rel13->initial_transmission_sf_io, end) &&
+			 pull16(ppReadPackedMsg, &mpdcch_params_rel13->transmission_power, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->dci_format, end) &&
+			 pull16(ppReadPackedMsg, &mpdcch_params_rel13->resource_block_coding, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->mcs, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->pdsch_reptition_levels, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->redundancy_version, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->new_data_indicator, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->harq_process, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->tpmi_length, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->tpmi, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->pmi_flag, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->pmi, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->harq_resource_offset, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->dci_subframe_repetition_number, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->tpc, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->downlink_assignment_index_length, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->downlink_assignment_index, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->allocate_prach_flag, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->preamble_index, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->prach_mask_index, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->starting_ce_level, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->srs_request, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->antenna_ports_and_scrambling_identity_flag, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->antenna_ports_and_scrambling_identity, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->frequency_hopping_enabled_flag, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->paging_direct_indication_differentiation_flag, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->direct_indication, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->total_dci_length_including_padding, end) &&
+			 pull8(ppReadPackedMsg, &mpdcch_params_rel13->number_of_tx_antenna_ports, end) &&
+			 pullarray16(ppReadPackedMsg, mpdcch_params_rel13->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, mpdcch_params_rel13->number_of_tx_antenna_ports, end));
+}
+
+
+static uint8_t unpack_dl_config_nbch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_nbch_pdu_rel13_t* nbch_params_rel13 = (nfapi_dl_config_nbch_pdu_rel13_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &nbch_params_rel13->length, end) &&
+			 pull16(ppReadPackedMsg, &nbch_params_rel13->pdu_index, end) &&
+			 pull16(ppReadPackedMsg, &nbch_params_rel13->transmission_power, end) &&
+			 pull16(ppReadPackedMsg, &nbch_params_rel13->hyper_sfn_2_lsbs, end));
+}
+
+static uint8_t unpack_dl_config_npdcch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_npdcch_pdu_rel13_t* npdcch_params_rel13 = (nfapi_dl_config_npdcch_pdu_rel13_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &npdcch_params_rel13->length, end) &&
+			 pull16(ppReadPackedMsg, &npdcch_params_rel13->pdu_index, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->ncce_index, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->aggregation_level, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->start_symbol, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->rnti_type, end) &&
+			 pull16(ppReadPackedMsg, &npdcch_params_rel13->rnti, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->scrambling_reinitialization_batch_index, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->nrs_antenna_ports_assumed_by_the_ue, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->dci_format, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->scheduling_delay, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->resource_assignment, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->repetition_number, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->mcs, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->new_data_indicator, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->harq_ack_resource, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->npdcch_order_indication, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->starting_number_of_nprach_repetitions, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->subcarrier_indication_of_nprach, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->paging_direct_indication_differentation_flag, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->direct_indication, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->dci_subframe_repetition_number, end) &&
+			 pull8(ppReadPackedMsg, &npdcch_params_rel13->total_dci_length_including_padding, end));
+}
+
+static uint8_t unpack_dl_config_ndlsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_dl_config_ndlsch_pdu_rel13_t* ndlsch_params_rel13 = (nfapi_dl_config_ndlsch_pdu_rel13_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &ndlsch_params_rel13->length, end) &&
+			 pull16(ppReadPackedMsg, &ndlsch_params_rel13->pdu_index, end) &&
+			 pull8(ppReadPackedMsg, &ndlsch_params_rel13->start_symbol, end) &&
+			 pull8(ppReadPackedMsg, &ndlsch_params_rel13->rnti_type, end) &&
+			 pull16(ppReadPackedMsg, &ndlsch_params_rel13->rnti, end) &&
+			 pull16(ppReadPackedMsg, &ndlsch_params_rel13->resource_assignment, end) &&
+			 pull16(ppReadPackedMsg, &ndlsch_params_rel13->repetition_number, end) &&
+			 pull8(ppReadPackedMsg, &ndlsch_params_rel13->modulation, end) &&
+			 pull8(ppReadPackedMsg, &ndlsch_params_rel13->number_of_subframes_for_resource_assignment, end) &&
+			 pull8(ppReadPackedMsg, &ndlsch_params_rel13->scrambling_sequence_initialization_cinit, end) &&
+			 pull16(ppReadPackedMsg, &ndlsch_params_rel13->sf_idx, end) &&
+			 pull8(ppReadPackedMsg, &ndlsch_params_rel13->nrs_antenna_ports_assumed_by_the_ue, end));
+} 
+
+
+static uint8_t unpack_dl_config_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_dl_config_request_body_t* value = (nfapi_dl_config_request_body_t*)tlv;
+
+	if(!(pull8(ppReadPackedMsg, &value->number_pdcch_ofdm_symbols, end) &&
+		 pull8(ppReadPackedMsg, &value->number_dci, end) &&
+		 pull16(ppReadPackedMsg, &value->number_pdu, end) &&
+		 pull8(ppReadPackedMsg, &value->number_pdsch_rnti, end) &&
+		 pull16(ppReadPackedMsg, &value->transmission_power_pcfich, end)))
+		return 0;
+
+	if(value->number_pdu > NFAPI_DL_CONFIG_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of dl config pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_pdu, NFAPI_DL_CONFIG_MAX_PDU);
+		return 0;		
+	}
+
+	if(value->number_pdu)
+	{
+		value->dl_config_pdu_list = (nfapi_dl_config_request_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_dl_config_request_pdu_t) * value->number_pdu, config);
+		if(value->dl_config_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate dl config pdu list (count:%d)\n", __FUNCTION__, value->number_pdu);
+			return 0;
+		}
+	}
+	else
+	{
+		value->dl_config_pdu_list = 0;
+	}
+
+	uint16_t i;
+	uint16_t total_number_of_pdus = value->number_pdu;
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_dl_config_request_pdu_t* pdu = &(value->dl_config_pdu_list[i]);
+		
+		if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) &&
+			 pull8(ppReadPackedMsg, &pdu->pdu_size, end)))
+			return 0;
+					
+		uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2;
+
+		if(packedPduEnd > end)
+		{
+			// pdu end of beyond buffer end
+			return 0;
+		}
+
+		switch(pdu->pdu_type)
+		{
+			case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel8, &unpack_dl_config_dci_dl_pdu_rel8_value},
+						{ NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel9, &unpack_dl_config_dci_dl_pdu_rel9_value},
+						{ NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel10, &unpack_dl_config_dci_dl_pdu_rel10_value},
+						{ NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel11, &unpack_dl_config_dci_dl_pdu_rel11_value},
+						{ NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel12, &unpack_dl_config_dci_dl_pdu_rel12_value},
+						{ NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel13, &unpack_dl_config_dci_dl_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_DL_CONFIG_BCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG, &pdu->bch_pdu.bch_pdu_rel8, &unpack_dl_config_bch_pdu_rel8_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_DL_CONFIG_MCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG, &pdu->mch_pdu.mch_pdu_rel8, &unpack_dl_config_mch_pdu_rel8_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel8, &unpack_dl_config_dlsch_pdu_rel8_value},
+						{ NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel9, &unpack_dl_config_dlsch_pdu_rel9_value},
+						{ NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel10, &unpack_dl_config_dlsch_pdu_rel10_value},
+						{ NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel11, &unpack_dl_config_dlsch_pdu_rel11_value},
+						{ NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel12, &unpack_dl_config_dlsch_pdu_rel12_value},
+						{ NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel13, &unpack_dl_config_dlsch_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_DL_CONFIG_PCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG, &pdu->pch_pdu.pch_pdu_rel8, &unpack_dl_config_pch_pdu_rel8_value},
+						{ NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG, &pdu->pch_pdu.pch_pdu_rel13, &unpack_dl_config_pch_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_DL_CONFIG_PRS_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG, &pdu->prs_pdu.prs_pdu_rel9, &unpack_dl_config_prs_pdu_rel9_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel10, &unpack_dl_config_csi_rs_pdu_rel10_value},
+						{ NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel13, &unpack_dl_config_csi_rs_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel8, &unpack_dl_config_dci_dl_pdu_rel8_value},
+						{ NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel9, &unpack_dl_config_dci_dl_pdu_rel9_value},
+						{ NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel10, &unpack_dl_config_dci_dl_pdu_rel10_value},
+						{ NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel11, &unpack_dl_config_dci_dl_pdu_rel11_value},
+						{ NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel12, &unpack_dl_config_dci_dl_pdu_rel12_value},
+						{ NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel13, &unpack_dl_config_dci_dl_pdu_rel13_value},
+						{ NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG, &pdu->epdcch_pdu.epdcch_params_rel11, &unpack_dl_config_epdcch_params_rel11_value},
+						{ NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG, &pdu->epdcch_pdu.epdcch_params_rel13, &unpack_dl_config_epdcch_params_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG, &pdu->mpdcch_pdu.mpdcch_pdu_rel13, &unpack_dl_config_mpdcch_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_DL_CONFIG_NBCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG, &pdu->nbch_pdu.nbch_pdu_rel13, &unpack_dl_config_nbch_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG, &pdu->npdcch_pdu.npdcch_pdu_rel13, &unpack_dl_config_npdcch_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				
+				}
+				break;
+			case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG, &pdu->ndlsch_pdu.ndlsch_pdu_rel13, &unpack_dl_config_ndlsch_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				
+				}
+				break;
+			default:
+				// Need to log an error
+				break;
+		}
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_dl_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_dl_config_request_t *pNfapiMsg = (nfapi_dl_config_request_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, &unpack_dl_config_request_body_value},
+	};
+
+	return ( pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			 unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_ul_config_ulsch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_pdu_rel8_t* ulsch_pdu_rel8 = (nfapi_ul_config_ulsch_pdu_rel8_t*)tlv;
+	
+	return (pull32(ppReadPackedMsg, &ulsch_pdu_rel8->handle, end) &&
+			pull16(ppReadPackedMsg, &ulsch_pdu_rel8->size, end) &&
+			pull16(ppReadPackedMsg, &ulsch_pdu_rel8->rnti, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->resource_block_start, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->number_of_resource_blocks, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->modulation_type, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->cyclic_shift_2_for_drms, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->frequency_hopping_enabled_flag, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->frequency_hopping_bits, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->new_data_indication, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->redundancy_version, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->harq_process_number, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->ul_tx_mode, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->current_tx_nb, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel8->n_srs, end ));
+}
+static uint8_t unpack_ul_config_ulsch_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_pdu_rel10_t* ulsch_pdu_rel10 = (nfapi_ul_config_ulsch_pdu_rel10_t*)tlv; 
+	
+	return (pull8(ppReadPackedMsg, &ulsch_pdu_rel10->resource_allocation_type, end) &&
+			pull32(ppReadPackedMsg, &ulsch_pdu_rel10->resource_block_coding, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel10->transport_blocks, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel10->transmission_scheme, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel10->number_of_layers, end) &
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel10->codebook_index, end) &&
+			pull8(ppReadPackedMsg, &ulsch_pdu_rel10->disable_sequence_hopping_flag, end));
+}
+static uint8_t unpack_ul_config_ulsch_pdu_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_pdu_rel11_t* ulsch_pdu_rel11 = (nfapi_ul_config_ulsch_pdu_rel11_t*)tlv;
+	
+	return ( pull8(ppReadPackedMsg,	&ulsch_pdu_rel11->virtual_cell_id_enabled_flag, end) &&
+			 pull16(ppReadPackedMsg, &ulsch_pdu_rel11->npusch_identity, end) &&
+			 pull8(ppReadPackedMsg,	&ulsch_pdu_rel11->dmrs_config_flag, end) &&
+			 pull16(ppReadPackedMsg, &ulsch_pdu_rel11->ndmrs_csh_identity, end));
+}
+static uint8_t unpack_ul_config_ulsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_pdu_rel13_t* ulsch_pdu_rel13 = (nfapi_ul_config_ulsch_pdu_rel13_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg,  &ulsch_pdu_rel13->ue_type, end) &&
+			pull16(ppReadPackedMsg, &ulsch_pdu_rel13->total_number_of_repetitions, end) &&
+			pull16(ppReadPackedMsg, &ulsch_pdu_rel13->repetition_number, end) &&
+			pull16(ppReadPackedMsg, &ulsch_pdu_rel13->initial_transmission_sf_io, end) &&
+			pull8(ppReadPackedMsg,  &ulsch_pdu_rel13->empty_symbols_due_to_re_tunning, end));
+}
+static uint8_t unpack_ul_config_cqi_ri_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_ri_information_rel8_t* cqi_ri_info_rel8 = (nfapi_ul_config_cqi_ri_information_rel8_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &cqi_ri_info_rel8->dl_cqi_pmi_size_rank_1, end) &&
+			pull8(ppReadPackedMsg, &cqi_ri_info_rel8->dl_cqi_pmi_size_rank_greater_1, end) &&
+			pull8(ppReadPackedMsg, &cqi_ri_info_rel8->ri_size, end) &&
+			pull8(ppReadPackedMsg, &cqi_ri_info_rel8->delta_offset_cqi, end) &&
+			pull8(ppReadPackedMsg, &cqi_ri_info_rel8->delta_offset_ri, end));
+}
+
+static uint8_t unpack_ul_config_cqi_ri_info_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_ri_information_rel9_t* cqi_ri_info_rel9 = (nfapi_ul_config_cqi_ri_information_rel9_t*)tlv;
+	
+	if(!(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->report_type, end) &&
+		 pull8(ppReadPackedMsg, &cqi_ri_info_rel9->delta_offset_cqi, end) &&
+		 pull8(ppReadPackedMsg, &cqi_ri_info_rel9->delta_offset_ri, end)))
+		return 0;
+
+	switch(cqi_ri_info_rel9->report_type)
+	{
+		case NFAPI_CSI_REPORT_TYPE_PERIODIC:
+			{
+				if(!(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size, end) &&
+					 pull8(ppReadPackedMsg, &cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.control_type, end)))
+					return 0;
+			}
+			break;
+		case NFAPI_CSI_REPORT_TYPE_APERIODIC:
+			{
+				if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc, end) ==0)
+					return 0;
+					
+				uint8_t i;
+				for(i = 0; i < cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc; ++i)
+				{
+					if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].ri_size, end) == 0)
+						return 0;
+
+                                        uint8_t j;
+                                        for(j = 0; j < 8; ++j)
+					{
+						if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].dl_cqi_pmi_size[j], end) == 0)
+							return 0;
+					}
+				}
+			}
+			break;
+		default:
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid report type %d \n", cqi_ri_info_rel9->report_type );
+				return 0;
+			}
+			break;
+	};
+	return 1;
+}
+
+// NOTE : This function is a little unconventional as we uese the side to
+// determine the report type
+static uint8_t unpack_ul_config_cqi_ri_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_ri_information_rel13_t* cqi_ri_info_rel13 = (nfapi_ul_config_cqi_ri_information_rel13_t*)tlv;
+	if(cqi_ri_info_rel13->tl.length == 0)
+	{
+		cqi_ri_info_rel13->report_type = NFAPI_CSI_REPORT_TYPE_APERIODIC;
+	}
+	else
+	{
+		cqi_ri_info_rel13->report_type = NFAPI_CSI_REPORT_TYPE_PERIODIC;
+		if(pull16(ppReadPackedMsg, &cqi_ri_info_rel13->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size_2, end) == 0)
+			return 0;
+	}
+	return 1;
+}
+static uint8_t unpack_ul_config_cqi_init_tx_params_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_initial_transmission_parameters_rel8_t* init_tx_params_rel8 = (nfapi_ul_config_initial_transmission_parameters_rel8_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &init_tx_params_rel8->n_srs_initial, end) &&
+			pull8(ppReadPackedMsg, &init_tx_params_rel8->initial_number_of_resource_blocks, end));
+}
+static uint8_t unpack_ul_config_ulsch_harq_info_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_harq_information_rel10_t* harq_info_rel10 = (nfapi_ul_config_ulsch_harq_information_rel10_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &harq_info_rel10->harq_size, end) &&
+			pull8(ppReadPackedMsg, &harq_info_rel10->delta_offset_harq, end) &&
+			pull8(ppReadPackedMsg, &harq_info_rel10->ack_nack_mode, end));
+}
+
+static uint8_t unpack_ul_config_ulsch_harq_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ulsch_harq_information_rel13_t* harq_info_rel13 = (nfapi_ul_config_ulsch_harq_information_rel13_t*)tlv;
+	
+	return (pull16(ppReadPackedMsg, &harq_info_rel13->harq_size_2, end) &&
+			pull8(ppReadPackedMsg, &harq_info_rel13->delta_offset_harq_2, end));
+}
+
+static uint8_t unpack_ul_config_ue_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ue_information_rel8_t* ue_info_rel8 = (nfapi_ul_config_ue_information_rel8_t*)tlv;
+	
+	return (pull32(ppReadPackedMsg, &ue_info_rel8->handle, end) &&
+			pull16(ppReadPackedMsg, &ue_info_rel8->rnti, end));
+}
+static uint8_t unpack_ul_config_ue_info_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ue_information_rel11_t* ue_info_rel11 = (nfapi_ul_config_ue_information_rel11_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &ue_info_rel11->virtual_cell_id_enabled_flag, end) &&
+			pull16(ppReadPackedMsg, &ue_info_rel11->npusch_identity, end));
+}
+static uint8_t unpack_ul_config_ue_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_ue_information_rel13_t* ue_info_rel13 = (nfapi_ul_config_ue_information_rel13_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &ue_info_rel13->ue_type, end) &&
+			pull8(ppReadPackedMsg, &ue_info_rel13->empty_symbols, end) &&
+			pull16(ppReadPackedMsg, &ue_info_rel13->total_number_of_repetitions, end) &&
+			pull16(ppReadPackedMsg, &ue_info_rel13->repetition_number, end));
+}
+
+static uint8_t unpack_ul_config_cqi_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_information_rel8_t* cqi_info_rel8 = (nfapi_ul_config_cqi_information_rel8_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &cqi_info_rel8->pucch_index, end) &&
+			 pull8(ppReadPackedMsg, &cqi_info_rel8->dl_cqi_pmi_size, end));
+}
+static uint8_t unpack_ul_config_cqi_info_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_information_rel10_t* cqi_info_rel10 = (nfapi_ul_config_cqi_information_rel10_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &cqi_info_rel10->number_of_pucch_resource, end) &&
+			pull16(ppReadPackedMsg, &cqi_info_rel10->pucch_index_p1, end));
+}
+static uint8_t unpack_ul_config_cqi_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_cqi_information_rel13_t* cqi_info_rel13 = (nfapi_ul_config_cqi_information_rel13_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &cqi_info_rel13->csi_mode, end) &&
+			pull16(ppReadPackedMsg, &cqi_info_rel13->dl_cqi_pmi_size_2, end) &&
+			pull8(ppReadPackedMsg, &cqi_info_rel13->starting_prb, end) &&
+			pull8(ppReadPackedMsg, &cqi_info_rel13->n_prb, end) &&
+			pull8(ppReadPackedMsg, &cqi_info_rel13->cdm_index, end) &&
+			pull8(ppReadPackedMsg, &cqi_info_rel13->n_srs, end));
+}
+		
+static uint8_t unpack_ul_config_sr_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_sr_information_rel8_t* sr_info_rel8 = (nfapi_ul_config_sr_information_rel8_t*)tlv;
+	
+	return ( pull16(ppReadPackedMsg, &sr_info_rel8->pucch_index, end));
+}
+
+static uint8_t unpack_ul_config_sr_info_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_sr_information_rel10_t* sr_info_rel10 = (nfapi_ul_config_sr_information_rel10_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &sr_info_rel10->number_of_pucch_resources, end) &&
+			pull16(ppReadPackedMsg, &sr_info_rel10->pucch_index_p1, end));
+}
+
+static uint8_t unpack_ul_config_harq_info_rel10_tdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_harq_information_rel10_tdd_t* harq_info_tdd_rel10 = (nfapi_ul_config_harq_information_rel10_tdd_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &harq_info_tdd_rel10->harq_size, end) &&
+			pull8(ppReadPackedMsg, &harq_info_tdd_rel10->ack_nack_mode, end) &&
+			pull8(ppReadPackedMsg, &harq_info_tdd_rel10->number_of_pucch_resources, end) &&
+			pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_0, end) &&
+			pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_1, end) &&
+			pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_2, end) &&
+			pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_3, end));
+}
+
+static uint8_t unpack_ul_config_harq_info_rel8_fdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_harq_information_rel8_fdd_t* harq_info_fdd_rel8 = (nfapi_ul_config_harq_information_rel8_fdd_t*)tlv;
+	
+	return (pull16(ppReadPackedMsg, &harq_info_fdd_rel8->n_pucch_1_0, end) &&
+			pull8(ppReadPackedMsg, &harq_info_fdd_rel8->harq_size, end));
+}
+
+static uint8_t unpack_ul_config_harq_info_rel9_fdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_harq_information_rel9_fdd_t* harq_info_fdd_rel9 = (nfapi_ul_config_harq_information_rel9_fdd_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &harq_info_fdd_rel9->harq_size, end) &&
+			pull8(ppReadPackedMsg, &harq_info_fdd_rel9->ack_nack_mode, end) &&
+			pull8(ppReadPackedMsg, &harq_info_fdd_rel9->number_of_pucch_resources, end) &&
+			pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_0, end) &&
+			pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_1, end) &&
+			pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_2, end) &&
+			pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_3, end));
+}
+
+static uint8_t unpack_ul_config_harq_info_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_harq_information_rel11_t* harq_info_rel11 = (nfapi_ul_config_harq_information_rel11_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &harq_info_rel11->num_ant_ports, end) &&
+			pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_0, end) &&
+			pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_1, end) &&
+			pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_2, end) &&
+			pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_3, end));
+}
+
+static uint8_t unpack_ul_config_harq_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_harq_information_rel13_t* harq_info_rel13 = (nfapi_ul_config_harq_information_rel13_t*)tlv;
+	
+	return (pull16(ppReadPackedMsg, &harq_info_rel13->harq_size_2, end) &&
+			pull8(ppReadPackedMsg, &harq_info_rel13->starting_prb, end) &&
+			pull8(ppReadPackedMsg, &harq_info_rel13->n_prb, end) &&
+			pull8(ppReadPackedMsg, &harq_info_rel13->cdm_index, end) &&
+			pull8(ppReadPackedMsg, &harq_info_rel13->n_srs, end));
+}
+
+
+static uint8_t unpack_ul_config_srs_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_srs_pdu_rel8_t* srs_pdu_rel8 = (nfapi_ul_config_srs_pdu_rel8_t*)tlv;
+	
+	return (pull32(ppReadPackedMsg, &srs_pdu_rel8->handle, end) &&
+			pull16(ppReadPackedMsg, &srs_pdu_rel8->size, end) &&
+			pull16(ppReadPackedMsg, &srs_pdu_rel8->rnti, end) &&
+			pull8(ppReadPackedMsg, &srs_pdu_rel8->srs_bandwidth, end) &&
+			pull8(ppReadPackedMsg, &srs_pdu_rel8->frequency_domain_position, end) &&
+			pull8(ppReadPackedMsg, &srs_pdu_rel8->srs_hopping_bandwidth, end) &&
+			pull8(ppReadPackedMsg, &srs_pdu_rel8->transmission_comb, end) &&
+			pull16(ppReadPackedMsg, &srs_pdu_rel8->i_srs, end) &&
+			pull8(ppReadPackedMsg, &srs_pdu_rel8->sounding_reference_cyclic_shift, end));
+}
+
+static uint8_t unpack_ul_config_srs_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_srs_pdu_rel10_t* srs_pdu_rel10 = (nfapi_ul_config_srs_pdu_rel10_t*)tlv;
+	return pull8(ppReadPackedMsg, &srs_pdu_rel10->antenna_port, end);
+}
+
+static uint8_t unpack_ul_config_srs_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_srs_pdu_rel13_t* srs_pdu_rel13 = (nfapi_ul_config_srs_pdu_rel13_t*)tlv;
+
+	return (pull8(ppReadPackedMsg, &srs_pdu_rel13->number_of_combs, end));
+}
+
+static uint8_t unpack_ul_nb_harq_info_rel13_fdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_nb_harq_information_rel13_fdd_t* nb_harq_info_fdd_rel13 = (nfapi_ul_config_nb_harq_information_rel13_fdd_t*)tlv;
+
+	return (pull8(ppReadPackedMsg, &nb_harq_info_fdd_rel13->harq_ack_resource, end));
+}
+
+static uint8_t unpack_ul_config_nulsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_nulsch_pdu_rel13_t* nulsch_pdu_rel13 = (nfapi_ul_config_nulsch_pdu_rel13_t*)tlv;
+
+	if(!(pull8(ppReadPackedMsg, &nulsch_pdu_rel13->nulsch_format, end) && 
+		 pull32(ppReadPackedMsg, &nulsch_pdu_rel13->handle, end) && 
+		 pull16(ppReadPackedMsg, &nulsch_pdu_rel13->size, end) && 
+		 pull16(ppReadPackedMsg, &nulsch_pdu_rel13->rnti, end) && 
+		 pull8(ppReadPackedMsg, &nulsch_pdu_rel13->subcarrier_indication, end) && 
+		 pull8(ppReadPackedMsg, &nulsch_pdu_rel13->resource_assignment, end) && 
+		 pull8(ppReadPackedMsg, &nulsch_pdu_rel13->mcs, end) && 
+		 pull8(ppReadPackedMsg, &nulsch_pdu_rel13->redudancy_version, end) && 
+		 pull8(ppReadPackedMsg, &nulsch_pdu_rel13->repetition_number, end) && 
+		 pull8(ppReadPackedMsg, &nulsch_pdu_rel13->new_data_indication, end) && 
+		 pull8(ppReadPackedMsg, &nulsch_pdu_rel13->n_srs, end) && 
+		 pull16(ppReadPackedMsg, &nulsch_pdu_rel13->scrambling_sequence_initialization_cinit, end) && 
+		 pull16(ppReadPackedMsg, &nulsch_pdu_rel13->sf_idx, end)))
+		return 0;
+		
+	unpack_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG, &nulsch_pdu_rel13->ue_information.ue_information_rel8, &unpack_ul_config_ue_info_rel8_value},
+		{ NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG, &nulsch_pdu_rel13->ue_information.ue_information_rel11, &unpack_ul_config_ue_info_rel11_value},
+		{ NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG, &nulsch_pdu_rel13->ue_information.ue_information_rel13, &unpack_ul_config_ue_info_rel13_value},
+		{ NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG, &nulsch_pdu_rel13->nb_harq_information.nb_harq_information_rel13_fdd, &unpack_ul_nb_harq_info_rel13_fdd_value},
+	};
+
+	return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, 0, 0);		
+}
+
+static uint8_t unpack_ul_config_nrach_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_config_nrach_pdu_rel13_t* nrach_pdu_rel13 = (nfapi_ul_config_nrach_pdu_rel13_t*)tlv;
+
+	return (pull8(ppReadPackedMsg, &nrach_pdu_rel13->nprach_config_0, end) &&
+			pull8(ppReadPackedMsg, &nrach_pdu_rel13->nprach_config_1, end) &&
+			pull8(ppReadPackedMsg, &nrach_pdu_rel13->nprach_config_2, end));
+}
+
+
+static uint8_t unpack_ul_config_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	#define UL_CONFIG_ULSCH_PDU_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG, &_pdu.ulsch_pdu_rel8, &unpack_ul_config_ulsch_pdu_rel8_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG, &_pdu.ulsch_pdu_rel10, &unpack_ul_config_ulsch_pdu_rel10_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG, &_pdu.ulsch_pdu_rel11, &unpack_ul_config_ulsch_pdu_rel11_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG, &_pdu.ulsch_pdu_rel13, &unpack_ul_config_ulsch_pdu_rel13_value}, 
+
+	#define UL_CONFIG_CQI_RI_INFO_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG, &_pdu.cqi_ri_information_rel8, &unpack_ul_config_cqi_ri_info_rel8_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG, &_pdu.cqi_ri_information_rel9, &unpack_ul_config_cqi_ri_info_rel9_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG, &_pdu.cqi_ri_information_rel13, &unpack_ul_config_cqi_ri_info_rel13_value},
+
+	#define UL_CONFIG_ULSCH_HARQ_INFO_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG, &_pdu.harq_information_rel10, &unpack_ul_config_ulsch_harq_info_rel10_value},\
+		{ NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG, &_pdu.harq_information_rel13, &unpack_ul_config_ulsch_harq_info_rel13_value},
+
+	#define UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG, &_pdu.initial_transmission_parameters_rel8, &unpack_ul_config_cqi_init_tx_params_rel8_value},
+
+	#define UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG, &_pdu.ue_information_rel8, &unpack_ul_config_ue_info_rel8_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG, &_pdu.ue_information_rel11, &unpack_ul_config_ue_info_rel11_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG, &_pdu.ue_information_rel13, &unpack_ul_config_ue_info_rel13_value},
+
+	#define UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG, &_pdu.cqi_information_rel8, &unpack_ul_config_cqi_info_rel8_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG, &_pdu.cqi_information_rel10, &unpack_ul_config_cqi_info_rel10_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG, &_pdu.cqi_information_rel13, &unpack_ul_config_cqi_info_rel13_value},
+						
+	#define UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG, &_pdu.sr_information_rel8, &unpack_ul_config_sr_info_rel8_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG, &_pdu.sr_information_rel10, &unpack_ul_config_sr_info_rel10_value},
+
+	#define UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG, &_pdu.harq_information_rel10_tdd, &unpack_ul_config_harq_info_rel10_tdd_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG, &_pdu.harq_information_rel8_fdd, &unpack_ul_config_harq_info_rel8_fdd_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG, &_pdu.harq_information_rel9_fdd, &unpack_ul_config_harq_info_rel9_fdd_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG, &_pdu.harq_information_rel11, &unpack_ul_config_harq_info_rel11_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG, &_pdu.harq_information_rel13, &unpack_ul_config_harq_info_rel13_value},
+
+	#define UL_CONFIG_SRS_PDU_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG, &_pdu.srs_pdu_rel8, &unpack_ul_config_srs_pdu_rel8_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG, &_pdu.srs_pdu_rel10, &unpack_ul_config_srs_pdu_rel10_value}, \
+		{ NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG, &_pdu.srs_pdu_rel13, &unpack_ul_config_srs_pdu_rel13_value},
+		
+	#define UL_CONFIG_NULSCH_PDU_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG, &_pdu.nulsch_pdu_rel13, &unpack_ul_config_nulsch_pdu_rel13_value},		
+
+	#define UL_CONFIG_NRACH_PDU_UNPACK_FNS(_pdu) \
+		{ NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG, &_pdu.nrach_pdu_rel13, &unpack_ul_config_nrach_pdu_rel13_value},		
+
+
+	nfapi_ul_config_request_body_t* value = (nfapi_ul_config_request_body_t*)tlv;
+
+	if(!(pull8(ppReadPackedMsg, &value->number_of_pdus, end) &&
+		 pull8(ppReadPackedMsg, &value->rach_prach_frequency_resources, end) &&
+		 pull8(ppReadPackedMsg, &value->srs_present, end)))
+		return 0;
+
+	if(value->number_of_pdus > NFAPI_UL_CONFIG_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of ul config pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_UL_CONFIG_MAX_PDU);
+		return 0;		
+	}
+
+	if(value->number_of_pdus > 0)
+	{
+		value->ul_config_pdu_list = (nfapi_ul_config_request_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_ul_config_request_pdu_t) * value->number_of_pdus, config);
+
+		if(value->ul_config_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate ul config pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus);
+			return 0;
+		}
+	}
+	else
+	{
+		value->ul_config_pdu_list = 0;
+	}
+
+
+	uint16_t i;
+	uint16_t total_number_of_pdus = value->number_of_pdus;
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_ul_config_request_pdu_t* pdu = &(value->ul_config_pdu_list[i]);
+		
+		if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) &&
+			 pull8(ppReadPackedMsg, &pdu->pdu_size, end)))
+			return 0;
+					
+		uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2;
+
+		if(packedPduEnd > end)
+		{
+			// pdu end is past buffer end
+			return 0;
+		}
+
+		switch(pdu->pdu_type)
+		{
+			case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_pdu)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+
+			case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_cqi_ri_pdu.ulsch_pdu)
+						UL_CONFIG_CQI_RI_INFO_UNPACK_FNS(pdu->ulsch_cqi_ri_pdu.cqi_ri_information)
+						UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(pdu->ulsch_cqi_ri_pdu.initial_transmission_parameters)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_harq_pdu.ulsch_pdu)
+						UL_CONFIG_ULSCH_HARQ_INFO_UNPACK_FNS(pdu->ulsch_harq_pdu.harq_information)
+						UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(pdu->ulsch_harq_pdu.initial_transmission_parameters)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu)
+						UL_CONFIG_CQI_RI_INFO_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information)
+						UL_CONFIG_ULSCH_HARQ_INFO_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.harq_information)
+						UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_pdu.ue_information)
+						UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_pdu.cqi_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_sr_pdu.ue_information)
+						UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_sr_pdu.sr_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_harq_pdu.ue_information)
+						UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_harq_pdu.harq_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_sr_harq_pdu.ue_information)
+						UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_sr_harq_pdu.sr_information)
+						UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_sr_harq_pdu.harq_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_harq_pdu.ue_information)
+						UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_harq_pdu.cqi_information)
+						UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_cqi_harq_pdu.harq_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_sr_pdu.ue_information)
+						UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_sr_pdu.cqi_information)
+						UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_cqi_sr_pdu.sr_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.ue_information)
+						UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.cqi_information)
+						UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.sr_information)
+						UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.harq_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_SRS_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_SRS_PDU_UNPACK_FNS(pdu->srs_pdu)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->harq_buffer_pdu.ue_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_uci_csi_pdu.ulsch_pdu)
+						UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->ulsch_uci_csi_pdu.csi_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_uci_harq_pdu.ulsch_pdu)
+						UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->ulsch_uci_harq_pdu.harq_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_csi_uci_harq_pdu.ulsch_pdu)
+						UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->ulsch_csi_uci_harq_pdu.csi_information)
+						UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->ulsch_csi_uci_harq_pdu.harq_information)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_NULSCH_PDU_UNPACK_FNS(pdu->nulsch_pdu)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;	
+			case NFAPI_UL_CONFIG_NRACH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						UL_CONFIG_NRACH_PDU_UNPACK_FNS(pdu->nrach_pdu)
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;						
+		}
+	}
+	return 1;
+}
+
+
+static uint8_t unpack_ul_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_ul_config_request_t *pNfapiMsg = (nfapi_ul_config_request_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_UL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->ul_config_request_body, &unpack_ul_config_request_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_hi_dci0_hi_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_hi_pdu_rel8_t* hi_pdu_rel8 = (nfapi_hi_dci0_hi_pdu_rel8_t*)tlv;
+	
+	return( pull8(ppReadPackedMsg, &hi_pdu_rel8->resource_block_start, end) &&
+			pull8(ppReadPackedMsg, &hi_pdu_rel8->cyclic_shift_2_for_drms, end) &&
+			pull8(ppReadPackedMsg, &hi_pdu_rel8->hi_value, end) &&
+			pull8(ppReadPackedMsg, &hi_pdu_rel8->i_phich, end) &&
+			pull16(ppReadPackedMsg, &hi_pdu_rel8->transmission_power, end));
+}
+
+static uint8_t unpack_hi_dci0_hi_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_hi_pdu_rel10_t* hi_pdu_rel10 = (nfapi_hi_dci0_hi_pdu_rel10_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &hi_pdu_rel10->flag_tb2, end) &&
+			pull8(ppReadPackedMsg, &hi_pdu_rel10->hi_value_2, end));
+}
+
+static uint8_t unpack_hi_dci0_dci_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_dci_pdu_rel8_t* dci_pdu_rel8 = (nfapi_hi_dci0_dci_pdu_rel8_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &dci_pdu_rel8->dci_format, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->cce_index, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->aggregation_level, end) &&
+			pull16(ppReadPackedMsg, &dci_pdu_rel8->rnti, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->resource_block_start, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->number_of_resource_block, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->mcs_1, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->cyclic_shift_2_for_drms, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->frequency_hopping_enabled_flag, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->frequency_hopping_bits, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->new_data_indication_1, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->ue_tx_antenna_seleciton, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->tpc, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->cqi_csi_request, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->ul_index, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel8->dl_assignment_index, end) &&
+			pull32(ppReadPackedMsg, &dci_pdu_rel8->tpc_bitmap, end) &&
+			pull16(ppReadPackedMsg, &dci_pdu_rel8->transmission_power, end));
+}
+
+static uint8_t unpack_hi_dci0_dci_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_dci_pdu_rel10_t* dci_pdu_rel10 = (nfapi_hi_dci0_dci_pdu_rel10_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &dci_pdu_rel10->cross_carrier_scheduling_flag, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->carrier_indicator, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->size_of_cqi_csi_feild, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->srs_flag, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->srs_request, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->resource_allocation_flag, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->resource_allocation_type, end) &&
+			pull32(ppReadPackedMsg, &dci_pdu_rel10->resource_block_coding, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->mcs_2, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->new_data_indication_2, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->number_of_antenna_ports, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->tpmi, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->total_dci_length_including_padding, end) &&
+			pull8(ppReadPackedMsg, &dci_pdu_rel10->n_ul_rb, end));
+}
+
+static uint8_t unpack_hi_dci0_dci_pdu_rel12_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_dci_pdu_rel12_t* dci_pdu_rel12 = (nfapi_hi_dci0_dci_pdu_rel12_t*)tlv;
+	
+	return ( pull8(ppReadPackedMsg, &dci_pdu_rel12->pscch_resource, end) &&
+			 pull8(ppReadPackedMsg, &dci_pdu_rel12->time_resource_pattern, end));
+}
+
+static uint8_t unpack_hi_dci0_mpdcch_dci_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t* value = (nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &value->mpdcch_narrowband, end) &&
+			pull8(ppReadPackedMsg, &value->number_of_prb_pairs, end) &&
+			pull8(ppReadPackedMsg, &value->resource_block_assignment, end) &&
+			pull8(ppReadPackedMsg, &value->mpdcch_transmission_type, end) &&
+			pull8(ppReadPackedMsg, &value->start_symbol, end) &&
+			pull8(ppReadPackedMsg, &value->ecce_index, end) &&
+			pull8(ppReadPackedMsg, &value->aggreagation_level, end) &&
+			pull8(ppReadPackedMsg, &value->rnti_type, end) &&
+			pull16(ppReadPackedMsg, &value->rnti, end) &&
+			pull8(ppReadPackedMsg, &value->ce_mode, end) &&
+			pull16(ppReadPackedMsg, &value->drms_scrambling_init, end) &&
+			pull16(ppReadPackedMsg, &value->initial_transmission_sf_io, end) &&
+			pull16(ppReadPackedMsg, &value->transmission_power, end) &&
+			pull8(ppReadPackedMsg, &value->dci_format, end) &&
+			pull8(ppReadPackedMsg, &value->resource_block_start, end) &&
+			pull8(ppReadPackedMsg, &value->number_of_resource_blocks, end) &&
+			pull8(ppReadPackedMsg, &value->mcs, end) &&
+			pull8(ppReadPackedMsg, &value->pusch_repetition_levels, end) &&
+			pull8(ppReadPackedMsg, &value->frequency_hopping_flag, end) &&
+			pull8(ppReadPackedMsg, &value->new_data_indication, end) &&
+			pull8(ppReadPackedMsg, &value->harq_process, end) &&
+			pull8(ppReadPackedMsg, &value->redudency_version, end) &&
+			pull8(ppReadPackedMsg, &value->tpc, end) &&
+			pull8(ppReadPackedMsg, &value->csi_request, end) &&
+			pull8(ppReadPackedMsg, &value->ul_inex, end) &&
+			pull8(ppReadPackedMsg, &value->dai_presence_flag, end) &&
+			pull8(ppReadPackedMsg, &value->dl_assignment_index, end) &&
+			pull8(ppReadPackedMsg, &value->srs_request, end) &&
+			pull8(ppReadPackedMsg, &value->dci_subframe_repetition_number, end) &&
+			pull32(ppReadPackedMsg, &value->tcp_bitmap, end) &&
+			pull8(ppReadPackedMsg, &value->total_dci_length_include_padding, end) &&
+			pull8(ppReadPackedMsg, &value->number_of_tx_antenna_ports, end) &&
+			pullarray16(ppReadPackedMsg, value->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, value->number_of_tx_antenna_ports, end));
+}
+
+static uint8_t unpack_hi_dci0_npdcch_dci_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_hi_dci0_npdcch_dci_pdu_rel13_t* value = (nfapi_hi_dci0_npdcch_dci_pdu_rel13_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &value->ncce_index, end) &&
+			pull8(ppReadPackedMsg, &value->aggregation_level, end) &&
+			pull8(ppReadPackedMsg, &value->start_symbol, end) &&
+			pull16(ppReadPackedMsg, &value->rnti, end) &&
+			pull8(ppReadPackedMsg, &value->scrambling_reinitialization_batch_index, end) &&
+			pull8(ppReadPackedMsg, &value->nrs_antenna_ports_assumed_by_the_ue, end) &&
+			pull8(ppReadPackedMsg, &value->subcarrier_indication, end) &&
+			pull8(ppReadPackedMsg, &value->resource_assignment, end) &&
+			pull8(ppReadPackedMsg, &value->scheduling_delay, end) &&
+			pull8(ppReadPackedMsg, &value->mcs, end) &&
+			pull8(ppReadPackedMsg, &value->redudancy_version, end) &&
+			pull8(ppReadPackedMsg, &value->repetition_number, end) &&
+			pull8(ppReadPackedMsg, &value->new_data_indicator, end) &&
+			pull8(ppReadPackedMsg, &value->dci_subframe_repetition_number, end));
+}
+
+static uint8_t unpack_hi_dci0_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_hi_dci0_request_body_t* value = (nfapi_hi_dci0_request_body_t*)tlv;
+
+	if(!(pull16(ppReadPackedMsg, &value->sfnsf, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_dci, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_hi, end)))
+		return 0;
+
+	uint8_t totalNumPdus = value->number_of_hi + value->number_of_dci;
+
+	if(totalNumPdus > NFAPI_HI_DCI0_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of dci0 pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, totalNumPdus, NFAPI_HI_DCI0_MAX_PDU);
+		return 0;		
+	}
+
+	if(totalNumPdus > 0)
+	{
+		value->hi_dci0_pdu_list = (nfapi_hi_dci0_request_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_hi_dci0_request_pdu_t) * totalNumPdus, config);
+		if(value->hi_dci0_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate hi dci0 pdu list (count:%d)\n", __FUNCTION__, totalNumPdus);
+			return 0;
+		}
+	}
+	else
+	{
+		value->hi_dci0_pdu_list = 0;
+	}
+
+	uint8_t i;
+	for(i = 0; i < totalNumPdus; ++i)
+	{
+		nfapi_hi_dci0_request_pdu_t* pdu = &(value->hi_dci0_pdu_list[i]);
+
+		if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) &&
+			 pull8(ppReadPackedMsg, &pdu->pdu_size, end)))
+			return 0;
+
+		uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2;
+
+		if(packedPduEnd > end)
+		{
+			// pdu end if past buffer end
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pdu size to big %d %d\n", __FUNCTION__, packedPduEnd, end);
+			return 0;
+		}
+
+		switch(pdu->pdu_type)
+		{
+			case NFAPI_HI_DCI0_HI_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG, &pdu->hi_pdu.hi_pdu_rel8, &unpack_hi_dci0_hi_pdu_rel8_value},
+						{ NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG, &pdu->hi_pdu.hi_pdu_rel10, &unpack_hi_dci0_hi_pdu_rel10_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_HI_DCI0_DCI_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG, &pdu->dci_pdu.dci_pdu_rel8, &unpack_hi_dci0_dci_pdu_rel8_value},
+						{ NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG, &pdu->dci_pdu.dci_pdu_rel10, &unpack_hi_dci0_dci_pdu_rel10_value},
+						{ NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG, &pdu->dci_pdu.dci_pdu_rel12, &unpack_hi_dci0_dci_pdu_rel12_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel8, &unpack_hi_dci0_dci_pdu_rel8_value},
+						{ NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel10, &unpack_hi_dci0_dci_pdu_rel10_value},
+						{ NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG, &pdu->epdcch_dci_pdu.epdcch_parameters_rel11, &unpack_dl_config_epdcch_params_rel11_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG, &pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13, &unpack_hi_dci0_mpdcch_dci_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG, &pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13, &unpack_hi_dci0_npdcch_dci_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			default:
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type );
+				}
+				break;
+		};
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_hi_dci0_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_hi_dci0_request_t *pNfapiMsg = (nfapi_hi_dci0_request_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_HI_DCI0_REQUEST_BODY_TAG, &pNfapiMsg->hi_dci0_request_body, &unpack_hi_dci0_request_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+
+}
+
+static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	uint8_t proceed = 1;
+	nfapi_tx_request_t *pNfapiMsg = (nfapi_tx_request_t*)msg;
+
+	if(pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) == 0)
+		return 0;
+
+	while (((uint8_t*)(*ppReadPackedMsg) < end) && proceed)
+	{
+		nfapi_tl_t generic_tl;
+		if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
+			return 0;
+
+		switch(generic_tl.tag)
+		{
+			case NFAPI_TX_REQUEST_BODY_TAG:
+			{
+				pNfapiMsg->tx_request_body.tl = generic_tl;
+
+				if( pull16(ppReadPackedMsg, &pNfapiMsg->tx_request_body.number_of_pdus, end) == 0)
+					return 0;
+
+				if(pNfapiMsg->tx_request_body.number_of_pdus > NFAPI_TX_MAX_PDU)
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of tx pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, pNfapiMsg->tx_request_body.number_of_pdus, NFAPI_TX_MAX_PDU);
+					return 0;		
+				}
+
+				if(pNfapiMsg->tx_request_body.number_of_pdus > 0)
+				{
+					pNfapiMsg->tx_request_body.tx_pdu_list = (nfapi_tx_request_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_tx_request_pdu_t) * pNfapiMsg->tx_request_body.number_of_pdus, config);
+					if(pNfapiMsg->tx_request_body.tx_pdu_list == NULL)
+					{
+						NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate tx  pdu list (count:%d)\n", __FUNCTION__, pNfapiMsg->tx_request_body.number_of_pdus);
+						return 0;
+					}
+				}
+				else
+				{
+					pNfapiMsg->tx_request_body.tx_pdu_list = 0;
+				}
+
+
+				uint16_t i;
+				uint16_t totalNumPdus = pNfapiMsg->tx_request_body.number_of_pdus;
+				for(i = 0; i < totalNumPdus; ++i)
+				{
+					nfapi_tx_request_pdu_t* pdu = &(pNfapiMsg->tx_request_body.tx_pdu_list[i]);
+					
+					uint16_t length = 0;
+					uint16_t index = 0;
+					
+					if(!(pull16(ppReadPackedMsg, &length, end) &&
+						 pull16(ppReadPackedMsg, &index, end)))
+						return 0;
+
+					pdu->pdu_length = length;
+					pdu->pdu_index = index;
+					
+
+					// TODO : May need to rethink this bit
+					pdu->num_segments = 1;
+					pdu->segments[0].segment_length = pdu->pdu_length;
+					pdu->segments[0].segment_data = nfapi_p7_allocate(pdu->pdu_length, config);
+
+					if(pdu->segments[0].segment_data)
+					{
+						if(!pullarray8(ppReadPackedMsg, pdu->segments[0].segment_data, pdu->segments[0].segment_length, pdu->segments[0].segment_length, end))
+							return 0;
+                                                if (0 && pdu->segments[0].segment_length == 3)
+                                                {
+                                                  NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, 
+                                                      pdu->segments[0].segment_data[0], 
+                                                      pdu->segments[0].segment_data[1], 
+                                                      pdu->segments[0].segment_data[2]
+                                                      );
+                                                }
+					}
+					else
+					{
+						NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_tx_request: Failed to allocate pdu (len:%d) %d/%d %d\n", pdu->pdu_length, totalNumPdus, i, pdu->pdu_index);
+					}
+				}
+			}
+			break;
+			default:
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_tx_request FIXME : Invalid pdu type %d \n", generic_tl.tag );
+			}
+			break;
+		};
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_harq_indication_tdd_harq_data_bundling(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_tdd_harq_data_bundling_t* value = (nfapi_harq_indication_tdd_harq_data_bundling_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &value->value_0, end) &&
+			pull8(ppReadPackedMsg, &value->value_1, end));
+}
+
+static uint8_t unpack_harq_indication_tdd_harq_data_multiplexing(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_tdd_harq_data_multiplexing_t* value = (nfapi_harq_indication_tdd_harq_data_multiplexing_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &value->value_0, end) &&
+			pull8(ppReadPackedMsg, &value->value_1, end) &&
+			pull8(ppReadPackedMsg, &value->value_2, end) &&
+			pull8(ppReadPackedMsg, &value->value_3, end));
+}
+static uint8_t unpack_harq_indication_tdd_harq_data_special_bundling(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_tdd_harq_data_special_bundling_t* value = (nfapi_harq_indication_tdd_harq_data_special_bundling_t*)tlv;
+	return ( pull8(ppReadPackedMsg, &value->value_0, end));
+}
+static uint8_t unpack_harq_indication_tdd_harq_data(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_tdd_harq_data_t* value = (nfapi_harq_indication_tdd_harq_data_t*)tlv;
+	return  (pull8(ppReadPackedMsg, &value->value_0, end));
+}
+
+static uint8_t unpack_harq_indication_tdd_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_tdd_rel8_t* value = (nfapi_harq_indication_tdd_rel8_t*)tlv;
+	
+	if(!(pull8(ppReadPackedMsg, &value->mode, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_ack_nack, end)))
+		return 0;
+
+	uint8_t result = 0;
+	switch(value->mode)
+	{
+		case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING:
+			result = unpack_harq_indication_tdd_harq_data_bundling(&value->harq_data.bundling, ppReadPackedMsg, end);
+			break;
+		case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING:
+			result = unpack_harq_indication_tdd_harq_data_multiplexing(&value->harq_data.multiplex, ppReadPackedMsg, end);
+			break;
+		case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING:
+			result = unpack_harq_indication_tdd_harq_data_special_bundling(&value->harq_data.special_bundling, ppReadPackedMsg, end);
+			break;
+		case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3:
+		case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION:
+			result = 1;
+			break;
+		default:
+			// TODO add error message
+			return 0;
+			break;
+	}
+	return result;
+}
+
+static uint8_t unpack_harq_indication_tdd_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_tdd_rel9_t* value = (nfapi_harq_indication_tdd_rel9_t*)tlv;
+	
+	if(!(pull8(ppReadPackedMsg, &value->mode, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_ack_nack, end)))
+		return 0;
+
+	if(value->number_of_ack_nack > NFAPI_MAX_NUMBER_ACK_NACK_TDD)
+	{
+		// TODO : add error message
+		return 0;
+	}
+
+	uint16_t idx = 0;
+	for(idx = 0; idx < value->number_of_ack_nack; ++idx)
+	{
+		uint8_t result = 0;
+		switch(value->mode)
+		{
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING:
+				result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].bundling, ppReadPackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING:
+				result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].multiplex, ppReadPackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING:
+				result = unpack_harq_indication_tdd_harq_data_special_bundling(&value->harq_data[idx].special_bundling, ppReadPackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION:
+				result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].channel_selection, ppReadPackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3:
+				result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_3, ppReadPackedMsg, end);
+				break;
+			default:
+				// TODO add error message
+				return 0;
+				break;
+		}
+
+		if(result == 0)
+			return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_harq_indication_tdd_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_tdd_rel13_t* value = (nfapi_harq_indication_tdd_rel13_t*)tlv;
+	
+	if(!(pull8(ppReadPackedMsg, &value->mode, end) &&
+		 pull16(ppReadPackedMsg, &value->number_of_ack_nack, end)))
+		return 0;
+
+	if(value->number_of_ack_nack > NFAPI_MAX_NUMBER_ACK_NACK_TDD)
+	{
+		// TODO : add error message
+		return 0;
+	}
+
+	uint16_t idx = 0;
+	for(idx = 0; idx < value->number_of_ack_nack; ++idx)
+	{
+		uint8_t result = 0;
+		switch(value->mode)
+		{
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING:
+				result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].bundling, ppReadPackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING:
+				result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].multiplex, ppReadPackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING:
+				result = unpack_harq_indication_tdd_harq_data_special_bundling(&value->harq_data[idx].special_bundling, ppReadPackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION:
+				result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].channel_selection, ppReadPackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3:
+				result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_3, ppReadPackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4:
+				result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_4, ppReadPackedMsg, end);
+				break;
+			case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5:
+				result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_5, ppReadPackedMsg, end);
+				break;
+			default:
+				// TODO add error message
+				return 0;
+				break;
+		}
+
+		if(result == 0)
+			return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_harq_indication_fdd_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_fdd_rel8_t* value = (nfapi_harq_indication_fdd_rel8_t*)tlv;
+	return (pull8(ppReadPackedMsg, &value->harq_tb1, end) &&
+			pull8(ppReadPackedMsg, &value->harq_tb2, end));
+}
+
+static uint8_t unpack_harq_indication_fdd_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_fdd_rel9_t* value = (nfapi_harq_indication_fdd_rel9_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &value->mode, end) &&
+			pull8(ppReadPackedMsg, &value->number_of_ack_nack, end) &&
+			pullarray8(ppReadPackedMsg, value->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL9_MAX, value->number_of_ack_nack, end));
+}
+
+static uint8_t unpack_harq_indication_fdd_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_harq_indication_fdd_rel13_t* value = (nfapi_harq_indication_fdd_rel13_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &value->mode, end) &&
+			pull16(ppReadPackedMsg, &value->number_of_ack_nack, end) &&
+			pullarray8(ppReadPackedMsg, value->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL13_MAX, value->number_of_ack_nack, end));
+}
+
+static uint8_t unpack_ul_cqi_information_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_ul_cqi_information_t* value = (nfapi_ul_cqi_information_t*)tlv;
+	
+	return (pull8(ppReadPackedMsg, &value->ul_cqi, end) &&
+			pull8(ppReadPackedMsg, &value->channel, end));
+}
+
+
+
+static uint8_t unpack_harq_indication_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_harq_indication_body_t* value = (nfapi_harq_indication_body_t*)tlv;
+	uint8_t* harqBodyEnd = *ppReadPackedMsg + value->tl.length;
+
+	if(harqBodyEnd > end)
+		return 0;
+
+	if(pull16(ppReadPackedMsg, &value->number_of_harqs, end) == 0)
+		return 0;
+
+	if(value->number_of_harqs > NFAPI_HARQ_IND_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of harq ind pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_harqs, NFAPI_HARQ_IND_MAX_PDU);
+		return 0;		
+	}
+
+	value->harq_pdu_list = (nfapi_harq_indication_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_harq_indication_pdu_t) * value->number_of_harqs, config);
+	if(value->harq_pdu_list == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate harq ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_harqs);
+		return 0;
+	}
+	
+	uint8_t i = 0;
+	for(i = 0; i < value->number_of_harqs; ++i)
+	{
+		nfapi_harq_indication_pdu_t* pdu = &(value->harq_pdu_list[i]);
+		if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0)
+			return 0;
+
+		uint8_t* harqPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length;
+
+		unpack_tlv_t unpack_fns[] =
+		{
+			{ NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value },
+			{ NFAPI_HARQ_INDICATION_TDD_REL8_TAG, &pdu->harq_indication_tdd_rel8, &unpack_harq_indication_tdd_rel8_value},
+			{ NFAPI_HARQ_INDICATION_TDD_REL9_TAG, &pdu->harq_indication_tdd_rel9, &unpack_harq_indication_tdd_rel9_value},
+			{ NFAPI_HARQ_INDICATION_TDD_REL13_TAG, &pdu->harq_indication_tdd_rel13, &unpack_harq_indication_tdd_rel13_value},
+			{ NFAPI_HARQ_INDICATION_FDD_REL8_TAG, &pdu->harq_indication_fdd_rel8, &unpack_harq_indication_fdd_rel8_value},
+			{ NFAPI_HARQ_INDICATION_FDD_REL9_TAG, &pdu->harq_indication_fdd_rel9, &unpack_harq_indication_fdd_rel9_value},
+			{ NFAPI_HARQ_INDICATION_FDD_REL13_TAG, &pdu->harq_indication_fdd_rel13, &unpack_harq_indication_fdd_rel13_value},
+			{ NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, &unpack_ul_cqi_information_value}
+		};
+
+		if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, harqPduInstanceEnd, 0, 0) == 0)
+			return 0;
+	
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_harq_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_harq_indication_t *pNfapiMsg = (nfapi_harq_indication_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->harq_indication_body, &unpack_harq_indication_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_crc_indication_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_crc_indication_rel8_t* crc_pdu_rel8 = (nfapi_crc_indication_rel8_t*)tlv;
+	return ( pull8(ppReadPackedMsg, &crc_pdu_rel8->crc_flag, end) );
+}
+
+static uint8_t unpack_crc_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end,  nfapi_p7_codec_config_t* config)
+{
+	nfapi_crc_indication_body_t* value = (nfapi_crc_indication_body_t*)tlv;
+	uint8_t* crcBodyEnd = *ppReadPackedMsg + value->tl.length;
+
+	if(crcBodyEnd > end)
+		return 0;
+
+	if(pull16(ppReadPackedMsg, &value->number_of_crcs, end) == 0)
+		return 0;
+
+	if(value->number_of_crcs > NFAPI_CRC_IND_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of crc ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_crcs, NFAPI_CRC_IND_MAX_PDU);
+		return 0;		
+	}
+
+	if(value->number_of_crcs > 0)
+	{
+		value->crc_pdu_list = (nfapi_crc_indication_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_crc_indication_pdu_t) * value->number_of_crcs, config);
+		if(value->crc_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate crc ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_crcs);
+			return 0;
+		}
+	}
+	else
+	{
+		value->crc_pdu_list = 0;
+	}
+
+	
+	uint8_t i = 0;
+	for(i = 0; i < value->number_of_crcs; ++i)
+	{
+		nfapi_crc_indication_pdu_t* pdu = &(value->crc_pdu_list[i]);
+
+		if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0)
+			return 0;
+
+		uint8_t* crcPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length;
+
+
+		unpack_tlv_t unpack_fns[] =
+		{
+			{ NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value },
+			{ NFAPI_CRC_INDICATION_REL8_TAG, &pdu->crc_indication_rel8, unpack_crc_indication_rel8_value },
+		};
+
+		if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, crcPduInstanceEnd, 0, 0) == 0)
+			return 0;
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_crc_indication_t *pNfapiMsg = (nfapi_crc_indication_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_CRC_INDICATION_BODY_TAG, &pNfapiMsg->crc_indication_body, &unpack_crc_indication_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_rx_indication_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_rx_indication_rel8_t* value = (nfapi_rx_indication_rel8_t*)tlv;
+	
+	return (pull16(ppReadPackedMsg, &value->length, end) &&
+			pull16(ppReadPackedMsg, &value->offset, end) &&
+			pull8(ppReadPackedMsg, &value->ul_cqi, end) &&
+			pull16(ppReadPackedMsg, &value->timing_advance, end));
+}
+static uint8_t unpack_rx_indication_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_rx_indication_rel9_t* value = (nfapi_rx_indication_rel9_t*)tlv;
+	return (pull16(ppReadPackedMsg, &value->timing_advance_r9, end));
+}
+
+static uint8_t unpack_rx_indication_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_rx_indication_body_t* value = (nfapi_rx_indication_body_t*)tlv;
+
+	// the rxBodyEnd points to the end of the cqi PDU's
+	uint8_t* rxBodyEnd = *ppReadPackedMsg + value->tl.length;
+	uint8_t* rxPduEnd = rxBodyEnd;
+
+	uint8_t* numberOfPdusAddress = *ppReadPackedMsg;
+
+	if(rxBodyEnd > end)
+	{
+		// pdu end is past buffer end
+		return 0;
+	}
+
+	if(pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0)
+		return 0;
+
+	if(value->number_of_pdus > NFAPI_RX_IND_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of rx ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_RX_IND_MAX_PDU);
+		return 0;		
+	}
+
+	if(value->number_of_pdus > 0)
+	{
+		value->rx_pdu_list = (nfapi_rx_indication_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_rx_indication_pdu_t) * value->number_of_pdus, config);
+		if(value->rx_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate rx ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus);
+			return 0;
+		}
+	}
+	else
+	{
+		value->rx_pdu_list = 0;
+	}
+	
+	uint8_t i = 0;
+	nfapi_rx_indication_pdu_t* pdu = 0;
+	while((uint8_t*)(*ppReadPackedMsg) < rxBodyEnd && (uint8_t*)(*ppReadPackedMsg) < rxPduEnd)
+	{
+		nfapi_tl_t generic_tl;
+		if( unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
+			return 0;
+
+		switch(generic_tl.tag)
+		{
+			case NFAPI_RX_UE_INFORMATION_TAG:
+				{
+					pdu = &(value->rx_pdu_list[i++]);
+					pdu->rx_ue_information.tl = generic_tl;
+					if(unpack_rx_ue_information_value(&pdu->rx_ue_information, ppReadPackedMsg, end) == 0)
+						return 0;
+				}
+				break;
+			case NFAPI_RX_INDICATION_REL8_TAG:
+				{
+					if(pdu != 0)
+					{
+						pdu->rx_indication_rel8.tl = generic_tl;
+						if(unpack_rx_indication_rel8_value(&pdu->rx_indication_rel8, ppReadPackedMsg, end) == 0)
+							return 0;
+		
+						if(pdu->rx_indication_rel8.offset > 0)
+						{
+							// Need to check that the data is within the tlv
+							if(numberOfPdusAddress + pdu->rx_indication_rel8.offset + pdu->rx_indication_rel8.length <= rxBodyEnd)
+							{
+								// If this the first pdu set the rxPduEnd
+								if(numberOfPdusAddress + pdu->rx_indication_rel8.offset < rxPduEnd)
+								{
+									rxPduEnd = numberOfPdusAddress + pdu->rx_indication_rel8.offset;
+		
+									if(rxPduEnd > end)
+									{
+										// pdu end is past buffer end
+										return 0;
+									}
+								}
+							}
+							else
+							{
+								NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME: the rx data is outside of the tlv\n");
+							}
+						}
+					}
+				}
+				break;
+			case NFAPI_RX_INDICATION_REL9_TAG:
+				{
+					if(pdu != 0)
+					{
+						pdu->rx_indication_rel9.tl = generic_tl;
+						if(unpack_rx_indication_rel9_value(&pdu->rx_indication_rel9, ppReadPackedMsg, end) == 0)
+							return 0;
+					}
+				}
+				break;
+			default:
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "RX_ULSCH.indication Invalid pdu type %d \n", generic_tl.tag );
+				}
+				break;
+		}
+	}
+	
+	uint8_t idx = 0;
+	for(idx = 0; idx < value->number_of_pdus; ++idx)
+	{
+		if(value->rx_pdu_list[idx].rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG)
+		{
+			uint32_t length = value->rx_pdu_list[idx].rx_indication_rel8.length;
+			value->rx_pdu_list[idx].data = nfapi_p7_allocate(length, config);
+			if(pullarray8(ppReadPackedMsg, value->rx_pdu_list[idx].data, length, length, end) == 0)
+			{
+				return 0;
+			}
+		}
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_rx_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_rx_indication_t *pNfapiMsg = (nfapi_rx_indication_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_RX_INDICATION_BODY_TAG, &pNfapiMsg->rx_indication_body, &unpack_rx_indication_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_preamble_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_preamble_pdu_rel8_t* preamble_pdu_rel8 = (nfapi_preamble_pdu_rel8_t*)tlv;
+	
+	return (pull16(ppReadPackedMsg, &preamble_pdu_rel8->rnti, end) &&
+			pull8(ppReadPackedMsg, &preamble_pdu_rel8->preamble, end) &&
+			pull16(ppReadPackedMsg, &preamble_pdu_rel8->timing_advance, end));
+}
+
+static uint8_t unpack_preamble_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_preamble_pdu_rel9_t* preamble_pdu_rel9 = (nfapi_preamble_pdu_rel9_t*)tlv;
+	return pull16(ppReadPackedMsg, &preamble_pdu_rel9->timing_advance_r9, end);
+}
+
+static uint8_t unpack_preamble_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_preamble_pdu_rel13_t* preamble_pdu_rel13 = (nfapi_preamble_pdu_rel13_t*)tlv;
+	return pull8(ppReadPackedMsg, &preamble_pdu_rel13->rach_resource_type, end);
+}
+
+static uint8_t unpack_rach_indication_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_rach_indication_body_t* value = (nfapi_rach_indication_body_t*)tlv;
+	uint8_t* rachBodyEnd = *ppReadPackedMsg + value->tl.length;
+
+	if(rachBodyEnd > end)
+		return 0;
+
+	if(pull16(ppReadPackedMsg, &value->number_of_preambles, end) == 0)
+		return 0;
+
+	if(value->number_of_preambles > NFAPI_PREAMBLE_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of preamble du's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_preambles, NFAPI_PREAMBLE_MAX_PDU);
+		return 0;		
+	}
+
+	if(value->number_of_preambles > 0)
+	{
+		value->preamble_list = (nfapi_preamble_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_preamble_pdu_t) * value->number_of_preambles, config);
+		if(value->preamble_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate preamble pdu list (count:%d)\n", __FUNCTION__, value->number_of_preambles);
+			return 0;
+		}
+	}
+	else
+	{
+		value->preamble_list = 0;
+	}
+
+	
+	uint8_t i = 0;
+	for(i = 0; i < value->number_of_preambles; ++i)
+	{
+		nfapi_preamble_pdu_t* pdu = &(value->preamble_list[i]);
+
+		if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0)
+			return 0;
+
+		uint8_t* preamblePduInstanceEnd = *ppReadPackedMsg + pdu->instance_length;
+
+
+		unpack_tlv_t unpack_fns[] =
+		{
+			{ NFAPI_PREAMBLE_REL8_TAG, &pdu->preamble_rel8, unpack_preamble_pdu_rel8_value },
+			{ NFAPI_PREAMBLE_REL9_TAG, &pdu->preamble_rel9, unpack_preamble_pdu_rel9_value },
+			{ NFAPI_PREAMBLE_REL13_TAG, &pdu->preamble_rel13, unpack_preamble_pdu_rel13_value },
+		};
+
+		if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, preamblePduInstanceEnd, 0, 0) == 0)
+			return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_rach_indication_t *pNfapiMsg = (nfapi_rach_indication_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_RACH_INDICATION_BODY_TAG, &pNfapiMsg->rach_indication_body, &unpack_rach_indication_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_srs_indication_fdd_rel8_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_srs_indication_fdd_rel8_t* srs_pdu_fdd_rel8 = (nfapi_srs_indication_fdd_rel8_t*)tlv;
+	
+	if(!(pull16(ppReadPackedMsg, &srs_pdu_fdd_rel8->doppler_estimation, end) &&
+		 pull16(ppReadPackedMsg, &srs_pdu_fdd_rel8->timing_advance, end) &&
+		 pull8(ppReadPackedMsg, &srs_pdu_fdd_rel8->number_of_resource_blocks, end) &&
+		 pull8(ppReadPackedMsg, &srs_pdu_fdd_rel8->rb_start, end) &&
+		 pullarray8(ppReadPackedMsg, srs_pdu_fdd_rel8->snr, NFAPI_NUM_RB_MAX, srs_pdu_fdd_rel8->number_of_resource_blocks, end)))
+		return 0;
+	return 1;
+}
+
+static uint8_t unpack_srs_indication_fdd_rel9_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_srs_indication_fdd_rel9_t* srs_pdu_fdd_rel9 = (nfapi_srs_indication_fdd_rel9_t*)tlv;
+	return (pull16(ppReadPackedMsg, &srs_pdu_fdd_rel9->timing_advance_r9, end));
+}
+
+static uint8_t unpack_srs_indication_tdd_rel10_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_srs_indication_ttd_rel10_t* srs_pdu_tdd_rel10 = (nfapi_srs_indication_ttd_rel10_t*)tlv;
+	return (pull8(ppReadPackedMsg, &srs_pdu_tdd_rel10->uppts_symbol, end));
+}
+
+static uint8_t unpack_srs_indication_fdd_rel11_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_srs_indication_fdd_rel11_t* srs_pdu_fdd_rel11 = (nfapi_srs_indication_fdd_rel11_t*)tlv;
+	return ( pull16(ppReadPackedMsg, &srs_pdu_fdd_rel11->ul_rtoa, end));
+}
+
+static uint8_t unpack_tdd_channel_measurement_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_tdd_channel_measurement_t* value = (nfapi_tdd_channel_measurement_t*)tlv;
+	
+	if(!(pull8(ppReadPackedMsg, &value->num_prb_per_subband, end) &&
+		 pull8(ppReadPackedMsg, &value->number_of_subbands, end) &&
+		 pull8(ppReadPackedMsg, &value->num_atennas, end)))
+		return 0;
+
+	if(value->number_of_subbands > NFAPI_MAX_NUM_SUBBANDS)
+	{
+		// todo : add error
+		return 0;
+	}
+
+	if(value->num_atennas > NFAPI_MAX_NUM_PHYSICAL_ANTENNAS)
+	{
+		// todo : add error
+		return 0;
+	}
+
+	uint8_t idx = 0;
+	for(idx = 0; idx < value->number_of_subbands; ++idx)
+	{
+		if(!(pull8(ppReadPackedMsg, &value->subands[idx].subband_index, end) &&
+			 pullarray16(ppReadPackedMsg, value->subands[idx].channel, NFAPI_MAX_NUM_PHYSICAL_ANTENNAS, value->num_atennas, end)))
+			return 0;
+	}
+
+	return 1;
+}
+
+
+static uint8_t unpack_srs_indication_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_srs_indication_body_t* value = (nfapi_srs_indication_body_t*)tlv;
+	uint8_t* srsBodyEnd = *ppReadPackedMsg + value->tl.length;
+	
+	if(srsBodyEnd > end)
+		return 0;
+
+	if(pull8(ppReadPackedMsg, &value->number_of_ues, end) == 0)
+		return 0;
+
+	if(value->number_of_ues > NFAPI_SRS_IND_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of srs ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_ues, NFAPI_SRS_IND_MAX_PDU);
+		return 0;		
+	}
+
+	if(value->number_of_ues > 0)
+	{
+		value->srs_pdu_list = (nfapi_srs_indication_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_srs_indication_pdu_t) * value->number_of_ues, config);
+		if(value->srs_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate srs ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_ues);
+			return 0;
+		}
+	}
+	else
+	{
+		value->srs_pdu_list = 0;
+	}
+
+
+	
+	uint8_t i = 0;
+	for(i = 0; i < value->number_of_ues; ++i)
+	{
+		nfapi_srs_indication_pdu_t* pdu = &(value->srs_pdu_list[i]);
+
+		
+		if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0)
+			return 0;
+
+		uint8_t* srsPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length;
+
+
+		unpack_tlv_t unpack_fns[] =
+		{
+			{ NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value },
+			{ NFAPI_SRS_INDICATION_FDD_REL8_TAG, &pdu->srs_indication_fdd_rel8, unpack_srs_indication_fdd_rel8_value},
+			{ NFAPI_SRS_INDICATION_FDD_REL9_TAG, &pdu->srs_indication_fdd_rel9, unpack_srs_indication_fdd_rel9_value},
+			{ NFAPI_SRS_INDICATION_TDD_REL10_TAG, &pdu->srs_indication_tdd_rel10, unpack_srs_indication_tdd_rel10_value},
+			{ NFAPI_SRS_INDICATION_FDD_REL11_TAG, &pdu->srs_indication_fdd_rel11, unpack_srs_indication_fdd_rel11_value},
+			{ NFAPI_TDD_CHANNEL_MEASUREMENT_TAG, &pdu->tdd_channel_measurement, unpack_tdd_channel_measurement_value},
+		};
+
+		if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, srsPduInstanceEnd, 0, 0) == 0)
+			return 0;
+	}
+	return 1;
+}
+
+static uint8_t unpack_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_srs_indication_t *pNfapiMsg = (nfapi_srs_indication_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_SRS_INDICATION_BODY_TAG, &pNfapiMsg->srs_indication_body, &unpack_srs_indication_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+
+static uint8_t unpack_sr_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_sr_indication_body_t* value = (nfapi_sr_indication_body_t*)tlv;
+	uint8_t* srBodyEnd = *ppReadPackedMsg + value->tl.length;
+
+	if(srBodyEnd > end)
+		return 0;
+
+	if(pull16(ppReadPackedMsg, &value->number_of_srs, end) == 0)
+		return 0;
+
+	if(value->number_of_srs > NFAPI_SR_IND_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of sr ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_srs, NFAPI_SR_IND_MAX_PDU);
+		return 0;		
+	}
+
+	if(value->number_of_srs > 0)
+	{
+		value->sr_pdu_list = (nfapi_sr_indication_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_sr_indication_pdu_t) * value->number_of_srs, config);
+		if(value->sr_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate sr ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_srs);
+			return 0;
+		}
+	}
+	else
+	{
+		value->sr_pdu_list = 0;
+	}
+	
+	uint8_t i = 0;
+	for(i = 0; i < value->number_of_srs; ++i)
+	{
+		nfapi_sr_indication_pdu_t* pdu = &(value->sr_pdu_list[i]);
+
+		if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0)
+			return 0;
+
+		uint8_t* srPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length;
+
+
+		unpack_tlv_t unpack_fns[] =
+		{
+			{ NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value },
+			{ NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, unpack_ul_cqi_information_value },
+		};
+
+		if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, srPduInstanceEnd, 0, 0) == 0)
+			return 0;
+	}
+
+	return 1;
+
+}
+
+static int unpack_sr_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_sr_indication_t *pNfapiMsg = (nfapi_sr_indication_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_SR_INDICATION_BODY_TAG, &pNfapiMsg->sr_indication_body, &unpack_sr_indication_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+static uint8_t unpack_cqi_indication_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_cqi_indication_rel8_t* cqi_pdu_rel8 = (nfapi_cqi_indication_rel8_t*)tlv;
+	
+	return (pull16(ppReadPackedMsg, &cqi_pdu_rel8->length, end) &&
+			pull16(ppReadPackedMsg, &cqi_pdu_rel8->data_offset, end) &&
+			pull8(ppReadPackedMsg, &cqi_pdu_rel8->ul_cqi, end) &&
+			pull8(ppReadPackedMsg, &cqi_pdu_rel8->ri, end) &&
+			pull16(ppReadPackedMsg, &cqi_pdu_rel8->timing_advance, end));
+
+}
+
+static uint8_t unpack_cqi_indication_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_cqi_indication_rel9_t* cqi_pdu_rel9 = (nfapi_cqi_indication_rel9_t*)tlv;
+	
+	if(!(pull16(ppReadPackedMsg, &cqi_pdu_rel9->length, end) &&
+		 pull16(ppReadPackedMsg, &cqi_pdu_rel9->data_offset, end) &&
+		 pull8(ppReadPackedMsg, &cqi_pdu_rel9->ul_cqi, end) &&
+		 pull8(ppReadPackedMsg, &cqi_pdu_rel9->number_of_cc_reported, end)))
+		return 0;
+
+	if(cqi_pdu_rel9->number_of_cc_reported > NFAPI_CC_MAX)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : out of bound array\n");
+		return 0;
+	}
+	
+	if(!(pullarray8(ppReadPackedMsg, cqi_pdu_rel9->ri, NFAPI_CC_MAX, cqi_pdu_rel9->number_of_cc_reported, end) &&
+		 pull16(ppReadPackedMsg, &cqi_pdu_rel9->timing_advance, end) &&
+		 pull16(ppReadPackedMsg, &cqi_pdu_rel9->timing_advance_r9, end)))
+		return 0;
+
+	return 1;
+}
+
+static uint8_t  unpack_cqi_indication_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end,  nfapi_p7_codec_config_t* config)
+{
+	nfapi_cqi_indication_body_t* value = (nfapi_cqi_indication_body_t*)tlv;
+
+	// the cqiBodyEnd points to the end of the cqi PDU's
+	uint8_t* cqiBodyEnd = *ppReadPackedMsg + value->tl.length;
+
+	//uint8_t* cqiPduEnd = cqiBodyEnd;
+	//uint8_t* numberOfPdusAddress = *ppReadPackedMsg;
+
+	if(cqiBodyEnd > end)
+		return 0;
+
+	if(pull16(ppReadPackedMsg, &value->number_of_cqis, end) == 0)
+		return 0;
+
+	if(value->number_of_cqis > NFAPI_CQI_IND_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of cqi ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_cqis, NFAPI_CQI_IND_MAX_PDU);
+		return -1;		
+	}
+
+	if(value->number_of_cqis > 0)
+	{
+		value->cqi_pdu_list = (nfapi_cqi_indication_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_cqi_indication_pdu_t) * value->number_of_cqis, config);
+		if(value->cqi_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate cqi ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_cqis);
+			return 0;
+		}
+	}
+	else
+	{
+		value->cqi_pdu_list = 0;
+	}
+
+	if(value->number_of_cqis > 0)
+	{
+		value->cqi_raw_pdu_list = (nfapi_cqi_indication_raw_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_cqi_indication_raw_pdu_t) * value->number_of_cqis, config);
+		if(value->cqi_raw_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate raw cqi ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_cqis);
+			return 0;
+		}
+	}
+	else
+	{
+		value->cqi_raw_pdu_list = 0;
+	}
+
+	uint8_t i = 0;
+	for(i = 0; i < value->number_of_cqis; ++i)
+	{
+		nfapi_cqi_indication_pdu_t* pdu = &(value->cqi_pdu_list[i]);
+		memset(pdu, 0, sizeof(nfapi_cqi_indication_pdu_t));
+
+		if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0)
+			return 0;
+
+		uint8_t* cqiPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length;
+
+
+		while((uint8_t*)(*ppReadPackedMsg) < cqiPduInstanceEnd)
+		{
+			nfapi_tl_t generic_tl;
+			if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
+				return 0;
+
+			switch(generic_tl.tag)
+			{
+				case NFAPI_RX_UE_INFORMATION_TAG:
+					pdu->rx_ue_information.tl = generic_tl;
+					if(unpack_rx_ue_information_value(&pdu->rx_ue_information, ppReadPackedMsg, end) == 0)
+						return 0;
+					break;
+				case NFAPI_CQI_INDICATION_REL8_TAG:
+					pdu->cqi_indication_rel8.tl = generic_tl;
+					if(unpack_cqi_indication_rel8_value(&pdu->cqi_indication_rel8, ppReadPackedMsg, end) == 0)
+						return 0;
+
+					break;
+				case NFAPI_CQI_INDICATION_REL9_TAG:
+					pdu->cqi_indication_rel9.tl = generic_tl;
+					if(unpack_cqi_indication_rel9_value(&pdu->cqi_indication_rel9, ppReadPackedMsg, end) == 0)
+						return 0;
+
+					break;
+				case NFAPI_UL_CQI_INFORMATION_TAG:
+					pdu->ul_cqi_information.tl = generic_tl;
+					if(unpack_ul_cqi_information_value(&pdu->ul_cqi_information, ppReadPackedMsg, end) == 0)
+						return 0;
+					break;
+				default:
+					{
+						NFAPI_TRACE(NFAPI_TRACE_ERROR, "RX_CQI.indication Invalid pdu type %d \n", generic_tl.tag );
+					}
+					break;
+
+			};
+		}
+	}
+
+	uint8_t idx = 0;
+	for(idx = 0; idx < value->number_of_cqis; ++idx)
+	{
+		if(value->cqi_pdu_list[idx].cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG)
+		{
+			if(pullarray8(ppReadPackedMsg, &(value->cqi_raw_pdu_list[idx].pdu[0]), NFAPI_CQI_RAW_MAX_LEN, value->cqi_pdu_list[idx].cqi_indication_rel8.length, end) == 0)
+				return 0;
+		}
+		else if(value->cqi_pdu_list[idx].cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG)
+		{
+			if(pullarray8(ppReadPackedMsg, &(value->cqi_raw_pdu_list[idx].pdu[0]), NFAPI_CQI_RAW_MAX_LEN, value->cqi_pdu_list[idx].cqi_indication_rel9.length, end) == 0)
+				return 0;
+		}
+	}
+
+
+	return 1;
+
+}
+
+static uint8_t unpack_cqi_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_cqi_indication_t *pNfapiMsg = (nfapi_cqi_indication_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_CQI_INDICATION_BODY_TAG, &pNfapiMsg->cqi_indication_body, &unpack_cqi_indication_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+static uint8_t unpack_lbt_pdsch_req_pdu_rel13_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lbt_pdsch_req_pdu_rel13_t* value = (nfapi_lbt_pdsch_req_pdu_rel13_t*)tlv;
+
+	return (pull32(ppReadPackedMsg, &value->handle, end) &&
+			pull32(ppReadPackedMsg, &value->mp_cca, end) &&
+			pull32(ppReadPackedMsg, &value->n_cca, end) &&
+			pull32(ppReadPackedMsg, &value->offset, end) &&
+			pull32(ppReadPackedMsg, &value->lte_txop_sf, end) &&
+			pull16(ppReadPackedMsg, &value->txop_sfn_sf_end, end) &&
+			pull32(ppReadPackedMsg, &value->lbt_mode, end));
+}
+
+static uint8_t unpack_lbt_drs_req_pdu_rel13_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lbt_drs_req_pdu_rel13_t* value = (nfapi_lbt_drs_req_pdu_rel13_t*)tlv;
+
+	return (pull32(ppReadPackedMsg, &value->handle, end) &&
+			pull32(ppReadPackedMsg, &value->offset, end) &&
+			pull16(ppReadPackedMsg, &value->sfn_sf_end, end) &&
+			pull32(ppReadPackedMsg, &value->lbt_mode, end));
+}
+
+
+static uint8_t unpack_lbt_config_request_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_lbt_dl_config_request_body_t* value = (nfapi_lbt_dl_config_request_body_t*)tlv;
+
+	if(pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0)
+		return 0;
+
+	if(value->number_of_pdus > NFAPI_LBT_DL_CONFIG_REQ_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of lbt dl config pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_LBT_DL_CONFIG_REQ_MAX_PDU);
+		return 0;		
+	}
+
+	if(value->number_of_pdus)
+	{
+		value->lbt_dl_config_req_pdu_list = (nfapi_lbt_dl_config_request_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_lbt_dl_config_request_pdu_t) * value->number_of_pdus, config);
+		if(value->lbt_dl_config_req_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate lbt dl config pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus);
+			return 0;
+		}
+	}
+	else
+	{
+		value->lbt_dl_config_req_pdu_list = 0;
+	}
+
+
+	uint16_t i;
+	uint16_t total_number_of_pdus = value->number_of_pdus;
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_lbt_dl_config_request_pdu_t* pdu = &(value->lbt_dl_config_req_pdu_list[i]);
+
+		if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) &&
+			 pull8(ppReadPackedMsg, &pdu->pdu_size, end)))
+			return 0;
+			
+		uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2;
+
+		if(packedPduEnd > end)
+			return 0;
+
+		switch(pdu->pdu_type)
+		{
+			case NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_LBT_PDSCH_REQ_PDU_REL13_TAG, &pdu->lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13, &unpack_lbt_pdsch_req_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_LBT_DRS_REQ_PDU_REL13_TAG, &pdu->lbt_drs_req_pdu.lbt_drs_req_pdu_rel13, &unpack_lbt_drs_req_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			default:
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL_CONFIG.request body invalid pdu type %d\n", pdu->pdu_type);
+				return 0;
+		}
+	}
+
+	return 1;
+}
+static uint8_t unpack_lbt_dl_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_lbt_dl_config_request_t *pNfapiMsg = (nfapi_lbt_dl_config_request_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LBT_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->lbt_dl_config_request_body, &unpack_lbt_config_request_body_value},
+	};
+	
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_lbt_pdsch_rsp_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lbt_pdsch_rsp_pdu_rel13_t* value = (nfapi_lbt_pdsch_rsp_pdu_rel13_t*)tlv;
+	
+	return (pull32(ppReadPackedMsg, &value->handle, end) &&
+			pull32(ppReadPackedMsg, &value->result, end) &&
+			pull32(ppReadPackedMsg, &value->lte_txop_symbols, end) &&
+			pull32(ppReadPackedMsg, &value->initial_partial_sf, end));
+	
+}
+static uint8_t unpack_lbt_drs_rsp_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_lbt_drs_rsp_pdu_rel13_t* value = (nfapi_lbt_drs_rsp_pdu_rel13_t*)tlv;
+	
+	return (pull32(ppReadPackedMsg, &value->handle, end) &&
+			pull32(ppReadPackedMsg, &value->result, end));
+}
+
+static uint8_t unpack_lbt_indication_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_lbt_dl_indication_body_t* value = (nfapi_lbt_dl_indication_body_t*)tlv;
+
+	if(pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0)
+		return 0;
+
+	if(value->number_of_pdus > NFAPI_LBT_IND_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of lbt dl ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_LBT_IND_MAX_PDU);
+		return 0;		
+	}
+
+	if(value->number_of_pdus > 0)
+	{
+		value->lbt_indication_pdu_list = (nfapi_lbt_dl_indication_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_lbt_dl_indication_pdu_t) * value->number_of_pdus, config);
+		if(value->lbt_indication_pdu_list == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate lbt dl ind config pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus);
+			return 0;
+		}
+	}
+	else
+	{
+		value->lbt_indication_pdu_list = 0;
+	}
+
+	uint16_t i;
+	uint16_t total_number_of_pdus = value->number_of_pdus;
+	for(i = 0; i < total_number_of_pdus; ++i)
+	{
+		nfapi_lbt_dl_indication_pdu_t* pdu = &(value->lbt_indication_pdu_list[i]);
+
+		if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) &&
+			 pull8(ppReadPackedMsg, &pdu->pdu_size, end)))
+			return 0;
+			
+		uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2;
+
+		if(packedPduEnd > end)
+			return 0;
+
+		switch(pdu->pdu_type)
+		{
+			case NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG, &pdu->lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13, &unpack_lbt_pdsch_rsp_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			case NFAPI_LBT_DL_RSP_DRS_PDU_TYPE:
+				{
+					unpack_tlv_t unpack_fns[] =
+					{
+						{ NFAPI_LBT_DRS_RSP_PDU_REL13_TAG, &pdu->lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13, &unpack_lbt_drs_rsp_pdu_rel13_value},
+					};
+
+					unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0);
+				}
+				break;
+			default:
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL.indication body invalid pdu type %d\n", pdu->pdu_type);
+				return 0;
+		}
+	}
+
+	return 1;
+}
+static uint8_t unpack_lbt_dl_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_lbt_dl_indication_t *pNfapiMsg = (nfapi_lbt_dl_indication_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_LBT_DL_INDICATION_BODY_TAG, &pNfapiMsg->lbt_dl_indication_body, &unpack_lbt_indication_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_nb_harq_indication_fdd_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nb_harq_indication_fdd_rel13_t* value = (nfapi_nb_harq_indication_fdd_rel13_t*)tlv;
+	return (pull8(ppReadPackedMsg, &value->harq_tb1, end));
+}
+
+
+static uint8_t unpack_nb_harq_indication_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_nb_harq_indication_body_t* value = (nfapi_nb_harq_indication_body_t*)tlv;
+	uint8_t* nbharqBodyEnd = *ppReadPackedMsg + value->tl.length;
+
+	if(nbharqBodyEnd > end)
+		return 0;
+
+	if(pull16(ppReadPackedMsg, &value->number_of_harqs, end) == 0)
+		return 0;
+
+	if(value->number_of_harqs > NFAPI_HARQ_IND_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of harq ind pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_harqs, NFAPI_HARQ_IND_MAX_PDU);
+		return 0;		
+	}
+
+	value->nb_harq_pdu_list = (nfapi_nb_harq_indication_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_nb_harq_indication_pdu_t) * value->number_of_harqs, config);
+	if(value->nb_harq_pdu_list == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate harq ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_harqs);
+		return 0;
+	}
+	
+	uint8_t i = 0;
+	for(i = 0; i < value->number_of_harqs; ++i)
+	{
+		nfapi_nb_harq_indication_pdu_t* pdu = &(value->nb_harq_pdu_list[i]);
+		if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0)
+			return 0;
+
+		uint8_t* harqPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length;
+
+		unpack_tlv_t unpack_fns[] =
+		{
+			{ NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value },
+			{ NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG, &pdu->nb_harq_indication_fdd_rel13, &unpack_nb_harq_indication_fdd_rel13_value},
+			{ NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, &unpack_ul_cqi_information_value}
+		};
+
+		if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, harqPduInstanceEnd, 0, 0) == 0)
+			return 0;
+	
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_nb_harq_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_nb_harq_indication_t *pNfapiMsg = (nfapi_nb_harq_indication_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_NB_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->nb_harq_indication_body, &unpack_nb_harq_indication_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_nrach_indication_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+{
+	nfapi_nrach_indication_pdu_rel13_t* value = (nfapi_nrach_indication_pdu_rel13_t*)tlv;
+	
+	return (pull16(ppReadPackedMsg, &value->rnti, end) && 
+			pull8(ppReadPackedMsg, &value->initial_sc, end) &&
+			pull16(ppReadPackedMsg, &value->timing_advance, end) &&
+			pull8(ppReadPackedMsg, &value->nrach_ce_level, end));
+}
+
+
+static uint8_t unpack_nrach_indication_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	nfapi_nrach_indication_body_t* value = (nfapi_nrach_indication_body_t*)tlv;
+	uint8_t* nrachBodyEnd = *ppReadPackedMsg + value->tl.length;
+
+	if(nrachBodyEnd > end)
+		return 0;
+
+	if(pull8(ppReadPackedMsg, &value->number_of_initial_scs_detected, end) == 0)
+		return 0;
+
+	if(value->number_of_initial_scs_detected > NFAPI_PREAMBLE_MAX_PDU)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of detected scs ind pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_initial_scs_detected, NFAPI_PREAMBLE_MAX_PDU);
+		return 0;		
+	}
+
+	value->nrach_pdu_list = (nfapi_nrach_indication_pdu_t*)nfapi_p7_allocate(sizeof(nfapi_nrach_indication_pdu_t) * value->number_of_initial_scs_detected, config);
+	if(value->nrach_pdu_list == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate nrach ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_initial_scs_detected);
+		return 0;
+	}
+	
+	uint8_t i = 0;
+	for(i = 0; i < value->number_of_initial_scs_detected; ++i)
+	{
+		nfapi_nrach_indication_pdu_t* pdu = &(value->nrach_pdu_list[i]);
+
+		uint8_t* nrachPduInstanceEnd = *ppReadPackedMsg + 4 + 6;
+
+		unpack_tlv_t unpack_fns[] =
+		{
+			{ NFAPI_NRACH_INDICATION_REL13_TAG, &pdu->nrach_indication_rel13, &unpack_nrach_indication_rel13_value},
+		};
+
+		if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, nrachPduInstanceEnd, 0, 0) == 0)
+			return 0;
+	
+	}
+
+	return 1;
+}
+
+static uint8_t unpack_nrach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_nrach_indication_t *pNfapiMsg = (nfapi_nrach_indication_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+		{ NFAPI_NRACH_INDICATION_BODY_TAG, &pNfapiMsg->nrach_indication_body, &unpack_nrach_indication_body_value},
+	};
+
+	return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_dl_node_sync(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_dl_node_sync_t *pNfapiMsg = (nfapi_dl_node_sync_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->t1, end) && 
+			pulls32(ppReadPackedMsg, &pNfapiMsg->delta_sfn_sf, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_ul_node_sync(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_ul_node_sync_t *pNfapiMsg = (nfapi_ul_node_sync_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->t1, end) &&
+			pull32(ppReadPackedMsg, &pNfapiMsg->t2, end) &&
+			pull32(ppReadPackedMsg, &pNfapiMsg->t3, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+static uint8_t unpack_timing_info(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
+{
+	nfapi_timing_info_t *pNfapiMsg = (nfapi_timing_info_t*)msg;
+
+	unpack_p7_tlv_t unpack_fns[] =
+	{
+	};
+
+	return (pull32(ppReadPackedMsg, &pNfapiMsg->last_sfn_sf, end) &&
+			pull32(ppReadPackedMsg, &pNfapiMsg->time_since_last_timing_info, end) &&
+			pull32(ppReadPackedMsg, &pNfapiMsg->dl_config_jitter, end) &&
+			pull32(ppReadPackedMsg, &pNfapiMsg->tx_request_jitter, end) &&
+			pull32(ppReadPackedMsg, &pNfapiMsg->ul_config_jitter, end) &&
+			pull32(ppReadPackedMsg, &pNfapiMsg->hi_dci0_jitter, end) &&
+			pulls32(ppReadPackedMsg, &pNfapiMsg->dl_config_latest_delay, end) &&
+			pulls32(ppReadPackedMsg, &pNfapiMsg->tx_request_latest_delay, end) &&
+			pulls32(ppReadPackedMsg, &pNfapiMsg->ul_config_latest_delay, end) &&
+			pulls32(ppReadPackedMsg, &pNfapiMsg->hi_dci0_latest_delay, end) &&
+			pulls32(ppReadPackedMsg, &pNfapiMsg->dl_config_earliest_arrival, end) &&
+			pulls32(ppReadPackedMsg, &pNfapiMsg->tx_request_earliest_arrival, end) &&
+			pulls32(ppReadPackedMsg, &pNfapiMsg->ul_config_earliest_arrival, end) &&
+			pulls32(ppReadPackedMsg, &pNfapiMsg->hi_dci0_earliest_arrival, end) &&
+			unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
+}
+
+
+// unpack length check
+
+static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen)
+{
+	int retLen = 0;
+
+	switch (msgId)
+	{
+		case NFAPI_DL_CONFIG_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_dl_config_request_t))
+				retLen = sizeof(nfapi_dl_config_request_t);
+			break;
+
+		case NFAPI_UL_CONFIG_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_ul_config_request_t))
+				retLen = sizeof(nfapi_ul_config_request_t);
+			break;
+
+		case NFAPI_SUBFRAME_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_subframe_indication_t))
+				retLen = sizeof(nfapi_subframe_indication_t);
+			break;
+
+		case NFAPI_HI_DCI0_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_hi_dci0_request_t))
+				retLen = sizeof(nfapi_hi_dci0_request_t);
+			break;
+
+		case NFAPI_TX_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_tx_request_t))
+				retLen = sizeof(nfapi_tx_request_t);
+			break;
+
+		case NFAPI_HARQ_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_harq_indication_t))
+				retLen = sizeof(nfapi_harq_indication_t);
+			break;
+
+		case NFAPI_CRC_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_crc_indication_t))
+				retLen = sizeof(nfapi_crc_indication_t);
+			break;
+
+		case NFAPI_RX_ULSCH_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_rx_indication_t))
+				retLen = sizeof(nfapi_rx_indication_t);
+			break;
+
+		case NFAPI_RACH_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_rach_indication_t))
+				retLen = sizeof(nfapi_rach_indication_t);
+			break;
+
+		case NFAPI_SRS_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_srs_indication_t))
+				retLen = sizeof(nfapi_srs_indication_t);
+			break;
+
+		case NFAPI_RX_SR_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_sr_indication_t))
+				retLen = sizeof(nfapi_sr_indication_t);
+			break;
+
+		case NFAPI_RX_CQI_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_cqi_indication_t))
+				retLen = sizeof(nfapi_cqi_indication_t);
+			break;
+
+		case NFAPI_LBT_DL_CONFIG_REQUEST:
+			if (unpackedBufLen >= sizeof(nfapi_lbt_dl_config_request_t))
+				retLen = sizeof(nfapi_lbt_dl_config_request_t);
+			break;
+
+		case NFAPI_LBT_DL_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_lbt_dl_indication_t))
+				retLen = sizeof(nfapi_lbt_dl_indication_t);
+			break;
+	
+		case NFAPI_NB_HARQ_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_nb_harq_indication_t))
+				retLen = sizeof(nfapi_nb_harq_indication_t);
+			break;
+			
+		case NFAPI_NRACH_INDICATION:
+			if (unpackedBufLen >= sizeof(nfapi_nrach_indication_t))
+				retLen = sizeof(nfapi_nrach_indication_t);
+			break;			
+			
+		case NFAPI_DL_NODE_SYNC:
+			if (unpackedBufLen >= sizeof(nfapi_dl_node_sync_t))
+				retLen = sizeof(nfapi_dl_node_sync_t);
+			break;
+
+		case NFAPI_UL_NODE_SYNC:
+			if (unpackedBufLen >= sizeof(nfapi_ul_node_sync_t))
+				retLen = sizeof(nfapi_ul_node_sync_t);
+			break;
+
+		case NFAPI_TIMING_INFO:
+			if (unpackedBufLen >= sizeof(nfapi_timing_info_t))
+				retLen = sizeof(nfapi_timing_info_t);
+			break;
+
+		default:
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown message ID %d\n", msgId);
+			break;
+	}
+
+	return retLen;
+}
+
+
+// Main unpack functions - public
+
+int nfapi_p7_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t* config)
+{
+	nfapi_p7_message_header_t *pMessageHeader = pUnpackedBuf;
+	uint8_t *pReadPackedMessage = pMessageBuf;
+	uint8_t *end = pMessageBuf + messageBufLen;
+
+	if (pMessageBuf == NULL || pUnpackedBuf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 header unpack supplied pointers are null\n");
+		return -1;
+	}
+
+	if (messageBufLen < NFAPI_P7_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p7_message_header_t))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 header unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen);
+		return -1;
+	}
+
+	// process the header
+	if(!(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) &&
+		 pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) &&
+		 pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) &&
+		 pull16(&pReadPackedMessage, &pMessageHeader->m_segment_sequence, end) &&
+		 pull32(&pReadPackedMessage, &pMessageHeader->checksum, end) &&
+		 pull32(&pReadPackedMessage, &pMessageHeader->transmit_timestamp, end)))
+		return -1;
+
+	return 0;
+}
+
+int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t* config)
+{
+	int result = 0;
+	nfapi_p7_message_header_t *pMessageHeader = (nfapi_p7_message_header_t*)pUnpackedBuf;
+	uint8_t *pReadPackedMessage = pMessageBuf;
+	uint8_t *end = pMessageBuf + messageBufLen;
+
+	if (pMessageBuf == NULL || pUnpackedBuf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied pointers are null\n");
+		return -1;
+	}
+
+	if (messageBufLen < NFAPI_P7_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p7_message_header_t))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen);
+		return -1;
+	}
+
+	// clean the supplied buffer for - tag value blanking
+	(void)memset(pUnpackedBuf, 0, unpackedBufLen);
+
+	// process the header
+	if(!(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) &&
+		 pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) &&
+		 pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) &&
+		 pull16(&pReadPackedMessage, &pMessageHeader->m_segment_sequence, end) &&
+		 pull32(&pReadPackedMessage, &pMessageHeader->checksum, end) &&
+		 pull32(&pReadPackedMessage, &pMessageHeader->transmit_timestamp, end)))
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack header failed\n");
+		return -1;
+	}
+
+	if((uint8_t*)(pMessageBuf + pMessageHeader->message_length) > end)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack message length is greater than the message buffer \n");
+		return -1;
+	}
+
+	/*
+	if(check_unpack_length(pMessageHeader->message_id, unpackedBufLen) == 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack unpack buffer is not large enough \n");
+		return -1;
+	}
+	*/
+
+	// look for the specific message
+	switch (pMessageHeader->message_id)
+	{
+		case NFAPI_DL_CONFIG_REQUEST:
+			if (check_unpack_length(NFAPI_DL_CONFIG_REQUEST, unpackedBufLen))
+				result = unpack_dl_config_request(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_UL_CONFIG_REQUEST:
+			if (check_unpack_length(NFAPI_UL_CONFIG_REQUEST, unpackedBufLen))
+				result = unpack_ul_config_request(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_HI_DCI0_REQUEST:
+			if (check_unpack_length(NFAPI_HI_DCI0_REQUEST, unpackedBufLen))
+				result = unpack_hi_dci0_request(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_TX_REQUEST:
+			if (check_unpack_length(NFAPI_TX_REQUEST, unpackedBufLen))
+				result = unpack_tx_request(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_HARQ_INDICATION:
+			if (check_unpack_length(NFAPI_HARQ_INDICATION, unpackedBufLen))
+				result = unpack_harq_indication(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_CRC_INDICATION:
+			if (check_unpack_length(NFAPI_CRC_INDICATION, unpackedBufLen))
+				result = unpack_crc_indication(&pReadPackedMessage,end , pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_RX_ULSCH_INDICATION:
+			if (check_unpack_length(NFAPI_RX_ULSCH_INDICATION, unpackedBufLen))
+				result = unpack_rx_indication(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_RACH_INDICATION:
+			if (check_unpack_length(NFAPI_RACH_INDICATION, unpackedBufLen))
+				result = unpack_rach_indication(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_SRS_INDICATION:
+			if (check_unpack_length(NFAPI_SRS_INDICATION, unpackedBufLen))
+				result = unpack_srs_indication(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_RX_SR_INDICATION:
+			if (check_unpack_length(NFAPI_RX_SR_INDICATION, unpackedBufLen))
+				result = unpack_sr_indication(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_RX_CQI_INDICATION:
+			if (check_unpack_length(NFAPI_RX_CQI_INDICATION, unpackedBufLen))
+				result = unpack_cqi_indication(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_LBT_DL_CONFIG_REQUEST:
+			if (check_unpack_length(NFAPI_LBT_DL_CONFIG_REQUEST, unpackedBufLen))
+				result = unpack_lbt_dl_config_request(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_LBT_DL_INDICATION:
+			if (check_unpack_length(NFAPI_LBT_DL_INDICATION, unpackedBufLen))
+				result = unpack_lbt_dl_indication(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+			
+		case NFAPI_NB_HARQ_INDICATION:
+			if (check_unpack_length(NFAPI_NB_HARQ_INDICATION, unpackedBufLen))
+				result = unpack_nb_harq_indication(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;	
+			
+		case NFAPI_NRACH_INDICATION:
+			if (check_unpack_length(NFAPI_NRACH_INDICATION, unpackedBufLen))
+				result = unpack_nrach_indication(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+			
+		case NFAPI_DL_NODE_SYNC:
+			if (check_unpack_length(NFAPI_DL_NODE_SYNC, unpackedBufLen))
+				result = unpack_dl_node_sync(&pReadPackedMessage,  end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_UL_NODE_SYNC:
+			if (check_unpack_length(NFAPI_UL_NODE_SYNC, unpackedBufLen))
+				result = unpack_ul_node_sync(&pReadPackedMessage, end , pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		case NFAPI_TIMING_INFO:
+			if (check_unpack_length(NFAPI_TIMING_INFO, unpackedBufLen))
+				result = unpack_timing_info(&pReadPackedMessage, end, pMessageHeader, config);
+			else
+				return -1;
+			break;
+
+		default:
+
+			if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && 
+			   pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
+			{
+				if(config && config->unpack_p7_vendor_extension)
+				{
+					result = (config->unpack_p7_vendor_extension)(pMessageHeader, &pReadPackedMessage, end, config);
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve decoder provided\n", __FUNCTION__, pMessageHeader->message_id);
+				}
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id);
+			}
+			break;
+	}
+
+	if(result == 0)
+		return -1;
+	else 
+		return 0;
+}
+
diff --git a/nfapi/open-nFAPI/nfapi/tests/Makefile.am b/nfapi/open-nFAPI/nfapi/tests/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..46785869b02d4e026b22b49416d782dc5bd4f2a6
--- /dev/null
+++ b/nfapi/open-nFAPI/nfapi/tests/Makefile.am
@@ -0,0 +1,36 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+#nfapi unit test
+AUTOMAKE_OPTIONS=subdir-objects
+
+AM_CPPFLAGS = -I$(top_srcdir)/nfapi/inc -I$(top_srcdir)/nfapi/public_inc  -I$(top_srcdir)/common/public_inc -I$(top_srcdir)pnf/public_inc $(CFLAGS_CUNIT) -Wall -Werror
+AM_CFLAGS = -I$(top_srcdir)/nfapi/inc -I$(top_srcdir)/nfapi/public_inc  -I$(top_srcdir)/common/public_inc -I$(top_srcdir)/pnf/public_inc $(CFLAGS_CUNIT) -Wall -Werror
+
+check_PROGRAMS= test_nfapi
+test_nfapi_SOURCES = nfapi_cunit_main.c ../src/nfapi.c ../src/nfapi_p7.c ../../common/src/debug.c ../src/nfapi_p5.c  ../src/nfapi_p4.c 
+test_nfapi_LDADD=$(top_builddir)/pnf/libnfapi_pnf.a  -L$(libdir) -lpthread -lrt -lsctp -lz -lcunit
+
+
+#jTEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh --ingore-exit
+#TEST_ENVIRONMENT = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
+
+#AM_TESTS_ENVIRONMENT = env AM_TAP_AWK='$(AWK)' $(SHELL);
+LOG_DRIVER = $(top_srcdir)/tap-driver.sh
+#AM_LOG_FLAGS = -- test_nfapi
+
+TESTS=$(check_PROGRAMS)
+EXTRA_DIST = $(TESTS)
diff --git a/nfapi/open-nFAPI/nfapi/tests/nfapi_cunit_main.c b/nfapi/open-nFAPI/nfapi/tests/nfapi_cunit_main.c
new file mode 100644
index 0000000000000000000000000000000000000000..daaf65a3ffebb3a0f889cacc02727cff1e2bd659
--- /dev/null
+++ b/nfapi/open-nFAPI/nfapi/tests/nfapi_cunit_main.c
@@ -0,0 +1,5511 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "CUnit.h"
+#include "Basic.h"
+#include "Automated.h"
+//#include "CUnit/Console.h"
+
+#include "nfapi_interface.h"
+#include "nfapi.h"
+#include <stdio.h>  // for printf
+#include <stdlib.h>
+#include "debug.h"
+#include "nfapi_interface.h"
+/* Test Suite setup and cleanup functions: */
+
+int init_suite(void) { return 0; }
+int clean_suite(void) { return 0; }
+
+#define MAX_PACKED_MESSAGE_SIZE	8192
+
+#define IN_OUT_ASSERT(_V) { CU_ASSERT_EQUAL(in._V, out._V); }
+
+typedef struct 
+{
+	nfapi_tl_t tl;
+	uint16_t value1;
+	uint32_t value2;
+} my_vendor_extention;
+
+extern void* nfapi_allocate_pdu(size_t size)
+{
+	return malloc(size);
+}
+
+extern int nfapi_test_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMsg, uint8_t *end, void** ve, nfapi_p4_p5_codec_config_t* config)
+{
+	printf("nfapi_unpack_vendor_extension_tlv\n");
+
+	if(tl->tag == NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE)
+	{
+		my_vendor_extention* mve = (my_vendor_extention*)malloc(sizeof(my_vendor_extention));
+		mve->tl.tag = NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE;
+		
+		if(!(pull16(ppReadPackedMsg, &mve->value1, end) &&
+		     pull32(ppReadPackedMsg, &mve->value2, end)))
+		{
+			free(mve);
+			return 0;
+		}
+
+		(*ve) = mve;
+
+	}
+
+	return 1;
+}
+
+int nfapi_pack_vendor_extension_tlv_called = 0;
+extern int nfapi_test_pack_vendor_extension_tlv(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	printf("nfapi_pack_vendor_extension_tlv\n");
+	nfapi_pack_vendor_extension_tlv_called++;
+
+	my_vendor_extention* mve = (my_vendor_extention*)ve;
+	
+	return (push16(mve->value1, ppWritePackedMsg, end) &&
+			push32(mve->value2, ppWritePackedMsg, end));
+
+}
+
+uint8_t gTestNfapiMessageTx[MAX_PACKED_MESSAGE_SIZE];
+
+
+uint8_t rand8(uint8_t min, uint8_t max)
+{
+	return ((rand() % (max + 1 - min)) + min);
+}
+
+/************* Test case functions ****************/
+
+void test_case_sample(void)
+{
+	/*Sample assert function, use as per your test case scenario.*/
+	CU_ASSERT(CU_TRUE);
+	CU_ASSERT_NOT_EQUAL(2, -1);
+	CU_ASSERT_STRING_EQUAL("string #1", "string #1");
+	CU_ASSERT_STRING_NOT_EQUAL("string #1", "string #2");
+
+	CU_ASSERT(CU_FALSE);
+	CU_ASSERT_EQUAL(2, 3);
+	CU_ASSERT_STRING_NOT_EQUAL("string #1", "string #1");
+	CU_ASSERT_STRING_EQUAL("string #1", "string #2");
+}
+
+
+int nfapi_test_verify_configreq_params(nfapi_pnf_config_request_t pnfConfigRequest_in, nfapi_pnf_config_request_t pnfConfigRequest_out)
+{
+	int i=0;
+	if(memcmp(&pnfConfigRequest_in, &pnfConfigRequest_out, sizeof(nfapi_pnf_config_request_t)) == 0)
+	{	
+		/*packed and unpacked phy config request are matched.*/
+
+		printf("Success: packed and unpacked phy config request are matched\n");
+		return 1;
+	}
+	else
+	{
+		if (pnfConfigRequest_in.header.message_id != pnfConfigRequest_out.header.message_id)
+		{
+			printf("Mismatch: packed message id %d, unpacked message id %d\n",
+					pnfConfigRequest_in.header.message_id, pnfConfigRequest_out.header.message_id);
+		}
+		if (pnfConfigRequest_in.header.message_length != pnfConfigRequest_out.header.message_length)
+		{
+			printf("Mismatch: packed message_length %d, unpacked message_length %d\n",
+					pnfConfigRequest_in.header.message_length, pnfConfigRequest_out.header.message_length);
+		}
+		if (pnfConfigRequest_in.header.phy_id != pnfConfigRequest_out.header.phy_id)
+		{
+			printf("Mismatch: packed phy_id %d, unpacked phy_id %d\n",
+					pnfConfigRequest_in.header.phy_id, pnfConfigRequest_out.header.phy_id);
+		}
+		if (pnfConfigRequest_in.pnf_phy_rf_config.number_phy_rf_config_info != pnfConfigRequest_out.pnf_phy_rf_config.number_phy_rf_config_info)			
+		{
+			printf("Mismatch: packed number_phy_rf_config_info %d, unpacked number_phy_rf_config_info %d\n",
+					pnfConfigRequest_in.pnf_phy_rf_config.number_phy_rf_config_info, pnfConfigRequest_out.pnf_phy_rf_config.number_phy_rf_config_info);
+		}
+
+		for (i=0; i < NFAPI_MAX_PHY_RF_INSTANCES; i++) 
+		{
+			if (pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[i].phy_id != pnfConfigRequest_out.pnf_phy_rf_config.phy_rf_config[i].phy_id)			
+			{
+				printf("Mismatch: rf idx %d, packed phy id %d, unpacked phy id %d\n",
+						i, pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[i].phy_id, pnfConfigRequest_out.pnf_phy_rf_config.phy_rf_config[i].phy_id);
+			}
+			if (pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[i].phy_config_index!= pnfConfigRequest_out.pnf_phy_rf_config.phy_rf_config[i].phy_config_index)			
+			{
+				printf("Mismatch: rf idx %d, packed phy_config_index %d, unpacked phy_config_index %d\n",
+						i, pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[i].phy_config_index, pnfConfigRequest_out.pnf_phy_rf_config.phy_rf_config[i].phy_config_index);
+			}
+			if (pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[i].rf_config_index != pnfConfigRequest_out.pnf_phy_rf_config.phy_rf_config[i].rf_config_index)			
+			{
+				printf("Mismatch: rf idx %d, packed rf_config_index %d, unpacked rf_config_index %d\n",
+						i, pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[i].rf_config_index, pnfConfigRequest_out.pnf_phy_rf_config.phy_rf_config[i].rf_config_index);
+			}
+		}
+		return 0;
+	}
+
+}
+
+
+void nfapi_test_pnf_config_req(void) 
+{
+
+	nfapi_pnf_config_request_t pnfConfigRequest_out;
+	nfapi_pnf_config_request_t pnfConfigRequest_in;
+	int packedMessageLength =0;
+
+	printf(" nfapi_test_pnf_config_req run \n");
+
+	/* Build phy config req */
+	pnfConfigRequest_in.header.phy_id = NFAPI_PHY_ID_NA;
+	pnfConfigRequest_in.header.message_id = NFAPI_PNF_CONFIG_REQUEST;
+	pnfConfigRequest_in.header.message_length = 22;
+	pnfConfigRequest_in.header.spare = 0;
+
+	pnfConfigRequest_in.pnf_phy_rf_config.tl.tag = NFAPI_PNF_PHY_RF_TAG;
+	pnfConfigRequest_in.pnf_phy_rf_config.tl.length = 0;
+	pnfConfigRequest_in.pnf_phy_rf_config.number_phy_rf_config_info = 2;
+	pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[0].phy_id = 4;
+	pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[0].phy_config_index = 1;
+	pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[0].rf_config_index = 1;
+	pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[1].phy_id = 5;
+	pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[1].phy_config_index = 2;
+	pnfConfigRequest_in.pnf_phy_rf_config.phy_rf_config[1].rf_config_index = 2;
+
+	/*Pack pnf config req*/
+	packedMessageLength = nfapi_p5_message_pack(&pnfConfigRequest_in, sizeof(nfapi_pnf_config_request_t), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	/*Unpack pnf config request*/
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &pnfConfigRequest_out, sizeof(nfapi_pnf_config_request_t), 0);
+
+	/*Verify unpacked message*/
+	CU_ASSERT_EQUAL(nfapi_test_verify_configreq_params(pnfConfigRequest_in, pnfConfigRequest_out), 1);  
+
+}
+
+void nfapi_test_2(void) {
+	/*Sample test function*/
+	CU_ASSERT_EQUAL( 0, 0);
+}
+
+void nfapi_test_rssi_request_lte()
+{
+	uint16_t idx;
+	nfapi_rssi_request_t in;
+	nfapi_rssi_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RSSI_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_LTE;
+
+	in.lte_rssi_request.tl.tag = NFAPI_LTE_RSSI_REQUEST_TAG;
+	in.lte_rssi_request.frequency_band_indicator = 0;
+	in.lte_rssi_request.bandwidth = 0;
+	in.lte_rssi_request.timeout = 0;
+	in.lte_rssi_request.number_of_earfcns = 4;
+	in.lte_rssi_request.earfcn[0] = 42;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	int upack_result = nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_NOT_EQUAL(packedMessageLength, -1);
+	CU_ASSERT_NOT_EQUAL(packedMessageLength, 0);
+	CU_ASSERT_NOT_EQUAL(upack_result, 0);
+	CU_ASSERT_NOT_EQUAL(upack_result, -1);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.lte_rssi_request.frequency_band_indicator, out.lte_rssi_request.frequency_band_indicator);
+	CU_ASSERT_EQUAL(in.lte_rssi_request.bandwidth, out.lte_rssi_request.bandwidth);
+	CU_ASSERT_EQUAL(in.lte_rssi_request.timeout, out.lte_rssi_request.timeout);
+	CU_ASSERT_EQUAL(in.lte_rssi_request.number_of_earfcns, out.lte_rssi_request.number_of_earfcns);
+
+	for(idx = 0; idx < out.lte_rssi_request.number_of_earfcns; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.lte_rssi_request.earfcn[idx], out.lte_rssi_request.earfcn[idx]);
+	}
+}
+
+void nfapi_test_rssi_request_lte2()
+{
+	uint16_t idx;
+	nfapi_rssi_request_t in;
+	nfapi_rssi_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RSSI_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_LTE;
+
+	in.lte_rssi_request.tl.tag = NFAPI_LTE_RSSI_REQUEST_TAG;
+	in.lte_rssi_request.frequency_band_indicator = 0;
+	in.lte_rssi_request.bandwidth = 0;
+	in.lte_rssi_request.timeout = 0;
+	in.lte_rssi_request.number_of_earfcns = 4;
+	in.lte_rssi_request.earfcn[0] = 42;
+
+	// try and pak with a buffer that is too small
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, NFAPI_HEADER_LENGTH + 4, 0);
+	CU_ASSERT_EQUAL(packedMessageLength, -1);
+
+	// pack correctly
+	packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	// unpack with a small bufer
+	int upack_result = nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength - 1, &out, sizeof(out), 0);
+
+	upack_result = nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_NOT_EQUAL(packedMessageLength, -1);
+	CU_ASSERT_NOT_EQUAL(packedMessageLength, 0);
+	CU_ASSERT_NOT_EQUAL(upack_result, 0);
+	CU_ASSERT_NOT_EQUAL(upack_result, -1);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.lte_rssi_request.frequency_band_indicator, out.lte_rssi_request.frequency_band_indicator);
+	CU_ASSERT_EQUAL(in.lte_rssi_request.bandwidth, out.lte_rssi_request.bandwidth);
+	CU_ASSERT_EQUAL(in.lte_rssi_request.timeout, out.lte_rssi_request.timeout);
+	CU_ASSERT_EQUAL(in.lte_rssi_request.number_of_earfcns, out.lte_rssi_request.number_of_earfcns);
+
+	for(idx = 0; idx < out.lte_rssi_request.number_of_earfcns; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.lte_rssi_request.earfcn[idx], out.lte_rssi_request.earfcn[idx]);
+	}
+}
+
+
+
+// Test decoding of message which has a large number if earfcn which could
+// cause a buffer over run if not handled
+void nfapi_test_rssi_request_lte_overrun()
+{
+	nfapi_rssi_request_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t* end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_RSSI_REQUEST, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push8(NFAPI_RAT_TYPE_LTE, &p, end);
+	push16(NFAPI_LTE_RSSI_REQUEST_TAG, &p, end);
+	push16(11, &p, end);
+
+	push8(0, &p, end);
+	push16(0, &p, end);
+	push8(0, &p, end);
+	push32(0, &p, end);
+	push8(123, &p, end); // to many EARFCN's
+	push16(16, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, sizeof(buffer), &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+
+void nfapi_test_rssi_request_lte_rat_type_mismatch()
+{
+	nfapi_rssi_request_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_RSSI_REQUEST, &p, end);
+	push16(16, &p, end);
+	push16(0, &p, end);
+
+	push8(NFAPI_RAT_TYPE_GERAN, &p, end);
+
+	push16(NFAPI_LTE_RSSI_REQUEST_TAG, &p, end);
+	push16(11, &p, end);
+
+	push8(0, &p, end);
+	push16(0, &p, end);
+	push8(0, &p, end);
+	push32(0, &p, end);
+	push8(1, &p, end);
+	push16(16, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, sizeof(buffer), &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+
+void nfapi_test_rssi_request_utran()
+{
+	uint16_t idx;
+	nfapi_rssi_request_t in;
+	nfapi_rssi_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RSSI_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_UTRAN;
+
+
+	in.utran_rssi_request.tl.tag = NFAPI_UTRAN_RSSI_REQUEST_TAG;
+	in.utran_rssi_request.frequency_band_indicator = 0;
+	in.utran_rssi_request.measurement_period = 0;
+	in.utran_rssi_request.timeout = 0;
+	in.utran_rssi_request.number_of_uarfcns = 3;
+	in.utran_rssi_request.uarfcn[0] = 42;
+	in.utran_rssi_request.uarfcn[1] = 42;
+	in.utran_rssi_request.uarfcn[2] = 42;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.utran_rssi_request.frequency_band_indicator, out.utran_rssi_request.frequency_band_indicator);
+	CU_ASSERT_EQUAL(in.utran_rssi_request.measurement_period, out.utran_rssi_request.measurement_period);
+	CU_ASSERT_EQUAL(in.utran_rssi_request.timeout, out.utran_rssi_request.timeout);
+	CU_ASSERT_EQUAL(in.utran_rssi_request.number_of_uarfcns, out.utran_rssi_request.number_of_uarfcns);
+
+	for(idx = 0; idx < out.utran_rssi_request.number_of_uarfcns; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.utran_rssi_request.uarfcn[idx], out.utran_rssi_request.uarfcn[idx]);
+	}
+
+}
+
+void nfapi_test_rssi_request_geran()
+{
+	uint16_t idx;
+	nfapi_rssi_request_t in;
+	nfapi_rssi_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RSSI_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_GERAN;
+
+	in.geran_rssi_request.tl.tag = NFAPI_GERAN_RSSI_REQUEST_TAG;
+	in.geran_rssi_request.frequency_band_indicator = 0;
+	in.geran_rssi_request.measurement_period = 0;
+	in.geran_rssi_request.timeout = 0;
+	in.geran_rssi_request.number_of_arfcns = 3;
+	in.geran_rssi_request.arfcn[0].arfcn = 42;
+	in.geran_rssi_request.arfcn[0].direction = 0;
+	in.geran_rssi_request.arfcn[1].arfcn = 42;
+	in.geran_rssi_request.arfcn[1].direction = 1;
+	in.geran_rssi_request.arfcn[2].arfcn = 42;
+	in.geran_rssi_request.arfcn[2].direction = 1;
+
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.geran_rssi_request.frequency_band_indicator, out.geran_rssi_request.frequency_band_indicator);
+	CU_ASSERT_EQUAL(in.geran_rssi_request.measurement_period, out.geran_rssi_request.measurement_period);
+	CU_ASSERT_EQUAL(in.geran_rssi_request.timeout, out.geran_rssi_request.timeout);
+	CU_ASSERT_EQUAL(in.geran_rssi_request.number_of_arfcns, out.geran_rssi_request.number_of_arfcns);
+
+	for(idx = 0; idx < out.geran_rssi_request.number_of_arfcns; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.geran_rssi_request.arfcn[idx].arfcn, out.geran_rssi_request.arfcn[idx].arfcn);
+		CU_ASSERT_EQUAL(in.geran_rssi_request.arfcn[idx].direction, out.geran_rssi_request.arfcn[idx].direction);
+	}
+}
+
+void nfapi_test_rssi_request_nb_iot()
+{
+	uint16_t idx, idx2;
+	nfapi_rssi_request_t in;
+	nfapi_rssi_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RSSI_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_NB_IOT;
+
+	in.nb_iot_rssi_request.tl.tag = NFAPI_NB_IOT_RSSI_REQUEST_TAG;
+	in.nb_iot_rssi_request.frequency_band_indicator = 34;
+	in.nb_iot_rssi_request.measurement_period = 900;
+	in.nb_iot_rssi_request.timeout = 4321;
+	in.nb_iot_rssi_request.number_of_earfcns = 3;
+	in.nb_iot_rssi_request.earfcn[0].earfcn = 42;
+	in.nb_iot_rssi_request.earfcn[0].number_of_ro_dl = 1;
+	in.nb_iot_rssi_request.earfcn[0].ro_dl[0] = 2;
+	in.nb_iot_rssi_request.earfcn[1].earfcn = 43;
+	in.nb_iot_rssi_request.earfcn[1].number_of_ro_dl = 0;
+	in.nb_iot_rssi_request.earfcn[2].earfcn = 44;
+	in.nb_iot_rssi_request.earfcn[2].number_of_ro_dl = 2;
+	in.nb_iot_rssi_request.earfcn[2].ro_dl[0] = 0;
+	in.nb_iot_rssi_request.earfcn[2].ro_dl[1] = 4;
+
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	IN_OUT_ASSERT(header.message_id);
+	IN_OUT_ASSERT(rat_type);
+	IN_OUT_ASSERT(nb_iot_rssi_request.frequency_band_indicator);
+	IN_OUT_ASSERT(nb_iot_rssi_request.measurement_period);
+	IN_OUT_ASSERT(nb_iot_rssi_request.timeout);
+	IN_OUT_ASSERT(nb_iot_rssi_request.number_of_earfcns);
+
+	for(idx = 0; idx < out.nb_iot_rssi_request.number_of_earfcns; ++idx)
+	{
+		IN_OUT_ASSERT(nb_iot_rssi_request.earfcn[idx].earfcn);
+		IN_OUT_ASSERT(nb_iot_rssi_request.earfcn[idx].number_of_ro_dl);
+		
+		for(idx2 = 0; idx2 < out.nb_iot_rssi_request.earfcn[idx].number_of_ro_dl; ++idx2)
+			IN_OUT_ASSERT(nb_iot_rssi_request.earfcn[idx].ro_dl[idx2]);
+	}
+}
+
+
+void nfapi_test_rssi_response()
+{
+	nfapi_rssi_response_t in;
+	nfapi_rssi_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RSSI_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+
+}
+
+void nfapi_test_rssi_indication()
+{
+	uint16_t idx = 0;
+	nfapi_rssi_indication_t in;
+	nfapi_rssi_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RSSI_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_OK;
+	in.rssi_indication_body.tl.tag = NFAPI_RSSI_INDICATION_TAG;
+	in.rssi_indication_body.tl.length = 0;
+	in.rssi_indication_body.number_of_rssi = 4;
+	in.rssi_indication_body.rssi[0] = 2;
+	in.rssi_indication_body.rssi[1] = 0;
+	in.rssi_indication_body.rssi[2] = -23;
+	in.rssi_indication_body.rssi[3] = -18000;
+
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.rssi_indication_body.tl.tag, out.rssi_indication_body.tl.tag);
+	CU_ASSERT_EQUAL(in.rssi_indication_body.number_of_rssi, out.rssi_indication_body.number_of_rssi);
+
+	for(idx = 0; idx < out.rssi_indication_body.number_of_rssi; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.rssi_indication_body.rssi[idx], out.rssi_indication_body.rssi[idx]);
+	}
+
+}
+void nfapi_test_rssi_indication_overrun()
+{
+	nfapi_rssi_indication_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_RSSI_INDICATION, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push32(0, &p, end); // error code
+
+	push16(NFAPI_RSSI_INDICATION_TAG, &p, end);
+	push16(11, &p, end);
+
+	push16(NFAPI_MAX_RSSI + 23, &p, end); // to many EARFCN's
+	push16(16, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, sizeof(buffer), &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+
+void nfapi_test_cell_search_request_lte()
+{
+	uint16_t idx;
+	nfapi_cell_search_request_t in;
+	nfapi_cell_search_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CELL_SEARCH_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_LTE;
+
+	in.lte_cell_search_request.tl.tag = NFAPI_LTE_CELL_SEARCH_REQUEST_TAG;
+	in.lte_cell_search_request.earfcn = 213;
+	in.lte_cell_search_request.measurement_bandwidth = 1;
+	in.lte_cell_search_request.exhaustive_search = 0;
+	in.lte_cell_search_request.timeout = 123;
+	in.lte_cell_search_request.number_of_pci = 3;
+	in.lte_cell_search_request.pci[0] = 3;
+	in.lte_cell_search_request.pci[1] = 6;
+	in.lte_cell_search_request.pci[2] = 9;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.lte_cell_search_request.earfcn, out.lte_cell_search_request.earfcn);
+	CU_ASSERT_EQUAL(in.lte_cell_search_request.measurement_bandwidth, out.lte_cell_search_request.measurement_bandwidth);
+	CU_ASSERT_EQUAL(in.lte_cell_search_request.exhaustive_search, out.lte_cell_search_request.exhaustive_search);
+	CU_ASSERT_EQUAL(in.lte_cell_search_request.timeout, out.lte_cell_search_request.timeout);
+	CU_ASSERT_EQUAL(in.lte_cell_search_request.number_of_pci, out.lte_cell_search_request.number_of_pci);
+
+	for(idx = 0; idx < out.lte_cell_search_request.number_of_pci; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.lte_cell_search_request.pci[idx], out.lte_cell_search_request.pci[idx]);
+	}
+}
+
+void nfapi_test_cell_search_request_utran()
+{
+	uint16_t idx;
+	nfapi_cell_search_request_t in;
+	nfapi_cell_search_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CELL_SEARCH_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_UTRAN;
+
+	in.utran_cell_search_request.tl.tag = NFAPI_UTRAN_CELL_SEARCH_REQUEST_TAG;
+	in.utran_cell_search_request.uarfcn = 213;
+	in.utran_cell_search_request.exhaustive_search = 0;
+	in.utran_cell_search_request.timeout = 123;
+	in.utran_cell_search_request.number_of_psc = 3;
+	in.utran_cell_search_request.psc[0] = 3;
+	in.utran_cell_search_request.psc[1] = 6;
+	in.utran_cell_search_request.psc[2] = 9;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	int unpackResult = nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_NOT_EQUAL(unpackResult, -1);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.utran_cell_search_request.uarfcn, out.utran_cell_search_request.uarfcn);
+	CU_ASSERT_EQUAL(in.utran_cell_search_request.exhaustive_search, out.utran_cell_search_request.exhaustive_search);
+	CU_ASSERT_EQUAL(in.utran_cell_search_request.timeout, out.utran_cell_search_request.timeout);
+	CU_ASSERT_EQUAL(in.utran_cell_search_request.number_of_psc, out.utran_cell_search_request.number_of_psc);
+
+	for(idx = 0; idx < out.utran_cell_search_request.number_of_psc; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.utran_cell_search_request.psc[idx], out.utran_cell_search_request.psc[idx]);
+	}
+}
+
+void nfapi_test_cell_search_request_geran()
+{
+	uint16_t idx;
+	nfapi_cell_search_request_t in;
+	nfapi_cell_search_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CELL_SEARCH_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_GERAN;
+
+	in.geran_cell_search_request.tl.tag = NFAPI_GERAN_CELL_SEARCH_REQUEST_TAG;
+	in.geran_cell_search_request.timeout = 123;
+	in.geran_cell_search_request.number_of_arfcn = 3;
+	in.geran_cell_search_request.arfcn[0] = 3;
+	in.geran_cell_search_request.arfcn[1] = 6;
+	in.geran_cell_search_request.arfcn[2] = 9;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	int unpackResult = nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_NOT_EQUAL(unpackResult, -1);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.geran_cell_search_request.timeout, out.geran_cell_search_request.timeout);
+	CU_ASSERT_EQUAL(in.geran_cell_search_request.number_of_arfcn, out.geran_cell_search_request.number_of_arfcn);
+
+	for(idx = 0; idx < out.geran_cell_search_request.number_of_arfcn; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.geran_cell_search_request.arfcn[idx], out.geran_cell_search_request.arfcn[idx]);
+	}
+}
+
+void nfapi_test_cell_search_request_nb_iot()
+{
+	uint16_t idx;
+	nfapi_cell_search_request_t in;
+	nfapi_cell_search_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CELL_SEARCH_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_NB_IOT;
+
+	in.nb_iot_cell_search_request.tl.tag = NFAPI_NB_IOT_CELL_SEARCH_REQUEST_TAG;
+	in.nb_iot_cell_search_request.earfcn = 54;
+	in.nb_iot_cell_search_request.ro_dl = 3;
+	in.nb_iot_cell_search_request.exhaustive_search = 1;
+	in.nb_iot_cell_search_request.timeout = 123;
+	in.nb_iot_cell_search_request.number_of_pci = 3;
+	in.nb_iot_cell_search_request.pci[0] = 3;
+	in.nb_iot_cell_search_request.pci[1] = 6;
+	in.nb_iot_cell_search_request.pci[2] = 9;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	int unpackResult = nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_NOT_EQUAL(unpackResult, -1);
+
+	IN_OUT_ASSERT(header.message_id);
+	IN_OUT_ASSERT(rat_type);
+	IN_OUT_ASSERT(nb_iot_cell_search_request.earfcn);
+	IN_OUT_ASSERT(nb_iot_cell_search_request.ro_dl);
+	IN_OUT_ASSERT(nb_iot_cell_search_request.exhaustive_search);
+	IN_OUT_ASSERT(nb_iot_cell_search_request.timeout);
+	IN_OUT_ASSERT(nb_iot_cell_search_request.number_of_pci);
+
+	for(idx = 0; idx < out.nb_iot_cell_search_request.number_of_pci; ++idx)
+	{
+		IN_OUT_ASSERT(nb_iot_cell_search_request.pci[idx]);
+	}
+}
+
+void nfapi_test_cell_search_response()
+{
+	nfapi_cell_search_response_t in;
+	nfapi_cell_search_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CELL_SEARCH_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+
+void nfapi_test_cell_search_indication_lte()
+{
+	uint16_t idx = 0;
+	nfapi_cell_search_indication_t in;
+	nfapi_cell_search_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CELL_SEARCH_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_OK;
+	in.lte_cell_search_indication.tl.tag = NFAPI_LTE_CELL_SEARCH_INDICATION_TAG;
+	in.lte_cell_search_indication.number_of_lte_cells_found = 2;
+	in.lte_cell_search_indication.lte_found_cells[0].pci = 0;
+	in.lte_cell_search_indication.lte_found_cells[0].rsrp = 42;
+	in.lte_cell_search_indication.lte_found_cells[0].rsrq= 11;
+	in.lte_cell_search_indication.lte_found_cells[0].frequency_offset = -100;
+
+	in.lte_cell_search_indication.lte_found_cells[1].pci = 123;
+	in.lte_cell_search_indication.lte_found_cells[1].rsrp = 2;
+	in.lte_cell_search_indication.lte_found_cells[1].rsrq= 17;
+	in.lte_cell_search_indication.lte_found_cells[1].frequency_offset = 123;
+
+	in.utran_cell_search_indication.tl.tag = 0;
+	in.geran_cell_search_indication.tl.tag = 0;
+	in.nb_iot_cell_search_indication.tl.tag = 0;
+	in.pnf_cell_search_state.tl.tag = 0;
+
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.lte_cell_search_indication.tl.tag, out.lte_cell_search_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.lte_cell_search_indication.number_of_lte_cells_found, out.lte_cell_search_indication.number_of_lte_cells_found);
+
+	for(idx = 0; idx < out.lte_cell_search_indication.number_of_lte_cells_found; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.lte_cell_search_indication.lte_found_cells[idx].pci, out.lte_cell_search_indication.lte_found_cells[idx].pci);
+		CU_ASSERT_EQUAL(in.lte_cell_search_indication.lte_found_cells[idx].rsrp, out.lte_cell_search_indication.lte_found_cells[idx].rsrp);
+		CU_ASSERT_EQUAL(in.lte_cell_search_indication.lte_found_cells[idx].rsrq, out.lte_cell_search_indication.lte_found_cells[idx].rsrq);
+		CU_ASSERT_EQUAL(in.lte_cell_search_indication.lte_found_cells[idx].frequency_offset, out.lte_cell_search_indication.lte_found_cells[idx].frequency_offset);
+	}
+
+
+	CU_ASSERT_EQUAL(in.utran_cell_search_indication.tl.tag, out.utran_cell_search_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.geran_cell_search_indication.tl.tag, out.geran_cell_search_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_cell_search_state.tl.tag, out.pnf_cell_search_state.tl.tag);
+}
+void nfapi_test_cell_search_indication_utran()
+{
+	uint16_t idx = 0;
+	nfapi_cell_search_indication_t in;
+	nfapi_cell_search_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CELL_SEARCH_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_OK;
+	in.utran_cell_search_indication.tl.tag = NFAPI_UTRAN_CELL_SEARCH_INDICATION_TAG;
+	in.utran_cell_search_indication.number_of_utran_cells_found = 1;
+	in.utran_cell_search_indication.utran_found_cells[0].psc = 123;
+	in.utran_cell_search_indication.utran_found_cells[0].rscp = 2;
+	in.utran_cell_search_indication.utran_found_cells[0].ecno = 89;
+	in.utran_cell_search_indication.utran_found_cells[0].frequency_offset = -1000;
+
+	in.lte_cell_search_indication.tl.tag = 0;
+	in.geran_cell_search_indication.tl.tag = 0;
+	in.nb_iot_cell_search_indication.tl.tag = 0;
+	in.pnf_cell_search_state.tl.tag = NFAPI_PNF_CELL_SEARCH_STATE_TAG;
+	in.pnf_cell_search_state.length = 12;
+	in.pnf_cell_search_state.value[0] = 34;
+	in.pnf_cell_search_state.value[1] = 35;
+	in.pnf_cell_search_state.value[2] = 36;
+	in.pnf_cell_search_state.value[3] = 37;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.utran_cell_search_indication.tl.tag, out.utran_cell_search_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.utran_cell_search_indication.number_of_utran_cells_found, out.utran_cell_search_indication.number_of_utran_cells_found);
+
+	for(idx = 0; idx < out.utran_cell_search_indication.number_of_utran_cells_found; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.utran_cell_search_indication.utran_found_cells[idx].psc, out.utran_cell_search_indication.utran_found_cells[idx].psc);
+		CU_ASSERT_EQUAL(in.utran_cell_search_indication.utran_found_cells[idx].rscp, out.utran_cell_search_indication.utran_found_cells[idx].rscp);
+		CU_ASSERT_EQUAL(in.utran_cell_search_indication.utran_found_cells[idx].ecno, out.utran_cell_search_indication.utran_found_cells[idx].ecno);
+		CU_ASSERT_EQUAL(in.utran_cell_search_indication.utran_found_cells[idx].frequency_offset, out.utran_cell_search_indication.utran_found_cells[idx].frequency_offset);
+	}
+
+	CU_ASSERT_EQUAL(in.lte_cell_search_indication.tl.tag, out.lte_cell_search_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.geran_cell_search_indication.tl.tag, out.geran_cell_search_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_cell_search_state.tl.tag, out.pnf_cell_search_state.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_cell_search_state.length, out.pnf_cell_search_state.length);
+
+	for(idx = 0; idx < out.pnf_cell_search_state.length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_cell_search_state.value[idx], out.pnf_cell_search_state.value[idx]);
+	}
+}
+void nfapi_test_cell_search_indication_geran()
+{
+	uint16_t idx = 0;
+	nfapi_cell_search_indication_t in;
+	nfapi_cell_search_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CELL_SEARCH_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_OK;
+	in.geran_cell_search_indication.tl.tag = NFAPI_GERAN_CELL_SEARCH_INDICATION_TAG;
+	in.geran_cell_search_indication.number_of_gsm_cells_found = 1;
+	in.geran_cell_search_indication.gsm_found_cells[0].arfcn = 123;
+	in.geran_cell_search_indication.gsm_found_cells[0].bsic = 2;
+	in.geran_cell_search_indication.gsm_found_cells[0].rxlev = 89;
+	in.geran_cell_search_indication.gsm_found_cells[0].rxqual = 12;
+	in.geran_cell_search_indication.gsm_found_cells[0].frequency_offset = 2389;
+	in.geran_cell_search_indication.gsm_found_cells[0].sfn_offset = 23;
+
+	in.lte_cell_search_indication.tl.tag = 0;
+	in.utran_cell_search_indication.tl.tag = 0;
+	in.nb_iot_cell_search_indication.tl.tag = 0;
+	in.pnf_cell_search_state.tl.tag = NFAPI_PNF_CELL_SEARCH_STATE_TAG;
+	in.pnf_cell_search_state.length = 63;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.geran_cell_search_indication.tl.tag, out.geran_cell_search_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.geran_cell_search_indication.number_of_gsm_cells_found, out.geran_cell_search_indication.number_of_gsm_cells_found);
+
+	for(idx = 0; idx < out.geran_cell_search_indication.number_of_gsm_cells_found; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.geran_cell_search_indication.gsm_found_cells[idx].arfcn, out.geran_cell_search_indication.gsm_found_cells[idx].arfcn);
+		CU_ASSERT_EQUAL(in.geran_cell_search_indication.gsm_found_cells[idx].bsic, out.geran_cell_search_indication.gsm_found_cells[idx].bsic);
+		CU_ASSERT_EQUAL(in.geran_cell_search_indication.gsm_found_cells[idx].rxlev, out.geran_cell_search_indication.gsm_found_cells[idx].rxlev);
+		CU_ASSERT_EQUAL(in.geran_cell_search_indication.gsm_found_cells[idx].rxqual, out.geran_cell_search_indication.gsm_found_cells[idx].rxqual);
+		CU_ASSERT_EQUAL(in.geran_cell_search_indication.gsm_found_cells[idx].frequency_offset, out.geran_cell_search_indication.gsm_found_cells[idx].frequency_offset);
+		CU_ASSERT_EQUAL(in.geran_cell_search_indication.gsm_found_cells[idx].sfn_offset, out.geran_cell_search_indication.gsm_found_cells[idx].sfn_offset);
+	}
+
+	CU_ASSERT_EQUAL(in.lte_cell_search_indication.tl.tag, out.lte_cell_search_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.utran_cell_search_indication.tl.tag, out.utran_cell_search_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.nb_iot_cell_search_indication.tl.tag, out.nb_iot_cell_search_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_cell_search_state.tl.tag, out.pnf_cell_search_state.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_cell_search_state.length, out.pnf_cell_search_state.length);
+
+	for(idx = 0; idx < out.pnf_cell_search_state.length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_cell_search_state.value[idx], out.pnf_cell_search_state.value[idx]);
+	}
+}
+
+void nfapi_test_cell_search_indication_nb_iot()
+{
+	uint16_t idx = 0;
+	nfapi_cell_search_indication_t in;
+	nfapi_cell_search_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CELL_SEARCH_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_OK;
+	in.nb_iot_cell_search_indication.tl.tag = NFAPI_NB_IOT_CELL_SEARCH_INDICATION_TAG;
+	in.nb_iot_cell_search_indication.number_of_nb_iot_cells_found = 1;
+	in.nb_iot_cell_search_indication.nb_iot_found_cells[0].pci = 123;
+	in.nb_iot_cell_search_indication.nb_iot_found_cells[0].rsrp = 2;
+	in.nb_iot_cell_search_indication.nb_iot_found_cells[0].rsrq = 89;
+	in.nb_iot_cell_search_indication.nb_iot_found_cells[0].frequency_offset = 2389;
+
+	in.lte_cell_search_indication.tl.tag = 0;
+	in.utran_cell_search_indication.tl.tag = 0;
+	in.geran_cell_search_indication.tl.tag = 0;
+	
+	in.pnf_cell_search_state.tl.tag = NFAPI_PNF_CELL_SEARCH_STATE_TAG;
+	in.pnf_cell_search_state.length = 63;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	IN_OUT_ASSERT(header.message_id);
+	IN_OUT_ASSERT(error_code);
+	IN_OUT_ASSERT(nb_iot_cell_search_indication.tl.tag);
+	IN_OUT_ASSERT(nb_iot_cell_search_indication.number_of_nb_iot_cells_found);
+
+	for(idx = 0; idx < out.nb_iot_cell_search_indication.number_of_nb_iot_cells_found; ++idx)
+	{
+		IN_OUT_ASSERT(nb_iot_cell_search_indication.nb_iot_found_cells[idx].pci);
+		IN_OUT_ASSERT(nb_iot_cell_search_indication.nb_iot_found_cells[idx].rsrp);
+		IN_OUT_ASSERT(nb_iot_cell_search_indication.nb_iot_found_cells[idx].rsrq);
+		IN_OUT_ASSERT(nb_iot_cell_search_indication.nb_iot_found_cells[idx].frequency_offset);
+	}
+
+	IN_OUT_ASSERT(lte_cell_search_indication.tl.tag);
+	IN_OUT_ASSERT(utran_cell_search_indication.tl.tag);
+	IN_OUT_ASSERT(geran_cell_search_indication.tl.tag);
+	IN_OUT_ASSERT(pnf_cell_search_state.tl.tag);
+	IN_OUT_ASSERT(pnf_cell_search_state.length);
+	
+	for(idx = 0; idx < out.pnf_cell_search_state.length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_cell_search_state.value[idx], out.pnf_cell_search_state.value[idx]);
+	}
+}
+
+void nfapi_test_cell_search_request_lte_overrun()
+{
+	nfapi_cell_search_request_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_CELL_SEARCH_REQUEST, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push8(0, &p, end); // rat_type
+
+	push16(NFAPI_LTE_CELL_SEARCH_REQUEST_TAG, &p, end);
+	push16(8, &p, end);
+
+	push16(11, &p, end);
+	push8(11, &p, end);
+	push8(11, &p, end);
+	push32(11, &p, end);
+	push8(NFAPI_MAX_PCI_LIST + 1, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+
+}
+void nfapi_test_cell_search_request_utran_overrun()
+{
+	nfapi_cell_search_request_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_CELL_SEARCH_REQUEST, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push8(NFAPI_RAT_TYPE_UTRAN, &p, end); // rat_type
+
+	push16(NFAPI_UTRAN_CELL_SEARCH_REQUEST_TAG, &p, end);
+	push16(8, &p, end);
+
+	push16(11, &p, end);
+	push8(11, &p, end);
+	push32(11, &p, end);
+	push8(NFAPI_MAX_PSC_LIST + 1, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_cell_search_request_geran_overrun()
+{
+	nfapi_cell_search_request_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_CELL_SEARCH_REQUEST, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push8(NFAPI_RAT_TYPE_GERAN, &p, end); // rat_type
+
+	push16(NFAPI_GERAN_CELL_SEARCH_REQUEST_TAG, &p, end);
+	push16(8, &p, end);
+
+	push32(11, &p, end);
+	push8(NFAPI_MAX_ARFCN_LIST + 1, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_cell_search_indication_lte_overrun()
+{
+	nfapi_cell_search_indication_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_CELL_SEARCH_INDICATION, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push32(0, &p, end); // error_code
+
+	push16(NFAPI_LTE_CELL_SEARCH_INDICATION_TAG, &p, end);
+	push16(8, &p, end);
+
+	push16(NFAPI_MAX_LTE_CELLS_FOUND + 1, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_cell_search_indication_utran_overrun()
+{
+	nfapi_cell_search_indication_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_CELL_SEARCH_INDICATION, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push32(0, &p, end); // error_code
+
+	push16(NFAPI_UTRAN_CELL_SEARCH_INDICATION_TAG, &p, end);
+	push16(8, &p, end);
+
+	push16(NFAPI_MAX_UTRAN_CELLS_FOUND + 1, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_cell_search_indication_geran_overrun()
+{
+	nfapi_cell_search_indication_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_CELL_SEARCH_INDICATION, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push32(0, &p, end); // error_code
+
+	push16(NFAPI_GERAN_CELL_SEARCH_INDICATION_TAG, &p, end);
+	push16(8, &p, end);
+
+	push16(NFAPI_MAX_GSM_CELLS_FOUND + 1, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_cell_search_indication_state_overrun()
+{
+	nfapi_cell_search_indication_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_CELL_SEARCH_INDICATION, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push32(0, &p, end); // error_code
+
+	push16(NFAPI_GERAN_CELL_SEARCH_INDICATION_TAG, &p, end);
+	push16(13, &p, end);
+
+	push16(1, &p, end);
+	if(1)
+	{
+		push16(42, &p, end);
+		push8(42, &p, end);
+		push8(42, &p, end);
+		push8(42, &p, end);
+		pushs16(42, &p, end);
+		push32(42, &p, end);
+	}
+
+	push16(NFAPI_PNF_CELL_SEARCH_STATE_TAG, &p, end);
+	push16(NFAPI_MAX_OPAQUE_DATA + 12, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_broadcast_detect_request_lte()
+{
+	nfapi_broadcast_detect_request_t in;
+	nfapi_broadcast_detect_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_BROADCAST_DETECT_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_LTE;
+
+	in.lte_broadcast_detect_request.tl.tag = NFAPI_LTE_BROADCAST_DETECT_REQUEST_TAG;
+	in.lte_broadcast_detect_request.earfcn = 123;
+	in.lte_broadcast_detect_request.pci = 12;
+	in.lte_broadcast_detect_request.timeout = 1246;
+
+	in.pnf_cell_search_state.tl.tag = 0;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	int unpackResult = nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_NOT_EQUAL(unpackResult, -1);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.lte_broadcast_detect_request.earfcn, out.lte_broadcast_detect_request.earfcn);
+	CU_ASSERT_EQUAL(in.lte_broadcast_detect_request.pci, out.lte_broadcast_detect_request.pci);
+	CU_ASSERT_EQUAL(in.lte_broadcast_detect_request.timeout, out.lte_broadcast_detect_request.timeout);
+
+}
+void nfapi_test_broadcast_detect_request_utran()
+{
+	uint16_t idx;
+	nfapi_broadcast_detect_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_broadcast_detect_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_BROADCAST_DETECT_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_UTRAN;
+
+	in.utran_broadcast_detect_request.tl.tag = NFAPI_UTRAN_BROADCAST_DETECT_REQUEST_TAG;
+	in.utran_broadcast_detect_request.uarfcn = 123;
+	in.utran_broadcast_detect_request.psc = 12;
+	in.utran_broadcast_detect_request.timeout = 1246;
+
+	in.pnf_cell_search_state.tl.tag = NFAPI_PNF_CELL_SEARCH_STATE_TAG;
+	in.pnf_cell_search_state.length = 60;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+	CU_ASSERT_NOT_EQUAL(packedMessageLength, 0);
+	CU_ASSERT_NOT_EQUAL(packedMessageLength, -1);
+
+	int unpackResult = nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_NOT_EQUAL(unpackResult, 0);
+	CU_ASSERT_NOT_EQUAL(unpackResult, -1);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.utran_broadcast_detect_request.uarfcn, out.utran_broadcast_detect_request.uarfcn);
+	CU_ASSERT_EQUAL(in.utran_broadcast_detect_request.psc, out.utran_broadcast_detect_request.psc);
+	CU_ASSERT_EQUAL(in.utran_broadcast_detect_request.timeout, out.utran_broadcast_detect_request.timeout);
+
+	CU_ASSERT_EQUAL(in.pnf_cell_search_state.length, out.pnf_cell_search_state.length);
+
+	for(idx = 0; idx < out.pnf_cell_search_state.length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_cell_search_state.value[idx], out.pnf_cell_search_state.value[idx]);
+	}
+
+}
+
+void nfapi_test_broadcast_detect_request_nb_iot()
+{
+	uint16_t idx;
+	nfapi_broadcast_detect_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_broadcast_detect_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_BROADCAST_DETECT_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_NB_IOT;
+
+	in.nb_iot_broadcast_detect_request.tl.tag = NFAPI_NB_IOT_BROADCAST_DETECT_REQUEST_TAG;
+	in.nb_iot_broadcast_detect_request.earfcn = 123;
+	in.nb_iot_broadcast_detect_request.ro_dl = 12;
+	in.nb_iot_broadcast_detect_request.pci = 12;
+	in.nb_iot_broadcast_detect_request.timeout = 1246;
+
+	in.pnf_cell_search_state.tl.tag = NFAPI_PNF_CELL_SEARCH_STATE_TAG;
+	in.pnf_cell_search_state.length = 60;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+	CU_ASSERT_NOT_EQUAL(packedMessageLength, 0);
+	CU_ASSERT_NOT_EQUAL(packedMessageLength, -1);
+
+	int unpackResult = nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_NOT_EQUAL(unpackResult, 0);
+	CU_ASSERT_NOT_EQUAL(unpackResult, -1);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.nb_iot_broadcast_detect_request.earfcn, out.nb_iot_broadcast_detect_request.earfcn);
+	CU_ASSERT_EQUAL(in.nb_iot_broadcast_detect_request.ro_dl, out.nb_iot_broadcast_detect_request.ro_dl);
+	CU_ASSERT_EQUAL(in.nb_iot_broadcast_detect_request.pci, out.nb_iot_broadcast_detect_request.pci);
+	CU_ASSERT_EQUAL(in.nb_iot_broadcast_detect_request.timeout, out.nb_iot_broadcast_detect_request.timeout);
+
+	CU_ASSERT_EQUAL(in.pnf_cell_search_state.length, out.pnf_cell_search_state.length);
+
+	for(idx = 0; idx < out.pnf_cell_search_state.length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_cell_search_state.value[idx], out.pnf_cell_search_state.value[idx]);
+	}
+
+}
+
+
+void nfapi_test_broadcast_detect_request_state_overrun()
+{
+	nfapi_broadcast_detect_request_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_BROADCAST_DETECT_REQUEST, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push8(NFAPI_RAT_TYPE_UTRAN, &p, end); // error_code
+
+	push16(NFAPI_UTRAN_BROADCAST_DETECT_REQUEST_TAG, &p, end);
+	push16(8, &p, end);
+
+	push16(42, &p, end);
+	push16(42, &p, end);
+	push32(42, &p, end);
+
+	push16(NFAPI_PNF_CELL_SEARCH_STATE_TAG, &p, end);
+	push16(NFAPI_MAX_OPAQUE_DATA + 12, &p, end);
+
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+
+void nfapi_test_broadcast_detect_response()
+{
+	nfapi_broadcast_detect_response_t in;
+	nfapi_broadcast_detect_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_BROADCAST_DETECT_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+
+}
+void nfapi_test_broadcast_detect_indication_lte()
+{
+	uint16_t idx;
+	nfapi_broadcast_detect_indication_t in;
+	nfapi_broadcast_detect_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_BROADCAST_DETECT_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+
+	in.lte_broadcast_detect_indication.tl.tag = NFAPI_LTE_BROADCAST_DETECT_INDICATION_TAG;
+	in.lte_broadcast_detect_indication.number_of_tx_antenna = 1;
+	in.lte_broadcast_detect_indication.mib_length = 8;
+	in.lte_broadcast_detect_indication.sfn_offset = 4;
+	in.utran_broadcast_detect_indication.tl.tag = 0;
+	in.pnf_cell_broadcast_state.tl.tag = NFAPI_PNF_CELL_BROADCAST_STATE_TAG;
+	in.pnf_cell_broadcast_state.length = 23;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.lte_broadcast_detect_indication.tl.tag, out.lte_broadcast_detect_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.lte_broadcast_detect_indication.number_of_tx_antenna, out.lte_broadcast_detect_indication.number_of_tx_antenna);
+	CU_ASSERT_EQUAL(in.lte_broadcast_detect_indication.mib_length, out.lte_broadcast_detect_indication.mib_length);
+	for(idx = 0; idx < out.lte_broadcast_detect_indication.mib_length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.lte_broadcast_detect_indication.mib[idx], out.lte_broadcast_detect_indication.mib[idx]);
+	}
+	CU_ASSERT_EQUAL(in.lte_broadcast_detect_indication.sfn_offset, out.lte_broadcast_detect_indication.sfn_offset);
+
+
+	CU_ASSERT_EQUAL(in.utran_broadcast_detect_indication.tl.tag, out.utran_broadcast_detect_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.tl.tag, out.pnf_cell_broadcast_state.tl.tag);
+	for(idx = 0; idx < out.pnf_cell_broadcast_state.length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.value[idx], out.pnf_cell_broadcast_state.value[idx]);
+	}
+}
+void nfapi_test_broadcast_detect_indication_lte_overrun()
+{
+	nfapi_broadcast_detect_indication_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_BROADCAST_DETECT_INDICATION, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push32(0, &p, end); // error_code
+
+	push16(NFAPI_LTE_BROADCAST_DETECT_INDICATION_TAG, &p, end);
+	push16(8, &p, end);
+
+	push8(1, &p, end);
+	push16(NFAPI_MAX_MIB_LENGTH + 1, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out) ,0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_broadcast_detect_indication_utran()
+{
+	uint16_t idx;
+	nfapi_broadcast_detect_indication_t in;
+	nfapi_broadcast_detect_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_BROADCAST_DETECT_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+
+	in.lte_broadcast_detect_indication.tl.tag = 0;
+	in.utran_broadcast_detect_indication.tl.tag = NFAPI_UTRAN_BROADCAST_DETECT_INDICATION_TAG;
+	in.utran_broadcast_detect_indication.mib_length = 16;
+	in.utran_broadcast_detect_indication.sfn_offset = 4;
+	in.pnf_cell_broadcast_state.tl.tag = 0;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.lte_broadcast_detect_indication.tl.tag, out.lte_broadcast_detect_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.utran_broadcast_detect_indication.tl.tag, out.utran_broadcast_detect_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.utran_broadcast_detect_indication.mib_length, out.utran_broadcast_detect_indication.mib_length);
+	for(idx = 0; idx < out.utran_broadcast_detect_indication.mib_length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.utran_broadcast_detect_indication.mib[idx], out.utran_broadcast_detect_indication.mib[idx]);
+	}
+	CU_ASSERT_EQUAL(in.utran_broadcast_detect_indication.sfn_offset, out.utran_broadcast_detect_indication.sfn_offset);
+
+
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.tl.tag, out.pnf_cell_broadcast_state.tl.tag);
+}
+void nfapi_test_broadcast_detect_indication_nb_iot()
+{
+	uint16_t idx;
+	nfapi_broadcast_detect_indication_t in;
+	nfapi_broadcast_detect_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_BROADCAST_DETECT_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+
+	in.lte_broadcast_detect_indication.tl.tag = 0;
+	in.utran_broadcast_detect_indication.tl.tag = 0;
+	in.nb_iot_broadcast_detect_indication.tl.tag = NFAPI_NB_IOT_BROADCAST_DETECT_INDICATION_TAG;
+	in.nb_iot_broadcast_detect_indication.number_of_tx_antenna = 2;
+	in.nb_iot_broadcast_detect_indication.mib_length = 16;
+	in.nb_iot_broadcast_detect_indication.sfn_offset = 4;
+	in.pnf_cell_broadcast_state.tl.tag = 0;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.lte_broadcast_detect_indication.tl.tag, out.lte_broadcast_detect_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.utran_broadcast_detect_indication.tl.tag, out.utran_broadcast_detect_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.nb_iot_broadcast_detect_indication.tl.tag, out.nb_iot_broadcast_detect_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.nb_iot_broadcast_detect_indication.number_of_tx_antenna, out.nb_iot_broadcast_detect_indication.number_of_tx_antenna);
+	CU_ASSERT_EQUAL(in.nb_iot_broadcast_detect_indication.mib_length, out.nb_iot_broadcast_detect_indication.mib_length);
+	for(idx = 0; idx < out.nb_iot_broadcast_detect_indication.mib_length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nb_iot_broadcast_detect_indication.mib[idx], out.nb_iot_broadcast_detect_indication.mib[idx]);
+	}
+	CU_ASSERT_EQUAL(in.nb_iot_broadcast_detect_indication.sfn_offset, out.nb_iot_broadcast_detect_indication.sfn_offset);
+
+
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.tl.tag, out.pnf_cell_broadcast_state.tl.tag);
+}
+void nfapi_test_broadcast_detect_indication_utran_overrun()
+{
+	nfapi_broadcast_detect_indication_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_BROADCAST_DETECT_INDICATION, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push32(0, &p, end); // error_code
+
+	push16(NFAPI_UTRAN_BROADCAST_DETECT_INDICATION_TAG, &p, end);
+	push16(8, &p, end);
+
+	push16(NFAPI_MAX_MIB_LENGTH + 1, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_broadcast_detect_indication_state_overrun()
+{
+}
+void nfapi_test_system_information_schedule_request_lte()
+{
+	uint16_t idx;
+	nfapi_system_information_schedule_request_t in;
+	nfapi_system_information_schedule_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_LTE;
+
+	in.nb_iot_system_information_schedule_request.tl.tag = 0;
+
+	in.lte_system_information_schedule_request.tl.tag = NFAPI_LTE_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG;
+	in.lte_system_information_schedule_request.earfcn = 16;
+	in.lte_system_information_schedule_request.pci = 4;
+	in.lte_system_information_schedule_request.downlink_channel_bandwidth = 20;
+	in.lte_system_information_schedule_request.phich_configuration = 1;
+	in.lte_system_information_schedule_request.number_of_tx_antenna = 2;
+	in.lte_system_information_schedule_request.retry_count = 4;
+	in.lte_system_information_schedule_request.timeout = 0;
+	in.pnf_cell_broadcast_state.tl.tag = NFAPI_PNF_CELL_BROADCAST_STATE_TAG;
+	in.pnf_cell_broadcast_state.length = 7;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.lte_system_information_schedule_request.tl.tag, out.lte_system_information_schedule_request.tl.tag);
+	CU_ASSERT_EQUAL(in.lte_system_information_schedule_request.earfcn, out.lte_system_information_schedule_request.earfcn);
+	CU_ASSERT_EQUAL(in.lte_system_information_schedule_request.pci, out.lte_system_information_schedule_request.pci);
+	CU_ASSERT_EQUAL(in.lte_system_information_schedule_request.downlink_channel_bandwidth, out.lte_system_information_schedule_request.downlink_channel_bandwidth);
+	CU_ASSERT_EQUAL(in.lte_system_information_schedule_request.downlink_channel_bandwidth, out.lte_system_information_schedule_request.downlink_channel_bandwidth);
+	CU_ASSERT_EQUAL(in.lte_system_information_schedule_request.number_of_tx_antenna, out.lte_system_information_schedule_request.number_of_tx_antenna);
+	CU_ASSERT_EQUAL(in.lte_system_information_schedule_request.retry_count, out.lte_system_information_schedule_request.retry_count);
+	CU_ASSERT_EQUAL(in.lte_system_information_schedule_request.timeout, out.lte_system_information_schedule_request.timeout);
+
+
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.tl.tag, out.pnf_cell_broadcast_state.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.length, out.pnf_cell_broadcast_state.length);
+	for(idx = 0; idx < out.pnf_cell_broadcast_state.length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.value[idx], out.pnf_cell_broadcast_state.value[idx]);
+	}
+}
+
+void nfapi_test_system_information_schedule_request_nb_iot()
+{
+	uint16_t idx;
+	nfapi_system_information_schedule_request_t in;
+	nfapi_system_information_schedule_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_NB_IOT;
+
+	in.lte_system_information_schedule_request.tl.tag = 0;
+	in.nb_iot_system_information_schedule_request.tl.tag = NFAPI_NB_IOT_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG;
+	in.nb_iot_system_information_schedule_request.earfcn = 16;
+	in.nb_iot_system_information_schedule_request.ro_dl = 4;
+	in.nb_iot_system_information_schedule_request.pci = 4;
+	in.nb_iot_system_information_schedule_request.scheduling_info_sib1_nb = 4;
+	in.nb_iot_system_information_schedule_request.timeout = 0;
+	in.pnf_cell_broadcast_state.tl.tag = NFAPI_PNF_CELL_BROADCAST_STATE_TAG;
+	in.pnf_cell_broadcast_state.length = 7;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.lte_system_information_schedule_request.tl.tag, out.lte_system_information_schedule_request.tl.tag);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_schedule_request.tl.tag, out.nb_iot_system_information_schedule_request.tl.tag);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_schedule_request.earfcn, out.nb_iot_system_information_schedule_request.earfcn);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_schedule_request.ro_dl, out.nb_iot_system_information_schedule_request.ro_dl);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_schedule_request.pci, out.nb_iot_system_information_schedule_request.pci);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_schedule_request.scheduling_info_sib1_nb, out.nb_iot_system_information_schedule_request.scheduling_info_sib1_nb);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_schedule_request.timeout, out.nb_iot_system_information_schedule_request.timeout);
+
+
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.tl.tag, out.pnf_cell_broadcast_state.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.length, out.pnf_cell_broadcast_state.length);
+	for(idx = 0; idx < out.pnf_cell_broadcast_state.length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.value[idx], out.pnf_cell_broadcast_state.value[idx]);
+	}
+}
+
+void nfapi_test_system_information_schedule_request_state_overrun()
+{
+	nfapi_system_information_schedule_request_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push8(0, &p, end); // rat type
+
+	push16(NFAPI_LTE_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG, &p, end);
+	push16(13, &p, end);
+
+	push16(1, &p, end);
+	push16(1, &p, end);
+	push16(1, &p, end);
+	push8(142, &p, end);
+	push8(142, &p, end);
+	push8(142, &p, end);
+	push32(42, &p, end);
+
+	push16(NFAPI_PNF_CELL_BROADCAST_STATE_TAG, &p, end);
+	push16(NFAPI_MAX_OPAQUE_DATA + 1, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+
+}
+void nfapi_test_system_information_schedule_response()
+{
+	nfapi_system_information_schedule_response_t in;
+	nfapi_system_information_schedule_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+void nfapi_test_system_information_schedule_indication_lte()
+{
+	uint16_t idx;
+	nfapi_system_information_schedule_indication_t in;
+	nfapi_system_information_schedule_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = 0;
+
+	in.nb_iot_system_information_indication.tl.tag = 0;
+	in.lte_system_information_indication.tl.tag = NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG;
+	in.lte_system_information_indication.sib_type = 16;
+	in.lte_system_information_indication.sib_length = 4;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.lte_system_information_indication.tl.tag, out.lte_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.lte_system_information_indication.sib_type, out.lte_system_information_indication.sib_type);
+	CU_ASSERT_EQUAL(in.lte_system_information_indication.sib_length, out.lte_system_information_indication.sib_length);
+
+	for(idx = 0; idx < out.lte_system_information_indication.sib_length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.lte_system_information_indication.sib[idx], out.lte_system_information_indication.sib[idx]);
+	}
+}
+void nfapi_test_system_information_schedule_indication_nb_iot()
+{
+	uint16_t idx;
+	nfapi_system_information_schedule_indication_t in;
+	nfapi_system_information_schedule_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = 0;
+
+	in.lte_system_information_indication.tl.tag = 0;
+	in.nb_iot_system_information_indication.tl.tag = NFAPI_NB_IOT_SYSTEM_INFORMATION_INDICATION_TAG;
+	in.nb_iot_system_information_indication.sib_type = 16;
+	in.nb_iot_system_information_indication.sib_length = 4;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.lte_system_information_indication.tl.tag, out.lte_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_indication.tl.tag, out.nb_iot_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_indication.sib_type, out.nb_iot_system_information_indication.sib_type);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_indication.sib_length, out.nb_iot_system_information_indication.sib_length);
+
+	for(idx = 0; idx < out.nb_iot_system_information_indication.sib_length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nb_iot_system_information_indication.sib[idx], out.nb_iot_system_information_indication.sib[idx]);
+	}
+}
+void nfapi_test_system_information_request_lte()
+{
+	uint16_t idx;
+	nfapi_system_information_request_t in;
+	nfapi_system_information_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_LTE;
+
+	in.lte_system_information_request.tl.tag = NFAPI_LTE_SYSTEM_INFORMATION_REQUEST_TAG;
+	in.lte_system_information_request.earfcn = 16;
+	in.lte_system_information_request.pci = 4;
+	in.lte_system_information_request.downlink_channel_bandwidth = 20;
+	in.lte_system_information_request.phich_configuration = 1;
+	in.lte_system_information_request.number_of_tx_antenna = 2;
+	in.lte_system_information_request.number_of_si_periodicity = 1;
+	in.lte_system_information_request.si_periodicity[0].si_periodicity = 3;
+	in.lte_system_information_request.si_periodicity[0].si_index = 0;
+	in.lte_system_information_request.si_window_length = 0;
+	in.lte_system_information_request.timeout = 2000;
+
+	in.pnf_cell_broadcast_state.tl.tag = NFAPI_PNF_CELL_BROADCAST_STATE_TAG;
+	in.pnf_cell_broadcast_state.length = 7;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.lte_system_information_request.tl.tag, out.lte_system_information_request.tl.tag);
+	CU_ASSERT_EQUAL(in.lte_system_information_request.earfcn, out.lte_system_information_request.earfcn);
+	CU_ASSERT_EQUAL(in.lte_system_information_request.pci, out.lte_system_information_request.pci);
+	CU_ASSERT_EQUAL(in.lte_system_information_request.downlink_channel_bandwidth, out.lte_system_information_request.downlink_channel_bandwidth);
+	CU_ASSERT_EQUAL(in.lte_system_information_request.downlink_channel_bandwidth, out.lte_system_information_request.downlink_channel_bandwidth);
+	CU_ASSERT_EQUAL(in.lte_system_information_request.number_of_tx_antenna, out.lte_system_information_request.number_of_tx_antenna);
+	CU_ASSERT_EQUAL(in.lte_system_information_request.number_of_si_periodicity, out.lte_system_information_request.number_of_si_periodicity);
+	for(idx = 0; idx < in.lte_system_information_request.number_of_si_periodicity; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.lte_system_information_request.si_periodicity[idx].si_periodicity, out.lte_system_information_request.si_periodicity[idx].si_periodicity);
+		CU_ASSERT_EQUAL(in.lte_system_information_request.si_periodicity[idx].si_index, out.lte_system_information_request.si_periodicity[idx].si_index);
+	}
+
+	CU_ASSERT_EQUAL(in.lte_system_information_request.si_window_length, out.lte_system_information_request.si_window_length);
+	CU_ASSERT_EQUAL(in.lte_system_information_request.timeout, out.lte_system_information_request.timeout);
+
+
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.tl.tag, out.pnf_cell_broadcast_state.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.length, out.pnf_cell_broadcast_state.length);
+	for(idx = 0; idx < out.pnf_cell_broadcast_state.length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.value[idx], out.pnf_cell_broadcast_state.value[idx]);
+	}
+}
+void nfapi_test_system_information_request_lte_overrun()
+{
+	nfapi_system_information_request_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_SYSTEM_INFORMATION_REQUEST, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push8(NFAPI_RAT_TYPE_LTE, &p, end); 
+
+	push16(NFAPI_LTE_SYSTEM_INFORMATION_REQUEST_TAG, &p, end);
+	push16(8, &p, end);
+
+	push16(8, &p, end);
+	push16(8, &p, end);
+	push16(8, &p, end);
+	push8(8, &p, end);
+	push8(8, &p, end);
+	push8(NFAPI_MAX_SI_PERIODICITY + 1, &p, end);
+
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_system_information_request_utran()
+{
+	nfapi_system_information_request_t in;
+	nfapi_system_information_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_UTRAN;
+
+	in.utran_system_information_request.tl.tag = NFAPI_UTRAN_SYSTEM_INFORMATION_REQUEST_TAG;
+	in.utran_system_information_request.uarfcn = 16;
+	in.utran_system_information_request.psc = 4;
+	in.utran_system_information_request.timeout = 2000;
+
+	in.pnf_cell_broadcast_state.tl.tag = 0;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.utran_system_information_request.tl.tag, out.utran_system_information_request.tl.tag);
+	CU_ASSERT_EQUAL(in.utran_system_information_request.uarfcn, out.utran_system_information_request.uarfcn);
+	CU_ASSERT_EQUAL(in.utran_system_information_request.psc, out.utran_system_information_request.psc);
+	CU_ASSERT_EQUAL(in.utran_system_information_request.timeout, out.utran_system_information_request.timeout);
+
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.tl.tag, out.pnf_cell_broadcast_state.tl.tag);
+}
+void nfapi_test_system_information_request_geran()
+{
+	nfapi_system_information_request_t in;
+	nfapi_system_information_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_GERAN;
+
+	in.geran_system_information_request.tl.tag = NFAPI_GERAN_SYSTEM_INFORMATION_REQUEST_TAG;
+	in.geran_system_information_request.arfcn = 16;
+	in.geran_system_information_request.bsic = 4;
+	in.geran_system_information_request.timeout = 2000;
+
+	in.pnf_cell_broadcast_state.tl.tag = 0;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rat_type, out.rat_type);
+	CU_ASSERT_EQUAL(in.geran_system_information_request.tl.tag, out.geran_system_information_request.tl.tag);
+	CU_ASSERT_EQUAL(in.geran_system_information_request.arfcn, out.geran_system_information_request.arfcn);
+	CU_ASSERT_EQUAL(in.geran_system_information_request.bsic, out.geran_system_information_request.bsic);
+	CU_ASSERT_EQUAL(in.geran_system_information_request.timeout, out.geran_system_information_request.timeout);
+
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.tl.tag, out.pnf_cell_broadcast_state.tl.tag);
+}
+void nfapi_test_system_information_request_state_overrun()
+{
+	nfapi_system_information_request_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_SYSTEM_INFORMATION_REQUEST, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push8(NFAPI_RAT_TYPE_LTE, &p, end); 
+
+	push16(NFAPI_LTE_SYSTEM_INFORMATION_REQUEST_TAG, &p, end);
+	push16(16, &p, end);
+
+	push16(8, &p, end);
+	push16(8, &p, end);
+	push16(8, &p, end);
+	push8(8, &p, end);
+	push8(8, &p, end);
+	push8(1, &p, end);
+	{
+		push8(1, &p, end);
+		push8(1, &p, end);
+	}
+	push8(1, &p, end);
+	push32(1, &p, end);
+
+	push16(NFAPI_PNF_CELL_BROADCAST_STATE_TAG, &p, end);
+	push16(NFAPI_MAX_OPAQUE_DATA + 1, &p, end);
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+
+void nfapi_test_system_information_request_nb_iot()
+{
+	uint16_t idx, idx2;
+	nfapi_system_information_request_t in;
+	nfapi_system_information_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.rat_type = NFAPI_RAT_TYPE_NB_IOT;
+
+	in.nb_iot_system_information_request.tl.tag = NFAPI_NB_IOT_SYSTEM_INFORMATION_REQUEST_TAG;
+	in.nb_iot_system_information_request.earfcn = 16;
+	in.nb_iot_system_information_request.ro_dl = 1;
+	in.nb_iot_system_information_request.pci = 4;
+	in.nb_iot_system_information_request.number_of_si_periodicity = 1;
+	in.nb_iot_system_information_request.si_periodicity[0].si_periodicity = 3;
+	in.nb_iot_system_information_request.si_periodicity[0].si_repetition_pattern = 0;
+	in.nb_iot_system_information_request.si_periodicity[0].si_tb_size = 0;
+	in.nb_iot_system_information_request.si_periodicity[0].number_of_si_index = 2;
+	in.nb_iot_system_information_request.si_periodicity[0].si_index[0] = 2;
+	in.nb_iot_system_information_request.si_periodicity[0].si_index[1] = 20;
+	in.nb_iot_system_information_request.si_window_length = 0;
+	in.nb_iot_system_information_request.timeout = 2000;
+
+	in.pnf_cell_broadcast_state.tl.tag = NFAPI_PNF_CELL_BROADCAST_STATE_TAG;
+	in.pnf_cell_broadcast_state.length = 7;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	IN_OUT_ASSERT(header.message_id);
+	IN_OUT_ASSERT(rat_type);
+	IN_OUT_ASSERT(nb_iot_system_information_request.tl.tag);
+	IN_OUT_ASSERT(nb_iot_system_information_request.earfcn);
+	IN_OUT_ASSERT(nb_iot_system_information_request.ro_dl);
+	IN_OUT_ASSERT(nb_iot_system_information_request.pci);
+	IN_OUT_ASSERT(nb_iot_system_information_request.number_of_si_periodicity);
+	
+	for(idx = 0; idx < in.nb_iot_system_information_request.number_of_si_periodicity; ++idx)
+	{
+		IN_OUT_ASSERT(nb_iot_system_information_request.si_periodicity[idx].si_periodicity);
+		IN_OUT_ASSERT(nb_iot_system_information_request.si_periodicity[idx].si_repetition_pattern);
+		IN_OUT_ASSERT(nb_iot_system_information_request.si_periodicity[idx].si_tb_size);
+		IN_OUT_ASSERT(nb_iot_system_information_request.si_periodicity[idx].number_of_si_index);
+		
+		for(idx2 = 0; idx2 < in.nb_iot_system_information_request.si_periodicity[idx].number_of_si_index; ++idx2)
+			IN_OUT_ASSERT(nb_iot_system_information_request.si_periodicity[idx].si_index[idx2]);
+	}
+
+	IN_OUT_ASSERT(nb_iot_system_information_request.si_window_length);
+	IN_OUT_ASSERT(nb_iot_system_information_request.timeout);
+
+
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.tl.tag, out.pnf_cell_broadcast_state.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.length, out.pnf_cell_broadcast_state.length);
+	for(idx = 0; idx < out.pnf_cell_broadcast_state.length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_cell_broadcast_state.value[idx], out.pnf_cell_broadcast_state.value[idx]);
+	}
+}
+
+
+void nfapi_test_system_information_response()
+{
+	nfapi_system_information_response_t in;
+	nfapi_system_information_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+void nfapi_test_system_information_indication_lte()
+{
+	uint16_t idx;
+	nfapi_system_information_indication_t in;
+	nfapi_system_information_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+	in.lte_system_information_indication.tl.tag = NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG;
+	in.lte_system_information_indication.sib_type = 2;
+	in.lte_system_information_indication.sib_length = 15;
+
+	in.utran_system_information_indication.tl.tag = 0;
+	in.geran_system_information_indication.tl.tag = 0;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.lte_system_information_indication.tl.tag, out.lte_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.lte_system_information_indication.sib_type, out.lte_system_information_indication.sib_type);
+	CU_ASSERT_EQUAL(in.lte_system_information_indication.sib_length, out.lte_system_information_indication.sib_length);
+
+	for(idx = 0; idx < out.lte_system_information_indication.sib_length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.lte_system_information_indication.sib[idx], out.lte_system_information_indication.sib[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.utran_system_information_indication.tl.tag, out.utran_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.geran_system_information_indication.tl.tag, out.geran_system_information_indication.tl.tag);
+
+}
+void nfapi_test_system_information_indication_lte_overrun()
+{
+	nfapi_system_information_indication_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_SYSTEM_INFORMATION_INDICATION, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push32(0, &p, end); // error code
+
+	push16(NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG, &p, end);
+	push16(8, &p, end);
+
+	push8(1, &p, end);
+	push16(NFAPI_MAX_SIB_LENGTH + 1, &p, end);
+
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_system_information_indication_utran()
+{
+	uint16_t idx;
+	nfapi_system_information_indication_t in;
+	nfapi_system_information_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+	in.lte_system_information_indication.tl.tag = 0;
+
+	in.utran_system_information_indication.tl.tag = NFAPI_UTRAN_SYSTEM_INFORMATION_INDICATION_TAG;
+	in.utran_system_information_indication.sib_length = 25;
+
+	in.geran_system_information_indication.tl.tag = 0;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.lte_system_information_indication.tl.tag, out.lte_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.utran_system_information_indication.tl.tag, out.utran_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.utran_system_information_indication.sib_length, out.utran_system_information_indication.sib_length);
+
+	for(idx = 0; idx < out.utran_system_information_indication.sib_length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.utran_system_information_indication.sib[idx], out.utran_system_information_indication.sib[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.geran_system_information_indication.tl.tag, out.geran_system_information_indication.tl.tag);
+
+}
+void nfapi_test_system_information_indication_utran_overrun()
+{
+	nfapi_system_information_indication_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_SYSTEM_INFORMATION_INDICATION, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push32(0, &p, end); // error code
+
+	push16(NFAPI_UTRAN_SYSTEM_INFORMATION_INDICATION_TAG, &p, end);
+	push16(8, &p, end);
+
+	push16(NFAPI_MAX_SIB_LENGTH + 1, &p, end);
+
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+void nfapi_test_system_information_indication_geran()
+{
+	uint16_t idx;
+	nfapi_system_information_indication_t in;
+	nfapi_system_information_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+	in.lte_system_information_indication.tl.tag = 0;
+	in.utran_system_information_indication.tl.tag = 0;
+
+	in.geran_system_information_indication.tl.tag = NFAPI_GERAN_SYSTEM_INFORMATION_INDICATION_TAG;
+	in.geran_system_information_indication.si_length = 25;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.lte_system_information_indication.tl.tag, out.lte_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.utran_system_information_indication.tl.tag, out.utran_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.geran_system_information_indication.tl.tag, out.geran_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.geran_system_information_indication.si_length, out.geran_system_information_indication.si_length);
+
+	for(idx = 0; idx < out.geran_system_information_indication.si_length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.geran_system_information_indication.si[idx], out.geran_system_information_indication.si[idx]);
+	}
+
+}
+void nfapi_test_system_information_indication_geran_overrun()
+{
+	nfapi_system_information_indication_t out;
+
+	uint8_t buffer[1024];
+	uint8_t* p = &buffer[0];
+	uint8_t *end = p + 1024;
+	push16(0, &p, end);
+	push16(NFAPI_SYSTEM_INFORMATION_INDICATION, &p, end);
+	push16(64, &p, end);
+	push16(0, &p, end);
+
+	push32(0, &p, end); // error code
+
+	push16(NFAPI_GERAN_SYSTEM_INFORMATION_INDICATION_TAG, &p, end);
+	push16(8, &p, end);
+
+	push16(NFAPI_MAX_SI_LENGTH + 1, &p, end);
+
+
+	int result = nfapi_p4_message_unpack(buffer, 34, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+
+void nfapi_test_system_information_indication_nb_iot()
+{
+	uint16_t idx;
+	nfapi_system_information_indication_t in;
+	nfapi_system_information_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SYSTEM_INFORMATION_INDICATION;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+	in.nb_iot_system_information_indication.tl.tag = NFAPI_NB_IOT_SYSTEM_INFORMATION_INDICATION_TAG;
+	in.nb_iot_system_information_indication.sib_type = 2;
+	in.nb_iot_system_information_indication.sib_length = 15;
+
+	in.lte_system_information_indication.tl.tag = 0;
+	in.utran_system_information_indication.tl.tag = 0;
+	in.geran_system_information_indication.tl.tag = 0;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_indication.tl.tag, out.nb_iot_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_indication.sib_type, out.nb_iot_system_information_indication.sib_type);
+	CU_ASSERT_EQUAL(in.nb_iot_system_information_indication.sib_length, out.nb_iot_system_information_indication.sib_length);
+
+	for(idx = 0; idx < out.nb_iot_system_information_indication.sib_length; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nb_iot_system_information_indication.sib[idx], out.nb_iot_system_information_indication.sib[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.lte_system_information_indication.tl.tag, out.lte_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.utran_system_information_indication.tl.tag, out.utran_system_information_indication.tl.tag);
+	CU_ASSERT_EQUAL(in.geran_system_information_indication.tl.tag, out.geran_system_information_indication.tl.tag);
+
+}
+
+void nfapi_test_nmm_stop_request()
+{
+	nfapi_nmm_stop_request_t in;
+	nfapi_nmm_stop_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_NMM_STOP_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+}
+void nfapi_test_nmm_stop_response()
+{
+	nfapi_nmm_stop_response_t in;
+	nfapi_nmm_stop_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_NMM_STOP_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_P4_MSG_RAT_NOT_SUPPORTED;
+
+	int packedMessageLength = nfapi_p4_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p4_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+
+
+void nfapi_test_pnf_param_request()
+{
+	nfapi_pnf_param_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_pnf_param_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PNF_PARAM_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+}
+void nfapi_test_pnf_param_request_ve()
+{
+	nfapi_pnf_param_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_pnf_param_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PNF_PARAM_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	my_vendor_extention ve;
+	ve.tl.tag = NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE;
+	ve.value1 = 56;
+	ve.value2 = 1234;
+	in.vendor_extension = (void*)&ve;
+
+	nfapi_p4_p5_codec_config_t codec;
+	memset(&codec, 0, sizeof(codec));
+	codec.unpack_vendor_extension_tlv = &nfapi_test_unpack_vendor_extension_tlv; 
+	codec.pack_vendor_extension_tlv = &nfapi_test_pack_vendor_extension_tlv;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, &codec);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), &codec);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+
+	CU_ASSERT_NOT_EQUAL(in.vendor_extension, 0);
+	CU_ASSERT_EQUAL(((my_vendor_extention*)(out.vendor_extension))->tl.tag, ve.tl.tag);
+	CU_ASSERT_EQUAL(((my_vendor_extention*)(out.vendor_extension))->value1, ve.value1);
+	CU_ASSERT_EQUAL(((my_vendor_extention*)(out.vendor_extension))->value2, ve.value2);
+
+	free(out.vendor_extension);
+}
+void nfapi_test_pnf_param_response()
+{
+	uint16_t idx = 0;
+	uint16_t idx2 = 0;
+	nfapi_pnf_param_response_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_pnf_param_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PNF_PARAM_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = 0;
+	in.pnf_param_general.tl.tag = NFAPI_PNF_PARAM_GENERAL_TAG;
+	in.pnf_param_general.nfapi_sync_mode = 2;
+	in.pnf_param_general.location_mode = 1;
+	in.pnf_param_general.location_coordinates_length = 1;
+	in.pnf_param_general.location_coordinates[0] = 123;
+	in.pnf_param_general.dl_config_timing = 12;
+	in.pnf_param_general.tx_timing = 12;
+	in.pnf_param_general.ul_config_timing = 12;
+	in.pnf_param_general.hi_dci0_timing = 12;
+	in.pnf_param_general.maximum_number_phys = 2;
+	in.pnf_param_general.maximum_total_bandwidth = 100;
+	in.pnf_param_general.maximum_total_number_dl_layers = 2;
+	in.pnf_param_general.maximum_total_number_ul_layers = 2;
+	in.pnf_param_general.shared_bands = 0;
+	in.pnf_param_general.shared_pa = 0;
+	in.pnf_param_general.maximum_total_power = -190;
+	in.pnf_param_general.oui[0] = 88;
+
+	in.pnf_phy.tl.tag = NFAPI_PNF_PHY_TAG;
+	in.pnf_phy.number_of_phys = 2;
+	in.pnf_phy.phy[0].phy_config_index = 0;
+	in.pnf_phy.phy[0].number_of_rfs = 2;
+	in.pnf_phy.phy[0].rf_config[0].rf_config_index = 0;
+	in.pnf_phy.phy[0].number_of_rf_exclusions = 1;
+	in.pnf_phy.phy[0].rf_config[0].rf_config_index = 1;
+	in.pnf_phy.phy[0].downlink_channel_bandwidth_supported = 20;
+	in.pnf_phy.phy[0].uplink_channel_bandwidth_supported = 20;
+	in.pnf_phy.phy[0].number_of_dl_layers_supported = 2;
+	in.pnf_phy.phy[0].number_of_ul_layers_supported = 1;
+	in.pnf_phy.phy[0].maximum_3gpp_release_supported = 3;
+	in.pnf_phy.phy[0].nmm_modes_supported = 2;
+
+	in.pnf_rf.tl.tag = NFAPI_PNF_RF_TAG;
+	in.pnf_rf.number_of_rfs = 2;
+	in.pnf_rf.rf[0].rf_config_index = 0;
+	in.pnf_rf.rf[0].band = 1;
+	in.pnf_rf.rf[0].maximum_transmit_power = -100; 
+	in.pnf_rf.rf[0].minimum_transmit_power = -90; 
+	in.pnf_rf.rf[0].number_of_antennas_suppported = 4;
+	in.pnf_rf.rf[0].minimum_downlink_frequency = 100;
+	in.pnf_rf.rf[0].maximum_downlink_frequency = 2132;
+	in.pnf_rf.rf[0].minimum_uplink_frequency = 1231;
+	in.pnf_rf.rf[0].maximum_uplink_frequency = 123;
+
+
+	in.pnf_phy_rel10.tl.tag = NFAPI_PNF_PHY_REL10_TAG;
+	in.pnf_phy_rel10.number_of_phys = 2;
+	in.pnf_phy_rel10.phy[0].phy_config_index = 0;
+	in.pnf_phy_rel10.phy[0].transmission_mode_7_supported = 1;
+	in.pnf_phy_rel10.phy[0].transmission_mode_8_supported = 2;
+	in.pnf_phy_rel10.phy[0].two_antenna_ports_for_pucch = 3;
+	in.pnf_phy_rel10.phy[0].transmission_mode_9_supported = 4;
+	in.pnf_phy_rel10.phy[0].simultaneous_pucch_pusch = 5;
+	in.pnf_phy_rel10.phy[0].four_layer_tx_with_tm3_and_tm4 = 6;
+
+	in.pnf_phy_rel11.tl.tag = NFAPI_PNF_PHY_REL11_TAG;
+	in.pnf_phy_rel11.number_of_phys = 2;
+	in.pnf_phy_rel11.phy[0].phy_config_index = 0;
+	in.pnf_phy_rel11.phy[0].edpcch_supported = 1;
+	in.pnf_phy_rel11.phy[0].multi_ack_csi_reporting = 2;
+	in.pnf_phy_rel11.phy[0].pucch_tx_diversity = 3;
+	in.pnf_phy_rel11.phy[0].ul_comp_supported = 4;
+	in.pnf_phy_rel11.phy[0].transmission_mode_5_supported = 5;
+
+	in.pnf_phy_rel12.tl.tag = NFAPI_PNF_PHY_REL12_TAG;
+	in.pnf_phy_rel12.number_of_phys = 2;
+	in.pnf_phy_rel12.phy[0].phy_config_index = 0;
+	in.pnf_phy_rel12.phy[0].csi_subframe_set = 1;
+	in.pnf_phy_rel12.phy[0].enhanced_4tx_codebook = 2;
+	in.pnf_phy_rel12.phy[0].drs_supported = 3;
+	in.pnf_phy_rel12.phy[0].ul_64qam_supported = 4;
+	in.pnf_phy_rel12.phy[0].transmission_mode_10_supported = 5;
+	in.pnf_phy_rel12.phy[0].alternative_bts_indices = 6;
+
+	in.pnf_phy_rel13.tl.tag = NFAPI_PNF_PHY_REL13_TAG;
+	in.pnf_phy_rel13.number_of_phys = 2;
+	in.pnf_phy_rel13.phy[0].phy_config_index = 0;
+	in.pnf_phy_rel13.phy[0].pucch_format4_supported = 1;
+	in.pnf_phy_rel13.phy[0].pucch_format5_supported = 2;
+	in.pnf_phy_rel13.phy[0].more_than_5_ca_support = 3;
+	in.pnf_phy_rel13.phy[0].laa_supported = 4;
+	in.pnf_phy_rel13.phy[0].laa_ending_in_dwpts_supported = 5;
+	in.pnf_phy_rel13.phy[0].laa_starting_in_second_slot_supported = 6;
+	in.pnf_phy_rel13.phy[0].beamforming_supported = 7;
+	in.pnf_phy_rel13.phy[0].csi_rs_enhancement_supported = 8;
+	in.pnf_phy_rel13.phy[0].drms_enhancement_supported = 9;
+	in.pnf_phy_rel13.phy[0].srs_enhancement_supported = 10;
+	
+	in.pnf_phy_rel13_nb_iot.tl.tag = NFAPI_PNF_PHY_REL13_NB_IOT_TAG;
+	in.pnf_phy_rel13_nb_iot.number_of_phys = 2;
+	in.pnf_phy_rel13_nb_iot.phy[0].phy_config_index = 0;
+	in.pnf_phy_rel13_nb_iot.phy[0].number_of_rfs = 2;
+	in.pnf_phy_rel13_nb_iot.phy[0].rf_config[0].rf_config_index = 0;
+	in.pnf_phy_rel13_nb_iot.phy[0].number_of_rf_exclusions = 1;
+	in.pnf_phy_rel13_nb_iot.phy[0].rf_config[0].rf_config_index = 1;
+	in.pnf_phy_rel13_nb_iot.phy[0].number_of_dl_layers_supported = 2;
+	in.pnf_phy_rel13_nb_iot.phy[0].number_of_ul_layers_supported = 1;
+	in.pnf_phy_rel13_nb_iot.phy[0].maximum_3gpp_release_supported = 3;
+	in.pnf_phy_rel13_nb_iot.phy[0].nmm_modes_supported = 2;
+
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	int unpack_result = nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(unpack_result, 1);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.pnf_param_general.tl.tag, out.pnf_param_general.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_param_general.nfapi_sync_mode, out.pnf_param_general.nfapi_sync_mode);
+	CU_ASSERT_EQUAL(in.pnf_param_general.location_mode, out.pnf_param_general.location_mode);
+
+	for(idx = 0; idx < NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH; ++idx)
+		CU_ASSERT_EQUAL(in.pnf_param_general.location_coordinates[idx], out.pnf_param_general.location_coordinates[idx]);
+
+	CU_ASSERT_EQUAL(in.pnf_param_general.dl_config_timing, out.pnf_param_general.dl_config_timing);
+	CU_ASSERT_EQUAL(in.pnf_param_general.tx_timing, out.pnf_param_general.tx_timing);
+	CU_ASSERT_EQUAL(in.pnf_param_general.ul_config_timing, out.pnf_param_general.ul_config_timing);
+	CU_ASSERT_EQUAL(in.pnf_param_general.hi_dci0_timing, out.pnf_param_general.hi_dci0_timing);
+	CU_ASSERT_EQUAL(in.pnf_param_general.maximum_number_phys, out.pnf_param_general.maximum_number_phys);
+	CU_ASSERT_EQUAL(in.pnf_param_general.maximum_total_bandwidth, out.pnf_param_general.maximum_total_bandwidth);
+	CU_ASSERT_EQUAL(in.pnf_param_general.maximum_total_number_dl_layers, out.pnf_param_general.maximum_total_number_dl_layers);
+	CU_ASSERT_EQUAL(in.pnf_param_general.maximum_total_number_ul_layers, out.pnf_param_general.maximum_total_number_ul_layers);
+	CU_ASSERT_EQUAL(in.pnf_param_general.shared_bands, out.pnf_param_general.shared_bands);
+	CU_ASSERT_EQUAL(in.pnf_param_general.shared_pa, out.pnf_param_general.shared_pa);
+	CU_ASSERT_EQUAL(in.pnf_param_general.maximum_total_power, out.pnf_param_general.maximum_total_power);
+	for(idx = 0; idx < NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH; ++idx)
+		CU_ASSERT_EQUAL(in.pnf_param_general.oui[idx], out.pnf_param_general.oui[idx]);
+
+	CU_ASSERT_EQUAL(in.pnf_phy.tl.tag, out.pnf_phy.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_phy.number_of_phys, out.pnf_phy.number_of_phys);
+	
+	for(idx = 0; idx < out.pnf_phy.number_of_phys; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].phy_config_index, out.pnf_phy.phy[idx].phy_config_index);
+		CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].number_of_rfs, out.pnf_phy.phy[idx].number_of_rfs);
+
+	
+		for(idx2 = 0; idx2 < out.pnf_phy.phy[idx].number_of_rfs; ++idx2)
+		{
+			CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].rf_config[idx2].rf_config_index, out.pnf_phy.phy[idx].rf_config[idx2].rf_config_index);
+		}
+		CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].number_of_rf_exclusions, out.pnf_phy.phy[idx].number_of_rf_exclusions);
+
+		for(idx2 = 0; idx2 < out.pnf_phy.phy[idx].number_of_rf_exclusions; ++idx2)
+		{
+			CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].excluded_rf_config[idx2].rf_config_index, out.pnf_phy.phy[idx].excluded_rf_config[idx2].rf_config_index);
+		}
+
+
+		CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].downlink_channel_bandwidth_supported, out.pnf_phy.phy[idx].downlink_channel_bandwidth_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].uplink_channel_bandwidth_supported, out.pnf_phy.phy[idx].uplink_channel_bandwidth_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].number_of_dl_layers_supported, out.pnf_phy.phy[idx].number_of_dl_layers_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].number_of_ul_layers_supported, out.pnf_phy.phy[idx].number_of_ul_layers_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].maximum_3gpp_release_supported, out.pnf_phy.phy[idx].maximum_3gpp_release_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy.phy[idx].nmm_modes_supported, out.pnf_phy.phy[idx].nmm_modes_supported);
+	}
+
+	CU_ASSERT_EQUAL(in.pnf_rf.tl.tag, out.pnf_rf.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_rf.number_of_rfs, out.pnf_rf.number_of_rfs);
+	for(idx = 0; idx < out.pnf_rf.number_of_rfs; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_rf.rf[idx].rf_config_index, out.pnf_rf.rf[idx].rf_config_index);
+		CU_ASSERT_EQUAL(in.pnf_rf.rf[idx].band, out.pnf_rf.rf[idx].band);
+		CU_ASSERT_EQUAL(in.pnf_rf.rf[idx].maximum_transmit_power, out.pnf_rf.rf[idx].maximum_transmit_power);
+		CU_ASSERT_EQUAL(in.pnf_rf.rf[idx].minimum_transmit_power, out.pnf_rf.rf[idx].minimum_transmit_power);
+		CU_ASSERT_EQUAL(in.pnf_rf.rf[idx].number_of_antennas_suppported, out.pnf_rf.rf[idx].number_of_antennas_suppported);
+		CU_ASSERT_EQUAL(in.pnf_rf.rf[idx].minimum_downlink_frequency, out.pnf_rf.rf[idx].minimum_downlink_frequency);
+		CU_ASSERT_EQUAL(in.pnf_rf.rf[idx].maximum_downlink_frequency, out.pnf_rf.rf[idx].maximum_downlink_frequency);
+		CU_ASSERT_EQUAL(in.pnf_rf.rf[idx].minimum_uplink_frequency, out.pnf_rf.rf[idx].minimum_uplink_frequency);
+		CU_ASSERT_EQUAL(in.pnf_rf.rf[idx].maximum_uplink_frequency, out.pnf_rf.rf[idx].maximum_uplink_frequency);
+	}
+
+
+	CU_ASSERT_EQUAL(in.pnf_phy_rel10.tl.tag, out.pnf_phy_rel10.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_phy_rel10.number_of_phys, out.pnf_phy_rel10.number_of_phys);
+	for(idx = 0; idx < out.pnf_phy_rel10.number_of_phys; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_phy_rel10.phy[idx].phy_config_index, out.pnf_phy_rel10.phy[idx].phy_config_index);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel10.phy[idx].transmission_mode_7_supported, out.pnf_phy_rel10.phy[idx].transmission_mode_7_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel10.phy[idx].transmission_mode_8_supported, out.pnf_phy_rel10.phy[idx].transmission_mode_8_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel10.phy[idx].two_antenna_ports_for_pucch, out.pnf_phy_rel10.phy[idx].two_antenna_ports_for_pucch);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel10.phy[idx].transmission_mode_9_supported, out.pnf_phy_rel10.phy[idx].transmission_mode_9_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel10.phy[idx].simultaneous_pucch_pusch, out.pnf_phy_rel10.phy[idx].simultaneous_pucch_pusch);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel10.phy[idx].four_layer_tx_with_tm3_and_tm4, out.pnf_phy_rel10.phy[idx].four_layer_tx_with_tm3_and_tm4);
+	}
+
+	CU_ASSERT_EQUAL(in.pnf_phy_rel11.tl.tag, out.pnf_phy_rel11.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_phy_rel11.number_of_phys, out.pnf_phy_rel11.number_of_phys);
+	for(idx = 0; idx < out.pnf_phy_rel11.number_of_phys; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_phy_rel11.phy[idx].phy_config_index, out.pnf_phy_rel11.phy[idx].phy_config_index);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel11.phy[idx].edpcch_supported, out.pnf_phy_rel11.phy[idx].edpcch_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel11.phy[idx].multi_ack_csi_reporting, out.pnf_phy_rel11.phy[idx].multi_ack_csi_reporting);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel11.phy[idx].pucch_tx_diversity, out.pnf_phy_rel11.phy[idx].pucch_tx_diversity);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel11.phy[idx].ul_comp_supported, out.pnf_phy_rel11.phy[idx].ul_comp_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel11.phy[idx].transmission_mode_5_supported, out.pnf_phy_rel11.phy[idx].transmission_mode_5_supported);
+	}
+
+	CU_ASSERT_EQUAL(in.pnf_phy_rel12.tl.tag, out.pnf_phy_rel12.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_phy_rel12.number_of_phys, out.pnf_phy_rel12.number_of_phys);
+	for(idx = 0; idx < out.pnf_phy_rel12.number_of_phys; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_phy_rel12.phy[idx].phy_config_index, out.pnf_phy_rel12.phy[idx].phy_config_index);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel12.phy[idx].csi_subframe_set, out.pnf_phy_rel12.phy[idx].csi_subframe_set);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel12.phy[idx].enhanced_4tx_codebook, out.pnf_phy_rel12.phy[idx].enhanced_4tx_codebook);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel12.phy[idx].drs_supported, out.pnf_phy_rel12.phy[idx].drs_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel12.phy[idx].ul_64qam_supported, out.pnf_phy_rel12.phy[idx].ul_64qam_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel12.phy[idx].transmission_mode_10_supported, out.pnf_phy_rel12.phy[idx].transmission_mode_10_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel12.phy[idx].alternative_bts_indices, out.pnf_phy_rel12.phy[idx].alternative_bts_indices);
+	}
+
+	CU_ASSERT_EQUAL(in.pnf_phy_rel13.tl.tag, out.pnf_phy_rel13.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_phy_rel13.number_of_phys, out.pnf_phy_rel13.number_of_phys);
+	for(idx = 0; idx < out.pnf_phy_rel13.number_of_phys; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].phy_config_index, out.pnf_phy_rel13.phy[idx].phy_config_index);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].pucch_format4_supported, out.pnf_phy_rel13.phy[idx].pucch_format4_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].pucch_format5_supported, out.pnf_phy_rel13.phy[idx].pucch_format5_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].more_than_5_ca_support, out.pnf_phy_rel13.phy[idx].more_than_5_ca_support);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].laa_supported, out.pnf_phy_rel13.phy[idx].laa_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].laa_ending_in_dwpts_supported, out.pnf_phy_rel13.phy[idx].laa_ending_in_dwpts_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].laa_starting_in_second_slot_supported, out.pnf_phy_rel13.phy[idx].laa_starting_in_second_slot_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].beamforming_supported, out.pnf_phy_rel13.phy[idx].beamforming_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].csi_rs_enhancement_supported, out.pnf_phy_rel13.phy[idx].csi_rs_enhancement_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].drms_enhancement_supported, out.pnf_phy_rel13.phy[idx].drms_enhancement_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13.phy[idx].srs_enhancement_supported, out.pnf_phy_rel13.phy[idx].srs_enhancement_supported);
+	}
+
+	CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.tl.tag, out.pnf_phy_rel13_nb_iot.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.number_of_phys, out.pnf_phy_rel13_nb_iot.number_of_phys);
+	
+	for(idx = 0; idx < out.pnf_phy_rel13_nb_iot.number_of_phys; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.phy[idx].phy_config_index, out.pnf_phy_rel13_nb_iot.phy[idx].phy_config_index);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.phy[idx].number_of_rfs, out.pnf_phy_rel13_nb_iot.phy[idx].number_of_rfs);
+
+	
+		for(idx2 = 0; idx2 < out.pnf_phy_rel13_nb_iot.phy[idx].number_of_rfs; ++idx2)
+		{
+			CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.phy[idx].rf_config[idx2].rf_config_index, out.pnf_phy_rel13_nb_iot.phy[idx].rf_config[idx2].rf_config_index);
+		}
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.phy[idx].number_of_rf_exclusions, out.pnf_phy_rel13_nb_iot.phy[idx].number_of_rf_exclusions);
+
+		for(idx2 = 0; idx2 < out.pnf_phy_rel13_nb_iot.phy[idx].number_of_rf_exclusions; ++idx2)
+		{
+			CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.phy[idx].excluded_rf_config[idx2].rf_config_index, out.pnf_phy_rel13_nb_iot.phy[idx].excluded_rf_config[idx2].rf_config_index);
+		}
+
+
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.phy[idx].number_of_dl_layers_supported, out.pnf_phy_rel13_nb_iot.phy[idx].number_of_dl_layers_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.phy[idx].number_of_ul_layers_supported, out.pnf_phy_rel13_nb_iot.phy[idx].number_of_ul_layers_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.phy[idx].maximum_3gpp_release_supported, out.pnf_phy_rel13_nb_iot.phy[idx].maximum_3gpp_release_supported);
+		CU_ASSERT_EQUAL(in.pnf_phy_rel13_nb_iot.phy[idx].nmm_modes_supported, out.pnf_phy_rel13_nb_iot.phy[idx].nmm_modes_supported);
+	}
+
+
+}
+
+void nfapi_test_pnf_config_request()
+{
+	uint16_t idx;
+	nfapi_pnf_config_request_t in;
+	nfapi_pnf_config_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PNF_CONFIG_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.pnf_phy_rf_config.tl.tag = NFAPI_PNF_PHY_RF_TAG;
+	in.pnf_phy_rf_config.number_phy_rf_config_info = 2;
+	in.pnf_phy_rf_config.phy_rf_config[0].phy_id = 0;
+	in.pnf_phy_rf_config.phy_rf_config[0].phy_config_index = 0;
+	in.pnf_phy_rf_config.phy_rf_config[0].rf_config_index = 0;
+
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	int unpack_result = nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(unpack_result, 1);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	//CU_ASSERT_EQUAL(in.error_code, out.error_code);
+
+	CU_ASSERT_EQUAL(in.pnf_phy_rf_config.tl.tag, out.pnf_phy_rf_config.tl.tag);
+	CU_ASSERT_EQUAL(in.pnf_phy_rf_config.number_phy_rf_config_info, out.pnf_phy_rf_config.number_phy_rf_config_info);
+
+	for(idx = 0; idx < out.pnf_phy_rf_config.number_phy_rf_config_info; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.pnf_phy_rf_config.phy_rf_config[idx].phy_id, out.pnf_phy_rf_config.phy_rf_config[idx].phy_id);
+		CU_ASSERT_EQUAL(in.pnf_phy_rf_config.phy_rf_config[idx].phy_config_index, out.pnf_phy_rf_config.phy_rf_config[idx].phy_config_index);
+		CU_ASSERT_EQUAL(in.pnf_phy_rf_config.phy_rf_config[idx].rf_config_index, out.pnf_phy_rf_config.phy_rf_config[idx].rf_config_index);
+	}
+}
+
+
+
+void nfapi_test_pnf_config_response()
+{
+	nfapi_pnf_config_response_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_pnf_config_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PNF_CONFIG_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_MSG_OK;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+void nfapi_test_pnf_config_response1()
+{
+	uint8_t buffer[NFAPI_HEADER_LENGTH  + 1];
+
+	nfapi_pnf_config_response_t in;
+	memset(&in, 0, sizeof(in));
+	//nfapi_pnf_config_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PNF_CONFIG_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_MSG_OK;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), buffer, sizeof(buffer), 0);
+	CU_ASSERT_EQUAL(packedMessageLength, -1);
+
+	//nfapi_p5_message_unpack(buffer, sizeof(buffer), &out, sizeof(out), 0);
+	//CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	//CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+void nfapi_test_pnf_start_request()
+{
+	nfapi_pnf_start_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_pnf_start_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PNF_START_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+}
+
+void nfapi_test_pnf_start_response()
+{
+	nfapi_pnf_start_response_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_pnf_start_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PNF_START_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_MSG_OK;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+void nfapi_test_pnf_stop_request()
+{
+	nfapi_pnf_stop_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_pnf_stop_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PNF_STOP_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+}
+void nfapi_test_pnf_stop_response()
+{
+	nfapi_pnf_stop_response_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_pnf_stop_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PNF_STOP_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_MSG_OK;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+
+void nfapi_test_param_request()
+{
+	nfapi_param_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_param_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PARAM_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+}
+void nfapi_test_param_response()
+{
+	#define SET_TLV(_TLV, _TAG, _VALUE) { _TLV.tl.tag = _TAG; _TLV.value = _VALUE; num_tlv++;	}
+	#define ASSERT_TLV(IN_TLV, OUT_TLV) { CU_ASSERT_EQUAL(IN_TLV.tl.tag, OUT_TLV.tl.tag); CU_ASSERT_EQUAL(IN_TLV.value, OUT_TLV.value);}
+
+	nfapi_param_response_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_param_response_t out;
+	memset(&out, 0, sizeof(out));
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_PARAM_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_MSG_OK;
+
+	uint16_t idx = 0;
+	uint16_t num_tlv = 0; // Bit of a hack, it is incremented in the SET_UINT16_TLV macro
+
+	SET_TLV(in.l1_status.phy_state, NFAPI_L1_STATUS_PHY_STATE_TAG, 1);
+	SET_TLV(in.phy_capabilities.dl_bandwidth_support, NFAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG, 63);
+	SET_TLV(in.phy_capabilities.ul_bandwidth_support, NFAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG, 63);
+	SET_TLV(in.phy_capabilities.dl_modulation_support, NFAPI_PHY_CAPABILITIES_DL_MODULATION_SUPPORT_TAG, 3);
+	SET_TLV(in.phy_capabilities.ul_modulation_support, NFAPI_PHY_CAPABILITIES_UL_MODULATION_SUPPORT_TAG, 3);
+	SET_TLV(in.phy_capabilities.phy_antenna_capability, NFAPI_PHY_CAPABILITIES_PHY_ANTENNA_CAPABILITY_TAG, 8);
+	SET_TLV(in.phy_capabilities.release_capability, NFAPI_PHY_CAPABILITIES_RELEASE_CAPABILITY_TAG, 63);
+	SET_TLV(in.phy_capabilities.mbsfn_capability, NFAPI_PHY_CAPABILITIES_MBSFN_CAPABILITY_TAG, 0);
+	
+	SET_TLV(in.laa_capability.laa_support, NFAPI_LAA_CAPABILITY_LAA_SUPPORT_TAG, 1);
+	SET_TLV(in.laa_capability.pd_sensing_lbt_support, NFAPI_LAA_CAPABILITY_PD_SENSING_LBT_SUPPORT_TAG, 0);
+	SET_TLV(in.laa_capability.multi_carrier_lbt_support, NFAPI_LAA_CAPABILITY_MULTI_CARRIER_LBT_SUPPORT_TAG, 3);
+	SET_TLV(in.laa_capability.partial_sf_support, NFAPI_LAA_CAPABILITY_PARTIAL_SF_SUPPORT_TAG, 2);
+
+	SET_TLV(in.subframe_config.duplex_mode, NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG, 1);
+	SET_TLV(in.subframe_config.pcfich_power_offset, NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG, 1000);
+	SET_TLV(in.subframe_config.pb, NFAPI_SUBFRAME_CONFIG_PB_TAG, 1);
+	SET_TLV(in.subframe_config.dl_cyclic_prefix_type, NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG, 0);
+	SET_TLV(in.subframe_config.ul_cyclic_prefix_type, NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG, 0);
+
+	SET_TLV(in.rf_config.dl_channel_bandwidth, NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG, 50);
+	SET_TLV(in.rf_config.ul_channel_bandwidth, NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG, 50);
+	SET_TLV(in.rf_config.reference_signal_power, NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG, 120);
+	SET_TLV(in.rf_config.tx_antenna_ports, NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG, 2);
+	SET_TLV(in.rf_config.rx_antenna_ports, NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG, 2);
+
+	SET_TLV(in.phich_config.phich_resource, NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG, 3);
+	SET_TLV(in.phich_config.phich_duration, NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG, 0);
+	SET_TLV(in.phich_config.phich_power_offset, NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG, 500);
+
+	SET_TLV(in.sch_config.primary_synchronization_signal_epre_eprers, NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, 1000);
+	SET_TLV(in.sch_config.secondary_synchronization_signal_epre_eprers, NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, 2000);
+	SET_TLV(in.sch_config.physical_cell_id, NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG, 12344);
+
+
+	SET_TLV(in.prach_config.configuration_index, NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG, 63);
+	SET_TLV(in.prach_config.root_sequence_index, NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG, 800);
+	SET_TLV(in.prach_config.zero_correlation_zone_configuration, NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG, 14);
+	SET_TLV(in.prach_config.high_speed_flag, NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG, 0);
+	SET_TLV(in.prach_config.frequency_offset, NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG, 23);
+
+	SET_TLV(in.pusch_config.hopping_mode, NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG, 0);
+	SET_TLV(in.pusch_config.hopping_offset, NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG, 55);
+	SET_TLV(in.pusch_config.number_of_subbands, NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG, 1);
+
+	SET_TLV(in.pucch_config.delta_pucch_shift, NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG, 2);
+	SET_TLV(in.pucch_config.n_cqi_rb, NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG, 88);
+	SET_TLV(in.pucch_config.n_an_cs, NFAPI_PUCCH_CONFIG_N_AN_CS_TAG, 3);
+	SET_TLV(in.pucch_config.n1_pucch_an, NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG, 2015);
+
+	SET_TLV(in.srs_config.bandwidth_configuration, NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG, 3);
+	SET_TLV(in.srs_config.max_up_pts, NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG, 0);
+	SET_TLV(in.srs_config.srs_subframe_configuration, NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG, 11);
+	SET_TLV(in.srs_config.srs_acknack_srs_simultaneous_transmission, NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG, 1);
+
+	SET_TLV(in.uplink_reference_signal_config.uplink_rs_hopping, NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG, 2);
+	SET_TLV(in.uplink_reference_signal_config.group_assignment, NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG, 22);
+	SET_TLV(in.uplink_reference_signal_config.cyclic_shift_1_for_drms, NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG, 2);
+
+	SET_TLV(in.tdd_frame_structure_config.subframe_assignment, NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG, 5);
+	SET_TLV(in.tdd_frame_structure_config.special_subframe_patterns, NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG, 3);
+
+	SET_TLV(in.l23_config.data_report_mode, NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG, 1);
+	SET_TLV(in.l23_config.sfnsf, NFAPI_L23_CONFIG_SFNSF_TAG, 12354);
+
+	in.nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
+	num_tlv++;
+
+	in.nfapi_config.p7_vnf_address_ipv6.tl.tag = NFAPI_NFAPI_P7_VNF_ADDRESS_IPV6_TAG;
+	num_tlv++;
+
+	SET_TLV(in.nfapi_config.p7_vnf_port, NFAPI_NFAPI_P7_VNF_PORT_TAG, 1111);
+	
+	in.nfapi_config.p7_pnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG;
+	num_tlv++;
+
+	in.nfapi_config.p7_pnf_address_ipv6.tl.tag = NFAPI_NFAPI_P7_PNF_ADDRESS_IPV6_TAG;
+	num_tlv++;
+
+	SET_TLV(in.nfapi_config.p7_pnf_port, NFAPI_NFAPI_P7_PNF_PORT_TAG, 9999);
+	SET_TLV(in.nfapi_config.dl_ue_per_sf, NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, 4);
+	SET_TLV(in.nfapi_config.ul_ue_per_sf, NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG, 4);
+
+	in.nfapi_config.rf_bands.tl.tag = NFAPI_PHY_RF_BANDS_TAG;
+	in.nfapi_config.rf_bands.number_rf_bands = 2;
+	in.nfapi_config.rf_bands.rf_band[0] = 783;
+	num_tlv++;
+
+	SET_TLV(in.nfapi_config.timing_window, NFAPI_NFAPI_TIMING_WINDOW_TAG, 29);
+	SET_TLV(in.nfapi_config.timing_info_mode, NFAPI_NFAPI_TIMING_INFO_MODE_TAG, 2);
+	SET_TLV(in.nfapi_config.timing_info_period, NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG, 23);
+	SET_TLV(in.nfapi_config.max_transmit_power, NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, 123);
+	SET_TLV(in.nfapi_config.earfcn, NFAPI_NFAPI_EARFCN_TAG, 1800);
+
+	in.nfapi_config.nmm_gsm_frequency_bands.tl.tag = NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG;
+	in.nfapi_config.nmm_gsm_frequency_bands.number_of_rf_bands = 2;
+	num_tlv++;
+
+	in.nfapi_config.nmm_umts_frequency_bands.tl.tag = NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG;
+	in.nfapi_config.nmm_umts_frequency_bands.number_of_rf_bands = 3;
+	num_tlv++;
+
+	in.nfapi_config.nmm_lte_frequency_bands.tl.tag = NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG;
+	in.nfapi_config.nmm_lte_frequency_bands.number_of_rf_bands = 1;
+	num_tlv++;
+
+	SET_TLV(in.nfapi_config.nmm_uplink_rssi_supported, NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG, 1);
+
+
+	in.num_tlv = num_tlv;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+	CU_ASSERT_EQUAL(in.num_tlv, out.num_tlv);
+
+	ASSERT_TLV(in.l1_status.phy_state, out.l1_status.phy_state);
+	ASSERT_TLV(in.phy_capabilities.dl_bandwidth_support, out.phy_capabilities.dl_bandwidth_support);
+	ASSERT_TLV(in.phy_capabilities.ul_bandwidth_support, out.phy_capabilities.ul_bandwidth_support);
+	ASSERT_TLV(in.phy_capabilities.dl_modulation_support, out.phy_capabilities.dl_modulation_support);
+	ASSERT_TLV(in.phy_capabilities.ul_modulation_support, out.phy_capabilities.ul_modulation_support);
+	ASSERT_TLV(in.phy_capabilities.phy_antenna_capability, out.phy_capabilities.phy_antenna_capability);
+	ASSERT_TLV(in.phy_capabilities.release_capability, out.phy_capabilities.release_capability);
+	ASSERT_TLV(in.phy_capabilities.mbsfn_capability, out.phy_capabilities.mbsfn_capability);
+
+	ASSERT_TLV(in.laa_capability.laa_support, in.laa_capability.laa_support);
+	ASSERT_TLV(in.laa_capability.pd_sensing_lbt_support, in.laa_capability.pd_sensing_lbt_support);
+	ASSERT_TLV(in.laa_capability.multi_carrier_lbt_support, in.laa_capability.multi_carrier_lbt_support);
+	ASSERT_TLV(in.laa_capability.partial_sf_support, in.laa_capability.partial_sf_support);
+
+	ASSERT_TLV(in.subframe_config.duplex_mode, out.subframe_config.duplex_mode);
+	ASSERT_TLV(in.subframe_config.pcfich_power_offset, out.subframe_config.pcfich_power_offset);
+	ASSERT_TLV(in.subframe_config.pb, out.subframe_config.pb);
+	ASSERT_TLV(in.subframe_config.dl_cyclic_prefix_type, out.subframe_config.dl_cyclic_prefix_type);
+	ASSERT_TLV(in.subframe_config.ul_cyclic_prefix_type, out.subframe_config.ul_cyclic_prefix_type);
+
+	ASSERT_TLV(in.rf_config.dl_channel_bandwidth, out.rf_config.dl_channel_bandwidth);
+	ASSERT_TLV(in.rf_config.ul_channel_bandwidth, out.rf_config.ul_channel_bandwidth);
+	ASSERT_TLV(in.rf_config.reference_signal_power, out.rf_config.reference_signal_power);
+	ASSERT_TLV(in.rf_config.tx_antenna_ports, out.rf_config.tx_antenna_ports);
+	ASSERT_TLV(in.rf_config.rx_antenna_ports, out.rf_config.rx_antenna_ports);
+
+	ASSERT_TLV(in.phich_config.phich_resource, out.phich_config.phich_resource);
+	ASSERT_TLV(in.phich_config.phich_duration, out.phich_config.phich_duration);
+	ASSERT_TLV(in.phich_config.phich_power_offset, out.phich_config.phich_power_offset);
+
+	ASSERT_TLV(in.sch_config.primary_synchronization_signal_epre_eprers, out.sch_config.primary_synchronization_signal_epre_eprers);
+	ASSERT_TLV(in.sch_config.secondary_synchronization_signal_epre_eprers, out.sch_config.secondary_synchronization_signal_epre_eprers);
+	ASSERT_TLV(in.sch_config.physical_cell_id, out.sch_config.physical_cell_id);
+
+
+	ASSERT_TLV(in.prach_config.configuration_index, out.prach_config.configuration_index);
+	ASSERT_TLV(in.prach_config.root_sequence_index, out.prach_config.root_sequence_index);
+	ASSERT_TLV(in.prach_config.zero_correlation_zone_configuration, out.prach_config.zero_correlation_zone_configuration);
+	ASSERT_TLV(in.prach_config.high_speed_flag, out.prach_config.high_speed_flag);
+	ASSERT_TLV(in.prach_config.frequency_offset, out.prach_config.frequency_offset);
+	
+	ASSERT_TLV(in.pusch_config.hopping_mode, in.pusch_config.hopping_mode);
+	ASSERT_TLV(in.pusch_config.hopping_offset, in.pusch_config.hopping_offset);
+	ASSERT_TLV(in.pusch_config.number_of_subbands, in.pusch_config.number_of_subbands);
+
+	ASSERT_TLV(in.pucch_config.delta_pucch_shift, out.pucch_config.delta_pucch_shift);
+	ASSERT_TLV(in.pucch_config.n_cqi_rb, out.pucch_config.n_cqi_rb);
+	ASSERT_TLV(in.pucch_config.n_an_cs, out.pucch_config.n_an_cs);
+	ASSERT_TLV(in.pucch_config.n1_pucch_an, out.pucch_config.n1_pucch_an);
+
+	ASSERT_TLV(in.srs_config.bandwidth_configuration, out.srs_config.bandwidth_configuration);
+	ASSERT_TLV(in.srs_config.max_up_pts, out.srs_config.max_up_pts);
+	ASSERT_TLV(in.srs_config.srs_subframe_configuration, out.srs_config.srs_subframe_configuration);
+	ASSERT_TLV(in.srs_config.srs_acknack_srs_simultaneous_transmission, out.srs_config.srs_acknack_srs_simultaneous_transmission);
+
+	ASSERT_TLV(in.uplink_reference_signal_config.uplink_rs_hopping, out.uplink_reference_signal_config.uplink_rs_hopping);
+	ASSERT_TLV(in.uplink_reference_signal_config.group_assignment, out.uplink_reference_signal_config.group_assignment);
+	ASSERT_TLV(in.uplink_reference_signal_config.cyclic_shift_1_for_drms, out.uplink_reference_signal_config.cyclic_shift_1_for_drms);
+
+	ASSERT_TLV(in.tdd_frame_structure_config.subframe_assignment, out.tdd_frame_structure_config.subframe_assignment);
+	ASSERT_TLV(in.tdd_frame_structure_config.special_subframe_patterns, out.tdd_frame_structure_config.special_subframe_patterns);
+
+	ASSERT_TLV(in.l23_config.data_report_mode, out.l23_config.data_report_mode);
+	ASSERT_TLV(in.l23_config.sfnsf, out.l23_config.sfnsf);
+
+	CU_ASSERT_EQUAL(in.nfapi_config.p7_vnf_address_ipv4.tl.tag, out.nfapi_config.p7_vnf_address_ipv4.tl.tag);
+	for(idx = 0; idx < NFAPI_IPV4_ADDRESS_LENGTH; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.p7_vnf_address_ipv4.address[idx], out.nfapi_config.p7_vnf_address_ipv4.address[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.nfapi_config.p7_vnf_address_ipv6.tl.tag, out.nfapi_config.p7_vnf_address_ipv6.tl.tag);
+	for(idx = 0; idx < NFAPI_IPV6_ADDRESS_LENGTH; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.p7_vnf_address_ipv6.address[idx], out.nfapi_config.p7_vnf_address_ipv6.address[idx]);
+	}
+
+	ASSERT_TLV(in.nfapi_config.p7_vnf_port, out.nfapi_config.p7_vnf_port);
+	
+	CU_ASSERT_EQUAL(in.nfapi_config.p7_pnf_address_ipv4.tl.tag, out.nfapi_config.p7_pnf_address_ipv4.tl.tag);
+	for(idx = 0; idx < NFAPI_IPV4_ADDRESS_LENGTH; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.p7_pnf_address_ipv4.address[idx], out.nfapi_config.p7_pnf_address_ipv4.address[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.nfapi_config.p7_pnf_address_ipv6.tl.tag, out.nfapi_config.p7_pnf_address_ipv6.tl.tag);
+	for(idx = 0; idx < NFAPI_IPV6_ADDRESS_LENGTH; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.p7_pnf_address_ipv6.address[idx], out.nfapi_config.p7_pnf_address_ipv6.address[idx]);
+	}
+
+	ASSERT_TLV(in.nfapi_config.p7_pnf_port, out.nfapi_config.p7_pnf_port);
+	ASSERT_TLV(in.nfapi_config.dl_ue_per_sf, out.nfapi_config.dl_ue_per_sf);
+	ASSERT_TLV(in.nfapi_config.ul_ue_per_sf, out.nfapi_config.ul_ue_per_sf);
+
+	CU_ASSERT_EQUAL(in.nfapi_config.rf_bands.tl.tag, out.nfapi_config.rf_bands.tl.tag);
+	CU_ASSERT_EQUAL(in.nfapi_config.rf_bands.number_rf_bands, out.nfapi_config.rf_bands.number_rf_bands);
+	for(idx = 0; idx < out.nfapi_config.rf_bands.number_rf_bands; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.rf_bands.rf_band[idx], out.nfapi_config.rf_bands.rf_band[idx]);
+	}
+
+	ASSERT_TLV(in.nfapi_config.timing_window, out.nfapi_config.timing_window);
+	ASSERT_TLV(in.nfapi_config.timing_info_mode, out.nfapi_config.timing_info_mode);
+	ASSERT_TLV(in.nfapi_config.timing_info_period, out.nfapi_config.timing_info_period);
+	ASSERT_TLV(in.nfapi_config.max_transmit_power, out.nfapi_config.max_transmit_power);
+	ASSERT_TLV(in.nfapi_config.earfcn, out.nfapi_config.earfcn); 
+
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_gsm_frequency_bands.tl.tag, out.nfapi_config.nmm_gsm_frequency_bands.tl.tag);
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_gsm_frequency_bands.number_of_rf_bands, out.nfapi_config.nmm_gsm_frequency_bands.number_of_rf_bands);
+	for(idx = 0; idx < out.nfapi_config.nmm_gsm_frequency_bands.number_of_rf_bands; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.nmm_gsm_frequency_bands.bands[idx], out.nfapi_config.nmm_gsm_frequency_bands.bands[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_umts_frequency_bands.tl.tag, out.nfapi_config.nmm_umts_frequency_bands.tl.tag);
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_umts_frequency_bands.number_of_rf_bands, out.nfapi_config.nmm_umts_frequency_bands.number_of_rf_bands);
+	for(idx = 0; idx < out.nfapi_config.nmm_umts_frequency_bands.number_of_rf_bands; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.nmm_umts_frequency_bands.bands[idx], out.nfapi_config.nmm_umts_frequency_bands.bands[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_lte_frequency_bands.tl.tag, out.nfapi_config.nmm_lte_frequency_bands.tl.tag);
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_lte_frequency_bands.number_of_rf_bands, out.nfapi_config.nmm_lte_frequency_bands.number_of_rf_bands);
+	for(idx = 0; idx < out.nfapi_config.nmm_lte_frequency_bands.number_of_rf_bands; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.nmm_lte_frequency_bands.bands[idx], out.nfapi_config.nmm_lte_frequency_bands.bands[idx]);
+	}
+
+	ASSERT_TLV(in.nfapi_config.nmm_uplink_rssi_supported, out.nfapi_config.nmm_uplink_rssi_supported); 
+}
+void nfapi_test_config_request()
+{
+	#define SET_TLV(_TLV, _TAG, _VALUE) { _TLV.tl.tag = _TAG; _TLV.value = _VALUE; num_tlv++;	}
+	#define ASSERT_TLV(IN_TLV, OUT_TLV) { CU_ASSERT_EQUAL(IN_TLV.tl.tag, OUT_TLV.tl.tag); CU_ASSERT_EQUAL(IN_TLV.value, OUT_TLV.value);}
+
+	nfapi_config_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_config_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CONFIG_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+
+	uint16_t idx = 0;
+	uint16_t num_tlv = 0; // Bit of a hack, it is incremented in the SET_UINT16_TLV macro
+
+	SET_TLV(in.subframe_config.duplex_mode, NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG, 1);
+	SET_TLV(in.subframe_config.pcfich_power_offset, NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG, 1000);
+	SET_TLV(in.subframe_config.pb, NFAPI_SUBFRAME_CONFIG_PB_TAG, 1);
+	SET_TLV(in.subframe_config.dl_cyclic_prefix_type, NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG, 0);
+	SET_TLV(in.subframe_config.ul_cyclic_prefix_type, NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG, 0);
+
+	SET_TLV(in.rf_config.dl_channel_bandwidth, NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG, 50);
+	SET_TLV(in.rf_config.ul_channel_bandwidth, NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG, 50);
+	SET_TLV(in.rf_config.reference_signal_power, NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG, 120);
+	SET_TLV(in.rf_config.tx_antenna_ports, NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG, 2);
+	SET_TLV(in.rf_config.rx_antenna_ports, NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG, 2);
+
+	SET_TLV(in.phich_config.phich_resource, NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG, 3);
+	SET_TLV(in.phich_config.phich_duration, NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG, 0);
+	SET_TLV(in.phich_config.phich_power_offset, NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG, 500);
+
+	SET_TLV(in.sch_config.primary_synchronization_signal_epre_eprers, NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, 1000);
+	SET_TLV(in.sch_config.secondary_synchronization_signal_epre_eprers, NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG, 2000);
+	SET_TLV(in.sch_config.physical_cell_id, NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG, 12344);
+
+
+	SET_TLV(in.prach_config.configuration_index, NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG, 63);
+	SET_TLV(in.prach_config.root_sequence_index, NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG, 800);
+	SET_TLV(in.prach_config.zero_correlation_zone_configuration, NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG, 14);
+	SET_TLV(in.prach_config.high_speed_flag, NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG, 0);
+	SET_TLV(in.prach_config.frequency_offset, NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG, 23);
+
+	SET_TLV(in.pusch_config.hopping_mode, NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG, 0);
+	SET_TLV(in.pusch_config.hopping_offset, NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG, 55);
+	SET_TLV(in.pusch_config.number_of_subbands, NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG, 1);
+
+	SET_TLV(in.pucch_config.delta_pucch_shift, NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG, 2);
+	SET_TLV(in.pucch_config.n_cqi_rb, NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG, 88);
+	SET_TLV(in.pucch_config.n_an_cs, NFAPI_PUCCH_CONFIG_N_AN_CS_TAG, 3);
+	SET_TLV(in.pucch_config.n1_pucch_an, NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG, 2015);
+
+	SET_TLV(in.srs_config.bandwidth_configuration, NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG, 3);
+	SET_TLV(in.srs_config.max_up_pts, NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG, 0);
+	SET_TLV(in.srs_config.srs_subframe_configuration, NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG, 11);
+	SET_TLV(in.srs_config.srs_acknack_srs_simultaneous_transmission, NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG, 1);
+
+	SET_TLV(in.uplink_reference_signal_config.uplink_rs_hopping, NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG, 2);
+	SET_TLV(in.uplink_reference_signal_config.group_assignment, NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG, 22);
+	SET_TLV(in.uplink_reference_signal_config.cyclic_shift_1_for_drms, NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG, 2);
+
+
+	// laa config
+	SET_TLV(in.laa_config.ed_threshold_lbt_pdsch, NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_PDSCH_TAG, 45);
+	SET_TLV(in.laa_config.ed_threshold_lbt_drs, NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_DRS_TAG, 69);
+	SET_TLV(in.laa_config.pd_threshold, NFAPI_LAA_CONFIG_PD_THRESHOLD_TAG, 65535);
+	SET_TLV(in.laa_config.multi_carrier_type, NFAPI_LAA_CONFIG_MULTI_CARRIER_TYPE_TAG, 3);
+	SET_TLV(in.laa_config.multi_carrier_tx, NFAPI_LAA_CONFIG_MULTI_CARRIER_TX_TAG, 1);
+	SET_TLV(in.laa_config.multi_carrier_freeze, NFAPI_LAA_CONFIG_MULTI_CARRIER_FREEZE_TAG, 0);
+	SET_TLV(in.laa_config.tx_antenna_ports_drs, NFAPI_LAA_CONFIG_TX_ANTENNA_PORTS_FOR_DRS_TAG, 4);
+	SET_TLV(in.laa_config.tx_power_drs, NFAPI_LAA_CONFIG_TRANSMISSION_POWER_FOR_DRS_TAG, 10000);
+	//
+	// emtc config
+	SET_TLV(in.emtc_config.pbch_repetitions_enable_r13, NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG, 1);
+	SET_TLV(in.emtc_config.prach_catm_root_sequence_index, NFAPI_EMTC_CONFIG_PRACH_CATM_ROOT_SEQUENCE_INDEX_TAG, 837); 
+	SET_TLV(in.emtc_config.prach_catm_zero_correlation_zone_configuration, NFAPI_EMTC_CONFIG_PRACH_CATM_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG, 15); 
+	SET_TLV(in.emtc_config.prach_catm_high_speed_flag, NFAPI_EMTC_CONFIG_PRACH_CATM_HIGH_SPEED_FLAG, 15); 
+	SET_TLV(in.emtc_config.prach_ce_level_0_enable, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG, 1); 
+	SET_TLV(in.emtc_config.prach_ce_level_0_configuration_index, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG, 60);
+	SET_TLV(in.emtc_config.prach_ce_level_0_frequency_offset, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG, 90);
+	SET_TLV(in.emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, 128);
+	SET_TLV(in.emtc_config.prach_ce_level_0_starting_subframe_periodicity, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG, 256);
+	SET_TLV(in.emtc_config.prach_ce_level_0_hopping_enable, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG, 1);
+	SET_TLV(in.emtc_config.prach_ce_level_0_hopping_offset, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG, 0);
+	SET_TLV(in.emtc_config.prach_ce_level_1_enable, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG, 1);
+	SET_TLV(in.emtc_config.prach_ce_level_1_configuration_index, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG, 45);
+	SET_TLV(in.emtc_config.prach_ce_level_1_frequency_offset, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG, 88);
+	SET_TLV(in.emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, 64);
+	SET_TLV(in.emtc_config.prach_ce_level_1_starting_subframe_periodicity, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG, 0xFFFF);
+	SET_TLV(in.emtc_config.prach_ce_level_1_hopping_enable, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG, 1);
+	SET_TLV(in.emtc_config.prach_ce_level_1_hopping_offset, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG, 22);
+	SET_TLV(in.emtc_config.prach_ce_level_2_enable, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG, 1);
+	SET_TLV(in.emtc_config.prach_ce_level_2_configuration_index, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG, 63);
+	SET_TLV(in.emtc_config.prach_ce_level_2_frequency_offset, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG, 22);
+	SET_TLV(in.emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, 8);
+	SET_TLV(in.emtc_config.prach_ce_level_2_starting_subframe_periodicity, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG, 64)
+	SET_TLV(in.emtc_config.prach_ce_level_2_hopping_enable, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG, 1);
+	SET_TLV(in.emtc_config.prach_ce_level_2_hopping_offset, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG, 45);
+	SET_TLV(in.emtc_config.prach_ce_level_3_enable, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG, 0);
+	SET_TLV(in.emtc_config.prach_ce_level_3_configuration_index, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG, 45);
+	SET_TLV(in.emtc_config.prach_ce_level_3_frequency_offset, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG, 22);
+	SET_TLV(in.emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG, 4); 
+	SET_TLV(in.emtc_config.prach_ce_level_3_starting_subframe_periodicity, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG, 4);
+	SET_TLV(in.emtc_config.prach_ce_level_3_hopping_enable, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG, 0); 
+	SET_TLV(in.emtc_config.prach_ce_level_3_hopping_offset, NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG, 0);
+	SET_TLV(in.emtc_config.pucch_interval_ulhoppingconfigcommonmodea, NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG, 8);
+	SET_TLV(in.emtc_config.pucch_interval_ulhoppingconfigcommonmodeb, NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG, 8);
+
+
+	SET_TLV(in.tdd_frame_structure_config.subframe_assignment, NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG, 5);
+	SET_TLV(in.tdd_frame_structure_config.special_subframe_patterns, NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG, 3);
+
+	SET_TLV(in.l23_config.data_report_mode, NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG, 1);
+	SET_TLV(in.l23_config.sfnsf, NFAPI_L23_CONFIG_SFNSF_TAG, 12354);
+
+	in.nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
+	num_tlv++;
+
+	in.nfapi_config.p7_vnf_address_ipv6.tl.tag = NFAPI_NFAPI_P7_VNF_ADDRESS_IPV6_TAG;
+	num_tlv++;
+
+	SET_TLV(in.nfapi_config.p7_vnf_port, NFAPI_NFAPI_P7_VNF_PORT_TAG, 1111);
+	
+	in.nfapi_config.p7_pnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG;
+	num_tlv++;
+
+	in.nfapi_config.p7_pnf_address_ipv6.tl.tag = NFAPI_NFAPI_P7_PNF_ADDRESS_IPV6_TAG;
+	for(idx = 0; idx < NFAPI_IPV6_ADDRESS_LENGTH; ++idx)
+	{
+		in.nfapi_config.p7_pnf_address_ipv6.address[idx] = idx;
+	}
+	num_tlv++;
+
+	SET_TLV(in.nfapi_config.p7_pnf_port, NFAPI_NFAPI_P7_PNF_PORT_TAG, 9999);
+	SET_TLV(in.nfapi_config.dl_ue_per_sf, NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, 4);
+	SET_TLV(in.nfapi_config.ul_ue_per_sf, NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG, 4);
+
+	in.nfapi_config.rf_bands.tl.tag = NFAPI_PHY_RF_BANDS_TAG;
+	in.nfapi_config.rf_bands.number_rf_bands = 2;
+	in.nfapi_config.rf_bands.rf_band[0] = 783;
+	num_tlv++;
+
+	SET_TLV(in.nfapi_config.timing_window, NFAPI_NFAPI_TIMING_WINDOW_TAG, 29);
+	SET_TLV(in.nfapi_config.timing_info_mode, NFAPI_NFAPI_TIMING_INFO_MODE_TAG, 2);
+	SET_TLV(in.nfapi_config.timing_info_period, NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG, 23);
+	SET_TLV(in.nfapi_config.max_transmit_power, NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, 123);
+	SET_TLV(in.nfapi_config.earfcn, NFAPI_NFAPI_EARFCN_TAG, 1800);
+
+	in.nfapi_config.nmm_gsm_frequency_bands.tl.tag = NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG;
+	in.nfapi_config.nmm_gsm_frequency_bands.number_of_rf_bands = 2;
+	num_tlv++;
+
+	in.nfapi_config.nmm_umts_frequency_bands.tl.tag = NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG;
+	in.nfapi_config.nmm_umts_frequency_bands.number_of_rf_bands = 3;
+	num_tlv++;
+
+	in.nfapi_config.nmm_lte_frequency_bands.tl.tag = NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG;
+	in.nfapi_config.nmm_lte_frequency_bands.number_of_rf_bands = 1;
+	num_tlv++;
+
+	SET_TLV(in.nfapi_config.nmm_uplink_rssi_supported, NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG, 1);
+
+
+	in.num_tlv = num_tlv;
+
+	in.vendor_extension = 0;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.num_tlv, out.num_tlv);
+
+	ASSERT_TLV(in.subframe_config.duplex_mode, out.subframe_config.duplex_mode);
+	ASSERT_TLV(in.subframe_config.pcfich_power_offset, out.subframe_config.pcfich_power_offset);
+	ASSERT_TLV(in.subframe_config.pb, out.subframe_config.pb);
+	ASSERT_TLV(in.subframe_config.dl_cyclic_prefix_type, out.subframe_config.dl_cyclic_prefix_type);
+	ASSERT_TLV(in.subframe_config.ul_cyclic_prefix_type, out.subframe_config.ul_cyclic_prefix_type);
+
+	ASSERT_TLV(in.rf_config.dl_channel_bandwidth, out.rf_config.dl_channel_bandwidth);
+	ASSERT_TLV(in.rf_config.ul_channel_bandwidth, out.rf_config.ul_channel_bandwidth);
+	ASSERT_TLV(in.rf_config.reference_signal_power, out.rf_config.reference_signal_power);
+	ASSERT_TLV(in.rf_config.tx_antenna_ports, out.rf_config.tx_antenna_ports);
+	ASSERT_TLV(in.rf_config.rx_antenna_ports, out.rf_config.rx_antenna_ports);
+
+	ASSERT_TLV(in.phich_config.phich_resource, out.phich_config.phich_resource);
+	ASSERT_TLV(in.phich_config.phich_duration, out.phich_config.phich_duration);
+	ASSERT_TLV(in.phich_config.phich_power_offset, out.phich_config.phich_power_offset);
+
+	ASSERT_TLV(in.sch_config.primary_synchronization_signal_epre_eprers, out.sch_config.primary_synchronization_signal_epre_eprers);
+	ASSERT_TLV(in.sch_config.secondary_synchronization_signal_epre_eprers, out.sch_config.secondary_synchronization_signal_epre_eprers);
+	ASSERT_TLV(in.sch_config.physical_cell_id, out.sch_config.physical_cell_id);
+
+
+	ASSERT_TLV(in.prach_config.configuration_index, out.prach_config.configuration_index);
+	ASSERT_TLV(in.prach_config.root_sequence_index, out.prach_config.root_sequence_index);
+	ASSERT_TLV(in.prach_config.zero_correlation_zone_configuration, out.prach_config.zero_correlation_zone_configuration);
+	ASSERT_TLV(in.prach_config.high_speed_flag, out.prach_config.high_speed_flag);
+	ASSERT_TLV(in.prach_config.frequency_offset, out.prach_config.frequency_offset);
+	
+	ASSERT_TLV(in.pusch_config.hopping_mode, in.pusch_config.hopping_mode);
+	ASSERT_TLV(in.pusch_config.hopping_offset, in.pusch_config.hopping_offset);
+	ASSERT_TLV(in.pusch_config.number_of_subbands, in.pusch_config.number_of_subbands);
+
+	ASSERT_TLV(in.pucch_config.delta_pucch_shift, out.pucch_config.delta_pucch_shift);
+	ASSERT_TLV(in.pucch_config.n_cqi_rb, out.pucch_config.n_cqi_rb);
+	ASSERT_TLV(in.pucch_config.n_an_cs, out.pucch_config.n_an_cs);
+	ASSERT_TLV(in.pucch_config.n1_pucch_an, out.pucch_config.n1_pucch_an);
+
+	ASSERT_TLV(in.srs_config.bandwidth_configuration, out.srs_config.bandwidth_configuration);
+	ASSERT_TLV(in.srs_config.max_up_pts, out.srs_config.max_up_pts);
+	ASSERT_TLV(in.srs_config.srs_subframe_configuration, out.srs_config.srs_subframe_configuration);
+	ASSERT_TLV(in.srs_config.srs_acknack_srs_simultaneous_transmission, out.srs_config.srs_acknack_srs_simultaneous_transmission);
+
+	ASSERT_TLV(in.uplink_reference_signal_config.uplink_rs_hopping, out.uplink_reference_signal_config.uplink_rs_hopping);
+	ASSERT_TLV(in.uplink_reference_signal_config.group_assignment, out.uplink_reference_signal_config.group_assignment);
+	ASSERT_TLV(in.uplink_reference_signal_config.cyclic_shift_1_for_drms, out.uplink_reference_signal_config.cyclic_shift_1_for_drms);
+
+	ASSERT_TLV(in.tdd_frame_structure_config.subframe_assignment, out.tdd_frame_structure_config.subframe_assignment);
+	ASSERT_TLV(in.tdd_frame_structure_config.special_subframe_patterns, out.tdd_frame_structure_config.special_subframe_patterns);
+
+	// laa config
+	ASSERT_TLV(in.laa_config.ed_threshold_lbt_pdsch, out.laa_config.ed_threshold_lbt_pdsch);
+	ASSERT_TLV(in.laa_config.ed_threshold_lbt_drs, out.laa_config.ed_threshold_lbt_drs);
+	ASSERT_TLV(in.laa_config.pd_threshold, out.laa_config.pd_threshold);
+	ASSERT_TLV(in.laa_config.multi_carrier_type, out.laa_config.multi_carrier_type);
+	ASSERT_TLV(in.laa_config.multi_carrier_tx, out.laa_config.multi_carrier_tx);
+	ASSERT_TLV(in.laa_config.multi_carrier_freeze, out.laa_config.multi_carrier_freeze);
+	ASSERT_TLV(in.laa_config.tx_antenna_ports_drs, out.laa_config.tx_antenna_ports_drs);
+	ASSERT_TLV(in.laa_config.tx_power_drs, out.laa_config.tx_power_drs);
+	// emtc config
+	ASSERT_TLV(in.emtc_config.pbch_repetitions_enable_r13, out.emtc_config.pbch_repetitions_enable_r13);
+	ASSERT_TLV(in.emtc_config.prach_catm_root_sequence_index, out.emtc_config.prach_catm_root_sequence_index);
+	ASSERT_TLV(in.emtc_config.prach_catm_zero_correlation_zone_configuration, out.emtc_config.prach_catm_zero_correlation_zone_configuration);
+	ASSERT_TLV(in.emtc_config.prach_catm_high_speed_flag, out.emtc_config.prach_catm_high_speed_flag);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_0_enable, out.emtc_config.prach_ce_level_0_enable);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_0_configuration_index, out.emtc_config.prach_ce_level_0_configuration_index);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_0_frequency_offset, out.emtc_config.prach_ce_level_0_frequency_offset);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt, out.emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_0_starting_subframe_periodicity, out.emtc_config.prach_ce_level_0_starting_subframe_periodicity);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_0_hopping_enable, out.emtc_config.prach_ce_level_0_hopping_enable);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_0_hopping_offset, out.emtc_config.prach_ce_level_0_hopping_offset);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_1_enable, out.emtc_config.prach_ce_level_1_enable);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_1_configuration_index, out.emtc_config.prach_ce_level_1_configuration_index);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_1_frequency_offset, out.emtc_config.prach_ce_level_1_frequency_offset);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt, out.emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_1_starting_subframe_periodicity, out.emtc_config.prach_ce_level_1_starting_subframe_periodicity);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_1_hopping_enable, out.emtc_config.prach_ce_level_1_hopping_enable);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_1_hopping_offset, out.emtc_config.prach_ce_level_1_hopping_offset);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_2_enable, out.emtc_config.prach_ce_level_2_enable);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_2_configuration_index, out.emtc_config.prach_ce_level_2_configuration_index);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_2_frequency_offset, out.emtc_config.prach_ce_level_2_frequency_offset);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt, out.emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_2_starting_subframe_periodicity, out.emtc_config.prach_ce_level_2_starting_subframe_periodicity);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_2_hopping_enable, out.emtc_config.prach_ce_level_2_hopping_enable);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_2_hopping_offset, out.emtc_config.prach_ce_level_2_hopping_offset);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_3_enable, out.emtc_config.prach_ce_level_3_enable);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_3_configuration_index, out.emtc_config.prach_ce_level_3_configuration_index);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_3_frequency_offset, out.emtc_config.prach_ce_level_3_frequency_offset);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt, out.emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_3_starting_subframe_periodicity, out.emtc_config.prach_ce_level_3_starting_subframe_periodicity);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_3_hopping_enable, out.emtc_config.prach_ce_level_3_hopping_enable);
+	ASSERT_TLV(in.emtc_config.prach_ce_level_3_hopping_offset, out.emtc_config.prach_ce_level_3_hopping_offset);
+	ASSERT_TLV(in.emtc_config.pucch_interval_ulhoppingconfigcommonmodea, out.emtc_config.pucch_interval_ulhoppingconfigcommonmodea);
+	ASSERT_TLV(in.emtc_config.pucch_interval_ulhoppingconfigcommonmodeb, out.emtc_config.pucch_interval_ulhoppingconfigcommonmodeb);
+
+	ASSERT_TLV(in.l23_config.data_report_mode, out.l23_config.data_report_mode);
+	ASSERT_TLV(in.l23_config.sfnsf, out.l23_config.sfnsf);
+
+	CU_ASSERT_EQUAL(in.nfapi_config.p7_vnf_address_ipv4.tl.tag, out.nfapi_config.p7_vnf_address_ipv4.tl.tag);
+	for(idx = 0; idx < NFAPI_IPV4_ADDRESS_LENGTH; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.p7_vnf_address_ipv4.address[idx], out.nfapi_config.p7_vnf_address_ipv4.address[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.nfapi_config.p7_vnf_address_ipv6.tl.tag, out.nfapi_config.p7_vnf_address_ipv6.tl.tag);
+	for(idx = 0; idx < NFAPI_IPV6_ADDRESS_LENGTH; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.p7_vnf_address_ipv6.address[idx], out.nfapi_config.p7_vnf_address_ipv6.address[idx]);
+	}
+
+	ASSERT_TLV(in.nfapi_config.p7_vnf_port, out.nfapi_config.p7_vnf_port);
+	
+	CU_ASSERT_EQUAL(in.nfapi_config.p7_pnf_address_ipv4.tl.tag, out.nfapi_config.p7_pnf_address_ipv4.tl.tag);
+	for(idx = 0; idx < NFAPI_IPV4_ADDRESS_LENGTH; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.p7_pnf_address_ipv4.address[idx], out.nfapi_config.p7_pnf_address_ipv4.address[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.nfapi_config.p7_pnf_address_ipv6.tl.tag, out.nfapi_config.p7_pnf_address_ipv6.tl.tag);
+	for(idx = 0; idx < NFAPI_IPV6_ADDRESS_LENGTH; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.p7_pnf_address_ipv6.address[idx], out.nfapi_config.p7_pnf_address_ipv6.address[idx]);
+	}
+
+	ASSERT_TLV(in.nfapi_config.p7_pnf_port, out.nfapi_config.p7_pnf_port);
+	ASSERT_TLV(in.nfapi_config.dl_ue_per_sf, out.nfapi_config.dl_ue_per_sf);
+	ASSERT_TLV(in.nfapi_config.ul_ue_per_sf, out.nfapi_config.ul_ue_per_sf);
+
+	CU_ASSERT_EQUAL(in.nfapi_config.rf_bands.tl.tag, out.nfapi_config.rf_bands.tl.tag);
+	CU_ASSERT_EQUAL(in.nfapi_config.rf_bands.number_rf_bands, out.nfapi_config.rf_bands.number_rf_bands);
+	for(idx = 0; idx < out.nfapi_config.rf_bands.number_rf_bands; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.rf_bands.rf_band[idx], out.nfapi_config.rf_bands.rf_band[idx]);
+	}
+
+	ASSERT_TLV(in.nfapi_config.timing_window, out.nfapi_config.timing_window);
+	ASSERT_TLV(in.nfapi_config.timing_info_mode, out.nfapi_config.timing_info_mode);
+	ASSERT_TLV(in.nfapi_config.timing_info_period, out.nfapi_config.timing_info_period);
+	ASSERT_TLV(in.nfapi_config.max_transmit_power, out.nfapi_config.max_transmit_power);
+	ASSERT_TLV(in.nfapi_config.earfcn, out.nfapi_config.earfcn); 
+
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_gsm_frequency_bands.tl.tag, out.nfapi_config.nmm_gsm_frequency_bands.tl.tag);
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_gsm_frequency_bands.number_of_rf_bands, out.nfapi_config.nmm_gsm_frequency_bands.number_of_rf_bands);
+	for(idx = 0; idx < out.nfapi_config.nmm_gsm_frequency_bands.number_of_rf_bands; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.nmm_gsm_frequency_bands.bands[idx], out.nfapi_config.nmm_gsm_frequency_bands.bands[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_umts_frequency_bands.tl.tag, out.nfapi_config.nmm_umts_frequency_bands.tl.tag);
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_umts_frequency_bands.number_of_rf_bands, out.nfapi_config.nmm_umts_frequency_bands.number_of_rf_bands);
+	for(idx = 0; idx < out.nfapi_config.nmm_umts_frequency_bands.number_of_rf_bands; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.nmm_umts_frequency_bands.bands[idx], out.nfapi_config.nmm_umts_frequency_bands.bands[idx]);
+	}
+
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_lte_frequency_bands.tl.tag, out.nfapi_config.nmm_lte_frequency_bands.tl.tag);
+	CU_ASSERT_EQUAL(in.nfapi_config.nmm_lte_frequency_bands.number_of_rf_bands, out.nfapi_config.nmm_lte_frequency_bands.number_of_rf_bands);
+	for(idx = 0; idx < out.nfapi_config.nmm_lte_frequency_bands.number_of_rf_bands; ++idx)
+	{
+		CU_ASSERT_EQUAL(in.nfapi_config.nmm_lte_frequency_bands.bands[idx], out.nfapi_config.nmm_lte_frequency_bands.bands[idx]);
+	}
+
+	ASSERT_TLV(in.nfapi_config.nmm_uplink_rssi_supported, out.nfapi_config.nmm_uplink_rssi_supported); 
+}
+void nfapi_test_config_response()
+{
+	nfapi_config_response_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_config_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CONFIG_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_MSG_OK;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+void nfapi_test_start_request()
+{
+	nfapi_start_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_start_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_START_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+}
+void nfapi_test_start_response()
+{
+	nfapi_start_response_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_start_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_START_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_MSG_OK;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+void nfapi_test_stop_request()
+{
+	nfapi_stop_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_stop_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_STOP_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+
+}
+void nfapi_test_stop_response()
+{
+	nfapi_stop_response_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_stop_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_STOP_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_MSG_OK;
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+}
+void nfapi_test_measurement_request()
+{
+//	#define SET_TLV(_TLV, _TAG, _VALUE) { _TLV.tl.tag = _TAG; _TLV.value = _VALUE; }
+//	#define ASSERT_TLV(IN_TLV, OUT_TLV) { CU_ASSERT_EQUAL(IN_TLV.tl.tag, OUT_TLV.tl.tag); CU_ASSERT_EQUAL(IN_TLV.value, OUT_TLV.value);}
+	uint16_t num_tlv = 0;
+	nfapi_measurement_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_measurement_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_MEASUREMENT_REQUEST;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	SET_TLV(in.dl_rs_tx_power, NFAPI_MEASUREMENT_REQUEST_DL_RS_XTX_POWER_TAG, 1);
+	SET_TLV(in.received_interference_power, NFAPI_MEASUREMENT_REQUEST_RECEIVED_INTERFERENCE_POWER_TAG, 123);
+	SET_TLV(in.thermal_noise_power, NFAPI_MEASUREMENT_REQUEST_THERMAL_NOISE_POWER_TAG, 255);
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+
+
+	ASSERT_TLV(in.dl_rs_tx_power, out.dl_rs_tx_power);
+	ASSERT_TLV(in.received_interference_power, out.received_interference_power);
+	ASSERT_TLV(in.thermal_noise_power, out.thermal_noise_power);
+}
+void nfapi_test_measurement_response()
+{
+	uint16_t num_tlv = 0;
+	nfapi_measurement_response_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_measurement_response_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_MEASUREMENT_RESPONSE;
+	in.header.message_length = 0;
+	in.header.spare = 0;
+
+	in.error_code = NFAPI_MSG_OK;
+
+	SET_TLV(in.dl_rs_tx_power_measurement, NFAPI_MEASUREMENT_RESPONSE_DL_RS_POWER_MEASUREMENT_TAG, -400);
+
+	in.received_interference_power_measurement.tl.tag = NFAPI_MEASUREMENT_RESPONSE_RECEIVED_INTERFERENCE_POWER_MEASUREMENT_TAG;
+	in.received_interference_power_measurement.number_of_resource_blocks = 100;
+	in.received_interference_power_measurement.received_interference_power[0] = -8767;
+
+	SET_TLV(in.thermal_noise_power_measurement, NFAPI_MEASUREMENT_RESPONSE_THERMAL_NOISE_MEASUREMENT_TAG, -8900);
+
+	int packedMessageLength = nfapi_p5_message_pack(&in, sizeof(in), gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p5_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.error_code, out.error_code);
+
+	ASSERT_TLV(in.dl_rs_tx_power_measurement, out.dl_rs_tx_power_measurement);
+	CU_ASSERT_EQUAL(in.received_interference_power_measurement.tl.tag, out.received_interference_power_measurement.tl.tag);
+	CU_ASSERT_EQUAL(in.received_interference_power_measurement.number_of_resource_blocks, out.received_interference_power_measurement.number_of_resource_blocks);
+	// check array
+	ASSERT_TLV(in.thermal_noise_power_measurement, out.thermal_noise_power_measurement);
+}
+
+void nfapi_test_dl_config_request()
+{
+
+
+	uint16_t idx = 0;
+	nfapi_dl_config_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_dl_config_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_DL_CONFIG_REQUEST;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 0x3FFF;
+
+	in.dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
+	in.dl_config_request_body.number_pdcch_ofdm_symbols = 4;
+	in.dl_config_request_body.number_dci = 255;
+	in.dl_config_request_body.number_pdu = 0;
+	in.dl_config_request_body.number_pdsch_rnti = 0;
+	in.dl_config_request_body.transmission_power_pcfich = 10000;
+
+	in.dl_config_request_body.dl_config_pdu_list = (nfapi_dl_config_request_pdu_t*)(malloc(sizeof(nfapi_dl_config_request_pdu_t) * 12));
+	
+	in.dl_config_request_body.dl_config_pdu_list[0].pdu_type = 0;
+	in.dl_config_request_body.dl_config_pdu_list[0].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel9.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel11.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.primary_cell_type = rand8(0, 2);
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.ul_dl_configuration_flag = rand8(0, 1);
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.number_ul_dl_configurations = rand8(0, 5);
+	for(idx = 0; idx <in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.number_ul_dl_configurations; ++idx)
+	{
+		in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.ul_dl_configuration_indication[idx] = rand8(1, 5);
+	}
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm_struct_flag = 1; //rand8(0, 1);
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.num_prb_per_subband = 3;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.number_of_subbands = 2;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.num_antennas = 2;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[0].subband_index = 1;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[0].scheduled_ues = 2;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[0].precoding_value[0][0] = 0x321;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[0].precoding_value[0][1] = 0x321;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[0].precoding_value[1][0] = 0x321;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[0].precoding_value[1][1] = 0x321;
+	
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[1].subband_index = 2;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[1].scheduled_ues = 1;	
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[1].precoding_value[0][0] = 0x32A;
+	in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[1].precoding_value[1][0] = 0x32A;
+
+	in.dl_config_request_body.number_pdu++;
+
+	in.dl_config_request_body.dl_config_pdu_list[1].pdu_type = 1;
+	in.dl_config_request_body.dl_config_pdu_list[1].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[1].bch_pdu.bch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG;
+	in.dl_config_request_body.number_pdu++;
+
+	in.dl_config_request_body.dl_config_pdu_list[2].pdu_type = 2;
+	in.dl_config_request_body.dl_config_pdu_list[2].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[2].mch_pdu.mch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG;
+	in.dl_config_request_body.number_pdu++;
+
+	in.dl_config_request_body.dl_config_pdu_list[3].pdu_type = 3;
+	in.dl_config_request_body.dl_config_pdu_list[3].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel9.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel11.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel12.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
+	in.dl_config_request_body.number_pdu++;
+
+	in.dl_config_request_body.dl_config_pdu_list[4].pdu_type = 4;
+	in.dl_config_request_body.dl_config_pdu_list[4].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[4].pch_pdu.pch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[4].pch_pdu.pch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG;
+	in.dl_config_request_body.number_pdu++;
+
+	in.dl_config_request_body.dl_config_pdu_list[5].pdu_type = 5;
+	in.dl_config_request_body.dl_config_pdu_list[5].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[5].prs_pdu.prs_pdu_rel9.tl.tag = NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG;
+	in.dl_config_request_body.number_pdu++;
+
+	in.dl_config_request_body.dl_config_pdu_list[6].pdu_type = 6;
+	in.dl_config_request_body.dl_config_pdu_list[6].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[6].csi_rs_pdu.csi_rs_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[6].csi_rs_pdu.csi_rs_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG;
+	in.dl_config_request_body.number_pdu++;
+
+	in.dl_config_request_body.dl_config_pdu_list[7].pdu_type = 7;
+	in.dl_config_request_body.dl_config_pdu_list[7].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel9.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel11.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel12.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_params_rel11.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG;
+	in.dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_params_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG;
+	in.dl_config_request_body.number_pdu++;
+
+	in.dl_config_request_body.dl_config_pdu_list[8].pdu_type = 8;
+	in.dl_config_request_body.dl_config_pdu_list[8].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[8].mpdcch_pdu.mpdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG;
+	in.dl_config_request_body.number_pdu++;
+
+	in.dl_config_request_body.dl_config_pdu_list[9].pdu_type = 9;
+	in.dl_config_request_body.dl_config_pdu_list[9].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[9].nbch_pdu.nbch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG;
+	in.dl_config_request_body.number_pdu++;
+	
+	in.dl_config_request_body.dl_config_pdu_list[10].pdu_type = 10;
+	in.dl_config_request_body.dl_config_pdu_list[10].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG;
+	in.dl_config_request_body.number_pdu++;
+	
+	in.dl_config_request_body.dl_config_pdu_list[11].pdu_type = 11;
+	in.dl_config_request_body.dl_config_pdu_list[11].pdu_size = 123;
+	in.dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG;
+	in.dl_config_request_body.number_pdu++;
+	
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+	CU_ASSERT_NOT_EQUAL(packedMessageLength, 0);
+	CU_ASSERT_NOT_EQUAL(packedMessageLength, -1);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.sfn_sf, out.sfn_sf);
+	CU_ASSERT_EQUAL(in.dl_config_request_body.tl.tag, out.dl_config_request_body.tl.tag);
+	CU_ASSERT_EQUAL(in.dl_config_request_body.number_pdcch_ofdm_symbols, out.dl_config_request_body.number_pdcch_ofdm_symbols);
+	CU_ASSERT_EQUAL(in.dl_config_request_body.number_dci, out.dl_config_request_body.number_dci);
+	CU_ASSERT_EQUAL(in.dl_config_request_body.number_pdu, out.dl_config_request_body.number_pdu);
+	CU_ASSERT_EQUAL(in.dl_config_request_body.number_pdsch_rnti, out.dl_config_request_body.number_pdsch_rnti);
+	CU_ASSERT_EQUAL(in.dl_config_request_body.transmission_power_pcfich, out.dl_config_request_body.transmission_power_pcfich);
+
+
+	CU_ASSERT_EQUAL(in.dl_config_request_body.dl_config_pdu_list[0].pdu_type, out.dl_config_request_body.dl_config_pdu_list[0].pdu_type);
+	CU_ASSERT_EQUAL(in.dl_config_request_body.dl_config_pdu_list[0].pdu_size, out.dl_config_request_body.dl_config_pdu_list[0].pdu_size);
+	CU_ASSERT_EQUAL(in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.tl.tag, out.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.dci_format);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.rnti);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.resource_allocation_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.mcs_1);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.transport_block_to_codeword_swap_flag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.mcs_2);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_2);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_2);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.harq_process);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.tpmi);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.pmi);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.precoding_information);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.tpc);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.downlink_assignment_index);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.ngap);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.transport_block_size_index);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.downlink_power_offset);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.allocate_prach_flag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.preamble_index);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.prach_mask_index);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel8.transmission_power);
+
+	CU_ASSERT_EQUAL(in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel9.tl.tag, out.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel9.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel9.mcch_flag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel9.mcch_change_notification);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel9.scrambling_identity);
+
+	CU_ASSERT_EQUAL(in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel10.tl.tag, out.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel10.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel10.cross_carrier_scheduling_flag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel10.carrier_indicator);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel10.srs_flag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel10.srs_request);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel10.antenna_ports_scrambling_and_layers);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel10.total_dci_length_including_padding);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel10.n_dl_rb);
+
+	CU_ASSERT_EQUAL(in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel11.tl.tag, out.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel11.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel11.harq_ack_resource_offset);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel11.pdsch_re_mapping_quasi_co_location_indicator);
+
+	CU_ASSERT_EQUAL(in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.tl.tag, out.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.primary_cell_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.ul_dl_configuration_flag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.number_ul_dl_configurations);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel12.ul_dl_configuration_indication[NFAPI_MAX_UL_DL_CONFIGURATIONS -1]);
+
+	CU_ASSERT_EQUAL(in.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tl.tag, out.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.laa_end_partial_sf_flag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.laa_end_partial_sf_configuration);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.initial_lbt_sf);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.codebook_size_determination);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.drms_table_flag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm_struct_flag);
+	if(out.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm_struct_flag)
+	{
+		
+		IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.num_prb_per_subband);
+		IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.number_of_subbands);
+		IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.num_antennas);
+		
+		uint8_t sb_idx;
+		for(sb_idx = 0; sb_idx < out.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.number_of_subbands; ++sb_idx)
+		{
+			IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[sb_idx].subband_index);
+			IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[sb_idx].scheduled_ues);
+			
+			uint8_t a_idx;
+			uint8_t su_idx;
+			
+			for(a_idx = 0; a_idx < out.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.num_antennas ; ++a_idx)
+			{
+				for(su_idx = 0; su_idx < out.dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[sb_idx].scheduled_ues; ++su_idx)
+				{
+					IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[0].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[sb_idx].precoding_value[a_idx][su_idx]);
+				}
+			}
+		}
+	}
+
+
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[1].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[1].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[1].bch_pdu.bch_pdu_rel8.tl.tag);
+
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[2].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[2].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[2].mch_pdu.mch_pdu_rel8.tl.tag);
+
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[3].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[3].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel8.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel9.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel10.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel11.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel12.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[3].dlsch_pdu.dlsch_pdu_rel13.tl.tag);
+
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[4].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[4].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[4].pch_pdu.pch_pdu_rel8.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[4].pch_pdu.pch_pdu_rel13.tl.tag);
+
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[5].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[5].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[5].prs_pdu.prs_pdu_rel9.tl.tag);
+
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[6].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[6].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[6].csi_rs_pdu.csi_rs_pdu_rel10.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[6].csi_rs_pdu.csi_rs_pdu_rel13.tl.tag);
+
+	
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[7].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[7].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel8.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel9.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel10.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel11.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel12.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_pdu_rel13.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_params_rel11.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[7].epdcch_pdu.epdcch_params_rel13.tl.tag);
+
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[8].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[8].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[8].mpdcch_pdu.mpdcch_pdu_rel13.tl.tag);
+	
+	//in.dl_config_request_body.dl_config_pdu_list[8].mpdcch_pdu;
+	//
+	
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[9].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[9].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[9].nbch_pdu.nbch_pdu_rel13.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[9].nbch_pdu.nbch_pdu_rel13.length);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[9].nbch_pdu.nbch_pdu_rel13.pdu_index);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[9].nbch_pdu.nbch_pdu_rel13.transmission_power);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[9].nbch_pdu.nbch_pdu_rel13.hyper_sfn_2_lsbs);
+	
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.length);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.pdu_index);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.ncce_index);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.aggregation_level);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.start_symbol);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.rnti_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.rnti);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.scrambling_reinitialization_batch_index);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.nrs_antenna_ports_assumed_by_the_ue);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.dci_format);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.scheduling_delay);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.resource_assignment);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.repetition_number);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.mcs);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.new_data_indicator);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.npdcch_order_indication);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.starting_number_of_nprach_repetitions);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.subcarrier_indication_of_nprach);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.paging_direct_indication_differentation_flag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.direct_indication);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[10].npdcch_pdu.npdcch_pdu_rel13.total_dci_length_including_padding);
+	
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].pdu_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].pdu_size);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.tl.tag);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.length);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.pdu_index);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.start_symbol);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.rnti_type);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.rnti);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.resource_assignment);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.repetition_number);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.modulation);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.number_of_subframes_for_resource_assignment);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.scrambling_sequence_initialization_cinit);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.sf_idx);
+	IN_OUT_ASSERT(dl_config_request_body.dl_config_pdu_list[11].ndlsch_pdu.ndlsch_pdu_rel13.nrs_antenna_ports_assumed_by_the_ue);
+	
+	
+	free(in.dl_config_request_body.dl_config_pdu_list);
+	free(out.dl_config_request_body.dl_config_pdu_list);
+}
+void nfapi_test_ul_config_request()
+{
+	nfapi_ul_config_request_t in;
+	//memset(&in, 0, sizeof(in));
+	nfapi_ul_config_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_UL_CONFIG_REQUEST;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 0x3FFF;
+
+	in.ul_config_request_body.tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
+	in.ul_config_request_body.number_of_pdus = 0;
+	in.ul_config_request_body.rach_prach_frequency_resources = 34;
+	in.ul_config_request_body.srs_present = 1;
+	
+	nfapi_ul_config_request_pdu_t ul_config_pdu_list[24];
+	memset(&ul_config_pdu_list[0], 0, sizeof(ul_config_pdu_list));
+	in.ul_config_request_body.ul_config_pdu_list = &ul_config_pdu_list[0];
+	
+	in.ul_config_request_body.ul_config_pdu_list[0].pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[0].ulsch_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[1].pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[1].ulsch_cqi_ri_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[2].pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[2].ulsch_harq_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[3].pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[3].ulsch_cqi_harq_ri_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[4].pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[4].uci_cqi_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+
+	in.ul_config_request_body.ul_config_pdu_list[5].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[5].uci_sr_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[6].pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[6].uci_harq_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[7].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[7].uci_sr_harq_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[8].pdu_type = NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[8].uci_cqi_harq_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[9].pdu_type = NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[9].uci_cqi_sr_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[10].pdu_type = NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[10].uci_cqi_sr_harq_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[11].pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[11].srs_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[12].pdu_type = NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[12].harq_buffer_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[13].pdu_type = NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[13].ulsch_uci_csi_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[14].pdu_type = NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[14].ulsch_uci_harq_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[15].pdu_type = NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE;
+	//in.ul_config_request_body.ul_config_pdu_list[15].ulsch_csi_uci_harq_pdu;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[16].pdu_type = NFAPI_UL_CONFIG_NULSCH_PDU_TYPE;
+	in.ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG;
+	in.ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
+	in.ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel11.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG;
+	in.ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG;
+	in.ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.nb_harq_information.nb_harq_information_rel13_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG;
+	in.ul_config_request_body.number_of_pdus++;
+	
+	in.ul_config_request_body.ul_config_pdu_list[17].pdu_type = NFAPI_UL_CONFIG_NRACH_PDU_TYPE;
+	in.ul_config_request_body.ul_config_pdu_list[17].nrach_pdu.nrach_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG;
+	in.ul_config_request_body.number_of_pdus++;
+	
+
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	IN_OUT_ASSERT(header.message_id);
+	IN_OUT_ASSERT(sfn_sf);
+	IN_OUT_ASSERT(ul_config_request_body.rach_prach_frequency_resources);
+	IN_OUT_ASSERT(ul_config_request_body.srs_present);
+	IN_OUT_ASSERT(ul_config_request_body.number_of_pdus);
+	
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[0].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[1].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[2].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[3].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[4].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[5].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[6].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[7].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[8].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[9].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[10].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[11].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[12].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[13].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[14].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[15].pdu_type);
+	
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].pdu_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.tl.tag);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.nulsch_format);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.handle);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.size);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.rnti);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.subcarrier_indication);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.resource_assignment);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.mcs);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.redudancy_version);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.repetition_number);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.new_data_indication);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.n_srs);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.scrambling_sequence_initialization_cinit);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.sf_idx);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel8.tl.tag);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel8.handle);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel8.rnti);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel11.tl.tag);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel11.virtual_cell_id_enabled_flag);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel11.npusch_identity);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.tl.tag);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.ue_type);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.empty_symbols);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.total_number_of_repetitions);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.repetition_number);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.nb_harq_information.nb_harq_information_rel13_fdd.tl.tag);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[16].nulsch_pdu.nulsch_pdu_rel13.nb_harq_information.nb_harq_information_rel13_fdd.harq_ack_resource);
+	
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[17].nrach_pdu.nrach_pdu_rel13.tl.tag);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[17].nrach_pdu.nrach_pdu_rel13.nprach_config_0);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[17].nrach_pdu.nrach_pdu_rel13.nprach_config_1);
+	IN_OUT_ASSERT(ul_config_request_body.ul_config_pdu_list[17].nrach_pdu.nrach_pdu_rel13.nprach_config_2);
+	
+
+	free(out.ul_config_request_body.ul_config_pdu_list);
+	
+}
+void nfapi_test_hi_dci0_request()
+{
+	nfapi_hi_dci0_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_hi_dci0_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_HI_DCI0_REQUEST;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 9999;
+	in.hi_dci0_request_body.tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
+	in.hi_dci0_request_body.sfnsf = 123;
+	in.hi_dci0_request_body.number_of_dci = 0;
+	in.hi_dci0_request_body.number_of_hi = 0;
+
+	in.hi_dci0_request_body.hi_dci0_pdu_list = (nfapi_hi_dci0_request_pdu_t*)malloc(sizeof(nfapi_hi_dci0_request_pdu_t) * 8);
+
+	in.hi_dci0_request_body.hi_dci0_pdu_list[0].pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel8.resource_block_start = 2;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 23;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel8.hi_value = 0;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel8.i_phich = 2;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel8.transmission_power = 12312;;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel10.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel10.flag_tb2 = 1;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel10.hi_value_2 = 2;
+
+	in.hi_dci0_request_body.number_of_hi++;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
+	/*
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.dci_format;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.cce_index;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.aggregation_level;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.rnti;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.resource_block_start;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.number_of_resource_block;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.mcs_1;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.cyclic_shift_2_for_drms;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.frequency_hopping_enabled_flag;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.frequency_hopping_bits;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.new_data_indication_1;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.ue_tx_antenna_seleciton;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.tpc;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.cqi_csi_request;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.ul_index;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.dl_assignment_index;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.tpc_bitmap;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.transmission_power;
+	*/
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG;
+	/*
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.cross_carrier_scheduling_flag;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.carrier_indicator;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.size_of_cqi_csi_feild;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.srs_flag;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.srs_request;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.resource_allocation_flag;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.resource_allocation_type;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.resource_block_coding;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.mcs_2;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.new_data_indication_2;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.number_of_antenna_ports;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.tpmi;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.total_dci_length_including_padding;
+	*/
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel12.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG;
+	/*
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel12.pscch_resource;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel12.time_resource_pattern;
+	*/
+
+	in.hi_dci0_request_body.number_of_dci++;
+
+	in.hi_dci0_request_body.hi_dci0_pdu_list[2].pdu_type = NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.tl.tag = NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[2].epdcch_dci_pdu.epdcch_parameters_rel11.tl.tag = NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG;
+	/*
+	in.hi_dci0_request_body.hi_dci0_pdu_list[2].edpcch_dci_pdu.edpcch_dci_pdu_rel8;
+	uint8_t dci_format;
+	uint8_t cce_index;
+	uint8_t aggregation_level;
+	uint16_t rnti;
+	uint8_t resource_block_start;
+	uint8_t number_of_resource_block;
+	uint8_t mcs_1;
+	uint8_t cyclic_shift_2_for_drms;
+	uint8_t frequency_hopping_enabled_flag;
+	uint8_t frequency_hopping_bits;
+	uint8_t new_data_indication_1;
+	uint8_t ue_tx_antenna_seleciton;
+	uint8_t tpc;
+	uint8_t cqi_csi_request;
+	uint8_t ul_index;
+	uint8_t dl_assignment_index;
+	uint32_t tpc_bitmap;
+	uint16_t transmission_power;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[2].edpcch_dci_pdu.edpcch_dci_pdu_rel10.cross_carrier_scheduling_flag;
+	uint8_t carrier_indicator;
+	uint8_t size_of_cqi_csi_feild;
+	uint8_t srs_flag;
+	uint8_t srs_request;
+	uint8_t resource_allocation_flag;
+	uint8_t resource_allocation_type;
+	uint32_t resource_block_coding;
+	uint8_t mcs_2;
+	uint8_t new_data_indication_2;
+	uint8_t number_of_antenna_ports;
+	uint8_t tpmi;
+	uint8_t total_dci_length_including_padding;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[2].edpcch_dci_pdu.edpcch_parameters_rel11.edpcch_resource_assigenment_flag;
+	uint16_t edpcch_id;
+	uint8_t epdcch_start_symbol;
+	uint8_t epdcch_num_prb;
+	uint8_t epdcch_prb_index[NFAPI_MAX_EPDCCH_PRB];
+	nfapi_bf_vector_t bf_vector;
+	*/
+	in.hi_dci0_request_body.number_of_dci++;
+	
+	in.hi_dci0_request_body.hi_dci0_pdu_list[3].pdu_type = NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[3].mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.tl.tag = NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG;
+	/*
+	in.hi_dci0_request_body.hi_dci0_pdu_list[3].mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mpdcch_narrowband;
+	uint8_t number_of_prb_pairs;
+	uint8_t resource_block_assignment;
+	uint8_t mpdcch_transmission_type;
+	uint8_t start_symbol;
+	uint8_t ecce_index;
+	uint8_t aggreagation_level;
+	uint8_t rnti_type;
+	uint16_t rnti;
+	uint8_t ce_mode;
+	uint16_t drms_scrambling_init;
+	uint16_t initial_transmission_sf_io;
+	uint16_t transmission_power;
+	uint8_t dci_format;
+	uint8_t resource_block_start;
+	uint8_t number_of_resource_blocks;
+	uint8_t mcs;
+	uint8_t pusch_repetition_levels;
+	uint8_t frequency_hopping_flag;
+	uint8_t new_data_indication;
+	uint8_t harq_process;
+	uint8_t redudency_version;
+	uint8_t tpc;
+	uint8_t csi_request;
+	uint8_t ul_inex;
+	uint8_t dai_presence_flag;
+	uint8_t dl_assignment_index;
+	uint8_t srs_request;
+	uint8_t dci_subframe_repetition_number;
+	uint32_t tcp_bitmap;
+	uint8_t total_dci_length_include_padding;
+	uint8_t number_of_tx_antenna_ports;
+	uint16_t precoding_value[NFAPI_MAX_ANTENNA_PORT_COUNT];
+	*/
+	in.hi_dci0_request_body.number_of_dci++;
+
+	in.hi_dci0_request_body.hi_dci0_pdu_list[4].pdu_type = NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE;
+	in.hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.tl.tag = NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG;
+	in.hi_dci0_request_body.number_of_dci++;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.sfn_sf, out.sfn_sf);
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.tl.tag, out.hi_dci0_request_body.tl.tag);
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.sfnsf, out.hi_dci0_request_body.sfnsf);
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.number_of_dci, out.hi_dci0_request_body.number_of_dci);
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.number_of_hi, out.hi_dci0_request_body.number_of_hi);
+
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.hi_dci0_pdu_list[0].pdu_type, out.hi_dci0_request_body.hi_dci0_pdu_list[0].pdu_type);
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel8.tl.tag, out.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel10.tl.tag, out.hi_dci0_request_body.hi_dci0_pdu_list[0].hi_pdu.hi_pdu_rel10.tl.tag);
+
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.hi_dci0_pdu_list[1].pdu_type, out.hi_dci0_request_body.hi_dci0_pdu_list[1].pdu_type);
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.tl.tag, out.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.tl.tag, out.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel10.tl.tag);
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel12.tl.tag, out.hi_dci0_request_body.hi_dci0_pdu_list[1].dci_pdu.dci_pdu_rel12.tl.tag);
+
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.hi_dci0_pdu_list[2].pdu_type, out.hi_dci0_request_body.hi_dci0_pdu_list[2].pdu_type);
+
+	CU_ASSERT_EQUAL(in.hi_dci0_request_body.hi_dci0_pdu_list[3].pdu_type, out.hi_dci0_request_body.hi_dci0_pdu_list[3].pdu_type);
+	
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].pdu_type);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.tl.tag);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.ncce_index);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.aggregation_level);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.start_symbol);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.rnti);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.scrambling_reinitialization_batch_index);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.nrs_antenna_ports_assumed_by_the_ue);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.subcarrier_indication);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.resource_assignment);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.scheduling_delay);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.mcs);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.redudancy_version);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.repetition_number);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.new_data_indicator);
+	IN_OUT_ASSERT(hi_dci0_request_body.hi_dci0_pdu_list[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.dci_subframe_repetition_number);
+
+	free(in.hi_dci0_request_body.hi_dci0_pdu_list);
+	free(out.hi_dci0_request_body.hi_dci0_pdu_list);
+}
+void nfapi_test_tx_request()
+{
+	nfapi_tx_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_tx_request_t out;
+
+	nfapi_p7_codec_config_t config;
+	config.allocate = &nfapi_allocate_pdu;
+	//config.deallocate = &nfapi_deallocate_pdu;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_TX_REQUEST;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	uint8_t pdu1_seg1[16];
+	uint8_t pdu1_seg2[16];
+	uint8_t pdu2[8];
+
+	in.sfn_sf = 10230;
+	in.tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+	in.tx_request_body.number_of_pdus = 2;
+
+	in.tx_request_body.tx_pdu_list = (nfapi_tx_request_pdu_t*)(malloc(sizeof(nfapi_tx_request_pdu_t) * in.tx_request_body.number_of_pdus));
+
+	in.tx_request_body.tx_pdu_list[0].pdu_length = sizeof(pdu1_seg1) + sizeof(pdu1_seg2);
+	in.tx_request_body.tx_pdu_list[0].pdu_index = 0;
+	in.tx_request_body.tx_pdu_list[0].num_segments = 2;
+	in.tx_request_body.tx_pdu_list[0].segments[0].segment_length = sizeof(pdu1_seg1);
+	in.tx_request_body.tx_pdu_list[0].segments[0].segment_data = pdu1_seg1;
+	in.tx_request_body.tx_pdu_list[0].segments[1].segment_length = sizeof(pdu1_seg2);
+	in.tx_request_body.tx_pdu_list[0].segments[1].segment_data = pdu1_seg2;
+
+	in.tx_request_body.tx_pdu_list[1].pdu_length = sizeof(pdu2);
+	in.tx_request_body.tx_pdu_list[1].pdu_index = 0;
+	in.tx_request_body.tx_pdu_list[1].num_segments = 1;
+	in.tx_request_body.tx_pdu_list[1].segments[0].segment_length = sizeof(pdu2);
+	in.tx_request_body.tx_pdu_list[1].segments[0].segment_data = pdu2;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, &config);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), &config);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.sfn_sf, out.sfn_sf);
+	CU_ASSERT_EQUAL(in.tx_request_body.tl.tag, out.tx_request_body.tl.tag);
+	CU_ASSERT_EQUAL(in.tx_request_body.number_of_pdus, out.tx_request_body.number_of_pdus);
+	CU_ASSERT_EQUAL(in.tx_request_body.tx_pdu_list[0].pdu_length, out.tx_request_body.tx_pdu_list[0].pdu_length);
+	CU_ASSERT_EQUAL(1, out.tx_request_body.tx_pdu_list[0].num_segments);
+
+	CU_ASSERT_EQUAL(in.tx_request_body.tx_pdu_list[1].pdu_length, out.tx_request_body.tx_pdu_list[1].pdu_length);
+	CU_ASSERT_EQUAL(1, out.tx_request_body.tx_pdu_list[1].num_segments);
+
+	CU_ASSERT_EQUAL(0, memcmp(pdu2, out.tx_request_body.tx_pdu_list[1].segments[0].segment_data, sizeof(pdu2)));
+
+	free(out.tx_request_body.tx_pdu_list[0].segments[0].segment_data);
+	free(out.tx_request_body.tx_pdu_list[1].segments[0].segment_data);
+
+	free(in.tx_request_body.tx_pdu_list);
+	free(out.tx_request_body.tx_pdu_list);
+}
+void nfapi_test_harq_indication()
+{
+	nfapi_harq_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_harq_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_HARQ_INDICATION;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 10230;
+	in.harq_indication_body.tl.tag = NFAPI_HARQ_INDICATION_BODY_TAG;
+	in.harq_indication_body.number_of_harqs = 6;
+
+	in.harq_indication_body.harq_pdu_list = (nfapi_harq_indication_pdu_t*)(calloc(1, sizeof(nfapi_harq_indication_pdu_t) * in.harq_indication_body.number_of_harqs));
+
+	in.harq_indication_body.harq_pdu_list[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.harq_indication_body.harq_pdu_list[0].harq_indication_tdd_rel8.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL8_TAG;
+	in.harq_indication_body.harq_pdu_list[0].harq_indication_tdd_rel8.mode = 0;
+	in.harq_indication_body.harq_pdu_list[0].harq_indication_tdd_rel8.number_of_ack_nack = 2;
+	in.harq_indication_body.harq_pdu_list[0].harq_indication_tdd_rel8.harq_data.bundling.value_0 = 6;
+	in.harq_indication_body.harq_pdu_list[0].harq_indication_tdd_rel8.harq_data.bundling.value_1 = 6;
+
+	in.harq_indication_body.harq_pdu_list[1].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.harq_indication_body.harq_pdu_list[1].harq_indication_tdd_rel9.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL9_TAG;
+	in.harq_indication_body.harq_pdu_list[1].harq_indication_tdd_rel9.mode = 0;
+	in.harq_indication_body.harq_pdu_list[1].harq_indication_tdd_rel9.number_of_ack_nack = 2;
+	in.harq_indication_body.harq_pdu_list[1].harq_indication_tdd_rel9.harq_data[0].bundling.value_0 = 2;
+
+	in.harq_indication_body.harq_pdu_list[2].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.harq_indication_body.harq_pdu_list[2].harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
+	in.harq_indication_body.harq_pdu_list[2].harq_indication_tdd_rel13.mode = 2;
+	in.harq_indication_body.harq_pdu_list[2].harq_indication_tdd_rel13.number_of_ack_nack = 2;
+	in.harq_indication_body.harq_pdu_list[2].harq_indication_tdd_rel13.harq_data[0].special_bundling.value_0 = 2;
+
+	in.harq_indication_body.harq_pdu_list[3].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.harq_indication_body.harq_pdu_list[3].ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+	in.harq_indication_body.harq_pdu_list[3].ul_cqi_information.ul_cqi = 9;
+	in.harq_indication_body.harq_pdu_list[3].ul_cqi_information.channel = 3;
+	in.harq_indication_body.harq_pdu_list[3].harq_indication_fdd_rel8.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL8_TAG;
+	in.harq_indication_body.harq_pdu_list[3].harq_indication_fdd_rel8.harq_tb1 = 1;
+	in.harq_indication_body.harq_pdu_list[3].harq_indication_fdd_rel8.harq_tb2 = 2;
+
+
+	in.harq_indication_body.harq_pdu_list[4].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.harq_indication_body.harq_pdu_list[4].harq_indication_fdd_rel9.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL9_TAG;
+	in.harq_indication_body.harq_pdu_list[4].harq_indication_fdd_rel9.mode = 0;
+	in.harq_indication_body.harq_pdu_list[4].harq_indication_fdd_rel9.number_of_ack_nack = 3;
+	in.harq_indication_body.harq_pdu_list[4].harq_indication_fdd_rel9.harq_tb_n[0] = 45;
+
+	in.harq_indication_body.harq_pdu_list[5].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.harq_indication_body.harq_pdu_list[5].harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
+	in.harq_indication_body.harq_pdu_list[5].harq_indication_fdd_rel13.mode = 1;
+	in.harq_indication_body.harq_pdu_list[5].harq_indication_fdd_rel13.number_of_ack_nack = 22;
+	in.harq_indication_body.harq_pdu_list[5].harq_indication_fdd_rel13.harq_tb_n[0] = 123;
+
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.sfn_sf, out.sfn_sf);
+
+	CU_ASSERT_EQUAL(in.harq_indication_body.tl.tag,out.harq_indication_body.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.number_of_harqs,out.harq_indication_body.number_of_harqs);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[0].rx_ue_information.tl.tag,out.harq_indication_body.harq_pdu_list[0].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[0].harq_indication_tdd_rel8.tl.tag,out.harq_indication_body.harq_pdu_list[0].harq_indication_tdd_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[1].rx_ue_information.tl.tag,out.harq_indication_body.harq_pdu_list[1].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[1].harq_indication_tdd_rel9.tl.tag,out.harq_indication_body.harq_pdu_list[1].harq_indication_tdd_rel9.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[2].rx_ue_information.tl.tag,out.harq_indication_body.harq_pdu_list[2].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[2].harq_indication_tdd_rel13.tl.tag,out.harq_indication_body.harq_pdu_list[2].harq_indication_tdd_rel13.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[3].rx_ue_information.tl.tag,out.harq_indication_body.harq_pdu_list[3].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[3].ul_cqi_information.tl.tag,out.harq_indication_body.harq_pdu_list[3].ul_cqi_information.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[3].harq_indication_fdd_rel8.tl.tag,out.harq_indication_body.harq_pdu_list[3].harq_indication_fdd_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[4].rx_ue_information.tl.tag,out.harq_indication_body.harq_pdu_list[4].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[4].harq_indication_fdd_rel9.tl.tag,out.harq_indication_body.harq_pdu_list[4].harq_indication_fdd_rel9.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[5].rx_ue_information.tl.tag,out.harq_indication_body.harq_pdu_list[5].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.harq_indication_body.harq_pdu_list[5].harq_indication_fdd_rel13.tl.tag,out.harq_indication_body.harq_pdu_list[5].harq_indication_fdd_rel13.tl.tag);
+
+	free(in.harq_indication_body.harq_pdu_list);
+	free(out.harq_indication_body.harq_pdu_list);
+}
+void nfapi_test_crc_indication()
+{
+	nfapi_crc_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_crc_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_CRC_INDICATION;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 10230;
+	in.crc_indication_body.tl.tag = NFAPI_CRC_INDICATION_BODY_TAG;
+	in.crc_indication_body.number_of_crcs = 2;
+	in.crc_indication_body.crc_pdu_list = (nfapi_crc_indication_pdu_t*)malloc(sizeof(nfapi_crc_indication_pdu_t) * in.crc_indication_body.number_of_crcs);
+	in.crc_indication_body.crc_pdu_list[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.crc_indication_body.crc_pdu_list[0].rx_ue_information.handle = 0x4567;
+	in.crc_indication_body.crc_pdu_list[0].rx_ue_information.rnti = 42;
+	in.crc_indication_body.crc_pdu_list[0].crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
+	in.crc_indication_body.crc_pdu_list[0].crc_indication_rel8.crc_flag = 0;
+
+
+	in.crc_indication_body.crc_pdu_list[1].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.crc_indication_body.crc_pdu_list[1].rx_ue_information.handle = 0x4568;
+	in.crc_indication_body.crc_pdu_list[1].rx_ue_information.rnti = 43;
+	in.crc_indication_body.crc_pdu_list[1].crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
+	in.crc_indication_body.crc_pdu_list[1].crc_indication_rel8.crc_flag = 1;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.crc_indication_body.tl.tag, out.crc_indication_body.tl.tag);
+	CU_ASSERT_EQUAL(in.crc_indication_body.number_of_crcs, out.crc_indication_body.number_of_crcs);
+	CU_ASSERT_EQUAL(in.crc_indication_body.crc_pdu_list[0].rx_ue_information.tl.tag, out.crc_indication_body.crc_pdu_list[0].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.crc_indication_body.crc_pdu_list[0].rx_ue_information.handle, out.crc_indication_body.crc_pdu_list[0].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.crc_indication_body.crc_pdu_list[0].rx_ue_information.rnti, out.crc_indication_body.crc_pdu_list[0].rx_ue_information.rnti);
+	CU_ASSERT_EQUAL(in.crc_indication_body.crc_pdu_list[0].crc_indication_rel8.tl.tag, out.crc_indication_body.crc_pdu_list[0].crc_indication_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.crc_indication_body.crc_pdu_list[0].crc_indication_rel8.crc_flag, out.crc_indication_body.crc_pdu_list[0].crc_indication_rel8.crc_flag);
+
+	CU_ASSERT_EQUAL(in.crc_indication_body.crc_pdu_list[1].rx_ue_information.tl.tag, out.crc_indication_body.crc_pdu_list[1].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.crc_indication_body.crc_pdu_list[1].rx_ue_information.handle, out.crc_indication_body.crc_pdu_list[1].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.crc_indication_body.crc_pdu_list[1].rx_ue_information.rnti, out.crc_indication_body.crc_pdu_list[1].rx_ue_information.rnti);
+	CU_ASSERT_EQUAL(in.crc_indication_body.crc_pdu_list[1].crc_indication_rel8.tl.tag, out.crc_indication_body.crc_pdu_list[1].crc_indication_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.crc_indication_body.crc_pdu_list[1].crc_indication_rel8.crc_flag, out.crc_indication_body.crc_pdu_list[1].crc_indication_rel8.crc_flag);
+
+	free(in.crc_indication_body.crc_pdu_list);
+	free(out.crc_indication_body.crc_pdu_list);
+}
+void nfapi_test_rx_ulsch_indication()
+{
+	nfapi_rx_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_rx_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RX_ULSCH_INDICATION;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	uint8_t pdu1[32];
+	uint8_t pdu2[8];
+
+	in.sfn_sf = 12354;
+	in.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
+	in.rx_indication_body.number_of_pdus = 3;
+
+	in.rx_indication_body.rx_pdu_list = (nfapi_rx_indication_pdu_t*)(calloc(1, sizeof(nfapi_rx_indication_pdu_t) * in.rx_indication_body.number_of_pdus));
+	
+	in.rx_indication_body.rx_pdu_list[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.rx_indication_body.rx_pdu_list[0].rx_ue_information.handle = 0xFEDC;
+	in.rx_indication_body.rx_pdu_list[0].rx_ue_information.rnti = 42;
+	in.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
+	in.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.length = sizeof(pdu1);
+	in.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.offset = 1;
+	in.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.ul_cqi = 1;
+	in.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.timing_advance = 23;
+	in.rx_indication_body.rx_pdu_list[0].rx_indication_rel9.tl.tag = NFAPI_RX_INDICATION_REL9_TAG;
+	in.rx_indication_body.rx_pdu_list[0].rx_indication_rel9.timing_advance_r9 = 1;
+	in.rx_indication_body.rx_pdu_list[0].data = pdu1;
+
+	in.rx_indication_body.rx_pdu_list[1].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.rx_indication_body.rx_pdu_list[1].rx_ue_information.handle = 0xFEDC;
+	in.rx_indication_body.rx_pdu_list[1].rx_ue_information.rnti = 43;
+	in.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
+	in.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.length = 0;
+	in.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.offset = 1;
+	in.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.ul_cqi = 1;
+	in.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.timing_advance = 23;
+	in.rx_indication_body.rx_pdu_list[1].data = 0;
+
+	in.rx_indication_body.rx_pdu_list[2].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.rx_indication_body.rx_pdu_list[2].rx_ue_information.handle = 0xFEDC;
+	in.rx_indication_body.rx_pdu_list[2].rx_ue_information.rnti = 43;
+	in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
+	in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.length = sizeof(pdu2);
+	in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.offset = 1;
+	in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.ul_cqi = 1;
+	in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.timing_advance = 23;
+	in.rx_indication_body.rx_pdu_list[2].rx_indication_rel9.tl.tag = NFAPI_RX_INDICATION_REL9_TAG;
+	in.rx_indication_body.rx_pdu_list[2].rx_indication_rel9.timing_advance_r9 = 34;
+	in.rx_indication_body.rx_pdu_list[2].data = pdu2;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+
+	CU_ASSERT_EQUAL(in.sfn_sf, out.sfn_sf);
+	CU_ASSERT_EQUAL(in.rx_indication_body.tl.tag, out.rx_indication_body.tl.tag);
+	CU_ASSERT_EQUAL(in.rx_indication_body.number_of_pdus, out.rx_indication_body.number_of_pdus);
+	
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[0].rx_ue_information.tl.tag, out.rx_indication_body.rx_pdu_list[0].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[0].rx_ue_information.handle, out.rx_indication_body.rx_pdu_list[0].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[0].rx_ue_information.rnti, out.rx_indication_body.rx_pdu_list[0].rx_ue_information.rnti);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.tl.tag, out.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.length, out.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.length);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.offset, out.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.offset);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.ul_cqi, out.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.ul_cqi);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.timing_advance, out.rx_indication_body.rx_pdu_list[0].rx_indication_rel8.timing_advance);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[0].rx_indication_rel9.tl.tag, out.rx_indication_body.rx_pdu_list[0].rx_indication_rel9.tl.tag);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[0].rx_indication_rel9.timing_advance_r9, out.rx_indication_body.rx_pdu_list[0].rx_indication_rel9.timing_advance_r9);
+	CU_ASSERT_EQUAL(0, memcmp(in.rx_indication_body.rx_pdu_list[0].data, out.rx_indication_body.rx_pdu_list[0].data, sizeof(pdu1)));
+
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[1].rx_ue_information.tl.tag, out.rx_indication_body.rx_pdu_list[1].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[1].rx_ue_information.handle, out.rx_indication_body.rx_pdu_list[1].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[1].rx_ue_information.rnti, out.rx_indication_body.rx_pdu_list[1].rx_ue_information.rnti);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.tl.tag, out.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.length, out.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.length);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.offset, out.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.offset);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.ul_cqi, out.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.ul_cqi);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.timing_advance, out.rx_indication_body.rx_pdu_list[1].rx_indication_rel8.timing_advance);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[1].data, 0);
+
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[2].rx_ue_information.tl.tag, out.rx_indication_body.rx_pdu_list[2].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[2].rx_ue_information.handle, out.rx_indication_body.rx_pdu_list[2].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[2].rx_ue_information.rnti, out.rx_indication_body.rx_pdu_list[2].rx_ue_information.rnti);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.tl.tag, out.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.length, out.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.length);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.offset, out.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.offset);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.ul_cqi, in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.ul_cqi);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.timing_advance, out.rx_indication_body.rx_pdu_list[2].rx_indication_rel8.timing_advance);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[2].rx_indication_rel9.tl.tag, out.rx_indication_body.rx_pdu_list[2].rx_indication_rel9.tl.tag);
+	CU_ASSERT_EQUAL(in.rx_indication_body.rx_pdu_list[2].rx_indication_rel9.timing_advance_r9, out.rx_indication_body.rx_pdu_list[2].rx_indication_rel9.timing_advance_r9);
+	CU_ASSERT_EQUAL(0, memcmp(in.rx_indication_body.rx_pdu_list[2].data, out.rx_indication_body.rx_pdu_list[2].data, sizeof(pdu2)));
+
+	free(in.rx_indication_body.rx_pdu_list);
+	free(out.rx_indication_body.rx_pdu_list);
+
+}
+void nfapi_test_rach_indication()
+{
+	nfapi_rach_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_rach_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RACH_INDICATION;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 10230;
+	in.rach_indication_body.tl.tag = NFAPI_RACH_INDICATION_BODY_TAG;
+	in.rach_indication_body.number_of_preambles = 2;
+	in.rach_indication_body.preamble_list = (nfapi_preamble_pdu_t*)(malloc(sizeof(nfapi_preamble_pdu_t)*in.rach_indication_body.number_of_preambles));
+	in.rach_indication_body.preamble_list[0].preamble_rel8.tl.tag = NFAPI_PREAMBLE_REL8_TAG;
+	in.rach_indication_body.preamble_list[0].preamble_rel9.tl.tag = NFAPI_PREAMBLE_REL9_TAG;
+	in.rach_indication_body.preamble_list[0].preamble_rel13.tl.tag = NFAPI_PREAMBLE_REL13_TAG;
+
+	in.rach_indication_body.preamble_list[1].preamble_rel8.tl.tag = NFAPI_PREAMBLE_REL8_TAG;
+	in.rach_indication_body.preamble_list[1].preamble_rel9.tl.tag = NFAPI_PREAMBLE_REL9_TAG;
+	in.rach_indication_body.preamble_list[1].preamble_rel13.tl.tag = NFAPI_PREAMBLE_REL13_TAG;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.rach_indication_body.tl.tag, out.rach_indication_body.tl.tag);
+	CU_ASSERT_EQUAL(in.rach_indication_body.number_of_preambles, out.rach_indication_body.number_of_preambles);
+	CU_ASSERT_EQUAL(in.rach_indication_body.preamble_list[0].preamble_rel8.tl.tag, out.rach_indication_body.preamble_list[0].preamble_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.rach_indication_body.preamble_list[0].preamble_rel9.tl.tag, out.rach_indication_body.preamble_list[0].preamble_rel9.tl.tag);
+	CU_ASSERT_EQUAL(in.rach_indication_body.preamble_list[0].preamble_rel13.tl.tag, out.rach_indication_body.preamble_list[0].preamble_rel13.tl.tag);
+	CU_ASSERT_EQUAL(in.rach_indication_body.preamble_list[1].preamble_rel8.tl.tag, out.rach_indication_body.preamble_list[1].preamble_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.rach_indication_body.preamble_list[1].preamble_rel9.tl.tag, out.rach_indication_body.preamble_list[1].preamble_rel9.tl.tag);
+	CU_ASSERT_EQUAL(in.rach_indication_body.preamble_list[1].preamble_rel13.tl.tag, out.rach_indication_body.preamble_list[1].preamble_rel13.tl.tag);
+
+	free(in.rach_indication_body.preamble_list);
+	free(out.rach_indication_body.preamble_list);
+}
+void nfapi_test_srs_indication()
+{
+	nfapi_srs_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_srs_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_SRS_INDICATION;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 10230;
+	in.srs_indication_body.tl.tag = NFAPI_SRS_INDICATION_BODY_TAG;
+	in.srs_indication_body.number_of_ues = 2;
+	in.srs_indication_body.srs_pdu_list = (nfapi_srs_indication_pdu_t*)(malloc(sizeof(nfapi_srs_indication_pdu_t) * in.srs_indication_body.number_of_ues));
+	in.srs_indication_body.srs_pdu_list[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.srs_indication_body.srs_pdu_list[0].rx_ue_information.handle = 0x4567;
+	in.srs_indication_body.srs_pdu_list[0].rx_ue_information.rnti = 42;
+
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.tl.tag = NFAPI_SRS_INDICATION_FDD_REL8_TAG;
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.doppler_estimation = 244;
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.timing_advance = 45;
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.number_of_resource_blocks = 100;
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.rb_start = 0;
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.snr[0] = 255;
+	//...
+	
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel9.tl.tag = NFAPI_SRS_INDICATION_FDD_REL9_TAG;
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel9.timing_advance_r9 = 7690;
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_tdd_rel10.tl.tag = NFAPI_SRS_INDICATION_TDD_REL10_TAG;
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_tdd_rel10.uppts_symbol = 1;
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel11.tl.tag = NFAPI_SRS_INDICATION_FDD_REL11_TAG;
+	in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel11.ul_rtoa = 4800;
+
+	in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.tl.tag = NFAPI_TDD_CHANNEL_MEASUREMENT_TAG;
+	in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.num_prb_per_subband = 4;
+	in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.number_of_subbands = 2;
+	in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.num_atennas = 2;
+	in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[0].subband_index = 4;
+	in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[0].channel[0] = 0xEEEE;
+	in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[1].subband_index = 6;
+	in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[1].channel[0] = 0xAAAA;
+
+	in.srs_indication_body.srs_pdu_list[1].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.srs_indication_body.srs_pdu_list[1].rx_ue_information.handle = 0x4567;
+	in.srs_indication_body.srs_pdu_list[1].rx_ue_information.rnti = 42;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+
+	CU_ASSERT_EQUAL(in.srs_indication_body.tl.tag, out.srs_indication_body.tl.tag);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].rx_ue_information.tl.tag, out.srs_indication_body.srs_pdu_list[0].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].rx_ue_information.handle, out.srs_indication_body.srs_pdu_list[0].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].rx_ue_information.rnti, out.srs_indication_body.srs_pdu_list[0].rx_ue_information.rnti);
+
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.tl.tag, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.doppler_estimation, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.doppler_estimation);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.timing_advance, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.timing_advance);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.number_of_resource_blocks, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.number_of_resource_blocks);
+	CU_ASSERT_EQUAL(memcmp(in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.snr, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.snr, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.number_of_resource_blocks), 0);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.rb_start, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel8.rb_start);
+
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel9.tl.tag, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel9.tl.tag);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel9.timing_advance_r9, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel9.timing_advance_r9);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_tdd_rel10.tl.tag, out.srs_indication_body.srs_pdu_list[0].srs_indication_tdd_rel10.tl.tag);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_tdd_rel10.uppts_symbol, out.srs_indication_body.srs_pdu_list[0].srs_indication_tdd_rel10.uppts_symbol);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel11.tl.tag, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel11.tl.tag);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel11.ul_rtoa, out.srs_indication_body.srs_pdu_list[0].srs_indication_fdd_rel11.ul_rtoa);
+
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.tl.tag, out.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.tl.tag);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.num_prb_per_subband, out.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.num_prb_per_subband);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.number_of_subbands, out.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.number_of_subbands);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.num_atennas, out.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.num_atennas);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[0].subband_index, out.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[0].subband_index) 
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[0].channel[0], out.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[0].channel[0]);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[1].subband_index, out.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[1].subband_index);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[1].channel[0], out.srs_indication_body.srs_pdu_list[0].tdd_channel_measurement.subands[1].channel[0]);
+
+
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[1].rx_ue_information.tl.tag, out.srs_indication_body.srs_pdu_list[1].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[1].rx_ue_information.handle, out.srs_indication_body.srs_pdu_list[1].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.srs_indication_body.srs_pdu_list[1].rx_ue_information.rnti, out.srs_indication_body.srs_pdu_list[1].rx_ue_information.rnti);
+
+	free(in.srs_indication_body.srs_pdu_list);
+	free(out.srs_indication_body.srs_pdu_list);
+}
+void nfapi_test_rx_sr_indication()
+{
+	nfapi_sr_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_sr_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RX_SR_INDICATION;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 10230;
+	in.sr_indication_body.tl.tag = NFAPI_SR_INDICATION_BODY_TAG;
+	in.sr_indication_body.number_of_srs = 2;
+	in.sr_indication_body.sr_pdu_list = (nfapi_sr_indication_pdu_t*)(malloc(sizeof(nfapi_sr_indication_pdu_t) * in.sr_indication_body.number_of_srs));
+	in.sr_indication_body.sr_pdu_list[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.sr_indication_body.sr_pdu_list[0].rx_ue_information.handle = 0x4567;
+	in.sr_indication_body.sr_pdu_list[0].rx_ue_information.rnti = 42;
+
+	in.sr_indication_body.sr_pdu_list[0].ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+	in.sr_indication_body.sr_pdu_list[0].ul_cqi_information.ul_cqi = 34;
+	in.sr_indication_body.sr_pdu_list[0].ul_cqi_information.channel = 38;
+
+	in.sr_indication_body.sr_pdu_list[1].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.sr_indication_body.sr_pdu_list[1].rx_ue_information.handle = 0x9876;
+	in.sr_indication_body.sr_pdu_list[1].rx_ue_information.rnti = 24;
+
+	in.sr_indication_body.sr_pdu_list[1].ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+	in.sr_indication_body.sr_pdu_list[1].ul_cqi_information.ul_cqi = 24;
+	in.sr_indication_body.sr_pdu_list[1].ul_cqi_information.channel = 28;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+
+	CU_ASSERT_EQUAL(in.sr_indication_body.tl.tag, out.sr_indication_body.tl.tag);
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[0].rx_ue_information.tl.tag, out.sr_indication_body.sr_pdu_list[0].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[0].rx_ue_information.handle, out.sr_indication_body.sr_pdu_list[0].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[0].rx_ue_information.rnti, out.sr_indication_body.sr_pdu_list[0].rx_ue_information.rnti);
+
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[0].ul_cqi_information.tl.tag, out.sr_indication_body.sr_pdu_list[0].ul_cqi_information.tl.tag);
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[0].ul_cqi_information.ul_cqi, out.sr_indication_body.sr_pdu_list[0].ul_cqi_information.ul_cqi);
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[0].ul_cqi_information.channel, out.sr_indication_body.sr_pdu_list[0].ul_cqi_information.channel);
+
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[1].rx_ue_information.tl.tag, out.sr_indication_body.sr_pdu_list[1].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[1].rx_ue_information.handle, out.sr_indication_body.sr_pdu_list[1].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[1].rx_ue_information.rnti, out.sr_indication_body.sr_pdu_list[1].rx_ue_information.rnti);
+
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[1].ul_cqi_information.tl.tag, out.sr_indication_body.sr_pdu_list[1].ul_cqi_information.tl.tag);
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[1].ul_cqi_information.ul_cqi, out.sr_indication_body.sr_pdu_list[1].ul_cqi_information.ul_cqi);
+	CU_ASSERT_EQUAL(in.sr_indication_body.sr_pdu_list[1].ul_cqi_information.channel, out.sr_indication_body.sr_pdu_list[1].ul_cqi_information.channel);
+
+	free(in.sr_indication_body.sr_pdu_list);
+	free(out.sr_indication_body.sr_pdu_list);
+
+}
+void nfapi_test_rx_cqi_indication()
+{
+	uint8_t cqi_1[] = { 0, 2, 4, 8, 10};
+	uint8_t cqi_2[] = { 100, 101, 102, 103, 104, 105, 106};
+
+	nfapi_cqi_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_cqi_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_RX_CQI_INDICATION;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 10240;
+	in.cqi_indication_body.tl.tag = NFAPI_CQI_INDICATION_BODY_TAG;
+	in.cqi_indication_body.number_of_cqis = 3;
+
+	in.cqi_indication_body.cqi_pdu_list = (nfapi_cqi_indication_pdu_t*)(calloc(1, sizeof(nfapi_cqi_indication_pdu_t)*in.cqi_indication_body.number_of_cqis));
+	in.cqi_indication_body.cqi_raw_pdu_list = (nfapi_cqi_indication_raw_pdu_t*)(calloc(1, sizeof(nfapi_cqi_indication_raw_pdu_t)*in.cqi_indication_body.number_of_cqis));
+
+	in.cqi_indication_body.cqi_pdu_list[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.cqi_indication_body.cqi_pdu_list[0].rx_ue_information.handle = 0x4567;
+	in.cqi_indication_body.cqi_pdu_list[0].rx_ue_information.rnti = 42;
+	in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.tl.tag = NFAPI_CQI_INDICATION_REL8_TAG;
+	in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.length = sizeof(cqi_1);
+	in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.data_offset = 1;
+	in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.ul_cqi = 4;
+	in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.ri = 4;
+	in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.timing_advance = 63;
+	in.cqi_indication_body.cqi_pdu_list[0].ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+	in.cqi_indication_body.cqi_pdu_list[0].ul_cqi_information.ul_cqi = 34;
+	in.cqi_indication_body.cqi_pdu_list[0].ul_cqi_information.channel = 38;
+
+	in.cqi_indication_body.cqi_pdu_list[1].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.cqi_indication_body.cqi_pdu_list[1].rx_ue_information.handle = 0x4567;
+	in.cqi_indication_body.cqi_pdu_list[1].rx_ue_information.rnti = 42;
+	in.cqi_indication_body.cqi_pdu_list[1].cqi_indication_rel8.tl.tag = NFAPI_CQI_INDICATION_REL8_TAG;
+	in.cqi_indication_body.cqi_pdu_list[1].cqi_indication_rel8.length = 0;
+	in.cqi_indication_body.cqi_pdu_list[1].cqi_indication_rel8.data_offset = 0;
+	in.cqi_indication_body.cqi_pdu_list[1].cqi_indication_rel8.ul_cqi = 0;
+	in.cqi_indication_body.cqi_pdu_list[1].cqi_indication_rel8.ri = 0;
+	in.cqi_indication_body.cqi_pdu_list[1].cqi_indication_rel8.timing_advance = 0;
+
+
+	in.cqi_indication_body.cqi_pdu_list[2].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.cqi_indication_body.cqi_pdu_list[2].rx_ue_information.handle = 0x4567;
+	in.cqi_indication_body.cqi_pdu_list[2].rx_ue_information.rnti = 42;
+	
+	in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.tl.tag = NFAPI_CQI_INDICATION_REL9_TAG;
+	in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.length = sizeof(cqi_2);
+	in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.data_offset = 1;
+	in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ul_cqi = 4;
+	in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.number_of_cc_reported = 4;
+	in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[0] = 6;
+	in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[1] = 7;
+	in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[2] = 8;
+	in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[3] = 1;
+	in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.timing_advance = 63;
+	in.cqi_indication_body.cqi_pdu_list[2].ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+	in.cqi_indication_body.cqi_pdu_list[2].ul_cqi_information.ul_cqi = 44;
+	in.cqi_indication_body.cqi_pdu_list[2].ul_cqi_information.channel = 48;
+
+
+	memcpy(in.cqi_indication_body.cqi_raw_pdu_list[0].pdu, cqi_1, sizeof(cqi_1));
+	memcpy(in.cqi_indication_body.cqi_raw_pdu_list[1].pdu, cqi_2, sizeof(cqi_2));
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+
+	CU_ASSERT_EQUAL(in.sfn_sf, out.sfn_sf);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.tl.tag, out.cqi_indication_body.tl.tag);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].rx_ue_information.tl.tag, out.cqi_indication_body.cqi_pdu_list[0].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].rx_ue_information.handle, out.cqi_indication_body.cqi_pdu_list[0].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].rx_ue_information.rnti, out.cqi_indication_body.cqi_pdu_list[0].rx_ue_information.rnti);
+
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.tl.tag, out.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.tl.tag);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.length, out.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.length);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.data_offset, out.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.data_offset);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.ul_cqi, out.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.ul_cqi);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.ri, out.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.ri);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.timing_advance, out.cqi_indication_body.cqi_pdu_list[0].cqi_indication_rel8.timing_advance);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].ul_cqi_information.tl.tag, out.cqi_indication_body.cqi_pdu_list[0].ul_cqi_information.tl.tag);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].ul_cqi_information.ul_cqi, out.cqi_indication_body.cqi_pdu_list[0].ul_cqi_information.ul_cqi);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[0].ul_cqi_information.channel, out.cqi_indication_body.cqi_pdu_list[0].ul_cqi_information.channel);
+
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].rx_ue_information.tl.tag, out.cqi_indication_body.cqi_pdu_list[2].rx_ue_information.tl.tag);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].rx_ue_information.handle, out.cqi_indication_body.cqi_pdu_list[2].rx_ue_information.handle);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].rx_ue_information.rnti, out.cqi_indication_body.cqi_pdu_list[2].rx_ue_information.rnti);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.tl.tag, out.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.tl.tag);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.length, out.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.length);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.data_offset, out.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.data_offset);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ul_cqi, out.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ul_cqi);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.number_of_cc_reported, out.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.number_of_cc_reported);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[0], out.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[0]);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[1], out.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[1]);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[2], out.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[2]);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[3], out.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.ri[3]);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.timing_advance, out.cqi_indication_body.cqi_pdu_list[2].cqi_indication_rel9.timing_advance);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].ul_cqi_information.tl.tag, out.cqi_indication_body.cqi_pdu_list[2].ul_cqi_information.tl.tag);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].ul_cqi_information.ul_cqi, out.cqi_indication_body.cqi_pdu_list[2].ul_cqi_information.ul_cqi);
+	CU_ASSERT_EQUAL(in.cqi_indication_body.cqi_pdu_list[2].ul_cqi_information.channel, out.cqi_indication_body.cqi_pdu_list[2].ul_cqi_information.channel);
+
+
+	CU_ASSERT_EQUAL(memcmp(in.cqi_indication_body.cqi_raw_pdu_list[0].pdu, out.cqi_indication_body.cqi_raw_pdu_list[0].pdu, sizeof(cqi_1)), 0);
+	CU_ASSERT_EQUAL(memcmp(in.cqi_indication_body.cqi_raw_pdu_list[2].pdu, out.cqi_indication_body.cqi_raw_pdu_list[2].pdu, sizeof(cqi_2)), 0);
+
+	free(in.cqi_indication_body.cqi_pdu_list);
+	free(in.cqi_indication_body.cqi_raw_pdu_list);
+	free(out.cqi_indication_body.cqi_pdu_list);
+	free(out.cqi_indication_body.cqi_raw_pdu_list);
+}
+
+void nfapi_test_lbt_dl_config_request()
+{
+	nfapi_lbt_dl_config_request_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_lbt_dl_config_request_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_LBT_DL_CONFIG_REQUEST;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	//in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 1234;
+	in.lbt_dl_config_request_body.tl.tag = NFAPI_LBT_DL_CONFIG_REQUEST_BODY_TAG;
+	in.lbt_dl_config_request_body.number_of_pdus = 2;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list = (nfapi_lbt_dl_config_request_pdu_t*)(malloc(sizeof(nfapi_lbt_dl_config_request_pdu_t) * in.lbt_dl_config_request_body.number_of_pdus));
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].pdu_type = NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].pdu_size = 32;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.tl.tag = NFAPI_LBT_PDSCH_REQ_PDU_REL13_TAG;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.handle = 0x1234;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.mp_cca = 22;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.n_cca = 23;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.offset = 24;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.lte_txop_sf = 25;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.txop_sfn_sf_end = 26;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.lbt_mode = 27;
+
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].pdu_type = NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].pdu_size = 32;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.tl.tag = NFAPI_LBT_DRS_REQ_PDU_REL13_TAG;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.handle = 0x4567;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.offset = 1;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.sfn_sf_end = 2;
+	in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.lbt_mode = 3;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.phy_id, out.header.phy_id);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.header.message_length, out.header.message_length);
+	CU_ASSERT_EQUAL(in.header.m_segment_sequence, out.header.m_segment_sequence);
+	CU_ASSERT_EQUAL(in.header.checksum, out.header.checksum);
+	CU_ASSERT_EQUAL(in.sfn_sf, out.sfn_sf);
+
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.number_of_pdus, out.lbt_dl_config_request_body.number_of_pdus);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].pdu_type, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].pdu_type);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].pdu_size, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].pdu_size);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.tl.tag, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.tl.tag);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.handle, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.handle);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.mp_cca, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.mp_cca);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.n_cca, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.n_cca);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.offset, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.offset);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.lte_txop_sf, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.lte_txop_sf);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.txop_sfn_sf_end, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.txop_sfn_sf_end);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.lbt_mode, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[0].lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13.lbt_mode);
+
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].pdu_type, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].pdu_type);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].pdu_size, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].pdu_size);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.tl.tag, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.tl.tag);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.handle, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.handle);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.offset, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.offset);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.sfn_sf_end, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.sfn_sf_end);
+	CU_ASSERT_EQUAL(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.lbt_mode, out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list[1].lbt_drs_req_pdu.lbt_drs_req_pdu_rel13.lbt_mode);
+
+	free(in.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list);
+	free(out.lbt_dl_config_request_body.lbt_dl_config_req_pdu_list);
+}
+
+void nfapi_test_lbt_dl_indication()
+{
+	nfapi_lbt_dl_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_lbt_dl_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_LBT_DL_INDICATION;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	//in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 1234;
+	in.lbt_dl_indication_body.tl.tag = NFAPI_LBT_DL_INDICATION_BODY_TAG;
+	in.lbt_dl_indication_body.number_of_pdus = 2;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list = (nfapi_lbt_dl_indication_pdu_t*)(malloc(sizeof(nfapi_lbt_dl_indication_pdu_t) * in.lbt_dl_indication_body.number_of_pdus));
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[0].pdu_type = NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[0].pdu_size = 32;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.tl.tag = NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.handle = 0x1234;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.result = 22;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.lte_txop_symbols = 23;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.initial_partial_sf = 24;
+
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[1].pdu_type = NFAPI_LBT_DL_RSP_DRS_PDU_TYPE;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[1].pdu_size = 32;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.tl.tag = NFAPI_LBT_DRS_RSP_PDU_REL13_TAG;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.handle = 0x4567;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.result = 1;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.phy_id, out.header.phy_id);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.header.message_length, out.header.message_length);
+	CU_ASSERT_EQUAL(in.header.m_segment_sequence, out.header.m_segment_sequence);
+	CU_ASSERT_EQUAL(in.header.checksum, out.header.checksum);
+	CU_ASSERT_EQUAL(in.sfn_sf, out.sfn_sf);
+
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.number_of_pdus, out.lbt_dl_indication_body.number_of_pdus);
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[0].pdu_type, out.lbt_dl_indication_body.lbt_indication_pdu_list[0].pdu_type);
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[0].pdu_size, out.lbt_dl_indication_body.lbt_indication_pdu_list[0].pdu_size);
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.tl.tag, out.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.tl.tag);
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.handle, out.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.handle);
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.result, out.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.result);
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.lte_txop_symbols, out.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.lte_txop_symbols);
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.initial_partial_sf, out.lbt_dl_indication_body.lbt_indication_pdu_list[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.initial_partial_sf);
+
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[1].pdu_type, out.lbt_dl_indication_body.lbt_indication_pdu_list[1].pdu_type);
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[1].pdu_size, out.lbt_dl_indication_body.lbt_indication_pdu_list[1].pdu_size);
+
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.tl.tag, out.lbt_dl_indication_body.lbt_indication_pdu_list[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.tl.tag);
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.handle, out.lbt_dl_indication_body.lbt_indication_pdu_list[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.handle);
+	CU_ASSERT_EQUAL(in.lbt_dl_indication_body.lbt_indication_pdu_list[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.result, out.lbt_dl_indication_body.lbt_indication_pdu_list[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.result);
+
+	free(in.lbt_dl_indication_body.lbt_indication_pdu_list);
+	free(out.lbt_dl_indication_body.lbt_indication_pdu_list);
+
+}
+void nfapi_test_lbt_dl_indication_invalid_pdu_type()
+{
+	nfapi_lbt_dl_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_lbt_dl_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_LBT_DL_INDICATION;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	//in.header.checksum = 0xEEEEEEEE;
+
+	in.sfn_sf = 1234;
+	in.lbt_dl_indication_body.tl.tag = NFAPI_LBT_DL_INDICATION_BODY_TAG;
+	in.lbt_dl_indication_body.number_of_pdus = 1;
+	in.lbt_dl_indication_body.lbt_indication_pdu_list = (nfapi_lbt_dl_indication_pdu_t*)(malloc(sizeof(nfapi_lbt_dl_indication_pdu_t) * in.lbt_dl_indication_body.number_of_pdus));
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[0].pdu_type = 44; // Invalid pdu type
+	in.lbt_dl_indication_body.lbt_indication_pdu_list[0].pdu_size = 32;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	int unpack_result = nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(unpack_result, -1);
+	CU_ASSERT_EQUAL(in.header.phy_id, out.header.phy_id);
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.header.message_length, out.header.message_length);
+	CU_ASSERT_EQUAL(in.header.m_segment_sequence, out.header.m_segment_sequence);
+	CU_ASSERT_EQUAL(in.header.checksum, out.header.checksum);
+	CU_ASSERT_EQUAL(in.sfn_sf, out.sfn_sf);
+	free(in.lbt_dl_indication_body.lbt_indication_pdu_list);
+	free(out.lbt_dl_indication_body.lbt_indication_pdu_list);
+}
+
+void nfapi_test_nb_harq_indication()
+{
+	nfapi_nb_harq_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_nb_harq_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_NB_HARQ_INDICATION;
+	in.header.message_length = 0;
+
+	in.sfn_sf = 1234;
+	in.nb_harq_indication_body.tl.tag = NFAPI_NB_HARQ_INDICATION_BODY_TAG;
+	in.nb_harq_indication_body.number_of_harqs = 1;
+	
+	nfapi_nb_harq_indication_pdu_t nb_harq_pdu[1];
+	in.nb_harq_indication_body.nb_harq_pdu_list = &nb_harq_pdu[0];
+	in.nb_harq_indication_body.nb_harq_pdu_list[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+	in.nb_harq_indication_body.nb_harq_pdu_list[0].nb_harq_indication_fdd_rel13.tl.tag = NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG;
+	in.nb_harq_indication_body.nb_harq_pdu_list[0].ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+	
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	IN_OUT_ASSERT(sfn_sf);
+	IN_OUT_ASSERT(nb_harq_indication_body.tl.tag);
+	IN_OUT_ASSERT(nb_harq_indication_body.number_of_harqs);
+	
+	IN_OUT_ASSERT(nb_harq_indication_body.nb_harq_pdu_list[0].rx_ue_information.tl.tag);
+	IN_OUT_ASSERT(nb_harq_indication_body.nb_harq_pdu_list[0].nb_harq_indication_fdd_rel13.tl.tag);
+	IN_OUT_ASSERT(nb_harq_indication_body.nb_harq_pdu_list[0].ul_cqi_information.tl.tag);
+	
+}
+
+void nfapi_test_nrach_indication()
+{
+	nfapi_nrach_indication_t in;
+	memset(&in, 0, sizeof(in));
+	nfapi_nrach_indication_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_NRACH_INDICATION;
+	in.header.message_length = 0;
+
+	in.sfn_sf = 1234;
+	
+	in.nrach_indication_body.tl.tag = NFAPI_NRACH_INDICATION_BODY_TAG;
+	in.nrach_indication_body.number_of_initial_scs_detected = 1;
+	
+	nfapi_nrach_indication_pdu_t nrach_pdu[1];
+	in.nrach_indication_body.nrach_pdu_list = &nrach_pdu[0];
+	
+	in.nrach_indication_body.nrach_pdu_list[0].nrach_indication_rel13.tl.tag = NFAPI_NRACH_INDICATION_REL13_TAG;
+	
+	
+
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+	
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	IN_OUT_ASSERT(sfn_sf);
+	IN_OUT_ASSERT(nrach_indication_body.tl.tag);
+	IN_OUT_ASSERT(nrach_indication_body.number_of_initial_scs_detected);
+	IN_OUT_ASSERT(nrach_indication_body.nrach_pdu_list[0].nrach_indication_rel13.tl.tag);
+	IN_OUT_ASSERT(nrach_indication_body.nrach_pdu_list[0].nrach_indication_rel13.rnti);
+	IN_OUT_ASSERT(nrach_indication_body.nrach_pdu_list[0].nrach_indication_rel13.initial_sc);
+	IN_OUT_ASSERT(nrach_indication_body.nrach_pdu_list[0].nrach_indication_rel13.timing_advance);
+	IN_OUT_ASSERT(nrach_indication_body.nrach_pdu_list[0].nrach_indication_rel13.nrach_ce_level);	
+	
+}
+
+void nfapi_test_dl_node_sync()
+{
+	nfapi_dl_node_sync_t in;
+	nfapi_dl_node_sync_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_DL_NODE_SYNC;
+	in.header.message_length = 0;
+
+	in.t1 = 10239999;
+	in.delta_sfn_sf = -987;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.t1, out.t1);
+	CU_ASSERT_EQUAL(in.delta_sfn_sf, out.delta_sfn_sf);
+}
+void nfapi_test_ul_node_sync()
+{
+	nfapi_ul_node_sync_t in;
+	nfapi_ul_node_sync_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_UL_NODE_SYNC;
+	in.header.message_length = 0;
+
+	in.t1 = 10239999;
+	in.t2 = 10239999;
+	in.t2 = 10239999;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+	
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.t1, out.t1);
+	CU_ASSERT_EQUAL(in.t2, out.t2);
+	CU_ASSERT_EQUAL(in.t3, out.t3);
+}
+void nfapi_test_timing_info()
+{
+	nfapi_timing_info_t in;
+	nfapi_timing_info_t out;
+
+	in.header.phy_id = NFAPI_PHY_ID_NA;
+	in.header.message_id = NFAPI_TIMING_INFO;
+	in.header.message_length = 0;
+	in.header.m_segment_sequence = 0xDDDD;
+	in.header.checksum = 0xEEEEEEEE;
+
+	in.last_sfn_sf = 0xDEAD; //10239999;
+	in.time_since_last_timing_info = 4294967295u;
+	in.dl_config_jitter = 4294967295u;
+	in.tx_request_jitter = 4294967295u;
+	in.ul_config_jitter = 4294967295u;
+	in.hi_dci0_jitter = 4294967295u;
+	in.dl_config_latest_delay = 0; //-2147483648L;
+	in.tx_request_latest_delay = 2147483647u;
+	in.ul_config_latest_delay = 0; //-2147483648L ;
+	in.hi_dci0_latest_delay =  0; //2147483647u;
+	in.dl_config_earliest_arrival = 0; //-2147483648L;
+	in.tx_request_earliest_arrival = 0; //2147483647u;
+	in.ul_config_earliest_arrival = 0; //2147483648L;
+	in.hi_dci0_earliest_arrival = -0; //2147483647u;
+
+	int packedMessageLength = nfapi_p7_message_pack(&in, gTestNfapiMessageTx, MAX_PACKED_MESSAGE_SIZE, 0);
+
+	nfapi_p7_message_unpack(gTestNfapiMessageTx, packedMessageLength, &out, sizeof(out), 0);
+
+	CU_ASSERT_EQUAL(in.header.message_id, out.header.message_id);
+	CU_ASSERT_EQUAL(in.last_sfn_sf, out.last_sfn_sf);
+	CU_ASSERT_EQUAL(in.time_since_last_timing_info, out.time_since_last_timing_info);
+	CU_ASSERT_EQUAL(in.dl_config_jitter, out.dl_config_jitter);
+	CU_ASSERT_EQUAL(in.tx_request_jitter, out.tx_request_jitter);
+	CU_ASSERT_EQUAL(in.ul_config_jitter, out.ul_config_jitter);
+	CU_ASSERT_EQUAL(in.hi_dci0_jitter, out.hi_dci0_jitter);
+	CU_ASSERT_EQUAL(in.dl_config_latest_delay, out.dl_config_latest_delay);
+	CU_ASSERT_EQUAL(in.tx_request_latest_delay, out.tx_request_latest_delay);
+	CU_ASSERT_EQUAL(in.ul_config_latest_delay, out.ul_config_latest_delay);
+	CU_ASSERT_EQUAL(in.hi_dci0_latest_delay, out.hi_dci0_latest_delay);
+	CU_ASSERT_EQUAL(in.dl_config_earliest_arrival, out.dl_config_earliest_arrival);
+	CU_ASSERT_EQUAL(in.tx_request_earliest_arrival, out.tx_request_earliest_arrival);
+	CU_ASSERT_EQUAL(in.ul_config_earliest_arrival, out.ul_config_earliest_arrival);
+	CU_ASSERT_EQUAL(in.hi_dci0_earliest_arrival, out.hi_dci0_earliest_arrival);
+}
+
+void nfapi_struct_sizes()
+{
+
+	
+	printf("P5\n");
+	printf("nfapi_pnf_param_request %zu\n", sizeof(nfapi_pnf_param_request_t));
+	printf("nfapi_pnf_param_response %zu\n", sizeof(nfapi_pnf_param_response_t));
+	printf("nfapi_pnf_config_request %zu\n", sizeof(nfapi_pnf_config_request_t));
+	printf("nfapi_pnf_config_response %zu\n", sizeof(nfapi_pnf_config_response_t));
+	printf("nfapi_pnf_start_request %zu\n", sizeof(nfapi_pnf_start_request_t));
+	printf("nfapi_pnf_start_response %zu\n", sizeof(nfapi_pnf_start_response_t));
+	printf("nfapi_pnf_stop_request %zu\n", sizeof(nfapi_pnf_stop_request_t));
+	printf("nfapi_pnf_stop_request %zu\n", sizeof(nfapi_pnf_stop_response_t));
+	printf("nfapi_param_request %zu\n", sizeof(nfapi_param_request_t));
+	printf("nfapi_param_response %zu\n", sizeof(nfapi_param_response_t));
+	printf("nfapi_config_request %zu\n", sizeof(nfapi_config_request_t));
+	printf("nfapi_config_response %zu\n", sizeof(nfapi_config_response_t));
+	printf("nfapi_start_request %zu\n", sizeof(nfapi_start_request_t));
+	printf("nfapi_start_response %zu\n", sizeof(nfapi_start_response_t));
+	printf("nfapi_stop_request %zu\n", sizeof(nfapi_stop_request_t));
+	printf("nfapi_stop_response %zu\n", sizeof(nfapi_stop_response_t));
+	printf("nfapi_measurement_request %zu\n", sizeof(nfapi_measurement_request_t));
+	printf("nfapi_measurement_response %zu\n", sizeof(nfapi_measurement_response_t));
+
+	printf("P7\n");
+	printf("nfapi_timing_info_t %zu\n", sizeof(nfapi_timing_info_t));
+	printf("nfapi_dl_config_request_t %zu\n", sizeof(nfapi_dl_config_request_t));
+	printf("nfapi_ul_config_request_t %zu\n", sizeof(nfapi_ul_config_request_t));
+	printf("nfapi_hi_dci0_request_t %zu\n", sizeof(nfapi_hi_dci0_request_t));
+	printf("nfapi_tx_request_t %zu\n", sizeof(nfapi_tx_request_t));
+	printf("nfapi_crc_indication_t %zu\n", sizeof(nfapi_crc_indication_t));
+	printf("nfapi_sr_indication_t %zu\n", sizeof(nfapi_sr_indication_t));
+	printf("nfapi_srs_indication_t %zu\n", sizeof(nfapi_srs_indication_t));
+	printf("nfapi_harq_indication_t %zu\n", sizeof(nfapi_harq_indication_t));
+	printf("nfapi_rx_indication_t %zu\n", sizeof(nfapi_rx_indication_t));
+	printf("nfapi_rach_indication_t %zu\n", sizeof(nfapi_rach_indication_t));
+	printf("nfapi_cqi_indication_t %zu\n", sizeof(nfapi_cqi_indication_t));
+	printf("nfapi_nb_harq_indication_t %zu\n", sizeof(nfapi_nb_harq_indication_t));
+	printf("nfapi_nrach_indication_t %zu\n", sizeof(nfapi_nrach_indication_t));
+	printf("nfapi_lbt_dl_config_request_t %zu\n", sizeof(nfapi_lbt_dl_config_request_t));
+	printf("nfapi_lbt_dl_indication_t %zu\n", sizeof(nfapi_lbt_dl_indication_t));
+
+	printf("P4\n");
+	printf("nfapi_lte_rssi_request_t %zu\n", sizeof(nfapi_lte_rssi_request_t));
+	printf("nfapi_utran_rssi_request_t %zu\n", sizeof(nfapi_utran_rssi_request_t));
+	printf("nfapi_geran_rssi_request_t %zu\n", sizeof(nfapi_geran_rssi_request_t));
+	printf("nfapi_lte_cell_search_request_t %zu\n", sizeof(nfapi_lte_cell_search_request_t));
+	printf("nfapi_utran_cell_search_request_t %zu\n", sizeof(nfapi_utran_cell_search_request_t));
+	printf("nfapi_geran_cell_search_request_t %zu\n", sizeof(nfapi_geran_cell_search_request_t));
+	printf("nfapi_lte_cell_search_indication_t %zu\n", sizeof(nfapi_lte_cell_search_indication_t));
+	printf("nfapi_utran_cell_search_indication_t %zu\n", sizeof(nfapi_utran_cell_search_indication_t));
+	printf("nfapi_geran_cell_search_indication_t %zu\n", sizeof(nfapi_geran_cell_search_indication_t));
+	printf("nfapi_lte_broadcast_detect_request_t %zu\n", sizeof(nfapi_lte_broadcast_detect_request_t));
+	printf("nfapi_utran_broadcast_detect_request_t %zu\n", sizeof(nfapi_utran_broadcast_detect_request_t));
+	printf("nfapi_lte_broadcast_detect_indication_t %zu\n", sizeof(nfapi_lte_broadcast_detect_indication_t));
+	printf("nfapi_utran_broadcast_detect_indication_t %zu\n", sizeof(nfapi_utran_broadcast_detect_indication_t));
+	printf("nfapi_lte_system_information_schedule_request_t %zu\n", sizeof(nfapi_lte_system_information_schedule_request_t));
+	printf("nfapi_lte_system_information_request_t %zu\n", sizeof(nfapi_lte_system_information_request_t));
+	printf("nfapi_utran_system_information_request_t %zu\n", sizeof(nfapi_utran_system_information_request_t));
+	printf("nfapi_geran_system_information_request_t %zu\n", sizeof(nfapi_geran_system_information_request_t));
+	printf("nfapi_lte_system_information_indication_t %zu\n", sizeof(nfapi_lte_system_information_indication_t));
+	printf("nfapi_utran_system_information_indication_t %zu\n", sizeof(nfapi_utran_system_information_indication_t));
+	printf("nfapi_geran_system_information_indication_t %zu\n", sizeof(nfapi_geran_system_information_indication_t));
+}
+
+/************* Test Runner Code goes here **************/
+
+
+int main ( int argc, char** argv)
+{
+
+/*
+        printf("1..3\n");
+        printf("ok 1 - run good\n");	
+        printf("ok 2 - mojojojo\n");	
+        printf("not ok 3 - not implemented\n");	
+	return 0;
+	*/
+
+
+	int i;
+	printf("%d \n", argc);
+	for(i = 0; i < argc; ++i)
+	{
+		if(argv[i] != 0)
+			printf("%s \n", argv[i]);
+	}
+
+	CU_pSuite pSuite = NULL;
+
+	/* initialize the CUnit test registry */
+	if ( CUE_SUCCESS != CU_initialize_registry() )
+		return CU_get_error();
+
+	/* add a suite to the registry */
+	pSuite = CU_add_suite( "nfapi_test_suite", init_suite, clean_suite );
+	if ( NULL == pSuite ) {
+		CU_cleanup_registry();
+		return CU_get_error();
+	}
+
+	/* add the tests to the suite */
+	//if ( (NULL == CU_add_test(pSuite, "nfapi_test_pnf_config_req", nfapi_test_pnf_config_req)) ||
+	//     (NULL == CU_add_test(pSuite, "nfapi_test_2", nfapi_test_2)) 
+	//   )
+	// {
+	//   CU_cleanup_registry();
+	//   return CU_get_error();
+	//}
+
+
+	CU_pSuite pSuiteP4 = CU_add_suite( "nfapi_p4_pack_unpack_test_suite", init_suite, clean_suite );
+	if(pSuiteP4)
+	{
+		if((NULL == CU_add_test(pSuiteP4, "nfapi_test_rssi_request_lte", nfapi_test_rssi_request_lte)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_rssi_request_lte2", nfapi_test_rssi_request_lte2)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_rssi_request_lte_overrun", nfapi_test_rssi_request_lte_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_rssi_request_lte_rat_type_mismatch", nfapi_test_rssi_request_lte_rat_type_mismatch)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_rssi_request_utran", nfapi_test_rssi_request_utran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_rssi_request_geran", nfapi_test_rssi_request_geran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_rssi_request_nb_iot", nfapi_test_rssi_request_nb_iot)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_rssi_response", nfapi_test_rssi_response)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_rssi_indication", nfapi_test_rssi_indication)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_rssi_indication_overrun", nfapi_test_rssi_indication_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_request_lte", nfapi_test_cell_search_request_lte)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_request_lte_overrun", nfapi_test_cell_search_request_lte_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_request_utran", nfapi_test_cell_search_request_utran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_request_utran_overrun", nfapi_test_cell_search_request_utran_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_request_geran", nfapi_test_cell_search_request_geran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_request_geran_overrun", nfapi_test_cell_search_request_geran_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_request_nb_iot", nfapi_test_cell_search_request_nb_iot)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_response", nfapi_test_cell_search_response)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_indication_lte", nfapi_test_cell_search_indication_lte)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_indication_lte_overrun", nfapi_test_cell_search_indication_lte_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_indication_utran", nfapi_test_cell_search_indication_utran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_indication_utran_overrun", nfapi_test_cell_search_indication_utran_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_indication_geran", nfapi_test_cell_search_indication_geran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_indication_geran_overrun", nfapi_test_cell_search_indication_geran_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_indication_state_overrun", nfapi_test_cell_search_indication_state_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_cell_search_indication_nb_iot", nfapi_test_cell_search_indication_nb_iot)) ||				
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_request_lte", nfapi_test_broadcast_detect_request_lte)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_request_utran", nfapi_test_broadcast_detect_request_utran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_request_nb_iot", nfapi_test_broadcast_detect_request_nb_iot)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_request_state_overrun", nfapi_test_broadcast_detect_request_state_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_response", nfapi_test_broadcast_detect_response)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_indication_lte", nfapi_test_broadcast_detect_indication_lte)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_indication_lte_overrun", nfapi_test_broadcast_detect_indication_lte_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_indication_utran", nfapi_test_broadcast_detect_indication_utran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_indication_utran_overrun", nfapi_test_broadcast_detect_indication_utran_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_indication_state_overrun", nfapi_test_broadcast_detect_indication_state_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_broadcast_detect_indication_nb_iot", nfapi_test_broadcast_detect_indication_nb_iot)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_schedule_request_lte", nfapi_test_system_information_schedule_request_lte)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_schedule_request_state_overrun", nfapi_test_system_information_schedule_request_state_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_schedule_request_nb_iot", nfapi_test_system_information_schedule_request_nb_iot)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_schedule_response", nfapi_test_system_information_schedule_response)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_schedule_indication_lte", nfapi_test_system_information_schedule_indication_lte)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_schedule_indication_nb_iot", nfapi_test_system_information_schedule_indication_nb_iot)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_request_lte", nfapi_test_system_information_request_lte)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_request_lte_overrun", nfapi_test_system_information_request_lte_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_request_utran", nfapi_test_system_information_request_utran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_request_geran", nfapi_test_system_information_request_geran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_request_state_overrun", nfapi_test_system_information_request_state_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_request_nb_iot", nfapi_test_system_information_request_nb_iot)) ||				
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_response", nfapi_test_system_information_response)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_indication_lte", nfapi_test_system_information_indication_lte)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_indication_lte_overrun", nfapi_test_system_information_indication_lte_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_indication_utran", nfapi_test_system_information_indication_utran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_indication_utran_overrun", nfapi_test_system_information_indication_utran_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_indication_geran", nfapi_test_system_information_indication_geran)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_indication_geran_overrun", nfapi_test_system_information_indication_geran_overrun)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_system_information_indication_nb_iot", nfapi_test_system_information_indication_nb_iot)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_nmm_stop_request", nfapi_test_nmm_stop_request)) ||
+				(NULL == CU_add_test(pSuiteP4, "nfapi_test_nmm_stop_response", nfapi_test_nmm_stop_response))
+				) 
+				{
+					CU_cleanup_registry();
+					return CU_get_error();
+				}
+	}
+	else
+	{
+		CU_cleanup_registry();
+		return CU_get_error();
+	}
+
+	CU_pSuite pSuiteP5 = CU_add_suite( "nfapi_p5_pack_unpack_test_suite", init_suite, clean_suite );
+	if(pSuiteP5)
+	{
+		if((NULL == CU_add_test(pSuiteP5, "nfapi_test_pnf_param_request", nfapi_test_pnf_param_request)) ||
+		    (NULL == CU_add_test(pSuiteP5, "nfapi_test_pnf_param_request_ve", nfapi_test_pnf_param_request_ve)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_pnf_param_response", nfapi_test_pnf_param_response)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_pnf_config_request", nfapi_test_pnf_config_request)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_pnf_config_response", nfapi_test_pnf_config_response)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_pnf_config_response1", nfapi_test_pnf_config_response1)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_pnf_start_request", nfapi_test_pnf_start_request)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_pnf_start_response", nfapi_test_pnf_start_response)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_pnf_stop_request", nfapi_test_pnf_stop_request)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_pnf_stop_request", nfapi_test_pnf_stop_request)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_param_request", nfapi_test_param_request)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_param_response", nfapi_test_param_response)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_config_request", nfapi_test_config_request)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_config_response", nfapi_test_config_response)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_start_request", nfapi_test_start_request)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_start_response", nfapi_test_start_response)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_stop_request", nfapi_test_stop_request)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_stop_response", nfapi_test_stop_response)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_measurement_request", nfapi_test_measurement_request)) ||
+			(NULL == CU_add_test(pSuiteP5, "nfapi_test_measurement_response", nfapi_test_measurement_response))
+		  )
+		{
+			CU_cleanup_registry();
+			return CU_get_error();
+		}
+
+	}
+	else
+	{
+		CU_cleanup_registry();
+		return CU_get_error();
+	}
+
+	CU_pSuite pSuiteP7 = CU_add_suite( "nfapi_p7_pack_unpack_test_suite", init_suite, clean_suite );
+	if(pSuiteP7)
+	{
+		if((NULL == CU_add_test(pSuiteP7, "nfapi_test_dl_config_request", nfapi_test_dl_config_request)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_ul_config_request", nfapi_test_ul_config_request)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_hi_dci0_request", nfapi_test_hi_dci0_request)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_tx_request", nfapi_test_tx_request)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_harq_indication", nfapi_test_harq_indication)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_crc_indication", nfapi_test_crc_indication)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_rx_ulsch_indication", nfapi_test_rx_ulsch_indication)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_rach_indication", nfapi_test_rach_indication)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_srs_indication", nfapi_test_srs_indication)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_rx_sr_indication", nfapi_test_rx_sr_indication)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_rx_cqi_indication", nfapi_test_rx_cqi_indication)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_lbt_dl_config_request", nfapi_test_lbt_dl_config_request)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_lbt_dl_indication", nfapi_test_lbt_dl_indication)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_lbt_dl_indication_invalid_pdu_type", nfapi_test_lbt_dl_indication_invalid_pdu_type)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_nb_harq_indication", nfapi_test_nb_harq_indication)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_nrach_indication", nfapi_test_nrach_indication)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_dl_node_sync", nfapi_test_dl_node_sync)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_ul_node_sync", nfapi_test_ul_node_sync)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_test_timing_info", nfapi_test_timing_info)) ||
+			(NULL == CU_add_test(pSuiteP7, "nfapi_struct_sizes", nfapi_struct_sizes))
+		  )
+		{
+			CU_cleanup_registry();
+			return CU_get_error();
+		}
+
+	}
+	else
+	{
+		CU_cleanup_registry();
+		return CU_get_error();
+	}
+
+
+	// Run all tests using the basic interface
+	CU_basic_set_mode(CU_BRM_VERBOSE);
+	//printf(" CU_basic_set_mode set \n");
+	CU_set_output_filename("nfapi_unit_test_results.xml");
+
+	CU_basic_run_tests();
+	//CU_automated_run_tests();
+
+	//CU_set_test_complete_handler(automated_test_complete_message_handler);
+	//CU_run_all_tests();
+
+	
+	CU_pSuite s = CU_get_registry()->pSuite;
+	int count = 0;
+	while(s)
+	{
+		CU_pTest t = s->pTest;
+		while(t)
+		{
+			count++;
+			t = t->pNext;
+		}
+		s = s->pNext;
+	}
+
+	printf("%d..%d\n", 1, count);
+
+
+
+	s = CU_get_registry()->pSuite;
+	count = 1;
+	while(s)
+	{
+		CU_pTest t = s->pTest;
+		while(t)
+		{
+			int pass = 1;
+			CU_FailureRecord* failures = CU_get_failure_list();
+			while(failures)
+			{
+				if(strcmp(failures->pSuite->pName, s->pName) == 0 &&
+				   strcmp(failures->pTest->pName, t->pName) == 0)
+				{
+					pass = 0;
+					failures = 0;
+				}
+				else
+				{
+					failures = failures->pNext;
+				}
+			}
+
+			if(pass)
+				printf("ok %d - %s:%s\n", count, s->pName, t->pName);
+			else 
+				printf("not ok %d - %s:%s\n", count, s->pName, t->pName);
+
+			count++;
+			t = t->pNext;
+		}
+		s = s->pNext;
+	}
+
+	/*
+	s = CU_get_registry()->pSuite;
+	while(s)
+	{
+	   printf("Suite %s\n", s->pName);
+	   CU_pTest t = s->pTest;
+	   while(t)
+	   {
+		   printf(" Test %s\n", t->pName);
+			i//CU_ErrorCode e = CU_basic_run_test(s, t);
+
+		   t = t->pNext;
+	   }
+	   s = s->pNext;
+	}
+	*/
+
+
+
+	//printf("CU_basic_run_tests completed \n");
+	//CU_basic_show_failures(CU_get_failure_list());
+	//printf("CU_basic_show_failures completed\n\n");
+	/*
+	// Run all tests using the automated interface
+	CU_automated_run_tests();
+	CU_list_tests_to_file();
+
+	// Run all tests using the console interface
+	CU_console_run_tests();
+	*/
+	/* Clean up registry and return */
+
+
+	CU_cleanup_registry();
+	return CU_get_error();
+
+}
diff --git a/nfapi/open-nFAPI/pnf/Makefile.am b/nfapi/open-nFAPI/pnf/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..663d96b6dddeba94a730abf6a82f7c9fe6ddd6a5
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf/Makefile.am
@@ -0,0 +1,32 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+AUTOMAKE_OPTIONS=subdir-objects
+
+AM_CPPFLAGS = -I$(top_srcdir)/pnf/inc -I$(top_srcdir)/pnf/public_inc -I$(top_srcdir)/nfapi/public_inc -I$(top_srcdir)/common/public_inc -g -Wall -Werror
+
+
+noinst_LIBRARIES = libnfapi_pnf.a
+
+libnfapi_pnf_a_SOURCES = src/pnf.c\
+						 src/pnf_interface.c\
+						 src/pnf_p7.c\
+						 src/pnf_p7_interface.c
+
+LDADD = -lsctp
+
+
+
diff --git a/nfapi/open-nFAPI/pnf/inc/pnf.h b/nfapi/open-nFAPI/pnf/inc/pnf.h
new file mode 100644
index 0000000000000000000000000000000000000000..ab38c66e090f1f2ed6d010988465155e25fa8ca8
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf/inc/pnf.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef _PNF_H_
+#define _PNF_H_
+
+#include "nfapi_pnf_interface.h"
+
+#define NFAPI_MAX_PACKED_MESSAGE_SIZE 8192
+
+typedef struct {
+
+	nfapi_pnf_config_t _public;
+
+	int p5_sock;
+	uint8_t tx_message_buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE];
+
+	uint8_t sctp;
+
+	uint8_t terminate;
+
+} pnf_t;
+
+
+int pnf_connect(pnf_t *pnf);
+int pnf_message_pump(pnf_t *pnf);
+
+int pnf_pack_and_send_p5_message(pnf_t* pnf, nfapi_p4_p5_message_header_t* msg, uint32_t msg_len);
+int pnf_pack_and_send_p4_message(pnf_t* pnf, nfapi_p4_p5_message_header_t* msg, uint32_t msg_len);
+int pnf_send_message(pnf_t* pnf, uint8_t* msg, uint32_t msg_len, uint16_t stream_id);
+
+nfapi_pnf_phy_config_t* nfapi_pnf_phy_config_find(nfapi_pnf_config_t* config, uint16_t phy_id);
+
+#endif // _PNF_H_
+
diff --git a/nfapi/open-nFAPI/pnf/inc/pnf_p7.h b/nfapi/open-nFAPI/pnf/inc/pnf_p7.h
new file mode 100644
index 0000000000000000000000000000000000000000..3f08d85e6b678aff5c15c733b3361c65ab81961c
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf/inc/pnf_p7.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef _PNF_P7_H_
+#define _PNF_P7_H_
+
+#define TIMEHR_SEC(_time_hr) ((uint32_t)(_time_hr) >> 20)
+#define TIMEHR_USEC(_time_hr) ((uint32_t)(_time_hr) & 0xFFFFF)
+#define TIME2TIMEHR(_time) (((uint32_t)(_time.tv_sec) & 0xFFF) << 20 | ((uint32_t)(_time.tv_usec) & 0xFFFFF))
+
+#include "nfapi_pnf_interface.h"
+
+#define NFAPI_MAX_PACKED_MESSAGE_SIZE 8192
+
+typedef struct {
+	uint16_t dl_conf_ontime;
+	uint16_t dl_conf_late;
+	uint16_t ul_conf_ontime;
+	uint16_t ul_conf_late;
+	uint16_t hi_dci0_ontime;
+	uint16_t hi_dci0_late;
+	uint16_t tx_ontime;
+	uint16_t tx_late;
+} pnf_p7_stats_t;
+
+typedef struct {
+	uint8_t* buffer;
+	uint16_t length;
+} pnf_p7_rx_message_segment_t;
+
+typedef struct pnf_p7_rx_message pnf_p7_rx_message_t;
+
+typedef struct pnf_p7_rx_message {
+	uint8_t sequence_number;
+	uint8_t num_segments_received;
+	uint8_t num_segments_expected;
+
+	// the spec allows of upto 128 segments, this does seem excessive
+	pnf_p7_rx_message_segment_t segments[128];
+
+	uint32_t rx_hr_time;
+
+	pnf_p7_rx_message_t* next;
+} pnf_p7_rx_message_t;
+
+typedef struct {
+
+	pnf_p7_rx_message_t* msg_queue;
+
+} pnf_p7_rx_reassembly_queue_t;
+
+
+typedef struct {
+
+	nfapi_pnf_p7_config_t _public;
+
+	//private data
+	int p7_sock;
+
+	uint8_t terminate;
+
+	uint8_t tx_message_buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE];
+	uint8_t* rx_message_buffer;
+	uint16_t rx_message_buffer_size;
+
+	pthread_mutex_t mutex; // should we allow the client to specifiy
+	pthread_mutex_t pack_mutex; // should we allow the client to specifiy
+
+	nfapi_pnf_p7_subframe_buffer_t subframe_buffer[30/*NFAPI_MAX_TIMING_WINDOW_SIZE*/];
+
+	uint32_t sequence_number;
+	uint16_t max_num_segments;
+
+	pnf_p7_rx_reassembly_queue_t reassembly_queue;
+
+	uint8_t* reassemby_buffer;
+	uint32_t reassemby_buffer_size;
+
+	uint16_t sfn_sf;
+	uint32_t sf_start_time_hr;
+	int32_t sfn_sf_shift;
+
+	uint8_t timing_info_period_counter;
+	uint8_t timing_info_aperiodic_send; // 0:false 1:true
+
+	uint32_t timing_info_ms_counter; // number of ms since last timing info
+
+	uint32_t dl_config_jitter;
+	uint32_t ul_config_jitter;
+	uint32_t hi_dci0_jitter;
+	uint32_t tx_jitter;
+
+	uint32_t tick;
+	pnf_p7_stats_t stats;
+
+} pnf_p7_t;
+
+int pnf_p7_message_pump(pnf_p7_t* pnf_p7);
+
+int pnf_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t* msg, uint32_t msg_len);
+int pnf_p7_send_message(pnf_p7_t* pnf_p7, uint8_t* msg, uint32_t msg_len);
+
+
+int pnf_p7_subframe_ind(pnf_p7_t* config, uint16_t phy_id, uint16_t sfn_sf);
+
+pnf_p7_rx_message_t* pnf_p7_rx_reassembly_queue_add_segment(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, uint32_t rx_hr_time, uint16_t sequence_number, uint16_t segment_number, uint8_t m, uint8_t* data, uint16_t data_len);
+void pnf_p7_rx_reassembly_queue_remove_msg(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, pnf_p7_rx_message_t* msg);
+void pnf_p7_rx_reassembly_queue_remove_old_msgs(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, uint32_t rx_hr_time, uint32_t delta);
+
+#endif /* _PNF_P7_H_ */
+
diff --git a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
new file mode 100644
index 0000000000000000000000000000000000000000..b25caf28760ff6e06ef4607b2d49f7e1a46e1de5
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
@@ -0,0 +1,803 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef _NFAPI_PNF_INTERFACE_H_
+#define _NFAPI_PNF_INTERFACE_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include "nfapi_interface.h"
+#include "debug.h"
+
+#include <sys/types.h>
+
+/*! This enum is used to describe the states of the pnf 
+ */
+typedef enum
+{
+	NFAPI_PNF_IDLE = 0,
+	NFAPI_PNF_CONFIGURED,
+	NFAPI_PNF_RUNNING
+} nfapi_pnf_state_e;
+
+/*! This enum is used to describe the states of a phy instance of a pnf
+ */
+typedef enum
+{
+	NFAPI_PNF_PHY_IDLE = 0,
+	NFAPI_PNF_PHY_CONFIGURED = 1,
+	NFAPI_PNF_PHY_RUNNING = 2
+} nfapi_pnf_phy_state_e;
+
+typedef struct nfapi_pnf_phy_config nfapi_pnf_phy_config_t;
+
+/*! Configuration information for a pnf phy instance
+ */
+typedef struct nfapi_pnf_phy_config
+{
+	/*! The PHY id*/
+	uint16_t phy_id;
+
+	/*! The state of the PNF PHY instance*/
+	nfapi_pnf_phy_state_e state;
+
+	/*! Optional user defined data that will be passed back in the callbacks*/
+	void* user_data;
+
+	/*! Pointer for use in a linked list */
+	struct nfapi_pnf_phy_config* next;
+} nfapi_pnf_phy_config_t;
+
+typedef struct nfapi_pnf_config nfapi_pnf_config_t;
+
+/*! Configuration information for the pnf created by calling nfapi_pnf_create
+ */
+typedef struct nfapi_pnf_config
+{
+	/*! A user define callback to override the default memory allocation 
+	 * \param size The size of the data buffer to allocate
+	 * \return A pointer to a data buffer
+	 */
+	void* (*malloc)(size_t size);
+	
+	/*! A user define callback to override the default memory deallocation 
+	 * \param ptr Pointer to a data buffer to be deallocated
+	 */
+	void (*free)(void* ptr);
+
+	/*! A user define callback to handle trace from the pnf 
+	 * \param level The trace level 
+	 * \param message The trace string
+	 * 
+	 * This is a vardic function.
+	 */
+	void (*trace)(nfapi_trace_level_t  level, const char* message, ...);
+
+	/*! The ip address of the VNF 
+	 *
+	 */
+	char* vnf_ip_addr;
+
+	/*! The ip port of the VNF 
+	 */
+	int vnf_p5_port;
+
+	/*! The state of the PNF */
+	nfapi_pnf_state_e state;
+
+	/*! List of PHY instances configured for this PNF */
+	nfapi_pnf_phy_config_t* phys;
+	
+	/*! Configuation option of the p4 p5 encode decode functions */
+	nfapi_p4_p5_codec_config_t codec_config;
+	
+	/*! Optional user defined data that will be passed back in the callbacks*/
+	void* user_data;
+
+
+	/*! A callback for the PNF_PARAM.request 
+	 *  \param config A pointer to the pnf configuration
+	 *  \param req A data structure for the decoded PNF_PARAM.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the PNF_PARAM.response after receiving the
+	 *  PNF_PARAM.request. This can be done in the call back. 
+	 */
+	int (*pnf_param_req)(nfapi_pnf_config_t* config, nfapi_pnf_param_request_t* req);
+	
+	/*! A callback for the PNF_CONFIG.request
+	 *  \param config A pointer to the pnf configuration
+	 *  \param req A data structure for the decoded PNF_CONFIG.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the PNF_CONFIG.response after receiving the
+	 *  PNF_CONFIG.request. This can be done in the call back. 
+	 */
+	int (*pnf_config_req)(nfapi_pnf_config_t* config, nfapi_pnf_config_request_t* req);
+	
+	/*! A callback for the PNF_START.request
+	 *  \param config A pointer to the pnf configuration
+	 *  \param req A data structure for the decoded PNF_CONFIG.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the PNF_START.response after receiving the
+	 *  PNF_START.request. This can be done in the call back. 
+	 */
+	int (*pnf_start_req)(nfapi_pnf_config_t* config, nfapi_pnf_start_request_t* req);
+	
+	/*! A callback for the PNF_STOP.request
+	 *  \param config A pointer to the pnf configuration
+	 *  \param req A data structure for the decoded PNF_STOP.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the PNF_STOP.response after receiving the
+	 *  PNF_STOP.request. This can be done in the call back. 
+	 */
+	int (*pnf_stop_req)(nfapi_pnf_config_t* config, nfapi_pnf_stop_request_t* req);
+
+	/*! A callback for the PARAM.request
+	 *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded PARAM.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the PARAM.response after receiving the
+	 *  PARAM.request. This can be done in the call back. 
+	 */
+	int (*param_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_param_request_t* req);
+	
+	/*! A callback for the CONFIG.request
+	 *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded CONFIG.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the CONFIG.response after receiving the
+	 *  CONFIG.request. This can be done in the call back. 
+	 */
+	int (*config_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_config_request_t* req);
+	
+	/*! A callback for the START.request
+	 *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded START.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the START.response after the client has received the
+	 *  first subframe indication from FAPI.
+	 */
+	int (*start_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_start_request_t* req);
+	
+	/*! A callback for the STOP.request
+	 *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded STOP.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the STOP.response after receiving the
+	 *  STOP.request. This can be done in the call back. 
+	 */
+	int (*stop_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_stop_request_t* req);
+	
+	/*! A callback for the MEASUREMENT.request
+	 *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded MEASUREMENT.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the MEASUREMENT.response after receiving the
+	 *  MEASUREMENT.request. This can be done in the call back. 
+	 */
+	int (*measurement_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_measurement_request_t* req);
+	
+	/*! A callback for the RSSI.request
+	 *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded RSSI.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the RSSI.response after receiving the
+	 *  RSSI.request. This can be done in the call back. 
+	 */
+	int (*rssi_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_rssi_request_t* req);
+	
+	/*! A callback for the CELL_SEARCH.request
+	 *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded CELL_SEARCH.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the CELL_SEARCH.response after receiving the
+	 *  CELL_SEARCH.request. This can be done in the call back. 	
+	 */
+	int (*cell_search_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_cell_search_request_t* req);
+	
+	/*! A callback for the BROADCAST_DETECT.request
+     *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded BROADCAST_DETECT.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the BROADCAST_DETECT.response after receiving the
+	 *  BROADCAST_DETECT.request. This can be done in the call back. 	
+	 */
+	int (*broadcast_detect_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_broadcast_detect_request_t* req);
+	
+	/*! A callback for the SYSTEM_INFORMATION_SCHEDULE.request
+     *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded SYSTEM_INFORMATION_SCHEDULE.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the SYSTEM_INFORMATION_SCHEDULE.response after receiving the
+	 *  SYSTEM_INFORMATION_SCHEDULE.request. This can be done in the call back. 	
+	 */
+	int (*system_information_schedule_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_system_information_schedule_request_t* req);
+	
+	/*! A callback for the SYSTEM_INFORMATION.request
+     *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded SYSTEM_INFORMATION.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the SYSTEM_INFORMATION.response after receiving the
+	 *  SYSTEM_INFORMATION.request. This can be done in the call back. 	
+	 */
+	int (*system_information_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_system_information_request_t* req);
+	
+	/*! A callback for the NMM_STOP.request
+     *  \param config A pointer to the pnf configuration
+	 *  \param phy A pointer to the pnf phy configuration
+	 *  \param req A data structure for the decoded NMM_STOP.request. This will have
+	 *             been allocated on the stack
+	 *  \return not currently used
+	 * 
+	 * 	The client is expected to send the NMM_STOP.response after receiving the
+	 *  NMM_STOP.request. This can be done in the call back.
+	 */
+	int (*nmm_stop_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_nmm_stop_request_t* req);
+	
+	/*! A callback for any vendor extension messages recevied
+	 *  \param config A pointer to the pnf configuration
+	 *  \param msg A pointer to the decode P4/P5 message
+	 *  \return not current used
+	 */
+	int (*vendor_ext)(nfapi_pnf_config_t* config, nfapi_p4_p5_message_header_t* msg);
+	
+	/*! A callback to allocate vendor extension message
+	 * \param message_id The message id from the decode P4/P5 message header
+	 * \param msg_size A pointer a the size of the allocated message structure. The callee should set this
+	 * \return A pointer to a allocated P4/P5 message structure
+	 */
+	nfapi_p4_p5_message_header_t* (*allocate_p4_p5_vendor_ext)(uint16_t message_id, uint16_t* msg_size);
+	
+	/*! A callback to deallocate vendor extension message 
+	 * \param header A pointer to an P4/P5 message structure
+	 */
+	void (*deallocate_p4_p5_vendor_ext)(nfapi_p4_p5_message_header_t* header);
+
+
+
+} nfapi_pnf_config_t;
+
+/*! Create a pnf configuration 
+ *  \return A pointer to a pnf configuration struture
+ * 
+ *  This function will create and initialize a pnf instance. It is expected that 
+ *  the client will set the callback and parameters need before calling nfapi_pnf_start
+ *
+ *  0 will be returned if it fails.
+ * 
+ * \code
+ * nfapi_pnf_config_t* config = nfapi_pnf_config_create(void);
+ * \endcode
+ */
+nfapi_pnf_config_t* nfapi_pnf_config_create(void);
+
+/*! Delete a pnf configuration 
+ * \param config A pointer to a pnf configuraiton
+ * \return 0 is success, -1 for failure
+ */
+int nfapi_pnf_config_destroy(nfapi_pnf_config_t* config);
+
+/*! Start the PNF library. 
+ * \param config A pointer to the pnf configuration
+ * \return 0 is success, -1 for failure
+ * 
+ * This function will not return until nfapi_pnf_stop is called
+ *
+ * \code
+ * // Create the pnf config
+ * nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+ *
+ * // Assumed that the vnf_address and vnf_port are provided over the P9 interface
+ * config->vnf_ip_addr = vnf_address;
+ * config->vnf_p5_port = vnf_port;
+ *
+ * // Set the required callbacks
+ * config->pnf_param_req = &pnf_param_request;
+ * ...
+ * 
+ * // Call start for the PNF to initiate a connection to the VNF
+ * nfai_pnf_start(config);
+ * 
+ * \endcode
+ */
+int nfapi_pnf_start(nfapi_pnf_config_t* config);
+
+/*! Stop the PNF library. 
+ * \param config A pointer to the pnf configuration
+ * \return 0 is success, -1 for failure
+ * 
+ * This function will cause the nfapi_pnf_start function to return
+ */
+int nfapi_pnf_stop(nfapi_pnf_config_t* config);
+
+/*! Send the PNF_PARAM.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_pnf_param_resp(nfapi_pnf_config_t* config, nfapi_pnf_param_response_t* resp);
+
+/*! Send the PNF_CONFIG.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_pnf_config_resp(nfapi_pnf_config_t* config, nfapi_pnf_config_response_t* resp);
+
+/*! Send the PNF_START.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_pnf_start_resp(nfapi_pnf_config_t* config, nfapi_pnf_start_response_t* resp);
+
+/*! Send the PNF_STOP.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_pnf_stop_resp(nfapi_pnf_config_t* config, nfapi_pnf_stop_response_t* resp);
+
+/*! Send the PARAM.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_param_resp(nfapi_pnf_config_t* config, nfapi_param_response_t* resp);
+
+/*! Send the CONFIG.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_config_resp(nfapi_pnf_config_t* config, nfapi_config_response_t* resp);
+
+/*! Send the START.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_start_resp(nfapi_pnf_config_t* config, nfapi_start_response_t* resp);
+
+/*! Send the STOP.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_stop_resp(nfapi_pnf_config_t* config, nfapi_stop_response_t* resp);
+
+/*! Send the MEASUREMENT.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_measurement_resp(nfapi_pnf_config_t* config, nfapi_measurement_response_t* resp);
+
+/*! Send the RSSI.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_rssi_resp(nfapi_pnf_config_t* config, nfapi_rssi_response_t* resp);
+
+/*! Send the RSSI.indication
+ * \param config A pointer to a pnf configuraiton
+ * \param ind A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_rssi_ind(nfapi_pnf_config_t* config, nfapi_rssi_indication_t* ind);
+
+/*! Send the CELL_SEARCH.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_cell_search_resp(nfapi_pnf_config_t* config, nfapi_cell_search_response_t* resp);
+
+/*! Send the CELL_SEARCH.indication
+ * \param config A pointer to a pnf configuraiton
+ * \param ind A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_cell_search_ind(nfapi_pnf_config_t* config, nfapi_cell_search_indication_t* ind);
+
+/*! Send the BROADCAST_DETECT.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_broadcast_detect_resp(nfapi_pnf_config_t* config, nfapi_broadcast_detect_response_t* resp);
+
+/*! Send the BROADCAST_DETECT.indication
+ * \param config A pointer to a pnf configuraiton
+ * \param ind A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_broadcast_detect_ind(nfapi_pnf_config_t* config, nfapi_broadcast_detect_indication_t* ind);
+
+/*! Send the SYSTEM_INFORMATION_SCHEDULE.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_system_information_schedule_resp(nfapi_pnf_config_t* config, nfapi_system_information_schedule_response_t* resp);
+
+/*! Send the SYSTEM_INFORMATION_SCHEDULE.indication
+ * \param config A pointer to a pnf configuraiton
+ * \param ind A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_system_information_schedule_ind(nfapi_pnf_config_t* config, nfapi_system_information_schedule_indication_t* ind);
+
+/*! Send the SYSTEM_INFORMATION.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_system_information_resp(nfapi_pnf_config_t* config, nfapi_system_information_response_t* resp);
+
+/*! Send the SYSTEM_INFORMATION.indication
+ * \param config A pointer to a pnf configuraiton
+ * \param ind A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_system_information_ind(nfapi_pnf_config_t* config, nfapi_system_information_indication_t* ind);
+
+/*! Send the NMM_STOP.response
+ * \param config A pointer to a pnf configuraiton
+ * \param resp A pointer to the message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_nmm_stop_resp(nfapi_pnf_config_t* config, nfapi_nmm_stop_response_t* resp);
+
+/*! Send a vendor extension message
+ * \param config A pointer to a pnf configuraiton
+ * \param msg A pointer to the vendor extention message structure
+ * \param msg_len The size of the vendor extention message structure
+ * \return 0 for success, -1 for failure
+ * 
+ */
+int nfapi_pnf_vendor_extension(nfapi_pnf_config_t* config, nfapi_p4_p5_message_header_t* msg, uint32_t msg_len);
+
+//--------------------------
+
+/*! A subframe buffer structure which can be used by the client to 
+ *  to configure the dummy information
+ */
+typedef struct 
+{
+	uint16_t sfn_sf;
+	
+	nfapi_dl_config_request_t* dl_config_req;
+	nfapi_ul_config_request_t* ul_config_req;
+	nfapi_hi_dci0_request_t* hi_dci0_req;
+	nfapi_tx_request_t* tx_req;
+	nfapi_lbt_dl_config_request_t* lbt_dl_config_req;
+
+} nfapi_pnf_p7_subframe_buffer_t;
+
+typedef struct nfapi_pnf_p7_config nfapi_pnf_p7_config_t;
+
+/*! The nfapi PNF PHY P7 configuration information created using the nfapi_pnf_p7_create function
+ */
+typedef struct nfapi_pnf_p7_config
+{
+	/*! A user define callback to override the default memory allocation 
+	 * \param size The size of the buffer to allocate
+	 * \return An allocated buffer. 0 in the case of failure
+	 * 
+	 * If not set malloc will be used
+	 */
+	void* (*malloc)(size_t size);
+	
+	/*! A user define callback to override the default memory deallocation 
+	 *  \param ptr Pointer to a buffer to dellocate
+	 *
+	 * If not set free will be used
+	 */
+	void (*free)(void* ptr);
+
+	/*! A user define callback to handle trace from the pnf
+	 * \param level The trace level
+	 * \param message The message string
+	 */
+	void (*trace)(nfapi_trace_level_t  level, const char* message, ...);
+
+	/*! The PHY id*/
+	uint16_t phy_id;
+
+	// remote
+	/*! The VNF P7 UDP port */
+	int remote_p7_port;
+	/*! The VNF P7 UDP address */
+	char* remote_p7_addr;
+
+	// local
+	/*! The PNF P7 UDP port */
+	int local_p7_port;
+	/*! The PNF P7 UDP address */
+	char* local_p7_addr;
+
+	/*! Flag to indicate of the pnf should use the P7 checksum */
+	uint8_t checksum_enabled;
+
+	/*! The maxium size of a P7 segement. If a message is large that this it
+	 * will be segemented */
+	uint16_t segment_size;
+
+	/*! The dummy subframe buffer structure that should be used in case there
+	 * are no 'valid' subframe messages */
+	nfapi_pnf_p7_subframe_buffer_t dummy_subframe;
+	
+	/*! Configuration options for the p7 pack unpack functions*/
+	nfapi_p7_codec_config_t codec_config;
+	
+	/*! Optional userdata that will be passed back in the callbacks*/
+	void* user_data;
+
+	// tdb : if these should be public
+	uint16_t subframe_buffer_size;
+	uint8_t timing_info_mode_periodic; // 0:false 1:true
+	uint8_t timing_info_mode_aperiodic; // 0:false 1:true
+	uint8_t timing_info_period; // 1..225 in subframes
+
+	/*! A callback for the DL_CONFIG.request
+	 * \param config A poiner to the PNF P7 config
+	 * \param req A pointer to the dl config request message structure
+	 * \return not currently used
+	 */
+	int (*dl_config_req)(nfapi_pnf_p7_config_t* config, nfapi_dl_config_request_t* req);
+	
+	/*! A callback for the UL_CONFIG.request
+	 * \param config A poiner to the PNF P7 config
+	 * \param req A pointer to the ul config request message structure
+	 * \return not currently used	
+	 */
+	int (*ul_config_req)(nfapi_pnf_p7_config_t* config, nfapi_ul_config_request_t* req);
+	
+	/*! A callback for the HI_DCI0.request
+	 * \param config A poiner to the PNF P7 config
+	 * \param req A pointer to the hi dci0 request message structure
+	 * \return not currently used
+	 */
+	int (*hi_dci0_req)(nfapi_pnf_p7_config_t* config, nfapi_hi_dci0_request_t* req);
+	
+	/*! A callback for the TX_REQ.request
+	 * \param config A poiner to the PNF P7 config
+	 * \param req A pointer to the tx request message structure
+	 * \return not currently used
+	 * 
+	 * The TX request contains pointers to the downlink PDUs to be sent. In the case that the FAPI interface
+	 * will 'keep' the pointers until they are transmitted the callee should set the pointers in the req to 0
+	 * and then use the p7 codec config free function to release the pdu's when appropriate. 
+	 */
+	int (*tx_req)(nfapi_pnf_p7_config_t* config, nfapi_tx_request_t* req);
+	
+	/*! A callback for the LBT_DL_CONFIG.request
+	 * \param config A poiner to the PNF P7 config
+	 * \param req A pointer to the lbt dl request message structure
+	 * \return not currently used
+	 */
+	int (*lbt_dl_config_req)(nfapi_pnf_p7_config_t* config, nfapi_lbt_dl_config_request_t* req);
+	
+	/*! A callback for vendor extension messages
+	 * \param config A poiner to the PNF P7 config
+	 * \param msg A pointer to a decode vendor extention message
+	 * \return not currently used
+	 */
+	int (*vendor_ext)(nfapi_pnf_p7_config_t* config, nfapi_p7_message_header_t* msg);
+
+	/*! A callback to allocate vendor extension message
+	 * \param message_id The vendor extention message id from the decode message header
+	 * \param msg_size A pointer to size of the allocate vendor extention message. Set by the callee
+	 * \return A pointer to an allocated vendor extention message structure. 0 if failed
+	 * 
+	 * 
+	 */
+	nfapi_p7_message_header_t* (*allocate_p7_vendor_ext)(uint16_t message_id, uint16_t* msg_size);
+	
+	/*! A callback to deallocate vendor extension message
+	 * \param header A pointer to a p7 vendor extention message
+	 */
+	void (*deallocate_p7_vendor_ext)(nfapi_p7_message_header_t* header);
+
+
+
+} nfapi_pnf_p7_config_t;
+
+/*! Create and initialise a nfapi_pnf_p7_config structure
+ * \return A pointer to a PNF P7 config structure
+ */
+nfapi_pnf_p7_config_t* nfapi_pnf_p7_config_create(void);
+
+/*! Delete an nfapi_pnf_p7_config structure
+ * \param config 
+ */
+int nfapi_pnf_p7_config_destroy(nfapi_pnf_p7_config_t* config);
+
+
+/*! Start the PNF P7 library. 
+ * \param config A pointer to a PNF P7 config
+ * \return 0 means success, -1 means failure
+ * 
+ * This function will not return until nfapi_pnf_p7_stop is called.
+ */
+int nfapi_pnf_p7_start(nfapi_pnf_p7_config_t* config);
+
+/*! Stop the PNF P7 library. 
+ * \param config A pointer to a PNF P7 config
+ * \return  0 means success, -1 means failure
+ * 
+ * This function will cause the nfapi_pnf_p7_start to return
+ */
+int nfapi_pnf_p7_stop(nfapi_pnf_p7_config_t* config);
+
+/*! Subframe indication
+ * \param config A pointer to a PNF P7 config
+ * \param phy_id The phy_id for the phy instance
+ * \param sfn_sf The SFN and SF in the format of FAPI
+ * \return 0 means success, -1 means failure
+ * 
+ * The client should call the subframe indication every 1ms. The PNF will
+ * respond by invoking the pnf p7 subframe callbacks with the messages from the subframe buffer
+ *
+ * If messages are not in the subframe buffer, they dummy subframe messages will be sent
+ */
+int nfapi_pnf_p7_subframe_ind(nfapi_pnf_p7_config_t* config, uint16_t phy_id, uint16_t sfn_sf);
+
+/*! Send the HARQ.indication
+ * \param config A pointer to a PNF P7 config
+ * \param ind A pointer to the harq indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_harq_ind(nfapi_pnf_p7_config_t* config, nfapi_harq_indication_t* ind);
+
+/*! Send the CRC.indication
+ * \param config A pointer to a PNF P7 config
+ * \param ind A pointer to the crc indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_crc_indication_t* ind);
+
+/*! Send the RX.indication
+ * \param config A pointer to a PNF P7 config
+ * \param ind A pointer to the rx indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_rx_ind(nfapi_pnf_p7_config_t* config, nfapi_rx_indication_t* ind);
+
+/*! Send the RACH.indication
+ * \param config A pointer to a PNF P7 config
+ * \param ind A pointer to the rach indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_rach_indication_t* ind);
+
+/*! Send the SRS.indication
+ * \param config A pointer to a PNF P7 config
+ * \param ind A pointer to the srs indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_srs_indication_t* ind);
+
+/*! Send the SR.indication
+ * \param config A pointer to a PNF P7 config
+ * \param ind A pointer to the sr indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_sr_ind(nfapi_pnf_p7_config_t* config, nfapi_sr_indication_t* ind);
+
+/*! Send the CQI.indication
+ * \param config A pointer to a PNF P7 config
+ * \param ind A pointer to the cqi indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_cqi_ind(nfapi_pnf_p7_config_t* config, nfapi_cqi_indication_t* ind);
+
+/*! Send the LBT_DL.indication
+ * \param config A pointer to a PNF P7 config
+ * \param ind A pointer to the lbt dl indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_lbt_dl_ind(nfapi_pnf_p7_config_t* config, nfapi_lbt_dl_indication_t* ind);
+
+/*! Send the NB_HARQ.indication
+ * \param config A pointer to a PNF P7 config
+ * \param ind A pointer to the lbt dl indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_nb_harq_ind(nfapi_pnf_p7_config_t* config, nfapi_nb_harq_indication_t* ind);
+
+/*! Send the NRACH.indication
+ * \param config A pointer to a PNF P7 config
+ * \param ind A pointer to the lbt dl indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_nrach_ind(nfapi_pnf_p7_config_t* config, nfapi_nrach_indication_t* ind);
+
+
+/*! Send a vendor exntesion message
+ * \param config A pointer to a PNF P7 config
+ * \param msg A pointer to the lbt dl indication message structure
+ * \return 0 means success, -1 means failure
+ */
+int nfapi_pnf_p7_vendor_extension(nfapi_pnf_p7_config_t* config, nfapi_p7_message_header_t* msg);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif // _NFAPI_PNF_INTERFACE_H_
diff --git a/nfapi/open-nFAPI/pnf/src/pnf.c b/nfapi/open-nFAPI/pnf/src/pnf.c
new file mode 100644
index 0000000000000000000000000000000000000000..d0a7fa6fd12140dd38ab66c1f866ec8d9abe3d09
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf/src/pnf.c
@@ -0,0 +1,1598 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netinet/sctp.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "pnf.h"
+
+#define MAX_SCTP_STREAMS 16
+
+void nfapi_pnf_phy_config_delete_all(nfapi_pnf_config_t* config)
+{
+	nfapi_pnf_phy_config_t* curr = config->phys;
+	while(curr != 0)
+	{
+		nfapi_pnf_phy_config_t* to_delete = curr;
+		curr = curr->next;
+		free(to_delete);
+	}
+
+	config->phys = 0;
+}
+
+void nfapi_pnf_phy_config_add(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy)
+{
+	phy->next = config->phys;
+	config->phys = phy;
+}
+
+nfapi_pnf_phy_config_t* nfapi_pnf_phy_config_find(nfapi_pnf_config_t* config, uint16_t phy_id)
+{
+	nfapi_pnf_phy_config_t* curr = config->phys;
+	while(curr != 0)
+	{
+		if(curr->phy_id == phy_id)
+			return curr;
+
+		curr = curr->next;
+	}
+	return 0;
+}
+
+void pnf_handle_pnf_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_pnf_param_request_t req;
+		
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_PARAM.request received\n");
+	
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(nfapi_pnf_param_request_t), &pnf->_public.codec_config) >= 0)
+		{
+			if(pnf->_public.state == NFAPI_PNF_IDLE)
+			{
+				if(pnf->_public.pnf_param_req)
+				{
+					(pnf->_public.pnf_param_req)(&pnf->_public, &req);
+				}
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: PNF not in IDLE state\n", __FUNCTION__);
+		
+				nfapi_pnf_param_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_PNF_PARAM_RESPONSE;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_pnf_param_resp(&pnf->_public, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	}
+}
+
+void pnf_handle_pnf_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+
+
+	// ensure it's valid
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_pnf_config_request_t req;
+
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_CONFIG.request received\n");
+	
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &pnf->_public.codec_config) >= 0)
+		{
+			// ensure correct state
+			if(pnf->_public.state != NFAPI_PNF_RUNNING)
+			{
+				// delete the phy records
+				nfapi_pnf_phy_config_delete_all(&pnf->_public);
+		
+				// create the phy records
+				if (req.pnf_phy_rf_config.tl.tag == NFAPI_PNF_PHY_RF_TAG)
+				{
+					int i = 0;
+					for(i = 0; i < req.pnf_phy_rf_config.number_phy_rf_config_info; ++i)
+					{
+						nfapi_pnf_phy_config_t* phy = (nfapi_pnf_phy_config_t*)malloc(sizeof(nfapi_pnf_phy_config_t));
+						memset(phy, 0, sizeof(nfapi_pnf_phy_config_t));
+		
+						phy->state = NFAPI_PNF_PHY_IDLE;
+						phy->phy_id = req.pnf_phy_rf_config.phy_rf_config[i].phy_id;
+		
+						nfapi_pnf_phy_config_add(&(pnf->_public), phy);
+					}
+				}
+		
+				if(pnf->_public.pnf_config_req)
+				{
+					(pnf->_public.pnf_config_req)(&(pnf->_public), &req);
+				}
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: PNF not in correct state: %d\n", __FUNCTION__, pnf->_public.state);
+		
+				nfapi_pnf_config_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_PNF_CONFIG_RESPONSE;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_pnf_config_resp(&(pnf->_public), &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	}
+}
+
+void pnf_handle_pnf_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_pnf_start_request_t req;
+
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_START.request Received\n");
+	
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &pnf->_public.codec_config) >= 0)
+		{
+			if(pnf->_public.state == NFAPI_PNF_CONFIGURED)
+			{
+				if(pnf->_public.pnf_start_req)
+				{
+					(pnf->_public.pnf_start_req)(&(pnf->_public), &req);
+				}
+			}
+			else
+			{
+				nfapi_pnf_start_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_PNF_START_RESPONSE;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_pnf_start_resp(&(pnf->_public), &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	}
+}
+
+void pnf_handle_pnf_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_pnf_stop_request_t req;
+		
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_STOP.request Received\n");
+	
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &pnf->_public.codec_config) >= 0)
+		{
+			if(pnf->_public.state == NFAPI_PNF_RUNNING)
+			{
+				if(pnf->_public.pnf_stop_req)
+				{
+					(pnf->_public.pnf_stop_req)(&(pnf->_public), &req);
+				}
+			}
+			else
+			{
+				nfapi_pnf_stop_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_PNF_STOP_RESPONSE;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_pnf_stop_resp(&(pnf->_public), &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	}
+}
+
+void pnf_handle_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_param_request_t req;
+		
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "PARAM.request received\n");
+	
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state == NFAPI_PNF_PHY_IDLE)
+					{
+						if(config->param_req)
+						{
+							(config->param_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_param_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_PARAM_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_param_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_param_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_PARAM_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_param_resp(config, &resp);
+				}
+		
+			}
+			else
+			{
+				nfapi_param_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_PARAM_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_param_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+
+	}
+}
+
+void pnf_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+
+	// ensure it's valid
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_config_request_t req;
+
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "CONFIG.request received\n");
+	
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state != NFAPI_PNF_PHY_RUNNING)
+					{
+						if(config->config_req)
+						{
+							(config->config_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_config_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_CONFIG_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_config_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_config_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_CONFIG_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_config_resp(config, &resp);
+				}
+			}
+			else
+			{
+				nfapi_config_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_CONFIG_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_config_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	}
+}
+
+void pnf_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_start_request_t req;
+	
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() START.request received state:%d\n", __FUNCTION__, config->state);
+	
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state != NFAPI_PNF_PHY_RUNNING)
+					{
+						if(config->start_req)
+						{
+							(config->start_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_start_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_START_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_start_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_start_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_START_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_start_resp(config, &resp);
+				}
+			}
+			else
+			{
+				nfapi_start_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_START_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_start_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+
+	}
+}
+
+void pnf_handle_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_stop_request_t req;
+
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "STOP.request received\n");
+	
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state != NFAPI_PNF_PHY_RUNNING)
+					{
+						if(config->stop_req)
+						{
+							(config->stop_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_stop_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_STOP_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_stop_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_stop_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_STOP_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_stop_resp(config, &resp);
+				}
+			}
+			else
+			{
+				nfapi_stop_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_STOP_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_stop_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+			
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	
+	}
+}
+
+void pnf_handle_measurement_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_measurement_request_t req;
+
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "MEASUREMENT.request received\n");
+	
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state != NFAPI_PNF_PHY_RUNNING)
+					{
+						if(config->measurement_req)
+						{
+							(config->measurement_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_measurement_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_MEASUREMENT_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_measurement_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_measurement_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_MEASUREMENT_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_measurement_resp(config, &resp);
+				}
+			}
+			else
+			{
+				nfapi_measurement_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_MEASUREMENT_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_measurement_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	}
+}
+
+void pnf_handle_rssi_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+
+
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{	
+		nfapi_rssi_request_t req;
+		
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "RSSI.request received\n");
+	
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state == NFAPI_PNF_PHY_RUNNING)
+					{
+						if(config->rssi_req)
+						{
+							(config->rssi_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_rssi_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_RSSI_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_rssi_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_rssi_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_RSSI_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_rssi_resp(config, &resp);
+				}
+			}
+			else
+			{
+				nfapi_rssi_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_RSSI_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_rssi_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	
+	}
+}
+
+void pnf_handle_cell_search_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_cell_search_request_t req;
+		
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "CELL_SEARCH.request received\n");
+	
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state == NFAPI_PNF_PHY_RUNNING)
+					{
+						if(config->cell_search_req)
+						{
+							(config->cell_search_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_cell_search_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_CELL_SEARCH_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_cell_search_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_cell_search_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_CELL_SEARCH_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_cell_search_resp(config, &resp);
+				}
+			}
+			else
+			{
+				nfapi_cell_search_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_CELL_SEARCH_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_cell_search_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	}
+
+}
+
+void pnf_handle_broadcast_detect_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_broadcast_detect_request_t req;
+
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "BROADCAST_DETECT.request received\n");
+	
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state == NFAPI_PNF_PHY_RUNNING)
+					{
+						if(config->broadcast_detect_req)
+						{
+							(config->broadcast_detect_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_broadcast_detect_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_BROADCAST_DETECT_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_broadcast_detect_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_broadcast_detect_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_BROADCAST_DETECT_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_broadcast_detect_resp(config, &resp);
+				}
+			}
+			else
+			{
+				nfapi_broadcast_detect_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_BROADCAST_DETECT_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_broadcast_detect_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+
+	}
+}
+
+void pnf_handle_system_information_schedule_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_system_information_schedule_request_t req;
+	
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "SYSTEM_INFORMATION_SCHEDULE.request received\n");
+	
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state == NFAPI_PNF_PHY_RUNNING)
+					{
+						if(config->system_information_schedule_req)
+						{
+							(config->system_information_schedule_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_system_information_schedule_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_system_information_schedule_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_system_information_schedule_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_system_information_schedule_resp(config, &resp);
+				}
+			}
+			else
+			{
+				nfapi_system_information_schedule_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_system_information_schedule_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	}
+}
+
+void pnf_handle_system_information_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_system_information_request_t req;
+
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "SYSTEM_INFORMATION.request received\n");
+	
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state == NFAPI_PNF_PHY_RUNNING)
+					{
+						if(config->system_information_req)
+						{
+							(config->system_information_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_system_information_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_SYSTEM_INFORMATION_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_system_information_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_system_information_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_SYSTEM_INFORMATION_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_system_information_resp(config, &resp);
+				}
+			}
+			else
+			{
+				nfapi_system_information_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_SYSTEM_INFORMATION_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_system_information_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	}
+
+}
+
+void pnf_handle_nmm_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_nmm_stop_request_t req;
+		
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "NMM_STOP.request received\n");
+	
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+		{
+			if(config->state == NFAPI_PNF_RUNNING)
+			{
+				nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
+				if(phy)
+				{
+					if(phy->state != NFAPI_PNF_PHY_RUNNING)
+					{
+						if(config->nmm_stop_req)
+						{
+							(config->nmm_stop_req)(config, phy, &req);
+						}
+					}
+					else
+					{
+						nfapi_nmm_stop_response_t resp;
+						memset(&resp, 0, sizeof(resp));
+						resp.header.message_id = NFAPI_NMM_STOP_RESPONSE;
+						resp.header.phy_id = req.header.phy_id;
+						resp.error_code = NFAPI_MSG_INVALID_STATE;
+						nfapi_pnf_nmm_stop_resp(config, &resp);
+					}
+				}
+				else
+				{
+					nfapi_nmm_stop_response_t resp;
+					memset(&resp, 0, sizeof(resp));
+					resp.header.message_id = NFAPI_NMM_STOP_RESPONSE;
+					resp.header.phy_id = req.header.phy_id;
+					resp.error_code = NFAPI_MSG_INVALID_CONFIG;
+					nfapi_pnf_nmm_stop_resp(config, &resp);
+				}
+			}
+			else
+			{
+				nfapi_nmm_stop_response_t resp;
+				memset(&resp, 0, sizeof(resp));
+				resp.header.message_id = NFAPI_NMM_STOP_RESPONSE;
+				resp.header.phy_id = req.header.phy_id;
+				resp.error_code = NFAPI_MSG_INVALID_STATE;
+				nfapi_pnf_nmm_stop_resp(config, &resp);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		if(req.vendor_extension)
+			pnf->_public.codec_config.deallocate(req.vendor_extension);
+	}
+}
+
+
+void pnf_handle_vendor_extension(void* pRecvMsg, int recvMsgLen, pnf_t* pnf, uint16_t message_id)
+{
+	if (pRecvMsg == NULL || pnf == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_pnf_config_t* config = &(pnf->_public);
+	
+		if(config->allocate_p4_p5_vendor_ext)
+		{
+			uint16_t msg_size;
+			nfapi_p4_p5_message_header_t* msg = config->allocate_p4_p5_vendor_ext(message_id, &msg_size);
+	
+			if(msg == 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to allocate vendor extention structure\n");
+				return;
+			}
+	
+			
+			int unpack_result = nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, msg, msg_size, &config->codec_config);
+	
+			if(unpack_result == 0)
+			{
+				if(config->vendor_ext)
+					config->vendor_ext(config, msg);
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+			}
+			
+			if(config->deallocate_p4_p5_vendor_ext)
+				config->deallocate_p4_p5_vendor_ext(msg);
+			
+		}
+	}
+}
+
+
+
+void pnf_handle_p5_message(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+{
+	nfapi_p4_p5_message_header_t messageHeader;
+
+	// validate the input params
+	if(pRecvMsg == NULL || recvMsgLen < NFAPI_HEADER_LENGTH)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return;
+	}
+
+	// unpack the message header
+	if (nfapi_p5_message_header_unpack(pRecvMsg, recvMsgLen, &messageHeader, sizeof(nfapi_p4_p5_message_header_t), &pnf->_public.codec_config) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unpack message header failed, ignoring\n");
+		return;
+	}
+
+	switch (messageHeader.message_id)
+	{
+		case NFAPI_PNF_PARAM_REQUEST:
+			pnf_handle_pnf_param_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_PNF_CONFIG_REQUEST:
+			pnf_handle_pnf_config_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_PNF_START_REQUEST:
+			pnf_handle_pnf_start_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_PNF_STOP_REQUEST:
+			pnf_handle_pnf_stop_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_PARAM_REQUEST:
+			pnf_handle_param_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_CONFIG_REQUEST:
+			pnf_handle_config_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_START_REQUEST:
+			pnf_handle_start_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_STOP_REQUEST:
+			pnf_handle_stop_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_MEASUREMENT_REQUEST:
+			pnf_handle_measurement_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_RSSI_REQUEST:
+			pnf_handle_rssi_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_CELL_SEARCH_REQUEST:
+			pnf_handle_cell_search_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_BROADCAST_DETECT_REQUEST:
+			pnf_handle_broadcast_detect_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST:
+			pnf_handle_system_information_schedule_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_REQUEST:
+			pnf_handle_system_information_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		case NFAPI_NMM_STOP_REQUEST:
+			pnf_handle_nmm_stop_request(pnf, pRecvMsg, recvMsgLen);
+			break;
+
+		default:
+			{
+				if(messageHeader.message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
+				   messageHeader.message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
+				{
+					pnf_handle_vendor_extension(pRecvMsg, recvMsgLen, pnf, messageHeader.message_id);
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s P5 Unknown message ID %d\n", __FUNCTION__, messageHeader.message_id);
+				}
+			}
+			break;
+	}
+}
+
+int pnf_pack_and_send_p5_message(pnf_t* pnf, nfapi_p4_p5_message_header_t* msg, uint32_t msg_len)
+{
+	int packed_len = nfapi_p5_message_pack(msg, msg_len,
+										   pnf->tx_message_buffer, 
+										   sizeof(pnf->tx_message_buffer), 
+										   &pnf->_public.codec_config);
+
+	if (packed_len < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_p5_message_pack failed (%d)\n", packed_len);
+		return -1;
+	}
+
+	return pnf_send_message(pnf, pnf->tx_message_buffer, packed_len, 0/*msg->stream_id*/);
+}
+
+int pnf_pack_and_send_p4_message(pnf_t* pnf, nfapi_p4_p5_message_header_t* msg, uint32_t msg_len)
+{
+	int packed_len = nfapi_p4_message_pack(msg, msg_len,
+										   pnf->tx_message_buffer, 
+										   sizeof(pnf->tx_message_buffer), 
+										   &pnf->_public.codec_config);
+
+	if (packed_len < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_p4_message_pack failed (%d)\n", packed_len);
+		return -1;
+	}
+
+	return pnf_send_message(pnf, pnf->tx_message_buffer, packed_len, 0/*msg->stream_id*/);
+}
+
+
+
+int pnf_connect(pnf_t* pnf)
+{
+	struct sockaddr_in servaddr;
+	uint8_t socketConnected = 0;
+
+	if(pnf->_public.vnf_ip_addr == 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnfIpAddress is null\n");
+		return -1;
+	}
+
+
+	(void)memset(&servaddr, 0, sizeof(struct sockaddr_in));
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "Starting P5 PNF connection to VNF at %s:%u\n", pnf->_public.vnf_ip_addr, pnf->_public.vnf_p5_port);
+
+	// todo split the vnf address list. currently only supporting 1
+	
+	struct addrinfo hints, *servinfo;
+	memset(&hints, 0, sizeof(hints));
+
+	hints.ai_socktype = SOCK_STREAM; // For SCTP we are only interested in SOCK_STREAM
+	// todo : allow the client to restrict IPV4 or IPV6
+		// todo : randomize which address to connect to?
+	
+	char port_str[8];
+	snprintf(port_str, sizeof(port_str), "%d", pnf->_public.vnf_p5_port);
+	if(getaddrinfo(pnf->_public.vnf_ip_addr, port_str,  &hints, &servinfo) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to get host (%s) addr info h_errno:%d \n", pnf->_public.vnf_ip_addr, h_errno);
+		return -1;
+	}
+
+	struct addrinfo *p = servinfo;
+	int i = 0;
+	int connected = 0;
+
+	while(p != NULL && connected == 0)
+	{
+		char* family = "Unknown";
+		char* address = "Unknown";
+		char _addr[128];
+		
+		if(p->ai_family == AF_INET6)
+		{
+			family = "IPV6";
+			struct sockaddr_in6* addr = (struct sockaddr_in6*)p->ai_addr;
+			inet_ntop(AF_INET6, &addr->sin6_addr, _addr, sizeof(_addr));
+			address = &_addr[0];
+		}
+		else if(p->ai_family == AF_INET)
+		{
+			family = "IPV4";
+			struct sockaddr_in* addr = (struct sockaddr_in*)p->ai_addr;
+			address = inet_ntoa(addr->sin_addr);
+		}
+
+		NFAPI_TRACE(NFAPI_TRACE_NOTE, "Host address info  %d Family:%s Address:%s\n", i++, family, address);
+
+		if (pnf->sctp)
+		{
+			// open the SCTP socket
+			if ((pnf->p5_sock = socket(p->ai_family, SOCK_STREAM, IPPROTO_SCTP)) < 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P5 socket errno: %d\n", errno);
+				freeaddrinfo(servinfo);
+				return -1;
+			}
+			int noDelay;
+			struct sctp_initmsg initMsg;
+
+			(void)memset(&initMsg, 0, sizeof(struct sctp_initmsg));
+
+			// configure the socket options
+			NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF Setting the SCTP_INITMSG\n");
+			initMsg.sinit_num_ostreams = 5; //MAX_SCTP_STREAMS;  // number of output streams can be greater
+			initMsg.sinit_max_instreams = 5; //MAX_SCTP_STREAMS;  // number of output streams can be greater
+			if (setsockopt(pnf->p5_sock, IPPROTO_SCTP, SCTP_INITMSG, &initMsg, sizeof(initMsg)) < 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt errno: %d\n", errno);
+				freeaddrinfo(servinfo);
+				return -1;
+			}
+			noDelay = 1;
+			if (setsockopt(pnf->p5_sock, IPPROTO_SCTP, SCTP_NODELAY, &noDelay, sizeof(noDelay)) < 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt errno: %d\n", errno);
+				freeaddrinfo(servinfo);
+				return -1;
+
+			}
+
+			struct sctp_event_subscribe events;
+			memset( (void *)&events, 0, sizeof(events) );
+			events.sctp_data_io_event = 1;
+
+			if(setsockopt(pnf->p5_sock, SOL_SCTP, SCTP_EVENTS, (const void *)&events, sizeof(events)) < 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt errno: %d\n", errno);
+				freeaddrinfo(servinfo);
+				return -1;
+			}
+		}
+		else
+		{
+			// Create an IP socket point 
+			if ((pnf->p5_sock = socket(p->ai_family, SOCK_STREAM, IPPROTO_IP)) < 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P5 socket errno: %d\n", errno);
+				freeaddrinfo(servinfo);
+				return -1;
+			}
+		}
+	
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "P5 socket created...\n");
+	
+		if (connect(pnf->p5_sock, p->ai_addr, p->ai_addrlen ) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "After connect (address:%s port:%d) errno: %d\n", 
+					pnf->_public.vnf_ip_addr, pnf->_public.vnf_p5_port, errno);
+
+			if(errno == EINVAL)
+			{
+				freeaddrinfo(servinfo);
+				return -1;
+			}
+			else
+			{
+				if(pnf->terminate != 0)
+				{
+					freeaddrinfo(servinfo);
+					return 0;
+				}
+				else
+				{
+					close(pnf->p5_sock);
+					sleep(1);
+				}
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "connect succeeded...\n");
+
+			connected = 1;
+		}
+
+		p = p->ai_next;
+	}
+
+	freeaddrinfo(servinfo);
+
+	// If we have failed to connect return 0 and it is retry
+	if(connected == 0)
+		return 0;
+
+
+	NFAPI_TRACE(NFAPI_TRACE_NOTE, "After connect loop\n");
+	if (pnf->sctp)
+	{
+		socklen_t optLen;
+		struct sctp_status status;
+
+		(void)memset(&status, 0, sizeof(struct sctp_status));
+
+		// check the connection status
+		optLen = (socklen_t) sizeof(struct sctp_status);
+		if (getsockopt(pnf->p5_sock, IPPROTO_SCTP, SCTP_STATUS, &status, &optLen) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "After getsockopt errno: %d\n", errno);
+			return -1;
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "Association ID = %d\n", status.sstat_assoc_id);
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "Receiver window size = %d\n", status.sstat_rwnd);
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "In Streams = %d\n",  status.sstat_instrms);
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "Out Streams = %d\n", status.sstat_outstrms);
+
+			socketConnected = 1;
+		}
+	}
+
+	NFAPI_TRACE(NFAPI_TRACE_NOTE, "Socket %s\n", socketConnected ? "CONNECTED" : "NOT_CONNECTED");
+	return socketConnected;
+}
+
+int pnf_send_message(pnf_t* pnf, uint8_t *msg, uint32_t len, uint16_t stream)
+{
+	if (pnf->sctp)
+	{
+		if (sctp_sendmsg(pnf->p5_sock, msg, len, NULL, 0, 42/*config->sctp_stream_number*/, 0, stream/*P5_STREAM_ID*/, 0, 0) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "sctp_sendmsg failed errno: %d\n", errno);
+			return -1;
+		}
+	}
+	else
+	{
+		if (write(pnf->p5_sock, msg, len) != len)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "read failed errno: %d\n", errno);
+			return -1;
+		}
+	}
+	return 0;
+}
+
+
+int pnf_read_dispatch_message(pnf_t* pnf)
+{
+	int socket_connected = 1;
+
+	// 1. Peek the message header
+	// 2. If the message is larger than the stack buffer then create a dynamic buffer
+	// 3. Read the buffer
+	// 4. Handle the p5 message
+
+	uint32_t header_buffer_size = NFAPI_HEADER_LENGTH;
+	uint8_t header_buffer[header_buffer_size];
+
+	uint32_t stack_buffer_size = 32; //should it be the size of then sctp_notificatoin structure
+	uint8_t stack_buffer[stack_buffer_size];
+
+	uint8_t* dynamic_buffer = 0;
+
+	uint8_t* read_buffer = &stack_buffer[0];
+	uint32_t message_size = 0;
+
+	struct sockaddr_in addr;
+	socklen_t addr_len = sizeof(addr);
+
+	struct sctp_sndrcvinfo sndrcvinfo;
+	(void)memset(&sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo));
+
+	{
+		int flags = MSG_PEEK;
+		message_size = sctp_recvmsg(pnf->p5_sock, header_buffer, header_buffer_size, /*(struct sockaddr*)&addr, &addr_len*/ 0, 0, &sndrcvinfo,  &flags);
+
+		if(message_size == -1)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF Failed to peek sctp message size errno:%d\n", errno);
+			return 0;
+		}
+
+		nfapi_p4_p5_message_header_t header;
+		int unpack_result = nfapi_p5_message_header_unpack(header_buffer, header_buffer_size, &header, sizeof(header), 0);
+		if(unpack_result < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF Failed to unpack p5 message header\n");
+			return 0;
+		}
+		message_size = header.message_length;
+
+		// now have the size of the mesage
+	}
+
+	if(message_size > stack_buffer_size)
+	{
+		dynamic_buffer = (uint8_t*)malloc(message_size);
+
+		if(dynamic_buffer == NULL)
+		{
+			// todo : add error mesage
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF Failed to allocate dynamic buffer for sctp_recvmsg size:%d\n", message_size);
+			return -1;
+		}
+
+		read_buffer = dynamic_buffer;
+	}
+
+	{
+		int flags = 0;
+		(void)memset(&sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo));
+
+		int recvmsg_result = sctp_recvmsg(pnf->p5_sock, read_buffer, message_size, (struct sockaddr*)&addr, &addr_len, &sndrcvinfo, &flags);
+		if(recvmsg_result == -1)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "Failed to read sctp message size errno:%d\n", errno);
+		}
+		else
+		{
+			if (flags & MSG_NOTIFICATION)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "Notification received from %s:%u\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
+
+				// todo - handle the events
+			}
+			else
+			{
+				/*
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "Received message fd:%d from %s:%u assoc:%d on stream %d, PPID %d, length %d, flags 0x%x\n",
+						pnf->p5_sock,
+						inet_ntoa(addr.sin_addr),
+						ntohs(addr.sin_port),
+						sndrcvinfo.sinfo_assoc_id,
+						sndrcvinfo.sinfo_stream,
+						ntohl(sndrcvinfo.sinfo_ppid),
+						message_size,
+						flags);
+				*/
+
+				// handle now if complete message in one or more segments
+				if ((flags & 0x80) == 0x80)
+				{
+					pnf_handle_p5_message(pnf, read_buffer, message_size);
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_WARN, "sctp_recvmsg: unhandled mode with flags 0x%x\n", flags);
+
+					// assume socket disconnected
+					NFAPI_TRACE(NFAPI_TRACE_WARN, "Disconnected socket\n");
+					socket_connected =  0;
+				}
+
+
+			}
+		}
+	}
+
+	if(dynamic_buffer)
+	{
+		free(dynamic_buffer);
+	}
+
+	return socket_connected;
+
+
+}
+
+
+int pnf_message_pump(pnf_t* pnf)
+{
+	uint8_t socketConnected = 1;
+
+	while(socketConnected && pnf->terminate == 0)
+	{
+		fd_set rfds;
+		int selectRetval = 0;
+
+		// select on a timeout and then get the message
+		FD_ZERO(&rfds);
+		FD_SET(pnf->p5_sock, &rfds);
+
+		struct timeval timeout;
+		timeout.tv_sec = 1;
+		timeout.tv_usec = 0;
+
+		selectRetval = select(pnf->p5_sock+1, &rfds, NULL, NULL, &timeout);
+
+		if(selectRetval == 0)
+		{	
+			// timeout
+			continue;
+		}
+		else if (selectRetval == -1 && (errno == EINTR))
+		{
+			// interrupted by signal
+			NFAPI_TRACE(NFAPI_TRACE_WARN, "P5 Signal Interrupt %d\n", errno);
+			continue;
+		}
+		else if (selectRetval == -1)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_WARN, "P5 select() failed\n");
+			sleep(1);
+			continue;
+		}
+
+		if(FD_ISSET(pnf->p5_sock, &rfds))
+		{
+			socketConnected = pnf_read_dispatch_message(pnf);
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_WARN, "Why are we here\n");
+		}
+	}
+
+	// Drop back to idle if we have lost connection
+	pnf->_public.state = NFAPI_PNF_PHY_IDLE;
+
+
+	// close the connection and socket
+	if (close(pnf->p5_sock) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "close(sctpSock) failed errno: %d\n", errno);
+	}
+
+	return 0;
+
+}
+
diff --git a/nfapi/open-nFAPI/pnf/src/pnf_interface.c b/nfapi/open-nFAPI/pnf/src/pnf_interface.c
new file mode 100644
index 0000000000000000000000000000000000000000..7310fc0c66c57209bcedac7cc326ab4b19d4229a
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf/src/pnf_interface.c
@@ -0,0 +1,432 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "pnf.h"
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+nfapi_pnf_config_t* nfapi_pnf_config_create()
+{
+	pnf_t* _this = (pnf_t*)malloc(sizeof(pnf_t));
+
+	if(_this == 0)
+		return 0;
+
+	memset(_this, 0, sizeof(pnf_t));
+
+	_this->sctp = 1;	// enable sctp
+	
+	_this->_public.vnf_p5_port = NFAPI_P5_SCTP_PORT;
+	
+	_this->_public.malloc = &malloc;
+	_this->_public.free = &free;	
+
+	_this->_public.codec_config.allocate = &malloc;
+	_this->_public.codec_config.deallocate = &free;
+
+	return &(_this->_public);
+}
+
+void nfapi_pnf_config_destory(nfapi_pnf_config_t* config)
+{
+	free(config);
+}
+
+int nfapi_pnf_start(nfapi_pnf_config_t* config)
+{
+	// Verify that config is not null
+	if(config == 0)
+		return -1;
+
+	// Make sure to set the defined trace function before using NFAPI_TRACE
+	if(config->trace)
+		nfapi_trace_g = config->trace;
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	while (_this->terminate == 0)
+	{
+		int connect_result = pnf_connect(_this);
+
+		if(connect_result > 0)
+		{
+			pnf_message_pump(_this);
+		}
+		else if(connect_result < 0)
+		{
+			return connect_result;
+		}
+
+		sleep(1);
+	}
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() terminate=1 - EXITTING............\n", __FUNCTION__);
+
+	return 0;
+}
+
+int nfapi_pnf_stop(nfapi_pnf_config_t* config)
+{
+	// Verify that config is not null
+	if(config == 0)
+		return -1;
+
+
+	pnf_t* _this = (pnf_t*)(config);
+	_this->terminate = 1;
+
+	// todo wait for the pnf to stop before returning
+
+	return 0;
+}
+
+int nfapi_pnf_pnf_param_resp(nfapi_pnf_config_t* config, nfapi_pnf_param_response_t* resp)
+{
+	// ensure it's valid
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_pnf_param_response_t));
+}
+
+int nfapi_pnf_pnf_config_resp(nfapi_pnf_config_t* config, nfapi_pnf_config_response_t* resp)
+{
+	// ensure it's valid
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	if(resp->error_code == NFAPI_MSG_OK)
+	{
+		config->state = NFAPI_PNF_CONFIGURED;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_pnf_config_response_t));
+}
+
+int nfapi_pnf_pnf_start_resp(nfapi_pnf_config_t* config, nfapi_pnf_start_response_t* resp)
+{
+	// ensure it's valid
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	if(resp->error_code == NFAPI_MSG_OK)
+	{
+		config->state = NFAPI_PNF_RUNNING;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_pnf_start_response_t));
+}
+
+int nfapi_pnf_pnf_stop_resp(nfapi_pnf_config_t* config, nfapi_pnf_stop_response_t* resp)
+{
+	// ensure it's valid
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	if(resp->error_code == NFAPI_MSG_OK)
+	{
+		config->state = NFAPI_PNF_CONFIGURED;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_pnf_stop_response_t));
+}
+
+int nfapi_pnf_param_resp(nfapi_pnf_config_t* config, nfapi_param_response_t* resp)
+{
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+	
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_param_response_t));
+}
+
+int nfapi_pnf_config_resp(nfapi_pnf_config_t* config, nfapi_config_response_t* resp)
+{
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, resp->header.phy_id);
+
+	if(phy)
+	{
+		if(resp->error_code == NFAPI_MSG_OK)
+		{
+			phy->state = NFAPI_PNF_PHY_CONFIGURED;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: unknow phy id %d\n", __FUNCTION__, resp->header.phy_id);
+		return -1;
+	}
+
+	return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_config_response_t));
+}
+
+int nfapi_pnf_start_resp(nfapi_pnf_config_t* config, nfapi_start_response_t* resp)
+{
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, resp->header.phy_id);
+	if(phy)
+	{
+		if(resp->error_code == NFAPI_MSG_OK)
+		{
+			phy->state = NFAPI_PNF_PHY_RUNNING;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: unknown phy id %d\n", __FUNCTION__, resp->header.phy_id);
+		return -1;
+	}
+
+	return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_start_response_t));
+}
+
+int nfapi_pnf_stop_resp(nfapi_pnf_config_t* config, nfapi_stop_response_t* resp)
+{
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, resp->header.phy_id);
+	if(phy)
+	{
+		if(resp->error_code == NFAPI_MSG_OK)
+		{
+			phy->state = NFAPI_PNF_PHY_CONFIGURED;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: unknow phy id %d\n", __FUNCTION__, resp->header.phy_id);
+		return -1;
+	}
+
+
+	return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_stop_response_t));
+}
+
+int nfapi_pnf_measurement_resp(nfapi_pnf_config_t* config, nfapi_measurement_response_t* resp)
+{
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_measurement_response_t));
+}
+
+
+int nfapi_pnf_rssi_resp(nfapi_pnf_config_t* config, nfapi_rssi_response_t* resp)
+{
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(resp->header), sizeof(nfapi_rssi_response_t));
+}
+
+int nfapi_pnf_rssi_ind(nfapi_pnf_config_t* config, nfapi_rssi_indication_t* ind)
+{
+	if (config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(ind->header), sizeof(nfapi_rssi_indication_t));
+}
+int nfapi_pnf_cell_search_resp(nfapi_pnf_config_t* config, nfapi_cell_search_response_t* resp)
+{
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "Send CELL_SEARCH.response\n");
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(resp->header), sizeof(nfapi_cell_search_response_t));
+}
+int nfapi_pnf_cell_search_ind(nfapi_pnf_config_t* config, nfapi_cell_search_indication_t* ind)
+{
+	if (config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(ind->header), sizeof(nfapi_cell_search_indication_t));
+}
+int nfapi_pnf_broadcast_detect_resp(nfapi_pnf_config_t* config, nfapi_broadcast_detect_response_t* resp)
+{
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(resp->header), sizeof(nfapi_broadcast_detect_response_t));
+}
+int nfapi_pnf_broadcast_detect_ind(nfapi_pnf_config_t* config, nfapi_broadcast_detect_indication_t* ind)
+{
+	if (config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(ind->header), sizeof(nfapi_broadcast_detect_indication_t));
+}
+int nfapi_pnf_system_information_schedule_resp(nfapi_pnf_config_t* config, nfapi_system_information_schedule_response_t* resp)
+{
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(resp->header), sizeof(nfapi_system_information_schedule_response_t));
+}
+
+int nfapi_pnf_system_information_schedule_ind(nfapi_pnf_config_t* config, nfapi_system_information_schedule_indication_t* ind)
+{
+	if (config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(ind->header), sizeof(nfapi_system_information_schedule_indication_t));
+}
+int nfapi_pnf_system_information_resp(nfapi_pnf_config_t* config, nfapi_system_information_response_t* resp)
+{
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(resp->header), sizeof(nfapi_system_information_response_t));
+}
+
+int nfapi_pnf_system_information_ind(nfapi_pnf_config_t* config, nfapi_system_information_indication_t* ind)
+{
+	if (config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(ind->header), sizeof(nfapi_system_information_indication_t));
+}
+int nfapi_pnf_nmm_stop_resp(nfapi_pnf_config_t* config, nfapi_nmm_stop_response_t* resp)
+{
+	// ensure it's valid
+	if (config == NULL || resp == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p4_message(_this, &(resp->header), sizeof(nfapi_nmm_stop_request_t));
+}
+
+int nfapi_pnf_vendor_extension(nfapi_pnf_config_t* config, nfapi_p4_p5_message_header_t* msg, uint32_t msg_len)
+{
+	// ensure it's valid
+	if (config == NULL || msg == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_t* _this = (pnf_t*)(config);
+
+	return pnf_pack_and_send_p5_message(_this, msg, msg_len);
+}
+
diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c
new file mode 100644
index 0000000000000000000000000000000000000000..02b828d382bf1a9dfc39cea7fe48544e56ed2000
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c
@@ -0,0 +1,1769 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <sys/select.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+
+#include "pnf_p7.h"
+
+#define FAPI2_IP_DSCP	0
+
+extern uint16_t sf_ahead;
+//uint16_t sf_ahead=4;
+
+void add_sf(uint16_t *frameP, uint16_t *subframeP, int offset)
+{
+    *frameP    = *frameP + ((*subframeP + offset) / 10);
+
+    *subframeP = ((*subframeP + offset) % 10);
+}
+
+void subtract_sf(uint16_t *frameP, uint16_t *subframeP, int offset)
+{
+  if (*subframeP < offset)
+  {
+    *frameP = (*frameP+1024-1)%1024;
+  }
+  *subframeP = (*subframeP+10-offset)%10;
+}
+
+uint16_t sfnsf_add_sf(uint16_t sfnsf, int offset)
+{
+  uint16_t new_sfnsf;
+  uint16_t sfn = NFAPI_SFNSF2SFN(sfnsf);
+  uint16_t sf  = NFAPI_SFNSF2SF(sfnsf);
+
+  //printf("%s() sfn:%u sf:%u\n", __FUNCTION__, sfn, sf);
+  add_sf(&sfn, &sf, offset);
+
+  new_sfnsf = sfn<<4|sf;
+
+  //printf("%s() sfn:%u sf:%u offset:%d sfnsf:%d(DEC:%d) new:%d(DEC:%d)\n", __FUNCTION__, sfn, sf, offset, sfnsf, NFAPI_SFNSF2DEC(sfnsf), new_sfnsf, NFAPI_SFNSF2DEC(new_sfnsf));
+
+  return new_sfnsf;
+}
+
+uint16_t sfnsf_subtract_sf(uint16_t sfnsf, int offset)
+{
+  uint16_t new_sfnsf;
+  uint16_t sfn = NFAPI_SFNSF2SFN(sfnsf);
+  uint16_t sf  = NFAPI_SFNSF2SF(sfnsf);
+
+  //printf("%s() sfn:%u sf:%u\n", __FUNCTION__, sfn, sf);
+  subtract_sf(&sfn, &sf, offset);
+
+  new_sfnsf = sfn<<4|sf;
+
+  //printf("%s() offset:%d sfnsf:%d(DEC:%d) new:%d(DEC:%d)\n", __FUNCTION__, offset, sfnsf, NFAPI_SFNSF2DEC(sfnsf), new_sfnsf, NFAPI_SFNSF2DEC(new_sfnsf));
+
+  return new_sfnsf;
+}
+
+uint32_t pnf_get_current_time_hr(void)
+{
+	struct timeval now;
+	(void)gettimeofday(&now, NULL);
+	uint32_t time_hr = TIME2TIMEHR(now);
+	return time_hr;
+}
+
+void* pnf_p7_malloc(pnf_p7_t* pnf_p7, size_t size)
+{
+	if(pnf_p7->_public.malloc)
+	{
+		return (pnf_p7->_public.malloc)(size);
+	}
+	else
+	{
+		return calloc(1, size); 
+	}
+}
+void pnf_p7_free(pnf_p7_t* pnf_p7, void* ptr)
+{
+	if(pnf_p7->_public.free)
+	{
+		return (pnf_p7->_public.free)(ptr);
+	}
+	else
+	{
+		return free(ptr); 
+	}
+}
+
+// todo : for now these just malloc/free need to move to a memory cache
+nfapi_dl_config_request_t* allocate_nfapi_dl_config_request(pnf_p7_t* pnf_p7) 
+{ 
+	void *ptr= pnf_p7_malloc(pnf_p7, sizeof(nfapi_dl_config_request_t));
+        //printf("%s() ptr:%p\n", __FUNCTION__, ptr);
+        return ptr;
+}
+
+void deallocate_nfapi_dl_config_request(nfapi_dl_config_request_t* req, pnf_p7_t* pnf_p7) 
+{ 
+  //printf("%s() SFN/SF:%d %s req:%p pdu_list:%p\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pnf_p7->_public.codec_config.deallocate ? "DEALLOCATE" : "FREE", req, req->dl_config_request_body.dl_config_pdu_list);
+	if(pnf_p7->_public.codec_config.deallocate)
+	{
+		(pnf_p7->_public.codec_config.deallocate)(req->dl_config_request_body.dl_config_pdu_list);
+	}
+	else
+	{
+		free(req->dl_config_request_body.dl_config_pdu_list);
+	}
+        req->dl_config_request_body.dl_config_pdu_list=0;
+
+	pnf_p7_free(pnf_p7, req);
+}
+
+nfapi_ul_config_request_t* allocate_nfapi_ul_config_request(pnf_p7_t* pnf_p7) 
+{ 
+	void *ptr= pnf_p7_malloc(pnf_p7, sizeof(nfapi_ul_config_request_t));
+        //printf("%s() ptr:%p\n", __FUNCTION__, ptr);
+        return ptr;
+}
+
+void deallocate_nfapi_ul_config_request(nfapi_ul_config_request_t* req, pnf_p7_t* pnf_p7) 
+{ 
+  //printf("%s() SFN/SF:%d %s req:%p pdu_list:%p\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pnf_p7->_public.codec_config.deallocate ? "DEALLOCATE" : "FREE", req, req->ul_config_request_body.ul_config_pdu_list);
+	if(pnf_p7->_public.codec_config.deallocate)
+	{
+		(pnf_p7->_public.codec_config.deallocate)(req->ul_config_request_body.ul_config_pdu_list);
+	}
+	else
+	{
+		free(req->ul_config_request_body.ul_config_pdu_list);
+	}
+        req->ul_config_request_body.ul_config_pdu_list=0;
+
+	pnf_p7_free(pnf_p7, req);
+}
+
+nfapi_hi_dci0_request_t* allocate_nfapi_hi_dci0_request(pnf_p7_t* pnf_p7) 
+{ 
+	return pnf_p7_malloc(pnf_p7, sizeof(nfapi_hi_dci0_request_t));
+}
+
+void deallocate_nfapi_hi_dci0_request(nfapi_hi_dci0_request_t* req, pnf_p7_t* pnf_p7) 
+{ 
+  //printf("%s() SFN/SF:%d %s req:%p pdu_list:%p\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pnf_p7->_public.codec_config.deallocate ? "DEALLOCATE" : "FREE", req, req->hi_dci0_request_body.hi_dci0_pdu_list);
+	if(pnf_p7->_public.codec_config.deallocate)
+	{
+		(pnf_p7->_public.codec_config.deallocate)(req->hi_dci0_request_body.hi_dci0_pdu_list);
+	}
+	else
+	{
+		free(req->hi_dci0_request_body.hi_dci0_pdu_list);
+	}
+        req->hi_dci0_request_body.hi_dci0_pdu_list=0;
+
+	pnf_p7_free(pnf_p7, req);
+}
+
+nfapi_tx_request_t* allocate_nfapi_tx_request(pnf_p7_t* pnf_p7) 
+{ 
+	return pnf_p7_malloc(pnf_p7, sizeof(nfapi_tx_request_t));
+}
+
+void deallocate_nfapi_tx_request(nfapi_tx_request_t* req, pnf_p7_t* pnf_p7) 
+{ 
+	int i = 0;
+
+  //printf("%s() SFN/SF:%d %s req:%p pdu[0]:data:%p\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pnf_p7->_public.codec_config.deallocate ? "DEALLOCATE" : "FREE", req, req->tx_request_body.tx_pdu_list[i].segments[0].segment_data);
+
+	for(i = 0; i < req->tx_request_body.number_of_pdus; ++i)
+	{
+		void* data = req->tx_request_body.tx_pdu_list[i].segments[0].segment_data;
+
+		if(pnf_p7->_public.codec_config.deallocate)
+		{
+			(pnf_p7->_public.codec_config.deallocate)(data);
+		}
+		else
+		{
+			free(data);
+		}
+                data=0;
+	}
+
+
+	if(pnf_p7->_public.codec_config.deallocate)
+	{
+		(pnf_p7->_public.codec_config.deallocate)(req->tx_request_body.tx_pdu_list);
+	}
+	else
+	{
+		free(req->tx_request_body.tx_pdu_list);
+	}
+        req->tx_request_body.tx_pdu_list=0;
+
+	pnf_p7_free(pnf_p7, req);
+}
+
+nfapi_lbt_dl_config_request_t* allocate_nfapi_lbt_dl_config_request(pnf_p7_t* pnf_p7) 
+{ 
+	return pnf_p7_malloc(pnf_p7, sizeof(nfapi_lbt_dl_config_request_t));
+}
+
+void deallocate_nfapi_lbt_dl_config_request(nfapi_lbt_dl_config_request_t* req, pnf_p7_t* pnf_p7) 
+{ 
+	if(pnf_p7->_public.codec_config.deallocate)
+	{
+		(pnf_p7->_public.codec_config.deallocate)(req->lbt_dl_config_request_body.lbt_dl_config_req_pdu_list);
+	}
+	else
+	{
+		free(req->lbt_dl_config_request_body.lbt_dl_config_req_pdu_list);
+	}
+        req->lbt_dl_config_request_body.lbt_dl_config_req_pdu_list=0;
+
+	pnf_p7_free(pnf_p7, req);
+}
+
+pnf_p7_rx_message_t* pnf_p7_rx_reassembly_queue_add_segment(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, uint32_t rx_hr_time, uint16_t sequence_number, uint16_t segment_number, uint8_t m, uint8_t* data, uint16_t data_len)
+{
+	pnf_p7_rx_message_t* msg = 0;
+	// attempt to find a entry for this segment
+	pnf_p7_rx_message_t* iterator = queue->msg_queue;
+	while(iterator != 0)
+	{
+		if(iterator->sequence_number == sequence_number)
+		{
+			msg = iterator;
+			break;
+		}
+
+		iterator = iterator->next;
+	}
+	
+	// if found then copy data to message
+	if(msg != 0)
+	{
+	
+		msg->segments[segment_number].buffer = (uint8_t*)pnf_p7_malloc(pnf_p7, data_len);
+		memcpy(msg->segments[segment_number].buffer, data, data_len);
+		msg->segments[segment_number].length = data_len;
+
+		msg->num_segments_received++;
+
+		// set the segement number if we have the last segment
+		if(m == 0)
+			msg->num_segments_expected = segment_number + 1;
+	}
+	// else add new rx message entry
+	else
+	{
+		// create a new message
+		msg = (pnf_p7_rx_message_t*)(pnf_p7_malloc(pnf_p7, sizeof(pnf_p7_rx_message_t)));
+		memset(msg, 0, sizeof(pnf_p7_rx_message_t));
+
+		msg->sequence_number = sequence_number;
+		msg->num_segments_expected = m ? 255 : segment_number + 1;
+		msg->num_segments_received = 1;
+		msg->rx_hr_time = rx_hr_time;
+
+		msg->segments[segment_number].buffer = (uint8_t*)pnf_p7_malloc(pnf_p7, data_len);
+		memcpy(msg->segments[segment_number].buffer, data, data_len);
+		msg->segments[segment_number].length = data_len;
+
+		// place the message at the head of the queue
+		msg->next = queue->msg_queue;
+		queue->msg_queue = msg;
+	}
+
+	return msg;
+}
+
+void pnf_p7_rx_reassembly_queue_remove_msg(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, pnf_p7_rx_message_t* msg)
+{
+	// remove message if it has the same sequence number
+	pnf_p7_rx_message_t* iterator = queue->msg_queue;
+	pnf_p7_rx_message_t* previous = 0;
+
+	while(iterator != 0)
+	{
+		if(iterator->sequence_number == msg->sequence_number)
+		{
+			if(previous == 0)
+			{
+				queue->msg_queue = iterator->next;
+			}
+			else
+			{
+				previous->next = iterator->next;
+			}
+
+			//NFAPI_TRACE(NFAPI_TRACE_INFO, "Deleting reassembly message\n");
+			// delete the message
+			uint16_t i;
+			for(i = 0; i < 128; ++i)
+			{
+				if(iterator->segments[i].buffer)
+					pnf_p7_free(pnf_p7, iterator->segments[i].buffer);
+			}
+			pnf_p7_free(pnf_p7, iterator);
+
+			break;
+		}
+
+		previous = iterator;
+		iterator = iterator->next;
+	}
+}
+
+void pnf_p7_rx_reassembly_queue_remove_old_msgs(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, uint32_t rx_hr_time, uint32_t delta)
+{
+	// remove all messages that are too old
+	pnf_p7_rx_message_t* iterator = queue->msg_queue;
+	pnf_p7_rx_message_t* previous = 0;
+
+	while(iterator != 0)
+	{
+		if(rx_hr_time - iterator->rx_hr_time > delta)
+		{
+			if(previous == 0)
+			{
+				queue->msg_queue = iterator->next;
+			}
+			else
+			{
+				previous->next = iterator->next;
+			}
+			
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "Deleting stale reassembly message (%u %u %d)\n", iterator->rx_hr_time, rx_hr_time, delta);
+
+			pnf_p7_rx_message_t* to_delete = iterator;
+			iterator = iterator->next;
+
+			// delete the message
+			uint16_t i;
+			for(i = 0; i < 128; ++i)
+			{
+				if(to_delete->segments[i].buffer)
+					pnf_p7_free(pnf_p7, to_delete->segments[i].buffer);
+			}
+			pnf_p7_free(pnf_p7, to_delete);
+
+		}
+		else
+		{
+			previous = iterator;
+			iterator = iterator->next;
+		}
+	}
+}
+
+
+static uint32_t get_sf_time(uint32_t now_hr, uint32_t sf_start_hr)
+{
+	if(now_hr < sf_start_hr)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "now is earlier than start of subframe now_hr:%u sf_start_hr:%u\n", now_hr, sf_start_hr);
+		return 0;
+	}
+	else
+	{
+		uint32_t now_us = TIMEHR_USEC(now_hr);
+		uint32_t sf_start_us = TIMEHR_USEC(sf_start_hr);
+
+		// if the us have wrapped adjust for it
+		if(now_hr < sf_start_us)
+		{
+			now_us += 1000000;
+		}
+
+		return now_us - sf_start_us;
+	}
+}
+
+int pnf_p7_send_message(pnf_p7_t* pnf_p7, uint8_t* msg, uint32_t len)
+{
+	// todo : consider how to do this only once
+	struct sockaddr_in remote_addr;
+	memset((char*)&remote_addr, 0, sizeof(struct sockaddr_in));
+	remote_addr.sin_family = AF_INET;
+	remote_addr.sin_port = htons(pnf_p7->_public.remote_p7_port);
+	//remote_addr.sin_addr.s_addr = inet_addr(pnf_p7->_public.remote_p7_addr);
+	if(inet_aton(pnf_p7->_public.remote_p7_addr, &remote_addr.sin_addr) == -1)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "inet_aton failed %d\n", errno);
+		return -1;
+	}
+	
+	socklen_t remote_addr_len = sizeof(struct sockaddr_in);
+	
+	int sendto_result;
+	if ((sendto_result = sendto((int)pnf_p7->p7_sock, (const char*)msg, len, 0, (const struct sockaddr*)&remote_addr, remote_addr_len)) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s %s:%d sendto(%d, %p, %d) %d failed errno: %d\n", __FUNCTION__, pnf_p7->_public.remote_p7_addr, pnf_p7->_public.remote_p7_port, (int)pnf_p7->p7_sock, (const char*)msg, len, remote_addr_len,  errno);
+		return -1;
+	}
+
+	if(sendto_result != len)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s sendto failed to send the entire message %d %d\n", __FUNCTION__, sendto_result, len);
+	}
+	return 0;
+}
+
+int pnf_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t* header, uint32_t msg_len)
+{
+	header->m_segment_sequence = NFAPI_P7_SET_MSS(0, 0, pnf_p7->sequence_number);
+
+	// Need to guard against different threads calling the encode function at the same time
+	if(pthread_mutex_lock(&(pnf_p7->pack_mutex)) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
+		return -1;
+	}
+
+	int len = nfapi_p7_message_pack(header, pnf_p7->tx_message_buffer, sizeof(pnf_p7->tx_message_buffer), &pnf_p7->_public.codec_config);
+
+	if (len < 0)
+	{
+		if(pthread_mutex_unlock(&(pnf_p7->pack_mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
+			return -1;
+		}
+		
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_p7_message_pack failed with return %d\n", len );
+		return -1;
+	}
+
+	if(len > pnf_p7->_public.segment_size)
+	{
+		int msg_body_len = len - NFAPI_P7_HEADER_LENGTH ; 
+		int seg_body_len = pnf_p7->_public.segment_size - NFAPI_P7_HEADER_LENGTH ; 
+		int segment_count = (msg_body_len / (seg_body_len)) + ((msg_body_len % seg_body_len) ? 1 : 0); 
+
+		int segment = 0;
+		int offset = NFAPI_P7_HEADER_LENGTH;
+		uint8_t buffer[pnf_p7->_public.segment_size];
+		for(segment = 0; segment < segment_count; ++segment)
+		{
+			uint8_t last = 0;
+			uint16_t size = pnf_p7->_public.segment_size - NFAPI_P7_HEADER_LENGTH;
+			if(segment + 1 == segment_count)
+			{
+				last = 1;
+				size = (msg_body_len) - (seg_body_len * segment);
+			}
+
+			uint16_t segment_size = size + NFAPI_P7_HEADER_LENGTH;
+
+			// Update the header with the m and segement 
+			memcpy(&buffer[0], pnf_p7->tx_message_buffer, NFAPI_P7_HEADER_LENGTH);
+
+			// set the segment length
+			buffer[4] = (segment_size & 0xFF00) >> 8;
+			buffer[5] = (segment_size & 0xFF);
+
+			// set the m & segment number
+			buffer[6] = ((!last) << 7) + segment;
+
+			memcpy(&buffer[NFAPI_P7_HEADER_LENGTH], pnf_p7->tx_message_buffer + offset, size);
+			offset += size;
+
+			if(pnf_p7->_public.checksum_enabled)
+			{
+				nfapi_p7_update_checksum(buffer, segment_size);
+			}
+
+
+			pnf_p7_send_message(pnf_p7, &buffer[0], segment_size);
+		}
+	}
+	else
+	{
+		if(pnf_p7->_public.checksum_enabled)
+		{
+			nfapi_p7_update_checksum(pnf_p7->tx_message_buffer, len);
+		}
+
+		// simple case that the message fits in a single segment
+		pnf_p7_send_message(pnf_p7, pnf_p7->tx_message_buffer, len);
+	}
+
+	pnf_p7->sequence_number++;
+	
+	if(pthread_mutex_unlock(&(pnf_p7->pack_mutex)) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+void pnf_pack_and_send_timing_info(pnf_p7_t* pnf_p7)
+{
+	nfapi_timing_info_t timing_info;
+	memset(&timing_info, 0, sizeof(timing_info));
+	timing_info.header.message_id = NFAPI_TIMING_INFO;
+	timing_info.header.phy_id = pnf_p7->_public.phy_id;
+
+	timing_info.last_sfn_sf = pnf_p7->sfn_sf;
+	timing_info.time_since_last_timing_info = pnf_p7->timing_info_ms_counter;
+
+	timing_info.dl_config_jitter = pnf_p7->dl_config_jitter;
+	timing_info.tx_request_jitter = pnf_p7->tx_jitter;
+	timing_info.ul_config_jitter = pnf_p7->ul_config_jitter;
+	timing_info.hi_dci0_jitter = pnf_p7->hi_dci0_jitter;
+
+	timing_info.dl_config_latest_delay = 0;
+	timing_info.tx_request_latest_delay = 0;
+	timing_info.ul_config_latest_delay = 0;
+	timing_info.hi_dci0_latest_delay = 0;
+
+	timing_info.dl_config_earliest_arrival = 0;
+	timing_info.tx_request_earliest_arrival = 0;
+	timing_info.ul_config_earliest_arrival = 0;
+	timing_info.hi_dci0_earliest_arrival = 0;
+
+
+	pnf_p7_pack_and_send_p7_message(pnf_p7, &(timing_info.header), sizeof(timing_info));
+
+	pnf_p7->timing_info_ms_counter = 0;
+}
+
+void send_dummy_subframe(pnf_p7_t* pnf_p7, uint16_t sfn_sf)
+{
+  struct timespec t;
+  clock_gettime( CLOCK_MONOTONIC, &t);
+
+  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(sfn_sf:%d) t:%ld.%09ld\n", __FUNCTION__, NFAPI_SFNSF2DEC(sfn_sf), t.tv_sec, t.tv_nsec);
+
+	if(pnf_p7->_public.tx_req && pnf_p7->_public.dummy_subframe.tx_req)
+	{
+		pnf_p7->_public.dummy_subframe.tx_req->sfn_sf = sfn_sf;
+		//NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy tx_req - enter\n");
+		(pnf_p7->_public.tx_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.tx_req);
+		//NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy tx_req - exit\n");
+	}
+	if(pnf_p7->_public.dl_config_req && pnf_p7->_public.dummy_subframe.dl_config_req)
+	{
+		pnf_p7->_public.dummy_subframe.dl_config_req->sfn_sf = sfn_sf;
+		//NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy dl_config_req - enter\n");
+		(pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req);
+		//NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy dl_config_req - exit\n");
+	}
+	if(pnf_p7->_public.ul_config_req && pnf_p7->_public.dummy_subframe.ul_config_req)
+	{
+		pnf_p7->_public.dummy_subframe.ul_config_req->sfn_sf = sfn_sf;
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy ul_config_req - enter\n");
+		(pnf_p7->_public.ul_config_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.ul_config_req);
+	}
+	if(pnf_p7->_public.hi_dci0_req && pnf_p7->_public.dummy_subframe.hi_dci0_req)
+	{
+		pnf_p7->_public.dummy_subframe.hi_dci0_req->sfn_sf = sfn_sf;
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy hi_dci0 - enter\n");
+		(pnf_p7->_public.hi_dci0_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.hi_dci0_req);
+	}
+	if(pnf_p7->_public.lbt_dl_config_req && pnf_p7->_public.dummy_subframe.lbt_dl_config_req)
+	{
+		pnf_p7->_public.dummy_subframe.lbt_dl_config_req->sfn_sf = sfn_sf;
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy lbt - enter\n");
+		(pnf_p7->_public.lbt_dl_config_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.lbt_dl_config_req);
+	}
+}
+
+int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
+{
+	// We could either send an event to the p7 thread have have it run the
+	// subframe or we could handle it here and lock access to the subframe
+	// buffers. If we do it on the p7 thread then we run the risk of blocking
+	// on the udp send. 
+	//
+	// todo : start a timer to give us more of the 1 ms tick before send back
+	// the frame
+	
+	// todo : consider a more efficent lock mechasium
+	if(pthread_mutex_lock(&(pnf_p7->mutex)) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
+		return -1;
+	}
+
+#if 1
+	// save the curren time and sfn_sf
+	pnf_p7->sf_start_time_hr = pnf_get_current_time_hr();
+	pnf_p7->sfn_sf = sfn_sf;
+
+        uint32_t sfn_sf_tx = sfnsf_add_sf(sfn_sf, sf_ahead);
+        uint32_t tx_sfn_sf_dec = NFAPI_SFNSF2DEC(sfn_sf_tx);
+
+	// If the subframe_buffer has been configured
+	if(pnf_p7->_public.subframe_buffer_size != 0)
+	{
+
+		// apply the shift to the incoming sfn_sf
+		if(pnf_p7->sfn_sf_shift != 0)
+		{
+			int32_t sfn_sf_dec = NFAPI_SFNSF2DEC(sfn_sf);
+
+			int32_t shifted_sfn_sf = sfn_sf_dec += pnf_p7->sfn_sf_shift;
+
+			// adjust for wrap-around
+			if(shifted_sfn_sf < 0)
+				shifted_sfn_sf += NFAPI_MAX_SFNSFDEC;
+			else if(shifted_sfn_sf > NFAPI_MAX_SFNSFDEC)
+				shifted_sfn_sf -= NFAPI_MAX_SFNSFDEC;
+
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "Applying shift %d to sfn/sf (%d -> %d)\n", pnf_p7->sfn_sf_shift, NFAPI_SFNSF2DEC(sfn_sf), shifted_sfn_sf);
+			sfn_sf = shifted_sfn_sf;
+
+                        //
+                        // DJP - why does the shift not apply to pnf_p7->sfn_sf???
+                        //
+
+			pnf_p7->sfn_sf_shift = 0;
+		}
+
+		uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(sfn_sf);
+		uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
+
+		nfapi_pnf_p7_subframe_buffer_t* subframe_buffer = &(pnf_p7->subframe_buffer[buffer_index]);
+
+		uint8_t tx_buffer_index = tx_sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
+		nfapi_pnf_p7_subframe_buffer_t* tx_subframe_buffer = &(pnf_p7->subframe_buffer[tx_buffer_index]);
+
+                //printf("sfn_sf_dec:%d tx_sfn_sf_dec:%d\n", sfn_sf_dec, tx_sfn_sf_dec);
+
+                if (0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() shift:%d subframe_buffer->sfn_sf:%d tx_subframe_buffer->sfn_sf:%d sfn_sf:%d subframe_buffer[buffer_index:%u dl_config_req:%p tx_req:%p] "
+                    "TX:sfn_sf:%d:tx_buffer_index:%d[dl_config_req:%p tx_req:%p]\n", 
+                    __FUNCTION__, 
+                    pnf_p7->sfn_sf_shift, 
+                    NFAPI_SFNSF2DEC(subframe_buffer->sfn_sf), 
+                    NFAPI_SFNSF2DEC(tx_subframe_buffer->sfn_sf), 
+                       sfn_sf_dec,    buffer_index,    subframe_buffer->dl_config_req,    subframe_buffer->tx_req, 
+                    tx_sfn_sf_dec, tx_buffer_index, tx_subframe_buffer->dl_config_req, tx_subframe_buffer->tx_req);
+
+		// if the subframe buffer sfn sf is set then we have atlease 1 message
+		// from the vnf. 
+		// todo : how to handle the messages we don't have, send dummies for
+		// now
+
+                //printf("tx_subframe_buffer->sfn_sf:%d sfn_sf_tx:%d\n", tx_subframe_buffer->sfn_sf, sfn_sf_tx);
+                //printf("subframe_buffer->sfn_sf:%d sfn_sf:%d\n", subframe_buffer->sfn_sf, sfn_sf);
+		if(tx_subframe_buffer->sfn_sf == sfn_sf_tx)
+		{
+			if(tx_subframe_buffer->tx_req != 0)
+			{
+				if(pnf_p7->_public.tx_req)
+					(pnf_p7->_public.tx_req)(&(pnf_p7->_public), tx_subframe_buffer->tx_req);
+
+				//deallocate_nfapi_tx_request(subframe_buffer->tx_req, pnf_p7);
+			}
+			else
+			{
+				// send dummy
+				if(pnf_p7->_public.tx_req && pnf_p7->_public.dummy_subframe.tx_req)
+				{
+					pnf_p7->_public.dummy_subframe.tx_req->sfn_sf = sfn_sf_tx;
+					(pnf_p7->_public.tx_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.tx_req);
+				}
+			}
+
+			if(tx_subframe_buffer->dl_config_req != 0)
+			{
+				if(pnf_p7->_public.dl_config_req)
+					(pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), tx_subframe_buffer->dl_config_req);
+
+				//deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7);
+			}
+			else
+			{
+				// send dummy
+				if(pnf_p7->_public.dl_config_req && pnf_p7->_public.dummy_subframe.dl_config_req)
+				{
+					pnf_p7->_public.dummy_subframe.dl_config_req->sfn_sf = sfn_sf_tx;
+					(pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req);
+				}
+			}
+
+			if(tx_subframe_buffer->hi_dci0_req != 0)
+			{
+				if(pnf_p7->_public.hi_dci0_req)
+					(pnf_p7->_public.hi_dci0_req)(&(pnf_p7->_public), tx_subframe_buffer->hi_dci0_req);
+
+				//deallocate_nfapi_hi_dci0_request(subframe_buffer->hi_dci0_req, pnf_p7);
+			}
+			else
+			{
+				//send dummy
+				if(pnf_p7->_public.hi_dci0_req && pnf_p7->_public.dummy_subframe.hi_dci0_req)
+				{
+					pnf_p7->_public.dummy_subframe.hi_dci0_req->sfn_sf = sfn_sf_tx;
+					(pnf_p7->_public.hi_dci0_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.hi_dci0_req);
+				}
+			}
+
+                        if(tx_subframe_buffer->dl_config_req != 0)
+                        {
+                          deallocate_nfapi_dl_config_request(tx_subframe_buffer->dl_config_req, pnf_p7);
+                          tx_subframe_buffer->dl_config_req = 0;
+                        }
+			if(tx_subframe_buffer->tx_req != 0)
+                        {
+                          deallocate_nfapi_tx_request(tx_subframe_buffer->tx_req, pnf_p7);
+                          tx_subframe_buffer->tx_req = 0;
+                        }
+                        if(tx_subframe_buffer->hi_dci0_req != 0)
+                        {
+                          deallocate_nfapi_hi_dci0_request(tx_subframe_buffer->hi_dci0_req, pnf_p7);
+                          tx_subframe_buffer->hi_dci0_req = 0;
+                        }
+                }
+		else
+		{
+                  // If we ever need to "send" a dummy ul_config this won't work!!!
+                  send_dummy_subframe(pnf_p7, sfn_sf_tx);
+		}
+
+                if(subframe_buffer->sfn_sf == sfn_sf)
+		{
+
+			if(subframe_buffer->ul_config_req != 0)
+			{
+				if(pnf_p7->_public.ul_config_req)
+					(pnf_p7->_public.ul_config_req)(&(pnf_p7->_public), subframe_buffer->ul_config_req);
+
+				//deallocate_nfapi_ul_config_request(subframe_buffer->ul_config_req, pnf_p7);
+			}
+			else
+			{
+				// send dummy
+				if(pnf_p7->_public.ul_config_req && pnf_p7->_public.dummy_subframe.ul_config_req)
+				{
+					pnf_p7->_public.dummy_subframe.ul_config_req->sfn_sf = sfn_sf;
+					(pnf_p7->_public.ul_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.ul_config_req);
+				}
+			}
+
+			if(subframe_buffer->lbt_dl_config_req != 0)
+			{
+				if(pnf_p7->_public.lbt_dl_config_req)
+					(pnf_p7->_public.lbt_dl_config_req)(&(pnf_p7->_public), subframe_buffer->lbt_dl_config_req);
+
+				//deallocate_nfapi_lbt_dl_config_request(subframe_buffer->lbt_dl_config_req, pnf_p7);
+			}
+			else
+			{
+				// send dummy
+				if(pnf_p7->_public.lbt_dl_config_req && pnf_p7->_public.dummy_subframe.lbt_dl_config_req)
+				{
+					pnf_p7->_public.dummy_subframe.lbt_dl_config_req->sfn_sf = sfn_sf;
+					(pnf_p7->_public.lbt_dl_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.lbt_dl_config_req);
+				}
+
+			}
+
+                        //if(subframe_buffer->dl_config_req != 0)
+                          //deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7);
+			//if(subframe_buffer->tx_req != 0)
+                          //deallocate_nfapi_tx_request(subframe_buffer->tx_req, pnf_p7);
+                        if(subframe_buffer->ul_config_req != 0)
+                        {
+                          deallocate_nfapi_ul_config_request(subframe_buffer->ul_config_req, pnf_p7);
+                          subframe_buffer->ul_config_req = 0;
+
+                        }
+                        //if(subframe_buffer->hi_dci0_req != 0)
+                          //deallocate_nfapi_hi_dci0_request(subframe_buffer->hi_dci0_req, pnf_p7);
+			if(subframe_buffer->lbt_dl_config_req != 0)
+                        {
+                          deallocate_nfapi_lbt_dl_config_request(subframe_buffer->lbt_dl_config_req, pnf_p7);
+                          subframe_buffer->lbt_dl_config_req = 0;
+                        }
+                } // sfn_sf match
+
+                if (subframe_buffer->dl_config_req == 0 && subframe_buffer->tx_req == 0 && subframe_buffer->ul_config_req == 0 && subframe_buffer->lbt_dl_config_req == 0)
+                {
+                  memset(&(pnf_p7->subframe_buffer[buffer_index]), 0, sizeof(nfapi_pnf_p7_subframe_buffer_t));
+                  pnf_p7->subframe_buffer[buffer_index].sfn_sf = -1;
+		}
+
+                //printf("pnf_p7->_public.timing_info_mode_periodic:%d pnf_p7->timing_info_period_counter:%d pnf_p7->_public.timing_info_period:%d\n", pnf_p7->_public.timing_info_mode_periodic, pnf_p7->timing_info_period_counter, pnf_p7->_public.timing_info_period);
+                //printf("pnf_p7->_public.timing_info_mode_aperiodic:%d pnf_p7->timing_info_aperiodic_send:%d\n", pnf_p7->_public.timing_info_mode_aperiodic, pnf_p7->timing_info_aperiodic_send);
+                //printf("pnf_p7->timing_info_ms_counter:%d\n", pnf_p7->timing_info_ms_counter);
+
+		// send the periodic timing info if configured
+		if(pnf_p7->_public.timing_info_mode_periodic && (pnf_p7->timing_info_period_counter++) == pnf_p7->_public.timing_info_period)
+		{
+			pnf_pack_and_send_timing_info(pnf_p7);
+
+			pnf_p7->timing_info_period_counter = 0;
+		}
+		else if(pnf_p7->_public.timing_info_mode_aperiodic && pnf_p7->timing_info_aperiodic_send)
+		{
+			pnf_pack_and_send_timing_info(pnf_p7);
+
+			pnf_p7->timing_info_aperiodic_send = 0;
+		}
+		else
+		{
+			pnf_p7->timing_info_ms_counter++;
+		}
+	}
+	else
+	{
+		//send_dummy_subframe(pnf_p7, sfn_sf_tx);
+	}
+
+
+        //printf("pnf_p7->tick:%d\n", pnf_p7->tick);
+	if(pnf_p7->tick == 1000)
+	{
+
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF P7:%d] (ONTIME/LATE) DL:(%d/%d) UL:(%d/%d) HI:(%d/%d) TX:(%d/%d)\n", pnf_p7->_public.phy_id,
+					pnf_p7->stats.dl_conf_ontime, pnf_p7->stats.dl_conf_late, 
+					pnf_p7->stats.ul_conf_ontime, pnf_p7->stats.ul_conf_late, 
+					pnf_p7->stats.hi_dci0_ontime, pnf_p7->stats.hi_dci0_late, 
+					pnf_p7->stats.tx_ontime, pnf_p7->stats.tx_late);
+		pnf_p7->tick = 0;
+		memset(&pnf_p7->stats, 0, sizeof(pnf_p7->stats));
+	}
+	pnf_p7->tick++;
+#endif
+
+	if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+
+
+// return 1 if in window
+// return 0 if out of window
+uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
+{
+	uint32_t recv_sfn_sf_dec = NFAPI_SFNSF2DEC(sfnsf);
+	uint32_t current_sfn_sf_dec = NFAPI_SFNSF2DEC(phy->sfn_sf);
+
+	uint8_t in_window = 0;
+	uint8_t timing_window = phy->_public.subframe_buffer_size;
+
+	if(recv_sfn_sf_dec <= current_sfn_sf_dec)
+	{
+		// Need to check for wrap in window
+		if(((current_sfn_sf_dec + timing_window) % NFAPI_MAX_SFNSFDEC) < current_sfn_sf_dec)
+		{
+			if(recv_sfn_sf_dec > ((current_sfn_sf_dec + timing_window) % NFAPI_MAX_SFNSFDEC))
+			{
+				// out of window
+				NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is late %d (with wrap)\n", current_sfn_sf_dec, name, recv_sfn_sf_dec);
+			}
+			else
+			{
+				// ok
+				//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d (with wrap)\n", current_sfn_sf_dec, name, recv_sfn_sf_dec);
+				in_window = 1;
+			}
+		}
+		else
+		{
+			// too late
+			NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in late %d (delta:%d)\n", current_sfn_sf_dec, name, recv_sfn_sf_dec, (current_sfn_sf_dec - recv_sfn_sf_dec));
+		}
+
+	}
+	else
+	{
+		// Need to check it is in window
+		if((recv_sfn_sf_dec - current_sfn_sf_dec) <= timing_window)
+		{
+			// in window
+			//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_sf_dec, name, recv_sfn_sf_dec);
+			in_window = 1;
+		}
+		else
+		{
+			// too far in the future
+			NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is out of window %d (delta:%d) [max:%d]\n", current_sfn_sf_dec, name, recv_sfn_sf_dec,  (recv_sfn_sf_dec - current_sfn_sf_dec), timing_window);
+		}
+
+	}
+
+	return in_window;
+}
+
+
+// P7 messages
+//
+void pnf_handle_dl_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "DL_CONFIG.req Received\n");
+
+	nfapi_dl_config_request_t* req  = allocate_nfapi_dl_config_request(pnf_p7);
+
+	if(req == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_dl_config_request structure\n");
+		return;
+	}
+
+	int unpack_result = nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, req, sizeof(nfapi_dl_config_request_t), &(pnf_p7->_public.codec_config));
+
+	if(unpack_result == 0)
+	{
+		if(pthread_mutex_lock(&(pnf_p7->mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
+			return;
+		}
+
+                if (
+                    0 && 
+                    (NFAPI_SFNSF2DEC(req->sfn_sf) % 100 ==0 ||
+                     NFAPI_SFNSF2DEC(req->sfn_sf) % 105 ==0 
+                    )
+                )
+                  NFAPI_TRACE(NFAPI_TRACE_INFO, "DL_CONFIG.req sfn_sf:%d pdcch:%u dci:%u pdu:%u pdsch_rnti:%u pcfich:%u\n", 
+                      NFAPI_SFNSF2DEC(req->sfn_sf),
+                      req->dl_config_request_body.number_pdcch_ofdm_symbols,
+                      req->dl_config_request_body.number_dci,
+                      req->dl_config_request_body.number_pdu,
+                      req->dl_config_request_body.number_pdsch_rnti,
+                      req->dl_config_request_body.transmission_power_pcfich
+                      );
+
+                if(is_p7_request_in_window(req->sfn_sf, "dl_config_request", pnf_p7))
+                {
+                  uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
+                  uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
+
+                        struct timespec t;
+                        clock_gettime(CLOCK_MONOTONIC, &t);
+
+                  NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE DL_CONFIG_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_sf_dec, buffer_index);
+
+			// if there is already an dl_config_req make sure we free it.
+			if(pnf_p7->subframe_buffer[buffer_index].dl_config_req != 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_NOTE, "%s() is_p7_request_in_window()=TRUE buffer_index occupied - free it first sfn_sf:%d buffer_index:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), buffer_index);
+				//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing dl_config_req at index %d (%d/%d)", 
+				//			pMyPhyInfo->sfnSf, bufferIdx,
+				//			SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf));
+				deallocate_nfapi_dl_config_request(pnf_p7->subframe_buffer[buffer_index].dl_config_req, pnf_p7);
+			}
+
+			// saving dl_config_request in subframe buffer
+			pnf_p7->subframe_buffer[buffer_index].sfn_sf = req->sfn_sf;
+			pnf_p7->subframe_buffer[buffer_index].dl_config_req = req;
+
+			pnf_p7->stats.dl_conf_ontime++;
+			
+		}
+		else
+		{
+			//NFAPI_TRACE(NFAPI_TRACE_NOTE, "NOT storing dl_config_req SFN/SF %d\n", req->sfn_sf);
+			deallocate_nfapi_dl_config_request(req, pnf_p7);
+
+			if(pnf_p7->_public.timing_info_mode_aperiodic)
+			{
+				pnf_p7->timing_info_aperiodic_send = 1;
+			}
+
+			pnf_p7->stats.dl_conf_late++;
+		}
+
+		if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
+			return;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to unpack dl_config_req");
+		deallocate_nfapi_dl_config_request(req, pnf_p7);
+	}
+}
+
+void pnf_handle_ul_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "UL_CONFIG.req Received\n");
+
+	nfapi_ul_config_request_t* req  = allocate_nfapi_ul_config_request(pnf_p7);
+
+	if(req == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_ul_config_request structure\n");
+		return;
+	}
+
+	int unpack_result = nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, req, sizeof(nfapi_ul_config_request_t), &(pnf_p7->_public.codec_config));
+
+	if(unpack_result == 0)
+	{
+		if(pthread_mutex_lock(&(pnf_p7->mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
+			return;
+		}
+
+		if(is_p7_request_in_window(req->sfn_sf, "ul_config_request", pnf_p7))
+		{
+			uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
+			uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
+
+                        struct timespec t;
+                        clock_gettime(CLOCK_MONOTONIC, &t);
+
+                        NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE UL_CONFIG_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_sf_dec, buffer_index);
+
+			if(pnf_p7->subframe_buffer[buffer_index].ul_config_req != 0)
+			{
+				//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing ul_config_req at index %d (%d/%d)", 
+				//			pMyPhyInfo->sfnSf, bufferIdx,
+				//			SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf));
+
+				deallocate_nfapi_ul_config_request(pnf_p7->subframe_buffer[buffer_index].ul_config_req, pnf_p7);
+			}
+
+			pnf_p7->subframe_buffer[buffer_index].sfn_sf = req->sfn_sf;
+			pnf_p7->subframe_buffer[buffer_index].ul_config_req = req;
+			
+			pnf_p7->stats.ul_conf_ontime++;
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] NOT storing ul_config_req OUTSIDE OF TRANSMIT BUFFER WINDOW SFN/SF %d\n", NFAPI_SFNSF2DEC(pnf_p7->sfn_sf), NFAPI_SFNSF2DEC(req->sfn_sf));
+			deallocate_nfapi_ul_config_request(req, pnf_p7);
+
+			if(pnf_p7->_public.timing_info_mode_aperiodic)
+			{
+				pnf_p7->timing_info_aperiodic_send = 1;
+			}
+
+			pnf_p7->stats.ul_conf_late++;
+		}
+
+		if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
+			return;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to unpack ul_config_req\n");
+		deallocate_nfapi_ul_config_request(req, pnf_p7);
+	}
+}
+
+void pnf_handle_hi_dci0_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "HI_DCI0.req Received\n");
+
+	nfapi_hi_dci0_request_t* req  = allocate_nfapi_hi_dci0_request(pnf_p7);
+
+	if(req == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_hi_dci0_request structure\n");
+		return;
+	}
+
+	int unpack_result = nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, req, sizeof(nfapi_hi_dci0_request_t), &pnf_p7->_public.codec_config);
+
+	if(unpack_result == 0)
+	{
+		if(pthread_mutex_lock(&(pnf_p7->mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
+			return;
+		}
+
+		if(is_p7_request_in_window(req->sfn_sf, "hi_dci0_request", pnf_p7))
+		{
+			uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
+			uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
+
+			if(pnf_p7->subframe_buffer[buffer_index].hi_dci0_req!= 0)
+			{
+				//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing hi_dci0_req at index %d (%d/%d)", 
+				//			pMyPhyInfo->sfnSf, bufferIdx,
+				//			SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf));
+
+				deallocate_nfapi_hi_dci0_request(pnf_p7->subframe_buffer[buffer_index].hi_dci0_req, pnf_p7);
+			}
+
+			pnf_p7->subframe_buffer[buffer_index].sfn_sf = req->sfn_sf;
+			pnf_p7->subframe_buffer[buffer_index].hi_dci0_req = req;
+
+			pnf_p7->stats.hi_dci0_ontime++;
+			
+		}
+		else
+		{
+			//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] NOT storing hi_dci0_req SFN/SF %d/%d\n", pMyPhyInfo->sfnSf, SFNSF2SFN(req->sfn_sf), SFNSF2SF(req->sfn_sf));
+			deallocate_nfapi_hi_dci0_request(req, pnf_p7);
+
+			if(pnf_p7->_public.timing_info_mode_aperiodic)
+			{
+				pnf_p7->timing_info_aperiodic_send = 1;
+			}
+
+			pnf_p7->stats.hi_dci0_late++;
+		}
+
+		if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
+			return;
+		}
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to unpack hi_dci0_req\n");
+		deallocate_nfapi_hi_dci0_request(req, pnf_p7);
+	}
+}
+
+void pnf_handle_tx_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "TX.req Received\n");
+	
+	nfapi_tx_request_t* req = allocate_nfapi_tx_request(pnf_p7);
+
+	if(req == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_tx_request structure\n");
+		return;
+	}
+
+	int unpack_result = nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, req, sizeof(nfapi_tx_request_t), &pnf_p7->_public.codec_config);
+	if(unpack_result == 0)
+	{
+		if(pthread_mutex_lock(&(pnf_p7->mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
+			return;
+		}
+
+		if(is_p7_request_in_window(req->sfn_sf, "tx_request", pnf_p7))
+		{
+			uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
+			uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
+
+                        struct timespec t;
+                        clock_gettime(CLOCK_MONOTONIC, &t);
+
+                        NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE TX_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_sf_dec, buffer_index);
+
+                        if (0 && NFAPI_SFNSF2DEC(req->sfn_sf)%100==0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX_REQ.req sfn_sf:%d pdus:%d - TX_REQ is within window\n",
+                            __FUNCTION__,
+                            NFAPI_SFNSF2DEC(req->sfn_sf),
+                            req->tx_request_body.number_of_pdus);
+
+			if(pnf_p7->subframe_buffer[buffer_index].tx_req != 0)
+			{
+				//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing tx_req at index %d (%d/%d)", 
+				//			pMyPhyInfo->sfnSf, bufferIdx,
+				//			SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf));
+
+				deallocate_nfapi_tx_request(pnf_p7->subframe_buffer[buffer_index].tx_req, pnf_p7);
+			}
+
+			pnf_p7->subframe_buffer[buffer_index].sfn_sf = req->sfn_sf;
+			pnf_p7->subframe_buffer[buffer_index].tx_req = req;
+
+			pnf_p7->stats.tx_ontime++;
+		}
+		else
+		{
+                  NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() TX_REQUEST Request is outside of window REQ:SFN_SF:%d CURR:SFN_SF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), NFAPI_SFNSF2DEC(pnf_p7->sfn_sf));
+
+			deallocate_nfapi_tx_request(req, pnf_p7);
+
+			if(pnf_p7->_public.timing_info_mode_aperiodic)
+			{
+				pnf_p7->timing_info_aperiodic_send = 1;
+			}
+
+			pnf_p7->stats.tx_late++;
+		}
+
+		if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
+			return;
+		}
+	}
+	else
+	{
+		deallocate_nfapi_tx_request(req, pnf_p7);
+	}
+}
+
+void pnf_handle_lbt_dl_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
+{
+	nfapi_lbt_dl_config_request_t* req = allocate_nfapi_lbt_dl_config_request(pnf_p7);
+
+	if(req == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_lbt_dl_config_request structure\n");
+		return;
+	}
+
+	int unpack_result = nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, req, sizeof(nfapi_lbt_dl_config_request_t), &pnf_p7->_public.codec_config);
+
+	if(unpack_result == 0)
+	{
+		if(pthread_mutex_lock(&(pnf_p7->mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
+			return;
+		}
+
+		if(is_p7_request_in_window(req->sfn_sf, "lbt_dl_request", pnf_p7))
+		{
+			uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
+			uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
+
+			if(pnf_p7->subframe_buffer[buffer_index].lbt_dl_config_req != 0)
+			{
+				//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing tx_req at index %d (%d/%d)", 
+				//			pMyPhyInfo->sfnSf, bufferIdx,
+				//			SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf));
+
+				deallocate_nfapi_lbt_dl_config_request(pnf_p7->subframe_buffer[buffer_index].lbt_dl_config_req, pnf_p7);
+			}
+
+			pnf_p7->subframe_buffer[buffer_index].sfn_sf = req->sfn_sf;
+			pnf_p7->subframe_buffer[buffer_index].lbt_dl_config_req = req;
+		}
+		else
+		{
+			deallocate_nfapi_lbt_dl_config_request(req, pnf_p7);
+
+			if(pnf_p7->_public.timing_info_mode_aperiodic)
+			{
+				pnf_p7->timing_info_aperiodic_send = 1;
+			}
+		}
+
+		if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
+			return;
+		}
+	}
+	else
+	{
+		deallocate_nfapi_lbt_dl_config_request(req, pnf_p7);
+	}
+
+}
+
+void pnf_handle_p7_vendor_extension(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7, uint16_t message_id)
+{
+	if(pnf_p7->_public.allocate_p7_vendor_ext)
+	{
+		uint16_t msg_size;
+		nfapi_p7_message_header_t* msg = pnf_p7->_public.allocate_p7_vendor_ext(message_id, &msg_size);
+
+		if(msg == 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to allocate vendor extention structure\n");
+			return;
+		}
+
+		int unpack_result = nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, msg, msg_size, &pnf_p7->_public.codec_config);
+
+		if(unpack_result == 0)
+		{
+			if(pnf_p7->_public.vendor_ext)
+				pnf_p7->_public.vendor_ext(&(pnf_p7->_public), msg);
+		}
+		
+		if(pnf_p7->_public.deallocate_p7_vendor_ext)
+			pnf_p7->_public.deallocate_p7_vendor_ext(msg);
+		
+	}
+	
+}
+
+
+uint32_t calculate_t2(uint32_t now_time_hr, uint16_t sfn_sf, uint32_t sf_start_time_hr)
+{
+	uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
+	uint32_t t2 = (NFAPI_SFNSF2DEC(sfn_sf) * 1000) + sf_time_us;
+
+        if (0)
+        {
+          static uint32_t prev_t2 = 0;
+
+          NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(now_time_hr:%u sfn_sf:%d sf_start_time_Hr:%u) sf_time_us:%u t2:%u prev_t2:%u diff:%u\n",
+              __FUNCTION__,
+              now_time_hr, NFAPI_SFNSF2DEC(sfn_sf), sf_start_time_hr,
+              sf_time_us,
+              t2,
+              prev_t2,
+              t2-prev_t2);
+
+          prev_t2 = t2;
+        }
+
+	return t2;
+}
+
+uint32_t calculate_t3(uint16_t sfn_sf, uint32_t sf_start_time_hr)
+{
+	uint32_t now_time_hr = pnf_get_current_time_hr();
+
+	uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
+
+	uint32_t t3 = (NFAPI_SFNSF2DEC(sfn_sf) * 1000) + sf_time_us;
+
+	return t3;
+}
+
+void pnf_handle_dl_node_sync(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7, uint32_t rx_hr_time)
+{
+	nfapi_dl_node_sync_t dl_node_sync;
+
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "DL_NODE_SYNC Received\n");
+
+	if (pRecvMsg == NULL || pnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+		return;
+	}
+
+	// unpack the message
+	if (nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &dl_node_sync, sizeof(dl_node_sync), &pnf_p7->_public.codec_config) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		return;
+	}
+
+	if(pthread_mutex_lock(&(pnf_p7->mutex)) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
+		return;
+	}
+
+
+	if (dl_node_sync.delta_sfn_sf != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Will shift SF timing by %d on next subframe\n", dl_node_sync.delta_sfn_sf);
+
+		pnf_p7->sfn_sf_shift = dl_node_sync.delta_sfn_sf;
+	}
+
+	nfapi_ul_node_sync_t ul_node_sync;
+	memset(&ul_node_sync, 0, sizeof(ul_node_sync));
+	ul_node_sync.header.message_id = NFAPI_UL_NODE_SYNC;
+	ul_node_sync.header.phy_id = dl_node_sync.header.phy_id;
+	ul_node_sync.t1 = dl_node_sync.t1;
+	ul_node_sync.t2 = calculate_t2(rx_hr_time, pnf_p7->sfn_sf, pnf_p7->sf_start_time_hr);
+	ul_node_sync.t3 = calculate_t3(pnf_p7->sfn_sf, pnf_p7->sf_start_time_hr);
+
+	if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
+		return;
+	}
+
+	pnf_p7_pack_and_send_p7_message(pnf_p7, &(ul_node_sync.header), sizeof(ul_node_sync));
+}
+
+void pnf_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7,  uint32_t rx_hr_time)
+{
+	nfapi_p7_message_header_t header;
+
+	// validate the input params
+	if(pRecvMsg == NULL || recvMsgLen < 4 || pnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return;
+	}
+
+	// unpack the message header
+	if (nfapi_p7_message_header_unpack(pRecvMsg, recvMsgLen, &header, sizeof(header), &pnf_p7->_public.codec_config) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unpack message header failed, ignoring\n");
+		return;
+	}
+
+	// ensure the message is sensible
+	if (recvMsgLen < 8 || pRecvMsg == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_WARN, "Invalid message size: %d, ignoring\n", recvMsgLen);
+		return;
+	}
+
+	switch (header.message_id)
+	{
+		case NFAPI_DL_NODE_SYNC:
+			pnf_handle_dl_node_sync(pRecvMsg, recvMsgLen, pnf_p7, rx_hr_time);
+			break;
+
+		case NFAPI_DL_CONFIG_REQUEST:
+			pnf_handle_dl_config_request(pRecvMsg, recvMsgLen, pnf_p7);
+			break;
+
+		case NFAPI_UL_CONFIG_REQUEST:
+			pnf_handle_ul_config_request(pRecvMsg, recvMsgLen, pnf_p7);
+			break;
+
+		case NFAPI_HI_DCI0_REQUEST:
+			pnf_handle_hi_dci0_request(pRecvMsg, recvMsgLen, pnf_p7);
+			break;
+
+		case NFAPI_TX_REQUEST:
+			pnf_handle_tx_request(pRecvMsg, recvMsgLen, pnf_p7);
+			break;
+
+		case NFAPI_LBT_DL_CONFIG_REQUEST:
+			pnf_handle_lbt_dl_config_request(pRecvMsg, recvMsgLen, pnf_p7);
+			break;
+		
+		default:
+			{
+				if(header.message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
+				   header.message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
+				{
+					pnf_handle_p7_vendor_extension(pRecvMsg, recvMsgLen, pnf_p7, header.message_id);
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s P7 Unknown message ID %d\n", __FUNCTION__, header.message_id);
+				}
+			}
+			break;
+	}
+}
+
+void pnf_handle_p7_message(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7,  uint32_t rx_hr_time)
+{
+	nfapi_p7_message_header_t messageHeader;
+
+	// validate the input params
+	if(pRecvMsg == NULL || recvMsgLen < 4 || pnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "pnf_handle_p7_message: invalid input params (%d %d %d)\n", pRecvMsg, recvMsgLen, pnf_p7);
+		return;
+	}
+
+	// unpack the message header
+	if (nfapi_p7_message_header_unpack(pRecvMsg, recvMsgLen, &messageHeader, sizeof(nfapi_p7_message_header_t), &pnf_p7->_public.codec_config) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unpack message header failed, ignoring\n");
+		return;
+	}
+
+	uint8_t m = NFAPI_P7_GET_MORE(messageHeader.m_segment_sequence);
+	uint8_t sequence_num = NFAPI_P7_GET_SEQUENCE(messageHeader.m_segment_sequence);
+	uint8_t segment_num = NFAPI_P7_GET_SEGMENT(messageHeader.m_segment_sequence);
+
+	if(pnf_p7->_public.checksum_enabled)
+	{
+		uint32_t checksum = nfapi_p7_calculate_checksum(pRecvMsg, recvMsgLen);
+		if(checksum != messageHeader.checksum)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "Checksum verification failed %d %d\n", checksum, messageHeader.checksum);
+			return;
+		}
+	}
+
+	if(m == 0 && segment_num == 0)
+	{
+		// we have a complete message
+		// ensure the message is sensible
+		if (recvMsgLen < 8 || pRecvMsg == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_WARN, "Invalid message size: %d, ignoring\n", recvMsgLen);
+			return;
+		}
+
+		pnf_dispatch_p7_message(pRecvMsg, recvMsgLen, pnf_p7, rx_hr_time);
+	}
+	else
+	{
+		pnf_p7_rx_message_t* rx_msg = pnf_p7_rx_reassembly_queue_add_segment(pnf_p7, &(pnf_p7->reassembly_queue), rx_hr_time, sequence_num, segment_num, m, pRecvMsg, recvMsgLen);
+
+		if(rx_msg->num_segments_received == rx_msg->num_segments_expected)
+		{
+			// send the buffer on
+			uint16_t i = 0;
+			uint16_t length = 0;
+			for(i = 0; i < rx_msg->num_segments_expected; ++i)
+			{
+				length += rx_msg->segments[i].length - (i > 0 ? NFAPI_P7_HEADER_LENGTH : 0);
+			}
+			
+			if(pnf_p7->reassemby_buffer_size < length)
+			{
+				pnf_p7_free(pnf_p7, pnf_p7->reassemby_buffer);
+				pnf_p7->reassemby_buffer = 0;
+			}
+
+			if(pnf_p7->reassemby_buffer == 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_NOTE, "Resizing PNF_P7 Reassembly buffer %d->%d\n", pnf_p7->reassemby_buffer_size, length);
+				pnf_p7->reassemby_buffer = (uint8_t*)pnf_p7_malloc(pnf_p7, length);
+
+				if(pnf_p7->reassemby_buffer == 0)
+				{
+					NFAPI_TRACE(NFAPI_TRACE_NOTE, "Failed to allocate PNF_P7 reassemby buffer len:%d\n", length);
+					return;
+				}
+
+				pnf_p7->reassemby_buffer_size = length;
+			}
+			
+			uint16_t offset = 0;
+			for(i = 0; i < rx_msg->num_segments_expected; ++i)
+			{
+				if(i == 0)
+				{
+					memcpy(pnf_p7->reassemby_buffer, rx_msg->segments[i].buffer, rx_msg->segments[i].length);
+					offset += rx_msg->segments[i].length;
+				}
+				else
+				{
+					memcpy(pnf_p7->reassemby_buffer + offset, rx_msg->segments[i].buffer + NFAPI_P7_HEADER_LENGTH, rx_msg->segments[i].length - NFAPI_P7_HEADER_LENGTH);
+					offset += rx_msg->segments[i].length - NFAPI_P7_HEADER_LENGTH;
+				}
+			}
+
+			
+			pnf_dispatch_p7_message(pnf_p7->reassemby_buffer, length, pnf_p7, rx_msg->rx_hr_time);
+
+
+			// delete the structure
+			pnf_p7_rx_reassembly_queue_remove_msg(pnf_p7, &(pnf_p7->reassembly_queue), rx_msg);
+		}
+	}
+
+	pnf_p7_rx_reassembly_queue_remove_old_msgs(pnf_p7, &(pnf_p7->reassembly_queue), rx_hr_time, 1000);
+	
+}
+void pnf_nfapi_p7_read_dispatch_message(pnf_p7_t* pnf_p7, uint32_t now_hr_time)
+{
+	int recvfrom_result = 0;
+	struct sockaddr_in remote_addr;
+	socklen_t remote_addr_size = sizeof(remote_addr);
+
+	do
+	{
+		// peek the header
+		uint8_t header_buffer[NFAPI_P7_HEADER_LENGTH];
+		recvfrom_result = recvfrom(pnf_p7->p7_sock, header_buffer, NFAPI_P7_HEADER_LENGTH, MSG_DONTWAIT | MSG_PEEK, (struct sockaddr*)&remote_addr, &remote_addr_size);
+
+		if(recvfrom_result > 0)
+		{
+			// get the segment size
+			nfapi_p7_message_header_t header;
+			nfapi_p7_message_header_unpack(header_buffer, NFAPI_P7_HEADER_LENGTH, &header, 34, 0);
+
+			// resize the buffer if we have a large segment
+			if(header.message_length > pnf_p7->rx_message_buffer_size)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_NOTE, "reallocing rx buffer %d\n", header.message_length); 
+				pnf_p7->rx_message_buffer = realloc(pnf_p7->rx_message_buffer, header.message_length);
+				pnf_p7->rx_message_buffer_size = header.message_length;
+			}
+
+			// read the segment
+			recvfrom_result = recvfrom(pnf_p7->p7_sock, pnf_p7->rx_message_buffer, header.message_length, MSG_DONTWAIT, (struct sockaddr*)&remote_addr, &remote_addr_size);
+
+		now_hr_time = pnf_get_current_time_hr(); //DJP - moved to here - get closer timestamp???
+
+			if(recvfrom_result > 0)
+			{
+				pnf_handle_p7_message(pnf_p7->rx_message_buffer, recvfrom_result, pnf_p7, now_hr_time);
+			}
+		}
+		else if(recvfrom_result == 0)
+		{
+			// recv zero length message
+			recvfrom_result = recvfrom(pnf_p7->p7_sock, header_buffer, 0, MSG_DONTWAIT, (struct sockaddr*)&remote_addr, &remote_addr_size);
+		}
+
+		if(recvfrom_result == -1)
+		{
+			if(errno == EAGAIN || errno == EWOULDBLOCK)
+			{
+				// return to the select
+				//NFAPI_TRACE(NFAPI_TRACE_WARN, "%s recvfrom would block :%d\n", __FUNCTION__, errno);
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_WARN, "%s recvfrom failed errno:%d\n", __FUNCTION__, errno);
+			}
+		}
+
+		// need to update the time as we would only use the value from the
+		// select
+#if 0
+// DJP - why do this here and not on return from recv???
+		now_hr_time = pnf_get_current_time_hr();
+#endif
+	}
+	while(recvfrom_result > 0);
+}
+
+int pnf_p7_message_pump(pnf_p7_t* pnf_p7)
+{
+
+	// initialize the mutex lock
+	if(pthread_mutex_init(&(pnf_p7->mutex), NULL) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P7 mutex init: %d\n", errno);
+		return -1;
+	}
+	
+	if(pthread_mutex_init(&(pnf_p7->pack_mutex), NULL) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P7 mutex init: %d\n", errno);
+		return -1;
+	}	
+
+	// create the pnf p7 socket
+	if ((pnf_p7->p7_sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P7 socket errno: %d\n", errno);
+		return -1;
+	}
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF P7 socket created (%d)...\n", pnf_p7->p7_sock);
+
+	// configure the UDP socket options
+	int reuseaddr_enable = 1;
+	if (setsockopt(pnf_p7->p7_sock, SOL_SOCKET, SO_REUSEADDR, &reuseaddr_enable, sizeof(int)) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF P7 setsockopt (SOL_SOCKET, SO_REUSEADDR) failed  errno: %d\n", errno);
+		return -1;
+	}
+
+/*
+	int reuseport_enable = 1;
+	if (setsockopt(pnf_p7->p7_sock, SOL_SOCKET, SO_REUSEPORT, &reuseport_enable, sizeof(int)) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF P7 setsockopt (SOL_SOCKET, SO_REUSEPORT) failed  errno: %d\n", errno);
+		return -1;
+	}
+*/
+		
+	int iptos_value = FAPI2_IP_DSCP << 2;
+	if (setsockopt(pnf_p7->p7_sock, IPPROTO_IP, IP_TOS, &iptos_value, sizeof(iptos_value)) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF P7 setsockopt (IPPROTO_IP, IP_TOS) failed errno: %d\n", errno);
+		return -1;
+	}
+
+	struct sockaddr_in addr;
+	memset(&addr, 0, sizeof(addr));
+	addr.sin_family = AF_INET;
+	addr.sin_port = htons(pnf_p7->_public.local_p7_port);
+
+	if(pnf_p7->_public.local_p7_addr == 0)
+	{
+		addr.sin_addr.s_addr = INADDR_ANY;
+	}
+	else
+	{
+		//addr.sin_addr.s_addr = inet_addr(pnf_p7->_public.local_p7_addr);
+		if(inet_aton(pnf_p7->_public.local_p7_addr, &addr.sin_addr) == -1)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "inet_aton failed\n");
+		}
+	}
+
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF P7 binding %d too %s:%d\n", pnf_p7->p7_sock, inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
+	if (bind(pnf_p7->p7_sock, (struct sockaddr *)&addr, sizeof(addr)) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF_P7 bind error fd:%d errno: %d\n", pnf_p7->p7_sock, errno);
+		return -1;
+	}
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF P7 bind succeeded...\n");
+
+	while(pnf_p7->terminate == 0)
+	{
+		fd_set rfds;
+		int selectRetval = 0;
+
+		// select on a timeout and then get the message
+		FD_ZERO(&rfds);
+		FD_SET(pnf_p7->p7_sock, &rfds);
+
+		struct timeval timeout;
+		timeout.tv_sec = 1;
+		timeout.tv_usec = 0;
+
+		selectRetval = select(pnf_p7->p7_sock+1, &rfds, NULL, NULL, &timeout);
+
+		uint32_t now_hr_time = pnf_get_current_time_hr();
+
+		if(selectRetval == 0)
+		{	
+			// timeout
+			continue;
+		}
+		else if (selectRetval == -1 && (errno == EINTR))
+		{
+			// interrupted by signal
+			NFAPI_TRACE(NFAPI_TRACE_WARN, "PNF P7 Signal Interrupt %d\n", errno);
+			continue;
+		}
+		else if (selectRetval == -1)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_WARN, "PNF P7 select() failed\n");
+			sleep(1);
+			continue;
+		}
+
+		if(FD_ISSET(pnf_p7->p7_sock, &rfds))
+		{
+			pnf_nfapi_p7_read_dispatch_message(pnf_p7, now_hr_time);
+		}
+	}
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF_P7 Terminating..\n");
+
+	// close the connection and socket
+	if (close(pnf_p7->p7_sock) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "close failed errno: %d\n", errno);
+	}
+
+	if(pthread_mutex_destroy(&(pnf_p7->pack_mutex)) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "mutex destroy failed errno: %d\n", errno);
+	}
+
+	if(pthread_mutex_destroy(&(pnf_p7->mutex)) != 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "mutex destroy failed errno: %d\n", errno);
+	}
+
+	return 0;
+}
diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7_interface.c b/nfapi/open-nFAPI/pnf/src/pnf_p7_interface.c
new file mode 100644
index 0000000000000000000000000000000000000000..74de5e5d785e5d251dfcc65133fd2154219b7641
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf/src/pnf_p7_interface.c
@@ -0,0 +1,225 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "pnf_p7.h"
+#include <stdlib.h>
+#include <string.h>
+
+nfapi_pnf_p7_config_t* nfapi_pnf_p7_config_create()
+{
+	pnf_p7_t* _this = (pnf_p7_t*)calloc(1, sizeof(pnf_p7_t));
+
+	if(_this == 0)
+		return 0;
+
+
+	// set the default parameters
+	_this->_public.segment_size = 1400;
+	_this->max_num_segments = 8;
+	
+	_this->_public.subframe_buffer_size = 8;
+	_this->_public.timing_info_mode_periodic = 1;
+	_this->_public.timing_info_period = 32;
+	_this->_public.timing_info_mode_aperiodic = 1;
+	
+	_this->_public.checksum_enabled = 1;
+	
+	_this->_public.malloc = &malloc;
+	_this->_public.free = &free;	
+
+	_this->_public.codec_config.allocate = &malloc;
+	_this->_public.codec_config.deallocate = &free;
+
+	return &(_this->_public);
+}
+
+void nfapi_pnf_p7_config_destory(nfapi_pnf_p7_config_t* config)
+{
+	if(config == 0)
+		return ;
+
+	free(config);
+}
+
+
+
+int nfapi_pnf_p7_start(nfapi_pnf_p7_config_t* config)
+{
+	// Verify that config is not null
+	if(config == 0)
+		return -1;
+
+	// Make sure to set the defined trace function before using NFAPI_TRACE
+	if(config->trace)
+		nfapi_trace_g = config->trace;
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+
+	pnf_p7_message_pump(_this);
+
+	return 0;
+}
+
+int nfapi_pnf_p7_stop(nfapi_pnf_p7_config_t* config)
+{
+	// Verify that config is not null
+	if(config == 0)
+		return -1;
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	_this->terminate = 1;
+
+	return 0;
+}
+
+
+int nfapi_pnf_p7_subframe_ind(nfapi_pnf_p7_config_t* config, uint16_t phy_id, uint16_t sfn_sf)
+{
+	// Verify that config is not null
+	if(config == 0)
+		return -1;
+	
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+
+	return pnf_p7_subframe_ind(_this, phy_id, sfn_sf);
+}
+
+int nfapi_pnf_p7_harq_ind(nfapi_pnf_p7_config_t* config, nfapi_harq_indication_t* ind)
+{
+	if(config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+
+	return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_harq_indication_t));
+}
+int nfapi_pnf_p7_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_crc_indication_t* ind)
+{
+	if(config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_crc_indication_t));
+}
+int nfapi_pnf_p7_rx_ind(nfapi_pnf_p7_config_t* config, nfapi_rx_indication_t* ind)
+{
+	if(config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_rx_indication_t));
+}
+int nfapi_pnf_p7_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_rach_indication_t* ind)
+{
+	if(config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_rach_indication_t));
+}
+int nfapi_pnf_p7_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_srs_indication_t* ind)
+{
+	if(config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_srs_indication_t));
+}
+int nfapi_pnf_p7_sr_ind(nfapi_pnf_p7_config_t* config, nfapi_sr_indication_t* ind)
+{
+	if(config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_sr_indication_t));
+}
+int nfapi_pnf_p7_cqi_ind(nfapi_pnf_p7_config_t* config, nfapi_cqi_indication_t* ind)
+{
+	if(config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_cqi_indication_t));
+}
+int nfapi_pnf_p7_lbt_dl_ind(nfapi_pnf_p7_config_t* config, nfapi_lbt_dl_indication_t* ind)
+{
+	if(config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_lbt_dl_indication_t));
+}
+int nfapi_pnf_p7_nb_harq_ind(nfapi_pnf_p7_config_t* config, nfapi_nb_harq_indication_t* ind)
+{
+	if(config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_nb_harq_indication_t));
+}
+int nfapi_pnf_p7_nrach_ind(nfapi_pnf_p7_config_t* config, nfapi_nrach_indication_t* ind)
+{
+	if(config == NULL || ind == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_nrach_indication_t));
+}
+int nfapi_pnf_p7_vendor_extension(nfapi_pnf_p7_config_t* config, nfapi_p7_message_header_t* msg)
+{
+	if(config == NULL || msg == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return -1;
+	}
+
+	pnf_p7_t* _this = (pnf_p7_t*)(config);
+	return pnf_p7_pack_and_send_p7_message(_this, msg, 0);
+}
+
diff --git a/nfapi/open-nFAPI/pnf/tests/Makefile.am b/nfapi/open-nFAPI/pnf/tests/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..4dcdea0511f8997ad211b3d97ffb45af0904a4f7
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf/tests/Makefile.am
@@ -0,0 +1,28 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+#nfapi unit test
+AUTOMAKE_OPTIONS=subdir-objects
+AM_CPPFLAGS = -I$(top_srcdir)/nfapi/inc -I$(top_srcdir)/nfapi/public_inc  -I$(top_srcdir)/common/public_inc -I$(top_srcdir)/pnf/public_inc $(CFLAGS_CUNIT) -Wall -Werror
+
+check_PROGRAMS= test_pnf
+
+test_pnf_SOURCES = pnf_cunit_main.c ../../common/src/debug.c   
+test_pnf_LDADD=$(top_builddir)/pnf/libnfapi_pnf.a $(top_builddir)/nfapi/libnfapi.a -L$(libdir) -lpthread -lrt -lsctp -lz -lcunit
+
+LOG_DRIVER = $(top_srcdir)/tap-driver.sh
+TESTS=$(check_PROGRAMS)
+EXTRA_DIST = $(TESTS)
diff --git a/nfapi/open-nFAPI/pnf/tests/pnf_cunit_main.c b/nfapi/open-nFAPI/pnf/tests/pnf_cunit_main.c
new file mode 100644
index 0000000000000000000000000000000000000000..d2ab031ad4708000942e490df8a0cd0b64276bb8
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf/tests/pnf_cunit_main.c
@@ -0,0 +1,2365 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "CUnit.h"
+
+#include "Basic.h"
+#include "Automated.h"
+//#include "CUnit/Console.h"
+
+#include "nfapi_interface.h"
+#include "nfapi_pnf_interface.h"
+#include "nfapi.h"
+#include <stdio.h>  // for printf
+#include <stdlib.h>
+#include <pthread.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netinet/sctp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <unistd.h>
+#include "debug.h"
+
+/* Test Suite setup and cleanup functions: */
+
+int init_suite(void) { return 0; }
+int clean_suite(void) { return 0; }
+
+#define MAX_PACKED_MESSAGE_SIZE	8192
+
+typedef struct phy_info
+{
+	uint8_t enabled;
+	uint16_t phy_id;
+	uint16_t sfn_sf;
+
+	pthread_t thread;
+
+	int pnf_p7_port;
+	char* pnf_p7_addr;
+
+	int vnf_p7_port;
+	char* vnf_p7_addr;
+
+	nfapi_pnf_p7_config_t* config;
+
+} phy_info_t;
+
+typedef struct pnf_info
+{
+	uint8_t num_phys;
+	phy_info_t phys[8];
+
+} pnf_info_t;
+
+phy_info_t* find_phy_info(pnf_info_t* pnf, uint16_t phy_id)
+{
+	int i = 0;
+	for(i = 0; i < 8; ++i)
+	{
+		if(pnf->phys[i].enabled == 1 && pnf->phys[i].phy_id == phy_id)
+		{
+			return &(pnf->phys[i]);
+		}
+	}
+	return 0;
+}
+
+
+
+/************* Test case functions ****************/
+
+void pnf_test_start_no_config(void) 
+{
+	int result = nfapi_pnf_start(0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+
+void test_trace(nfapi_trace_level_t level, const char* message, ...)
+{
+	printf("%s", message);
+}
+
+
+void* pnf_test_start_thread(void* ptr)
+{
+	int result = nfapi_pnf_start((nfapi_pnf_config_t*)ptr);
+	return (void*)(intptr_t)result;
+}
+
+void* pnf_test_start_p7_thread(void* ptr)
+{
+	int result = nfapi_pnf_p7_start((nfapi_pnf_p7_config_t*)ptr);
+	return (void*)(intptr_t)result;
+}
+
+void pnf_test_start_no_connection(void) 
+{
+	char* vnf_addr = "127.127.0.1";
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+	config->vnf_ip_addr = vnf_addr;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &pnf_test_start_thread, config);
+
+	sleep(1);
+
+	nfapi_pnf_stop(config);
+
+	int* result;
+	pthread_join(thread, (void**)&result);
+	CU_ASSERT_EQUAL(result, 0);
+}
+
+void pnf_test_start_no_ip(void) 
+{
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &pnf_test_start_thread, config);
+
+	sleep(2);
+
+	nfapi_pnf_stop(config);
+
+	intptr_t result;
+	pthread_join(thread, (void**)&result);
+	CU_ASSERT_EQUAL((int)result, -1);
+}
+
+void pnf_test_start_invalid_ip(void) 
+{
+	char* vnf_addr = "not.an.ip.address";
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+	config->vnf_ip_addr = vnf_addr;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &pnf_test_start_thread, config);
+
+	sleep(2);
+
+	nfapi_pnf_stop(config);
+
+	intptr_t result;
+	pthread_join(thread, (void**)&result);
+	CU_ASSERT_EQUAL((int)result, -1);
+}
+
+int create_p5_listen_socket(char* ip, int port)
+{
+	int p5ListenSock = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP);
+	
+	struct sockaddr_in addr;
+	addr.sin_family = AF_INET;
+	addr.sin_port = htons(port);
+	addr.sin_addr.s_addr = INADDR_ANY;
+
+	// bind to the configured address and port
+	bind(p5ListenSock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
+
+	return p5ListenSock;
+}
+int create_p5_ipv6_listen_socket(char* ip, int port)
+{
+	struct addrinfo hints, *servinfo;
+	memset(&hints, 0, sizeof(hints));
+	hints.ai_socktype = SOCK_STREAM; // For SCTP we are only interested in SOCK_STREAM
+	hints.ai_family= AF_INET6;
+
+	char port_str[8];
+	snprintf(port_str, sizeof(port_str), "%d", port);
+	getaddrinfo(ip, port_str,  &hints, &servinfo);
+
+
+	int p5ListenSock = socket(AF_INET6, SOCK_STREAM, IPPROTO_SCTP);
+	//printf("Socket result %d\n", p5ListenSock);
+	
+	// bind to the configured address and port
+	/*int bind_result = */
+	bind(p5ListenSock, servinfo->ai_addr, servinfo->ai_addrlen);
+	//printf("Bind result %d (errno:%d)\n", bind_result, errno);
+
+	freeaddrinfo(servinfo);
+
+	return p5ListenSock;
+}
+
+/*
+int wait_for_pnf_connection(int p5ListenSock)
+{
+	listen(p5ListenSock, 2);
+	socklen_t addrSize;
+	int	p5Sock = accept(p5ListenSock, (struct sockaddr *)&addr, &addrSize);
+
+	return p5Sock;
+}
+*/
+
+int test_param_request_called = 0;
+int test_pnf_param_request(nfapi_pnf_config_t* config, nfapi_pnf_param_request_t* req)
+{
+	printf("test_pnf_param_request called.... ;-)\n");
+	
+	nfapi_pnf_param_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_PARAM_RESPONSE;
+
+	resp.pnf_param_general.tl.tag = NFAPI_PNF_PARAM_GENERAL_TAG;
+	resp.pnf_param_general.nfapi_sync_mode = 2;
+	resp.pnf_param_general.location_mode = 1;
+	resp.pnf_param_general.location_coordinates[0] = 123;
+	resp.pnf_param_general.dl_config_timing = 12;
+	resp.pnf_param_general.tx_timing = 12;
+	resp.pnf_param_general.ul_config_timing = 12;
+	resp.pnf_param_general.hi_dci0_timing = 12;
+	resp.pnf_param_general.maximum_number_phys = 2;
+	resp.pnf_param_general.maximum_total_bandwidth = 100;
+	resp.pnf_param_general.maximum_total_number_dl_layers = 2;
+	resp.pnf_param_general.maximum_total_number_ul_layers = 2;
+	resp.pnf_param_general.shared_bands = 0;
+	resp.pnf_param_general.shared_pa = 0;
+	resp.pnf_param_general.maximum_total_power = -190;
+	resp.pnf_param_general.oui[0] = 88;
+/*
+	in.pnf_phy.tl.tag = NFAPI_PNF_PHY_TAG;
+	in.pnf_phy.number_of_phys = 2;
+	in.pnf_phy.phy[0].phy_config_index = 0;
+	in.pnf_phy.phy[0].number_of_rfs = 2;
+	in.pnf_phy.phy[0].rf_config[0].rf_config_index = 0;
+	in.pnf_phy.phy[0].number_of_rf_exclusions = 1;
+	in.pnf_phy.phy[0].rf_config[0].rf_config_index = 1;
+	in.pnf_phy.phy[0].downlink_channel_bandwidth_supported = 20;
+	in.pnf_phy.phy[0].uplink_channel_bandwidth_supported = 20;
+	in.pnf_phy.phy[0].number_of_dl_layers_supported = 2;
+	in.pnf_phy.phy[0].number_of_ul_layers_supported = 1;
+	in.pnf_phy.phy[0].maximum_3gpp_release_supported = 3;
+	in.pnf_phy.phy[0].nmm_modes_supported = 2;
+
+	in.pnf_rf.tl.tag = NFAPI_PNF_RF_TAG;
+	in.pnf_rf.number_of_rfs = 2;
+	in.pnf_rf.rf[0].rf_config_index = 0;
+	in.pnf_rf.rf[0].band = 1;
+	in.pnf_rf.rf[0].maximum_transmit_power = -100; 
+	in.pnf_rf.rf[0].minimum_transmit_power = -90; 
+	in.pnf_rf.rf[0].number_of_antennas_suppported = 4;
+	in.pnf_rf.rf[0].minimum_downlink_frequency = 100;
+	in.pnf_rf.rf[0].maximum_downlink_frequency = 2132;
+	in.pnf_rf.rf[0].minimum_uplink_frequency = 1231;
+	in.pnf_rf.rf[0].maximum_uplink_frequency = 123;
+
+
+	in.pnf_phy_rel10.tl.tag = NFAPI_PNF_PHY_REL10_TAG;
+	in.pnf_phy_rel10.number_of_phys = 2;
+	in.pnf_phy_rel10.phy[0].phy_config_index = 0;
+	in.pnf_phy_rel10.phy[0].transmission_mode_7_supported = 1;
+	in.pnf_phy_rel10.phy[0].transmission_mode_8_supported = 2;
+	in.pnf_phy_rel10.phy[0].two_antenna_ports_for_pucch = 3;
+	in.pnf_phy_rel10.phy[0].transmission_mode_9_supported = 4;
+	in.pnf_phy_rel10.phy[0].simultaneous_pucch_pusch = 5;
+	in.pnf_phy_rel10.phy[0].four_layer_tx_with_tm3_and_tm4 = 6;
+
+	in.pnf_phy_rel11.tl.tag = NFAPI_PNF_PHY_REL11_TAG;
+	in.pnf_phy_rel11.number_of_phys = 2;
+	in.pnf_phy_rel11.phy[0].phy_config_index = 0;
+	in.pnf_phy_rel11.phy[0].edpcch_supported = 1;
+	in.pnf_phy_rel11.phy[0].multi_ack_csi_reporting = 2;
+	in.pnf_phy_rel11.phy[0].pucch_tx_diversity = 3;
+	in.pnf_phy_rel11.phy[0].ul_comp_supported = 4;
+	in.pnf_phy_rel11.phy[0].transmission_mode_5_supported = 5;
+
+	in.pnf_phy_rel12.tl.tag = NFAPI_PNF_PHY_REL12_TAG;
+	in.pnf_phy_rel12.number_of_phys = 2;
+	in.pnf_phy_rel12.phy[0].phy_config_index = 0;
+	in.pnf_phy_rel12.phy[0].csi_subframe_set = 1;
+	in.pnf_phy_rel12.phy[0].enhanced_4tx_codebook = 2;
+	in.pnf_phy_rel12.phy[0].drs_supported = 3;
+	in.pnf_phy_rel12.phy[0].ul_64qam_supported = 4;
+	in.pnf_phy_rel12.phy[0].transmission_mode_10_supported = 5;
+	in.pnf_phy_rel12.phy[0].alternative_bts_indices = 6;
+
+	in.pnf_phy_rel13.tl.tag = NFAPI_PNF_PHY_REL13_TAG;
+	in.pnf_phy_rel13.number_of_phys = 2;
+	in.pnf_phy_rel13.phy[0].phy_config_index = 0;
+	in.pnf_phy_rel13.phy[0].pucch_format4_supported = 1;
+	in.pnf_phy_rel13.phy[0].pucch_format5_supported = 2;
+	in.pnf_phy_rel13.phy[0].more_than_5_ca_support = 3;
+	in.pnf_phy_rel13.phy[0].laa_supported = 4;
+	in.pnf_phy_rel13.phy[0].laa_ending_in_dwpts_supported = 5;
+	in.pnf_phy_rel13.phy[0].laa_starting_in_second_slot_supported = 6;
+	in.pnf_phy_rel13.phy[0].beamforming_supported = 7;
+	in.pnf_phy_rel13.phy[0].csi_rs_enhancement_supported = 8;
+	in.pnf_phy_rel13.phy[0].drms_enhancement_supported = 9;
+	in.pnf_phy_rel13.phy[0].srs_enhancement_supported = 10;
+*/
+	test_param_request_called++;
+
+	nfapi_pnf_pnf_param_resp(config, &resp);
+	return 0;
+}
+
+int test_config_request_called = 0;
+int test_pnf_config_request(nfapi_pnf_config_t* config, nfapi_pnf_config_request_t* req)
+{
+	printf("test_pnf_config_request called.... ;-)\n");
+
+	CU_ASSERT_EQUAL(req->pnf_phy_rf_config.tl.tag, NFAPI_PNF_PHY_RF_TAG);
+
+	if(config->user_data != 0)
+	{
+		pnf_info_t* pnf = (pnf_info_t*)(config->user_data);	
+		int i = 0;
+		for(i = 0; i < req->pnf_phy_rf_config.number_phy_rf_config_info; ++i)
+		{
+			pnf->phys[i].enabled = 1;
+			pnf->phys[i].phy_id = req->pnf_phy_rf_config.phy_rf_config[i].phy_id;
+			printf("test_pnf_config_request creating phy %d\n", pnf->phys[i].phy_id);
+
+		}
+	}
+	
+	nfapi_pnf_config_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_CONFIG_RESPONSE;
+	resp.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_pnf_config_resp(config, &resp);
+
+	test_config_request_called++;
+	return 0;
+}
+int test_pnf_start_request(nfapi_pnf_config_t* config, nfapi_pnf_start_request_t* req)
+{
+	printf("test_pnf_start_request called.... ;-)\n");
+
+	nfapi_pnf_start_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_START_RESPONSE;
+	resp.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_pnf_start_resp(config, &resp);
+	return 0;
+}
+int test_pnf_stop_request(nfapi_pnf_config_t* config, nfapi_pnf_stop_request_t* req)
+{
+	printf("test_pnf_stop_request called.... ;-)\n");
+
+	nfapi_pnf_stop_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_STOP_RESPONSE;
+	resp.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_pnf_stop_resp(config, &resp);
+	return 0;
+}
+int test_param_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_param_request_t* req)
+{
+	printf("test_param_request called.... ;-)\n");
+
+	nfapi_param_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PARAM_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_MSG_OK;
+
+	if(config->user_data != 0)
+	{
+		phy_info_t* phy_info = find_phy_info((pnf_info_t*)(config->user_data), req->header.phy_id);	
+
+		resp.nfapi_config.p7_pnf_port.tl.tag = NFAPI_NFAPI_P7_PNF_PORT_TAG;
+		resp.nfapi_config.p7_pnf_port.value = phy_info->pnf_p7_port;
+		resp.num_tlv++;
+
+		resp.nfapi_config.p7_pnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_PNF_PORT_TAG;
+		struct sockaddr_in pnf_p7_sockaddr;
+		pnf_p7_sockaddr.sin_addr.s_addr = inet_addr(phy_info->pnf_p7_addr);
+		memcpy(&(resp.nfapi_config.p7_pnf_address_ipv4.address[0]), &pnf_p7_sockaddr.sin_addr.s_addr, 4);
+		resp.num_tlv++;
+	}
+
+
+
+
+	nfapi_pnf_param_resp(config, &resp);
+	return 0;
+}
+int test_config_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_config_request_t* req)
+{
+	printf("test_config_request called.... ;-)\n");
+
+	if(config->user_data != 0)
+	{
+		phy_info_t* phy_info = find_phy_info((pnf_info_t*)(config->user_data), req->header.phy_id);
+
+		if(req->nfapi_config.p7_vnf_port.tl.tag == NFAPI_NFAPI_P7_VNF_PORT_TAG)
+		{
+			phy_info->vnf_p7_port = req->nfapi_config.p7_vnf_port.value;
+			printf("vnf_p7_port %d\n", phy_info->vnf_p7_port);
+		}
+
+		if(req->nfapi_config.p7_vnf_address_ipv4.tl.tag == NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG)
+		{
+			struct sockaddr_in addr;
+			memcpy(&addr.sin_addr.s_addr, req->nfapi_config.p7_vnf_address_ipv4.address, 4);
+			char* ip = inet_ntoa(addr.sin_addr);
+			phy_info->vnf_p7_addr = ip;
+			printf("vnf_p7_addr %s\n", phy_info->vnf_p7_addr);
+		}
+
+			
+	}
+
+	nfapi_config_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_CONFIG_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_config_resp(config, &resp);
+	return 0;
+}
+int test_dl_config_req(nfapi_pnf_p7_config_t* config, nfapi_dl_config_request_t* req)
+{
+	printf("test_dl_config_req called.... ;-)\n");
+	return 0;
+}
+
+int test_ul_config_req(nfapi_pnf_p7_config_t* config, nfapi_ul_config_request_t* req)
+{
+	printf("test_ul_config_req called.... ;-)\n");
+	return 0;
+}
+int test_hi_dci0_req(nfapi_pnf_p7_config_t* config, nfapi_hi_dci0_request_t* req)
+{
+	printf("test_hi_dci0_req called.... ;-)\n");
+	return 0;
+}
+int test_tx_req(nfapi_pnf_p7_config_t* config, nfapi_tx_request_t* req)
+{
+	printf("test_tx_req called.... ;-)\n");
+	return 0;
+}
+int test_lbt_dl_config_req(nfapi_pnf_p7_config_t* config, nfapi_lbt_dl_config_request_t* req)
+{
+	printf("test_lbt_dl_req called.... ;-)\n");
+	return 0;
+}
+int test_start_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_start_request_t* req)
+{
+	printf("test_start_request called.... ;-)\n");
+
+
+	if(config->user_data != 0)
+	{
+		phy_info_t* phy_info = find_phy_info((pnf_info_t*)(config->user_data), req->header.phy_id);
+
+		phy_info->config = nfapi_pnf_p7_config_create();
+		phy_info->config->local_p7_port = phy_info->pnf_p7_port;
+
+		phy_info->config->remote_p7_port = phy_info->vnf_p7_port;
+		phy_info->config->remote_p7_addr = phy_info->vnf_p7_addr;
+
+		phy_info->config->dl_config_req = &test_dl_config_req;
+		phy_info->config->ul_config_req = &test_ul_config_req;
+		phy_info->config->hi_dci0_req = &test_hi_dci0_req;
+		phy_info->config->tx_req = &test_tx_req;
+		phy_info->config->lbt_dl_config_req = &test_lbt_dl_config_req;
+
+		//phy_info->config->subframe_buffer_size = 8;
+		//phy_info->config->timing_info_mode_periodic = 1;
+		//phy_info->config->timing_info_period = 32;
+		//phy_info->config->timing_info_mode_aperiodic = 1;
+
+		phy_info->config->segment_size = 1400;
+		phy_info->config->checksum_enabled = 0;
+
+
+		pthread_create(&phy_info->thread, NULL, &pnf_test_start_p7_thread, phy_info->config);
+	}
+
+	nfapi_start_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_START_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_start_resp(config, &resp);
+	return 0;
+}
+int test_stop_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_stop_request_t* req)
+{
+	printf("test_stop_request called.... ;-)\n");
+
+	nfapi_stop_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_STOP_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_stop_resp(config, &resp);
+	return 0;
+}
+
+int send_p5_message(int p5Sock, nfapi_p4_p5_message_header_t* msg, unsigned msg_size, struct sockaddr* addr, socklen_t addr_size)
+{
+	char buffer[256];
+	int encoded_size = nfapi_p5_message_pack(msg, msg_size, buffer, sizeof(buffer), 0);
+	int result  = sendto(p5Sock, buffer, encoded_size, 0, addr, addr_size);
+	return result;
+}
+
+int send_p7_message(int p7Sock, nfapi_p7_message_header_t* msg, unsigned msg_size, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	char buffer[256];
+	int encoded_size = nfapi_p7_message_pack(msg, buffer, sizeof(buffer), 0);
+	int result = sendto(p7Sock, buffer, encoded_size, 0, (struct sockaddr*)addr, addr_size);
+
+	printf("send_p7_message result %d\n", result);
+	return result;
+}
+int send_p7_segmented_message(int p7Sock, nfapi_p7_message_header_t* msg, unsigned msg_size, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	char buffer[1024 * 10];
+	int encoded_size = nfapi_p7_message_pack(msg, buffer, sizeof(buffer), 0);
+
+	uint16_t segment_size = 256;
+
+	if(encoded_size < segment_size)
+	{
+		int result = sendto(p7Sock, buffer, encoded_size, 0, (struct sockaddr*)addr, addr_size);
+		return result;
+	}
+	else
+	{
+	//	printf("Segmenting p7 message %d\n", encoded_size);
+
+		uint8_t segment_count = 0;
+		uint8_t buffer2[segment_size];
+		uint32_t offset = 0;
+		uint16_t msg_size;
+		//uint8_t m = 1;
+
+		do{
+
+			if(segment_count == 0)
+			{
+				msg_size = segment_size;
+				memcpy(&buffer2[0], &buffer[0], msg_size);
+				// M = 1
+				buffer2[6] = (1 << 7) | (segment_count & 0x7F);
+
+				offset = msg_size;
+			}
+			else
+			{
+				memcpy(&buffer2[0], &buffer[0], NFAPI_P7_HEADER_LENGTH);
+
+				if(encoded_size - offset > segment_size)
+				{
+					// M = 1
+					buffer2[6] = (1 << 7) | (segment_count & 0x7F);
+					msg_size = segment_size;
+				}
+				else
+				{
+					// M = 0
+					buffer2[6] = (0 << 7) | (segment_count & 0x7F);
+					msg_size = encoded_size - offset + NFAPI_P7_HEADER_LENGTH;
+				}
+
+
+				memcpy(&buffer2[NFAPI_P7_HEADER_LENGTH], &buffer[offset], msg_size - NFAPI_P7_HEADER_LENGTH);
+			
+				offset += msg_size - NFAPI_P7_HEADER_LENGTH;
+			}
+
+			uint8_t* p = &buffer2[4];
+			push16(msg_size, &p, &buffer2[segment_size]);
+
+		//printf("Segmenting p7 message %d %di %d\n", segment_count, msg_size, offset);
+			/*int result = */sendto(p7Sock, buffer2, msg_size, 0, (struct sockaddr*)addr, addr_size);
+
+			segment_count++;
+
+		}while(offset < encoded_size);
+
+	}
+
+	return 0;
+}
+int send_p7_segmented_message_outoforder(int p7Sock, nfapi_p7_message_header_t* msg, unsigned msg_size, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	char buffer[1024 * 10];
+	int encoded_size = nfapi_p7_message_pack(msg, buffer, sizeof(buffer), 0);
+
+	uint16_t segment_size = 256;
+
+	if(encoded_size < segment_size)
+	{
+		int result = sendto(p7Sock, buffer, encoded_size, 0, (struct sockaddr*)addr, addr_size);
+		return result;
+	}
+	else
+	{
+	//	printf("Segmenting p7 message %d\n", encoded_size);
+
+		uint8_t segment_count = 0;
+		uint8_t buffer2[128][segment_size];
+		uint32_t offset = 0;
+		uint16_t msg_size[128];
+		uint8_t i = 0;
+
+		do{
+
+			if(segment_count == 0)
+			{
+				msg_size[i] = segment_size;
+				memcpy(&buffer2[i][0], &buffer[0], msg_size[i]);
+				// M = 1
+				buffer2[i][6] = (1 << 7) | (segment_count & 0x7F);
+
+				offset = msg_size[i];
+			}
+			else
+			{
+				memcpy(&buffer2[i][0], &buffer[0], NFAPI_P7_HEADER_LENGTH);
+
+				if(encoded_size - offset > segment_size)
+				{
+					// M = 1
+					buffer2[i][6] = (1 << 7) | (segment_count & 0x7F);
+					msg_size[i] = segment_size;
+				}
+				else
+				{
+					// M = 0
+					buffer2[i][6] = (0 << 7) | (segment_count & 0x7F);
+					msg_size[i] = encoded_size - offset + NFAPI_P7_HEADER_LENGTH;
+				}
+
+
+				memcpy(&buffer2[i][NFAPI_P7_HEADER_LENGTH], &buffer[offset], msg_size[i] - NFAPI_P7_HEADER_LENGTH);
+			
+				offset += msg_size[i] - NFAPI_P7_HEADER_LENGTH;
+			}
+
+			uint8_t* p = &buffer2[i][4];
+			push16(msg_size[i], &p, &buffer2[i][segment_size]);
+
+
+			segment_count++;
+			i++;
+
+		}while(offset < encoded_size);
+
+		// send all odd then send event
+		uint8_t e = 0;
+		uint8_t o = 1;
+		while(o <= i)
+		{
+			sendto(p7Sock, &buffer2[o][0], msg_size[o], 0, (struct sockaddr*)addr, addr_size);
+			o += 2;
+		}
+		while(e <= i)
+		{
+			sendto(p7Sock, &buffer2[e][0], msg_size[e], 0, (struct sockaddr*)addr, addr_size);
+			e += 2;
+		}
+
+	}
+
+	return 0;
+}
+
+int get_p7_segmented_message(int p7Sock, nfapi_p7_message_header_t* msg, unsigned _msg_size, struct sockaddr_in* addr, socklen_t addr_size, uint8_t (buffer2)[][256], uint16_t msg_size[256], uint8_t i)
+{
+	char buffer[1024 * 10];
+	int encoded_size = nfapi_p7_message_pack(msg, buffer, sizeof(buffer), 0);
+
+	uint16_t segment_size = 256;
+
+	printf("get_p7_segmented_message size %d\n", encoded_size);
+
+	if(encoded_size < segment_size)
+	{
+		msg_size[i] = encoded_size;
+		memcpy(&buffer2[i][0], &buffer[0], msg_size[i]);
+		i++;
+	}
+	else
+	{
+		uint8_t segment_count = 0;
+		uint32_t offset = 0;
+
+		do{
+
+			if(segment_count == 0)
+			{
+				msg_size[i] = segment_size;
+				memcpy(&buffer2[i][0], &buffer[0], msg_size[i]);
+				// M = 1
+				(buffer2[i][6]) = (1 << 7) | (segment_count & 0x7F);
+
+				offset = msg_size[i];
+			}
+			else
+			{
+				memcpy(&buffer2[i][0], &buffer[0], NFAPI_P7_HEADER_LENGTH);
+
+				if(encoded_size - offset > segment_size)
+				{
+					// M = 1
+					(buffer2[i][6]) = (1 << 7) | (segment_count & 0x7F);
+					msg_size[i] = segment_size;
+				}
+				else
+				{
+					// M = 0
+					(buffer2[i][6]) = (0 << 7) | (segment_count & 0x7F);
+					msg_size[i] = encoded_size - offset + NFAPI_P7_HEADER_LENGTH;
+				}
+
+
+				memcpy(&buffer2[i][NFAPI_P7_HEADER_LENGTH], &buffer[offset], msg_size[i] - NFAPI_P7_HEADER_LENGTH);
+			
+				offset += msg_size[i] - NFAPI_P7_HEADER_LENGTH;
+			}
+
+			uint8_t* p = &buffer2[i][4];
+			push16(msg_size[i], &p, &buffer2[i][segment_size]);
+
+
+			segment_count++;
+			i++;
+
+		}while(offset < encoded_size);
+
+	}
+
+	return i;
+}
+
+
+int recv_p5_message(int p5Sock, nfapi_p4_p5_message_header_t* msg, unsigned msg_size)
+{
+	//struct sockaddr_in addr2;
+	//socklen_t addr2len;
+	char buffer2[1024];
+	int result2 = recv(p5Sock, buffer2, sizeof(buffer2), 0); //, (struct sockaddr*)&addr2, &addr2len); 
+
+	if(result2 == -1)
+	{
+		printf("%s recvfrom failed errno:%d\n", __FUNCTION__, errno);
+	}
+	else
+	{
+		/*int unpack_result =*/ nfapi_p5_message_unpack(buffer2, result2, msg, msg_size, 0); //, sizeof(resp));
+	}
+	return 0;
+}
+
+int recv_p7_message(int p7Sock, nfapi_p7_message_header_t* msg, unsigned msg_size)
+{
+	char buffer2[2560];
+	int result2 = recvfrom(p7Sock, buffer2, sizeof(buffer2), 0, 0, 0);
+
+	if(result2 == -1)
+	{
+		printf("%s recvfrom failed errno:%d\n", __FUNCTION__, errno);
+	}
+	else
+	{
+		/*int unpack_result =*/ nfapi_p7_message_unpack(buffer2, result2, msg, msg_size, 0); //, sizeof(resp));
+	}
+	return 0;
+}
+
+int send_pnf_param_request(int p5Sock, struct sockaddr* addr, socklen_t addr_size)
+{
+	printf("%s\n", __FUNCTION__);
+	nfapi_pnf_param_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_PNF_PARAM_REQUEST;
+	req.header.message_length = 0;
+
+	send_p5_message(p5Sock, &(req.header), sizeof(req), addr, addr_size);
+	return 0;
+}
+
+int receive_pnf_param_response(int p5Sock, uint8_t error_code)
+{
+	nfapi_pnf_param_response_t resp;
+	recv_p5_message(p5Sock, &(resp.header), sizeof(resp));
+
+		printf("0x%x\n", resp.header.message_id);
+	CU_ASSERT_EQUAL(resp.header.message_id, NFAPI_PNF_PARAM_RESPONSE);
+	if(resp.header.message_id == NFAPI_PNF_PARAM_RESPONSE)
+	{
+		printf("decoded nfapi_pnf_param_response\n");
+		CU_ASSERT_EQUAL(resp.error_code, error_code);
+		if(error_code == NFAPI_MSG_OK)
+		{
+			CU_ASSERT_EQUAL(resp.pnf_param_general.tl.tag, NFAPI_PNF_PARAM_GENERAL_TAG);
+			CU_ASSERT_EQUAL(resp.pnf_param_general.nfapi_sync_mode,  2);
+			CU_ASSERT_EQUAL(resp.pnf_param_general.location_mode, 1);
+		}
+	}
+	return 0;
+}
+
+int send_pnf_config_request(int p5Sock, struct sockaddr* addr, socklen_t addr_size)
+{
+	nfapi_pnf_config_request_t req;
+	req.header.message_id = NFAPI_PNF_CONFIG_REQUEST;
+	req.header.message_length = 0;
+
+	req.pnf_phy_rf_config.tl.tag = NFAPI_PNF_PHY_RF_TAG;
+	req.pnf_phy_rf_config.number_phy_rf_config_info = 1;
+	req.pnf_phy_rf_config.phy_rf_config[0].phy_id = 0;
+
+	send_p5_message(p5Sock, &(req.header), sizeof(req), addr, addr_size);
+	return 0;
+}
+
+int receive_pnf_config_response(int p5Sock)
+{
+	nfapi_pnf_config_response_t resp;
+	recv_p5_message(p5Sock, &(resp.header), sizeof(resp));
+	
+	CU_ASSERT_EQUAL(resp.header.message_id, NFAPI_PNF_CONFIG_RESPONSE);
+	if(resp.header.message_id == NFAPI_PNF_CONFIG_RESPONSE)
+	{
+		printf("decoded nfapi_pnf_config_response\n");
+	}
+	return 0;
+}
+
+void send_pnf_start_request(int p5Sock,  struct sockaddr* addr, socklen_t addr_size)
+{
+	nfapi_pnf_start_request_t req;
+	req.header.message_id = NFAPI_PNF_START_REQUEST;
+	req.header.message_length = 0;
+
+	send_p5_message(p5Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+
+void receive_pnf_start_response(int p5Sock)
+{
+	nfapi_pnf_start_response_t resp;
+	recv_p5_message(p5Sock, &(resp.header), sizeof(resp));
+	
+	CU_ASSERT_EQUAL(resp.header.message_id, NFAPI_PNF_START_RESPONSE);
+	if(resp.header.message_id == NFAPI_PNF_START_RESPONSE)
+	{
+		printf("decoded nfapi_pnf_start_response\n");
+	}
+}
+
+void send_pnf_stop_request(int p5Sock,  struct sockaddr* addr, socklen_t addr_size)
+{
+	nfapi_pnf_stop_request_t req;
+	req.header.message_id = NFAPI_PNF_STOP_REQUEST;
+	req.header.message_length = 0;
+
+	send_p5_message(p5Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+
+void receive_pnf_stop_response(int p5Sock)
+{
+	nfapi_pnf_stop_response_t resp;
+	recv_p5_message(p5Sock, &(resp.header), sizeof(resp));
+	
+	CU_ASSERT_EQUAL(resp.header.message_id, NFAPI_PNF_STOP_RESPONSE);
+	if(resp.header.message_id == NFAPI_PNF_STOP_RESPONSE)
+	{
+		printf("decoded nfapi_pnf_stop_response\n");
+	}
+}
+
+void send_param_request(int p5Sock, int phy_id, struct sockaddr* addr, socklen_t addr_size)
+{
+	nfapi_param_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_PARAM_REQUEST;
+	req.header.phy_id = phy_id;
+
+	send_p5_message(p5Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+void receive_param_response(int p5Sock)
+{
+	nfapi_pnf_stop_response_t resp;
+	recv_p5_message(p5Sock, &(resp.header), sizeof(resp));
+	
+	CU_ASSERT_EQUAL(resp.header.message_id, NFAPI_PARAM_RESPONSE);
+	if(resp.header.message_id == NFAPI_PARAM_RESPONSE)
+	{
+		printf("decoded nfapi_param_response\n");
+	}
+}
+void send_config_request(int p5Sock, int phy_id, struct sockaddr* addr, socklen_t addr_size, pnf_info_t* pnf_info)
+{
+	nfapi_config_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_CONFIG_REQUEST;
+	req.header.phy_id = phy_id;
+
+	phy_info_t* phy_info = find_phy_info(pnf_info, phy_id);
+
+	req.nfapi_config.p7_vnf_port.tl.tag = NFAPI_NFAPI_P7_VNF_PORT_TAG;
+	req.nfapi_config.p7_vnf_port.value = phy_info->vnf_p7_port;
+	req.num_tlv++;
+
+	//req.nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
+	//req.num_tlv++;
+
+	send_p5_message(p5Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+void receive_config_response(int p5Sock)
+{
+	nfapi_pnf_stop_response_t resp;
+	recv_p5_message(p5Sock, &(resp.header), sizeof(resp));
+	
+	CU_ASSERT_EQUAL(resp.header.message_id, NFAPI_CONFIG_RESPONSE);
+	if(resp.header.message_id == NFAPI_CONFIG_RESPONSE)
+	{
+		printf("decoded nfapi_config_response\n");
+	}
+}
+void send_start_request(int p5Sock, int phy_id, struct sockaddr* addr, socklen_t addr_size)
+{
+	nfapi_start_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_START_REQUEST;
+	req.header.phy_id = phy_id;
+
+	send_p5_message(p5Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+void receive_start_response(int p5Sock)
+{
+	nfapi_pnf_start_response_t resp;
+	recv_p5_message(p5Sock, &(resp.header), sizeof(resp));
+	
+	CU_ASSERT_EQUAL(resp.header.message_id, NFAPI_START_RESPONSE);
+	if(resp.header.message_id == NFAPI_START_RESPONSE)
+	{
+		printf("decoded nfapi_start_response\n");
+	}
+}
+void send_stop_request(int p5Sock, int phy_id, struct sockaddr* addr, socklen_t addr_size)
+{
+	nfapi_start_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_STOP_REQUEST;
+	req.header.phy_id = phy_id;
+
+	send_p5_message(p5Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+
+void receive_stop_response(int p5Sock)
+{
+	nfapi_pnf_stop_response_t resp;
+	recv_p5_message(p5Sock, &(resp.header), sizeof(resp));
+	
+	CU_ASSERT_EQUAL(resp.header.message_id, NFAPI_STOP_RESPONSE);
+	if(resp.header.message_id == NFAPI_STOP_RESPONSE)
+	{
+		printf("decoded nfapi_stop_response\n");
+	}
+}
+
+void send_dl_node_sync(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_dl_node_sync_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_DL_NODE_SYNC;
+	req.header.phy_id = phy_id;
+	req.t1 = 1977;
+	req.delta_sfn_sf = 5000;
+
+	send_p7_message(p7Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+void receive_ul_node_sync(int p7Sock)
+{
+	nfapi_ul_node_sync_t sync;
+	recv_p7_message(p7Sock, &(sync.header), sizeof(sync));
+	
+	CU_ASSERT_EQUAL(sync.header.message_id, NFAPI_UL_NODE_SYNC);
+	if(sync.header.message_id == NFAPI_UL_NODE_SYNC)
+	{
+		printf("decoded nfapi_ul_node_sync t1:%d t2:%d t3:%d\n",
+				sync.t1, sync.t2, sync.t3);
+	}
+}
+
+void receive_timing_info(int p7Sock)
+{
+	nfapi_timing_info_t timing_info;
+	recv_p7_message(p7Sock, &(timing_info.header), sizeof(timing_info));
+	
+	CU_ASSERT_EQUAL(timing_info.header.message_id, NFAPI_TIMING_INFO);
+	if(timing_info.header.message_id == NFAPI_TIMING_INFO)
+	{
+		printf("decoded nfapi_timing_info\n");
+	}
+	else
+	{
+		printf("decoded ?? 0x%x\n", timing_info.header.message_id);
+	}
+}
+void send_dl_config_req(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size, uint16_t sfn_sf)
+{
+	nfapi_dl_config_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_DL_CONFIG_REQUEST;
+	req.header.phy_id = phy_id;
+	req.sfn_sf = sfn_sf;
+
+	send_p7_message(p7Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+void send_ul_config_req(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size, uint16_t sfn_sf)
+{
+	nfapi_ul_config_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_UL_CONFIG_REQUEST;
+	req.header.phy_id = phy_id;
+	req.sfn_sf = sfn_sf;
+
+	send_p7_message(p7Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+void send_hi_dci0_req(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size, uint16_t sfn_sf)
+{
+	nfapi_hi_dci0_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_HI_DCI0_REQUEST;
+	req.header.phy_id = phy_id;
+	req.sfn_sf = sfn_sf;
+
+	send_p7_message(p7Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+void send_tx_req(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size, uint16_t sfn_sf)
+{
+	nfapi_tx_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_TX_REQUEST;
+	req.header.phy_id = phy_id;
+	req.sfn_sf = sfn_sf;
+	send_p7_message(p7Sock, &(req.header), sizeof(req), addr, addr_size);
+}
+
+void send_tx_req_1(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size, uint16_t sfn_sf)
+{
+	nfapi_tx_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_TX_REQUEST;
+	req.header.phy_id = phy_id;
+	req.sfn_sf = sfn_sf;
+	req.tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+	req.tx_request_body.number_of_pdus = 8;
+	req.tx_request_body.tx_pdu_list = (nfapi_tx_request_pdu_t*)(malloc(sizeof(nfapi_tx_request_t) * 8));
+	uint8_t i = 0;
+	uint8_t test_pdu[1200];
+
+	for(i = 0; i < 8; i++)
+	{
+		req.tx_request_body.tx_pdu_list[i].pdu_length = sizeof(test_pdu);
+		req.tx_request_body.tx_pdu_list[i].pdu_index = i;
+		req.tx_request_body.tx_pdu_list[i].num_segments =1;
+		req.tx_request_body.tx_pdu_list[i].segments[0].segment_length = sizeof(test_pdu);
+		req.tx_request_body.tx_pdu_list[i].segments[0].segment_data  = (void*)&test_pdu;
+	}
+
+	send_p7_segmented_message(p7Sock, &(req.header), sizeof(req), addr, addr_size);
+
+	free(req.tx_request_body.tx_pdu_list);
+
+}
+
+void send_tx_req_2(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size, uint16_t sfn_sf)
+{
+	nfapi_tx_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_TX_REQUEST;
+	req.header.phy_id = phy_id;
+	req.sfn_sf = sfn_sf;
+	req.tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+	req.tx_request_body.number_of_pdus = 8;
+	req.tx_request_body.tx_pdu_list = (nfapi_tx_request_pdu_t*)(malloc(sizeof(nfapi_tx_request_t) * 8));
+	uint8_t i = 0;
+	uint8_t test_pdu[1200];
+
+	for(i = 0; i < 8; i++)
+	{
+		req.tx_request_body.tx_pdu_list[i].pdu_length = sizeof(test_pdu);
+		req.tx_request_body.tx_pdu_list[i].pdu_index = i;
+		req.tx_request_body.tx_pdu_list[i].num_segments =1;
+		req.tx_request_body.tx_pdu_list[i].segments[0].segment_length = sizeof(test_pdu);
+		req.tx_request_body.tx_pdu_list[i].segments[0].segment_data  = (void*)&test_pdu;
+	}
+
+	send_p7_segmented_message_outoforder(p7Sock, &(req.header), sizeof(req), addr, addr_size);
+
+	free(req.tx_request_body.tx_pdu_list);
+
+}
+void send_dl_subframe_msgs_interleaved(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size, uint16_t sfn_sf)
+{
+
+	uint8_t buffer[256][256];
+	uint16_t msg_size[256];
+	uint16_t count = 0;
+
+	{
+		nfapi_dl_config_request_t req;
+		memset(&req, 0, sizeof(req));
+		req.header.message_id = NFAPI_DL_CONFIG_REQUEST;
+		req.header.phy_id = phy_id;
+		req.header.m_segment_sequence = 34;
+		req.sfn_sf = sfn_sf;
+		req.dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
+		req.dl_config_request_body.number_pdu = 8;
+		req.dl_config_request_body.dl_config_pdu_list = (nfapi_dl_config_request_pdu_t*)malloc(sizeof(nfapi_dl_config_request_pdu_t) * 8);
+
+		uint8_t i = 0;
+		for(i = 0; i < 8; i++)
+		{
+			nfapi_dl_config_request_pdu_t* pdu = &(req.dl_config_request_body.dl_config_pdu_list[i]);
+			pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
+			pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
+		}
+
+
+		count = get_p7_segmented_message(p7Sock, &(req.header), sizeof(req), addr, addr_size, buffer, msg_size, count);
+	}
+
+	{
+		nfapi_ul_config_request_t req;
+		memset(&req, 0, sizeof(req));
+		req.header.message_id = NFAPI_UL_CONFIG_REQUEST;
+		req.header.phy_id = phy_id;
+		req.header.m_segment_sequence = 35;
+		req.sfn_sf = sfn_sf;
+
+		count = get_p7_segmented_message(p7Sock, &(req.header), sizeof(req), addr, addr_size, buffer, msg_size, count);
+	}
+
+	{
+		nfapi_hi_dci0_request_t req;
+		memset(&req, 0, sizeof(req));
+		req.header.message_id = NFAPI_HI_DCI0_REQUEST;
+		req.header.phy_id = phy_id;
+		req.header.m_segment_sequence = 36;
+		req.sfn_sf = sfn_sf;
+		count = get_p7_segmented_message(p7Sock, &(req.header), sizeof(req), addr, addr_size, buffer, msg_size, count);
+	}
+
+	{
+		nfapi_tx_request_t req;
+		memset(&req, 0, sizeof(req));
+		req.header.message_id = NFAPI_TX_REQUEST;
+		req.header.phy_id = phy_id;
+		req.header.m_segment_sequence = 37;
+		req.sfn_sf = sfn_sf;
+		req.tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+		req.tx_request_body.number_of_pdus = 8;
+		req.tx_request_body.tx_pdu_list = (nfapi_tx_request_pdu_t*)(malloc(sizeof(nfapi_tx_request_t) * 8));
+		uint8_t i = 0;
+		uint8_t test_pdu[1200];
+
+		for(i = 0; i < 8; i++)
+		{
+			req.tx_request_body.tx_pdu_list[i].pdu_length = sizeof(test_pdu);
+			req.tx_request_body.tx_pdu_list[i].pdu_index = i;
+			req.tx_request_body.tx_pdu_list[i].num_segments =1;
+			req.tx_request_body.tx_pdu_list[i].segments[0].segment_length = sizeof(test_pdu);
+			req.tx_request_body.tx_pdu_list[i].segments[0].segment_data  = (void*)&test_pdu;
+		}
+
+		count = get_p7_segmented_message(p7Sock, &(req.header), sizeof(req), addr, addr_size, buffer, msg_size, count);
+	}
+
+	// send all odd then send event
+	uint8_t e = 0;
+	uint8_t o = 1;
+	while(o <= count)
+	{
+		if(msg_size[o] == 0)
+			printf("**** Sending a zero length msg %d\n", o);
+		sendto(p7Sock, &buffer[o][0], msg_size[o], 0, (struct sockaddr*)addr, addr_size);
+		o += 2;
+	}
+	while(e <= count)
+	{
+		if(msg_size[e] == 0)
+			printf("**** Sending a zero length msg %d\n", e);
+
+		sendto(p7Sock, &buffer[e][0], msg_size[e], 0, (struct sockaddr*)addr, addr_size);
+		e += 2;
+	}
+	//free(req.tx_request_body.tx_pdu_list);
+}
+
+void send_subframe_indication(phy_info_t* phy_info)
+{
+	nfapi_pnf_p7_subframe_ind(phy_info->config, phy_info->phy_id, phy_info->sfn_sf);
+}
+
+void send_harq_ind(phy_info_t* phy_info, uint16_t sfn_sf)
+{
+	nfapi_harq_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_HARQ_INDICATION;
+	ind.header.phy_id = phy_info->phy_id;
+	ind.sfn_sf = sfn_sf;
+
+	nfapi_pnf_p7_harq_ind((phy_info->config), &ind);
+}
+void recieve_harq_ind(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_harq_indication_t ind;
+	recv_p7_message(p7Sock, &(ind.header), sizeof(ind));
+	
+	CU_ASSERT_EQUAL(ind.header.message_id, NFAPI_HARQ_INDICATION);
+	if(ind.header.message_id == NFAPI_HARQ_INDICATION)
+	{
+		printf("decoded nfapi_harq_indication\n");
+	}
+	else
+	{
+		printf("decoded ?? 0x%x\n", ind.header.message_id);
+	}
+}
+
+void send_crc_ind(phy_info_t* phy_info, uint16_t sfn_sf)
+{
+	nfapi_crc_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_CRC_INDICATION;
+	ind.header.phy_id = phy_info->phy_id;
+	ind.sfn_sf = sfn_sf;
+
+	nfapi_pnf_p7_crc_ind((phy_info->config), &ind);
+
+}
+void recieve_crc_ind(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_crc_indication_t ind;
+	recv_p7_message(p7Sock, &(ind.header), sizeof(ind));
+	
+	CU_ASSERT_EQUAL(ind.header.message_id, NFAPI_CRC_INDICATION);
+	if(ind.header.message_id == NFAPI_CRC_INDICATION)
+	{
+		printf("decoded nfapi_crc_indication\n");
+	}
+}
+
+void send_rx_ind(phy_info_t* phy_info, uint16_t sfn_sf)
+{
+	nfapi_rx_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_RX_ULSCH_INDICATION;
+	ind.header.phy_id = phy_info->phy_id;
+	ind.sfn_sf = sfn_sf;
+
+	nfapi_pnf_p7_rx_ind((phy_info->config), &ind);
+}
+void recieve_rx_ind(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_rx_indication_t ind;
+	recv_p7_message(p7Sock, &(ind.header), sizeof(ind));
+	
+	CU_ASSERT_EQUAL(ind.header.message_id, NFAPI_RX_ULSCH_INDICATION);
+	if(ind.header.message_id == NFAPI_RX_ULSCH_INDICATION)
+	{
+		printf("decoded nfapi_rx_indication\n");
+	}
+}
+
+void send_rach_ind(phy_info_t* phy_info, uint16_t sfn_sf)
+{
+	nfapi_rach_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_RACH_INDICATION;
+	ind.header.phy_id = phy_info->phy_id;
+	ind.sfn_sf = sfn_sf;
+
+	nfapi_pnf_p7_rach_ind((phy_info->config), &ind);
+}
+void recieve_rach_ind(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_rach_indication_t ind;
+	recv_p7_message(p7Sock, &(ind.header), sizeof(ind));
+	
+	CU_ASSERT_EQUAL(ind.header.message_id, NFAPI_RACH_INDICATION);
+	if(ind.header.message_id == NFAPI_RACH_INDICATION)
+	{
+		printf("decoded nfapi_rach_indication\n");
+	}
+}
+
+void send_srs_ind(phy_info_t* phy_info, uint16_t sfn_sf)
+{
+	nfapi_srs_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_SRS_INDICATION;
+	ind.header.phy_id = phy_info->phy_id;
+	ind.sfn_sf = sfn_sf;
+
+	nfapi_pnf_p7_srs_ind((phy_info->config), &ind);
+}
+void recieve_srs_ind(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_srs_indication_t ind;
+	recv_p7_message(p7Sock, &(ind.header), sizeof(ind));
+	
+	CU_ASSERT_EQUAL(ind.header.message_id, NFAPI_SRS_INDICATION);
+	if(ind.header.message_id == NFAPI_SRS_INDICATION)
+	{
+		printf("decoded nfapi_srs_indication\n");
+	}
+}
+
+void send_sr_ind(phy_info_t* phy_info, uint16_t sfn_sf)
+{
+	nfapi_sr_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_RX_SR_INDICATION;
+	ind.header.phy_id = phy_info->phy_id;
+	ind.sfn_sf = sfn_sf;
+
+	nfapi_pnf_p7_sr_ind((phy_info->config), &ind);
+}
+void recieve_sr_ind(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_sr_indication_t ind;
+	recv_p7_message(p7Sock, &(ind.header), sizeof(ind));
+	
+	CU_ASSERT_EQUAL(ind.header.message_id, NFAPI_RX_SR_INDICATION);
+	if(ind.header.message_id == NFAPI_RX_SR_INDICATION)
+	{
+		printf("decoded nfapi_sr_indication\n");
+	}
+}
+
+void send_cqi_ind(phy_info_t* phy_info, uint16_t sfn_sf)
+{
+	nfapi_cqi_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_RX_CQI_INDICATION;
+	ind.header.phy_id = phy_info->phy_id;
+	ind.sfn_sf = sfn_sf;
+
+	nfapi_pnf_p7_cqi_ind((phy_info->config), &ind);
+}
+void recieve_cqi_ind(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_cqi_indication_t ind;
+	recv_p7_message(p7Sock, &(ind.header), sizeof(ind));
+	
+	CU_ASSERT_EQUAL(ind.header.message_id, NFAPI_RX_CQI_INDICATION);
+	if(ind.header.message_id == NFAPI_RX_CQI_INDICATION)
+	{
+		printf("decoded nfapi_cqi_indication\n");
+	}
+}
+
+void send_lbt_dl_ind(phy_info_t* phy_info, uint16_t sfn_sf)
+{
+	nfapi_lbt_dl_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_LBT_DL_INDICATION;
+	ind.header.phy_id = phy_info->phy_id;
+	ind.sfn_sf = sfn_sf;
+
+	nfapi_pnf_p7_lbt_dl_ind((phy_info->config), &ind);
+}
+void recieve_lbt_dl_ind(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_lbt_dl_indication_t ind;
+	recv_p7_message(p7Sock, &(ind.header), sizeof(ind));
+	
+	CU_ASSERT_EQUAL(ind.header.message_id, NFAPI_LBT_DL_INDICATION);
+	if(ind.header.message_id == NFAPI_LBT_DL_INDICATION)
+	{
+		printf("decoded nfapi_lbt_dl_indication\n");
+	}
+}
+
+void send_nb_harq_ind(phy_info_t* phy_info, uint16_t sfn_sf)
+{
+	nfapi_nb_harq_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_NB_HARQ_INDICATION;
+	ind.header.phy_id = phy_info->phy_id;
+	ind.sfn_sf = sfn_sf;
+
+	nfapi_pnf_p7_nb_harq_ind((phy_info->config), &ind);
+}
+void recieve_nb_harq_ind(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_nb_harq_indication_t ind;
+	recv_p7_message(p7Sock, &(ind.header), sizeof(ind));
+	
+	CU_ASSERT_EQUAL(ind.header.message_id, NFAPI_NB_HARQ_INDICATION);
+	if(ind.header.message_id == NFAPI_NB_HARQ_INDICATION)
+	{
+		printf("decoded nfapi_nb_harq_indication\n");
+	}
+}
+
+void send_nrach_ind(phy_info_t* phy_info, uint16_t sfn_sf)
+{
+	nfapi_nrach_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_NRACH_INDICATION;
+	ind.header.phy_id = phy_info->phy_id;
+	ind.sfn_sf = sfn_sf;
+
+	nfapi_pnf_p7_nrach_ind((phy_info->config), &ind);
+}
+void recieve_nrach_ind(int p7Sock, int phy_id, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_nrach_indication_t ind;
+	recv_p7_message(p7Sock, &(ind.header), sizeof(ind));
+	
+	CU_ASSERT_EQUAL(ind.header.message_id, NFAPI_NRACH_INDICATION);
+	if(ind.header.message_id == NFAPI_NRACH_INDICATION)
+	{
+		printf("decoded nfapi_nrach_indication\n");
+	}
+}
+
+void pnf_test_start_connect(void) 
+{
+	pnf_info_t pnf_info;
+	pnf_info.num_phys = 1;
+	pnf_info.phys[0].pnf_p7_port = 9345;
+	pnf_info.phys[0].pnf_p7_addr = "127.0.0.1";
+	pnf_info.phys[0].vnf_p7_port = 8875;
+	pnf_info.phys[0].vnf_p7_addr = "127.0.0.1";
+
+	char* vnf_addr = "127.0.0.1";
+	int vnf_port = 6699;
+	
+	int p5ListenSock = create_p5_listen_socket(vnf_addr, vnf_port);
+	printf("p5ListenSock %d %d\n", p5ListenSock, errno);
+	listen(p5ListenSock, 2);
+
+	test_param_request_called = 0;
+	test_config_request_called = 0;
+
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+	config->vnf_ip_addr = vnf_addr;
+	config->vnf_p5_port = vnf_port;
+	config->pnf_param_req = &test_pnf_param_request;
+	config->pnf_config_req = &test_pnf_config_request;
+	config->pnf_start_req = &test_pnf_start_request;
+	config->pnf_stop_req = &test_pnf_stop_request;
+	config->param_req = &test_param_request;
+	config->config_req = &test_config_request;
+	config->start_req = &test_start_request;
+	config->stop_req = &test_stop_request;
+
+	config->user_data = &pnf_info;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &pnf_test_start_thread, config);
+
+	struct sockaddr_in addr;
+	socklen_t addrSize = sizeof(addr);;
+	int	p5Sock = accept(p5ListenSock, (struct sockaddr *)&addr, &addrSize);
+	printf("p5 connection accepted %d %d\n", p5Sock, errno);
+
+	send_pnf_param_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_param_response(p5Sock, NFAPI_MSG_OK);
+
+	send_pnf_config_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_config_response(p5Sock);
+	
+	send_pnf_start_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_start_response(p5Sock);
+
+	send_param_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_param_response(p5Sock);
+	
+
+	send_config_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize, &pnf_info);
+	receive_config_response(p5Sock);
+
+	send_start_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_start_response(p5Sock);
+
+	sleep(2);
+
+	int p7Sock = socket(AF_INET, SOCK_DGRAM, 0);
+
+	{
+		struct sockaddr_in addr;
+		addr.sin_family = AF_INET;
+		addr.sin_port = htons(pnf_info.phys[0].vnf_p7_port);
+		addr.sin_addr.s_addr = INADDR_ANY;
+
+		bind(p7Sock, (struct sockaddr*)&addr, sizeof(addr));
+	}
+
+	printf("Sending p7 messages too %s:%d\n", pnf_info.phys[0].pnf_p7_addr, pnf_info.phys[0].pnf_p7_port);
+
+	struct sockaddr_in p7_addr;
+	p7_addr.sin_family = AF_INET;
+	p7_addr.sin_port = htons(pnf_info.phys[0].pnf_p7_port);
+	p7_addr.sin_addr.s_addr = inet_addr(pnf_info.phys[0].pnf_p7_addr);
+	socklen_t p7_addrSize = sizeof(p7_addr);
+
+	send_dl_node_sync(p7Sock, 0, &p7_addr, p7_addrSize);
+	receive_ul_node_sync(p7Sock);
+
+
+#define SFNSF(_sfn, _sf) ((_sfn << 4) + _sf)
+
+	uint16_t sfn_sf = SFNSF(500, 3); // sfn:500 sf:3
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+	send_subframe_indication(&(pnf_info.phys[0]));
+
+	// should generate dummy messages
+
+	usleep(500);
+
+	sfn_sf = SFNSF(500, 4); // sfn:500 sf:4
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+
+	send_dl_config_req(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+	send_ul_config_req(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+	send_hi_dci0_req(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+	send_tx_req(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+
+
+	usleep(500);
+
+	send_subframe_indication(&(pnf_info.phys[0]));
+	// should send the cached messages
+
+	send_harq_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_harq_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_crc_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_crc_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_rx_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_rx_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_rach_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_rach_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_srs_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_srs_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+	
+	send_sr_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_sr_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_cqi_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_cqi_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+	
+	send_lbt_dl_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_lbt_dl_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+	
+	send_nb_harq_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_nb_harq_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_nrach_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_nrach_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+
+	// send out of window dl_config, should expect the timing info
+	send_dl_config_req(p7Sock, 0, &p7_addr, p7_addrSize, SFNSF(600, 0));
+
+	sfn_sf = SFNSF(500, 5); // sfn:500 sf:4
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+	usleep(500);
+
+	send_subframe_indication(&(pnf_info.phys[0]));
+	receive_timing_info(p7Sock);
+
+	send_stop_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_stop_response(p5Sock);
+
+
+
+	send_pnf_stop_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_stop_response(p5Sock);
+
+	nfapi_pnf_stop(config);
+
+	int* result;
+	pthread_join(thread, (void**)&result);
+	//CU_ASSERT_NOT_EQUAL(*result, -1);
+	CU_ASSERT_EQUAL(test_param_request_called, 1);
+	CU_ASSERT_EQUAL(test_config_request_called, 1);
+
+	close(p5Sock);
+	close(p5ListenSock);
+
+}
+void pnf_test_start_connect_ipv6(void) 
+{
+	pnf_info_t pnf_info;
+	pnf_info.num_phys = 1;
+	pnf_info.phys[0].pnf_p7_port = 9345;
+	pnf_info.phys[0].pnf_p7_addr = "::1";
+	pnf_info.phys[0].vnf_p7_port = 8875;
+	pnf_info.phys[0].vnf_p7_addr = "::1";
+
+	char* vnf_addr = "::1";
+	int vnf_port = 6698;
+	
+	int p5ListenSock = create_p5_ipv6_listen_socket(vnf_addr, vnf_port);
+	printf("p5ListenSock ipv6 %d %d\n", p5ListenSock, errno);
+	int listen_result = listen(p5ListenSock, 2);
+	printf("Listen result %d\n", listen_result);
+
+	test_param_request_called = 0;
+	test_config_request_called = 0;
+
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+	config->vnf_ip_addr = vnf_addr;
+	config->vnf_p5_port = vnf_port;
+	config->pnf_param_req = &test_pnf_param_request;
+	config->pnf_config_req = &test_pnf_config_request;
+	config->pnf_start_req = &test_pnf_start_request;
+	config->pnf_stop_req = &test_pnf_stop_request;
+	config->param_req = &test_param_request;
+	config->config_req = &test_config_request;
+	config->start_req = &test_start_request;
+	config->stop_req = &test_stop_request;
+
+	config->user_data = &pnf_info;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &pnf_test_start_thread, config);
+
+	struct sockaddr_in6 addr;
+	socklen_t addrSize = sizeof(addr);;
+	int	p5Sock = accept(p5ListenSock, (struct sockaddr *)&addr, &addrSize);
+	printf("p5 connection accepted %d %d\n", p5Sock, errno);
+	
+	send_pnf_param_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_param_response(p5Sock, NFAPI_MSG_OK);
+
+	send_pnf_config_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_config_response(p5Sock);
+	
+	send_pnf_start_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_start_response(p5Sock);
+
+	send_param_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_param_response(p5Sock);
+}
+        
+void pnf_test_state_pnf_config_invalid_state()
+{
+	char* vnf_addr = "127.0.0.1";
+	int vnf_port = 4546;
+	
+	int p5ListenSock = create_p5_listen_socket(vnf_addr, vnf_port);
+
+	test_param_request_called = 0;
+	test_config_request_called = 0;
+
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+	config->vnf_ip_addr = vnf_addr;
+	config->vnf_p5_port = vnf_port;
+	config->pnf_param_req = &test_pnf_param_request;
+	config->pnf_config_req = &test_pnf_config_request;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &pnf_test_start_thread, config);
+
+	listen(p5ListenSock, 2);
+	struct sockaddr_in addr;
+	socklen_t addrSize = sizeof(addr);
+	int	p5Sock = accept(p5ListenSock, (struct sockaddr *)&addr, &addrSize);
+	printf("%s p5Sock %d errno %d\n", __FUNCTION__, p5Sock, errno);
+
+	send_pnf_param_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_param_response(p5Sock, NFAPI_MSG_OK);
+
+	send_pnf_config_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_config_response(p5Sock);
+
+	send_pnf_param_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_param_response(p5Sock, NFAPI_MSG_INVALID_STATE);
+	
+	nfapi_pnf_stop(config);
+
+	int* result;
+	pthread_join(thread, (void**)&result);
+	CU_ASSERT_EQUAL(result, 0);
+	CU_ASSERT_EQUAL(test_param_request_called, 1);
+	CU_ASSERT_EQUAL(test_config_request_called, 1);
+
+	close(p5Sock);
+	close(p5ListenSock);
+
+}
+
+void pnf_test_state_pnf_param_invalid_state()
+{
+	pnf_info_t pnf_info;
+
+	char* vnf_addr = "127.0.0.1";
+	int vnf_port = 4547;
+	
+	int p5ListenSock = create_p5_listen_socket(vnf_addr, vnf_port);
+
+	test_param_request_called = 0;
+	test_config_request_called = 0;
+
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+	config->vnf_ip_addr = vnf_addr;
+	config->vnf_p5_port = vnf_port;
+	config->pnf_param_req = &test_pnf_param_request;
+	config->pnf_config_req = &test_pnf_config_request;
+
+	config->user_data = &pnf_info;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &pnf_test_start_thread, config);
+
+	listen(p5ListenSock, 2);
+	struct sockaddr_in addr;
+	socklen_t addrSize = sizeof(addr);
+	int	p5Sock = accept(p5ListenSock, (struct sockaddr *)&addr, &addrSize);
+
+	send_pnf_param_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_param_response(p5Sock, NFAPI_MSG_OK);
+
+	send_pnf_config_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_config_response(p5Sock);
+
+	send_pnf_config_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_config_response(p5Sock);
+	
+	nfapi_pnf_stop(config);
+
+	int* result;
+	pthread_join(thread, (void**)&result);
+	CU_ASSERT_EQUAL(result, 0);
+	CU_ASSERT_EQUAL(test_param_request_called, 1);
+	CU_ASSERT_EQUAL(test_config_request_called, 2);
+
+	close(p5Sock);
+	close(p5ListenSock);
+
+}
+void pnf_test_p7_segmentation_test_1(void) 
+{
+	pnf_info_t pnf_info;
+	pnf_info.num_phys = 1;
+	pnf_info.phys[0].pnf_p7_port = 9348;
+	pnf_info.phys[0].pnf_p7_addr = "127.0.0.1";
+	pnf_info.phys[0].vnf_p7_port = 8878;
+	pnf_info.phys[0].vnf_p7_addr = "127.0.0.1";
+
+	char* vnf_addr = "127.0.0.1";
+	int vnf_port = 6699;
+	
+	int p5ListenSock = create_p5_listen_socket(vnf_addr, vnf_port);
+	printf("p5ListenSock %d %d\n", p5ListenSock, errno);
+	listen(p5ListenSock, 2);
+
+	test_param_request_called = 0;
+	test_config_request_called = 0;
+
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+	config->vnf_ip_addr = vnf_addr;
+	config->vnf_p5_port = vnf_port;
+	config->pnf_param_req = &test_pnf_param_request;
+	config->pnf_config_req = &test_pnf_config_request;
+	config->pnf_start_req = &test_pnf_start_request;
+	config->pnf_stop_req = &test_pnf_stop_request;
+	config->param_req = &test_param_request;
+	config->config_req = &test_config_request;
+	config->start_req = &test_start_request;
+	config->stop_req = &test_stop_request;
+
+	config->user_data = &pnf_info;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &pnf_test_start_thread, config);
+
+	struct sockaddr_in addr;
+	socklen_t addrSize = sizeof(addr);;
+	int	p5Sock = accept(p5ListenSock, (struct sockaddr *)&addr, &addrSize);
+	printf("p5 connection accepted %d %d\n", p5Sock, errno);
+
+	send_pnf_param_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_param_response(p5Sock, NFAPI_MSG_OK);
+
+	send_pnf_config_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_config_response(p5Sock);
+	
+	send_pnf_start_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_start_response(p5Sock);
+
+	send_param_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_param_response(p5Sock);
+	
+
+	send_config_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize, &pnf_info);
+	receive_config_response(p5Sock);
+
+	send_start_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_start_response(p5Sock);
+
+	sleep(2);
+
+	int p7Sock = socket(AF_INET, SOCK_DGRAM, 0);
+
+	{
+		struct sockaddr_in addr;
+		addr.sin_family = AF_INET;
+		addr.sin_port = htons(pnf_info.phys[0].vnf_p7_port);
+		addr.sin_addr.s_addr = INADDR_ANY;
+
+		bind(p7Sock, (struct sockaddr*)&addr, sizeof(addr));
+	}
+
+	printf("Sending p7 messages too %s:%d\n", pnf_info.phys[0].pnf_p7_addr, pnf_info.phys[0].pnf_p7_port);
+
+	struct sockaddr_in p7_addr;
+	p7_addr.sin_family = AF_INET;
+	p7_addr.sin_port = htons(pnf_info.phys[0].pnf_p7_port);
+	p7_addr.sin_addr.s_addr = inet_addr(pnf_info.phys[0].pnf_p7_addr);
+	socklen_t p7_addrSize = sizeof(p7_addr);
+
+	send_dl_node_sync(p7Sock, 0, &p7_addr, p7_addrSize);
+	receive_ul_node_sync(p7Sock);
+
+
+#define SFNSF(_sfn, _sf) ((_sfn << 4) + _sf)
+
+	uint16_t sfn_sf = SFNSF(500, 3); // sfn:500 sf:3
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+	send_subframe_indication(&(pnf_info.phys[0]));
+
+	// should generate dummy messages
+
+	usleep(500);
+
+	sfn_sf = SFNSF(500, 4); // sfn:500 sf:4
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+
+	send_dl_config_req(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+	send_ul_config_req(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+	send_hi_dci0_req(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+	send_tx_req_1(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+
+
+	usleep(500);
+
+	send_subframe_indication(&(pnf_info.phys[0]));
+	// should send the cached messages
+
+	send_harq_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_harq_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_crc_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_crc_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_rx_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_rx_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_rach_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_rach_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_srs_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_srs_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+	
+	send_sr_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_sr_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_cqi_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_cqi_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+	
+	send_lbt_dl_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_lbt_dl_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_nb_harq_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_nb_harq_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_nrach_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_nrach_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+
+	// send out of window dl_config, should expect the timing info
+	send_dl_config_req(p7Sock, 0, &p7_addr, p7_addrSize, SFNSF(600, 0));
+
+	sfn_sf = SFNSF(500, 5); // sfn:500 sf:4
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+	usleep(500);
+
+	send_subframe_indication(&(pnf_info.phys[0]));
+	receive_timing_info(p7Sock);
+
+	nfapi_pnf_p7_stop(pnf_info.phys[0].config);
+	int* result;
+	pthread_join(pnf_info.phys[0].thread, (void**)&result);
+	close(p7Sock);
+
+	send_stop_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_stop_response(p5Sock);
+
+	send_pnf_stop_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_stop_response(p5Sock);
+
+	nfapi_pnf_stop(config);
+
+	pthread_join(thread, (void**)&result);
+	//CU_ASSERT_NOT_EQUAL(*result, -1);
+	CU_ASSERT_EQUAL(test_param_request_called, 1);
+	CU_ASSERT_EQUAL(test_config_request_called, 1);
+
+	close(p5Sock);
+	close(p5ListenSock);
+
+}
+void pnf_test_p7_segmentation_test_2(void) 
+{
+	pnf_info_t pnf_info;
+	pnf_info.num_phys = 1;
+	pnf_info.phys[0].pnf_p7_port = 9348;
+	pnf_info.phys[0].pnf_p7_addr = "127.0.0.1";
+	pnf_info.phys[0].vnf_p7_port = 8878;
+	pnf_info.phys[0].vnf_p7_addr = "127.0.0.1";
+
+	char* vnf_addr = "127.0.0.1";
+	int vnf_port = 6699;
+	
+	int p5ListenSock = create_p5_listen_socket(vnf_addr, vnf_port);
+	printf("p5ListenSock %d %d\n", p5ListenSock, errno);
+	listen(p5ListenSock, 2);
+
+	test_param_request_called = 0;
+	test_config_request_called = 0;
+
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+	config->vnf_ip_addr = vnf_addr;
+	config->vnf_p5_port = vnf_port;
+	config->pnf_param_req = &test_pnf_param_request;
+	config->pnf_config_req = &test_pnf_config_request;
+	config->pnf_start_req = &test_pnf_start_request;
+	config->pnf_stop_req = &test_pnf_stop_request;
+	config->param_req = &test_param_request;
+	config->config_req = &test_config_request;
+	config->start_req = &test_start_request;
+	config->stop_req = &test_stop_request;
+
+	config->user_data = &pnf_info;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &pnf_test_start_thread, config);
+
+	struct sockaddr_in addr;
+	socklen_t addrSize = sizeof(addr);;
+	int	p5Sock = accept(p5ListenSock, (struct sockaddr *)&addr, &addrSize);
+	printf("p5 connection accepted %d %d\n", p5Sock, errno);
+
+	send_pnf_param_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_param_response(p5Sock, NFAPI_MSG_OK);
+
+	send_pnf_config_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_config_response(p5Sock);
+	
+	send_pnf_start_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_start_response(p5Sock);
+
+	send_param_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_param_response(p5Sock);
+	
+
+	send_config_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize, &pnf_info);
+	receive_config_response(p5Sock);
+
+	send_start_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_start_response(p5Sock);
+
+	sleep(2);
+
+	int p7Sock = socket(AF_INET, SOCK_DGRAM, 0);
+
+	{
+		struct sockaddr_in addr;
+		addr.sin_family = AF_INET;
+		addr.sin_port = htons(pnf_info.phys[0].vnf_p7_port);
+		addr.sin_addr.s_addr = INADDR_ANY;
+
+		bind(p7Sock, (struct sockaddr*)&addr, sizeof(addr));
+	}
+
+	printf("Sending p7 messages too %s:%d\n", pnf_info.phys[0].pnf_p7_addr, pnf_info.phys[0].pnf_p7_port);
+
+	struct sockaddr_in p7_addr;
+	p7_addr.sin_family = AF_INET;
+	p7_addr.sin_port = htons(pnf_info.phys[0].pnf_p7_port);
+	p7_addr.sin_addr.s_addr = inet_addr(pnf_info.phys[0].pnf_p7_addr);
+	socklen_t p7_addrSize = sizeof(p7_addr);
+
+	send_dl_node_sync(p7Sock, 0, &p7_addr, p7_addrSize);
+	receive_ul_node_sync(p7Sock);
+
+
+#define SFNSF(_sfn, _sf) ((_sfn << 4) + _sf)
+
+	uint16_t sfn_sf = SFNSF(500, 3); // sfn:500 sf:3
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+	send_subframe_indication(&(pnf_info.phys[0]));
+
+	// should generate dummy messages
+
+	usleep(500);
+
+	sfn_sf = SFNSF(500, 4); // sfn:500 sf:4
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+
+	send_dl_config_req(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+	send_ul_config_req(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+	send_hi_dci0_req(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+	send_tx_req_2(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+
+
+	usleep(500);
+
+	send_subframe_indication(&(pnf_info.phys[0]));
+	// should send the cached messages
+
+	send_harq_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_harq_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_crc_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_crc_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_rx_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_rx_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_rach_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_rach_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_srs_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_srs_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+	
+	send_sr_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_sr_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_cqi_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_cqi_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+	
+	send_lbt_dl_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_lbt_dl_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	// send out of window dl_config, should expect the timing info
+	send_dl_config_req(p7Sock, 0, &p7_addr, p7_addrSize, SFNSF(600, 0));
+
+	sfn_sf = SFNSF(500, 5); // sfn:500 sf:4
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+	usleep(500);
+
+	send_subframe_indication(&(pnf_info.phys[0]));
+	receive_timing_info(p7Sock);
+
+	send_stop_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_stop_response(p5Sock);
+
+	nfapi_pnf_p7_stop(pnf_info.phys[0].config);
+	int* result;
+	pthread_join(pnf_info.phys[0].thread, (void**)&result);
+	close(p7Sock);
+
+
+	send_pnf_stop_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_stop_response(p5Sock);
+
+	nfapi_pnf_stop(config);
+
+	pthread_join(thread, (void**)&result);
+	//CU_ASSERT_NOT_EQUAL(*result, -1);
+	CU_ASSERT_EQUAL(test_param_request_called, 1);
+	CU_ASSERT_EQUAL(test_config_request_called, 1);
+
+	close(p5Sock);
+	close(p5ListenSock);
+
+}
+void pnf_test_p7_segmentation_test_3(void) 
+{
+	pnf_info_t pnf_info;
+	pnf_info.num_phys = 1;
+	pnf_info.phys[0].pnf_p7_port = 9348;
+	pnf_info.phys[0].pnf_p7_addr = "127.0.0.1";
+	pnf_info.phys[0].vnf_p7_port = 8878;
+	pnf_info.phys[0].vnf_p7_addr = "127.0.0.1";
+
+	char* vnf_addr = "127.0.0.1";
+	int vnf_port = 6699;
+	
+	int p5ListenSock = create_p5_listen_socket(vnf_addr, vnf_port);
+	printf("p5ListenSock %d %d\n", p5ListenSock, errno);
+	listen(p5ListenSock, 2);
+
+	test_param_request_called = 0;
+	test_config_request_called = 0;
+
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+	config->vnf_ip_addr = vnf_addr;
+	config->vnf_p5_port = vnf_port;
+	config->pnf_param_req = &test_pnf_param_request;
+	config->pnf_config_req = &test_pnf_config_request;
+	config->pnf_start_req = &test_pnf_start_request;
+	config->pnf_stop_req = &test_pnf_stop_request;
+	config->param_req = &test_param_request;
+	config->config_req = &test_config_request;
+	config->start_req = &test_start_request;
+	config->stop_req = &test_stop_request;
+
+	config->user_data = &pnf_info;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &pnf_test_start_thread, config);
+
+	struct sockaddr_in addr;
+	socklen_t addrSize = sizeof(addr);;
+	int	p5Sock = accept(p5ListenSock, (struct sockaddr *)&addr, &addrSize);
+	printf("p5 connection accepted %d %d\n", p5Sock, errno);
+
+	send_pnf_param_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_param_response(p5Sock, NFAPI_MSG_OK);
+
+	send_pnf_config_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_config_response(p5Sock);
+	
+	send_pnf_start_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_start_response(p5Sock);
+
+	send_param_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_param_response(p5Sock);
+	
+
+	send_config_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize, &pnf_info);
+	receive_config_response(p5Sock);
+
+	send_start_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_start_response(p5Sock);
+
+	sleep(2);
+
+	int p7Sock = socket(AF_INET, SOCK_DGRAM, 0);
+
+	{
+		struct sockaddr_in addr;
+		addr.sin_family = AF_INET;
+		addr.sin_port = htons(pnf_info.phys[0].vnf_p7_port);
+		addr.sin_addr.s_addr = INADDR_ANY;
+
+		bind(p7Sock, (struct sockaddr*)&addr, sizeof(addr));
+	}
+
+	printf("Sending p7 messages too %s:%d\n", pnf_info.phys[0].pnf_p7_addr, pnf_info.phys[0].pnf_p7_port);
+
+	struct sockaddr_in p7_addr;
+	p7_addr.sin_family = AF_INET;
+	p7_addr.sin_port = htons(pnf_info.phys[0].pnf_p7_port);
+	p7_addr.sin_addr.s_addr = inet_addr(pnf_info.phys[0].pnf_p7_addr);
+	socklen_t p7_addrSize = sizeof(p7_addr);
+
+	send_dl_node_sync(p7Sock, 0, &p7_addr, p7_addrSize);
+	receive_ul_node_sync(p7Sock);
+
+
+#define SFNSF(_sfn, _sf) ((_sfn << 4) + _sf)
+
+	uint16_t sfn_sf = SFNSF(500, 3); // sfn:500 sf:3
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+	send_subframe_indication(&(pnf_info.phys[0]));
+
+	// should generate dummy messages
+
+	usleep(500);
+
+	sfn_sf = SFNSF(500, 4); // sfn:500 sf:4
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+
+
+	send_dl_subframe_msgs_interleaved(p7Sock, 0, &p7_addr, p7_addrSize, sfn_sf);
+
+
+	usleep(500);
+
+	send_subframe_indication(&(pnf_info.phys[0]));
+	// should send the cached messages
+
+	send_harq_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_harq_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_crc_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_crc_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_rx_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_rx_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_rach_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_rach_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_srs_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_srs_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+	
+	send_sr_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_sr_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	send_cqi_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_cqi_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+	
+	send_lbt_dl_ind(&pnf_info.phys[0], sfn_sf);
+	recieve_lbt_dl_ind(p7Sock, 0, &p7_addr, p7_addrSize);
+
+	// send out of window dl_config, should expect the timing info
+	printf("Sending late dl config req\n");
+	send_dl_config_req(p7Sock, 0, &p7_addr, p7_addrSize, SFNSF(600, 0));
+
+	sfn_sf = SFNSF(500, 5); // sfn:500 sf:4
+	pnf_info.phys[0].sfn_sf = sfn_sf;
+	sleep(2);
+
+	printf("Sending subframe indication\n");
+	send_subframe_indication(&(pnf_info.phys[0]));
+	printf("Waitning for timing info\n");
+	receive_timing_info(p7Sock);
+
+	printf("Sending stop request\n");
+	send_stop_request(p5Sock, 0, (struct sockaddr*)&addr, addrSize);
+	receive_stop_response(p5Sock);
+
+	printf("Waiting for P7 thread to stop\n");
+	nfapi_pnf_p7_stop(pnf_info.phys[0].config);
+	int* result;
+	pthread_join(pnf_info.phys[0].thread, (void**)&result);
+	close(p7Sock);
+
+
+	send_pnf_stop_request(p5Sock, (struct sockaddr*)&addr, addrSize);
+	receive_pnf_stop_response(p5Sock);
+
+	nfapi_pnf_stop(config);
+
+	pthread_join(thread, (void**)&result);
+	//CU_ASSERT_NOT_EQUAL(*result, -1);
+	CU_ASSERT_EQUAL(test_param_request_called, 1);
+	CU_ASSERT_EQUAL(test_config_request_called, 1);
+
+	close(p5Sock);
+	close(p5ListenSock);
+
+}
+
+/************* Test Runner Code goes here **************/
+
+int main ( void )
+{
+   CU_pSuite pSuite = NULL;
+
+   /* initialize the CUnit test registry */
+   if ( CUE_SUCCESS != CU_initialize_registry() )
+      return CU_get_error();
+
+   /* add a suite to the registry */
+   pSuite = CU_add_suite( "pnf_test_suite", init_suite, clean_suite );
+   if ( NULL == pSuite ) {
+      CU_cleanup_registry();
+      return CU_get_error();
+   }
+
+   /* add the tests to the suite */
+   if ( (NULL == CU_add_test(pSuite, "pnf_test_start_no_config", pnf_test_start_no_config)) ||
+        (NULL == CU_add_test(pSuite, "pnf_test_start_no_ip", pnf_test_start_no_ip)) ||
+        (NULL == CU_add_test(pSuite, "pnf_test_start_invalid_ip", pnf_test_start_invalid_ip)) ||
+        (NULL == CU_add_test(pSuite, "pnf_test_start_no_connection", pnf_test_start_no_connection)) ||
+        (NULL == CU_add_test(pSuite, "pnf_test_start_connect", pnf_test_start_connect)) ||
+        (NULL == CU_add_test(pSuite, "pnf_test_start_pnf_config_invalid_state", pnf_test_state_pnf_config_invalid_state)) ||
+        (NULL == CU_add_test(pSuite, "pnf_test_start_pnf_param_invalid_state", pnf_test_state_pnf_param_invalid_state)) ||
+        (NULL == CU_add_test(pSuite, "pnf_test_p7_segmentation_test_1", pnf_test_p7_segmentation_test_1)) ||
+        (NULL == CU_add_test(pSuite, "pnf_test_p7_segmentation_test_2", pnf_test_p7_segmentation_test_2)) ||
+        (NULL == CU_add_test(pSuite, "pnf_test_p7_segmentation_test_3", pnf_test_p7_segmentation_test_3))
+		)
+   {
+      CU_cleanup_registry();
+      return CU_get_error();
+   }
+
+   //(NULL == CU_add_test(pSuite, "pnf_test_start_connect_ipv6", pnf_test_start_connect_ipv6)) ||
+
+   // Run all tests using the basic interface
+   CU_basic_set_mode(CU_BRM_VERBOSE);
+   CU_set_output_filename("pnf_unit_test_results.xml");
+   CU_basic_run_tests();
+
+	CU_pSuite s = CU_get_registry()->pSuite;
+	int count = 0;
+	while(s)
+	{
+		CU_pTest t = s->pTest;
+		while(t)
+		{
+			count++;
+			t = t->pNext;
+		}
+		s = s->pNext;
+	}
+
+	printf("%d..%d\n", 1, count);
+
+
+
+	s = CU_get_registry()->pSuite;
+	count = 1;
+	while(s)
+	{
+		CU_pTest t = s->pTest;
+		while(t)
+		{
+			int pass = 1;
+			CU_FailureRecord* failures = CU_get_failure_list();
+			while(failures)
+			{
+				if(strcmp(failures->pSuite->pName, s->pName) == 0 &&
+				   strcmp(failures->pTest->pName, t->pName) == 0)
+				{
+					pass = 0;
+					failures = 0;
+				}
+				else
+				{
+					failures = failures->pNext;
+				}
+			}
+
+			if(pass)
+				printf("ok %d - %s:%s\n", count, s->pName, t->pName);
+			else 
+				printf("not ok %d - %s:%s\n", count, s->pName, t->pName);
+
+			count++;
+			t = t->pNext;
+		}
+		s = s->pNext;
+	}
+
+   // Clean up registry and return 
+   CU_cleanup_registry();
+   return CU_get_error();
+
+}
diff --git a/nfapi/open-nFAPI/pnf_sim/Makefile.am b/nfapi/open-nFAPI/pnf_sim/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..c8d9d8ddd462bb29eb1666c994fe68febbe566b2
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf_sim/Makefile.am
@@ -0,0 +1,22 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+AUTOMAKE_OPTIONS=subdir-objects
+AM_CPPFLAGS = -I$(top_srcdir)/pnf_sim/inc -I$(top_srcdir)/sim_common/inc -I$(top_srcdir)/pnf/public_inc  -I$(top_srcdir)/common/inc -I$(top_srcdir)/common/public_inc -I$(top_srcdir)/nfapi/public_inc -I$(top_srcdir)/nfapi/inc $(XML_CFLAGS) -g
+AM_CXXFLAGS = -I$(top_srcdir)/pnf_sim/inc -I$(top_srcdir)/sim_common/inc -I$(top_srcdir)/pnf/public_inc  -I$(top_srcdir)/common/inc -I$(top_srcdir)/common/public_inc -I$(top_srcdir)/nfapi/public_inc -I$(top_srcdir)/nfapi/inc $(XML_CFLAGS) -std=c++11 $(BOOST_CPPFLAGS) -g
+bin_PROGRAMS = pnfsim
+pnfsim_SOURCES = src/main.cpp src/fapi_stub.cpp
+LDADD= $(top_builddir)/pnf/libnfapi_pnf.a $(top_builddir)/common/libnfapi_common.a $(top_builddir)/nfapi/libnfapi.a $(top_builddir)/sim_common/libnfapi_sim_common.a -L$(libdir) -lpthread -lrt -lsctp  -lz 
diff --git a/nfapi/open-nFAPI/pnf_sim/inc/fapi_interface.h b/nfapi/open-nFAPI/pnf_sim/inc/fapi_interface.h
new file mode 100644
index 0000000000000000000000000000000000000000..b1d44eab8b0c714e5b764c8edff7819ae6dbc928
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf_sim/inc/fapi_interface.h
@@ -0,0 +1,1800 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef _FAPI_INTERFACE_H_
+#define _FAPI_INTERFACE_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+typedef signed char		int8_t;
+typedef unsigned char	uint8_t;
+typedef signed short	int16_t;
+typedef unsigned short	uint16_t;
+typedef signed int		int32_t;
+typedef unsigned int	uint32_t;
+
+#define FAPI_PARAM_REQUEST									0x00
+#define FAPI_PARAM_RESPONSE									0x01
+#define FAPI_CONFIG_REQUEST									0x02
+#define FAPI_CONFIG_RESPONSE								0x03
+#define FAPI_START_REQUEST									0x04
+#define FAPI_STOP_REQUEST									0x05
+#define FAPI_STOP_INDICATION								0x06
+#define FAPI_UE_CONFIG_REQUEST								0x07
+#define FAPI_UE_CONFIG_RESPONSE								0x08
+#define FAPI_ERROR_INDICATION								0x09
+#define FAPI_UE_RELEASE_REQUEST								0x0A
+#define FAPI_UE_RELEASE_RESPONSE							0x0B
+#define FAPI_DL_CONFIG_REQUEST								0x80
+#define FAPI_UL_CONFIG_REQUEST								0x81
+#define FAPI_SUBFRAME_INDICATION							0x82
+#define FAPI_HI_DCI0_REQUEST								0x83
+#define FAPI_TX_REQUEST										0x84
+#define FAPI_HARQ_INDICATION								0x85
+#define FAPI_CRC_INDICATION									0x86
+#define FAPI_RX_ULSCH_INDICATION							0x87
+#define FAPI_RACH_INDICATION								0x88
+#define FAPI_SRS_INDICATION									0x89
+#define FAPI_RX_SR_INDICATION								0x8A
+#define FAPI_RX_CQI_INDICATION								0x8B
+#define FAPI_LBT_DL_CONFIG_REQUEST							0x8C
+#define FAPI_LBT_DL_INDICATION								0x8D
+#define FAPI_NB_HARQ_INDICATION								0x8E
+#define FAPI_NRACH_INDICATION								0x8F
+
+
+
+
+#define FAPI_SUBFRAME_DUPLEX_MODE_TAG						0x01
+#define FAPI_SUBFRAME_PCFICH_POWER_OFFSET_TAG				0x02
+#define FAPI_SUBFRAME_PB_TAG								0x03
+#define FAPI_SUBFRAME_DL_CYCLIC_PREFIX_TYPE_TAG				0x04
+#define FAPI_SUBFRAME_UL_CYCLIC_PREFIX_TYPE_TAG				0x05
+#define FAPI_RF_DL_CHANNEL_BANDWIDTH_TAG					0x0A
+#define FAPI_RF_UL_CHANNEL_BANDWIDTH_TAG					0x0B
+#define FAPI_RF_REFERENCE_SIGNAL_POWER_TAG					0x0C
+#define FAPI_RF_TX_ANTENNA_PORTS_TAG						0x0D
+#define FAPI_RF_RX_ANTENNA_PORTS_TAG						0x0E
+#define FAPI_PHICH_RESOURCE_TAG								0x14
+#define FAPI_PHICH_DURATION_TAG								0x15
+#define FAPI_PHICH_POWER_OFFSET_TAG							0x16
+#define FAPI_SCH_PRIMARY_SYNC_SIGNAL_TAG					0x1E
+#define FAPI_SCH_SECONDARY_SYNC_SIGNAL_TAG					0x1F
+#define FAPI_SCH_PHYSICAL_CELL_ID_TAG						0x20
+#define FAPI_PRACH_CONFIGURATION_INDEX_TAG					0x28
+#define FAPI_PRACH_ROOT_SEQUENCE_INDEX_TAG					0x29
+#define FAPI_PRACH_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG	0x2A
+#define FAPI_PRACH_HIGH_SPEED_FLAG_TAG						0x2B
+#define FAPI_PRACH_FREQUENCY_OFFSET_TAG						0x2C
+#define FAPI_PUSCH_HOPPING_MODE_TAG							0x32
+#define FAPI_PUSCH_HOPPING_OFFSET_TAG						0x33
+#define FAPI_PUSCH_NUMBER_OF_SUBBANDS_TAG					0x34
+#define FAPI_PUCCH_DELTA_PUCCH_SHIFT_TAG					0x3C
+#define FAPI_PUCCH_N_CQI_RB_TAG								0x3D
+#define FAPI_PUCCH_N_AN_CS_TAG								0x3E
+#define FAPI_PUCCH_N1_PUCCH_AN_TAG							0x3F
+#define FAPI_SRS_BANDWIDTH_CONFIGURATION_TAG				0x46
+#define FAPI_SRS_MAX_UP_PTS_TAG								0x47
+#define FAPI_SRS_SUBFRAME_CONFIGURATION_TAG					0x48
+#define FAPI_SRS_ACK_NACK_SRS_SIMULTANEOUS_TX_TAG			0x49
+#define FAPI_UL_REF_SIG_UPLINK_RS_HOPPING_TAG				0x50
+#define FAPI_UL_REF_SIG_GROUP_ASSIGNMENT_TAG				0x51
+#define FAPI_UL_REF_SIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG			0x52
+#define FAPI_TDD_SUBFRAME_ASSIGNMENT_TAG					0x5A
+#define FAPI_TDD_SPECIAL_SUBFRAME_PATTERNS_TAG				0x5B
+
+#define FAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_PDSCH_TAG	0x64
+#define FAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_DRS_TAG	0x65
+#define FAPI_LAA_CONFIG_PD_THRESHOLD_TAG					0x66
+#define FAPI_LAA_CONFIG_MULTI_CARRIER_TYPE_TAG				0x67
+#define FAPI_LAA_CONFIG_MULTI_CARRIER_TX_TAG				0x68
+#define FAPI_LAA_CONFIG_MULTI_CARRIER_FREEZE_TAG			0x69
+#define FAPI_LAA_CONFIG_TX_ANTENNA_PORTS_FOR_DRS_TAG		0x6A
+#define FAPI_LAA_CONFIG_TRANSMISSION_POWER_FOR_DRS_TAG		0x6B
+
+#define FAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLED_R13_TAG						0x78
+#define FAPI_EMTC_CONFIG_PRACH_CAT_M_ROOT_SEQUENCY_INDEX_TAG					0x79
+#define FAPI_EMTC_CONFIG_PRACH_CAT_M_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG	0x7A
+#define FAPI_EMTC_CONFIG_PRACH_CAT_M_HIGH_SPEED_FLAG_TAG						0x7B
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG							0x7C
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG				0x7D
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG					0x7E
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG	0x7F
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG		0x80
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG					0x81
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG					0x82
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG							0x83
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG				0x84
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG					0x85
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG	0x86
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG		0x87
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG					0x88
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG					0x89
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG							0x8A
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG				0x8B
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG					0x8C
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG	0x8D
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG		0x8E
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG					0x8F
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG					0x90
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG							0x91
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG				0x92
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG					0x93
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG	0x94
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG		0x95
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG					0x96
+#define FAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG					0x97
+#define FAPI_EMTC_CONFIG_PRACH_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG	0x98
+#define FAPI_EMTC_CONFIG_PRACH_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG	0x99
+
+#define FAPI_NB_IOT_OPERATING_MODE_TAG											0xA5
+#define FAPI_NB_IOT_ANCHOR_TAG													0xA6
+#define FAPI_NB_IOT_PRB_INDEX_TAG												0xA7
+#define FAPI_NB_IOT_CONTROL_REGION_SIZE_TAG										0xA8
+#define FAPI_NB_IOT_ASSUMED_CRS_APS_TAG											0xA9
+#define FAPI_NB_IOT_NPRACH_CONFIG_0_ENABLE_TAG									0xAA
+#define FAPI_NB_IOT_NPRACH_CONFIG_0_SF_PERIODCITY_TAG							0xAB
+#define FAPI_NB_IOT_NPRACH_CONFIG_0_START_TIME_TAG								0xAC
+#define FAPI_NB_IOT_NPRACH_CONFIG_0_SUBCARRIER_OFFSET_TAG						0xAD
+#define FAPI_NB_IOT_NPRACH_CONFIG_0_NUMBER_OF_SUBCARRIERS_TAG					0xAE
+#define FAPI_NB_IOT_NPRACH_CONFIG_0_CP_LENGTH_TAG								0xAD
+#define FAPI_NB_IOT_NPRACH_CONFIG_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG		0xB0
+#define FAPI_NB_IOT_NPRACH_CONFIG_1_ENABLE_TAG									0xB1
+#define FAPI_NB_IOT_NPRACH_CONFIG_1_SF_PERIODCITY_TAG							0xB2
+#define FAPI_NB_IOT_NPRACH_CONFIG_1_START_TIME_TAG								0xB3
+#define FAPI_NB_IOT_NPRACH_CONFIG_1_SUBCARRIER_OFFSET_TAG						0xB4
+#define FAPI_NB_IOT_NPRACH_CONFIG_1_NUMBER_OF_SUBCARRIERS_TAG					0xB5
+#define FAPI_NB_IOT_NPRACH_CONFIG_1_CP_LENGTH_TAG								0xB6
+#define FAPI_NB_IOT_NPRACH_CONFIG_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG		0xB7
+#define FAPI_NB_IOT_NPRACH_CONFIG_2_ENABLE_TAG									0xB8
+#define FAPI_NB_IOT_NPRACH_CONFIG_2_SF_PERIODCITY_TAG							0xB9
+#define FAPI_NB_IOT_NPRACH_CONFIG_2_START_TIME_TAG								0xBA
+#define FAPI_NB_IOT_NPRACH_CONFIG_2_SUBCARRIER_OFFSET_TAG						0xBB
+#define FAPI_NB_IOT_NPRACH_CONFIG_2_NUMBER_OF_SUBCARRIERS_TAG					0xBC
+#define FAPI_NB_IOT_NPRACH_CONFIG_2_CP_LENGTH_TAG								0xBD
+#define FAPI_NB_IOT_NPRACH_CONFIG_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG		0xBE
+
+#define FAPI_NB_IOT_THREE_TONE_BASE_SEQUENCE_TAG			0xBF
+#define FAPI_NB_IOT_SIX_TONE_BASE_SEQUENCE_TAG				0xC0
+#define FAPI_NB_IOT_TWELVE_TONE_BASE_SEQUENCE_TAG			0xC1
+#define FAPI_NB_IOT_THREE_TONE_CYCLIC_SHIFT_TAG				0xC2
+#define FAPI_NB_IOT_SIX_TONE_CYCLIC_SHIFT_TAG				0xC3
+#define FAPI_NB_IOT_DL_GAP_CONFIG_ENABLE_TAG				0xC4
+#define FAPI_NB_IOT_DL_GAP_THRESHOLD_TAG					0xC5
+#define FAPI_NB_IOT_DL_GAP_PERIODICITY_TAG					0xC6
+#define FAPI_NB_IOT_DL_GAP_DURATION_COEFFICIENT_TAG			0xC7
+
+//...
+#define FAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG		0xC8
+#define FAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG		0xC9
+#define FAPI_PHY_CAPABILITIES_DL_MODULATION_SUPPORT_TAG		0xCA
+#define FAPI_PHY_CAPABILITIES_UL_MODULATION_SUPPORT_TAG		0xCB
+#define FAPI_PHY_CAPABILITIES_PHY_ANTENNA_CAPABILITY_TAG	0xCC
+#define FAPI_PHY_CAPABILITIES_RELEASE_CAPABILITY_TAG		0xCD
+#define FAPI_PHY_CAPABILITIES_MBSFN_CAPABILITY_TAG			0xCE
+#define FAPI_PHY_CAPABILITIES_LAA_SUPPORT_TAG				0xD1
+#define FAPI_PHY_CAPABILITIES_LAA_PD_SENSING_LBT_SUPPORT_TAG 0xD2
+#define FAPI_PHY_CAPABILITIES_LAA_MULTI_CARRIER_LBT_SUPPORT_TAG	0xD3
+#define FAPI_PHY_CAPABILITIES_LAA_PARTIAL_SF_SUPPORT_TAG	0xD4
+#define FAPI_PHY_CAPABILITIES_NB_IOT_SUPPORT_TAG			0xD5
+#define FAPI_PHY_CAPABILITIES_NB_IOT_OPERATING_MODE_CAPABILITY_TAG 0xD6
+
+#define FAPI_PHY_CAPABILITIES_DATA_REPORT_MODE_TAG			0xF0
+#define FAPI_PHY_SFN_SF_TAG									0xF1
+#define FAPI_PHY_STATE_TAG									0xFA
+
+#define FAPI_MSG_OK											0x0
+#define FAPI_MSG_INVALID_STATE								0x1
+#define FAPI_MSG_INVALID_CONFIG								0x2
+#define FAPI_MSG_SFN_OUT_OF_SYNC							0x3
+#define FAPI_MSG_SUBFRAME_ERR								0x4
+#define FAPI_MSG_BCH_MISSING								0x5
+#define FAPI_MSG_INVALID_SFN								0x6
+#define FAPI_MSG_HI_ERR										0x7
+#define FAPI_MSG_TX_ERR										0x8
+
+#define FAPI_MSG_LBT_NO_PDU_IN_DL_REQ						0x9
+#define FAPI_MSG_LBT_NO_VALID_CONFIG_REQ_RECIEVED			0xA
+#define FAPI_MSG_FAPI_E_LBT_SF_SFN_PASSED_END_SF_SFN		0xB
+#define FAPI_MSG_FAPI_E_LBT_OVERLAP							0xC
+#define FAPI_MSG_BCH_PRESENT								0xD
+#define FAPI_MSG_NBIOT_UNEXPECTED_REQ						0xE
+
+
+// TODO : Work out what the correct maximums should be
+
+// Number of UL/DL configurations, I, as defined by 36.212 section 5.3.3.1.4
+// todo : work out what the max is
+#define FAPI_MAX_UL_DL_CONFIGURATIONS						4
+#define FAPI_MAX_NUM_PHYSICAL_ANTENNAS						4
+#define FAPI_MAX_NUM_SCHEDULED_UES							8
+#define FAPI_MAX_NUM_SUBBANDS								8
+#define FAPI_MAX_ANTENNA_PORT_COUNT							2
+	
+	
+typedef struct {
+	uint8_t message_id;
+	uint16_t length;
+} fapi_header_t;
+
+typedef struct {
+	uint8_t tag;
+	uint8_t length;
+	uint16_t value;
+} fapi_tlv_t;
+
+typedef struct {
+	fapi_header_t header;
+} fapi_param_req_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint8_t error_code;
+	uint8_t number_of_tlvs;
+	fapi_tlv_t tlvs[255];
+} fapi_param_resp_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint8_t number_of_tlvs;
+	fapi_tlv_t tlvs[255];
+} fapi_config_req_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint8_t error_code;
+	uint8_t number_of_invalid_tlvs;
+	uint8_t number_of_missing_tlvs;
+	fapi_tlv_t tlvs[255];
+} fapi_config_resp_t;
+
+typedef struct {
+	fapi_header_t header;
+} fapi_start_req_t;
+
+typedef struct {
+	fapi_header_t header;
+} fapi_stop_req_t;
+
+typedef struct {
+	fapi_header_t header;
+} fapi_stop_ind_t;
+
+typedef struct {
+	uint16_t received_sfn_sf;
+	uint16_t expected_sfn_sf;
+} fapi_sfn_out_of_sync_error_ind_t;
+
+typedef struct {
+	uint16_t received_sfn_sf;
+	uint16_t expected_sfn_sf;
+} fapi_invalid_sfn_error_ind_t;
+
+typedef struct {
+	uint8_t sub_error_code;
+	uint8_t direction;
+	uint16_t rnti;
+	uint8_t pdu_type;
+} fapi_pdu_error_ind_t;
+
+typedef struct {
+	uint8_t sub_error_code;
+	uint8_t phich_lowest_ul_rb_index;
+} fapi_hi_error_ind_t;
+
+typedef struct {
+	uint8_t sub_error_code;
+	uint8_t pdu_index;
+} fapi_tx_error_ind_t;	
+
+typedef struct {
+	fapi_header_t header;
+	uint8_t message_id;
+	uint8_t error_code;
+	union 
+	{
+		fapi_sfn_out_of_sync_error_ind_t	out_of_sync_err;
+		fapi_invalid_sfn_error_ind_t		invalid_sfn_err;
+		fapi_pdu_error_ind_t				pdu_err;
+		fapi_hi_error_ind_t					hi_err;
+		fapi_tx_error_ind_t					tx_err;	
+	};
+} fapi_error_ind_t;
+
+typedef struct {
+	uint32_t handle;
+	uint16_t rnti;
+} fapi_rx_ue_information_t;
+
+typedef struct {
+	uint8_t ul_cqi;
+	uint8_t channel;
+} fapi_ul_cqi_information_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+} fapi_subframe_ind_t;
+
+typedef struct { 
+	uint8_t value_0;
+	uint8_t value_1;
+} fapi_harq_ind_rel8_tdd_harq_data_bundling_t;
+
+typedef struct { 
+	uint8_t value_0;
+	uint8_t value_1;
+	uint8_t value_2;
+	uint8_t value_3;
+} fapi_harq_ind_rel8_tdd_harq_data_multiplexing_t;
+
+typedef struct { 
+	uint8_t value_0;
+} fapi_harq_ind_rel8_tdd_harq_data_special_bundling_t;
+
+typedef struct { 
+	uint8_t mode;
+	uint8_t number_of_ack_nack;
+	union{
+		fapi_harq_ind_rel8_tdd_harq_data_bundling_t			bundling;
+		fapi_harq_ind_rel8_tdd_harq_data_multiplexing_t		multiplex;
+		fapi_harq_ind_rel8_tdd_harq_data_special_bundling_t	special_bundling;
+	} harq_data;
+} fapi_harq_ind_rel8_tdd_pdu_t;
+
+typedef struct { 
+	uint8_t value_0;
+} fapi_harq_ind_rel8_tdd_harq_data_t;
+
+
+typedef struct {
+	uint8_t mode;
+	uint8_t number_of_ack_nack;
+	union{
+		fapi_harq_ind_rel8_tdd_harq_data_t	bundling;
+		fapi_harq_ind_rel8_tdd_harq_data_t	multiplex;
+		fapi_harq_ind_rel8_tdd_harq_data_special_bundling_t	special_bundling;
+		fapi_harq_ind_rel8_tdd_harq_data_t	channel_selection;
+		fapi_harq_ind_rel8_tdd_harq_data_t	format_3;
+	} harq_data[21];
+} fapi_harq_ind_rel9_tdd_pdu_t;
+
+typedef struct {
+	uint8_t mode;
+	uint16_t number_of_ack_nack;
+	union{
+		fapi_harq_ind_rel8_tdd_harq_data_t					bundling;
+		fapi_harq_ind_rel8_tdd_harq_data_t					multiplex;
+		fapi_harq_ind_rel8_tdd_harq_data_special_bundling_t	special_bundling;
+		fapi_harq_ind_rel8_tdd_harq_data_t					channel_selection;
+		fapi_harq_ind_rel8_tdd_harq_data_t			format_3;
+		fapi_harq_ind_rel8_tdd_harq_data_t			format_4;
+		fapi_harq_ind_rel8_tdd_harq_data_t			format_5;
+	} harq_data[22];
+} fapi_harq_ind_rel13_tdd_pdu_t;
+
+typedef struct {
+	uint8_t harq_tb_1;
+	uint8_t harq_tb_2;
+} fapi_harq_ind_rel8_fdd_pdu_t;
+
+typedef struct {
+	uint8_t mode;
+	uint8_t number_of_ack_nack;
+	uint8_t harq_tb_n[10];
+} fapi_harq_ind_rel9_fdd_pdu_t;
+
+typedef struct {
+	uint8_t mode;
+	uint16_t number_of_ack_nack;
+	uint8_t harq_tb_n[22];
+} fapi_harq_ind_rel13_fdd_pdu_t;
+
+typedef struct {
+	fapi_rx_ue_information_t rx_ue_info;
+	union {
+		fapi_harq_ind_rel8_tdd_pdu_t	rel8_tdd_pdu;
+		fapi_harq_ind_rel9_tdd_pdu_t	rel9_tdd_pdu;
+		fapi_harq_ind_rel13_tdd_pdu_t	rel13_tdd_pdu;
+		fapi_harq_ind_rel8_fdd_pdu_t	rel8_fdd_pdu;
+		fapi_harq_ind_rel9_fdd_pdu_t	rel9_fdd_pdu;
+		fapi_harq_ind_rel13_fdd_pdu_t	rel13_fdd_pdu;
+	};
+	fapi_ul_cqi_information_t ul_cqi_info;
+} fapi_harq_ind_pdu_t;
+
+typedef struct {
+	uint16_t number_of_harqs;
+	fapi_harq_ind_pdu_t pdus[32];
+} fapi_harq_ind_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_harq_ind_body_t body;
+} fapi_harq_ind_t;
+
+typedef struct {
+	uint8_t crc_flag;
+} fapi_crc_ind_rel8_pdu_t;
+
+typedef struct {
+	fapi_rx_ue_information_t rx_ue_info;
+	fapi_crc_ind_rel8_pdu_t rel8_pdu;
+} fapi_crc_ind_pdu_t;
+
+typedef struct {
+	uint16_t number_of_crcs;
+	fapi_crc_ind_pdu_t pdus[32];
+} fapi_crc_ind_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_crc_ind_body_t body;
+} fapi_crc_ind_t;
+
+typedef struct {
+	uint16_t length;
+	uint16_t data_offset;
+	uint8_t ul_cqi;
+	uint16_t timing_advance;
+} fapi_rx_ulsch_ind_rel8_pdu_t;
+
+typedef struct {
+	uint16_t timing_advance_r9;
+} fapi_rx_ulsch_ind_rel9_pdu_t;
+
+typedef struct {
+	fapi_rx_ue_information_t rx_ue_info;
+	fapi_rx_ulsch_ind_rel8_pdu_t rel8_pdu;
+	fapi_rx_ulsch_ind_rel9_pdu_t rel9_pdu;
+} fapi_rx_ulsch_ind_pdu_t;
+
+typedef struct {
+	uint16_t number_of_pdus;
+	fapi_rx_ulsch_ind_pdu_t pdus[32];
+	void* data[32];
+} fapi_rx_ulsch_ind_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_rx_ulsch_ind_body_t body;
+} fapi_rx_ulsch_ind_t;
+
+typedef struct {
+	uint16_t length;
+	uint16_t data_offset;
+	uint8_t ul_cqi;
+	uint8_t ri;
+	uint16_t timing_advance;
+} fapi_rx_cqi_ind_rel8_pdu_t;
+
+typedef struct {
+	uint16_t length;
+	uint16_t data_offset;
+	uint8_t ul_cqi;
+	uint8_t number_of_cc_reported;
+	uint8_t ri[5];
+	uint16_t timing_advance;
+	uint16_t timing_advance_r9;
+} fapi_rx_cqi_ind_rel9_pdu_t;
+
+typedef struct {
+	fapi_rx_ue_information_t rx_ue_info;
+	fapi_rx_cqi_ind_rel8_pdu_t rel8_pdu;
+	fapi_rx_cqi_ind_rel9_pdu_t rel9_pdu;
+	fapi_ul_cqi_information_t ul_cqi_info;
+} fapi_rx_cqi_ind_pdu_t;
+
+typedef struct {
+	uint16_t number_of_pdus;
+	fapi_rx_cqi_ind_pdu_t pdus[32];
+	uint8_t* data[32];
+} fapi_rx_cqi_ind_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_rx_cqi_ind_body_t body;
+} fapi_rx_cqi_ind_t;
+
+typedef struct {
+	fapi_rx_ue_information_t rx_ue_info;
+	fapi_ul_cqi_information_t ul_cqi_info;
+} fapi_rx_sr_ind_pdu_t;
+
+typedef struct {
+	uint16_t number_of_srs;
+	fapi_rx_sr_ind_pdu_t pdus[32];
+} fapi_rx_sr_ind_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_rx_sr_ind_body_t body;
+} fapi_rx_sr_ind_t;
+
+typedef struct {
+	uint16_t rnti;
+	uint8_t preamble;
+	uint16_t timing_advance;
+} fapi_rach_ind_pdu_rel8_t;
+
+typedef struct {
+	uint16_t timing_advance_r9;
+} fapi_rach_ind_pdu_rel9_t;
+
+typedef struct {
+	uint8_t rach_resource_type;
+} fapi_rach_ind_pdu_rel13_t;
+
+typedef struct {
+	fapi_rach_ind_pdu_rel8_t rel8_pdu;
+	fapi_rach_ind_pdu_rel9_t rel9_pdu;
+	fapi_rach_ind_pdu_rel13_t rel13_pdu;
+} fapi_rach_ind_pdu_t;
+
+typedef struct {
+	uint8_t number_of_preambles;
+	fapi_rach_ind_pdu_t pdus[32];
+} fapi_rach_ind_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_rach_ind_body_t body;
+} fapi_rach_ind_t;
+
+
+typedef struct {
+	uint16_t doppler_estimation;
+	uint16_t timing_advance;
+	uint8_t number_of_resource_blocks;
+	uint8_t rb_start;
+	uint8_t snr[100];
+} fapi_srs_ind_rel8_pdu_t;
+
+typedef struct { 
+	uint16_t timing_advance_r9;
+} fapi_srs_ind_rel9_pdu_t;
+
+typedef struct { 
+	uint8_t uppts_symbol;
+} fapi_srs_ind_rel10_tdd_pdu_t;
+
+typedef struct {
+	uint16_t ul_rtoa;
+} fapi_srs_ind_rel11_pdu_t;
+
+typedef struct {
+	uint8_t num_prb_per_subband;
+	uint8_t number_of_subbands;
+	uint8_t num_atennas;
+	struct {
+		uint8_t subband_index;
+		uint16_t channel[FAPI_MAX_NUM_PHYSICAL_ANTENNAS];
+	} subands[FAPI_MAX_NUM_SUBBANDS];
+} fapi_ttd_channel_measurement_t;
+
+typedef struct {
+	fapi_rx_ue_information_t		rx_ue_info;
+	fapi_srs_ind_rel8_pdu_t 		rel8_pdu;
+	fapi_srs_ind_rel9_pdu_t 		rel9_pdu;
+	fapi_srs_ind_rel10_tdd_pdu_t	rel10_tdd_pdu;
+	fapi_srs_ind_rel11_pdu_t		rel11_pdu;
+	fapi_ttd_channel_measurement_t tdd_channel_measurement;
+} fapi_srs_ind_pdu_t;
+
+typedef struct {
+	uint8_t number_of_ues;
+	fapi_srs_ind_pdu_t pdus[32];
+} fapi_srs_ind_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_srs_ind_body_t body;
+} fapi_srs_ind_t;
+
+
+typedef struct {
+	uint32_t handle;
+	uint32_t result;
+	uint32_t lte_txop_symbols;
+	uint32_t initial_partial_sf;
+} fapi_lbt_dl_pdsch_rsp_rel13_pdu_t;
+
+typedef struct {
+	fapi_lbt_dl_pdsch_rsp_rel13_pdu_t	rel13_pdu;
+} fapi_lbt_dl_pdsch_rsp_pdu_t;
+
+typedef struct {
+	uint32_t handle;
+	uint32_t result;
+} fapi_lbt_dl_drs_rsp_rel13_pdu_t;
+
+typedef struct {
+	fapi_lbt_dl_drs_rsp_rel13_pdu_t 	rel13_pdu;
+} fapi_lbt_dl_drs_rsp_pdu_t;
+
+typedef struct {
+	uint8_t pdu_type;
+	uint8_t pdu_size;
+	union {
+		fapi_lbt_dl_pdsch_rsp_pdu_t		lbt_pdsch_rsp_pdu;
+		fapi_lbt_dl_drs_rsp_pdu_t		lbt_drs_rsp_pdu;
+	};
+} fapi_lbt_dl_ind_pdu_t;
+
+typedef struct {
+	uint16_t number_of_pdus;
+	fapi_lbt_dl_ind_pdu_t pdus[32];
+} fapi_lbt_dl_ind_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_lbt_dl_ind_body_t body;
+} fapi_lbt_dl_ind_t;
+
+typedef struct {
+	uint8_t harq_tb1;
+} fapi_nb_harq_ind_rel13_pdu_t;
+
+typedef struct {
+	fapi_rx_ue_information_t rx_ue_info;
+	union {
+		fapi_nb_harq_ind_rel13_pdu_t	rel13_pdu;
+	};
+	fapi_ul_cqi_information_t ul_cqi_info;
+} fapi_nb_harq_ind_pdu_t;
+
+typedef struct {
+	uint16_t number_of_harqs;
+	fapi_nb_harq_ind_pdu_t pdus[32];
+} fapi_nb_harq_ind_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_nb_harq_ind_body_t body;
+} fapi_nb_harq_ind_t;
+
+typedef struct {
+	uint16_t rnti;
+	uint8_t initial_sc;
+	uint16_t timing_advance;
+	uint8_t nrach_cs_level;
+} fapi_nrach_ind_rel13_pdu_t;
+
+typedef struct {
+	fapi_rx_ue_information_t rx_ue_info;
+	union {
+		fapi_nrach_ind_rel13_pdu_t	rel13_pdu;
+	};
+	fapi_ul_cqi_information_t ul_cqi_info;
+} fapi_nrach_ind_pdu_t;
+
+typedef struct {
+	uint16_t number_of_initial_scs_detected;
+	fapi_nrach_ind_pdu_t pdus[32];
+} fapi_nrach_ind_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_nrach_ind_body_t body;
+} fapi_nrach_ind_t;
+
+//------------------------------------------------------------------------------
+
+typedef struct {
+	uint8_t dci_format;
+	uint8_t cce_index;
+	uint8_t aggregation_level;
+	uint16_t rnti;
+	uint8_t resource_allocation_type;
+	uint8_t virtual_resource_block_assignment_flag;
+	uint32_t resource_block_coding;
+	uint8_t mcs_1;
+	uint8_t redundancy_version_1;
+	uint8_t new_data_indicator_1;
+	uint8_t transport_block_to_codeword_swap_flag;
+	uint8_t mcs_2;
+	uint8_t redundancy_version_2;
+	uint8_t new_data_indictor_2;
+	uint8_t harq_process;
+	uint8_t tpmi;
+	uint8_t pmi;
+	uint8_t precoding_information;
+	uint8_t tpc;
+	uint8_t downlink_assignment_index;
+	uint8_t n_gap;
+	uint8_t transport_block_size_index;
+	uint8_t downlink_power_offset;
+	uint8_t allocate_prach_flag;
+	uint8_t preamble_index;
+	uint8_t prach_mask_index;
+	uint8_t rnti_type;
+	uint16_t transmission_power;
+} fapi_dl_config_dci_rel8_pdu_t;
+
+typedef struct {
+	uint8_t mcch_flag;
+	uint8_t mcch_change_notification;
+	uint8_t scrambling_identity;
+} fapi_dl_config_dci_rel9_pdu_t;
+
+typedef struct {
+	uint8_t cross_carrier_scheduling_flag;
+	uint8_t carrier_indicator;
+	uint8_t srs_flag;
+	uint8_t srs_request;
+	uint8_t antenna_ports_scrambling_and_layers;
+	uint8_t total_dci_length_including_padding;
+	uint8_t n_dl_rb;
+} fapi_dl_config_dci_rel10_pdu_t;
+
+typedef struct {
+	uint8_t harq_ack_resource_offset;
+	uint8_t pdsch_re_mapping_quasi_co_location_indicator;
+} fapi_dl_config_dci_rel11_pdu_t;
+
+typedef struct {
+	uint8_t primary_cell_type;
+	uint8_t ul_dl_configuration_flag;
+	uint8_t number_ul_dl_configurations;
+	uint8_t ul_dl_configuration_indication[FAPI_MAX_UL_DL_CONFIGURATIONS];
+} fapi_dl_config_dci_rel12_pdu_t;
+
+
+typedef struct {
+	uint8_t subband_index;
+	uint8_t scheduled_ues;
+	uint16_t precoding_value[FAPI_MAX_NUM_PHYSICAL_ANTENNAS][FAPI_MAX_NUM_SCHEDULED_UES];
+} fapi_dl_config_dci_dl_tpm_subband_info_t;
+
+typedef struct {
+	uint8_t num_prb_per_subband;
+	uint8_t number_of_subbands;
+	uint8_t num_antennas;
+	fapi_dl_config_dci_dl_tpm_subband_info_t subband_info[FAPI_MAX_NUM_SUBBANDS];
+} fapi_dl_config_dci_dl_tpm_t;
+
+typedef struct {
+	uint8_t laa_end_partial_sf_flag;
+	uint8_t laa_end_partial_sf_configuration;
+	uint8_t initial_lbt_sf;
+	uint8_t codebook_size_determination;
+	uint8_t drms_table_flag;
+	uint8_t tpm_struct_flag;
+	fapi_dl_config_dci_dl_tpm_t tpm;
+} fapi_dl_config_dci_rel13_pdu_t;
+
+typedef struct {
+	fapi_dl_config_dci_rel8_pdu_t 	rel8_pdu;
+	fapi_dl_config_dci_rel9_pdu_t 	rel9_pdu;
+	fapi_dl_config_dci_rel10_pdu_t	rel10_pdu;
+	fapi_dl_config_dci_rel11_pdu_t	rel11_pdu;
+	fapi_dl_config_dci_rel12_pdu_t	rel12_pdu;
+	fapi_dl_config_dci_rel13_pdu_t	rel13_pdu;
+} fapi_dl_config_dci_pdu_t;
+
+typedef struct {
+	uint16_t length;
+	uint16_t pdu_index;
+	uint16_t transmission_power;
+} fapi_dl_config_bch_rel8_pdu_t;
+
+typedef struct {
+	fapi_dl_config_bch_rel8_pdu_t rel8_pdu;
+} fapi_dl_config_bch_pdu_t;
+
+typedef struct {
+	uint16_t length;
+	uint16_t pdu_index;
+	uint16_t rnti;
+	uint8_t resource_allocation_type;
+	uint32_t resource_block_coding;
+	uint8_t modulation;
+	uint16_t transmission_power;
+	uint16_t mbsfn_area_id;
+} fapi_dl_config_mch_rel8_pdu_t;
+
+typedef struct {
+	fapi_dl_config_mch_rel8_pdu_t rel8_pdu;
+} fapi_dl_config_mch_pdu_t;
+
+typedef struct {
+	uint8_t subband_index;
+	uint8_t num_atennas;
+	uint16_t bf_value[8];
+} fapi_dl_config_bf_vector_t;
+
+typedef struct {
+	uint16_t length;
+	uint16_t pdu_index;
+	uint16_t rnti;
+	uint8_t resource_allocation_type;
+	uint8_t virtual_resource_block_assignment_flag;
+	uint32_t resource_block_coding;
+	uint8_t modulation;
+	uint8_t redundacy_version;
+	uint8_t transport_blocks;
+	uint8_t transport_block_codeword_swap_flag;
+	uint8_t transmission_scheme;
+	uint8_t number_of_layers;
+	uint8_t nunber_of_subands;
+	uint8_t codebook_index[13];
+	uint8_t ue_category_capacity;
+	uint8_t p_a;
+	uint8_t delta_power_offset_index;
+	uint8_t n_gap;
+	uint8_t n_prb;
+	uint8_t transmission_mode;
+	uint8_t num_bf_prb_per_subband;
+	uint8_t num_bf_vecitor;
+	fapi_dl_config_bf_vector_t bf_vector[8];
+} fapi_dl_config_dlsch_rel8_pdu_t;
+
+typedef struct {
+	uint8_t nscid;
+} fapi_dl_config_dlsch_rel9_pdu_t;
+
+typedef struct {
+	uint8_t csi_rs_flag;
+	uint8_t csi_rs_resource_config_r10;
+	uint16_t csi_rs_zero_tx_power_resource_config_bitmap_r10;
+	uint8_t csi_rs_number_nzp_configuration;
+	uint8_t csi_rs_resource_config[4];
+	uint8_t pdsch_start;
+} fapi_dl_config_dlsch_rel10_pdu_t;
+
+typedef struct {
+	uint8_t drms_config_flag;
+	uint16_t drms_scrambling;
+	uint8_t csi_config_flag;
+	uint16_t csi_scrambling;
+	uint8_t pdsch_re_mapping_flag;
+	uint8_t pdsch_re_mapping_atenna_ports;
+	uint8_t pdsch_re_mapping_freq_shift;
+} fapi_dl_config_dlsch_rel11_pdu_t;
+
+typedef struct {
+	uint8_t altcqi_table_r12;
+	uint8_t maxlayers;
+	uint8_t n_dl_harq;
+} fapi_dl_config_dlsch_rel12_pdu_t;
+
+typedef struct {
+	uint8_t dwpts_symbols;
+	uint8_t initial_lbt_sf;
+	uint8_t ue_type;
+	uint8_t pdsch_payload_type;
+	uint16_t initial_transmission_sf_io;
+	uint8_t drms_table_flag;
+} fapi_dl_config_dlsch_rel13_pdu_t;
+
+typedef struct {
+	fapi_dl_config_dlsch_rel8_pdu_t rel8_pdu;
+	fapi_dl_config_dlsch_rel9_pdu_t rel9_pdu;
+	fapi_dl_config_dlsch_rel10_pdu_t rel10_pdu;
+	fapi_dl_config_dlsch_rel11_pdu_t rel11_pdu;
+	fapi_dl_config_dlsch_rel12_pdu_t rel12_pdu;
+	fapi_dl_config_dlsch_rel13_pdu_t rel13_pdu;
+} fapi_dl_config_dlsch_pdu_t;
+
+typedef struct {
+	uint16_t length;
+	uint16_t pdu_index;
+	uint16_t p_rnti;
+	uint8_t resource_allocation_type;
+	uint8_t virtual_resource_block_assignment_flag;
+	uint32_t resource_block_coding;
+	uint8_t mcs;
+	uint8_t redudancy_version;
+	uint8_t number_of_transport_blocks;
+	uint8_t transport_block_to_codeword_swap_flag;
+	uint8_t transmission_scheme;
+	uint8_t number_of_layers;
+	uint8_t codebook_index;
+	uint8_t ue_category_capacity;
+	uint8_t p_a;
+	uint16_t transmission_power;
+	uint8_t n_prb;
+	uint8_t n_gap;
+} fapi_dl_config_pch_rel8_pdu_t;
+
+typedef struct {
+	uint8_t ue_mode;
+	uint16_t initial_transmission_sf_io;
+} fapi_dl_config_pch_rel13_pdu_t;
+
+typedef struct {
+	fapi_dl_config_pch_rel8_pdu_t	rel8_pdu;
+	fapi_dl_config_pch_rel13_pdu_t	rel13_pdu;
+} fapi_dl_config_pch_pdu_t;
+
+typedef struct {
+	uint16_t transmission_power;
+	uint8_t prs_bandwidth;
+	uint8_t prs_cyclic_prefix_type;
+	uint8_t prs_muting;
+} fapi_dl_config_prs_rel9_pdu_t;
+
+typedef struct {
+	fapi_dl_config_prs_rel9_pdu_t	rel9_pdu;
+} fapi_dl_config_prs_pdu_t;
+
+typedef struct {
+	uint8_t csi_rs_antenna_port_count_r10;
+	uint8_t csi_rs_resource_config_r10;
+	uint16_t transmission_power;
+	uint16_t csi_rs_zero_tx_power_resource_config_bitmap_r10;
+	uint8_t csi_rs_number_of_nzp_configuration;
+	uint8_t csi_rs_resource_config[8];
+} fapi_dl_config_csi_rs_rel10_pdu_t;
+
+typedef struct {
+	uint8_t csi_rs_class;
+	uint8_t cdm_type;
+	uint8_t num_bf_vector;
+	struct {
+		uint8_t csi_rs_resource_index;
+		uint16_t bf_value[FAPI_MAX_ANTENNA_PORT_COUNT];
+	} bf_vector[8];
+}fapi_dl_config_csi_rs_rel13_pdu_t;
+
+typedef struct {
+	fapi_dl_config_csi_rs_rel10_pdu_t	rel10_pdu;
+	fapi_dl_config_csi_rs_rel13_pdu_t	rel13_pdu;
+} fapi_dl_config_csi_rs_pdu_t;
+
+typedef struct {
+	uint8_t edpcch_resource_assigenment_flag;
+	uint16_t edpcch_id;
+	uint8_t epdcch_start_symbol;
+	uint8_t epdcch_num_prb;
+	uint8_t epdcch_prb_index[8];
+	fapi_dl_config_bf_vector_t bf_vector;
+} fapi_dl_config_edpcch_rel11_params_t;
+
+typedef struct {
+	uint8_t dwpts_symbols;
+	uint8_t initial_lbt_sf;
+} fapi_dl_config_edpcch_rel13_params_t;
+
+typedef struct {
+	fapi_dl_config_dci_rel8_pdu_t			rel8_pdu;
+	fapi_dl_config_dci_rel9_pdu_t			rel9_pdu;
+	fapi_dl_config_dci_rel10_pdu_t			rel10_pdu;
+	fapi_dl_config_dci_rel11_pdu_t			rel11_pdu;
+	fapi_dl_config_dci_rel12_pdu_t			rel12_pdu;
+	fapi_dl_config_dci_rel13_pdu_t			rel13_pdu;
+	fapi_dl_config_edpcch_rel11_params_t	rel8_params;
+	fapi_dl_config_edpcch_rel13_params_t	rel13_params;
+} fapi_dl_config_edpcch_pdu_t;
+
+typedef struct {
+	uint8_t mpdcch_narrow_band;
+	uint8_t number_of_prb_pairs;
+	uint8_t resource_block_assignment;
+	uint8_t mpdcch_tansmission_type;
+	uint8_t start_symbol;
+	uint8_t ecce_index;
+	uint8_t aggregation_level;
+	uint8_t rnti_type;
+	uint16_t rnti;
+	uint8_t ce_mode;
+	uint16_t drms_scrambling_init;
+	uint16_t initial_transmission_sf_io;
+	uint16_t transmission_power;
+	uint8_t dci_format;
+	uint16_t resource_block_coding;
+	uint8_t mcs;
+	uint8_t pdsch_reptition_levels;
+	uint8_t redundancy_version;
+	uint8_t new_data_indicator;
+	uint8_t harq_process;
+	uint8_t tpmi_length;
+	uint8_t tpmi;
+	uint8_t pmi_flag;
+	uint8_t pmi;
+	uint8_t harq_resource_offset;
+	uint8_t dci_subframe_repetition_number;
+	uint8_t tpc;
+	uint8_t downlink_assignment_index_length;
+	uint8_t downlink_assignment_index;
+	uint8_t allocate_prach_flag;
+	uint8_t preamble_index;
+	uint8_t prach_mask_index;
+	uint8_t starting_ce_level;
+	uint8_t srs_request;
+	uint8_t antenna_ports_and_scrambling_identity_flag;
+	uint8_t antenna_ports_and_scrambling_identity;
+	uint8_t frequency_hopping_enabled_flag;
+	uint8_t paging_direct_indication_differentiation_flag;
+	uint8_t direct_indication;
+	uint8_t total_dci_length_including_padding;
+	uint8_t number_of_tx_antenna_ports;
+	uint16_t precoding_value[8];
+} fapi_dl_config_mdpcch_rel13_pdu_t;
+
+typedef struct {
+	fapi_dl_config_mdpcch_rel13_pdu_t	rel13_pdu;
+} fapi_dl_config_mdpcch_pdu_t;
+
+typedef struct {
+	uint16_t length;
+	uint16_t pdu_index;
+	uint16_t transmission_power;
+	uint16_t hyper_sfn_2_lsbs;
+} fapi_dl_config_nbch_rel13_pdu_t;
+
+typedef struct {
+	fapi_dl_config_nbch_rel13_pdu_t		rel13_pdu;
+} fapi_dl_config_nbch_pdu_t;
+
+typedef struct {
+	uint16_t length;
+	uint16_t pdu_index;
+	uint8_t ncce_index;
+	uint8_t aggregation_level;
+	uint8_t start_symbol;
+	uint8_t rnti_type;
+	uint16_t rnti;
+	uint8_t scrambling_reinitialization_batch_index;
+	uint8_t nrs_antenna_ports_assumed_by_the_ue;
+	uint8_t dci_format;
+	uint8_t scheduling_delay;
+	uint8_t resource_assignment;
+	uint8_t repetition_number;
+	uint8_t mcs;
+	uint8_t new_data_indicator;
+	uint8_t harq_ack_resource;
+	uint8_t npdcch_order_indication;
+	uint8_t starting_number_of_nprach_repetitions;
+	uint8_t subcarrier_indication_of_nprach;
+	uint8_t paging_direct_indication_differentation_flag;
+	uint8_t direct_indication;
+	uint8_t dci_subframe_repetition_number;
+	uint8_t total_dci_length_including_padding;
+} fapi_dl_config_npdcch_rel13_pdu_t;
+
+typedef struct {
+	fapi_dl_config_npdcch_rel13_pdu_t	rel13_pdu;
+} fapi_dl_config_npdcch_pdu_t;
+
+typedef struct {
+	uint16_t length;
+	uint16_t pdu_index;
+	uint8_t start_symbol;
+	uint8_t rnti_type;
+	uint16_t rnti;
+	uint16_t resource_assignment;
+	uint16_t repetition_number;
+	uint8_t modulation;
+	uint8_t number_of_subframes_for_resource_assignment;
+	uint8_t scrambling_sequence_initialization_cinit;
+	uint16_t sf_idx;
+	uint8_t nrs_antenna_ports_assumed_by_the_ue;
+} fapi_dl_config_ndlsch_rel13_pdu_t;
+
+typedef struct {
+	fapi_dl_config_ndlsch_rel13_pdu_t	rel13_pdu;
+} fapi_dl_config_ndlsch_pdu_t;
+
+typedef struct {
+	uint8_t pdu_type;
+	uint8_t pdu_size;
+	union
+	{
+		fapi_dl_config_dci_pdu_t	dci_dl_pdu;
+		fapi_dl_config_bch_pdu_t	bch_pdu;
+		fapi_dl_config_mch_pdu_t	mch_pdu;
+		fapi_dl_config_dlsch_pdu_t	dlsch_pdu;
+		fapi_dl_config_pch_pdu_t	pch_pdu;
+		fapi_dl_config_prs_pdu_t	prs_pdu;
+		fapi_dl_config_csi_rs_pdu_t	csirs_pdu;
+		fapi_dl_config_edpcch_pdu_t edpcch_pdu;
+		fapi_dl_config_mdpcch_pdu_t mdpcch_pdu;
+		fapi_dl_config_nbch_pdu_t   nbch_pdu;
+		fapi_dl_config_npdcch_pdu_t npdcch_pdu;
+		fapi_dl_config_ndlsch_pdu_t ndlsch_pdu;
+	};
+} fapi_dl_config_req_pdu_t;
+
+typedef struct {
+	uint8_t number_of_pdcch_ofdm_symbols;
+	uint8_t number_of_dcis;
+	uint16_t number_of_pdus;
+	uint8_t number_of_pdsch_rntis;
+	uint16_t transmission_power_for_pcfich;
+	fapi_dl_config_req_pdu_t pdus[32];
+} fapi_dl_config_req_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	uint16_t length;
+	fapi_dl_config_req_body_t body;
+} fapi_dl_config_req_t;
+
+typedef struct {
+	uint32_t handle;
+	uint16_t size;
+	uint16_t rnti;
+	uint8_t resource_block_start;
+	uint8_t number_of_resource_blocks;
+	uint8_t modulation_type;
+	uint8_t cyclic_shift_2_for_drms;
+	uint8_t frequency_hopping_enabled_flag;
+	uint8_t frequency_hopping_bits;
+	uint8_t new_data_indication;
+	uint8_t redundancy_version;
+	uint8_t harq_process_number;
+	uint8_t ul_tx_mode;
+	uint8_t current_tx_nb;
+	uint8_t n_srs;
+} fapi_ul_config_req_ulsch_rel8_pdu_t;
+
+typedef struct {
+	uint8_t resource_allocation_type;
+	uint32_t resource_block_coding;
+	uint8_t transport_blocks;
+	uint8_t transmission_scheme;
+	uint8_t number_of_layers;
+	uint8_t codebook_index;
+	uint8_t disable_sequence_hopping_flag;
+} fapi_ul_config_req_ulsch_rel10_pdu_t;
+
+typedef struct {
+	uint8_t virtual_cell_id_enabled_flag;
+	uint16_t npusch_identity;
+	uint8_t dmrs_config_flag;
+	uint16_t ndmrs_csh_identity;
+} fapi_ul_config_req_ulsch_rel11_pdu_t;
+
+typedef struct {
+	uint8_t  ue_type;
+	uint16_t total_number_of_repetitions;
+	uint16_t repetition_number;
+	uint16_t initial_transmission_sf_io;
+	uint8_t  empty_symbols_due_to_re_tunning;
+} fapi_ul_config_req_ulsch_rel13_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ulsch_rel8_pdu_t 	rel8_pdu;
+	fapi_ul_config_req_ulsch_rel10_pdu_t	rel10_pdu;
+	fapi_ul_config_req_ulsch_rel11_pdu_t	rel11_pdu;
+	fapi_ul_config_req_ulsch_rel13_pdu_t	rel13_pdu;
+} fapi_ul_config_req_ulsch_pdu_t;
+
+typedef struct { 
+	uint8_t dl_cqi_pmi_size_rank_1;
+	uint8_t dl_cqi_pmi_size_rank_greater_1;
+	uint8_t ri_size;
+	uint8_t delta_offset_cqi;
+	uint8_t delta_offset_ri;
+} fapi_ul_config_cqi_ri_rel8_information_t;
+
+typedef struct {
+	uint8_t dl_cqi_pmi_ri_size;
+	uint8_t control_type;
+} fapi_ul_config_periodic_cqi_pmi_ri_report_t;
+
+typedef struct {
+	uint8_t number_of_cc;
+	struct {
+		uint8_t ri_size;
+		uint8_t dl_cqi_pmi_size;
+	} cc[5];
+} fapi_ul_config_aperiodic_cqi_pmi_ri_report_t;
+
+typedef struct {
+	uint8_t report_type;
+	uint8_t delta_offset_cqi;
+	uint8_t delta_offset_ri;
+	union {
+		fapi_ul_config_periodic_cqi_pmi_ri_report_t periodic_cqi_pmi_ri_report;
+		fapi_ul_config_aperiodic_cqi_pmi_ri_report_t aperiodic_cqi_pmi_ri_report;
+	};
+} fapi_ul_config_cqi_ri_rel9_information_t;
+
+typedef struct {
+	uint16_t dl_cqi_pmi_ri_size_2;
+} fapi_ul_config_periodic_cqi_pmi_ri_report_re13_t;
+
+typedef struct {
+} fapi_ul_config_aperiodic_cqi_pmi_ri_report_re13_t;
+
+
+typedef struct {
+	union {
+		fapi_ul_config_periodic_cqi_pmi_ri_report_re13_t periodic_cqi_pmi_ri_report;
+		fapi_ul_config_aperiodic_cqi_pmi_ri_report_re13_t aperiodic_cqi_pmi_ri_report;
+	};
+} fapi_ul_config_cqi_ri_rel13_information_t;
+
+typedef struct {
+	fapi_ul_config_cqi_ri_rel8_information_t	rel8_info;
+	fapi_ul_config_cqi_ri_rel9_information_t	rel9_cqi_ri_info;
+	fapi_ul_config_cqi_ri_rel13_information_t	rel13_cqi_ri_info;
+} fapi_ul_config_cqi_ri_information_t;
+
+typedef struct { 
+	uint8_t n_srs_initial;
+	uint8_t initial_number_of_resource_blocks;
+} fapi_ul_config_init_tx_rel8_params_t;
+
+typedef struct {
+	fapi_ul_config_init_tx_rel8_params_t rel8_params;
+} fapi_ul_config_init_tx_params_t;
+
+typedef struct { 
+	uint8_t harq_size;
+	uint8_t delta_offset_harq;
+	uint8_t ack_nack_mode;
+} fapi_ul_config_harq_rel10_information_t;
+
+typedef struct {
+	uint16_t harq_size_2;
+	uint8_t delta_offset_harq_2;
+} fapi_ul_config_harq_rel13_information_t;
+
+typedef struct {
+	fapi_ul_config_harq_rel10_information_t rel10_info;
+	fapi_ul_config_harq_rel13_information_t rel13_info;
+} fapi_ul_config_harq_information_t;
+
+typedef struct { 
+	uint32_t handle;
+	uint16_t rnti;
+} fapi_ul_config_req_ue_rel8_info_t;
+
+typedef struct {
+	uint8_t virtual_cell_id_enabled_flag;
+	uint16_t npusch_identity;
+} fapi_ul_config_req_ue_rel11_info_t;
+
+typedef struct {
+	uint8_t  ue_type;
+	uint8_t  empty_symbols;
+	uint16_t total_number_of_repetitions;
+	uint16_t repetition_number;
+} fapi_ul_config_req_ue_rel13_info_t;
+
+typedef struct {
+	fapi_ul_config_req_ue_rel8_info_t rel8_info;
+	fapi_ul_config_req_ue_rel11_info_t rel11_info;
+	fapi_ul_config_req_ue_rel13_info_t rel13_info;
+} fapi_ul_config_req_ue_info_t;
+
+typedef struct { 
+	uint16_t pucch_index;
+	uint8_t dl_cqi_pmi_size;
+} fapi_ul_config_req_cqi_rel8_info_t;
+
+typedef struct {
+	uint8_t number_of_pucch_resource;
+	uint16_t pucch_index_p1;
+} fapi_ul_config_req_cqi_rel10_info_t;
+
+typedef struct {
+	uint8_t csi_mode;
+	uint16_t dl_cqi_pmi_size_2;
+	uint8_t starting_prb;
+	uint8_t n_prb;
+	uint8_t cdm_index;
+	uint8_t n_srs;
+} fapi_ul_config_req_cqi_rel13_info_t;
+
+typedef struct {
+	fapi_ul_config_req_cqi_rel8_info_t rel8_info;
+	fapi_ul_config_req_cqi_rel10_info_t rel10_info;
+	fapi_ul_config_req_cqi_rel13_info_t rel13_info;
+} fapi_ul_config_req_cqi_info_t;
+
+typedef struct { 
+	uint16_t pucch_index;
+} fapi_ul_config_req_sr_rel8_info_t;
+
+typedef struct {
+	uint8_t number_of_pucch_resources;
+	uint16_t pucch_index_p1;
+} fapi_ul_config_req_sr_rel10_info_t;
+
+typedef struct {
+	fapi_ul_config_req_sr_rel8_info_t rel8_info;
+	fapi_ul_config_req_sr_rel10_info_t rel10_info;
+} fapi_ul_config_req_sr_info_t;
+
+typedef struct {
+	uint8_t harq_size;
+	uint8_t ack_nack_mode;
+	uint8_t number_of_pucch_resources;
+	uint16_t n_pucch_1_0;
+	uint16_t n_pucch_1_1;
+	uint16_t n_pucch_1_2;
+	uint16_t n_pucch_1_3;
+} fapi_ul_config_req_harq_rel10_tdd_info_t;
+
+typedef struct {
+	uint16_t n_pucch_1_0;
+	uint8_t harq_size;
+} fapi_ul_config_req_harq_rel8_fdd_info_t;
+
+typedef struct {
+	uint8_t harq_size;
+	uint8_t ack_nack_mode;
+	uint8_t number_of_pucch_resources;
+	uint16_t n_pucch_1_0;
+	uint16_t n_pucch_1_1;
+	uint16_t n_pucch_1_2;
+	uint16_t n_pucch_1_3;
+} fapi_ul_config_req_harq_rel9_fdd_info_t;
+
+typedef struct {
+	uint8_t  num_ant_ports;
+	uint16_t n_pucch_2_0;
+	uint16_t n_pucch_2_1;
+	uint16_t n_pucch_2_2;
+	uint16_t n_pucch_2_3;	
+} fapi_ul_config_req_harq_rel11_fdd_tdd_info_t;
+
+typedef struct {
+	uint16_t  harq_size_2;
+	uint8_t starting_prb;
+	uint8_t n_prb;
+	uint8_t cdm_index;
+	uint8_t n_srs;
+} fapi_ul_config_req_harq_rel13_fdd_tdd_info_t;
+
+typedef struct {
+	fapi_ul_config_req_harq_rel10_tdd_info_t		rel10_tdd_info;
+	fapi_ul_config_req_harq_rel8_fdd_info_t			rel8_fdd_info;
+	fapi_ul_config_req_harq_rel9_fdd_info_t			rel9_fdd_info;
+	fapi_ul_config_req_harq_rel11_fdd_tdd_info_t	rel11_fdd_tdd_info;
+	fapi_ul_config_req_harq_rel13_fdd_tdd_info_t	rel13_fdd_tdd_info;
+} fapi_ul_config_req_harq_info_t;
+
+typedef struct {
+	fapi_ul_config_req_ulsch_pdu_t		ulsch_pdu;
+	fapi_ul_config_cqi_ri_information_t cqi_ri_info;
+	fapi_ul_config_init_tx_params_t		init_tx_params;
+} fapi_ul_config_req_ulsch_cqi_ri_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ulsch_pdu_t		ulsch_pdu;
+	fapi_ul_config_harq_information_t	harq_info;
+	fapi_ul_config_init_tx_params_t		init_tx_params;
+} fapi_ul_config_req_ulsch_harq_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ulsch_pdu_t		ulsch_pdu;
+	fapi_ul_config_cqi_ri_information_t cqi_ri_info;
+	fapi_ul_config_harq_information_t	harq_info;
+	fapi_ul_config_init_tx_params_t		init_tx_params;
+} fapi_ul_config_req_ulsch_cqi_harq_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ue_info_t		ue_info;
+	fapi_ul_config_req_cqi_info_t		cqi_info;
+} fapi_ul_config_req_uci_cqi_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ue_info_t		ue_info;
+	fapi_ul_config_req_sr_info_t		sr_info;
+} fapi_ul_config_req_uci_sr_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ue_info_t		ue_info;
+	fapi_ul_config_req_harq_info_t		harq_info;
+} fapi_ul_config_req_uci_harq_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ue_info_t		ue_info;
+	fapi_ul_config_req_sr_info_t		sr_info;
+	fapi_ul_config_req_harq_info_t		harq_info;
+} fapi_ul_config_req_uci_sr_harq_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ue_info_t		ue_info;
+	fapi_ul_config_req_cqi_info_t		cqi_info;
+	fapi_ul_config_req_harq_info_t		harq_info;
+} fapi_ul_config_req_uci_cqi_harq_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ue_info_t		ue_info;
+	fapi_ul_config_req_cqi_info_t		cqi_info;
+	fapi_ul_config_req_sr_info_t		sr_info;
+} fapi_ul_config_req_uci_cqi_sr_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ue_info_t		ue_info;
+	fapi_ul_config_req_cqi_info_t		cqi_info;
+	fapi_ul_config_req_sr_info_t		sr_info;
+	fapi_ul_config_req_harq_info_t		harq_info;
+} fapi_ul_config_req_uci_cqi_sr_harq_pdu_t;
+
+typedef struct {
+	uint32_t handle;
+	uint16_t size;
+	uint16_t rnti;
+	uint8_t srs_bandwidth;
+	uint8_t frqeuency_domain_position;
+	uint8_t srs_hopping_bandwidth;
+	uint8_t transmission_comb;
+	uint16_t srs_config_index;
+	uint8_t sounding_reference_cyclic_shift;
+} fapi_ul_config_req_srs_rel8_pdu_t;
+
+typedef struct { 
+	uint8_t antenna_port;
+} fapi_ul_config_req_srs_rel10_pdu_t;
+
+typedef struct {
+	uint8_t number_of_combs;
+} fapi_ul_config_req_srs_rel13_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_srs_rel8_pdu_t rel8_pdu;
+	fapi_ul_config_req_srs_rel10_pdu_t rel10_pdu;
+	fapi_ul_config_req_srs_rel13_pdu_t rel13_pdu;
+} fapi_ul_config_req_srs_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ue_info_t		ue_info;
+} fapi_ul_config_req_harq_buffer_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ulsch_pdu_t		ulsch_pdu;
+	fapi_ul_config_req_cqi_info_t 	csi_information;
+} fapi_ul_config_req_ulsch_uci_csi_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ulsch_pdu_t		ulsch_pdu;
+	fapi_ul_config_req_harq_info_t		harq_information;
+} fapi_ul_config_req_ulsch_uci_harq_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_ulsch_pdu_t		ulsch_pdu;
+	fapi_ul_config_req_cqi_info_t 		csi_information;
+	fapi_ul_config_req_harq_info_t		harq_information;
+} fapi_ul_config_req_ulsch_csi_uci_harq_pdu_t;
+
+typedef struct {
+	uint8_t harq_ack_resource;
+} fapi_ul_config_req_nb_harq_rel13_info_t;
+
+typedef struct {
+	fapi_ul_config_req_nb_harq_rel13_info_t	nb_harq_pdu_rel13;
+} fapi_ul_config_req_nb_harq_info_t;
+
+typedef struct {
+	uint8_t nulsch_format;
+	uint32_t handle;
+	uint16_t size;
+	uint16_t rnti;
+	uint8_t subcarrier_indication;
+	uint8_t resource_assignment;
+	uint8_t mcs;
+	uint8_t redudancy_version;
+	uint8_t repetition_number;
+	uint8_t new_data_indication;
+	uint8_t n_srs;
+	uint16_t scrambling_sequence_initialization_cinit;
+	uint16_t sf_idx;
+	fapi_ul_config_req_ue_info_t ue_information;
+	fapi_ul_config_req_nb_harq_info_t nb_harq_information;
+} fapi_ul_config_req_nulsch_rel13_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_nulsch_rel13_pdu_t	nulsch_pdu_rel13;
+} fapi_ul_config_req_nulsch_pdu_t;
+
+typedef struct {
+	uint8_t nprach_config_0;
+	uint8_t nprach_config_1;
+	uint8_t nprach_config_2;
+} fapi_ul_config_req_nrach_rel13_pdu_t;
+
+typedef struct {
+	fapi_ul_config_req_nrach_rel13_pdu_t	nrach_pdu_rel13;
+} fapi_ul_config_req_nrach_pdu_t;
+
+typedef struct { 
+	uint8_t pdu_type;
+	uint8_t pdu_size;
+	union
+	{
+		fapi_ul_config_req_ulsch_pdu_t				ulsch_pdu;
+		fapi_ul_config_req_ulsch_cqi_ri_pdu_t		ulsch_cqi_ri_pdu;
+		fapi_ul_config_req_ulsch_harq_pdu_t			ulsch_harq_pdu;
+		fapi_ul_config_req_ulsch_cqi_harq_pdu_t		ulsch_cqi_harq_pdu;
+		fapi_ul_config_req_uci_cqi_pdu_t			uci_cqi_pdu;
+		fapi_ul_config_req_uci_sr_pdu_t				uci_sr_pdu;
+		fapi_ul_config_req_uci_harq_pdu_t			uci_harq_pdu;
+		fapi_ul_config_req_uci_sr_harq_pdu_t		uci_sr_harq_pdu;
+		fapi_ul_config_req_uci_cqi_harq_pdu_t		uci_cqi_harq_pdu;
+		fapi_ul_config_req_uci_cqi_sr_pdu_t			uci_cqi_sr_pdu;
+		fapi_ul_config_req_uci_cqi_sr_harq_pdu_t	uci_cqi_sr_harq_pdu;
+		fapi_ul_config_req_srs_pdu_t				srs_pdu;
+		fapi_ul_config_req_harq_buffer_pdu_t		harq_buffer_pdu;
+		fapi_ul_config_req_ulsch_uci_csi_pdu_t		ulsch_uci_csi_pdu;
+		fapi_ul_config_req_ulsch_uci_harq_pdu_t		ulsch_uci_harq_pdu;
+		fapi_ul_config_req_ulsch_csi_uci_harq_pdu_t	ulsch_csi_uci_harq_pdu;
+		fapi_ul_config_req_nulsch_pdu_t				nulsch_pdu;
+		fapi_ul_config_req_nrach_pdu_t				nrach_pdu;
+	};
+} fapi_ul_config_req_pdu_t;
+
+typedef struct {
+	uint8_t number_of_pdus;
+	uint8_t rach_prach_frequency_resources;
+	uint8_t srs_present;
+	fapi_ul_config_req_pdu_t* pdus;
+} fapi_ul_config_req_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	uint16_t length;
+	fapi_ul_config_req_body_t body;
+} fapi_ul_config_req_t;
+
+typedef struct { 
+	uint8_t dci_format;
+	uint8_t cce_index;
+	uint8_t aggregation_level;
+	uint8_t rnti;
+	uint8_t resource_block_start;
+	uint8_t number_of_resource_blocks;
+	uint8_t mcs_1;
+	uint8_t cyclic_shift_2_for_drms;
+	uint8_t frequency_hopping_enabled_flag;
+	uint8_t frequency_hopping_flags;
+	uint8_t new_data_indication_1;
+	uint8_t ue_tx_antenna_selection;
+	uint8_t tpc;
+	uint8_t cqi_csi_request;
+	uint8_t ul_index;
+	uint8_t dl_assignment_index;
+	uint32_t tpc_bitmap;
+	uint16_t transmission_power;
+} fapi_hi_dci0_req_dci0_rel8_pdu_t;
+
+typedef struct {
+	uint8_t cross_carrier_scheduling_flag;
+	uint8_t carrier_indicator;
+	uint8_t size_of_cqi_csi_feild;
+	uint8_t srs_flag;
+	uint8_t srs_request;
+	uint8_t resource_allocation_flag;
+	uint8_t resource_allocation_type;
+	uint32_t resource_block_coding;
+	uint8_t mcs_2;
+	uint8_t new_data_indication_2;
+	uint8_t number_of_antenna_ports;
+	uint8_t tpmi;
+	uint8_t total_dci_length_including_padding;
+	uint8_t n_ul_rb;
+} fapi_hi_dci0_req_dci0_rel10_pdu_t;
+
+typedef struct {
+	uint8_t pscch_resource;
+	uint8_t time_resource_pattern;
+} fapi_hi_dci0_req_dci0_rel12_pdu_t;
+
+typedef struct {
+	fapi_hi_dci0_req_dci0_rel8_pdu_t rel8_pdu;
+	fapi_hi_dci0_req_dci0_rel10_pdu_t rel10_pdu;
+	fapi_hi_dci0_req_dci0_rel12_pdu_t rel12_pdu;
+} fapi_hi_dci0_req_dci0_pdu_t;
+
+typedef struct {
+	uint8_t resource_block_start;
+	uint8_t cyclic_shift_2_for_drms;
+	uint8_t hi_value;
+	uint8_t i_phich;
+	uint16_t transmission_power;
+} fapi_hi_dci0_req_hi_rel8_pdu_t;
+
+typedef struct {
+	uint8_t flag_tb2;
+	uint8_t hi_value_2;
+} fapi_hi_dci0_req_hi_rel10_pdu_t;
+
+typedef struct {
+	fapi_hi_dci0_req_hi_rel8_pdu_t rel8_pdu;
+	fapi_hi_dci0_req_hi_rel10_pdu_t rel10_pdu;
+} fapi_hi_dci0_req_hi_pdu_t;
+
+typedef struct {
+	fapi_dl_config_dci_rel8_pdu_t			edpcch_dci_pdu_rel8;
+	fapi_dl_config_dci_rel10_pdu_t			edpcch_dci_pdu_rel10;
+	fapi_dl_config_edpcch_rel11_params_t	edpcch_parameters_rel11;
+} fapi_hi_dci0_req_epdcch_dci_ul_pdu_t;
+
+typedef struct {
+	uint8_t mpdcch_narrowband;
+	uint8_t number_of_prb_pairs;
+	uint8_t resource_block_assignment;
+	uint8_t mpdcch_transmission_type;
+	uint8_t start_symbol;
+	uint8_t ecce_index;
+	uint8_t aggreagation_level;
+	uint8_t rnti_type;
+	uint16_t rnti;
+	uint8_t ce_mode;
+	uint16_t drms_scrambling_init;
+	uint16_t initial_transmission_sf_io;
+	uint16_t transmission_power;
+	uint8_t dci_format;
+	uint8_t resource_block_start;
+	uint8_t number_of_resource_blocks;
+	uint8_t mcs;
+	uint8_t pusch_repetition_levels;
+	uint8_t frequency_hopping_flag;
+	uint8_t new_data_indication;
+	uint8_t harq_process;
+	uint8_t redudency_version;
+	uint8_t tpc;
+	uint8_t csi_request;
+	uint8_t ul_inex;
+	uint8_t dai_presence_flag;
+	uint8_t dl_assignment_index;
+	uint8_t srs_request;
+	uint8_t dci_subframe_repetition_number;
+	uint32_t tcp_bitmap;
+	uint8_t total_dci_length_include_padding;
+	uint8_t number_of_tx_antenna_ports;
+	uint16_t precoding_value[FAPI_MAX_ANTENNA_PORT_COUNT];
+} fapi_hi_dci0_req_mpdcch_dci_ul_rel13_pdu_t;
+
+typedef struct {
+	fapi_hi_dci0_req_mpdcch_dci_ul_rel13_pdu_t	mpdcch_dci_pdu_rel13;
+} fapi_hi_dci0_req_mpdcch_dci_ul_pdu_t;
+
+typedef struct {
+	uint8_t ncce_index;
+	uint8_t aggregation_level;
+	uint8_t start_symbol;
+	uint16_t rnti;
+	uint8_t scrambling_reinitialization_batch_index;
+	uint8_t nrs_antenna_ports_assumed_by_the_ue;
+	uint8_t subcarrier_indication;
+	uint8_t resource_assignment;
+	uint8_t scheduling_delay;
+	uint8_t mcs;
+	uint8_t redudancy_version;
+	uint8_t repetition_number;
+	uint8_t new_data_indicator;
+	uint8_t dci_subframe_repetition_number;
+} fapi_hi_dci0_req_npdcch_dci_ul_rel13_pdu_t;
+
+typedef struct {
+	fapi_hi_dci0_req_npdcch_dci_ul_rel13_pdu_t	npdcch_dci_pdu_rel13;
+} fapi_hi_dci0_req_npdcch_dci_ul_pdu_t;
+
+typedef struct {
+	uint8_t pdu_type;
+	uint8_t pdu_size;
+	union 
+	{
+		fapi_hi_dci0_req_hi_pdu_t				hi_pdu;
+		fapi_hi_dci0_req_dci0_pdu_t				dci0_pdu;
+		fapi_hi_dci0_req_epdcch_dci_ul_pdu_t	edpcch_dci_ul_pdu;
+		fapi_hi_dci0_req_mpdcch_dci_ul_pdu_t	mdpcch_dci_ul_pdu;
+		fapi_hi_dci0_req_npdcch_dci_ul_pdu_t	ndpcch_dci_ul_pdu;
+	};
+} fapi_hi_dci0_req_pdu_t;
+
+typedef struct {
+	uint16_t sfn_sf;
+	uint8_t number_of_dci;
+	uint8_t number_of_hi;
+	fapi_hi_dci0_req_pdu_t* pdus;
+} fapi_hi_dci0_req_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_hi_dci0_req_body_t body;
+} fapi_hi_dci0_req_t;
+
+typedef struct {
+	uint16_t tag;
+	uint16_t length;
+	uint32_t* value;
+} fapi_tx_req_pdu_tlv_t;
+
+typedef struct {
+	uint16_t pdu_length;
+	uint16_t pdu_index;
+	uint32_t num_tlv;
+	fapi_tx_req_pdu_tlv_t tlvs[32];
+} fapi_tx_req_pdu_t;
+
+typedef struct {
+	uint16_t number_of_pdus;
+	fapi_tx_req_pdu_t* pdus;
+} fapi_tx_req_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	fapi_tx_req_body_t body;
+} fapi_tx_req_t;
+
+typedef struct {
+	uint32_t handle;
+	uint32_t mp_cca;
+	uint32_t n_cca;
+	uint32_t offset;
+	uint32_t lte_txop_sf;
+	uint16_t txop_sfn_sf_end;
+	uint32_t lbt_mode;
+} fapi_lbt_pdsch_req_rel13_pdu_t;
+
+typedef struct {
+	fapi_lbt_pdsch_req_rel13_pdu_t	rel13_pdu;
+} fapi_lbt_pdsch_req_pdu_t;
+
+typedef struct {
+	uint32_t handle;
+	uint32_t offset;
+	uint16_t sfn_sf_end;
+	uint32_t lbt_mode;
+} fapi_lbt_drs_req_rel13_pdu_t;
+
+typedef struct {
+	fapi_lbt_drs_req_rel13_pdu_t	rel13_pdu;
+} fapi_lbt_drs_req_pdu_t;
+
+typedef struct {
+	uint8_t pdu_type;
+	uint8_t pdu_size;
+	union {
+		fapi_lbt_pdsch_req_pdu_t	lbt_pdsch_req_pdu;
+		fapi_lbt_drs_req_pdu_t		lbt_drs_req_pdu;
+	};
+} fapi_lbt_dl_config_req_pdu_t;
+
+typedef struct {
+	uint16_t number_of_pdus;
+	fapi_lbt_dl_config_req_pdu_t pdus[32];
+} fapi_lbt_dl_config_req_body_t;
+
+typedef struct {
+	fapi_header_t header;
+	uint16_t sfn_sf;
+	uint16_t length;
+	fapi_lbt_dl_config_req_body_t body;
+} fapi_lbt_dl_config_req_t;
+
+//------------------------------------------------------------------------------
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
diff --git a/nfapi/open-nFAPI/pnf_sim/inc/fapi_stub.h b/nfapi/open-nFAPI/pnf_sim/inc/fapi_stub.h
new file mode 100644
index 0000000000000000000000000000000000000000..10df46e7ab34ddb297e8200c25cc159eb1a7be19
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf_sim/inc/fapi_stub.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _FAPI_STUB_H_
+#define _FAPI_STUB_H_
+
+#include "fapi_interface.h"
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+typedef struct fapi fapi_t;
+
+typedef struct fapi {
+	void* user_data;
+} fapi_t;
+
+typedef struct {
+	int (*fapi_param_response)(fapi_t* fapi, fapi_param_resp_t* resp);
+	int (*fapi_config_response)(fapi_t* fapi, fapi_config_resp_t* resp);
+
+	int (*fapi_subframe_ind)(fapi_t* fapi, fapi_subframe_ind_t* ind);
+
+	int (*fapi_harq_ind)(fapi_t* fapi, fapi_harq_ind_t* ind);
+	int (*fapi_crc_ind)(fapi_t* fapi, fapi_crc_ind_t* ind);
+	int (*fapi_rx_ulsch_ind)(fapi_t* fapi, fapi_rx_ulsch_ind_t* ind);
+	int (*fapi_rx_cqi_ind)(fapi_t* fapi, fapi_rx_cqi_ind_t* ind);
+	int (*fapi_rx_sr_ind)(fapi_t* fapi, fapi_rx_sr_ind_t* ind);
+	int (*fapi_rach_ind)(fapi_t* fapi, fapi_rach_ind_t* ind);
+	int (*fapi_srs_ind)(fapi_t* fapi, fapi_srs_ind_t* ind);
+	
+	int (*fapi_lbt_dl_ind)(fapi_t* fapi, fapi_lbt_dl_ind_t* ind);
+	int (*fapi_nb_harq_ind)(fapi_t* fapi, fapi_nb_harq_ind_t* ind);
+	int (*fapi_nrach_ind)(fapi_t* fapi, fapi_nrach_ind_t* ind);
+
+} fapi_cb_t;
+
+typedef struct {
+
+	uint16_t duplex_mode;
+	uint16_t dl_channel_bw_support;
+	uint16_t ul_channel_bw_support;
+} fapi_config_t;
+
+fapi_t* fapi_create(fapi_cb_t* callbacks, fapi_config_t* config);
+
+void fapi_start_data(fapi_t* fapi, unsigned rx_port, const char* tx_address, unsigned tx_port);
+
+int fapi_param_request(fapi_t* fapi, fapi_param_req_t* req);
+int fapi_config_request(fapi_t* fapi, fapi_config_req_t* req);
+int fapi_start_request(fapi_t* fapi, fapi_start_req_t* req);
+
+int fapi_dl_config_request(fapi_t* fapi, fapi_dl_config_req_t* req);
+int fapi_ul_config_request(fapi_t* fapi, fapi_ul_config_req_t* req);
+int fapi_hi_dci0_request(fapi_t* fapi, fapi_hi_dci0_req_t* req);
+int fapi_tx_request(fapi_t* fapi, fapi_tx_req_t* req);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
diff --git a/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp b/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..df0ca12305f6ca954c9f02f1874e31c46637022e
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp
@@ -0,0 +1,642 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "fapi_stub.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <ifaddrs.h>
+#include <netdb.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#include <mutex>
+#include <queue>
+#include <list>
+
+struct phy_pdu
+{
+	phy_pdu() : buffer_len(1500), buffer(0), len(0)
+	{
+		buffer = (char*) malloc(buffer_len);
+	}
+	
+	virtual ~phy_pdu()
+	{
+		free(buffer);
+	}
+
+
+	unsigned buffer_len;
+	char* buffer;
+	unsigned len;
+};
+
+class fapi_private 
+{
+		std::mutex mutex;
+		std::queue<phy_pdu*> rx_buffer;
+
+		std::queue<phy_pdu*> free_store;
+	public:
+
+		fapi_private()
+			: byte_count(0), tick(0), first_dl_config(false)
+		{
+		}
+
+		phy_pdu* allocate_phy_pdu()
+		{
+			phy_pdu* pdu = 0;
+			mutex.lock();
+			if(free_store.empty())
+			{
+				pdu = new phy_pdu();
+			}
+			else
+			{
+				pdu = free_store.front();
+				free_store.pop();
+			}
+			mutex.unlock();
+			return pdu;
+		}
+
+		void release_phy_pdu(phy_pdu* pdu)
+		{
+			mutex.lock();
+			free_store.push(pdu);
+			mutex.unlock();
+		}
+
+		bool rx_buffer_empty()
+		{
+			bool empty;
+			mutex.lock();
+			empty = rx_buffer.empty();
+			mutex.unlock();
+
+			return empty;
+		}
+		
+
+		void push_rx_buffer(phy_pdu* buff)
+		{
+			mutex.lock();
+			rx_buffer.push(buff);
+			mutex.unlock();
+		}
+
+		phy_pdu* pop_rx_buffer()
+		{
+			phy_pdu* buff = 0;
+			mutex.lock();
+			if(!rx_buffer.empty())
+			{
+				buff = rx_buffer.front();
+				rx_buffer.pop();
+			}
+			mutex.unlock();
+			return buff;
+		}
+
+		uint32_t byte_count;
+		uint32_t tick;
+		bool first_dl_config;
+
+};
+
+extern "C"
+{
+	typedef struct fapi_internal
+	{
+		fapi_t _public;
+
+		fapi_cb_t callbacks;
+
+		uint8_t state;
+		fapi_config_t config;
+
+		int rx_sock;
+		int tx_sock;
+		struct sockaddr_in tx_addr;
+
+		uint32_t tx_byte_count;
+		uint32_t tick;
+		
+		fapi_private* fapi;
+
+	} fapi_internal_t;
+}
+
+extern void set_thread_priority(int);
+/*
+{
+	pthread_attr_t ptAttr;
+	
+	struct sched_param schedParam;
+	schedParam.__sched_priority = 79;
+	sched_setscheduler(0, SCHED_RR, &schedParam);
+
+	pthread_attr_setschedpolicy(&ptAttr, SCHED_RR);
+
+	pthread_attr_setinheritsched(&ptAttr, PTHREAD_EXPLICIT_SCHED);
+
+	struct sched_param thread_params;
+	thread_params.sched_priority = 20;
+	pthread_attr_setschedparam(&ptAttr, &thread_params);
+}
+*/
+
+void send_uplink_indications(fapi_internal_t* instance, uint16_t sfn_sf)
+{
+	fapi_harq_ind_t harq_ind;
+	(instance->callbacks.fapi_harq_ind)(&(instance->_public), &harq_ind);
+
+	fapi_crc_ind_t crc_ind;
+	crc_ind.header.message_id = FAPI_CRC_INDICATION;
+	crc_ind.header.length = 0; //??;
+	crc_ind.sfn_sf = sfn_sf;
+	crc_ind.body.number_of_crcs = 1;
+	crc_ind.body.pdus[0].rx_ue_info.handle = 0; //??
+	crc_ind.body.pdus[0].rx_ue_info.rnti = 0; //??
+	crc_ind.body.pdus[0].rel8_pdu.crc_flag = 1;
+
+	(instance->callbacks.fapi_crc_ind)(&(instance->_public), &crc_ind);
+
+	if(!instance->fapi->rx_buffer_empty())
+	{
+		fapi_rx_ulsch_ind_t rx_ind;
+		memset(&rx_ind, 0, sizeof(rx_ind));
+		rx_ind.header.message_id = FAPI_RX_ULSCH_INDICATION;
+		rx_ind.sfn_sf = sfn_sf;
+
+
+		phy_pdu* buff = 0;
+		int i = 0;
+		std::list<phy_pdu*> free_list;
+		do
+		{
+			buff = instance->fapi->pop_rx_buffer();
+			if(buff != 0)
+			{
+				if(buff->len == 0)
+				{
+					printf("[FAPI] Buffer length = 0\n");
+				}
+
+				rx_ind.body.pdus[i].rx_ue_info.handle = 0xDEADBEEF;
+				rx_ind.body.pdus[i].rx_ue_info.rnti = 0x4242;
+
+				rx_ind.body.pdus[i].rel8_pdu.length = buff->len;
+				//rx_ind.pdus[i].rel8_pdu.data_offset;
+				//rx_ind.pdus[i].rel8_pdu.ul_cqi;
+				//rx_ind.pdus[i].rel8_pdu.timing_advance;
+
+				rx_ind.body.data[i] = buff->buffer;
+
+				rx_ind.body.number_of_pdus++;
+				i++;
+
+				instance->fapi->byte_count += buff->len;
+
+				free_list.push_back(buff);
+			}
+		}while(buff != 0 && i < 8);
+
+		(instance->callbacks.fapi_rx_ulsch_ind)(&(instance->_public), &rx_ind);
+
+		for(phy_pdu* pdu : free_list)
+		{
+			instance->fapi->release_phy_pdu(pdu);
+			//free(tx_req.tx_request_body.tx_pdu_list[j].segments[0].segment_data);
+		}
+	}
+	else
+	{
+		fapi_rx_ulsch_ind_t rx_ind;
+		memset(&rx_ind, 0, sizeof(rx_ind));
+		rx_ind.header.message_id = FAPI_RX_ULSCH_INDICATION;
+		rx_ind.sfn_sf = sfn_sf;
+		(instance->callbacks.fapi_rx_ulsch_ind)(&(instance->_public), &rx_ind);
+	}
+
+	
+	fapi_rx_cqi_ind_t cqi_ind;
+	cqi_ind.sfn_sf = sfn_sf;
+	(instance->callbacks.fapi_rx_cqi_ind)(&(instance->_public), &cqi_ind);
+
+	fapi_rx_sr_ind_t sr_ind;
+	sr_ind.sfn_sf = sfn_sf;
+	(instance->callbacks.fapi_rx_sr_ind)(&(instance->_public), &sr_ind);
+
+	fapi_rach_ind_t rach_ind;
+	rach_ind.sfn_sf = sfn_sf;
+	(instance->callbacks.fapi_rach_ind)(&(instance->_public), &rach_ind);
+
+	fapi_srs_ind_t srs_ind;
+	srs_ind.sfn_sf = sfn_sf;
+	(instance->callbacks.fapi_srs_ind)(&(instance->_public), &srs_ind);
+	/*
+	nfapi_lbt_dl_indication_t lbt_ind;
+	memset(&lbt_ind, 0, sizeof(lbt_ind));
+	lbt_ind.header.message_id = NFAPI_LBT_DL_INDICATION;
+	lbt_ind.header.phy_id = config->phy_id;
+	lbt_ind.sfn_sf = sfn_sf;
+	nfapi_pnf_p7_lbt_dl_ind(config, &lbt_ind);
+
+	vendor_ext_p7_ind ve_p7_ind;
+	memset(&ve_p7_ind, 0, sizeof(ve_p7_ind));
+	ve_p7_ind.header.message_id = P7_VENDOR_EXT_IND;
+	ve_p7_ind.header.phy_id = config->phy_id;
+	ve_p7_ind.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_p7_vendor_extension(config, &(ve_p7_ind.header));
+	*/
+	
+	fapi_nb_harq_ind_t nb_harq_ind;
+	nb_harq_ind.sfn_sf = sfn_sf;
+	(instance->callbacks.fapi_nb_harq_ind)(&(instance->_public), &nb_harq_ind);
+
+	fapi_nrach_ind_t nrach_ind;
+	nrach_ind.sfn_sf = sfn_sf;
+	(instance->callbacks.fapi_nrach_ind)(&(instance->_public), &nrach_ind);
+
+}
+
+void* fapi_thread_start(void* ptr)
+{
+	set_thread_priority(81);
+
+	fapi_internal_t* instance = (fapi_internal_t*)ptr;
+	uint16_t sfn_sf_dec = 0;
+	uint32_t last_tv_usec = 0;
+	uint32_t last_tv_sec = 0;
+
+	uint32_t millisec;
+	uint32_t last_millisec = -1;
+	uint16_t catchup = 0;
+
+	while(1)
+	{
+		// get the time
+		struct timeval sf_start;
+		(void)gettimeofday(&sf_start, NULL);
+		
+		uint16_t sfn_sf = ((((sfn_sf_dec) / 10) << 4) | (((sfn_sf_dec) - (((sfn_sf_dec) / 10) * 10)) & 0xF));
+		// increment the sfn/sf - for the next subframe
+		sfn_sf_dec++;
+		if(sfn_sf_dec > 10239)
+			sfn_sf_dec = 0;
+
+	
+		fapi_subframe_ind_t ind;
+		ind.sfn_sf = sfn_sf;
+
+		if(instance->fapi->first_dl_config)
+			send_uplink_indications(instance, sfn_sf);
+
+		if(instance->tick == 1000)
+		{
+			if(instance->tx_byte_count > 0)
+			{
+				printf("[FAPI] Tx rate %d bytes/sec\n", instance->tx_byte_count);
+				instance->tx_byte_count = 0;
+			}
+			
+			instance->tick = 0;
+		}
+
+		instance->tick++;
+
+		(instance->callbacks.fapi_subframe_ind)(&(instance->_public), &ind);
+
+		{
+			phy_pdu* pdu = instance->fapi->allocate_phy_pdu();
+			int len = recvfrom(instance->rx_sock, pdu->buffer, pdu->buffer_len, MSG_DONTWAIT, 0, 0);
+			if(len > 0)
+			{
+				pdu->len = len;
+				instance->fapi->push_rx_buffer(pdu);
+			}
+			else
+			{
+				instance->fapi->release_phy_pdu(pdu);
+			}
+		}
+		
+
+		if(catchup)
+		{
+			catchup--;
+		}
+		else
+		{
+			struct timespec now_ts;
+			struct timespec sleep_ts;
+			struct timespec sleep_rem_ts;
+
+			// get the current time
+			clock_gettime(CLOCK_MONOTONIC, &now_ts);
+
+
+			// determine how long to sleep before the start of the next 1ms
+			sleep_ts.tv_sec = 0;
+			sleep_ts.tv_nsec = 1e6 - (now_ts.tv_nsec % 1000000);
+
+			int nanosleep_result = nanosleep(&sleep_ts, &sleep_rem_ts);
+
+			if(nanosleep_result != 0)
+				printf("*** nanosleep failed or was interrupted\n");
+
+
+			clock_gettime(CLOCK_MONOTONIC, &now_ts);
+			millisec = now_ts.tv_nsec / 1e6;
+
+			if(last_millisec != -1 && ((last_millisec + 1 ) % 1000) != millisec)
+			{
+				printf("*** missing millisec %d %d\n", last_millisec, millisec);
+				catchup = millisec - last_millisec - 1;
+			}
+
+			last_millisec = millisec;
+		}
+	}
+}
+
+extern "C"
+{
+	fapi_t* fapi_create(fapi_cb_t* callbacks, fapi_config_t* config)
+	{
+		fapi_internal_t* instance = (fapi_internal*)calloc(1, sizeof(fapi_internal_t));
+		instance->callbacks = *callbacks;
+		instance->config = *config;
+		instance->state = 0;
+
+		instance->fapi = new fapi_private();
+
+		return (fapi_t*)instance;
+	}
+	
+	void fapi_destroy(fapi_t* fapi)
+	{
+		fapi_internal_t* instance = (fapi_internal_t*)fapi;
+		
+		delete instance->fapi;
+		free(instance);
+	}
+
+	void* fapi_rx_thread_start(void* ptr)
+	{
+		set_thread_priority(60);
+
+		fapi_internal_t* instance = (fapi_internal_t*)ptr;
+
+		while(1)
+		{
+			phy_pdu* pdu = instance->fapi->allocate_phy_pdu();
+			int len = recvfrom(instance->rx_sock, pdu->buffer, pdu->buffer_len, 0, 0, 0);
+			if(len > 0)
+			{
+				pdu->len = len;
+				instance->fapi->push_rx_buffer(pdu);
+			}
+			else
+			{
+				instance->fapi->release_phy_pdu(pdu);
+			}
+
+		}
+	}
+
+	void fapi_start_data(fapi_t* fapi, unsigned rx_port, const char* tx_address, unsigned tx_port)
+	{
+		fapi_internal_t* instance = (fapi_internal_t*)fapi;
+
+		printf("[FAPI] Rx Data from %d\n", rx_port);
+		printf("[FAPI] Tx Data to %s:%d\n", tx_address, tx_port);
+
+		instance->rx_sock = socket(AF_INET, SOCK_DGRAM, 0);
+		
+		if(instance->rx_sock < 0)
+		{
+			printf("[FAPI] Failed to create socket\n");
+			return;
+		}
+
+		struct sockaddr_in addr;
+		memset(&addr, 0, sizeof(addr));
+		addr.sin_family = AF_INET;
+		addr.sin_port = htons(rx_port);
+		addr.sin_addr.s_addr = INADDR_ANY;
+		
+		int bind_result = bind(instance->rx_sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
+		
+		if(bind_result == -1)
+		{
+			printf("[FAPI] Failed to bind to port %d\n", rx_port);
+			close(instance->rx_sock);
+			return ;
+		}
+
+		instance->tx_sock = socket(AF_INET, SOCK_DGRAM, 0);
+		instance->tx_addr.sin_family = AF_INET;
+		instance->tx_addr.sin_port = htons(tx_port);
+		instance->tx_addr.sin_addr.s_addr = inet_addr(tx_address);
+
+	}
+
+
+	void fill_tlv(fapi_tlv_t tlvs[], uint8_t count, uint8_t tag, uint8_t len, uint16_t value)
+	{
+		tlvs[count].tag = tag;
+		tlvs[count].value = value;
+		tlvs[count].length = len;
+		
+	}
+
+	int fapi_param_request(fapi_t* fapi, fapi_param_req_t* req)
+	{
+		fapi_internal_t* instance = (fapi_internal_t*)fapi;
+			
+		fapi_param_resp_t resp;
+		resp.header.message_id = FAPI_PARAM_RESPONSE;
+
+		resp.error_code = FAPI_MSG_OK;
+
+		resp.number_of_tlvs = 0;
+		fill_tlv(resp.tlvs, resp.number_of_tlvs++, FAPI_PHY_STATE_TAG, 2, instance->state);
+
+
+		if(instance->state == 0)
+		{
+			if(instance->config.duplex_mode == 0)
+			{
+				// -- TDD
+				// Downlink Bandwidth Support
+				// Uplink Bandwidth Support
+				// Downlink Modulation Support
+				// Uplink Modulation Support
+				// PHY Antenna Capability
+				// Release Capability
+				// MBSFN Capability
+			}
+			else if(instance->config.duplex_mode == 1)
+			{
+				// -- FDD
+				// Downlink Bandwidth Support
+				fill_tlv(resp.tlvs, resp.number_of_tlvs++, FAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG, 2, instance->config.dl_channel_bw_support);
+				// Uplink Bandwidth Support
+				fill_tlv(resp.tlvs, resp.number_of_tlvs++, FAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG, 2, instance->config.ul_channel_bw_support);
+				// Downlink Modulation Support
+				// Uplink Modulation Support
+				// PHY Antenna Capability
+				// Release Capability
+				// MBSFN Capability
+				// LAA Capability
+			}
+		}
+		else
+		{
+			if(instance->config.duplex_mode == 0)
+			{
+				// -- TDD
+				// Downlink Bandwidth Support
+				// Uplink Bandwidth Support
+				// Downlink Modulation Support
+				// Uplink Modulation Support
+				// PHY Antenna Capability
+				// Release Capability
+				// MBSFN Capability
+				// Duplexing Mode
+				// PCFICH Power Offset
+				// P-B
+				// DL Cyclic Prefix Type
+				// UL Cyclic Prefix Type
+				// RF Config
+				// PHICH Config
+				// SCH Config
+				// PRACH Config
+				// PUSCH Config
+				// PUCCH Config
+				// SRS Config
+				// Uplink Reference Signal Config
+				// TDD Frame Structure Config
+				// Data Report Mode
+			}
+			else if(instance->config.duplex_mode == 1)
+			{
+				// FDD
+				// Downlink Bandwidth Support
+				// Uplink Bandwidth Support
+				// Downlink Modulation Support
+				// Uplink Modulation Support
+				// PHY Antenna Capability
+				// Release Capability
+				// MBSFN Capability
+				// LAA Capability
+				// Duplexing Mode
+				// PCFICH Power Offset
+				// P-B
+				// DL Cyclic Prefix Type
+				// UL Cyclic Prefix Type
+				// RF Config
+				// PHICH Config
+				// SCH Config
+				// PRACH Config
+				// PUSCH Config
+				// PUCCH Config
+				// SRS Config
+				// Uplink Reference Signal Config
+				// Data Report Mode
+			}
+		}
+
+
+		//todo fill
+		(instance->callbacks.fapi_param_response)(fapi, &resp);
+
+		return 0;
+	}
+
+	int fapi_config_request(fapi_t* fapi, fapi_config_req_t* req)
+	{
+		fapi_internal_t* instance = (fapi_internal_t*)fapi;
+			
+		fapi_config_resp_t resp;
+		resp.header.message_id = FAPI_CONFIG_RESPONSE;
+		resp.error_code = FAPI_MSG_OK;
+
+		(instance->callbacks.fapi_config_response)(fapi, &resp);
+		return 0;
+	}
+
+	int fapi_start_request(fapi_t* fapi, fapi_start_req_t* req)
+	{
+		fapi_internal_t* instance = (fapi_internal_t*)fapi;
+			
+		pthread_t fapi_thread;
+		pthread_create(&fapi_thread, NULL, &fapi_thread_start, instance);
+		
+		return 0;
+	}
+
+	int fapi_dl_config_request(fapi_t* fapi, fapi_dl_config_req_t* req)
+	{
+		fapi_internal_t* instance = (fapi_internal_t*)fapi;
+		instance->fapi->first_dl_config = true;
+		return 0;
+	}
+	int fapi_ul_config_request(fapi_t* fapi, fapi_ul_config_req_t* req)
+	{
+		fapi_internal_t* instance = (fapi_internal_t*)fapi;
+		return 0;
+	}
+	int fapi_hi_dci0_request(fapi_t* fapi, fapi_hi_dci0_req_t* req)
+	{
+		fapi_internal_t* instance = (fapi_internal_t*)fapi;
+		return 0;
+	}
+	int fapi_tx_request(fapi_t* fapi, fapi_tx_req_t* req)
+	{
+		fapi_internal_t* instance = (fapi_internal_t*)fapi;
+
+		for(int i = 0; i < req->body.number_of_pdus; ++i)
+		{
+			uint16_t len = req->body.pdus[i].pdu_length;
+			uint32_t* data = req->body.pdus[i].tlvs[0].value;
+			//printf("[FAPI] sfnsf:%d len:%d\n", req->sfn_sf,len);
+			//
+			instance->tx_byte_count += len;
+
+			int sendto_result = sendto(instance->tx_sock, data, len, 0, (struct sockaddr*)&(instance->tx_addr), sizeof(instance->tx_addr));
+			
+			if(sendto_result == -1)
+			{
+				// error
+			}
+		}
+
+		return 0;
+	}
+}
+
diff --git a/nfapi/open-nFAPI/pnf_sim/src/main.cpp b/nfapi/open-nFAPI/pnf_sim/src/main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e2622cf3c3636f1021633e1570c8949d31088f8c
--- /dev/null
+++ b/nfapi/open-nFAPI/pnf_sim/src/main.cpp
@@ -0,0 +1,2285 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <unistd.h>
+#include "debug.h"
+#include "nfapi_pnf_interface.h"
+#include "nfapi.h"
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <netinet/in.h>
+#include <assert.h>
+#include <arpa/inet.h>
+
+#include <boost/foreach.hpp>
+#include <boost/property_tree/xml_parser.hpp>
+#include <boost/property_tree/ptree.hpp>
+#include <boost/exception/diagnostic_information.hpp> 
+#include <boost/exception_ptr.hpp> 
+
+
+#include <vendor_ext.h>
+
+#include "fapi_stub.h"
+#include "pool.h"
+
+
+#include <mutex>
+#include <list>
+#include <queue>
+#include <map>
+#include <vector>
+#include <algorithm>
+#include <stdlib.h>
+
+#define NUM_P5_PHY 2
+
+uint16_t phy_antenna_capability_values[] = { 1, 2, 4, 8, 16 };
+
+static uint32_t rand_range(uint32_t min, uint32_t max)
+{
+	return ((rand() % (max + 1 - min)) + min);
+}
+
+
+
+extern "C" nfapi_pnf_param_response_t g_pnf_param_resp;
+
+extern "C" {
+
+
+void* pnf_allocate(size_t size)
+{
+	return (void*)memory_pool::allocate(size);
+}
+
+void pnf_deallocate(void* ptr)
+{
+	memory_pool::deallocate((uint8_t*)ptr);
+}
+
+
+int read_xml(const char *xml_file);
+
+};
+
+class udp_data
+{
+	public:
+		bool enabled;
+		uint32_t rx_port;
+		uint32_t tx_port;
+		std::string tx_addr;
+};
+
+class phy_info
+{
+	public:
+
+		phy_info()
+			: first_subframe_ind(0), fapi(0),
+			  dl_ues_per_subframe(0), ul_ues_per_subframe(0), 
+			  timing_window(0), timing_info_mode(0), timing_info_period(0)
+		{
+			index = 0;
+			id = 0;
+
+			local_port = 0;
+			remote_addr = 0;
+			remote_port = 0;
+	
+			duplex_mode = 0;
+			dl_channel_bw_support = 0;
+			ul_channel_bw_support = 0;
+			num_dl_layers_supported = 0;
+			num_ul_layers_supported = 0;
+			release_supported = 0;
+			nmm_modes_supported = 0;
+		}
+
+		uint16_t index;
+		uint16_t id;
+		std::vector<uint8_t> rfs;
+		std::vector<uint8_t> excluded_rfs;
+
+		udp_data udp;
+
+		std::string local_addr;
+		int local_port;
+
+		char* remote_addr;
+		int remote_port;
+
+		uint8_t duplex_mode;
+		uint16_t dl_channel_bw_support;
+		uint16_t ul_channel_bw_support;
+		uint8_t num_dl_layers_supported;
+		uint8_t num_ul_layers_supported;
+		uint16_t release_supported;
+		uint8_t nmm_modes_supported;
+
+		uint8_t dl_ues_per_subframe;
+		uint8_t ul_ues_per_subframe;
+
+		uint8_t first_subframe_ind;
+
+		// timing information recevied from the vnf
+		uint8_t timing_window;
+		uint8_t timing_info_mode;
+		uint8_t timing_info_period;
+
+		fapi_t* fapi;
+
+};
+
+class rf_info
+{
+	public:
+		uint16_t index;
+		uint16_t band;
+		int16_t max_transmit_power;
+		int16_t min_transmit_power;
+		uint8_t num_antennas_supported;
+		uint32_t min_downlink_frequency;
+		uint32_t max_downlink_frequency;
+		uint32_t max_uplink_frequency;
+		uint32_t min_uplink_frequency;
+};
+
+
+class pnf_info
+{
+	public:
+
+		pnf_info() 
+		: release(13), wireshark_test_mode(0),
+		  max_total_power(0), oui(0)
+					
+		{
+			release = 0;
+	
+			sync_mode = 0;
+			location_mode = 0;
+			dl_config_timing = 0;
+			ul_config_timing = 0;
+			tx_timing = 0;
+			hi_dci0_timing = 0;
+	
+			max_phys = 0;
+			max_total_bw = 0;
+			max_total_dl_layers = 0;
+			max_total_ul_layers = 0;
+			shared_bands = 0;
+			shared_pa = 0;
+			
+		}
+
+		int release;
+		std::vector<phy_info> phys;
+		std::vector<rf_info> rfs;
+
+		uint8_t sync_mode;
+		uint8_t location_mode;
+		uint8_t location_coordinates[6];
+		uint32_t dl_config_timing;
+		uint32_t ul_config_timing;
+		uint32_t tx_timing;
+		uint32_t hi_dci0_timing;
+
+		uint16_t max_phys;
+		uint16_t max_total_bw;
+		uint16_t max_total_dl_layers;
+		uint16_t max_total_ul_layers;
+		uint8_t shared_bands;
+		uint8_t shared_pa;
+		int16_t max_total_power;
+		uint8_t oui;
+		
+		uint8_t wireshark_test_mode;
+
+};
+
+struct pnf_phy_user_data_t
+{
+	uint16_t phy_id;
+	nfapi_pnf_config_t* config;
+	phy_info* phy;
+	nfapi_pnf_p7_config_t* p7_config;
+};
+
+int read_pnf_xml(pnf_info& pnf, const char* xml_file)
+{
+	try
+	{
+		std::ifstream input(xml_file);
+	
+		using boost::property_tree::ptree;
+		ptree pt;
+	
+		read_xml(input, pt);
+		
+		pnf.wireshark_test_mode = pt.get<unsigned>("pnf.wireshark_test_mode", 0);
+	
+		
+		pnf.sync_mode = pt.get<unsigned>("pnf.sync_mode");
+		pnf.location_mode= pt.get<unsigned>("pnf.location_mode");
+		//pnf.sync_mode = pt.get<unsigned>("pnf.location_coordinates");
+	
+		pnf.dl_config_timing= pt.get<unsigned>("pnf.dl_config_timing");
+		pnf.ul_config_timing = pt.get<unsigned>("pnf.ul_config_timing");
+		pnf.tx_timing = pt.get<unsigned>("pnf.tx_timing");
+		pnf.hi_dci0_timing = pt.get<unsigned>("pnf.hi_dci0_timing");
+	
+		pnf.max_phys = pt.get<unsigned>("pnf.max_phys");
+		pnf.max_total_bw = pt.get<unsigned>("pnf.max_total_bandwidth");
+		pnf.max_total_dl_layers = pt.get<unsigned>("pnf.max_total_num_dl_layers");
+		pnf.max_total_ul_layers = pt.get<unsigned>("pnf.max_total_num_ul_layers");
+	
+		pnf.shared_bands = pt.get<unsigned>("pnf.shared_bands");
+		pnf.shared_pa = pt.get<unsigned>("pnf.shared_pas");
+	
+		pnf.max_total_power = pt.get<signed>("pnf.maximum_total_power");
+	
+		//"oui");
+	
+		for(const auto& v : pt.get_child("pnf.phys"))
+		{
+			if(v.first == "phy")
+			{
+				phy_info phy;
+				
+				
+					
+				phy.index = v.second.get<unsigned>("index");
+				phy.local_port = v.second.get<unsigned>("port");
+				phy.local_addr = v.second.get<std::string>("address");
+				phy.duplex_mode = v.second.get<unsigned>("duplex_mode");
+	
+				phy.dl_channel_bw_support = v.second.get<unsigned>("downlink_channel_bandwidth_support");
+				phy.ul_channel_bw_support = v.second.get<unsigned>("uplink_channel_bandwidth_support");
+				phy.num_dl_layers_supported = v.second.get<unsigned>("number_of_dl_layers");
+				phy.num_ul_layers_supported = v.second.get<unsigned>("number_of_ul_layers");
+				phy.release_supported = v.second.get<unsigned>("3gpp_release_supported");
+				phy.nmm_modes_supported = v.second.get<unsigned>("nmm_modes_supported");
+	
+				for(const auto& v2 : v.second.get_child("rfs"))
+				{
+					if(v2.first == "index")
+						phy.rfs.push_back(v2.second.get_value<unsigned>());
+				}
+				for(const auto& v2 : v.second.get_child("excluded_rfs"))
+				{
+					if(v2.first == "index")
+						phy.excluded_rfs.push_back(v2.second.get_value<unsigned>());
+				}
+	
+				boost::optional<const boost::property_tree::ptree&> d = v.second.get_child_optional("data.udp");
+				if(d.is_initialized())
+				{
+					phy.udp.enabled = true;
+					phy.udp.rx_port = d.get().get<unsigned>("rx_port");
+					phy.udp.tx_port = d.get().get<unsigned>("tx_port");
+					phy.udp.tx_addr = d.get().get<std::string>("tx_addr");
+				}
+				else
+				{
+					phy.udp.enabled = false;
+				}
+	
+				phy.dl_ues_per_subframe = v.second.get<unsigned>("dl_ues_per_subframe");
+				phy.ul_ues_per_subframe = v.second.get<unsigned>("ul_ues_per_subframe");
+	
+				pnf.phys.push_back(phy);
+			}
+		}	
+		for(const auto& v : pt.get_child("pnf.rfs"))
+		{
+			if(v.first == "rf")
+			{
+				rf_info rf;
+	
+				rf.index = v.second.get<unsigned>("index");
+				rf.band = v.second.get<unsigned>("band");
+				rf.max_transmit_power = v.second.get<signed>("max_transmit_power");
+				rf.min_transmit_power = v.second.get<signed>("min_transmit_power");
+				rf.num_antennas_supported = v.second.get<unsigned>("num_antennas_supported");
+				rf.min_downlink_frequency = v.second.get<unsigned>("min_downlink_frequency");
+				rf.max_downlink_frequency = v.second.get<unsigned>("max_downlink_frequency");
+				rf.min_uplink_frequency = v.second.get<unsigned>("max_uplink_frequency");
+				rf.max_uplink_frequency = v.second.get<unsigned>("min_uplink_frequency");
+	
+				pnf.rfs.push_back(rf);
+			}
+		}	
+	}
+	catch(std::exception& e)
+	{
+		printf("%s", e.what());
+		return -1;
+	}
+	catch(boost::exception& e)
+	{
+		printf("%s", boost::diagnostic_information(e).c_str());
+		return -1;
+	}
+	
+	return 0;
+}
+
+
+
+void pnf_sim_trace(nfapi_trace_level_t level, const char* message, ...)
+{
+	va_list args;
+	va_start(args, message);
+	vprintf(message, args);
+	va_end(args);
+}
+
+void set_thread_priority(int priority)
+{
+	//printf("%s(priority:%d)\n", __FUNCTION__, priority);
+
+	pthread_attr_t ptAttr;
+	
+	struct sched_param schedParam;
+	schedParam.__sched_priority = priority; //79;
+	if(sched_setscheduler(0, SCHED_RR, &schedParam) != 0)
+	{
+		printf("failed to set SCHED_RR\n");
+	}
+
+	if(pthread_attr_setschedpolicy(&ptAttr, SCHED_RR) != 0)
+	{
+		printf("failed to set pthread SCHED_RR %d\n", errno);
+	}
+
+	pthread_attr_setinheritsched(&ptAttr, PTHREAD_EXPLICIT_SCHED);
+
+	struct sched_param thread_params;
+	thread_params.sched_priority = 20;
+	if(pthread_attr_setschedparam(&ptAttr, &thread_params) != 0)
+	{
+		printf("failed to set sched param\n");
+	}
+}
+
+
+void* pnf_p7_thread_start(void* ptr)
+{
+	set_thread_priority(79);
+
+	nfapi_pnf_p7_config_t* config = (nfapi_pnf_p7_config_t*)ptr;
+	nfapi_pnf_p7_start(config);
+	
+	return 0;
+}
+
+
+
+int pnf_param_request(nfapi_pnf_config_t* config, nfapi_pnf_param_request_t* req)
+{
+	printf("[PNF_SIM] pnf param request\n");
+
+	nfapi_pnf_param_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_PARAM_RESPONSE;
+	resp.error_code = NFAPI_MSG_OK;
+
+	pnf_info* pnf = (pnf_info*)(config->user_data);
+	
+	resp.pnf_param_general.tl.tag = NFAPI_PNF_PARAM_GENERAL_TAG;
+	resp.pnf_param_general.nfapi_sync_mode = pnf->sync_mode;
+	resp.pnf_param_general.location_mode = pnf->location_mode;
+	//uint8_t location_coordinates[NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH];
+	resp.pnf_param_general.dl_config_timing = pnf->dl_config_timing;
+	resp.pnf_param_general.tx_timing = pnf->tx_timing;
+	resp.pnf_param_general.ul_config_timing = pnf->ul_config_timing;
+	resp.pnf_param_general.hi_dci0_timing = pnf->hi_dci0_timing;
+	resp.pnf_param_general.maximum_number_phys = pnf->max_phys;
+	resp.pnf_param_general.maximum_total_bandwidth = pnf->max_total_bw;
+	resp.pnf_param_general.maximum_total_number_dl_layers = pnf->max_total_dl_layers;
+	resp.pnf_param_general.maximum_total_number_ul_layers = pnf->max_total_ul_layers;
+	resp.pnf_param_general.shared_bands = pnf->shared_bands;
+	resp.pnf_param_general.shared_pa = pnf->shared_pa;
+	resp.pnf_param_general.maximum_total_power = pnf->max_total_power;
+	//uint8_t oui[NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH];
+
+	resp.pnf_phy.tl.tag = NFAPI_PNF_PHY_TAG;
+	resp.pnf_phy.number_of_phys = pnf->phys.size();
+	
+	for(int i = 0; i < pnf->phys.size(); ++i)
+	{
+		resp.pnf_phy.phy[i].phy_config_index = pnf->phys[i].index; 
+		resp.pnf_phy.phy[i].downlink_channel_bandwidth_supported = pnf->phys[i].dl_channel_bw_support;
+		resp.pnf_phy.phy[i].uplink_channel_bandwidth_supported = pnf->phys[i].ul_channel_bw_support;
+		resp.pnf_phy.phy[i].number_of_dl_layers_supported = pnf->phys[i].num_dl_layers_supported;
+		resp.pnf_phy.phy[i].number_of_ul_layers_supported = pnf->phys[i].num_ul_layers_supported;
+		resp.pnf_phy.phy[i].maximum_3gpp_release_supported = pnf->phys[i].release_supported;
+		resp.pnf_phy.phy[i].nmm_modes_supported = pnf->phys[i].nmm_modes_supported;
+
+		resp.pnf_phy.phy[i].number_of_rfs = pnf->phys[i].rfs.size();
+		for(int j = 0; j < pnf->phys[i].rfs.size(); ++j)
+		{
+			resp.pnf_phy.phy[i].rf_config[j].rf_config_index = pnf->phys[i].rfs[j];
+		}
+
+		resp.pnf_phy.phy[i].number_of_rf_exclusions = pnf->phys[i].excluded_rfs.size();
+		for(int j = 0; j < pnf->phys[i].excluded_rfs.size(); ++j)
+		{
+			resp.pnf_phy.phy[i].excluded_rf_config[j].rf_config_index = pnf->phys[i].excluded_rfs[j];
+		}
+	}
+
+
+	resp.pnf_rf.tl.tag = NFAPI_PNF_RF_TAG;
+	resp.pnf_rf.number_of_rfs = pnf->rfs.size();
+
+	for(int i = 0; i < pnf->rfs.size(); ++i)
+	{
+		resp.pnf_rf.rf[i].rf_config_index = pnf->rfs[i].index; 
+		resp.pnf_rf.rf[i].band = pnf->rfs[i].band;
+		resp.pnf_rf.rf[i].maximum_transmit_power = pnf->rfs[i].max_transmit_power; 
+		resp.pnf_rf.rf[i].minimum_transmit_power = pnf->rfs[i].min_transmit_power;
+		resp.pnf_rf.rf[i].number_of_antennas_suppported = pnf->rfs[i].num_antennas_supported;
+		resp.pnf_rf.rf[i].minimum_downlink_frequency = pnf->rfs[i].min_downlink_frequency;
+		resp.pnf_rf.rf[i].maximum_downlink_frequency = pnf->rfs[i].max_downlink_frequency;
+		resp.pnf_rf.rf[i].minimum_uplink_frequency = pnf->rfs[i].min_uplink_frequency;
+		resp.pnf_rf.rf[i].maximum_uplink_frequency = pnf->rfs[i].max_uplink_frequency;
+	}
+
+	if(pnf->release >= 10)
+	{
+		resp.pnf_phy_rel10.tl.tag = NFAPI_PNF_PHY_REL10_TAG;
+		resp.pnf_phy_rel10.number_of_phys = pnf->phys.size();
+		
+		for(int i = 0; i < pnf->phys.size(); ++i)
+		{
+			resp.pnf_phy_rel10.phy[i].phy_config_index = pnf->phys[i].index; 
+			resp.pnf_phy_rel10.phy[i].transmission_mode_7_supported = 0;
+			resp.pnf_phy_rel10.phy[i].transmission_mode_8_supported = 1;
+			resp.pnf_phy_rel10.phy[i].two_antenna_ports_for_pucch = 0;
+			resp.pnf_phy_rel10.phy[i].transmission_mode_9_supported = 1;
+			resp.pnf_phy_rel10.phy[i].simultaneous_pucch_pusch = 0;
+			resp.pnf_phy_rel10.phy[i].four_layer_tx_with_tm3_and_tm4 = 1;
+
+		}
+	}
+
+	if(pnf->release >= 11)
+	{
+		resp.pnf_phy_rel11.tl.tag = NFAPI_PNF_PHY_REL11_TAG;
+		resp.pnf_phy_rel11.number_of_phys = pnf->phys.size();
+		
+		for(int i = 0; i < pnf->phys.size(); ++i)
+		{
+			resp.pnf_phy_rel11.phy[i].phy_config_index = pnf->phys[i].index; 
+			resp.pnf_phy_rel11.phy[i].edpcch_supported = 0;
+			resp.pnf_phy_rel11.phy[i].multi_ack_csi_reporting = 1;
+			resp.pnf_phy_rel11.phy[i].pucch_tx_diversity = 0;
+			resp.pnf_phy_rel11.phy[i].ul_comp_supported = 1;
+			resp.pnf_phy_rel11.phy[i].transmission_mode_5_supported = 0;
+		}
+	}
+
+	if(pnf->release >= 12)
+	{
+		resp.pnf_phy_rel12.tl.tag = NFAPI_PNF_PHY_REL12_TAG;
+		resp.pnf_phy_rel12.number_of_phys = pnf->phys.size();
+		
+		for(int i = 0; i < pnf->phys.size(); ++i)
+		{
+			resp.pnf_phy_rel12.phy[i].phy_config_index = pnf->phys[i].index; 
+			resp.pnf_phy_rel12.phy[i].csi_subframe_set = 0;
+			resp.pnf_phy_rel12.phy[i].enhanced_4tx_codebook = 2; // yes this is invalid
+			resp.pnf_phy_rel12.phy[i].drs_supported = 0;
+			resp.pnf_phy_rel12.phy[i].ul_64qam_supported = 1;
+			resp.pnf_phy_rel12.phy[i].transmission_mode_10_supported = 0;
+			resp.pnf_phy_rel12.phy[i].alternative_bts_indices = 1;
+		}
+	}
+
+	if(pnf->release >= 13)
+	{
+		resp.pnf_phy_rel13.tl.tag = NFAPI_PNF_PHY_REL13_TAG;
+		resp.pnf_phy_rel13.number_of_phys = pnf->phys.size();
+		
+		for(int i = 0; i < pnf->phys.size(); ++i)
+		{
+			resp.pnf_phy_rel13.phy[i].phy_config_index = pnf->phys[i].index; 
+			resp.pnf_phy_rel13.phy[i].pucch_format4_supported = 0;
+			resp.pnf_phy_rel13.phy[i].pucch_format5_supported = 1;
+			resp.pnf_phy_rel13.phy[i].more_than_5_ca_support = 0;
+			resp.pnf_phy_rel13.phy[i].laa_supported = 1;
+			resp.pnf_phy_rel13.phy[i].laa_ending_in_dwpts_supported = 0;
+			resp.pnf_phy_rel13.phy[i].laa_starting_in_second_slot_supported = 1;
+			resp.pnf_phy_rel13.phy[i].beamforming_supported = 0;
+			resp.pnf_phy_rel13.phy[i].csi_rs_enhancement_supported = 1;
+			resp.pnf_phy_rel13.phy[i].drms_enhancement_supported = 0;
+			resp.pnf_phy_rel13.phy[i].srs_enhancement_supported = 1;
+		}
+		
+		resp.pnf_phy_rel13_nb_iot.tl.tag = NFAPI_PNF_PHY_REL13_NB_IOT_TAG;
+		resp.pnf_phy_rel13_nb_iot.number_of_phys = pnf->phys.size();		
+		
+		for(int i = 0; i < pnf->phys.size(); ++i)
+		{
+			resp.pnf_phy_rel13_nb_iot.phy[i].phy_config_index = pnf->phys[i].index; 
+			
+			resp.pnf_phy_rel13_nb_iot.phy[i].number_of_rfs = pnf->phys[i].rfs.size();
+			for(int j = 0; j < pnf->phys[i].rfs.size(); ++j)
+			{
+				resp.pnf_phy_rel13_nb_iot.phy[i].rf_config[j].rf_config_index = pnf->phys[i].rfs[j];
+			}
+	
+			resp.pnf_phy_rel13_nb_iot.phy[i].number_of_rf_exclusions = pnf->phys[i].excluded_rfs.size();
+			for(int j = 0; j < pnf->phys[i].excluded_rfs.size(); ++j)
+			{
+				resp.pnf_phy_rel13_nb_iot.phy[i].excluded_rf_config[j].rf_config_index = pnf->phys[i].excluded_rfs[j];
+			}
+			
+			resp.pnf_phy_rel13_nb_iot.phy[i].number_of_dl_layers_supported = pnf->phys[i].num_dl_layers_supported;
+			resp.pnf_phy_rel13_nb_iot.phy[i].number_of_ul_layers_supported = pnf->phys[i].num_ul_layers_supported;
+			resp.pnf_phy_rel13_nb_iot.phy[i].maximum_3gpp_release_supported = pnf->phys[i].release_supported;
+			resp.pnf_phy_rel13_nb_iot.phy[i].nmm_modes_supported = pnf->phys[i].nmm_modes_supported;
+
+		}
+	}
+
+
+	nfapi_pnf_pnf_param_resp(config, &resp);
+	
+	return 0;
+}
+
+int pnf_config_request(nfapi_pnf_config_t* config, nfapi_pnf_config_request_t* req)
+{
+	printf("[PNF_SIM] pnf config request\n");
+
+	pnf_info* pnf = (pnf_info*)(config->user_data);
+
+	for(int i = 0; i < req->pnf_phy_rf_config.number_phy_rf_config_info; ++i)
+	{
+		auto found = std::find_if(pnf->phys.begin(), pnf->phys.end(), [&](phy_info& item)
+								  { return item.index == req->pnf_phy_rf_config.phy_rf_config[i].phy_config_index; });
+
+		if(found != pnf->phys.end())
+		{
+			phy_info& phy = (*found);
+			phy.id = req->pnf_phy_rf_config.phy_rf_config[i].phy_id;
+			printf("[PNF_SIM] pnf config request assigned phy_id %d to phy_config_index %d\n", phy.id, req->pnf_phy_rf_config.phy_rf_config[i].phy_config_index);
+		}
+		else
+		{
+			// did not find the phy
+			printf("[PNF_SIM] pnf config request did not find phy_config_index %d\n", req->pnf_phy_rf_config.phy_rf_config[i].phy_config_index);
+		}
+
+	}
+
+	nfapi_pnf_config_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_CONFIG_RESPONSE;
+	resp.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_pnf_config_resp(config, &resp);
+
+	return 0;
+}
+
+int fapi_param_response(fapi_t* fapi, fapi_param_resp_t* resp)
+{
+	printf("[PNF_SIM] fapi param response\n");
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+
+	nfapi_param_response_t nfapi_resp;
+
+	memset(&nfapi_resp, 0, sizeof(nfapi_resp));
+	nfapi_resp.header.message_id = NFAPI_PARAM_RESPONSE;
+	nfapi_resp.header.phy_id = data->phy_id;
+	nfapi_resp.error_code = resp->error_code;
+
+	for(int i = 0; i < resp->number_of_tlvs; ++i)
+	{
+		switch(resp->tlvs[i].tag)
+		{
+			case FAPI_PHY_STATE_TAG:
+				nfapi_resp.l1_status.phy_state.tl.tag = NFAPI_L1_STATUS_PHY_STATE_TAG;
+				nfapi_resp.l1_status.phy_state.value = resp->tlvs[i].value;
+				nfapi_resp.num_tlv++;
+				break;
+
+			case FAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG:
+				nfapi_resp.phy_capabilities.dl_bandwidth_support.tl.tag = NFAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG;
+				nfapi_resp.phy_capabilities.dl_bandwidth_support.value = resp->tlvs[i].value;
+				nfapi_resp.num_tlv++;
+				break;
+
+			case FAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG:
+				nfapi_resp.phy_capabilities.ul_bandwidth_support.tl.tag = NFAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG;
+				nfapi_resp.phy_capabilities.ul_bandwidth_support.value = resp->tlvs[i].value;
+				nfapi_resp.num_tlv++;
+				break;
+		}
+	}
+	
+	if(1)
+	{
+		// just code to populate all the tlv for testing with wireshark
+		// todo : these should be move up so that they are populated by fapi
+		
+		nfapi_resp.phy_capabilities.dl_modulation_support.tl.tag = NFAPI_PHY_CAPABILITIES_DL_MODULATION_SUPPORT_TAG;
+		nfapi_resp.phy_capabilities.dl_modulation_support.value = rand_range(0, 0x0F);
+		nfapi_resp.num_tlv++;
+		nfapi_resp.phy_capabilities.ul_modulation_support.tl.tag = NFAPI_PHY_CAPABILITIES_UL_MODULATION_SUPPORT_TAG;
+		nfapi_resp.phy_capabilities.ul_modulation_support.value = rand_range(0, 0x07);
+		nfapi_resp.num_tlv++;
+		nfapi_resp.phy_capabilities.phy_antenna_capability.tl.tag = NFAPI_PHY_CAPABILITIES_PHY_ANTENNA_CAPABILITY_TAG;
+		nfapi_resp.phy_capabilities.phy_antenna_capability.value = phy_antenna_capability_values[rand_range(0, 4)];
+		nfapi_resp.num_tlv++;
+		nfapi_resp.phy_capabilities.release_capability.tl.tag = NFAPI_PHY_CAPABILITIES_RELEASE_CAPABILITY_TAG;
+		nfapi_resp.phy_capabilities.release_capability.value = rand_range(0, 0x3F);
+		nfapi_resp.num_tlv++;
+		nfapi_resp.phy_capabilities.mbsfn_capability.tl.tag = NFAPI_PHY_CAPABILITIES_MBSFN_CAPABILITY_TAG;
+		nfapi_resp.phy_capabilities.mbsfn_capability.value = rand_range(0, 1);
+		nfapi_resp.num_tlv++;
+		
+		
+		nfapi_resp.laa_capability.laa_support.tl.tag = NFAPI_LAA_CAPABILITY_LAA_SUPPORT_TAG;
+		nfapi_resp.laa_capability.laa_support.value = rand_range(0, 1);
+		nfapi_resp.num_tlv++;
+		nfapi_resp.laa_capability.pd_sensing_lbt_support.tl.tag = NFAPI_LAA_CAPABILITY_PD_SENSING_LBT_SUPPORT_TAG;
+		nfapi_resp.laa_capability.pd_sensing_lbt_support.value = rand_range(0, 1);		
+		nfapi_resp.num_tlv++;
+		nfapi_resp.laa_capability.multi_carrier_lbt_support.tl.tag = NFAPI_LAA_CAPABILITY_MULTI_CARRIER_LBT_SUPPORT_TAG;
+		nfapi_resp.laa_capability.multi_carrier_lbt_support.value = rand_range(0, 0x0F);		
+		nfapi_resp.num_tlv++;
+		nfapi_resp.laa_capability.partial_sf_support.tl.tag = NFAPI_LAA_CAPABILITY_PARTIAL_SF_SUPPORT_TAG;
+		nfapi_resp.laa_capability.partial_sf_support.value = rand_range(0, 1);		
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.nb_iot_capability.nb_iot_support.tl.tag = NFAPI_LAA_CAPABILITY_NB_IOT_SUPPORT_TAG;
+		nfapi_resp.nb_iot_capability.nb_iot_support.value = rand_range(0, 2);		
+		nfapi_resp.num_tlv++;
+		nfapi_resp.nb_iot_capability.nb_iot_operating_mode_capability.tl.tag = NFAPI_LAA_CAPABILITY_NB_IOT_OPERATING_MODE_CAPABILITY_TAG;
+		nfapi_resp.nb_iot_capability.nb_iot_operating_mode_capability.value = rand_range(0, 1);		
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.subframe_config.pcfich_power_offset.tl.tag = NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.subframe_config.pb.tl.tag = NFAPI_SUBFRAME_CONFIG_PB_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.subframe_config.dl_cyclic_prefix_type.tl.tag = NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.subframe_config.ul_cyclic_prefix_type.tl.tag = NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG;
+		nfapi_resp.num_tlv++;		
+		
+		nfapi_resp.rf_config.dl_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.rf_config.ul_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.rf_config.reference_signal_power.tl.tag = NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.rf_config.tx_antenna_ports.tl.tag = NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.rf_config.rx_antenna_ports.tl.tag = NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG;
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.phich_config.phich_resource.tl.tag = NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.phich_config.phich_duration.tl.tag = NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.phich_config.phich_power_offset.tl.tag = NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG;
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.sch_config.primary_synchronization_signal_epre_eprers.tl.tag = NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.sch_config.secondary_synchronization_signal_epre_eprers.tl.tag = NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.sch_config.physical_cell_id.tl.tag = NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG;
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.prach_config.configuration_index.tl.tag = NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.prach_config.root_sequence_index.tl.tag = NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.prach_config.zero_correlation_zone_configuration.tl.tag = NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.prach_config.high_speed_flag.tl.tag = NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.prach_config.frequency_offset.tl.tag = NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG;
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.pusch_config.hopping_mode.tl.tag = NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.pusch_config.hopping_offset.tl.tag = NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.pusch_config.number_of_subbands.tl.tag = NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG;
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.pucch_config.delta_pucch_shift.tl.tag = NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.pucch_config.n_cqi_rb.tl.tag = NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.pucch_config.n_an_cs.tl.tag = NFAPI_PUCCH_CONFIG_N_AN_CS_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.pucch_config.n1_pucch_an.tl.tag = NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG;
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.srs_config.bandwidth_configuration.tl.tag = NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.srs_config.max_up_pts.tl.tag = NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.srs_config.srs_subframe_configuration.tl.tag = NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.srs_config.srs_acknack_srs_simultaneous_transmission.tl.tag = NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG;
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.uplink_reference_signal_config.uplink_rs_hopping.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.uplink_reference_signal_config.group_assignment.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.uplink_reference_signal_config.cyclic_shift_1_for_drms.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG;
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.tdd_frame_structure_config.subframe_assignment.tl.tag = NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.tdd_frame_structure_config.special_subframe_patterns.tl.tag = NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG;
+		nfapi_resp.num_tlv++;
+		
+		nfapi_resp.l23_config.data_report_mode.tl.tag = NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG;
+		nfapi_resp.num_tlv++;
+		nfapi_resp.l23_config.sfnsf.tl.tag = NFAPI_L23_CONFIG_SFNSF_TAG;
+		nfapi_resp.num_tlv++;
+	}
+		
+
+	{
+		//if(phy->state == NFAPI_PNF_PHY_IDLE)
+		//if(nfapi_resp.l1_status.phy_state.value == NFAPI_PNF_PHY_IDLE)
+		{
+			// -- NFAPI
+			// Downlink UEs per Subframe
+			nfapi_resp.nfapi_config.dl_ue_per_sf.tl.tag = NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG;
+			nfapi_resp.nfapi_config.dl_ue_per_sf.value = data->phy->dl_ues_per_subframe;
+			nfapi_resp.num_tlv++;
+			// Uplink UEs per Subframe
+			nfapi_resp.nfapi_config.ul_ue_per_sf.tl.tag = NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG;
+			nfapi_resp.nfapi_config.ul_ue_per_sf.value = data->phy->ul_ues_per_subframe;
+			nfapi_resp.num_tlv++;
+			// nFAPI RF Bands
+			nfapi_resp.nfapi_config.rf_bands.tl.tag = NFAPI_PHY_RF_BANDS_TAG;
+			nfapi_resp.nfapi_config.rf_bands.number_rf_bands = 2;
+			nfapi_resp.nfapi_config.rf_bands.rf_band[0] = 23;
+			nfapi_resp.nfapi_config.rf_bands.rf_band[1] = 7;
+			
+			// P7 PNF Address IPv4
+			nfapi_resp.nfapi_config.p7_pnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG;
+			struct sockaddr_in pnf_p7_sockaddr;
+			pnf_p7_sockaddr.sin_addr.s_addr = inet_addr(data->phy->local_addr.c_str());
+			memcpy(&(nfapi_resp.nfapi_config.p7_pnf_address_ipv4.address[0]), &pnf_p7_sockaddr.sin_addr.s_addr, 4);
+			nfapi_resp.num_tlv++;
+			// P7 PNF Address IPv6
+			// P7 PNF Port
+			nfapi_resp.nfapi_config.p7_pnf_port.tl.tag = NFAPI_NFAPI_P7_PNF_PORT_TAG;
+			nfapi_resp.nfapi_config.p7_pnf_port.value = data->phy->local_port;
+			nfapi_resp.num_tlv++;
+			// NMM GSM Frequency Bands
+			nfapi_resp.nfapi_config.nmm_gsm_frequency_bands.tl.tag = NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG;
+			nfapi_resp.nfapi_config.nmm_gsm_frequency_bands.number_of_rf_bands = 1;
+			nfapi_resp.nfapi_config.nmm_gsm_frequency_bands.bands[0] = 23;
+			nfapi_resp.num_tlv++;
+			// NMM UMTS Frequency Bands
+			nfapi_resp.nfapi_config.nmm_umts_frequency_bands.tl.tag = NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG;
+			nfapi_resp.nfapi_config.nmm_umts_frequency_bands.number_of_rf_bands = 1;
+			nfapi_resp.nfapi_config.nmm_umts_frequency_bands.bands[0] = 23;
+			nfapi_resp.num_tlv++;
+			// NMM LTE Frequency Bands
+			nfapi_resp.nfapi_config.nmm_lte_frequency_bands.tl.tag = NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG;
+			nfapi_resp.nfapi_config.nmm_lte_frequency_bands.number_of_rf_bands = 1;
+			nfapi_resp.nfapi_config.nmm_lte_frequency_bands.bands[0] = 23;
+			nfapi_resp.num_tlv++;
+			// NMM Uplink RSSI supported
+			nfapi_resp.nfapi_config.nmm_uplink_rssi_supported.tl.tag = NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG;
+			nfapi_resp.nfapi_config.nmm_uplink_rssi_supported.value = 1;
+			nfapi_resp.num_tlv++;
+
+		}
+	}
+
+
+		
+	nfapi_pnf_param_resp(data->config, &nfapi_resp);
+
+	return 0;
+}
+
+int fapi_config_response(fapi_t* fapi, fapi_config_resp_t* resp)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+
+	nfapi_config_response_t nfapi_resp;
+	memset(&nfapi_resp, 0, sizeof(nfapi_resp));
+	nfapi_resp.header.message_id = NFAPI_CONFIG_RESPONSE;
+	nfapi_resp.header.phy_id = data->phy_id;
+	nfapi_resp.error_code = resp->error_code;
+	nfapi_pnf_config_resp(data->config, &nfapi_resp);
+
+	return 0;
+}
+
+int fapi_subframe_ind(fapi_t* fapi, fapi_subframe_ind_t* resp)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+
+	if(data->phy->first_subframe_ind == 0)
+	{
+		printf("Sending nfapi_pnf_start_resp phy_id:%d\n", data->phy_id);
+		nfapi_start_response_t start_resp;
+		memset(&start_resp, 0, sizeof(start_resp));
+		start_resp.header.message_id = NFAPI_START_RESPONSE;
+		start_resp.header.phy_id = data->phy_id;
+		start_resp.error_code = NFAPI_MSG_OK;
+		nfapi_pnf_start_resp(data->config, &start_resp);
+		
+		data->phy->first_subframe_ind = 1;
+
+		if(data->phy->udp.enabled)
+		{
+			fapi_start_data(fapi, 
+							data->phy->udp.rx_port, 
+							data->phy->udp.tx_addr.c_str(), 
+							data->phy->udp.tx_port);
+		}
+	
+	}
+
+
+	nfapi_pnf_p7_subframe_ind(data->p7_config, data->phy_id, resp->sfn_sf);
+	
+	return 0;
+
+}
+
+int fapi_harq_ind(fapi_t* fapi, fapi_harq_ind_t* ind)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+
+	nfapi_harq_indication_t harq_ind;
+	memset(&harq_ind, 0, sizeof(harq_ind));
+	harq_ind.header.message_id = NFAPI_HARQ_INDICATION;
+	harq_ind.header.phy_id = data->p7_config->phy_id;
+	harq_ind.sfn_sf = ind->sfn_sf;
+
+	if(((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+	{
+		harq_ind.harq_indication_body.tl.tag = NFAPI_HARQ_INDICATION_BODY_TAG;
+		harq_ind.harq_indication_body.number_of_harqs = 1;
+	
+		nfapi_harq_indication_pdu_t pdus[harq_ind.harq_indication_body.number_of_harqs];
+		memset(&pdus, 0, sizeof(pdus));
+		
+		pdus[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+		pdus[0].rx_ue_information.handle = rand_range(0, 9999);
+		pdus[0].rx_ue_information.rnti = rand_range(1, 65535);
+		
+		
+		
+		pdus[0].harq_indication_tdd_rel8.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL8_TAG;
+		pdus[0].harq_indication_tdd_rel8.mode = rand_range(0, 4);
+		pdus[0].harq_indication_tdd_rel8.number_of_ack_nack = rand_range(1, 4);
+		
+		switch(pdus[0].harq_indication_tdd_rel8.mode)
+		{
+			case 0:
+			{
+				pdus[0].harq_indication_tdd_rel8.harq_data.bundling.value_0 = rand_range(1, 7);
+				pdus[0].harq_indication_tdd_rel8.harq_data.bundling.value_1 = rand_range(1, 7);
+			}
+			break;
+			case 1:
+			{
+				pdus[0].harq_indication_tdd_rel8.harq_data.multiplex.value_0 = rand_range(1, 7);
+				pdus[0].harq_indication_tdd_rel8.harq_data.multiplex.value_1 = rand_range(1, 7);
+				pdus[0].harq_indication_tdd_rel8.harq_data.multiplex.value_2 = rand_range(1, 7);
+				pdus[0].harq_indication_tdd_rel8.harq_data.multiplex.value_3 = rand_range(1, 7);
+			}
+			break;
+			case 2:
+			{
+				pdus[0].harq_indication_tdd_rel8.harq_data.special_bundling.value_0 = rand_range(1, 7);
+			}
+			break;
+		};
+		
+		
+		pdus[0].harq_indication_tdd_rel9.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL9_TAG;
+		pdus[0].harq_indication_tdd_rel9.mode = rand_range(0, 4);
+		pdus[0].harq_indication_tdd_rel9.number_of_ack_nack = 1;
+		
+		switch(pdus[0].harq_indication_tdd_rel9.mode)
+		{
+			case 0:
+			{		
+				pdus[0].harq_indication_tdd_rel9.harq_data[0].bundling.value_0 = rand_range(1, 7);
+			}
+			break;
+			case 1:
+			{
+				pdus[0].harq_indication_tdd_rel9.harq_data[0].multiplex.value_0 = rand_range(1, 7);
+			}
+			break;
+			case 2:
+			{
+				pdus[0].harq_indication_tdd_rel9.harq_data[0].special_bundling.value_0 = rand_range(1, 7);
+			}
+			break;
+			case 3:
+			{
+				pdus[0].harq_indication_tdd_rel9.harq_data[0].channel_selection.value_0 = rand_range(1, 7);
+			}
+			break;
+			case 4:
+			{
+				pdus[0].harq_indication_tdd_rel9.harq_data[0].format_3.value_0 = rand_range(1, 7);
+			}
+			break;
+		};
+
+	
+	
+		pdus[0].harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
+		pdus[0].harq_indication_tdd_rel13.mode = rand_range(0, 6);
+		pdus[0].harq_indication_tdd_rel13.number_of_ack_nack = 1;
+
+		switch(pdus[0].harq_indication_tdd_rel13.mode)
+		{
+			case 0:
+			{
+				pdus[0].harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = rand_range(1, 7);		
+			}
+			break;
+			case 1:
+			{
+				pdus[0].harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = rand_range(1, 7);
+			}
+			break;			
+			case 2:
+			{
+				pdus[0].harq_indication_tdd_rel13.harq_data[0].special_bundling.value_0 = rand_range(1, 7);
+			}
+			break;			
+			case 3:
+			{
+				pdus[0].harq_indication_tdd_rel13.harq_data[0].channel_selection.value_0 = rand_range(1, 7);
+			}
+			break;			
+			case 4:
+			{
+				pdus[0].harq_indication_tdd_rel13.harq_data[0].format_3.value_0 = rand_range(1, 7);
+			}
+			break;			
+			case 5:
+			{
+				pdus[0].harq_indication_tdd_rel13.harq_data[0].format_4.value_0 = rand_range(1, 7);
+			}
+			break;			
+			case 6:
+			{
+				pdus[0].harq_indication_tdd_rel13.harq_data[0].format_5.value_0 = rand_range(1, 7);
+			}
+			break;			
+		};
+	
+		pdus[0].harq_indication_fdd_rel8.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL8_TAG;
+		pdus[0].harq_indication_fdd_rel8.harq_tb1 = rand_range(1, 7);
+		pdus[0].harq_indication_fdd_rel8.harq_tb2 = rand_range(1, 7);
+		
+		pdus[0].harq_indication_fdd_rel9.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL9_TAG;
+		pdus[0].harq_indication_fdd_rel9.mode = rand_range(0, 2);
+		pdus[0].harq_indication_fdd_rel9.number_of_ack_nack = 2;
+		pdus[0].harq_indication_fdd_rel9.harq_tb_n[0] = rand_range(1, 7);
+		pdus[0].harq_indication_fdd_rel9.harq_tb_n[1] = rand_range(1, 7);
+	
+		pdus[0].harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
+		pdus[0].harq_indication_fdd_rel13.mode = rand_range(0, 2);
+		pdus[0].harq_indication_fdd_rel13.number_of_ack_nack = 2;
+		pdus[0].harq_indication_fdd_rel13.harq_tb_n[0] = rand_range(1, 7);
+		pdus[0].harq_indication_fdd_rel13.harq_tb_n[1] = rand_range(1, 7);
+	
+		pdus[0].ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+		pdus[0].ul_cqi_information.ul_cqi = rand_range(0,255);
+		pdus[0].ul_cqi_information.channel	 = rand_range(0, 1);
+
+		harq_ind.harq_indication_body.harq_pdu_list = pdus;
+		
+		nfapi_pnf_p7_harq_ind(data->p7_config, &harq_ind);	
+	}
+	else
+	{
+
+		harq_ind.harq_indication_body.tl.tag = NFAPI_HARQ_INDICATION_BODY_TAG;
+		harq_ind.harq_indication_body.number_of_harqs = 8;
+	
+		nfapi_harq_indication_pdu_t pdus[8];
+		memset(&pdus, 0, sizeof(pdus));
+	
+		for(int i = 0; i < 8; ++i)
+		{
+			pdus[i].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+			pdus[i].rx_ue_information.handle = 0xFF;
+			pdus[i].rx_ue_information.rnti = i;
+	
+			pdus[i].harq_indication_fdd_rel8.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL8_TAG;
+			pdus[i].harq_indication_fdd_rel8.harq_tb1 = 1;
+			pdus[i].harq_indication_fdd_rel8.harq_tb2 = 2;
+		}
+	
+		harq_ind.harq_indication_body.harq_pdu_list = pdus;
+		
+		nfapi_pnf_p7_harq_ind(data->p7_config, &harq_ind);	
+	}
+	
+	return 0;	
+}
+
+int fapi_crc_ind(fapi_t* fapi, fapi_crc_ind_t* ind)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+
+	nfapi_crc_indication_t crc_ind;
+	memset(&crc_ind, 0, sizeof(crc_ind));
+	crc_ind.header.message_id = NFAPI_CRC_INDICATION;
+	crc_ind.header.phy_id = data->p7_config->phy_id;
+	crc_ind.sfn_sf = ind->sfn_sf;
+	
+	
+	if(((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+	{
+		crc_ind.crc_indication_body.tl.tag = NFAPI_CRC_INDICATION_BODY_TAG;
+		crc_ind.crc_indication_body.number_of_crcs = 1;
+		
+		nfapi_crc_indication_pdu_t pdus[crc_ind.crc_indication_body.number_of_crcs];
+		memset(&pdus, 0, sizeof(pdus));
+		
+		pdus[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+		pdus[0].rx_ue_information.handle = rand_range(0, 9999);
+		pdus[0].rx_ue_information.rnti = rand_range(1, 65535);
+		
+		pdus[0].crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
+		pdus[0].crc_indication_rel8.crc_flag = rand_range(0, 1);
+		
+		crc_ind.crc_indication_body.crc_pdu_list = pdus;
+		nfapi_pnf_p7_crc_ind(data->p7_config, &crc_ind);
+	}
+	else
+	{
+		crc_ind.crc_indication_body.tl.tag = NFAPI_CRC_INDICATION_BODY_TAG;
+		crc_ind.crc_indication_body.number_of_crcs = ind->body.number_of_crcs;
+	
+		crc_ind.crc_indication_body.crc_pdu_list = (nfapi_crc_indication_pdu_t*)malloc(sizeof(nfapi_crc_indication_pdu_t) * ind->body.number_of_crcs);
+	
+		for(int i = 0; i < ind->body.number_of_crcs; ++i)
+		{
+			crc_ind.crc_indication_body.crc_pdu_list[i].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+			crc_ind.crc_indication_body.crc_pdu_list[i].rx_ue_information.handle = ind->body.pdus[i].rx_ue_info.handle;
+			crc_ind.crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti = ind->body.pdus[i].rx_ue_info.rnti;
+			crc_ind.crc_indication_body.crc_pdu_list[i].crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
+			crc_ind.crc_indication_body.crc_pdu_list[i].crc_indication_rel8.crc_flag = ind->body.pdus[i].rel8_pdu.crc_flag;
+		}
+	
+		nfapi_pnf_p7_crc_ind(data->p7_config, &crc_ind);
+	
+		free(crc_ind.crc_indication_body.crc_pdu_list);
+	}
+	
+	return 0;
+}
+int fapi_rx_ulsch_ind(fapi_t* fapi, fapi_rx_ulsch_ind_t* ind)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+
+	nfapi_rx_indication_t rx_ind;
+	memset(&rx_ind, 0, sizeof(rx_ind));
+	rx_ind.header.message_id = NFAPI_RX_ULSCH_INDICATION;
+	rx_ind.header.phy_id = data->p7_config->phy_id;
+	rx_ind.sfn_sf = ind->sfn_sf;
+	
+	if(1)//((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+	{
+		rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
+		rx_ind.rx_indication_body.number_of_pdus = 1;
+		
+		uint8_t rx_data[1024];
+		
+		nfapi_rx_indication_pdu_t pdus[rx_ind.rx_indication_body.number_of_pdus];
+		memset(&pdus, 0, sizeof(pdus));
+		
+                strcpy((char*)rx_data, (char*)"123456789");
+
+		for(int i = 0; i < rx_ind.rx_indication_body.number_of_pdus;++i)
+		{
+		
+			pdus[i].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+			pdus[i].rx_ue_information.handle = rand_range(0, 9999);
+			pdus[i].rx_ue_information.rnti = rand_range(1, 65535);
+			
+			pdus[i].rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
+			pdus[i].rx_indication_rel8.length = 10;//rand_range(0, 1024);
+			pdus[i].rx_indication_rel8.offset = 0;//djp - 1;
+			pdus[i].rx_indication_rel8.ul_cqi = rand_range(0, 255);
+			pdus[i].rx_indication_rel8.timing_advance = rand_range(0, 63);
+			
+			//pdus[i].rx_indication_rel9.tl.tag = NFAPI_RX_INDICATION_REL9_TAG;
+			//pdus[i].rx_indication_rel9.timing_advance_r9 = rand_range(0, 7690);
+			
+			pdus[i].data = &rx_data[0];
+		}
+		
+		rx_ind.rx_indication_body.rx_pdu_list = pdus;
+		
+		nfapi_pnf_p7_rx_ind(data->p7_config, &rx_ind);
+	}
+	else
+	{
+
+		rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
+		rx_ind.rx_indication_body.number_of_pdus = ind->body.number_of_pdus;
+	
+		rx_ind.rx_indication_body.rx_pdu_list = (nfapi_rx_indication_pdu_t*)malloc(sizeof(nfapi_rx_indication_pdu_t) * ind->body.number_of_pdus);
+	
+		for(int i = 0; i < ind->body.number_of_pdus; ++i)
+		{
+			rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+			rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.handle = ind->body.pdus[i].rx_ue_info.handle;
+			rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
+			rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length = ind->body.pdus[i].rel8_pdu.length;
+			rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.offset = 1;
+			rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel9.tl.tag = 0;
+			rx_ind.rx_indication_body.rx_pdu_list[i].data = (uint8_t*)ind->body.data[i];
+	
+		}
+		
+		nfapi_pnf_p7_rx_ind(data->p7_config, &rx_ind);
+	
+		free(rx_ind.rx_indication_body.rx_pdu_list);
+	}
+	
+	return 0;
+
+}
+int fapi_rx_cqi_ind(fapi_t* fapi, fapi_rx_cqi_ind_t* ind)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+
+	nfapi_cqi_indication_t cqi_ind;
+	memset(&cqi_ind, 0, sizeof(cqi_ind));
+	cqi_ind.header.message_id = NFAPI_RX_CQI_INDICATION;
+	cqi_ind.header.phy_id = data->p7_config->phy_id;
+	cqi_ind.sfn_sf = ind->sfn_sf;
+	
+	if(((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+	{
+		cqi_ind.cqi_indication_body.tl.tag = NFAPI_CQI_INDICATION_BODY_TAG;
+		cqi_ind.cqi_indication_body.number_of_cqis = 3;
+		
+		nfapi_cqi_indication_pdu_t cqi_pdu_list[cqi_ind.cqi_indication_body.number_of_cqis];
+		memset(&cqi_pdu_list, 0, sizeof(cqi_pdu_list));
+		nfapi_cqi_indication_raw_pdu_t cqi_raw_pdu_list[cqi_ind.cqi_indication_body.number_of_cqis];
+		//memset(&cqi_raw_pdu_list, 0, sizeof(cqi_raw_pdu_list));
+		
+		
+		for(int i = 0; i < cqi_ind.cqi_indication_body.number_of_cqis; ++i)
+		{
+			cqi_pdu_list[i].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+			cqi_pdu_list[i].rx_ue_information.handle = rand_range(0, 9999);
+			cqi_pdu_list[i].rx_ue_information.rnti = rand_range(1, 65535);
+			
+			uint8_t rel8_or_9 = rand_range(0, 1);
+			
+			if(rel8_or_9)
+			{
+				cqi_pdu_list[i].cqi_indication_rel8.tl.tag = NFAPI_CQI_INDICATION_REL8_TAG;
+				cqi_pdu_list[i].cqi_indication_rel8.length = 8; //rand_range(1, 12);		
+				cqi_pdu_list[i].cqi_indication_rel8.data_offset = 1; //rand_range(0, 1);		
+				cqi_pdu_list[i].cqi_indication_rel8.ul_cqi = 0;
+				cqi_pdu_list[i].cqi_indication_rel8.ri = rand_range(0, 4);		
+				cqi_pdu_list[i].cqi_indication_rel8.timing_advance = rand_range(0, 63);		
+			}
+			else
+			{
+				cqi_pdu_list[i].cqi_indication_rel9.tl.tag = NFAPI_CQI_INDICATION_REL9_TAG;
+				cqi_pdu_list[i].cqi_indication_rel9.length = 8; //rand_range(1, 12);		
+				cqi_pdu_list[i].cqi_indication_rel9.data_offset = 1; //rand_range(0, 1);		
+				cqi_pdu_list[i].cqi_indication_rel9.ul_cqi = 0; //rand_range(0, 1);		
+				cqi_pdu_list[i].cqi_indication_rel9.number_of_cc_reported = 1;
+				cqi_pdu_list[i].cqi_indication_rel9.ri[0] = rand_range(0, 8);		
+				cqi_pdu_list[i].cqi_indication_rel9.timing_advance = rand_range(0, 63);		
+				cqi_pdu_list[i].cqi_indication_rel9.timing_advance_r9 = rand_range(0, 7690);
+			}
+			
+			cqi_pdu_list[i].ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+			cqi_pdu_list[i].ul_cqi_information.ul_cqi = rand_range(0,255);
+			cqi_pdu_list[i].ul_cqi_information.channel = rand_range(0, 1);	
+		}
+		
+		cqi_ind.cqi_indication_body.cqi_pdu_list = cqi_pdu_list;
+		cqi_ind.cqi_indication_body.cqi_raw_pdu_list = cqi_raw_pdu_list;
+		
+		nfapi_pnf_p7_cqi_ind(data->p7_config, &cqi_ind);
+	}
+	else
+	{
+		nfapi_pnf_p7_cqi_ind(data->p7_config, &cqi_ind);
+	}
+	
+	return 0;
+}
+int fapi_rx_sr_ind(fapi_t* fapi, fapi_rx_sr_ind_t* ind)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+
+	nfapi_sr_indication_t sr_ind;
+	memset(&sr_ind, 0, sizeof(sr_ind));
+	sr_ind.header.message_id = NFAPI_RX_SR_INDICATION;
+	sr_ind.header.phy_id = data->p7_config->phy_id;
+	sr_ind.sfn_sf = ind->sfn_sf;
+	
+	if(((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+	{
+		sr_ind.sr_indication_body.tl.tag = NFAPI_SR_INDICATION_BODY_TAG;
+		sr_ind.sr_indication_body.number_of_srs = 1;
+		
+		nfapi_sr_indication_pdu_t pdus[sr_ind.sr_indication_body.number_of_srs];
+		memset(&pdus, 0, sizeof(pdus));
+		
+		pdus[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+		pdus[0].rx_ue_information.handle = rand_range(0, 9999);
+		pdus[0].rx_ue_information.rnti = rand_range(1, 65535);
+		
+		pdus[0].ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+		pdus[0].ul_cqi_information.ul_cqi = rand_range(0,255);
+		pdus[0].ul_cqi_information.channel = rand_range(0, 1);			
+		
+		sr_ind.sr_indication_body.sr_pdu_list = pdus;
+		
+		nfapi_pnf_p7_sr_ind(data->p7_config, &sr_ind);
+	}
+	else
+	{
+		nfapi_pnf_p7_sr_ind(data->p7_config, &sr_ind);	
+	}
+	
+	return 0;
+}
+
+int fapi_rach_ind(fapi_t* fapi, fapi_rach_ind_t* ind)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+
+	nfapi_rach_indication_t rach_ind;
+	memset(&rach_ind, 0, sizeof(rach_ind));
+	rach_ind.header.message_id = NFAPI_RACH_INDICATION;
+	rach_ind.header.phy_id = data->p7_config->phy_id;
+	rach_ind.sfn_sf = ind->sfn_sf;
+	
+	if(((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+	{
+		rach_ind.rach_indication_body.tl.tag = NFAPI_RACH_INDICATION_BODY_TAG;
+		rach_ind.rach_indication_body.number_of_preambles = 1;
+	
+		nfapi_preamble_pdu_t pdus[rach_ind.rach_indication_body.number_of_preambles];
+		memset(&pdus, 0, sizeof(pdus));
+		
+		pdus[0].preamble_rel8.tl.tag = NFAPI_PREAMBLE_REL8_TAG;
+		pdus[0].preamble_rel8.rnti = rand_range(1, 65535);
+		pdus[0].preamble_rel8.preamble = rand_range(0, 63);
+		pdus[0].preamble_rel8.timing_advance = rand_range(0, 1282);
+		pdus[0].preamble_rel9.tl.tag = NFAPI_PREAMBLE_REL9_TAG;
+		pdus[0].preamble_rel9.timing_advance_r9 = rand_range(0, 7690);
+		pdus[0].preamble_rel13.tl.tag = NFAPI_PREAMBLE_REL13_TAG;
+		pdus[0].preamble_rel13.rach_resource_type = rand_range(0, 4);
+			
+		rach_ind.rach_indication_body.preamble_list = pdus;
+		nfapi_pnf_p7_rach_ind(data->p7_config, &rach_ind);
+	}
+	else
+	{
+		nfapi_pnf_p7_rach_ind(data->p7_config, &rach_ind);
+	}
+	
+	return 0;
+}
+
+int fapi_srs_ind(fapi_t* fapi, fapi_srs_ind_t* ind)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+
+	nfapi_srs_indication_t srs_ind;
+	memset(&srs_ind, 0, sizeof(srs_ind));
+	srs_ind.header.message_id = NFAPI_SRS_INDICATION;
+	srs_ind.header.phy_id = data->p7_config->phy_id;
+	srs_ind.sfn_sf = ind->sfn_sf;
+
+	if(((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+	{
+		srs_ind.srs_indication_body.tl.tag = NFAPI_SRS_INDICATION_BODY_TAG;
+		srs_ind.srs_indication_body.number_of_ues = 1;
+		
+		nfapi_srs_indication_pdu_t pdus[srs_ind.srs_indication_body.number_of_ues];
+		memset(&pdus, 0, sizeof(pdus));		
+		
+		pdus[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+		pdus[0].rx_ue_information.handle = rand_range(0, 9999);
+		pdus[0].rx_ue_information.rnti = rand_range(1, 65535);
+				
+		pdus[0].srs_indication_fdd_rel8.tl.tag = NFAPI_SRS_INDICATION_FDD_REL8_TAG;
+		pdus[0].srs_indication_fdd_rel8.doppler_estimation = rand_range(0, 255);
+		pdus[0].srs_indication_fdd_rel8.timing_advance = rand_range(0, 63);
+		pdus[0].srs_indication_fdd_rel8.number_of_resource_blocks = 2; //rand_range(0, 255);
+		pdus[0].srs_indication_fdd_rel8.rb_start = rand_range(0, 245);
+		pdus[0].srs_indication_fdd_rel8.snr[0] = rand_range(0, 255);
+		pdus[0].srs_indication_fdd_rel8.snr[1] = rand_range(0, 255);
+		
+		pdus[0].srs_indication_fdd_rel9.tl.tag = NFAPI_SRS_INDICATION_FDD_REL9_TAG;
+		pdus[0].srs_indication_fdd_rel9.timing_advance_r9 = rand_range(0, 7690);
+		
+		pdus[0].srs_indication_tdd_rel10.tl.tag = NFAPI_SRS_INDICATION_TDD_REL10_TAG;
+		pdus[0].srs_indication_tdd_rel10.uppts_symbol = rand_range(0, 1);
+		
+		pdus[0].srs_indication_fdd_rel11.tl.tag = NFAPI_SRS_INDICATION_FDD_REL11_TAG;
+		pdus[0].srs_indication_fdd_rel11.ul_rtoa;		
+		
+		pdus[0].tdd_channel_measurement.tl.tag = NFAPI_TDD_CHANNEL_MEASUREMENT_TAG;
+		pdus[0].tdd_channel_measurement.num_prb_per_subband = rand_range(0, 255);
+		pdus[0].tdd_channel_measurement.number_of_subbands = 1;
+		pdus[0].tdd_channel_measurement.num_atennas = 2;
+		pdus[0].tdd_channel_measurement.subands[0].subband_index = rand_range(0, 255);
+		pdus[0].tdd_channel_measurement.subands[0].channel[0] = rand_range(0, 9999);
+		pdus[0].tdd_channel_measurement.subands[0].channel[1] = rand_range(0, 9999);
+	
+		srs_ind.srs_indication_body.srs_pdu_list = pdus;
+		nfapi_pnf_p7_srs_ind(data->p7_config, &srs_ind);
+	}
+	else
+	{
+		nfapi_pnf_p7_srs_ind(data->p7_config, &srs_ind);
+	}
+	
+	return 0;
+}
+
+int fapi_lbt_dl_ind(fapi_t* fapi, fapi_lbt_dl_ind_t* ind)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+	
+	nfapi_lbt_dl_indication_t lbt_dl_ind;
+	memset(&lbt_dl_ind, 0, sizeof(lbt_dl_ind));
+	lbt_dl_ind.header.message_id = NFAPI_LBT_DL_INDICATION;
+	lbt_dl_ind.header.phy_id = data->p7_config->phy_id;
+	lbt_dl_ind.sfn_sf = ind->sfn_sf;
+
+	if(((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+	{
+		lbt_dl_ind.lbt_dl_indication_body.tl.tag = NFAPI_LBT_DL_INDICATION_BODY_TAG;
+		lbt_dl_ind.lbt_dl_indication_body.number_of_pdus = 2;
+		
+		nfapi_lbt_dl_indication_pdu_t pdus[lbt_dl_ind.lbt_dl_indication_body.number_of_pdus];
+		memset(&pdus, 0, sizeof(pdus));	
+		
+		pdus[0].pdu_type = 0; // LBT_PDSCH_RSP PDU
+		pdus[0].pdu_size = 0;
+		pdus[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.tl.tag = NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG;
+		pdus[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.handle = 0xABCD;
+		pdus[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.result = rand_range(0, 1);
+		pdus[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.lte_txop_symbols = rand_range(0, 0xFFFF);
+		pdus[0].lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13.initial_partial_sf = rand_range(0, 1);
+		
+		pdus[1].pdu_type = 1; // LBT_DRS_RSP PDU
+		pdus[1].pdu_size = 0;
+		pdus[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.tl.tag = NFAPI_LBT_DRS_RSP_PDU_REL13_TAG;
+		pdus[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.handle = 0xABCD;
+		pdus[1].lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13.result = rand_range(0, 1);
+
+		lbt_dl_ind.lbt_dl_indication_body.lbt_indication_pdu_list = pdus;
+		nfapi_pnf_p7_lbt_dl_ind(data->p7_config, &lbt_dl_ind);
+	}
+	else
+	{
+		nfapi_pnf_p7_lbt_dl_ind(data->p7_config, &lbt_dl_ind);
+	}
+	
+	return 0;
+}
+
+int fapi_nb_harq_ind(fapi_t* fapi, fapi_nb_harq_ind_t* ind)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+	
+	nfapi_nb_harq_indication_t nb_harq_ind;
+	memset(&nb_harq_ind, 0, sizeof(nb_harq_ind));
+	nb_harq_ind.header.message_id = NFAPI_NB_HARQ_INDICATION;
+	nb_harq_ind.header.phy_id = data->p7_config->phy_id;
+	nb_harq_ind.sfn_sf = ind->sfn_sf;
+
+	if(((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+	{
+		
+		nb_harq_ind.nb_harq_indication_body.tl.tag = NFAPI_NB_HARQ_INDICATION_BODY_TAG;
+		nb_harq_ind.nb_harq_indication_body.number_of_harqs = 1;
+		
+		nfapi_nb_harq_indication_pdu_t pdus[nb_harq_ind.nb_harq_indication_body.number_of_harqs];
+		memset(&pdus, 0, sizeof(pdus));	
+		
+		pdus[0].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+		pdus[0].rx_ue_information.handle = rand_range(0, 0xFFFF);
+		pdus[0].rx_ue_information.rnti = rand_range(0, 65535);
+		
+		pdus[0].nb_harq_indication_fdd_rel13.tl.tag = NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG;
+		pdus[0].nb_harq_indication_fdd_rel13.harq_tb1 = rand_range(1, 7);
+		
+		pdus[0].ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+		pdus[0].ul_cqi_information.ul_cqi = rand_range(0, 255);
+		pdus[0].ul_cqi_information.channel = rand_range(0, 1);
+		
+		nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list = pdus;
+		nfapi_pnf_p7_nb_harq_ind(data->p7_config, &nb_harq_ind);
+	}
+	else
+	{
+		nfapi_pnf_p7_nb_harq_ind(data->p7_config, &nb_harq_ind);
+	}
+	
+	return 0;
+}
+
+int fapi_nrach_ind(fapi_t* fapi, fapi_nrach_ind_t* ind)
+{
+	pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)(fapi->user_data);
+	
+	nfapi_nrach_indication_t nrach_ind;
+	memset(&nrach_ind, 0, sizeof(nrach_ind));
+	nrach_ind.header.message_id = NFAPI_NRACH_INDICATION;
+	nrach_ind.header.phy_id = data->p7_config->phy_id;
+	nrach_ind.sfn_sf = ind->sfn_sf;
+
+	if(((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+	{
+		nrach_ind.nrach_indication_body.tl.tag = NFAPI_NRACH_INDICATION_BODY_TAG;
+		nrach_ind.nrach_indication_body.number_of_initial_scs_detected = 1;
+		
+		nfapi_nrach_indication_pdu_t pdus[nrach_ind.nrach_indication_body.number_of_initial_scs_detected];
+		memset(&pdus, 0, sizeof(pdus));	
+		
+		pdus[0].nrach_indication_rel13.tl.tag = NFAPI_NRACH_INDICATION_REL13_TAG;
+		pdus[0].nrach_indication_rel13.rnti = rand_range(1, 65535);
+		pdus[0].nrach_indication_rel13.initial_sc = rand_range(0, 47);
+		pdus[0].nrach_indication_rel13.timing_advance = rand_range(0, 3840);
+		pdus[0].nrach_indication_rel13.nrach_ce_level = rand_range(0, 2);
+		
+		nrach_ind.nrach_indication_body.nrach_pdu_list = pdus;
+		
+		nfapi_pnf_p7_nrach_ind(data->p7_config, &nrach_ind);
+	}
+	else
+	{
+		nfapi_pnf_p7_nrach_ind(data->p7_config, &nrach_ind);
+	}	
+	
+	return 0;
+}
+
+int pnf_start_request(nfapi_pnf_config_t* config, nfapi_pnf_start_request_t* req)
+{
+
+	pnf_info* pnf = (pnf_info*)(config->user_data);
+
+	// start all phys that have been configured
+	for(phy_info& phy : pnf->phys)
+	{
+		if(phy.id != 0)
+		{
+	//auto found = std::find_if(pnf->phys.begin(), pnf->phys.end(), [&](phy_info& item)
+	//		{ return item.id == req->header.phy_id; });
+//
+//	if(found != pnf->phys.end())
+//	{
+//		phy_info& phy = (*found);
+
+			fapi_cb_t cb;
+			cb.fapi_param_response = &fapi_param_response;
+			cb.fapi_config_response = &fapi_config_response;
+			cb.fapi_subframe_ind = &fapi_subframe_ind;
+			cb.fapi_harq_ind = fapi_harq_ind;
+			cb.fapi_crc_ind = fapi_crc_ind;
+			cb.fapi_rx_ulsch_ind = fapi_rx_ulsch_ind;
+			cb.fapi_rx_cqi_ind = fapi_rx_cqi_ind;
+			cb.fapi_rx_sr_ind = fapi_rx_sr_ind;
+			cb.fapi_rach_ind = fapi_rach_ind;
+			cb.fapi_srs_ind = fapi_srs_ind;
+			
+			cb.fapi_lbt_dl_ind = fapi_lbt_dl_ind;
+			cb.fapi_nb_harq_ind = fapi_nb_harq_ind;
+			cb.fapi_nrach_ind = fapi_nrach_ind;
+			
+			
+
+			fapi_config_t c;
+			c.duplex_mode = phy.duplex_mode;
+			c.dl_channel_bw_support = phy.dl_channel_bw_support;
+			c.ul_channel_bw_support = phy.ul_channel_bw_support;
+
+			phy.fapi = fapi_create(&cb, &c);
+			printf("[PNF_SIM] staring fapi %p phy_id:%d\n", phy.fapi, phy.id);
+
+			pnf_phy_user_data_t* data = (pnf_phy_user_data_t*)malloc(sizeof(pnf_phy_user_data_t));
+			data->phy_id = phy.id;
+			data->config = config;
+			data->phy = &phy;
+
+			phy.fapi->user_data = data; 
+		}
+
+	}
+
+	nfapi_pnf_start_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_START_RESPONSE;
+	resp.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_pnf_start_resp(config, &resp);
+
+	return 0;
+}
+
+int pnf_stop_request(nfapi_pnf_config_t* config, nfapi_pnf_stop_request_t* req)
+{
+	printf("[PNF_SIM] pnf stop request\n");
+
+	nfapi_pnf_stop_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_STOP_RESPONSE;
+	resp.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_pnf_stop_resp(config, &resp);
+
+	return 0;
+}
+
+int param_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_param_request_t* req)
+{
+	printf("[PNF_SIM] param request phy_id:%d\n", req->header.phy_id);
+
+	pnf_info* pnf = (pnf_info*)(config->user_data);
+
+	auto found = std::find_if(pnf->phys.begin(), pnf->phys.end(), [&](phy_info& item)
+								  { return item.id == req->header.phy_id; });
+
+	if(found != pnf->phys.end())
+	{
+		phy_info& phy_info = (*found);
+
+		fapi_param_req_t fapi_req;
+		fapi_req.header.message_id = req->header.message_id;
+		fapi_req.header.length = 0;
+
+		// convert nfapi to fapi
+
+		fapi_param_request(phy_info.fapi, &fapi_req);
+
+	}
+	else
+	{
+		// did not find the phy
+	}
+
+
+	printf("[PNF_SIM] param request .. exit\n");
+
+
+	return 0;
+}
+
+int config_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_config_request_t* req)
+{
+	printf("[PNF_SIM] config request phy_id:%d\n", req->header.phy_id);
+
+	pnf_info* pnf = (pnf_info*)(config->user_data);
+
+	auto found = std::find_if(pnf->phys.begin(), pnf->phys.end(), [&](phy_info& item)
+								  { return item.id == req->header.phy_id; });
+
+	if(found != pnf->phys.end())
+	{
+		phy_info& phy_info = (*found);
+
+
+		if(req->nfapi_config.timing_window.tl.tag == NFAPI_NFAPI_TIMING_WINDOW_TAG)
+		{
+			phy_info.timing_window = req->nfapi_config.timing_window.value;
+		}
+
+		if(req->nfapi_config.timing_info_mode.tl.tag == NFAPI_NFAPI_TIMING_INFO_MODE_TAG)
+		{
+			printf("timing info mode provided\n");
+			phy_info.timing_info_mode = req->nfapi_config.timing_info_mode.value;
+		}
+		else 
+		{
+			phy_info.timing_info_mode = 0;
+			printf("NO timing info mode provided\n");
+		}
+
+		if(req->nfapi_config.timing_info_period.tl.tag == NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG)
+		{
+			printf("timing info period provided\n");
+			phy_info.timing_info_period = req->nfapi_config.timing_info_period.value;
+		}
+		else 
+		{
+			phy_info.timing_info_period = 0;
+		}
+
+		phy_info.remote_port = req->nfapi_config.p7_vnf_port.value;
+
+		struct sockaddr_in vnf_p7_sockaddr;
+		memcpy(&vnf_p7_sockaddr.sin_addr.s_addr, &(req->nfapi_config.p7_vnf_address_ipv4.address[0]), 4);
+		phy_info.remote_addr = inet_ntoa(vnf_p7_sockaddr.sin_addr);
+
+		printf("[PNF_SIM] %d vnf p7 %s:%d timing %d %d %d\n", phy_info.id, phy_info.remote_addr, phy_info.remote_port, 
+				phy_info.timing_window, phy_info.timing_info_mode, phy_info.timing_info_period);
+
+		fapi_config_req_t fapi_req;
+		fapi_config_request(phy_info.fapi, &fapi_req);
+	}
+
+	return 0;
+}
+
+nfapi_p7_message_header_t* phy_allocate_p7_vendor_ext(uint16_t message_id, uint16_t* msg_size)
+{
+	if(message_id == P7_VENDOR_EXT_REQ)
+	{
+		(*msg_size) = sizeof(vendor_ext_p7_req);
+		return (nfapi_p7_message_header_t*)malloc(sizeof(vendor_ext_p7_req));
+	}
+	
+	return 0;
+}
+
+void phy_deallocate_p7_vendor_ext(nfapi_p7_message_header_t* header)
+{
+	free(header);
+}
+
+int phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req)
+{
+	//printf("[PNF_SIM] dl config request\n");
+
+	if(req->vendor_extension)
+		free(req->vendor_extension);
+
+	phy_info* phy = (phy_info*)(pnf_p7->user_data);
+
+	fapi_dl_config_req_t fapi_req;
+	// convert
+	fapi_dl_config_request(phy->fapi, &fapi_req);
+
+	return 0;
+}
+int phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req)
+{
+	//printf("[PNF_SIM] ul config request\n");
+	phy_info* phy = (phy_info*)(pnf_p7->user_data);
+
+	fapi_ul_config_req_t fapi_req;
+	// convert
+	fapi_ul_config_request(phy->fapi, &fapi_req);
+
+	return 0;
+}
+int phy_hi_dci0_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req)
+{
+	//printf("[PNF_SIM] hi dci0 request\n");
+	phy_info* phy = (phy_info*)(pnf_p7->user_data);
+
+	fapi_hi_dci0_req_t fapi_req;
+	// convert
+	fapi_hi_dci0_request(phy->fapi, &fapi_req);
+	return 0;
+}
+int phy_tx_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
+{
+	//printf("[PNF_SIM] tx request\n");
+	phy_info* phy = (phy_info*)(pnf_p7->user_data);
+
+	fapi_tx_req_t fapi_req;
+	fapi_req.header.message_id = FAPI_TX_REQUEST;
+	fapi_req.sfn_sf = req->sfn_sf;
+	fapi_req.body.number_of_pdus = req->tx_request_body.number_of_pdus;
+
+	fapi_tx_req_pdu_t pdus[8];
+	fapi_req.body.pdus = &pdus[0];
+
+	for(int i = 0; i < fapi_req.body.number_of_pdus; ++i)
+	{
+		fapi_req.body.pdus[i].pdu_length = req->tx_request_body.tx_pdu_list[i].pdu_length;
+		fapi_req.body.pdus[i].pdu_index = req->tx_request_body.tx_pdu_list[i].pdu_index;
+		fapi_req.body.pdus[i].num_tlv = 1;
+		fapi_req.body.pdus[i].tlvs[0].value = (uint32_t*)req->tx_request_body.tx_pdu_list[i].segments[0].segment_data;
+
+		//if the pnf wants to retain the pointer then req->tx_request_body.tx_pdu_list[i].segments[0].segment_data should be set to 0
+
+
+	}
+
+	fapi_tx_request(phy->fapi, &fapi_req);
+/*
+	if(fapi_req.body.number_of_pdus > 0)
+	{
+		for(int i = 0; i < fapi_req.body.number_of_pdus; ++i)
+		{
+			//printf("freeing tx pdu %p\n", fapi_req.body.pdus[i].tlvs[0].value);
+			if(0)
+			{
+				free(fapi_req.body.pdus[i].tlvs[0].value);
+			}
+			else
+			{
+				pnf_deallocate(fapi_req.body.pdus[i].tlvs[0].value);
+			}
+		}
+	}
+*/	
+
+	return 0;
+}
+int phy_lbt_dl_config_req(nfapi_pnf_p7_config_t*, nfapi_lbt_dl_config_request_t* req)
+{
+	//printf("[PNF_SIM] lbt dl config request\n");
+	return 0;
+}
+
+int phy_vendor_ext(nfapi_pnf_p7_config_t* config, nfapi_p7_message_header_t* msg)
+{
+	if(msg->message_id == P7_VENDOR_EXT_REQ)
+	{
+		vendor_ext_p7_req* req = (vendor_ext_p7_req*)msg;
+		//printf("[PNF_SIM] vendor request (1:%d 2:%d)\n", req->dummy1, req->dummy2);
+	}
+	else
+	{
+		printf("[PNF_SIM] unknown vendor ext\n");
+	}
+	return 0;
+}
+
+
+
+int phy_pack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t** ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* codex)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+	if(header->message_id == P7_VENDOR_EXT_IND)
+	{
+		vendor_ext_p7_ind* ind = (vendor_ext_p7_ind*)(header);
+		if(!push16(ind->error_code, ppWritePackedMsg, end))
+			return 0;
+		
+		return 1;
+	}
+	return -1;
+}
+
+int phy_unpack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t** ppReadPackedMessage, uint8_t *end, nfapi_p7_codec_config_t* codec)
+{
+	if(header->message_id == P7_VENDOR_EXT_REQ)
+	{
+		//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+		vendor_ext_p7_req* req = (vendor_ext_p7_req*)(header);
+		if(!(pull16(ppReadPackedMessage, &req->dummy1, end) &&
+			 pull16(ppReadPackedMessage, &req->dummy2, end)))
+			return 0;
+		return 1;
+	}
+	return -1;
+}
+
+int phy_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessage, uint8_t* end, void** ve, nfapi_p7_codec_config_t* config)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "phy_unpack_vendor_extension_tlv\n");
+
+	switch(tl->tag)
+	{
+		case VENDOR_EXT_TLV_1_TAG:
+			*ve = malloc(sizeof(vendor_ext_tlv_1));
+			if(!pull32(ppReadPackedMessage, &((vendor_ext_tlv_1*)(*ve))->dummy, end))
+				return 0;
+
+			return 1;
+			break;
+	}
+
+	return -1;
+}
+
+int phy_pack_vendor_extention_tlv(void* ve, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p7_codec_config_t* config)
+{
+	//printf("%s\n", __FUNCTION__);
+	(void)ve;
+	(void)ppWritePackedMsg;
+	return -1;
+}
+
+int pnf_sim_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessage, uint8_t *end, void** ve, nfapi_p4_p5_codec_config_t* config)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "pnf_sim_unpack_vendor_extension_tlv\n");
+
+	switch(tl->tag)
+	{
+		case VENDOR_EXT_TLV_2_TAG:
+			*ve = malloc(sizeof(vendor_ext_tlv_2));
+			if(!pull32(ppReadPackedMessage, &((vendor_ext_tlv_2*)(*ve))->dummy, end))
+				return 0;
+
+			return 1;
+			break;
+	}
+	
+	return -1;
+}
+
+int pnf_sim_pack_vendor_extention_tlv(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	//printf("%s\n", __FUNCTION__);
+	(void)ve;
+	(void)ppWritePackedMsg;
+	return -1;
+}
+int start_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_start_request_t* req)
+{
+	printf("[PNF_SIM] start request phy_id:%d\n", req->header.phy_id);
+
+	pnf_info* pnf = (pnf_info*)(config->user_data);
+
+	auto found = std::find_if(pnf->phys.begin(), pnf->phys.end(), [&](phy_info& item)
+								  { return item.id == req->header.phy_id; });
+
+	if(found != pnf->phys.end())
+	{
+		phy_info& phy_info = (*found);
+
+
+		nfapi_pnf_p7_config_t* p7_config = nfapi_pnf_p7_config_create();
+
+		p7_config->phy_id = phy->phy_id;
+
+		p7_config->remote_p7_port = phy_info.remote_port;
+		p7_config->remote_p7_addr = phy_info.remote_addr;
+		p7_config->local_p7_port = phy_info.local_port;
+		p7_config->local_p7_addr = (char*)phy_info.local_addr.c_str();
+		p7_config->user_data = &phy_info;
+
+		p7_config->malloc = &pnf_allocate;
+		p7_config->free = &pnf_deallocate;
+		p7_config->codec_config.allocate = &pnf_allocate;
+		p7_config->codec_config.deallocate = &pnf_deallocate;
+		
+		p7_config->trace = &pnf_sim_trace;
+
+		phy->user_data = p7_config;
+
+		p7_config->subframe_buffer_size = phy_info.timing_window;
+		if(phy_info.timing_info_mode & 0x1)
+		{
+			p7_config->timing_info_mode_periodic = 1;
+			p7_config->timing_info_period = phy_info.timing_info_period;
+		}
+		
+		if(phy_info.timing_info_mode & 0x2)
+		{
+			p7_config->timing_info_mode_aperiodic = 1;
+		}
+
+		p7_config->dl_config_req = &phy_dl_config_req;
+		p7_config->ul_config_req = &phy_ul_config_req;
+		p7_config->hi_dci0_req = &phy_hi_dci0_req;
+		p7_config->tx_req = &phy_tx_req;
+		p7_config->lbt_dl_config_req = &phy_lbt_dl_config_req;
+
+		p7_config->vendor_ext = &phy_vendor_ext;
+
+		p7_config->allocate_p7_vendor_ext = &phy_allocate_p7_vendor_ext;
+		p7_config->deallocate_p7_vendor_ext = &phy_deallocate_p7_vendor_ext;
+
+		p7_config->codec_config.unpack_p7_vendor_extension = &phy_unpack_p7_vendor_extension;
+		p7_config->codec_config.pack_p7_vendor_extension = &phy_pack_p7_vendor_extension;
+		p7_config->codec_config.unpack_vendor_extension_tlv = &phy_unpack_vendor_extension_tlv;
+		p7_config->codec_config.pack_vendor_extension_tlv = &phy_pack_vendor_extention_tlv;
+
+		pthread_t p7_thread;
+		pthread_create(&p7_thread, NULL, &pnf_p7_thread_start, p7_config);
+
+
+		((pnf_phy_user_data_t*)(phy_info.fapi->user_data))->p7_config = p7_config;
+
+		fapi_start_req_t fapi_req;
+		fapi_start_request(phy_info.fapi, &fapi_req);
+
+	}
+
+	return 0;
+}
+
+int measurement_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_measurement_request_t* req)
+{
+	nfapi_measurement_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_MEASUREMENT_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_MSG_OK;
+	nfapi_pnf_measurement_resp(config, &resp);
+	return 0;
+}
+int rssi_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_rssi_request_t* req)
+{
+	nfapi_rssi_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_RSSI_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_P4_MSG_OK;
+	nfapi_pnf_rssi_resp(config, &resp);
+	
+	nfapi_rssi_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_RSSI_INDICATION;
+	ind.header.phy_id = req->header.phy_id;
+	ind.error_code = NFAPI_P4_MSG_OK;
+	ind.rssi_indication_body.tl.tag = NFAPI_RSSI_INDICATION_TAG;
+	ind.rssi_indication_body.number_of_rssi = 1;
+	ind.rssi_indication_body.rssi[0] = -42;
+	nfapi_pnf_rssi_ind(config, &ind);
+	return 0;
+}
+int cell_search_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_cell_search_request_t* req)
+{
+	nfapi_cell_search_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_CELL_SEARCH_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_P4_MSG_OK;
+	nfapi_pnf_cell_search_resp(config, &resp);
+	
+	nfapi_cell_search_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_CELL_SEARCH_INDICATION;
+	ind.header.phy_id = req->header.phy_id;
+	ind.error_code = NFAPI_P4_MSG_OK;
+	
+	switch(req->rat_type)
+	{
+		case NFAPI_RAT_TYPE_LTE:
+		{
+			ind.lte_cell_search_indication.tl.tag = NFAPI_LTE_CELL_SEARCH_INDICATION_TAG;
+			ind.lte_cell_search_indication.number_of_lte_cells_found = 1;
+			ind.lte_cell_search_indication.lte_found_cells[0].pci = 123;
+			ind.lte_cell_search_indication.lte_found_cells[0].rsrp = 123;
+			ind.lte_cell_search_indication.lte_found_cells[0].rsrq = 123;
+			ind.lte_cell_search_indication.lte_found_cells[0].frequency_offset = 123;
+		}
+		break;
+		case NFAPI_RAT_TYPE_UTRAN:
+		{
+			ind.utran_cell_search_indication.tl.tag = NFAPI_UTRAN_CELL_SEARCH_INDICATION_TAG;
+			ind.utran_cell_search_indication.number_of_utran_cells_found = 1;
+			ind.utran_cell_search_indication.utran_found_cells[0].psc = 89;
+			ind.utran_cell_search_indication.utran_found_cells[0].rscp = 89;
+			ind.utran_cell_search_indication.utran_found_cells[0].ecno = 89;
+			ind.utran_cell_search_indication.utran_found_cells[0].frequency_offset = -89;
+			
+		}
+		break;
+		case NFAPI_RAT_TYPE_GERAN:
+		{
+			ind.geran_cell_search_indication.tl.tag = NFAPI_GERAN_CELL_SEARCH_INDICATION_TAG;
+			ind.geran_cell_search_indication.number_of_gsm_cells_found = 1;
+			ind.geran_cell_search_indication.gsm_found_cells[0].bsic = 23;
+			ind.geran_cell_search_indication.gsm_found_cells[0].rxlev = 23;
+			ind.geran_cell_search_indication.gsm_found_cells[0].rxqual = 23;
+			ind.geran_cell_search_indication.gsm_found_cells[0].frequency_offset = -23;
+			ind.geran_cell_search_indication.gsm_found_cells[0].sfn_offset = 230;
+			
+		}
+		break;
+	}
+	
+	ind.pnf_cell_search_state.tl.tag = NFAPI_PNF_CELL_SEARCH_STATE_TAG;
+	ind.pnf_cell_search_state.length = 3;
+	
+	nfapi_pnf_cell_search_ind(config, &ind);	
+	return 0;
+}
+int broadcast_detect_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_broadcast_detect_request_t* req)
+{
+	nfapi_broadcast_detect_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_BROADCAST_DETECT_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_P4_MSG_OK;
+	nfapi_pnf_broadcast_detect_resp(config, &resp);
+	
+	nfapi_broadcast_detect_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_BROADCAST_DETECT_INDICATION;
+	ind.header.phy_id = req->header.phy_id;
+	ind.error_code = NFAPI_P4_MSG_OK;
+	
+	switch(req->rat_type)
+	{
+		case NFAPI_RAT_TYPE_LTE:
+		{
+			ind.lte_broadcast_detect_indication.tl.tag = NFAPI_LTE_BROADCAST_DETECT_INDICATION_TAG;
+			ind.lte_broadcast_detect_indication.number_of_tx_antenna = 1;
+			ind.lte_broadcast_detect_indication.mib_length = 4;
+			//ind.lte_broadcast_detect_indication.mib...
+			ind.lte_broadcast_detect_indication.sfn_offset = 77;
+		
+		}
+		break;
+		case NFAPI_RAT_TYPE_UTRAN:
+		{
+			ind.utran_broadcast_detect_indication.tl.tag = NFAPI_UTRAN_BROADCAST_DETECT_INDICATION_TAG;
+			ind.utran_broadcast_detect_indication.mib_length = 4;
+			//ind.utran_broadcast_detect_indication.mib...
+			ind.utran_broadcast_detect_indication.sfn_offset;
+			
+		}
+		break;
+	}
+	
+	ind.pnf_cell_broadcast_state.tl.tag = NFAPI_PNF_CELL_BROADCAST_STATE_TAG;
+	ind.pnf_cell_broadcast_state.length = 3;
+	
+	nfapi_pnf_broadcast_detect_ind(config, &ind);	
+	return 0;
+}
+int system_information_schedule_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_system_information_schedule_request_t* req)
+{
+	nfapi_system_information_schedule_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_P4_MSG_OK;
+	nfapi_pnf_system_information_schedule_resp(config, &resp);
+	
+	nfapi_system_information_schedule_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION;
+	ind.header.phy_id = req->header.phy_id;
+	ind.error_code = NFAPI_P4_MSG_OK;
+	
+	ind.lte_system_information_indication.tl.tag = NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG;
+	ind.lte_system_information_indication.sib_type = 3;
+	ind.lte_system_information_indication.sib_length = 5;
+	//ind.lte_system_information_indication.sib...
+	
+	nfapi_pnf_system_information_schedule_ind(config, &ind);		
+	return 0;
+}
+int system_information_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_system_information_request_t* req)
+{
+	nfapi_system_information_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_SYSTEM_INFORMATION_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_P4_MSG_OK;
+	nfapi_pnf_system_information_resp(config, &resp);
+	
+	nfapi_system_information_indication_t ind;
+	memset(&ind, 0, sizeof(ind));
+	ind.header.message_id = NFAPI_SYSTEM_INFORMATION_INDICATION;
+	ind.header.phy_id = req->header.phy_id;
+	ind.error_code = NFAPI_P4_MSG_OK;
+	
+	switch(req->rat_type)
+	{
+		case NFAPI_RAT_TYPE_LTE:
+		{
+			ind.lte_system_information_indication.tl.tag = NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG;
+			ind.lte_system_information_indication.sib_type = 1;
+			ind.lte_system_information_indication.sib_length = 3;
+			//ind.lte_system_information_indication.sib...
+		}
+		break;
+		case NFAPI_RAT_TYPE_UTRAN:
+		{
+			ind.utran_system_information_indication.tl.tag = NFAPI_UTRAN_SYSTEM_INFORMATION_INDICATION_TAG;
+			ind.utran_system_information_indication.sib_length = 3;
+			//ind.utran_system_information_indication.sib...
+			
+		}
+		break;
+		case NFAPI_RAT_TYPE_GERAN:
+		{
+			ind.geran_system_information_indication.tl.tag = NFAPI_GERAN_SYSTEM_INFORMATION_INDICATION_TAG;
+			ind.geran_system_information_indication.si_length = 3;
+			//ind.geran_system_information_indication.si...
+			
+		}
+		break;
+	}
+		
+	
+	nfapi_pnf_system_information_ind(config, &ind);		
+
+	return 0;
+}
+int nmm_stop_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_nmm_stop_request_t* req)
+{
+	nfapi_nmm_stop_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_NMM_STOP_RESPONSE;
+	resp.header.phy_id = req->header.phy_id;
+	resp.error_code = NFAPI_P4_MSG_OK;
+	nfapi_pnf_nmm_stop_resp(config, &resp);
+	return 0;
+}
+	
+int vendor_ext(nfapi_pnf_config_t* config, nfapi_p4_p5_message_header_t* msg)
+{
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF_SIM] P5 %s %p\n", __FUNCTION__, msg);
+
+	switch(msg->message_id)
+	{
+		case P5_VENDOR_EXT_REQ:
+			{
+				vendor_ext_p5_req* req = (vendor_ext_p5_req*)msg;
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF_SIM] P5 Vendor Ext Req (%d %d)\n", req->dummy1, req->dummy2);
+				// send back the P5_VENDOR_EXT_RSP
+				vendor_ext_p5_rsp rsp;
+				memset(&rsp, 0, sizeof(rsp));
+				rsp.header.message_id = P5_VENDOR_EXT_RSP;
+				rsp.error_code = NFAPI_MSG_OK;
+				nfapi_pnf_vendor_extension(config, &rsp.header, sizeof(vendor_ext_p5_rsp));
+			}
+			break;
+	}
+	
+	return 0;
+}
+
+nfapi_p4_p5_message_header_t* pnf_sim_allocate_p4_p5_vendor_ext(uint16_t message_id, uint16_t* msg_size)
+{
+	if(message_id == P5_VENDOR_EXT_REQ)
+	{
+		(*msg_size) = sizeof(vendor_ext_p5_req);
+		return (nfapi_p4_p5_message_header_t*)malloc(sizeof(vendor_ext_p5_req));
+	}
+	
+	return 0;
+}
+
+void pnf_sim_deallocate_p4_p5_vendor_ext(nfapi_p4_p5_message_header_t* header)
+{
+	free(header);
+}
+
+
+int pnf_sim_pack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t* header, uint8_t** ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+	if(header->message_id == P5_VENDOR_EXT_RSP)
+	{
+		vendor_ext_p5_rsp* rsp = (vendor_ext_p5_rsp*)(header);
+		return (!push16(rsp->error_code, ppWritePackedMsg, end));
+	}
+	return 0;
+}
+
+int pnf_sim_unpack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t* header, uint8_t** ppReadPackedMessage, uint8_t *end, nfapi_p4_p5_codec_config_t* codec)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+	if(header->message_id == P5_VENDOR_EXT_REQ)
+	{
+		vendor_ext_p5_req* req = (vendor_ext_p5_req*)(header);
+		return (!(pull16(ppReadPackedMessage, &req->dummy1, end) &&
+	  			  pull16(ppReadPackedMessage, &req->dummy2, end)));
+		 
+		//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s (%d %d)\n", __FUNCTION__, req->dummy1, req->dummy2);
+	}
+	return 0;
+}
+int main(int argc, char *argv[])
+{
+	if (argc < 3)
+	{
+		printf("Use parameters: <IP Address of VNF P5> <P5 Port> <Config File>\n");
+		return 0;
+	}
+
+	set_thread_priority(50);
+
+	pnf_info pnf;
+	if(read_pnf_xml(pnf, argv[3]) < 0)
+	{
+		printf("Failed to read xml file>\n");
+		return 0;
+	}
+
+
+	nfapi_pnf_config_t* config = nfapi_pnf_config_create();
+
+	config->vnf_ip_addr = argv[1];
+	config->vnf_p5_port = atoi(argv[2]);
+
+	config->pnf_param_req = &pnf_param_request;
+	config->pnf_config_req = &pnf_config_request;
+	config->pnf_start_req = &pnf_start_request;
+	config->pnf_stop_req = &pnf_stop_request;
+	config->param_req = &param_request;
+	config->config_req = &config_request;
+	config->start_req = &start_request;
+	
+	config->measurement_req = &measurement_request;
+	config->rssi_req = &rssi_request;
+	config->cell_search_req = &cell_search_request;
+	config->broadcast_detect_req = &broadcast_detect_request;
+	config->system_information_schedule_req = &system_information_schedule_request;
+	config->system_information_req = &system_information_request;
+	config->nmm_stop_req = &nmm_stop_request;
+	
+	config->vendor_ext = &vendor_ext;
+
+	config->trace = &pnf_sim_trace;
+
+	config->user_data = &pnf;
+
+	// To allow custom vendor extentions to be added to nfapi
+	config->codec_config.unpack_vendor_extension_tlv = &pnf_sim_unpack_vendor_extension_tlv;
+	config->codec_config.pack_vendor_extension_tlv = &pnf_sim_pack_vendor_extention_tlv;
+	
+	config->allocate_p4_p5_vendor_ext = &pnf_sim_allocate_p4_p5_vendor_ext;
+	config->deallocate_p4_p5_vendor_ext = &pnf_sim_deallocate_p4_p5_vendor_ext;
+
+	config->codec_config.unpack_p4_p5_vendor_extension = &pnf_sim_unpack_p4_p5_vendor_extension;
+	config->codec_config.pack_p4_p5_vendor_extension = &pnf_sim_pack_p4_p5_vendor_extension;
+
+	return nfapi_pnf_start(config);
+	
+}
diff --git a/nfapi/open-nFAPI/sim_common/Makefile.am b/nfapi/open-nFAPI/sim_common/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..771b768a163feeb41bfc54cc8ca07f587fd1d948
--- /dev/null
+++ b/nfapi/open-nFAPI/sim_common/Makefile.am
@@ -0,0 +1,31 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+AUTOMAKE_OPTIONS=subdir-objects
+
+AM_CFLAGS = -I$(top_srcdir)/sim_common/public_inc -I$(top_srcdir)/common/public_inc -I$(top_srcdir)/nfapi/public_inc -g -Wall -Werror
+
+AM_CXXFLAGS = -I$(top_srcdir)/sim_common/public_inc -I$(top_srcdir)/common/public_inc -std=c++11 -I$(top_srcdir)/nfapi/public_inc $(BOOST_CPPFLAGS) -g -Wall -Werror
+noinst_LIBRARIES =libnfapi_sim_common.a
+#libnfapi_sim_common_a_SOURCES = src/xml_property_tree.cpp src/pool.cpp
+libnfapi_sim_common_a_SOURCES = src/pool.cpp
+
+libnfapi_sim_common_a_CFLAGS =$(AM_CFLAGS)
+libnfapi_sim_common_a_CXXFLAGS =$(AM_CXXFLAGS)
+
+lib_LTLIBRARIES =libnfapi_sim_common.la
+#libnfapi_sim_common_la_SOURCES = src/xml_property_tree.cpp
+libnfapi_sim_common_la_SOURCES = src/pool.cpp
diff --git a/nfapi/open-nFAPI/sim_common/inc/pool.h b/nfapi/open-nFAPI/sim_common/inc/pool.h
new file mode 100644
index 0000000000000000000000000000000000000000..8591d939f969b422cf9c76743f5cb8fe79bc96e1
--- /dev/null
+++ b/nfapi/open-nFAPI/sim_common/inc/pool.h
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _POOL_H_
+#define _POOL_H_
+
+#include <mutex>
+#include <map>
+#include <queue>
+#include <cassert>
+
+
+class pool_config
+{
+    public:
+        
+        size_t size;
+        uint16_t initial_count;
+};
+
+class memory_pool
+{
+    std::mutex mutex;
+	std::map<size_t, std::queue<uint8_t*>> free_store;
+	std::map<size_t, uint16_t> allocated_store;
+	
+    void init(std::vector<pool_config> config)
+    {
+        printf("memory_pool::init\n");
+        		
+        for(pool_config c : config)
+        {
+            // todo : use the initial count to allocate initial pool memory
+            free_store.insert(std::pair<size_t, 
+                                        std::queue<uint8_t*>>
+                                            (c.size, std::queue<uint8_t*>()));
+			allocated_store.insert(std::pair<size_t, uint16_t>(c.size, 0));
+        }
+    }
+    
+    memory_pool()
+    {
+        std::vector<pool_config> config 
+        {
+            {8, 0}, {32, 0}, {64, 0}, {128, 0}, {256, 0}, 
+            {1024, 0}, {4096, 0}, {8912, 0}
+            
+        };
+        
+        init(config);
+    }
+    
+    
+    uint16_t determine_pool_size(size_t size)
+    {
+        for(auto pool : free_store)
+        {
+            if(pool.first >= size)
+                return pool.first;
+        }
+        
+        return 0;
+    }
+    
+    uint8_t* alloc(size_t size)
+    {
+        if(size == 0)
+            return 0;
+            
+        uint8_t* ptr = 0;
+        size_t psize = determine_pool_size(size + 4);
+        
+        if(psize == 0)
+        {
+            ptr =  (uint8_t*)malloc(size + 4);
+			memset(ptr, 0, size + 4);	
+        }
+        else
+        {
+            mutex.lock();
+            
+            auto it = free_store.find(psize);
+            
+            if(it == free_store.end())
+            {
+                // Unknown pool size
+   				ptr =  (uint8_t*)malloc(psize + 4);
+				memcpy(ptr, &psize, 4);
+            }
+            else
+            {
+                if(it->second.size() > 0)
+                {
+                    // Take from the pool
+                    ptr = (uint8_t*)(it->second.front());
+    				it->second.pop();
+                }
+                else
+                {
+                    // No memory left in pool
+                    ptr =  (uint8_t*)malloc(psize + 4);
+				    memcpy(ptr, &psize, 4);
+                }
+            }
+            
+            mutex.unlock();
+        }
+
+        return (ptr + 4);
+    }
+    
+    void dealloc(uint8_t* ptr)
+    {
+      	if(ptr == 0)
+			return;
+			
+		uint8_t* _ptr = (uint8_t*)ptr;
+
+        size_t psize;
+		memcpy(&psize, _ptr - 4, 4);
+		
+		if(psize == 0)
+		{
+		    free(_ptr - 4);
+		}
+		else
+		{
+		    mutex.lock();
+		    
+		    auto it = free_store.find(psize);
+			if(it == free_store.end())
+			{
+			    free(_ptr - 4);
+			}
+			else
+			{
+			    assert((_ptr - 4) != 0);    
+			    it->second.push(_ptr - 4);
+			}
+		    
+		    mutex.unlock();
+		}
+  
+    }
+    
+    public:
+    
+    memory_pool(memory_pool const&) = delete;
+    void operator=(memory_pool const&) = delete;
+    
+    /*! Get the memory_pool instance */
+    static memory_pool& instance()
+    {
+        static memory_pool instance;
+        return instance;
+    }    
+
+    /*! Allocate a buffer from the memory_pool is at least size */
+    static uint8_t* allocate(size_t size)
+    {
+        return instance().alloc(size);
+    }
+    
+    /*! Return the buffer to the memory_pool */
+    static void deallocate(uint8_t* ptr)
+    {
+        return instance().dealloc(ptr);
+    }
+        
+    
+};
+
+#endif // _POOL_H_
diff --git a/nfapi/open-nFAPI/sim_common/inc/vendor_ext.h b/nfapi/open-nFAPI/sim_common/inc/vendor_ext.h
new file mode 100644
index 0000000000000000000000000000000000000000..d0fd57837d2eef4650700eb58399c0249eb68918
--- /dev/null
+++ b/nfapi/open-nFAPI/sim_common/inc/vendor_ext.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _VENDOR_EXT_H_
+#define _VENDOR_EXT_H_
+
+#include "nfapi_interface.h"
+
+typedef enum 
+{
+	P5_VENDOR_EXT_REQ = NFAPI_VENDOR_EXT_MSG_MIN,
+	P5_VENDOR_EXT_RSP,
+
+	P7_VENDOR_EXT_REQ,
+	P7_VENDOR_EXT_IND
+
+} vendor_ext_message_id_e;
+
+typedef struct {
+	nfapi_p4_p5_message_header_t header;
+	uint16_t dummy1;
+	uint16_t dummy2;
+} vendor_ext_p5_req;
+
+typedef struct {
+	nfapi_p4_p5_message_header_t header;
+	uint16_t error_code;
+} vendor_ext_p5_rsp;
+
+typedef struct {
+	nfapi_p7_message_header_t header;
+	uint16_t dummy1;
+	uint16_t dummy2;
+} vendor_ext_p7_req;
+
+typedef struct {
+	nfapi_p7_message_header_t header;
+	uint16_t error_code;
+} vendor_ext_p7_ind;
+
+typedef struct {
+	nfapi_tl_t tl;
+	uint32_t dummy;
+} vendor_ext_tlv_1;
+
+#define VENDOR_EXT_TLV_1_TAG 0xF001
+
+typedef struct {
+	nfapi_tl_t tl;
+	uint32_t dummy;
+} vendor_ext_tlv_2;
+
+#define VENDOR_EXT_TLV_2_TAG 0xF002
+
+
+
+
+#endif // _VENDOR_EXT_
diff --git a/nfapi/open-nFAPI/sim_common/src/pool.cpp b/nfapi/open-nFAPI/sim_common/src/pool.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..47d9cfa992ebd7fdd05ffa6d9963009226fed354
--- /dev/null
+++ b/nfapi/open-nFAPI/sim_common/src/pool.cpp
@@ -0,0 +1,15 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
diff --git a/nfapi/open-nFAPI/vnf/Makefile.am b/nfapi/open-nFAPI/vnf/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..ae8d2bb3d67ed480faf29d94762438c250728d9b
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf/Makefile.am
@@ -0,0 +1,43 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+
+AUTOMAKE_OPTIONS=subdir-objects
+
+AM_CPPFLAGS = -I$(top_srcdir)/vnf/inc\
+			  -I$(top_srcdir)/vnf/public_inc\
+			  -I$(top_srcdir)/nfapi/public_inc\
+			  -I$(top_srcdir)/common/public_inc\
+			  -Wall -Werror -g
+
+
+noinst_LIBRARIES = libnfapi_vnf.a
+
+libnfapi_vnf_a_SOURCES = src/vnf.c\
+						 src/vnf_p7.c\
+						 src/vnf_interface.c\
+						 src/vnf_p7_interface.c
+
+LDADD = -lsctp  ../common/bin/libnfapi_common.a
+
+libnfapi_vnf_a_CFLAGS =$(AM_CFLAGS)
+
+lib_LTLIBRARIES = libnfapi_vnf.la
+
+libnfapi_vnf_la_SOURCES =  src/vnf.c\
+						 src/vnf_p7.c\
+						 src/vnf_interface.c\
+						 src/vnf_p7_interface.c
diff --git a/nfapi/open-nFAPI/vnf/inc/vnf.h b/nfapi/open-nFAPI/vnf/inc/vnf.h
new file mode 100644
index 0000000000000000000000000000000000000000..4fd8d2b91d6e1ec63b08e8ffb3a4ba0786c30b53
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf/inc/vnf.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef _VNF_H_
+#define _VNF_H_
+
+#include "nfapi_vnf_interface.h"
+
+typedef struct 
+{
+
+	nfapi_vnf_config_t _public;
+
+	uint8_t terminate;
+	uint8_t sctp;
+
+	uint8_t tx_message_buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE];
+	uint16_t next_phy_id;
+	
+} vnf_t;
+
+
+int vnf_pack_and_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_p4_p5_message_header_t* msg, uint16_t msg_len);
+int vnf_pack_and_send_p4_message(vnf_t* vnf, uint16_t p5_idx, nfapi_p4_p5_message_header_t* msg, uint16_t msg_len);
+
+int vnf_read_dispatch_message(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_t* pnf);
+
+void nfapi_vnf_phy_info_list_add(nfapi_vnf_config_t* config, nfapi_vnf_phy_info_t* info);
+nfapi_vnf_phy_info_t* nfapi_vnf_phy_info_list_find(nfapi_vnf_config_t* config, uint16_t phy_id);
+void nfapi_vnf_pnf_list_add(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_t* node);
+nfapi_vnf_pnf_info_t* nfapi_vnf_pnf_list_find(nfapi_vnf_config_t* config, int p5_idx);
+#endif // _VNF_H_
diff --git a/nfapi/open-nFAPI/vnf/inc/vnf_p7.h b/nfapi/open-nFAPI/vnf/inc/vnf_p7.h
new file mode 100644
index 0000000000000000000000000000000000000000..fc2ab4e6b5382bd282d08d1a20290b98b0e65f88
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf/inc/vnf_p7.h
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef _VNF_P7_H_
+#define _VNF_P7_H_
+
+#include "nfapi_vnf_interface.h"
+
+#define TIMEHR_SEC(_time_hr) ((uint32_t)(_time_hr) >> 20)
+#define TIMEHR_USEC(_time_hr) ((uint32_t)(_time_hr) & 0xFFFFF)
+#define TIME2TIMEHR(_time) (((uint32_t)(_time.tv_sec) & 0xFFF) << 20 | ((uint32_t)(_time.tv_usec) & 0xFFFFF))
+
+
+
+typedef struct {
+	uint8_t* buffer;
+	uint16_t length;
+} vnf_p7_rx_message_segment_t;
+
+typedef struct vnf_p7_rx_message vnf_p7_rx_message_t;
+
+typedef struct vnf_p7_rx_message {
+	uint8_t sequence_number;
+	uint8_t num_segments_received;
+	uint8_t num_segments_expected;
+
+	// the spec allows of upto 128 segments, this does seem excessive
+	vnf_p7_rx_message_segment_t segments[128];
+
+	uint32_t rx_hr_time;
+
+	vnf_p7_rx_message_t* next;
+} vnf_p7_rx_message_t;
+
+typedef struct {
+
+	vnf_p7_rx_message_t* msg_queue;
+
+} vnf_p7_rx_reassembly_queue_t;
+
+typedef struct nfapi_vnf_p7_connection_info {
+
+	/*! The PHY id */
+	int phy_id;
+
+
+	// this does not belong here...
+	uint8_t stream_id;
+
+	/*! Flag indicating the sync state of the P7 conenction */
+	uint8_t in_sync;
+
+	int dl_out_sync_offset; 
+	int dl_out_sync_period; // ms (as a pow2)
+
+	int dl_in_sync_offset; 
+	int dl_in_sync_period; // ms (as a pow2)
+
+	uint8_t filtered_adjust;
+	uint16_t min_sync_cycle_count;
+	uint32_t latency[8];
+	uint32_t average_latency;
+	int32_t sf_offset_filtered;
+	int32_t sf_offset_trend;
+	int32_t sf_offset;
+	uint16_t zero_count;
+	int32_t adjustment;
+	int32_t insync_minor_adjustment;
+	int32_t insync_minor_adjustment_duration;
+
+	uint32_t previous_t1;
+	uint32_t previous_t2;
+	int32_t previous_sf_offset_filtered;
+
+	int sfn_sf;
+
+	int socket;
+	struct sockaddr_in local_addr;
+	struct sockaddr_in remote_addr;
+	
+	vnf_p7_rx_reassembly_queue_t reassembly_queue;
+	uint8_t* reassembly_buffer;
+	uint32_t reassembly_buffer_size;
+
+	uint32_t sequence_number;
+
+	struct nfapi_vnf_p7_connection_info* next;
+
+} nfapi_vnf_p7_connection_info_t;
+
+typedef struct {
+
+	nfapi_vnf_p7_config_t _public;
+	
+	// private data
+	uint8_t terminate;
+	nfapi_vnf_p7_connection_info_t* p7_connections;
+	int socket;
+	uint32_t sf_start_time_hr;
+	uint8_t* rx_message_buffer; // would this be better put in the p7 conenction info?
+	uint16_t rx_message_buffer_size;
+	
+} vnf_p7_t;
+
+uint32_t vnf_get_current_time_hr(void);
+
+uint16_t increment_sfn_sf(uint16_t sfn_sf);
+int vnf_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info);
+int send_mac_subframe_indications(vnf_p7_t* config);
+int vnf_p7_read_dispatch_message(vnf_p7_t* vnf_p7 );
+
+void vnf_p7_connection_info_list_add(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* node);
+nfapi_vnf_p7_connection_info_t* vnf_p7_connection_info_list_find(vnf_p7_t* vnf_p7, uint16_t phy_id);
+nfapi_vnf_p7_connection_info_t* vnf_p7_connection_info_list_delete(vnf_p7_t* vnf_p7, uint16_t phy_id);
+
+int vnf_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header);
+
+void vnf_p7_release_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header);
+void vnf_p7_release_pdu(vnf_p7_t* vnf_p7, void* pdu);
+
+
+#endif // _VNF_P7_H_
diff --git a/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h b/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
new file mode 100644
index 0000000000000000000000000000000000000000..462901391a8cd63bfc9b25a239f8600870fdad52
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
@@ -0,0 +1,995 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _NFAPI_VNF_INTERFACE_H_
+#define _NFAPI_VNF_INTERFACE_H_
+
+#include "nfapi_interface.h"
+#include "debug.h"
+
+#include "netinet/in.h"
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define NFAPI_MAX_PACKED_MESSAGE_SIZE 8192
+
+/*! The nfapi VNF phy configuration information
+ */
+typedef struct nfapi_vnf_phy_info
+{
+	/*! The P5 Index */
+	int p5_idx;	//which p5 connection
+	/*! The PHY ID */
+	int phy_id; //phy_id
+
+	/*! Timing window */
+	uint8_t timing_window;
+	/*! Timing info mode */
+	uint8_t timing_info_mode;
+	/*! Timing info period */
+	uint8_t timing_info_period;
+
+	/*! P7 UDP socket information for the pnf */
+	struct sockaddr_in p7_pnf_address;
+	/*! P7 UDP socket information for the vnf */
+	struct sockaddr_in p7_vnf_address;
+
+	struct nfapi_vnf_phy_info* next;
+} nfapi_vnf_phy_info_t;
+
+/*! The nfapi VNF pnf configuration information
+ */
+typedef struct nfapi_vnf_pnf_info
+{
+	/*! The P5 Index */
+	int p5_idx;
+	/*! The P5 socket */
+	int p5_sock;
+	/*! Flag indicating if the pnf is connected */
+	uint8_t connected;
+
+	/*! P5 SCTP socket information for the pnf */
+	struct sockaddr_in p5_pnf_sockaddr;
+
+	/*! Flag indicating if this pnf should be deleted */
+	uint8_t to_delete;
+
+	struct nfapi_vnf_pnf_info* next;
+
+} nfapi_vnf_pnf_info_t;
+
+typedef struct nfapi_vnf_config nfapi_vnf_config_t;
+
+/*! The nfapi VNF configuration information
+ */
+typedef struct nfapi_vnf_config
+{
+	/*! A user define callback to override the default memory allocation */
+	void* (*malloc)(size_t size);
+	/*! A user define callback to override the default memory deallocation */
+	void (*free)(void*);
+	/*! A user define callback to handle trace from the pnf */
+	void (*trace)(nfapi_trace_level_t level, const char* message, ...);
+
+	/*! The port the VNF P5 SCTP connection listens on
+	 *
+	 *  By default this will be set to 7701. However this can be changed if
+	 *  required.
+	 */
+	int vnf_p5_port;
+
+	// todo : for enabling ipv4/ipv6
+	int vnf_ipv4;
+	int vnf_ipv6;
+
+	/*! List of connected pnfs */
+	nfapi_vnf_pnf_info_t* pnf_list;
+
+	/*! List of configured phys */
+	nfapi_vnf_phy_info_t* phy_list;
+
+	/*! Configuration options for the p4 p5 pack unpack functions */
+	nfapi_p4_p5_codec_config_t codec_config;
+	
+	/*! Optional user defined data that will be avaliable in the callbacks*/
+	void* user_data;
+
+	/*! \brief Callback indicating that a pnf has established connection 
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 used to indicate this pnf p5 connection
+	 * 
+	 *  The client is expected to send the PNF_PARAM.request in response to 
+	 *  the connection indication
+	 * 
+	 *  \todo Do we need to send the address information of the PNF?
+	 */
+	int (*pnf_connection_indication)(nfapi_vnf_config_t* config, int p5_idx);
+	
+	/*! \brief Callback indicating that a pnf has lost connection 
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 used to indicate this pnf p5 connection
+	 *
+	 *  The p5_idx may be used for future new p5 connections
+	 *
+	 *  The client is responsiable for communicating to the p7 instance(s) that
+	 *  may be associated with this p5 that they should be deleted using the 
+	 *  nfapi_vnf_p7_del_pnf functon
+	 * 
+	 */
+	int (*pnf_disconnect_indication)(nfapi_vnf_config_t* config, int p5_idx);
+
+	// p5 interface functions
+	
+	/*! \brief A callback to handle the PNF_PARAM.resp
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded PNF_PARAM.response. This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 *  
+	 *  The PNF_PARAM.resp contains the capability of the PNF identified by the
+	 *  p5_idx. 
+	 *  
+	 *  The client is expected to send the PNF_CONFIG.request after receiving the
+	 *  PNF_PARAM.resp. This can be done in the call back. 
+	 *
+	 *  It is expected that the client when building the PNF_CONFIG.request will
+	 *  used the nfapi_vnf_allocate_phy() to allocate unique phy id for each FAPI
+	 *  instance the client wishes to create.
+	 *  
+	 *  The resp may contain pointers to dyanmically allocated sub structures  
+	 *  such as the vendor_extention. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */
+	int (*pnf_param_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_response_t* resp);
+	
+	/*! A callback for the PNF_CONFIG.resp 
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded PNF_CONFIG.response. This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 *  
+	 *  The PNF_CONFIG.resp contains the result of the PNF_CONFIG.request for the 
+	  * PNF identified by the p5_idx. 
+	 *  
+	 *  The client is expected to send the PNF_START.request after receiving the
+	 *  PNF_PARAM.resp. This can be done in the call back. 
+	 *  
+	 *  The resp may contain pointers to dyanmically allocated sub structures  
+	 *  such as the vendor_extention. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */
+	int (*pnf_config_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_config_response_t* resp);
+	
+	/*! A callback for the PNF_START.resp
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded PNF_START.response. This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 *  
+	 *  The PNF_START.resp contains the result of the PNF_START.request for the 
+	 *  PNF identified by the p5_idx. 
+	 *  
+	 *  The client is expected to send the PARAM.request for each FAPI instance 
+	 *  that has been created in the PNF. 
+	 *  
+	 *  The resp may contain pointers to dyanmically allocated sub structures  
+	 *  such as the vendor_extention. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */
+	int (*pnf_start_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_start_response_t* resp);
+	
+	/*! A callback for the PNF_STOP.resp
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded PNF_STOP.response. This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 *  
+	 *  The PNF_STOP.response contains the result of the PNF_STOP.request for the 
+     *  PNF identified by the p5_idx. 
+	 *  
+	 *  The resp may contain pointers to dyanmically allocated sub structures  
+	 *  such as the vendor_extention. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */
+	int (*pnf_stop_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_stop_response_t* resp);
+	
+	/*! A callback for the PARAM.resp
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded PARAM.resposne. This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 *  
+	 *  The PARAM.request contains the capabilities of the FAPI instance identified
+	 *  by the phy_id
+	 *
+	 *  The client is expected to send the CONFIG.request after receiving the
+	 *  PARAM.response. This can be done in the call back. The PARAM.response 
+	 *  contains the PNF P7 address (ipv4 or ipv6) and port. This information 
+	 *  is used when calling the nfapi_vnf_p7_add_pnf()
+	 * 
+	 *  The client is responsible for identifing the VNF P7 ip address 
+	 *  (ipv4 or ipv6) and port for the VNF P7 entity which will be sent to the
+	 *  PNF P7 entity. That endpoint should be valid before send the 
+	 * CONFIG.request.
+	 * 
+	 *  The resp may contain pointers to dyanmically allocated sub structures  
+	 *  such as the vendor_extention. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */
+	int (*param_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_response_t* resp);
+	
+	/*! A callback for the CONFIG.response
+     *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded CONFIG.response This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 *  
+	 *  The CONFIG.response contains the result of the CONFIG.request
+	 *
+	 * 
+	 *  The resp may contain pointers to dyanmically allocated sub structures  
+	 *  such as the vendor_extention. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */
+	int (*config_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_config_response_t* resp);
+	
+	/*! A callback for the START.resp
+     *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded START.response This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 *  
+	 *  The START.response contains the result of the START.request
+	 *
+	 * 
+	 *  The resp may contain pointers to dyanmically allocated sub structures  
+	 *  such as the vendor_extention. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */
+	int (*start_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_start_response_t* resp);
+	
+	/*! A callback for the STOP.resp
+     *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded STOP.response This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 *  
+	 *  The STOP.response contains the result of the STOP.request
+	 *
+	 * 
+	 *  The resp may contain pointers to dyanmically allocated sub structures  
+	 *  such as the vendor_extention. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*stop_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_stop_response_t* resp);
+	 
+	/*! A callback for the MEASUREMENT.resp 
+     *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded MEASUREMENT.response This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 *  
+	 *  The MEASUREMENT.response contains the result of the MEASUREMENT.request
+	 * 
+	 *  The resp may contain pointers to dyanmically allocated sub structures  
+	 *  such as the vendor_extention. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*measurement_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_measurement_response_t* resp);
+
+	// p4 interface functions
+	/*! A callback for the RSSI.resp 
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded RSSI.response This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 */
+	int (*rssi_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_rssi_response_t* resp);
+	
+	/*! A callback for the RSSI.indication
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded RSSI.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 */
+	int (*rssi_ind)(nfapi_vnf_config_t* config, int p5_idx, nfapi_rssi_indication_t* ind);
+	
+	/*! A callback for the CELL_SEARCH.response
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded CELL_SEARCH.response This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 */
+	int (*cell_search_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_cell_search_response_t* resp);
+	
+	/*! A callback for the CELL_SEARCH.indication
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded CELL_SEARCH.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 */
+	int (*cell_search_ind)(nfapi_vnf_config_t* config, int p5_idx, nfapi_cell_search_indication_t* ind);
+	
+	/*! A callback for the BROADCAST_DETECT.response
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded BROADCAST_DETECT.response This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.	 */
+	int (*broadcast_detect_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_broadcast_detect_response_t* resp);
+	
+	/*! A callback for the BROADCAST_DETECT.indication
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded BROADCAST_DETECT.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.	 
+	 */
+	int (*broadcast_detect_ind)(nfapi_vnf_config_t* config, int p5_idx, nfapi_broadcast_detect_indication_t* ind);
+	
+	/*! A callback for the SYSTEM_INFORMATION_SCHEUDLE.response
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded SYSTEM_INFORMATION_SCHEUDLE.response This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.	 
+	 */
+	int (*system_information_schedule_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_system_information_schedule_response_t* resp);
+	
+	/*! A callback for the SYSTEM_INFORMATION_SCHEUDLE.indication
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded SYSTEM_INFORMATION_SCHEUDLE.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.	
+	 */
+	int (*system_information_schedule_ind)(nfapi_vnf_config_t* config, int p5_idx, nfapi_system_information_schedule_indication_t* ind);
+	
+	/*! A callback for the SYSTEM_INFORMATION.response
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded SYSTEM_INFORMATION.response This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.	
+	 */
+	int (*system_information_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_system_information_response_t* resp);
+	
+	/*! A callback for the SYSTEM_INFORMATION.indication
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded SYSTEM_INFORMATION.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.	
+	 */
+	int (*system_information_ind)(nfapi_vnf_config_t* config, int p5_idx, nfapi_system_information_indication_t* ind);
+	
+	/*! A callback for the NMM_STOP.response
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded NMM_STOP.response This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.		
+	 */
+	int (*nmm_stop_resp)(nfapi_vnf_config_t* config, int p5_idx, nfapi_nmm_stop_response_t* resp);
+	
+
+	/*! A callback for any vendor extension message received
+	 *  \param config A pointer to the vnf configuration
+	 *  \param p5_idx The p5 index used to indicate a particular pnf p5 connection
+	 *  \param resp A data structure for the decoded vendor extention message 
+	 *  \return not currently used.	
+	 */
+	int (*vendor_ext)(nfapi_vnf_config_t* config, int p5_idx, nfapi_p4_p5_message_header_t* msg);
+
+	/*! A callback to allocate vendor extension messages
+	 *  \param message_id The message is taken from the message header
+	 *  \param msg_size The is the vendor extention message that has been allocated. 
+	 *					The callee must set this value
+	 *	\return A pointer to an allocated vendor extention message
+	 */
+	nfapi_p4_p5_message_header_t* (*allocate_p4_p5_vendor_ext)(uint16_t message_id, uint16_t* msg_size);
+	
+	/*! A callback to deallocate vendor extension messages
+	 *  \param header A pointer to an allocated vendor extention message
+	 */
+	void (*deallocate_p4_p5_vendor_ext)(nfapi_p4_p5_message_header_t* header);
+
+
+
+
+	
+	
+} nfapi_vnf_config_t;
+
+/*! Creates and initialise the vnf config structure before use
+ * \return A pointer to a vnf config structure
+ */
+nfapi_vnf_config_t* nfapi_vnf_config_create(void);
+
+/*! Delete an vnf config
+ */
+void nfapi_vnf_config_destory(nfapi_vnf_config_t* config);
+
+
+/*! Start the VNF library. 
+ * \param config A pointer to a vnf config
+ * \return 0 means success, -1 failure
+ *
+ * The config should be initailize with port the vnf should listen on and
+ * the callback set to functions that will be called when a nFAPI message is 
+ * recevied before calling nfapi_vnf_start.
+ * 
+ * This function will not return untill nfapi_vnf_stop is called
+ */
+int nfapi_vnf_start(nfapi_vnf_config_t* config);
+
+/*! Stop the VNF library. 
+ * \param config A pointer to a vnf config
+ * \return 0 means success, -1 failure
+ * 
+ * This function will cause the nfapi_vnf_start function to return
+ */
+int nfapi_vnf_stop(nfapi_vnf_config_t* config);
+
+/*! Allocates a PHY ID for the PNF PHY instance managed by this VNF
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index return by the callbacks
+ * \param phy_id A pointer to a phy_id that will be set by this function
+ * \return  0 means success, -1 failure
+ * 
+ * Called before nfapi_vnf_config_req to allocate a vnf phy instance. This
+ * function will return unqiue phy_id to be used for this identify the phy
+ *
+ */
+int nfapi_vnf_allocate_phy(nfapi_vnf_config_t* config, int p5_idx, uint16_t* phy_id);
+
+// P5 Request functions
+//
+/*! Send the PNF_PARAM.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a PNF_PARAM.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_pnf_param_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_request_t* req);
+
+/*! Send the PNF_CONFIG.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a PNF_CONFIG.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_pnf_config_req(nfapi_vnf_config_t* config,int p5_idx, nfapi_pnf_config_request_t* req);
+
+/*! Send the PNF_START.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a PNF_START.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_pnf_start_req(nfapi_vnf_config_t* config,int p5_idx, nfapi_pnf_start_request_t* req);
+
+/*! Send the PNF_STOP.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a PNF_STOP.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_pnf_stop_req(nfapi_vnf_config_t* config,int p5_idx, nfapi_pnf_stop_request_t* req);
+
+/*! Send the PARAM.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a PARAM.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_param_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_request_t* req);
+
+/*! Send the CONFIG.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a CONFIG.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_config_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_config_request_t* req);
+
+/*! Send the START.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a START.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_start_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_start_request_t* req);
+
+/*! Send the STOP.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a STOP.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_stop_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_stop_request_t* req);
+
+/*! Send the MEASUREMENT.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a MEASUREMENT.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_measurement_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_measurement_request_t* req);
+
+// P4 Request functions
+/*! Send the RSSI.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a RSSI.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_rssi_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_rssi_request_t* req);
+
+/*! Send the CELL_SEARCH.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a CELL_SEARCH.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_cell_search_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_cell_search_request_t* req);
+
+/*! Send the BROADCAST_DETECT.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a BROADCAST_DETECT.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_broadcast_detect_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_broadcast_detect_request_t* req);
+
+/*! Send the SYSTEM_INFORMATION_SCHEDULE.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a SYSTEM_INFORMATION_SCHEDULE.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_system_information_schedule_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_system_information_schedule_request_t* req);
+
+/*! Send the SYSTEM_INFORMATION.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a SYSTEM_INFORMATION.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_system_information_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_system_information_request_t* req);
+
+/*! Send the NMM_STOP.request
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param req A pointer to a NMM_STOP.request message structure
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_nmm_stop_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_nmm_stop_request_t* req);
+
+/*! Send a vendor extension message
+ * \param config A pointer to a vnf config
+ * \param p5_idx The P5 index
+ * \param msg A poiner to a vendor extention message
+ * \return  0 means success, -1 failure
+ */
+int nfapi_vnf_vendor_extension(nfapi_vnf_config_t* config, int p5_idx, nfapi_p4_p5_message_header_t* msg);
+
+//-----------------------------------------------------------------------------
+
+/*! The nfapi VNF P7 connection information
+ */
+typedef struct nfapi_vnf_p7_config nfapi_vnf_p7_config_t;
+
+/*! The nfapi VNF P7 configuration information
+ */
+typedef struct nfapi_vnf_p7_config
+{
+	/*! A user define callback to override the default memory allocation
+	 * \param size Size of the memory block to allocate
+	 * \return a pointer to a memory block
+	 *
+	 * If not set the vnf p7 library will use malloc
+	 */
+	void* (*malloc)(size_t size);
+	
+	/*! A user define callback to override the default memory deallocation
+	 * \param ptr Pointer to a memory block to deallocate
+	 *
+	 * If not set the vnf p7 library will use free
+	 */
+	void (*free)(void*);
+	
+	/*! A user define callback to handle trace from the pnf
+	 * \param level The trace level 
+	 * \param message The trace string
+	 */
+	void (*trace)(nfapi_trace_level_t level, const char* message, ...);
+
+	/*! The port the vnf p7 will receive on */
+	int port;
+
+	/*! Flag to indicate of the pnf should use the P7 checksum */
+	uint8_t checksum_enabled;
+
+	/*! The maxium size of a P7 segement. If a message is large that this it
+	 * will be segemented */
+	uint16_t segment_size;
+	uint16_t max_num_segments;
+
+	/*! Configuration option for the p7 pack unpack functions*/
+	nfapi_p7_codec_config_t codec_config;
+
+	/* ! Call back to indicate the sync state with the PNF PHY
+	 * \param config A pointer to the vnf p7 configuration
+	 * \param sync Indicating if the pnf is in sync or not
+	 * \return not currently used
+	 *
+	 * sync = 0  : in sync
+	 * sync != 0 : out of sync
+	 */
+	int (*sync_indication)(struct nfapi_vnf_p7_config* config, uint8_t sync);
+
+	/*! A callback for the subframe indication
+	 * \param config A pointer to the vnf p7 configuration
+	 * \param phy_id The ID for the PNF PHY instance
+	 * \param sfn_sf The SFN SF number formated as per the FAPI specification
+	 * \return not currently used
+	 *
+	 * This callback is an indication for the VNF to generate the downlink subframe messages
+	 * for sfn/sf. This indicatoin is called every millisecond
+	 *
+	 * The VNF P7 Lib will adjust the subframe timing to 'catch-up' or 'slow-down' with the PNF PHY's
+	 *
+	 * \todo Need some way the tell the VNF how long it has
+	 */
+	
+	int (*subframe_indication)(struct nfapi_vnf_p7_config* config, uint16_t phy_id, uint16_t sfn_sf);
+
+	/*! A callback for the HARQ.indication
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param ind A data structure for the decoded HARQ.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 * 
+	 *  The ind may contain pointers to dyanmically allocated sub structures  
+	 *  such as the pdu. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*harq_indication)(struct nfapi_vnf_p7_config* config, nfapi_harq_indication_t* ind);
+	
+	/*! A callback for the CRC.ind
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param ind A data structure for the decoded CRC.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 * 
+	 *  The ind may contain pointers to dyanmically allocated sub structures  
+	 *  such as the pdu. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*crc_indication)(struct nfapi_vnf_p7_config* config, nfapi_crc_indication_t* ind);
+	
+	/*! A callback for the RX_ULSCH.indication
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param ind A data structure for the decoded RX_ULSCH.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 * 
+	 *  The ind may contain pointers to dyanmically allocated sub structures  
+	 *  such as the pdu. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 *
+	 *  Note that the rx_indication may hold one or many uplink pdus in the 
+	 *  ind.rx_indication_body.rx_pdu_list
+	 */	
+	int (*rx_indication)(struct nfapi_vnf_p7_config* config, nfapi_rx_indication_t* ind);
+	
+	/*! A callback for the RACH.indication
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param ind A data structure for the decoded RACH.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 * 
+	 *  The ind may contain pointers to dyanmically allocated sub structures  
+	 *  such as the pdu. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*rach_indication)(struct nfapi_vnf_p7_config* config, nfapi_rach_indication_t* ind);
+	
+	/*! A callback for the SRS.indication
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param ind A data structure for the decoded SRS.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 * 
+	 *  The ind may contain pointers to dyanmically allocated sub structures  
+	 *  such as the pdu. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*srs_indication)(struct nfapi_vnf_p7_config* config, nfapi_srs_indication_t* ind);
+	
+	/*! A callback for the RX_SR.indication
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param ind A data structure for the decoded RX_SR.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 * 
+	 *  The ind may contain pointers to dyanmically allocated sub structures  
+	 *  such as the pdu. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*sr_indication)(struct nfapi_vnf_p7_config* config, nfapi_sr_indication_t* ind);
+	
+	/*! A callback for the RX_CQI.indication
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param ind A data structure for the decoded RX_CQI.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 * 
+	 *  The ind may contain pointers to dyanmically allocated sub structures  
+	 *  such as the pdu. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*cqi_indication)(struct nfapi_vnf_p7_config* config, nfapi_cqi_indication_t* ind);
+	
+	/*! A callback for the LBT_DL.indication
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param ind A data structure for the decoded LBT_DL.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 * 
+	 *  The ind may contain pointers to dyanmically allocated sub structures  
+	 *  such as the pdu. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*lbt_dl_indication)(struct nfapi_vnf_p7_config* config, nfapi_lbt_dl_indication_t* ind);
+	
+	/*! A callback for the NB_HARQ.indication
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param ind A data structure for the decoded LBT_DL.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 * 
+	 *  The ind may contain pointers to dyanmically allocated sub structures  
+	 *  such as the pdu. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*nb_harq_indication)(struct nfapi_vnf_p7_config* config, nfapi_nb_harq_indication_t* ind);	
+	
+	/*! A callback for the NRACH.indication
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param ind A data structure for the decoded LBT_DL.indication This will 
+	 *              have been allocated on the stack. 
+	 *  \return not currently used.
+	 * 
+	 *  The ind may contain pointers to dyanmically allocated sub structures  
+	 *  such as the pdu. The dyanmically allocated structure will 
+	 *  be deallocated on return. If the client wishes to 'keep' the structures 
+	 *  then the substructure pointers should be set to 0 and then the client should
+	 *  use the codec_config.deallocate function to release it at a future point
+	 */	
+	int (*nrach_indication)(struct nfapi_vnf_p7_config* config, nfapi_nrach_indication_t* ind);		
+	
+	/*! A callback for any vendor extension messages
+     *  \param config A pointer to the vnf p7 configuration
+	 *  \param msg A data structure for the decoded vendor extention message allocated
+	 *			   using the allocate_p7_vendor_ext callback
+	 *  \return not currently used.
+	 */	
+	int (*vendor_ext)(struct nfapi_vnf_p7_config* config, nfapi_p7_message_header_t* msg);
+
+	/*! Optional userdata that will be passed back in the callbacks*/
+	void* user_data;
+	
+	/*! A callback to allocate a memory for a vendor extension message
+	 *  \param message_id The message is taken from the p7 message header
+	 *  \param msg_size The is the vendor extention message that has been allocated. 
+	 *					The callee must set this value
+	 *	\return A pointer to an allocated vendor extention message
+	 */
+	nfapi_p7_message_header_t* (*allocate_p7_vendor_ext)(uint16_t message_id, uint16_t* msg_size);
+	
+	/*! A callback to deallocate a vendor extension message
+	 *  \param header A pointer to an allocated vendor extention message
+	 */
+	void (*deallocate_p7_vendor_ext)(nfapi_p7_message_header_t* header);
+
+
+} nfapi_vnf_p7_config_t;
+
+/*! Creates and initializes the nfapi_vnf_p7_config structure before use
+ *  \return A pointer to an allocated vnf p7 configuration
+ */
+nfapi_vnf_p7_config_t* nfapi_vnf_p7_config_create(void);
+
+/*! Cleanup and delete nfapi_vnf_p7_config structure
+ *  \param config A pointer to an vnf p7 configuration structure
+ *
+ *  The pointer to the config will not long be valid after this call
+ */
+ 
+void nfapi_vnf_p7_config_destory(nfapi_vnf_p7_config_t* config);
+
+/*! Start the VNF P7 library.
+ *  \param config A pointer to an vnf p7 configuration structure
+ *	\return A status value. 0 equal success, -1 indicates failure
+ *
+ * This function is blocking and will not return until the nfapi_vnf_p7_stop
+ * function is called. 
+ */
+ 
+int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config);
+
+/*! Stop the VNF P7 library. 
+ *  \param config A pointer to an vnf p7 configuration structure
+ *	\return A status value. 0 equal success, -1 indicates failure
+ * 
+ * This function will cause the nfapi_vnf_p7_start function to return
+ */
+int nfapi_vnf_p7_stop(nfapi_vnf_p7_config_t* config);
+
+/*! Release a P7 message back to the vnf_p7 library. This should be used if the
+ *  callback return 0 in the case where MAC wants to keep the message for
+ *  futher processing.
+ *  This function will release any pdu's is they are non-null. If the uplink
+ *  PDU need to be kept then they pdu pointer should be set to 0 in the message
+ *  and then the nfapi_vnf_p7_release_pdu message can be used to release the
+ *  pdu later.
+ */
+int nfapi_vnf_p7_release_msg(nfapi_vnf_p7_config_t* config, nfapi_p7_message_header_t*);
+
+/*! Release a P7 pdu's back to the vnf_p7 library.
+ */
+int nfapi_vnf_p7_release_pdu(nfapi_vnf_p7_config_t* config, void*);
+
+/*! Add a vnf p7 instance to the vnf p7 module
+ *  \param config A pointer to the vnf p7 configuration
+ *  \param pnf_p7_addr The udp address the pnf p7 entity has chosen 
+ *  \param pnf_p7_port The udp port the pnf p7 entity has chosen
+ *  \param phy_id The unique phy id for the pnf p7 entity
+ *  \return A status value. 0 equal success, -1 indicates failure
+ *
+ * This function should be used to each pnf p7 entity that is to be added to this
+ * vnf p7 entity. Once added the vnf p7 entity will start establish sync with the
+ * pnf p7 entity and that has been sucessfull will generate subframe indications for it
+ */
+int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id);
+
+/*! Delete a vnf p7 instance to the vnf p7 module
+ *  \param config A pointer to the vnf p7 configuration
+ *  \param phy_id The unique phy id for the pnf p7 entity
+ *  \return A status value. 0 equal success, -1 indicates failure
+ *
+ * This function should be used to remove a pnf p7 entity from the vnf p7 entity
+ */
+int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id);
+
+/*! Send the DL_CONFIG.request
+ *  \param config A pointer to the vnf p7 configuration
+ *  \param req A data structure for the decoded DL_CONFIG.request.
+ *	\return A status value. 0 equal success, -1 indicates failure
+ * 
+ *  The caller is responsiable for memory management of any pointers set in the req, which
+ *  may be released after this function call has returned or at a later pointer
+ */
+int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req);
+
+/*! Send the UL_CONFIG.request
+ *  \param config A pointer to the vnf p7 configuration
+ *  \param req A data structure for the decoded UL_CONFIG.request.
+ *	\return A status value. 0 equal success, -1 indicates failure
+ * 
+ *  The caller is responsiable for memory management of any pointers set in the req, which
+ *  may be released after this function call has returned or at a later pointer
+ */
+int nfapi_vnf_p7_ul_config_req(nfapi_vnf_p7_config_t* config, nfapi_ul_config_request_t* req);
+
+/*! Send the HI_DCI0.request
+ *  \param config A pointer to the vnf p7 configuration
+ *  \param req A data structure for the decoded HI_DCI0.request.
+ *	\return A status value. 0 equal success, -1 indicates failure
+ * 
+ *  The caller is responsiable for memory management of any pointers set in the req, which
+ *  may be released after this function call has returned or at a later pointer
+ */
+int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_request_t* req);
+
+/*! Send the TX.req
+ *  \param config A pointer to the vnf p7 configuration
+ *  \param req A data structure for the decoded HI_DCI0.request.
+ *	\return A status value. 0 equal success, -1 indicates failure
+ * 
+ *  The caller is responsiable for memory management of any pointers set in the req, which
+ *  may be released after this function call has returned or at a later pointer
+ */
+int nfapi_vnf_p7_tx_req(nfapi_vnf_p7_config_t* config, nfapi_tx_request_t* req);
+
+/*! Send the LBT_DL_CONFIG.requst
+ *  \param config A pointer to the vnf p7 configuration
+ *  \param req A data structure for the decoded LBT_DL_CONFIG.request.
+ *	\return A status value. 0 equal success, -1 indicates failure
+ * 
+ *  The caller is responsiable for memory management of any pointers set in the req, which
+ *  may be released after this function call has returned or at a later pointer
+ */
+int nfapi_vnf_p7_lbt_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_lbt_dl_config_request_t* req);
+
+/*! Send a vendor extension message
+ *  \param config A pointer to the vnf p7 configuration
+ *  \param msg A data structure for the decoded vendor extention message
+ *	\return A status value. 0 equal success, -1 indicates failure
+ * 
+ *  The caller is responsiable for memory management of any pointers set in the req, which
+ *  may be released after this function call has returned or at a later pointer
+ */
+int nfapi_vnf_p7_vendor_extension(nfapi_vnf_p7_config_t* config, nfapi_p7_message_header_t* msg);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif // _NFAPI_PNF_INTERFACE_H_
diff --git a/nfapi/open-nFAPI/vnf/src/vnf.c b/nfapi/open-nFAPI/vnf/src/vnf.c
new file mode 100644
index 0000000000000000000000000000000000000000..6800ee21d202cbae1c69ae5335ab7fbae3efd7a0
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf/src/vnf.c
@@ -0,0 +1,1123 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/sctp.h>
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "vnf.h"
+
+
+void* vnf_malloc(nfapi_vnf_config_t* config, size_t size)
+{
+	if(config->malloc)
+	{
+		return (config->malloc)(size);
+	}
+	else
+	{
+		return calloc(1, size); 
+	}
+}
+void vnf_free(nfapi_vnf_config_t* config, void* ptr)
+{
+	if(config->free)
+	{
+		return (config->free)(ptr);
+	}
+	else
+	{
+		return free(ptr); 
+	}
+}
+
+void nfapi_vnf_phy_info_list_add(nfapi_vnf_config_t* config, nfapi_vnf_phy_info_t* info)
+{
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "Adding phy p5_idx:%d phy_id:%d\n", info->p5_idx, info->phy_id);
+	info->next = config->phy_list;
+	config->phy_list = info;
+}
+
+nfapi_vnf_phy_info_t* nfapi_vnf_phy_info_list_find(nfapi_vnf_config_t* config, uint16_t phy_id)
+{
+	nfapi_vnf_phy_info_t* curr = config->phy_list;
+	while(curr != 0)
+	{
+		if(curr->phy_id == phy_id)
+			return curr;
+
+		curr = curr->next;
+	}
+
+	return 0;
+}
+
+
+
+
+void nfapi_vnf_pnf_list_add(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_t* node)
+{
+	node->next = config->pnf_list;
+	config->pnf_list = node;
+}
+
+
+nfapi_vnf_pnf_info_t* nfapi_vnf_pnf_list_find(nfapi_vnf_config_t* config, int p5_idx)
+{
+	NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s : config->pnf_list:%p\n", __FUNCTION__, config->pnf_list);
+
+	nfapi_vnf_pnf_info_t* curr = config->pnf_list;
+	while(curr != 0)
+	{
+		if(curr->p5_idx == p5_idx)
+                {
+                  NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s : curr->p5_idx:%d p5_idx:%d\n", __FUNCTION__, curr->p5_idx, p5_idx);
+			return curr;
+                        }
+
+                NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s : curr->next:%p\n", __FUNCTION__, curr->next);
+
+		curr = curr->next;
+	}
+
+	return 0;
+}
+
+void vnf_handle_pnf_param_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s : NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received PNF_PARAM.reponse\n");
+
+		nfapi_pnf_param_response_t msg;
+			
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			// Invoke the call back
+			if(config->pnf_param_resp)
+			{
+				(config->pnf_param_resp)(config, p5_idx, &msg);
+			}
+		}	
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_pnf_config_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received PNF_CONFIG_RESPONSE\n");
+		
+		nfapi_pnf_config_response_t msg;
+		
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			// Invoke the call back
+			if(config->pnf_config_resp)
+			{
+				(config->pnf_config_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_pnf_start_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received PNF_START_RESPONSE\n");
+	
+		nfapi_pnf_start_response_t msg;
+	
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->pnf_start_resp)
+			{
+				(config->pnf_start_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_pnf_stop_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received PNF_STOP_RESPONSE\n");
+	
+		nfapi_pnf_stop_response_t msg;
+
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->pnf_stop_resp)
+			{
+				(config->pnf_stop_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+
+	}
+}
+
+void vnf_handle_param_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received PARAM_RESPONSE\n");
+		
+		nfapi_param_response_t msg;
+		
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			
+			if (msg.error_code == NFAPI_MSG_OK)
+			{
+				nfapi_vnf_phy_info_t* phy_info = nfapi_vnf_phy_info_list_find(config, msg.header.phy_id);
+		
+				if(msg.nfapi_config.p7_pnf_address_ipv4.tl.tag)
+				{
+					struct sockaddr_in sockAddr;
+		
+					(void)memcpy(&sockAddr.sin_addr.s_addr, msg.nfapi_config.p7_pnf_address_ipv4.address, NFAPI_IPV4_ADDRESS_LENGTH);
+					NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF P7 IPv4 address: %s\n", inet_ntoa(sockAddr.sin_addr));
+		
+					// store address
+					phy_info->p7_pnf_address.sin_addr = sockAddr.sin_addr;
+				}
+		
+				if(msg.nfapi_config.p7_pnf_address_ipv6.tl.tag)
+				{
+					struct sockaddr_in6 sockAddr6;
+					char addr6[64];
+					(void)memcpy(&sockAddr6.sin6_addr, msg.nfapi_config.p7_pnf_address_ipv6.address, NFAPI_IPV6_ADDRESS_LENGTH);
+					NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF P7 IPv6 address: %s\n", inet_ntop(AF_INET6, &sockAddr6.sin6_addr, addr6, sizeof(addr6)));
+				}
+				
+				if (msg.nfapi_config.p7_pnf_port.tl.tag)
+				{
+					NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF P7 Port: %d\n", msg.nfapi_config.p7_pnf_port.value);
+		
+					// store port
+					phy_info->p7_pnf_address.sin_port = htons(msg.nfapi_config.p7_pnf_port.value);
+				}
+			}
+			
+			if(config->param_resp)
+			{
+				(config->param_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_config_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received CONFIG_RESPONSE\n");
+			
+		nfapi_config_response_t msg;
+		
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >=0 )
+		{
+			if(config->config_resp)
+			{
+				(config->config_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_start_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{	
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received START_RESPONSE\n");
+
+		nfapi_start_response_t msg;
+		
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->start_resp)
+			{
+				(config->start_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_stop_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received STOP.response\n");
+	
+		nfapi_stop_response_t msg;
+			
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->stop_resp)
+			{
+				(config->stop_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_measurement_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received MEASUREMENT.response\n");
+		
+		nfapi_measurement_response_t msg;
+		
+		// unpack the message
+		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->measurement_resp)
+			{
+				(config->measurement_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_rssi_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received RSSI.response\n");		
+
+		nfapi_rssi_response_t msg;
+		
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->rssi_resp)
+			{
+				(config->rssi_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_rssi_indication(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received RSSI.indication\n");	
+
+		nfapi_rssi_indication_t msg;
+		
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->rssi_ind)
+			{
+				(config->rssi_ind)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_cell_search_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received CELL_SEARCH.response\n");
+		
+		nfapi_cell_search_response_t msg;
+	
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->cell_search_resp)
+			{
+				(config->cell_search_resp)(config, p5_idx, &msg);
+			}	
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_cell_search_indication(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_cell_search_indication: NULL parameters\n");
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received CELL_SEARCH.indication\n");
+	
+		nfapi_cell_search_indication_t msg;
+		
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->cell_search_ind)
+			{
+				(config->cell_search_ind)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_cell_search_response: Unpack message failed, ignoring\n");
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_broadcast_detect_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received BROADCAST_DETECT.response\n");
+
+		nfapi_broadcast_detect_response_t msg;
+
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->broadcast_detect_resp)
+			{
+				(config->broadcast_detect_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_broadcast_detect_indication(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received BROADCAST_DETECT.indication\n");
+
+		nfapi_broadcast_detect_indication_t msg;
+
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->broadcast_detect_ind)
+			{
+				(config->broadcast_detect_ind)(config, p5_idx, &msg);
+			}	
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+			return;
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_system_information_schedule_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received SYSTEM_INFORMATION_SCHEDULE.response\n");
+	
+		nfapi_system_information_schedule_response_t msg;
+		
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->system_information_schedule_resp)
+			{
+				(config->system_information_schedule_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+			
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_system_information_schedule_indication(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received SYSTEM_INFORMATION_SCHEDULE.indication\n");
+
+		nfapi_system_information_schedule_indication_t msg;
+
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->system_information_schedule_ind)
+			{
+				(config->system_information_schedule_ind)(config, p5_idx, &msg);
+			}	
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_system_information_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received SYSTEM_INFORMATION.response\n");
+
+		nfapi_system_information_response_t msg;
+		
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) >= 0)
+		{
+			if(config->system_information_resp)
+			{
+				(config->system_information_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+	
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_system_information_indication(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received SYSTEM_INFORMATION.indication\n");
+		
+		nfapi_system_information_indication_t msg;
+		
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(msg), &config->codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+			return;
+		}
+	
+		if(config->system_information_ind)
+		{
+			(config->system_information_ind)(config, p5_idx, &msg);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+}
+
+void vnf_handle_nmm_stop_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "Received NMM_STOP.response\n");	
+		
+		nfapi_nmm_stop_response_t msg;	
+		
+		// unpack the message
+		if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &msg, sizeof(nfapi_nmm_stop_response_t), &config->codec_config) >= 0)
+		{
+			if(config->nmm_stop_resp)
+			{
+				(config->nmm_stop_resp)(config, p5_idx, &msg);
+			}
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+		}
+		
+		// make sure to release any dyanmic part of the message
+		if(msg.vendor_extension)
+			config->codec_config.deallocate(msg.vendor_extension);
+	}
+	
+}
+
+void vnf_handle_vendor_extension(void* pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx, uint16_t message_id)
+{
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+	
+	if(config->allocate_p4_p5_vendor_ext && config->deallocate_p4_p5_vendor_ext)
+	{
+		uint16_t msg_size;
+		
+		nfapi_p4_p5_message_header_t* msg = config->allocate_p4_p5_vendor_ext(message_id, &msg_size);
+
+		if(msg)
+		{
+			if(nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, msg, msg_size, &config->codec_config) >= 0)
+			{
+				if(config->vendor_ext)
+					config->vendor_ext(config, p5_idx, msg);
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
+			}
+			
+			config->deallocate_p4_p5_vendor_ext(msg);
+		}
+		else
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to allocate vendor extention structure\n");
+		}
+	}
+}
+
+void vnf_handle_p4_p5_message(void *pRecvMsg, int recvMsgLen, int p5_idx, nfapi_vnf_config_t* config)
+{
+	nfapi_p4_p5_message_header_t messageHeader;
+
+	// validate the input params
+	if(pRecvMsg == NULL || recvMsgLen < NFAPI_HEADER_LENGTH || config == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_p4_p5_message: invalid input params\n");
+		return;
+	}
+
+	// unpack the message header
+	if (nfapi_p5_message_header_unpack(pRecvMsg, recvMsgLen, &messageHeader, sizeof(nfapi_p4_p5_message_header_t), &config->codec_config) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unpack message header failed, ignoring\n");
+		return;
+	}
+
+	switch (messageHeader.message_id)
+	{
+		case NFAPI_PNF_PARAM_RESPONSE:
+			vnf_handle_pnf_param_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_PNF_CONFIG_RESPONSE:
+			vnf_handle_pnf_config_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_PNF_START_RESPONSE:
+			vnf_handle_pnf_start_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_PNF_STOP_RESPONSE:
+			vnf_handle_pnf_stop_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_PARAM_RESPONSE:
+			vnf_handle_param_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_CONFIG_RESPONSE:
+			vnf_handle_config_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_START_RESPONSE:
+			vnf_handle_start_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_STOP_RESPONSE:
+			vnf_handle_stop_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_MEASUREMENT_RESPONSE:
+			vnf_handle_measurement_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_RSSI_RESPONSE:
+			vnf_handle_rssi_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_RSSI_INDICATION:
+			vnf_handle_rssi_indication(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_CELL_SEARCH_RESPONSE:
+			vnf_handle_cell_search_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_CELL_SEARCH_INDICATION:
+			vnf_handle_cell_search_indication(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_BROADCAST_DETECT_RESPONSE:
+			vnf_handle_broadcast_detect_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_BROADCAST_DETECT_INDICATION:
+			vnf_handle_broadcast_detect_indication(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE:
+			vnf_handle_system_information_schedule_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION:
+			vnf_handle_system_information_schedule_indication(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_RESPONSE:
+			vnf_handle_system_information_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_SYSTEM_INFORMATION_INDICATION:
+			vnf_handle_system_information_indication(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		case NFAPI_NMM_STOP_RESPONSE:
+			vnf_handle_nmm_stop_response(pRecvMsg, recvMsgLen, config, p5_idx);
+			break;
+
+		default:
+			{
+				if(messageHeader.message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
+				   messageHeader.message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
+				{
+					vnf_handle_vendor_extension(pRecvMsg, recvMsgLen, config, p5_idx, messageHeader.message_id);
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s P5 Unknown message ID %d\n", __FUNCTION__, messageHeader.message_id);
+				}
+			}
+			break;
+	}
+}
+int vnf_read_dispatch_message(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_t* pnf)
+{
+	if(1)
+	{
+		int socket_connected = 1;
+
+		// 1. Peek the message header
+		// 2. If the message is larger than the stack buffer then create a dynamic buffer
+		// 3. Read the buffer
+		// 4. Handle the p5 message
+		
+		uint32_t header_buffer_size = NFAPI_HEADER_LENGTH;
+		uint8_t header_buffer[header_buffer_size];
+
+		uint32_t stack_buffer_size = 32; //should it be the size of then sctp_notificatoin structure
+		uint8_t stack_buffer[stack_buffer_size];
+
+		uint8_t* dynamic_buffer = 0;
+
+		uint8_t* read_buffer = &stack_buffer[0];
+		uint32_t message_size = 0;
+
+		struct sockaddr_in addr;
+		socklen_t addr_len = sizeof(addr);
+
+		struct sctp_sndrcvinfo sndrcvinfo;
+		(void)memset(&sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo));
+
+		{
+			int flags = MSG_PEEK;
+			message_size = sctp_recvmsg(pnf->p5_sock, header_buffer, header_buffer_size, (struct sockaddr*)&addr, &addr_len, &sndrcvinfo,  &flags);
+
+			if(message_size == -1)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Failed to peek sctp message size errno:%d\n", errno);
+				return 0;
+			}
+
+			nfapi_p4_p5_message_header_t header;
+			int unpack_result = nfapi_p5_message_header_unpack(header_buffer, header_buffer_size, &header, sizeof(header), 0);
+			if(unpack_result < 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Failed to decode message header %d\n", unpack_result);
+				return 0;
+			}
+			message_size = header.message_length;
+
+			// now have the size of the mesage
+		}
+
+		if(message_size > stack_buffer_size)
+		{
+			dynamic_buffer = (uint8_t*)malloc(message_size);
+
+			if(dynamic_buffer == NULL)
+			{
+				// todo : add error mesage
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Failed to allocate dynamic buffer for sctp_recvmsg size:%d\n", message_size);
+				return -1;
+			}
+
+			read_buffer = dynamic_buffer;
+		}
+
+		{
+			int flags = 0;
+			(void)memset(&sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo));
+
+			int recvmsg_result = sctp_recvmsg(pnf->p5_sock, read_buffer, message_size, (struct sockaddr*)&addr, &addr_len, &sndrcvinfo, &flags);
+			if(recvmsg_result == -1)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "Failed to read sctp message size errno:%d\n", errno);
+			}
+			else
+			{
+				if (flags & MSG_NOTIFICATION)
+				{
+					NFAPI_TRACE(NFAPI_TRACE_INFO, "Notification received from %s:%u\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
+
+					// todo - handle the events
+				}
+				else
+				{
+					/*
+					NFAPI_TRACE(NFAPI_TRACE_INFO, "Received message fd:%d from %s:%u assoc:%d on stream %d, PPID %d, length %d, flags 0x%x\n",
+							pnf->p5_sock,
+							inet_ntoa(addr.sin_addr),
+							ntohs(addr.sin_port),
+							sndrcvinfo.sinfo_assoc_id,
+							sndrcvinfo.sinfo_stream,
+							ntohl(sndrcvinfo.sinfo_ppid),
+							message_size,
+							flags);
+					*/
+
+					// handle now if complete message in one or more segments
+					if ((flags & 0x80) == 0x80)
+					{
+						vnf_handle_p4_p5_message(read_buffer, message_size, pnf->p5_idx, config);
+					}
+					else
+					{
+						NFAPI_TRACE(NFAPI_TRACE_WARN, "sctp_recvmsg: unhandled mode with flags 0x%x\n", flags);
+
+						// assume socket disconnected
+						NFAPI_TRACE(NFAPI_TRACE_WARN, "Disconnected socket\n");
+						socket_connected =  0;
+					}
+
+
+				}
+			}
+		}
+
+		if(dynamic_buffer)
+		{
+			free(dynamic_buffer);
+		}
+
+		return socket_connected;
+	}
+}
+
+static int vnf_send_p5_msg(nfapi_vnf_pnf_info_t* pnf, const void *msg, int len, uint8_t stream)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s len:%d stream:%d\n", __FUNCTION__, len, stream);
+
+	int result = sctp_sendmsg(pnf->p5_sock, msg, len, (struct sockaddr*)&pnf->p5_pnf_sockaddr, sizeof(pnf->p5_pnf_sockaddr),1, 0, stream, 0, 4);
+
+	if(result != len)
+	{
+		if(result <  0)
+		{
+			// error
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "sctp sendto failed errno: %d\n", errno);
+		}
+		else
+		{
+			// did not send all the message
+		}
+	}
+
+	return 0;
+}
+
+
+int vnf_pack_and_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_p4_p5_message_header_t* msg, uint16_t msg_len)
+{
+	nfapi_vnf_pnf_info_t* pnf = nfapi_vnf_pnf_list_find(&(vnf->_public), p5_idx);
+	
+	if(pnf)
+	{
+		// pack the message for transmission
+		int packedMessageLength = nfapi_p5_message_pack(msg, msg_len, vnf->tx_message_buffer, sizeof(vnf->tx_message_buffer), &vnf->_public.codec_config);
+
+		if (packedMessageLength < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_p5_message_pack failed with return %d\n", packedMessageLength);
+			return -1;
+		}
+
+		return vnf_send_p5_msg(pnf, vnf->tx_message_buffer, packedMessageLength, 0/*msg->phy_id*/);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find pnf info for p5_idx:%d\n", __FUNCTION__, p5_idx);
+		return -1;
+	}
+}
+
+
+int vnf_pack_and_send_p4_message(vnf_t* vnf, uint16_t p5_idx, nfapi_p4_p5_message_header_t* msg, uint16_t msg_len)
+{
+	nfapi_vnf_pnf_info_t* pnf = nfapi_vnf_pnf_list_find(&(vnf->_public), p5_idx);
+	
+	if(pnf)
+	{
+		// pack the message for transmission
+		int packedMessageLength = nfapi_p4_message_pack(msg, msg_len, vnf->tx_message_buffer, sizeof(vnf->tx_message_buffer), &vnf->_public.codec_config);
+
+		if (packedMessageLength < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_p4_message_pack failed with return %d\n", packedMessageLength);
+			return -1;
+		}
+
+		return vnf_send_p5_msg(pnf, vnf->tx_message_buffer, packedMessageLength, 0/*msg->phy_id*/);
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find pnf info for p5_idx:%d\n", __FUNCTION__, p5_idx);
+		return -1;
+	}
+}
+
diff --git a/nfapi/open-nFAPI/vnf/src/vnf_interface.c b/nfapi/open-nFAPI/vnf/src/vnf_interface.c
new file mode 100644
index 0000000000000000000000000000000000000000..0aba0a29f5e0c9a6d74ef1e361f7c135a875e31b
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf/src/vnf_interface.c
@@ -0,0 +1,676 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netinet/sctp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <stdio.h>
+
+#include "vnf.h"
+
+
+
+nfapi_vnf_config_t* nfapi_vnf_config_create()
+{
+	vnf_t* _this = (vnf_t*)calloc(1, sizeof(vnf_t));
+
+	if(_this == 0)
+		return 0;
+
+	_this->sctp = 1;
+
+	_this->next_phy_id = 1;
+	
+	// Set the default P5 port
+	_this->_public.vnf_p5_port = NFAPI_P5_SCTP_PORT;
+	
+	// set the default memory allocation 
+	_this->_public.malloc = &malloc;
+	_this->_public.free = &free;
+	
+	// set the default memory allocation 
+	_this->_public.codec_config.allocate = &malloc;
+	_this->_public.codec_config.deallocate = &free;
+	
+
+	return &(_this->_public);
+}
+
+void nfapi_vnf_config_destory(nfapi_vnf_config_t* config)
+{
+	free(config);
+}
+
+int nfapi_vnf_start(nfapi_vnf_config_t* config)
+{
+	// Verify that config is not null
+	if(config == 0)
+		return -1;
+
+	// Make sure to set the defined trace function before using NFAPI_TRACE
+	if(config->trace)
+		nfapi_trace_g = (nfapi_trace_fn_t)config->trace;
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
+
+	int p5ListenSock, p5Sock; 
+
+	struct sockaddr_in addr;
+	socklen_t addrSize;
+
+	struct sockaddr_in6 addr6;
+
+	struct sctp_event_subscribe events;
+	struct sctp_initmsg initMsg;
+	int noDelay;
+
+	(void)memset(&addr, 0, sizeof(struct sockaddr_in));
+	(void)memset(&addr6, 0, sizeof(struct sockaddr_in6));
+	(void)memset(&events, 0, sizeof(struct sctp_event_subscribe));
+	(void)memset(&initMsg, 0, sizeof(struct sctp_initmsg));
+
+	vnf_t* vnf = (vnf_t*)(config);
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "Starting P5 VNF connection on port %u\n", config->vnf_p5_port);
+
+	/*
+	char * host = 0;
+	char * port = "4242";
+	struct addrinfo hints;
+	bzero(&hints, sizeof(struct addrinfo));
+	//hints.ai_flags=AI_PASSIVE;
+	//hints.ai_flags=AI_DEFAULT;
+	hints.ai_family=AF_UNSPEC;
+	//hints.ai_family=AF_INET6;
+	hints.ai_socktype=SOCK_STREAM;
+	//hints.ai_protocol=IPPROTO_SCTP
+
+	struct addrinfo *aiHead = 0;
+
+
+
+	int result = getaddrinfo(host, port, &hints, &aiHead);
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "getaddrinfo return %d %d\n", result, errno);
+
+	while(aiHead->ai_next != NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "addr info %d (IP %d UDP %d SCTP %d)\n %d (%d)\n", 
+				aiHead->ai_protocol, IPPROTO_IP, IPPROTO_UDP, IPPROTO_SCTP, 
+				aiHead->ai_flags, AI_PASSIVE);
+
+		char hostBfr[ NI_MAXHOST ];
+		char servBfr[ NI_MAXSERV ];
+
+		getnameinfo(aiHead->ai_addr,
+				aiHead->ai_addrlen,
+				hostBfr,
+				sizeof( hostBfr ),
+				servBfr,
+				sizeof( servBfr ),
+				NI_NUMERICHOST | NI_NUMERICSERV );
+
+		switch(aiHead->ai_family)
+		{
+			case PF_INET:
+				{
+				struct sockaddr_in *pSadrIn = (struct sockaddr_in*) aiHead->ai_addr;
+				printf(
+						"   ai_addr      = sin_family: %d (AF_INET = %d, "
+						"AF_INET6 = %d)\n"
+						"                  sin_addr:   %s\n"
+						"                  sin_port:   %s\n",
+						pSadrIn->sin_family,
+						AF_INET,
+						AF_INET6,
+						hostBfr,
+						servBfr );
+				}
+				break;
+			case PF_INET6:
+				{
+				struct sockaddr_in6 *pSadrIn6 = (struct sockaddr_in6*) aiHead->ai_addr;
+				fprintf( stderr,
+						"   ai_addr      = sin6_family:   %d (AF_INET = %d, "
+						"AF_INET6 = %d) \n"
+						"                  sin6_addr:     %s\n"
+						"                  sin6_port:     %s\n"
+						"                  sin6_flowinfo: %d\n"
+						"                  sin6_scope_id: %d\n",
+						pSadrIn6->sin6_family,
+						AF_INET,
+						AF_INET6,
+						hostBfr,
+						servBfr,
+						pSadrIn6->sin6_flowinfo,
+						pSadrIn6->sin6_scope_id);
+				}
+				break;
+			default:
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "Not ment to be here\n");
+				break;
+		}
+
+		aiHead = aiHead->ai_next;
+	}
+	*/
+
+	{
+		int protocol;
+		int domain;
+
+		if (vnf->sctp)
+			protocol = IPPROTO_SCTP;
+		else
+			protocol = IPPROTO_IP;
+
+		if(config->vnf_ipv6)
+		{
+			domain = PF_INET6;
+		}
+		else
+		{
+			domain = AF_INET;
+		}
+
+		// open the SCTP socket
+		if ((p5ListenSock = socket(domain, SOCK_STREAM, protocol)) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P5 socket errno: %d\n", errno);
+			return 0;
+		}
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "P5 socket created... %d\n", p5ListenSock);
+	}
+
+	if (vnf->sctp)
+	{
+		// configure for MSG_NOTIFICATION
+		if (setsockopt(p5ListenSock, IPPROTO_SCTP, SCTP_EVENTS, &events, sizeof(struct sctp_event_subscribe)) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (SCTP_EVENTS) errno: %d\n", errno);
+			close(p5ListenSock);
+			return 0;
+		}
+		NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF Setting the SCTP_INITMSG\n");
+		// configure the SCTP socket options
+		initMsg.sinit_num_ostreams = 5; //MAX_SCTP_STREAMS;  // number of output streams can be greater
+		initMsg.sinit_max_instreams = 5; //MAX_SCTP_STREAMS;  // number of output streams can be greater
+		if (setsockopt(p5ListenSock, IPPROTO_SCTP, SCTP_INITMSG, &initMsg, sizeof(initMsg)) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (SCTP_INITMSG) errno: %d\n", errno)
+			close(p5ListenSock);
+			return 0;
+		}
+		noDelay = 1;
+		if (setsockopt(p5ListenSock, IPPROTO_SCTP, SCTP_NODELAY, &noDelay, sizeof(noDelay)) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (STCP_NODELAY) errno: %d\n", errno);
+			close(p5ListenSock);
+			return 0;
+		}
+		struct sctp_event_subscribe events;
+		memset( (void *)&events, 0, sizeof(events) );
+  	    events.sctp_data_io_event = 1;
+		
+		if(setsockopt(p5ListenSock, SOL_SCTP, SCTP_EVENTS, (const void *)&events, sizeof(events)) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt errno: %d\n", errno);
+			close(p5ListenSock);
+			return -1;
+		}
+
+	}
+
+
+	if(config->vnf_ipv6)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "IPV6 binding to port %d %d\n", config->vnf_p5_port, p5ListenSock);
+		addr6.sin6_family = AF_INET6;
+		addr6.sin6_port = htons(config->vnf_p5_port);
+		addr6.sin6_addr = in6addr_any;
+
+		// bind to the configured address and port
+		if (bind(p5ListenSock, (struct sockaddr *)&addr6, sizeof(struct sockaddr_in6)) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "After bind errno: %d\n", errno);
+			close(p5ListenSock);
+			return 0;
+		}
+	}
+	else if(config->vnf_ipv4)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "IPV4 binding to port %d\n", config->vnf_p5_port);
+		addr.sin_family = AF_INET;
+		addr.sin_port = htons(config->vnf_p5_port);
+		addr.sin_addr.s_addr = INADDR_ANY;
+
+		// bind to the configured address and port
+		if (bind(p5ListenSock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) < 0)
+		//if (sctp_bindx(p5ListenSock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in), SCTP_BINDX_ADD_ADDR) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "After bind errno: %d\n", errno);
+			close(p5ListenSock);
+			return 0;
+		}
+	}
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "bind succeeded..%d.\n", p5ListenSock);
+
+	// put the socket into listen mode
+	if (listen(p5ListenSock, 2) < 0) 
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "After listen errno: %d\n", errno);
+		close(p5ListenSock);
+		return 0;
+	}
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "listen succeeded...\n");
+
+	struct timeval tv;
+	fd_set read_fd_set;
+
+
+	int p5_idx = 0;
+	while(vnf->terminate == 0)
+	{
+		FD_ZERO(&read_fd_set);
+
+		FD_SET(p5ListenSock, &read_fd_set);
+		int max_fd = p5ListenSock;
+
+		tv.tv_sec = 5;
+		tv.tv_usec = 0;
+
+		nfapi_vnf_pnf_info_t* pnf = config->pnf_list;
+		while(pnf != 0)
+		{
+			if(pnf->connected)
+			{
+				FD_SET(pnf->p5_sock, &read_fd_set);
+				if (pnf->p5_sock > max_fd)
+				{
+					max_fd = pnf->p5_sock;
+				}
+			}
+
+			pnf = pnf->next;
+		}
+
+		int select_result = select(max_fd + 1, &read_fd_set, 0, 0, &tv);
+
+		if(select_result == -1)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "select result %d errno %d\n", select_result, errno);
+			close(p5ListenSock);
+			return 0;
+		}
+		else if(select_result)
+		{
+			if(FD_ISSET(p5ListenSock, &read_fd_set))
+			{
+				addrSize = sizeof(struct sockaddr_in);
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "Accepting connection from PNF...\n");
+
+				p5Sock = accept(p5ListenSock, (struct sockaddr *)&addr, &addrSize);
+
+				if (p5Sock < 0) 
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to accept PNF connection reason:%d\n", errno);
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF connection (fd:%d) accepted from %s:%d \n", p5Sock,  inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
+					nfapi_vnf_pnf_info_t* pnf = (nfapi_vnf_pnf_info_t*)malloc(sizeof(nfapi_vnf_pnf_info_t));
+					NFAPI_TRACE(NFAPI_TRACE_INFO, "MALLOC nfapi_vnf_pnf_info_t for pnf_list pnf:%p\n", pnf);
+					memset(pnf, 0, sizeof(nfapi_vnf_pnf_info_t));
+					pnf->p5_sock = p5Sock;
+					pnf->p5_idx = p5_idx++;
+					pnf->p5_pnf_sockaddr = addr;
+					pnf->connected = 1;
+
+					nfapi_vnf_pnf_list_add(config, pnf);
+
+					// Inform mac that a pnf connection has been established
+					// todo : allow mac to 'accept' the connection. i.e. to
+					// reject it.
+					if(config->pnf_connection_indication != 0)
+					{
+						(config->pnf_connection_indication)(config, pnf->p5_idx);
+					}
+
+					
+					// check the connection status
+					{
+						struct sctp_status status;
+						(void)memset(&status, 0, sizeof(struct sctp_status));
+						socklen_t optLen = (socklen_t) sizeof(struct sctp_status);
+						if (getsockopt(p5Sock, IPPROTO_SCTP, SCTP_STATUS, &status, &optLen) < 0)
+						{
+							NFAPI_TRACE(NFAPI_TRACE_ERROR, "After getsockopt errno: %d\n", errno);
+							return -1;
+						}
+						else
+						{
+							NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Association ID = %d\n", status.sstat_assoc_id);
+							NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Receiver window size = %d\n", status.sstat_rwnd);
+							NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF In Streams = %d\n",  status.sstat_instrms);
+							NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF Out Streams = %d\n", status.sstat_outstrms);
+
+						}
+					}
+				}
+			}
+			else
+			{
+				uint8_t delete_pnfs = 0;
+
+				nfapi_vnf_pnf_info_t* pnf = config->pnf_list;
+				while(pnf != 0)
+				{
+					if(FD_ISSET(pnf->p5_sock, &read_fd_set))
+					{
+						if(vnf_read_dispatch_message(config, pnf) == 0)
+						{
+							if(config->pnf_disconnect_indication != 0)
+							{
+								(config->pnf_disconnect_indication)(config, pnf->p5_idx);
+							}
+
+							close(pnf->p5_sock);
+
+							pnf->to_delete = 1;
+							delete_pnfs = 1;
+						}
+					}
+			
+					pnf = pnf->next;
+				}
+
+				if(delete_pnfs)
+				{
+					nfapi_vnf_pnf_info_t* pnf = config->pnf_list;
+					nfapi_vnf_pnf_info_t* prev = 0;
+					while(pnf != 0)
+					{
+						nfapi_vnf_pnf_info_t* curr = pnf;
+
+						if(pnf->to_delete == 1)
+						{
+							if(prev == 0)
+							{
+								config->pnf_list = pnf->next;
+							}
+							else
+							{
+								prev->next = pnf->next;
+							}
+
+							pnf = pnf->next;
+
+							free(curr);
+						}
+						else
+						{
+							prev = pnf;
+							pnf = pnf->next;
+						}
+
+					}
+					
+				}
+			}
+
+			continue;
+		}
+		else
+		{
+			// timeout
+			
+			// Should we test for socket closure here every second?
+
+			continue;
+		}
+	}
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "Closing p5Sock socket's\n");
+	{
+		nfapi_vnf_pnf_info_t* curr = config->pnf_list;
+		while(curr != NULL)
+		{
+			if(config->pnf_disconnect_indication)
+			{
+				(config->pnf_disconnect_indication)(config, curr->p5_idx);
+			}
+
+			close(curr->p5_sock);
+			curr = curr->next;
+		}
+	}
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "Closing p5Listen socket\n");
+	close(p5ListenSock);
+		
+	return 0;
+
+}
+
+int nfapi_vnf_stop(nfapi_vnf_config_t* config)
+{
+	// Verify that config is not null
+	if(config == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+	_this->terminate = 1;
+	return 0;
+}
+
+int nfapi_vnf_pnf_param_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_pnf_param_request_t));
+}
+
+int nfapi_vnf_pnf_config_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_config_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_pnf_config_request_t));
+}
+
+int nfapi_vnf_pnf_start_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_start_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_pnf_start_request_t));
+}
+
+int nfapi_vnf_pnf_stop_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_stop_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_pnf_stop_request_t));
+}
+
+int nfapi_vnf_param_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_param_request_t));
+}
+int nfapi_vnf_config_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_config_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	nfapi_vnf_phy_info_t* phy = nfapi_vnf_phy_info_list_find(config, req->header.phy_id);
+
+	if(phy == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_WARN, "%s failed to find phy inforation phy_id:%d\n", __FUNCTION__, req->header.phy_id);
+		return -1;
+	}
+
+	// set the timing parameters
+	req->nfapi_config.timing_window.tl.tag = NFAPI_NFAPI_TIMING_WINDOW_TAG;
+	req->nfapi_config.timing_window.value = phy->timing_window;
+	req->num_tlv++;
+
+	req->nfapi_config.timing_info_mode.tl.tag = NFAPI_NFAPI_TIMING_INFO_MODE_TAG;
+	req->nfapi_config.timing_info_mode.value = phy->timing_info_mode;
+	req->num_tlv++;
+
+	req->nfapi_config.timing_info_period.tl.tag = NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG;
+	req->nfapi_config.timing_info_period.value = phy->timing_info_period;
+	req->num_tlv++;
+
+	return vnf_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_config_request_t));
+}
+int nfapi_vnf_start_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_start_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_start_request_t));
+}
+int nfapi_vnf_stop_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_stop_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_stop_request_t));
+}
+int nfapi_vnf_measurement_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_measurement_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p5_message(_this, p5_idx, &req->header, sizeof(nfapi_measurement_request_t));
+}
+int nfapi_vnf_rssi_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_rssi_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p4_message(_this, p5_idx, &req->header, sizeof(nfapi_rssi_request_t));
+}
+int nfapi_vnf_cell_search_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_cell_search_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p4_message(_this, p5_idx, &req->header, sizeof(nfapi_cell_search_request_t));
+}
+int nfapi_vnf_broadcast_detect_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_broadcast_detect_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p4_message(_this, p5_idx, &req->header, sizeof(nfapi_broadcast_detect_request_t));
+}
+int nfapi_vnf_system_information_schedule_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_system_information_schedule_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p4_message(_this, p5_idx, &req->header, sizeof(nfapi_system_information_schedule_request_t));
+}
+int nfapi_vnf_system_information_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_system_information_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p4_message(_this, p5_idx, &req->header, sizeof(nfapi_system_information_request_t));
+}
+int nfapi_vnf_nmm_stop_request(nfapi_vnf_config_t* config, int p5_idx, nfapi_nmm_stop_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p4_message(_this, p5_idx, &req->header, sizeof(nfapi_nmm_stop_request_t));
+}
+int nfapi_vnf_vendor_extension(nfapi_vnf_config_t* config, int p5_idx, nfapi_p4_p5_message_header_t* msg)
+{
+	if(config == 0 || msg == 0)
+		return -1;
+
+	vnf_t* _this = (vnf_t*)(config);
+
+	return vnf_pack_and_send_p5_message(_this, p5_idx, msg, sizeof(nfapi_p4_p5_message_header_t));
+}
+
+int nfapi_vnf_allocate_phy(nfapi_vnf_config_t* config, int p5_idx, uint16_t* phy_id)
+{
+	vnf_t* vnf = (vnf_t*)config;
+
+	nfapi_vnf_phy_info_t* info = (nfapi_vnf_phy_info_t*)calloc(1, sizeof(nfapi_vnf_phy_info_t));
+	info->p5_idx = p5_idx;
+	info->phy_id = vnf->next_phy_id++;
+
+	info->timing_window = 30;       // This seems to override what gets set by the user - why???
+	info->timing_info_mode = 0x03;
+	info->timing_info_period = 128;
+
+	nfapi_vnf_phy_info_list_add(config, info);
+
+	(*phy_id) = info->phy_id;
+
+	return 0;
+}
diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7.c b/nfapi/open-nFAPI/vnf/src/vnf_p7.c
new file mode 100644
index 0000000000000000000000000000000000000000..13041767522935fb74a90cfe9748517d303588dd
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf/src/vnf_p7.c
@@ -0,0 +1,1599 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <time.h>
+
+#include <sys/time.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "vnf_p7.h"
+
+#define SYNC_CYCLE_COUNT 2
+
+void* vnf_p7_malloc(vnf_p7_t* vnf_p7, size_t size)
+{
+	if(vnf_p7->_public.malloc)
+	{
+		return (vnf_p7->_public.malloc)(size);
+	}
+	else
+	{
+		return calloc(1, size); 
+	}
+}
+void vnf_p7_free(vnf_p7_t* vnf_p7, void* ptr)
+{
+	if(ptr == 0)
+		return;
+
+	if(vnf_p7->_public.free)
+	{
+		(vnf_p7->_public.free)(ptr);
+	}
+	else
+	{
+		free(ptr); 
+	}
+}
+
+void vnf_p7_codec_free(vnf_p7_t* vnf_p7, void* ptr)
+{
+	if(ptr == 0)
+		return;
+
+	if(vnf_p7->_public.codec_config.deallocate)
+	{
+		(vnf_p7->_public.codec_config.deallocate)(ptr);
+	}
+	else
+	{
+		free(ptr); 
+	}
+}
+
+void vnf_p7_connection_info_list_add(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* node)
+{
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
+	// todo : add mutex
+	node->next = vnf_p7->p7_connections; 
+	vnf_p7->p7_connections = node;
+}
+
+nfapi_vnf_p7_connection_info_t* vnf_p7_connection_info_list_find(vnf_p7_t* vnf_p7, uint16_t phy_id)
+{
+	nfapi_vnf_p7_connection_info_t* curr = vnf_p7->p7_connections;
+	while(curr != 0)
+	{
+		if(curr->phy_id == phy_id)
+		{
+			return curr;
+		}
+		curr = curr->next;
+	}
+
+	return 0;
+}
+
+nfapi_vnf_p7_connection_info_t* vnf_p7_connection_info_list_delete(vnf_p7_t* vnf_p7, uint16_t phy_id)
+{
+	nfapi_vnf_p7_connection_info_t* curr = vnf_p7->p7_connections;
+	nfapi_vnf_p7_connection_info_t* prev = 0;
+
+	while(curr != 0)
+	{
+		if(curr->phy_id == phy_id)
+		{
+			if(prev == 0)
+			{
+				vnf_p7->p7_connections = curr->next;
+			}
+			else
+			{
+				prev->next = curr->next;
+			}
+
+			return curr;
+		}
+		else
+		{
+			prev = curr;
+			curr = curr->next;
+		}
+	}
+
+	return 0;
+}
+
+vnf_p7_rx_message_t* vnf_p7_rx_reassembly_queue_add_segment(vnf_p7_t* vnf_p7, vnf_p7_rx_reassembly_queue_t* queue, uint16_t sequence_number, uint16_t segment_number, uint8_t m, uint8_t* data, uint16_t data_len)
+{
+	vnf_p7_rx_message_t* msg = 0;
+	// attempt to find a entry for this segment
+	vnf_p7_rx_message_t* iterator = queue->msg_queue;
+	while(iterator != 0)
+	{
+		if(iterator->sequence_number == sequence_number)
+		{
+			msg = iterator;
+			break;
+		}
+
+		iterator = iterator->next;
+	}
+	
+	// if found then copy data to message
+	if(msg != 0)
+	{
+	
+		msg->segments[segment_number].buffer = (uint8_t*)vnf_p7_malloc(vnf_p7, data_len);
+		memcpy(msg->segments[segment_number].buffer, data, data_len);
+		msg->segments[segment_number].length = data_len;
+
+		msg->num_segments_received++;
+
+		// set the segement number if we have the last segment
+		if(m == 0)
+			msg->num_segments_expected = segment_number + 1;
+	}
+	// else add new rx message entry
+	else
+	{
+		// create a new message
+		msg = (vnf_p7_rx_message_t*)(vnf_p7_malloc(vnf_p7, sizeof(vnf_p7_rx_message_t)));
+		memset(msg, 0, sizeof(vnf_p7_rx_message_t));
+
+		msg->sequence_number = sequence_number;
+		msg->num_segments_expected = m ? 255 : segment_number + 1;
+		msg->num_segments_received = 1;
+		msg->rx_hr_time = vnf_get_current_time_hr();
+
+		msg->segments[segment_number].buffer = (uint8_t*)vnf_p7_malloc(vnf_p7, data_len);
+		memcpy(msg->segments[segment_number].buffer, data, data_len);
+		msg->segments[segment_number].length = data_len;
+
+		// place the message at the head of the queue
+		msg->next = queue->msg_queue;
+		queue->msg_queue = msg;
+	}
+
+	return msg;
+}
+
+void vnf_p7_rx_reassembly_queue_remove_msg(vnf_p7_t* vnf_p7, vnf_p7_rx_reassembly_queue_t* queue, vnf_p7_rx_message_t* msg)
+{
+	// remove message if it has the same sequence number
+	vnf_p7_rx_message_t* iterator = queue->msg_queue;
+	vnf_p7_rx_message_t* previous = 0;
+
+	while(iterator != 0)
+	{
+		if(iterator->sequence_number == msg->sequence_number)
+		{
+			if(previous == 0)
+			{
+				queue->msg_queue = iterator->next;
+			}
+			else
+			{
+				previous->next = iterator->next;
+			}
+
+			//NFAPI_TRACE(NFAPI_TRACE_INFO, "Deleting reassembly message\n");
+			// delete the message
+			uint16_t i;
+			for(i = 0; i < 128; ++i)
+			{
+				if(iterator->segments[i].buffer)
+					vnf_p7_free(vnf_p7, iterator->segments[i].buffer);
+			}
+			vnf_p7_free(vnf_p7, iterator);
+
+			break;
+		}
+
+		previous = iterator;
+		iterator = iterator->next;
+	}
+}
+
+void vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7_t* vnf_p7, vnf_p7_rx_reassembly_queue_t* queue, uint32_t delta)
+{
+	// remove all messages that are too old
+	vnf_p7_rx_message_t* iterator = queue->msg_queue;
+	vnf_p7_rx_message_t* previous = 0;
+
+	uint32_t rx_hr_time = vnf_get_current_time_hr();
+
+	while(iterator != 0)
+	{
+		if(rx_hr_time - iterator->rx_hr_time > delta)
+		{
+			if(previous == 0)
+			{
+				queue->msg_queue = iterator->next;
+			}
+			else
+			{
+				previous->next = iterator->next;
+			}
+			
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "Deleting stale reassembly message (%u %u %d)\n", iterator->rx_hr_time, rx_hr_time, delta);
+
+			vnf_p7_rx_message_t* to_delete = iterator;
+			iterator = iterator->next;
+
+			// delete the message
+			uint16_t i;
+			for(i = 0; i < 128; ++i)
+			{
+				if(to_delete->segments[i].buffer)
+					vnf_p7_free(vnf_p7, to_delete->segments[i].buffer);
+			}
+			vnf_p7_free(vnf_p7, to_delete);
+
+		}
+		else
+		{
+			previous = iterator;
+			iterator = iterator->next;
+		}
+	}
+}
+
+uint32_t vnf_get_current_time_hr()
+{
+	struct timeval now;
+	(void)gettimeofday(&now, NULL);
+	uint32_t time_hr = TIME2TIMEHR(now);
+	return time_hr;
+}
+
+uint16_t increment_sfn_sf(uint16_t sfn_sf)
+{
+	if((sfn_sf & 0xF) == 9)
+	{
+		sfn_sf += 0x0010;
+		sfn_sf &= 0x3FF0;
+	}
+	else if((sfn_sf & 0xF) > 9)
+	{
+		// error should not happen
+	}
+	else
+	{
+		sfn_sf++;
+	}
+
+	return sfn_sf;
+}
+
+struct timespec timespec_delta(struct timespec start, struct timespec end)
+{
+	struct timespec temp;
+	if ((end.tv_nsec-start.tv_nsec)<0) 
+	{
+		temp.tv_sec = end.tv_sec-start.tv_sec-1;
+		temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
+	} 
+	else 
+	{
+		temp.tv_sec = end.tv_sec-start.tv_sec;
+		temp.tv_nsec = end.tv_nsec-start.tv_nsec;
+	}
+	return temp;
+}
+
+static uint32_t get_sf_time(uint32_t now_hr, uint32_t sf_start_hr)
+{
+	if(now_hr < sf_start_hr)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "now is earlier that start of subframe\n");
+		return 0;
+	}
+	else
+	{
+		uint32_t now_us = TIMEHR_USEC(now_hr);
+		uint32_t sf_start_us = TIMEHR_USEC(sf_start_hr);
+
+		// if the us have wrapped adjust for it
+		if(now_hr < sf_start_us)
+		{
+			now_us += 1000000;
+		}
+
+		return now_us - sf_start_us;
+	}
+}
+
+uint32_t calculate_t1(uint16_t sfn_sf, uint32_t sf_start_time_hr)
+{
+	uint32_t now_time_hr = vnf_get_current_time_hr();
+
+	uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
+
+	uint32_t t1 = (NFAPI_SFNSF2DEC(sfn_sf) * 1000) + sf_time_us;
+
+	return t1;
+}
+
+
+uint32_t calculate_t4(uint32_t now_time_hr, uint16_t sfn_sf, uint32_t sf_start_time_hr)
+{
+	uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
+
+	uint32_t t4 = (NFAPI_SFNSF2DEC(sfn_sf) * 1000) + sf_time_us;
+
+	return t4;
+
+}
+
+
+uint32_t calculate_transmit_timestamp(uint16_t sfn_sf, uint32_t sf_start_time_hr)
+{
+	uint32_t now_time_hr = vnf_get_current_time_hr();
+
+	uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
+
+	uint32_t tt = (NFAPI_SFNSF2DEC(sfn_sf) * 1000) + sf_time_us;
+
+	return tt;
+}
+
+
+uint16_t increment_sfn_sf_by(uint16_t sfn_sf, uint8_t increment)
+{
+	while(increment > 0)
+	{
+		sfn_sf = increment_sfn_sf(sfn_sf);
+		--increment;
+	}
+
+	return sfn_sf;
+}
+
+
+int send_mac_subframe_indications(vnf_p7_t* vnf_p7)
+{
+	nfapi_vnf_p7_connection_info_t* curr = vnf_p7->p7_connections;
+	while(curr != 0)
+	{
+		if(curr->in_sync == 1)
+		{
+			// ask for subframes in the future
+			uint16_t sfn_sf_adv = increment_sfn_sf_by(curr->sfn_sf, 2);
+
+			vnf_p7->_public.subframe_indication(&(vnf_p7->_public), curr->phy_id, sfn_sf_adv);
+		}
+
+		curr = curr->next;
+	}
+
+	return 0;
+}
+
+int vnf_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info, uint8_t* msg, const uint32_t len)
+{
+	int sendto_result = sendto(vnf_p7->socket, msg, len, 0, (struct sockaddr*)&(p7_info->remote_addr), sizeof(p7_info->remote_addr)); 
+
+	if(sendto_result != len)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sendto_result %d %d\n", __FUNCTION__, sendto_result, errno);
+	}
+
+	return 0;
+}
+
+int vnf_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header)
+{
+
+	nfapi_vnf_p7_connection_info_t* p7_connection = vnf_p7_connection_info_list_find(vnf_p7, header->phy_id);
+	if(p7_connection)
+	{
+		int send_result = 0;
+		uint8_t  buffer[1024 * 32];
+
+		header->m_segment_sequence = NFAPI_P7_SET_MSS(0, 0, p7_connection->sequence_number);
+		
+		int len = nfapi_p7_message_pack(header, buffer, sizeof(buffer), &vnf_p7->_public.codec_config);
+		
+                //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() phy_id:%d nfapi_p7_message_pack()=len=%d vnf_p7->_public.segment_size:%u\n", __FUNCTION__, header->phy_id, len, vnf_p7->_public.segment_size);
+
+		if(len < 0) 
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() failed to pack p7 message phy_id:%d\n", __FUNCTION__, header->phy_id);
+			return -1;
+		}
+
+		if(len > vnf_p7->_public.segment_size)
+		{
+			// todo : consider replacing with the sendmmsg call
+			// todo : worry about blocking writes?
+		
+			// segmenting the transmit
+			int msg_body_len = len - NFAPI_P7_HEADER_LENGTH ; 
+			int seg_body_len = vnf_p7->_public.segment_size - NFAPI_P7_HEADER_LENGTH ; 
+			int segment_count = (msg_body_len / (seg_body_len)) + ((msg_body_len % seg_body_len) ? 1 : 0); 
+				
+			int segment = 0;
+			int offset = NFAPI_P7_HEADER_LENGTH;
+			uint8_t tx_buffer[vnf_p7->_public.segment_size];
+                        NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() MORE THAN ONE SEGMENT phy_id:%d nfapi_p7_message_pack()=len=%d vnf_p7->_public.segment_size:%u\n", __FUNCTION__, header->phy_id, len, vnf_p7->_public.segment_size);
+			for(segment = 0; segment < segment_count; ++segment)
+			{
+				uint8_t last = 0;
+				uint16_t size = vnf_p7->_public.segment_size - NFAPI_P7_HEADER_LENGTH;
+				if(segment + 1 == segment_count)
+				{
+					last = 1;
+					size = (msg_body_len) - (seg_body_len * segment);
+				}
+
+				uint16_t segment_size = size + NFAPI_P7_HEADER_LENGTH;
+
+				// Update the header with the m and segement 
+				memcpy(&tx_buffer[0], buffer, NFAPI_P7_HEADER_LENGTH);
+
+				// set the segment length
+				tx_buffer[4] = (segment_size & 0xFF00) >> 8;
+				tx_buffer[5] = (segment_size & 0xFF);
+
+				// set the m & segment number
+				tx_buffer[6] = ((!last) << 7) + segment;
+
+				memcpy(&tx_buffer[NFAPI_P7_HEADER_LENGTH], &buffer[0] + offset, size);
+				offset += size;
+
+				if(vnf_p7->_public.checksum_enabled)
+				{
+					nfapi_p7_update_checksum(tx_buffer, segment_size);
+				}
+			
+				nfapi_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->sfn_sf, vnf_p7->sf_start_time_hr));	
+
+				send_result = vnf_send_p7_msg(vnf_p7, p7_connection,  &tx_buffer[0], segment_size);
+			}
+		}
+		else
+		{
+			if(vnf_p7->_public.checksum_enabled)
+			{
+				nfapi_p7_update_checksum(buffer, len);
+			}
+
+			nfapi_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->sfn_sf, vnf_p7->sf_start_time_hr));	
+
+			// simple case that the message fits in a single segement
+			send_result = vnf_send_p7_msg(vnf_p7, p7_connection, &buffer[0], len);
+		}
+
+		p7_connection->sequence_number++;
+
+		return send_result;
+	}
+	else
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find p7 connection info for phy_id:%d\n", __FUNCTION__, header->phy_id);
+		return -1;
+	}
+}
+
+int vnf_build_send_dl_node_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info)
+{
+	nfapi_dl_node_sync_t dl_node_sync;
+	memset(&dl_node_sync, 0, sizeof(dl_node_sync));
+
+	dl_node_sync.header.phy_id = p7_info->phy_id;
+	dl_node_sync.header.message_id = NFAPI_DL_NODE_SYNC;
+	dl_node_sync.t1 = calculate_t1(p7_info->sfn_sf, vnf_p7->sf_start_time_hr);
+	dl_node_sync.delta_sfn_sf = 0;
+
+	return vnf_p7_pack_and_send_p7_msg(vnf_p7, &dl_node_sync.header);	
+}
+
+int vnf_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info)
+{
+
+	if(p7_info->in_sync == 1)
+	{
+		uint16_t dl_sync_period_mask = p7_info->dl_in_sync_period-1;
+		uint16_t sfn_sf_dec = NFAPI_SFNSF2DEC(p7_info->sfn_sf);
+
+		if ((((sfn_sf_dec + p7_info->dl_in_sync_offset) % NFAPI_MAX_SFNSFDEC) & dl_sync_period_mask) == 0)
+		{
+			vnf_build_send_dl_node_sync(vnf_p7, p7_info);
+		}
+	}
+	else
+	{
+		uint16_t dl_sync_period_mask = p7_info->dl_out_sync_period-1;
+		uint16_t sfn_sf_dec = NFAPI_SFNSF2DEC(p7_info->sfn_sf);
+
+		if ((((sfn_sf_dec + p7_info->dl_out_sync_offset) % NFAPI_MAX_SFNSFDEC) & dl_sync_period_mask) == 0)
+		{
+			vnf_build_send_dl_node_sync(vnf_p7, p7_info);
+		}
+	}
+	return 0;
+}
+
+
+void vnf_handle_harq_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_harq_indication_t ind;
+	
+		if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
+		}
+		else
+		{
+			if(vnf_p7->_public.harq_indication)
+			{
+				(vnf_p7->_public.harq_indication)(&(vnf_p7->_public), &ind);
+			}
+		}
+	
+		vnf_p7_codec_free(vnf_p7, ind.harq_indication_body.harq_pdu_list);
+		vnf_p7_codec_free(vnf_p7, ind.vendor_extension);
+	}
+}
+
+void vnf_handle_crc_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_crc_indication_t ind;
+	
+		if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to message\n", __FUNCTION__);
+		}
+		else
+		{
+			if(vnf_p7->_public.crc_indication)
+			{
+				(vnf_p7->_public.crc_indication)(&(vnf_p7->_public), &ind);
+			}
+		}
+	
+		vnf_p7_codec_free(vnf_p7, ind.crc_indication_body.crc_pdu_list);
+		vnf_p7_codec_free(vnf_p7, ind.vendor_extension);
+	}
+}
+
+void vnf_handle_rx_ulsch_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_rx_indication_t ind;
+	
+		if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
+		}
+		else
+		{
+			if(vnf_p7->_public.rx_indication)
+			{
+				(vnf_p7->_public.rx_indication)(&(vnf_p7->_public), &ind);
+			}
+		}
+
+		uint16_t i = 0;
+		for(i = 0; i < ind.rx_indication_body.number_of_pdus; ++i)
+		{
+			vnf_p7_codec_free(vnf_p7, ind.rx_indication_body.rx_pdu_list[i].data);
+		}
+		vnf_p7_codec_free(vnf_p7, ind.rx_indication_body.rx_pdu_list);
+		vnf_p7_codec_free(vnf_p7, ind.vendor_extension);
+	}
+
+}
+
+void vnf_handle_rach_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_rach_indication_t ind;
+	
+		if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to message\n", __FUNCTION__);
+		}
+		else
+		{
+			if(vnf_p7->_public.rach_indication)
+			{
+				(vnf_p7->_public.rach_indication)(&vnf_p7->_public, &ind);
+			}
+		}
+	
+		vnf_p7_codec_free(vnf_p7, ind.rach_indication_body.preamble_list);
+		vnf_p7_codec_free(vnf_p7, ind.vendor_extension);
+
+	}
+}
+
+void vnf_handle_srs_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_srs_indication_t ind;
+
+		if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
+		}
+		else
+		{
+			if(vnf_p7->_public.srs_indication)
+			{
+				(vnf_p7->_public.srs_indication)(&(vnf_p7->_public), &ind);
+			}
+		}
+	
+		vnf_p7_codec_free(vnf_p7, ind.srs_indication_body.srs_pdu_list);
+		vnf_p7_codec_free(vnf_p7, ind.vendor_extension);	
+	}
+}
+
+void vnf_handle_rx_sr_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_sr_indication_t ind;
+	
+		if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
+		}
+		else
+		{
+			if(vnf_p7->_public.sr_indication)
+			{
+				(vnf_p7->_public.sr_indication)(&(vnf_p7->_public), &ind);
+			}
+		}
+	
+		vnf_p7_codec_free(vnf_p7, ind.sr_indication_body.sr_pdu_list);
+		vnf_p7_codec_free(vnf_p7, ind.vendor_extension);	
+	}
+}
+void vnf_handle_rx_cqi_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_cqi_indication_t ind;
+	
+		if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
+		}
+		else
+		{
+			if(vnf_p7->_public.cqi_indication)
+			{
+				(vnf_p7->_public.cqi_indication)(&(vnf_p7->_public), &ind);
+			}
+		}
+	
+		vnf_p7_codec_free(vnf_p7, ind.cqi_indication_body.cqi_pdu_list);
+		vnf_p7_codec_free(vnf_p7, ind.cqi_indication_body.cqi_raw_pdu_list);
+		vnf_p7_codec_free(vnf_p7, ind.vendor_extension);	
+		
+	}
+
+}
+
+void vnf_handle_lbt_dl_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_lbt_dl_indication_t ind;
+
+		if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
+		}
+		else
+		{
+			if(vnf_p7->_public.lbt_dl_indication)
+			{
+				(vnf_p7->_public.lbt_dl_indication)(&(vnf_p7->_public), &ind);
+			}
+		}
+	
+		vnf_p7_codec_free(vnf_p7, ind.lbt_dl_indication_body.lbt_indication_pdu_list);
+		vnf_p7_codec_free(vnf_p7, ind.vendor_extension);
+	}
+}
+
+void vnf_handle_nb_harq_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_nb_harq_indication_t ind;
+	
+		if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
+		}
+		else
+		{
+			if(vnf_p7->_public.nb_harq_indication)
+			{
+				(vnf_p7->_public.nb_harq_indication)(&(vnf_p7->_public), &ind);
+			}
+		}
+	
+		vnf_p7_codec_free(vnf_p7, ind.nb_harq_indication_body.nb_harq_pdu_list);
+		vnf_p7_codec_free(vnf_p7, ind.vendor_extension);
+	}
+}
+
+void vnf_handle_nrach_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	// ensure it's valid
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else
+	{
+		nfapi_nrach_indication_t ind;
+	
+		if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
+		}
+		else
+		{
+			if(vnf_p7->_public.nrach_indication)
+			{
+				(vnf_p7->_public.nrach_indication)(&(vnf_p7->_public), &ind);
+			}
+		}
+	
+		vnf_p7_codec_free(vnf_p7, ind.nrach_indication_body.nrach_pdu_list);
+		vnf_p7_codec_free(vnf_p7, ind.vendor_extension);
+	}
+}
+
+void vnf_handle_p7_vendor_extension(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7, uint16_t message_id)
+{
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
+	}
+	else if(vnf_p7->_public.allocate_p7_vendor_ext)
+	{
+		uint16_t msg_size;
+		nfapi_p7_message_header_t* msg = vnf_p7->_public.allocate_p7_vendor_ext(message_id, &msg_size);
+
+		if(msg == 0)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to allocate vendor extention structure\n", __FUNCTION__);
+			return;
+		}
+
+		int unpack_result = nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, msg, msg_size, &vnf_p7->_public.codec_config);
+
+		if(unpack_result == 0)
+		{
+			if(vnf_p7->_public.vendor_ext)
+				vnf_p7->_public.vendor_ext(&(vnf_p7->_public), msg);
+		}
+		
+		if(vnf_p7->_public.deallocate_p7_vendor_ext)
+			vnf_p7->_public.deallocate_p7_vendor_ext(msg);
+		
+	}
+}
+
+
+void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	uint32_t now_time_hr = vnf_get_current_time_hr();
+
+	if (pRecvMsg == NULL || vnf_p7  == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_ul_node_sync: NULL parameters\n");
+		return;
+	}
+
+	nfapi_ul_node_sync_t ind;
+	if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(nfapi_ul_node_sync_t), &vnf_p7->_public.codec_config) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to unpack ul_node_sync\n");
+		return;
+	}
+
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "Received UL_NODE_SYNC phy_id:%d t1:%d t2:%d t3:%d\n", ind.header.phy_id, ind.t1, ind.t2, ind.t3);
+
+	nfapi_vnf_p7_connection_info_t* phy = vnf_p7_connection_info_list_find(vnf_p7, ind.header.phy_id);
+	uint32_t t4 = calculate_t4(now_time_hr, phy->sfn_sf, vnf_p7->sf_start_time_hr);
+
+	uint32_t tx_2_rx = t4>ind.t1 ? t4 - ind.t1 : t4 + NFAPI_MAX_SFNSFDEC - ind.t1 ;
+	uint32_t pnf_proc_time = ind.t3 - ind.t2;
+
+	// divide by 2 using shift operator
+	uint32_t latency =  (tx_2_rx - pnf_proc_time) >> 1;
+
+	if(!(phy->filtered_adjust))
+	{
+		phy->latency[phy->min_sync_cycle_count] = latency;
+
+		NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) PNF to VNF !sync phy_id:%d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d\n",
+				NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ind.header.phy_id, ind.t1, ind.t2, ind.t3, t4, 
+				tx_2_rx, pnf_proc_time, latency);
+	}
+	else
+	{
+		phy->latency[phy->min_sync_cycle_count] = latency;
+
+		//if(phy->min_sync_cycle_count != SYNC_CYCLE_COUNT)
+		{
+			if (ind.t2 < phy->previous_t2 && ind.t1 > phy->previous_t1)
+			{
+				// Only t2 wrap has occurred!!!
+				phy->sf_offset = (NFAPI_MAX_SFNSFDEC + ind.t2) - ind.t1 - latency;
+			}
+			else if (ind.t2 > phy->previous_t2 && ind.t1 < phy->previous_t1)
+			{
+				// Only t1 wrap has occurred
+				phy->sf_offset = ind.t2 - ( ind.t1 + NFAPI_MAX_SFNSFDEC) - latency;
+			}
+			else
+			{
+				// Either no wrap or both have wrapped
+				phy->sf_offset = ind.t2 - ind.t1 - latency;
+			}
+
+			if (phy->sf_offset_filtered == 0)
+			{
+				phy->sf_offset_filtered = phy->sf_offset;
+			}
+			else
+			{
+				int32_t oldFilteredValueShifted = phy->sf_offset_filtered << 5;
+				int32_t newOffsetShifted = phy->sf_offset << 5;
+
+				// 1/8 of new and 7/8 of old
+				phy->sf_offset_filtered = ((newOffsetShifted >> 3) + ((oldFilteredValueShifted * 7) >> 3)) >> 5;
+			}
+		}
+
+		if(1)
+		{
+                  struct timespec ts;
+                  clock_gettime(CLOCK_MONOTONIC, &ts);
+
+			NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) %d.%d PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n", 
+					NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
+					ind.t1, ind.t2, ind.t3, t4, 
+					tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->sf_offset, phy->sf_offset_filtered,
+					(ind.t1<phy->previous_t1), (ind.t2<phy->previous_t2));
+		}
+
+	}
+
+        if (phy->filtered_adjust && (phy->sf_offset_filtered > 1e6 || phy->sf_offset_filtered < -1e6))
+        {
+          phy->filtered_adjust = 0;
+          phy->zero_count=0;
+          phy->min_sync_cycle_count = 2;
+          phy->in_sync = 0;
+          NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s - ADJUST TOO BAD - go out of filtered phy->sf_offset_filtered:%d\n", __FUNCTION__, phy->sf_offset_filtered);
+        }
+
+	if(phy->min_sync_cycle_count)
+		phy->min_sync_cycle_count--;
+
+	if(phy->min_sync_cycle_count == 0)
+	{
+		uint32_t curr_sfn_sf = phy->sfn_sf;
+		int32_t sfn_sf_dec = NFAPI_SFNSF2DEC(phy->sfn_sf);
+
+		if(!phy->filtered_adjust)
+		{
+			int i = 0;
+			//phy->average_latency = 0;
+			for(i = 0; i < SYNC_CYCLE_COUNT; ++i)
+			{
+				phy->average_latency += phy->latency[i];
+
+			}
+			phy->average_latency /= SYNC_CYCLE_COUNT;
+
+			phy->sf_offset = ind.t2 - (ind.t1 - phy->average_latency);
+
+			sfn_sf_dec += (phy->sf_offset / 1000);
+		}
+		else
+		{
+			sfn_sf_dec += ((phy->sf_offset_filtered + 500) / 1000);	//Round up go from microsecond to subframe(1ms)
+		}
+
+		if(sfn_sf_dec < 0)
+		{
+			sfn_sf_dec += NFAPI_MAX_SFNSFDEC;
+		}
+		else if( sfn_sf_dec >= NFAPI_MAX_SFNSFDEC)
+		{
+			sfn_sf_dec -= NFAPI_MAX_SFNSFDEC;
+		}
+
+		uint16_t new_sfn_sf = NFAPI_SFNSFDEC2SFNSF(sfn_sf_dec);
+
+
+		{
+			phy->adjustment = NFAPI_SFNSF2DEC(new_sfn_sf) - NFAPI_SFNSF2DEC(curr_sfn_sf);
+
+			NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF phy_id:%d adjustment%d phy->previous_sf_offset_filtered:%d phy->previous_sf_offset_filtered:%d phy->sf_offset_trend:%d\n", ind.header.phy_id, phy->adjustment, phy->previous_sf_offset_filtered, phy->previous_sf_offset_filtered, phy->sf_offset_trend);
+
+			phy->previous_t1 = 0;
+			phy->previous_t2 = 0;
+
+			if(phy->previous_sf_offset_filtered > 0)
+			{
+				if( phy->sf_offset_filtered > phy->previous_sf_offset_filtered)
+				{
+					// pnf is getting futher ahead of vnf
+					//phy->sf_offset_trend = phy->sf_offset_filtered - phy->previous_sf_offset_filtered;
+					phy->sf_offset_trend = (phy->sf_offset_filtered + phy->previous_sf_offset_filtered)/2;
+				}
+				else
+				{
+					// pnf is getting back in sync
+				}
+			}
+			else if(phy->previous_sf_offset_filtered < 0)
+			{
+				if(phy->sf_offset_filtered < phy->previous_sf_offset_filtered)
+				{
+					// vnf is getting future ahead of pnf
+					//phy->sf_offset_trend = -(phy->sf_offset_filtered - phy->previous_sf_offset_filtered);
+					phy->sf_offset_trend = (-(phy->sf_offset_filtered + phy->previous_sf_offset_filtered)) /2;
+				}
+				else
+				{
+					//  vnf is getting back in sync
+				}
+			}
+
+			
+			int insync_minor_adjustment_1 = phy->sf_offset_trend / 6;
+			int insync_minor_adjustment_2 = phy->sf_offset_trend / 2;
+
+
+			if(insync_minor_adjustment_1 == 0)
+				insync_minor_adjustment_1 = 2;
+
+			if(insync_minor_adjustment_2 == 0)
+				insync_minor_adjustment_2 = 10;
+
+			if(!phy->filtered_adjust)
+			{
+				if(phy->adjustment < 10)
+				{
+					phy->zero_count++;
+
+					if(phy->zero_count >= 10)
+					{
+						phy->filtered_adjust = 1;
+						phy->zero_count = 0;
+
+						NFAPI_TRACE(NFAPI_TRACE_NOTE, "***** Adjusting VNF SFN/SF switching to filtered mode\n");
+					}
+				}
+				else
+				{
+					phy->zero_count = 0;
+				}
+			}
+			else
+			{
+				// Fine level of adjustment
+				if (phy->adjustment == 0)
+				{
+					if (phy->zero_count >= 10)
+					{
+						if(phy->in_sync == 0)
+						{
+							NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF P7 In Sync with phy (phy_id:%d)\n", phy->phy_id); 
+
+							if(vnf_p7->_public.sync_indication)
+								(vnf_p7->_public.sync_indication)(&(vnf_p7->_public), 1);
+						}
+
+						phy->in_sync = 1;
+					}
+					else
+					{
+						phy->zero_count++;
+					}
+
+					if(phy->in_sync)
+					{
+						// in sync
+						if(phy->sf_offset_filtered > 250)
+						{
+							// VNF is slow
+							phy->insync_minor_adjustment = insync_minor_adjustment_1; //25;
+							phy->insync_minor_adjustment_duration = ((phy->sf_offset_filtered) / insync_minor_adjustment_1);
+						}
+						else if(phy->sf_offset_filtered < -250)
+						{
+							// VNF is fast
+							phy->insync_minor_adjustment = -(insync_minor_adjustment_1); //25;
+							phy->insync_minor_adjustment_duration = (((phy->sf_offset_filtered) / -(insync_minor_adjustment_1)));
+						}
+						else
+						{
+							phy->insync_minor_adjustment = 0;
+						}
+
+						if(phy->insync_minor_adjustment != 0)
+						{
+							NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d subframes (sf_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adjustment:%d\n", 
+										NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ind.header.phy_id,
+										phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, 
+                                                                                phy->sf_offset_filtered, 
+                                                                                insync_minor_adjustment_1, insync_minor_adjustment_2, phy->sf_offset_trend,
+                                                                                NFAPI_SFNSF2DEC(new_sfn_sf),
+                                                                                NFAPI_SFNSF2DEC(curr_sfn_sf),
+                                                                                phy->adjustment); 
+						}
+					}
+				}
+				else
+				{
+					if (phy->in_sync)
+					{
+						if(phy->adjustment == 0)
+						{
+						}
+						else if(phy->adjustment > 0)
+						{
+							// VNF is slow
+							//if(phy->adjustment == 1)
+							{
+								//
+								if(phy->sf_offset_filtered > 250)
+								{
+									// VNF is slow
+									phy->insync_minor_adjustment = insync_minor_adjustment_2;
+									phy->insync_minor_adjustment_duration = 2 * ((phy->sf_offset_filtered - 250) / insync_minor_adjustment_2);
+								}
+								else if(phy->sf_offset_filtered < -250)
+								{
+									// VNF is fast
+									phy->insync_minor_adjustment = -(insync_minor_adjustment_2);
+									phy->insync_minor_adjustment_duration = 2 * ((phy->sf_offset_filtered + 250) / -(insync_minor_adjustment_2));
+								}
+							
+							}
+							//else
+							{
+								// out of sync?
+							}
+							
+							NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d subframes (adjustment:%d sf_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adj:%d\n", 
+										NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ind.header.phy_id,
+										phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->sf_offset_filtered,
+										insync_minor_adjustment_1, insync_minor_adjustment_2, phy->sf_offset_trend,
+                                                                                NFAPI_SFNSF2DEC(new_sfn_sf),
+                                                                                NFAPI_SFNSF2DEC(curr_sfn_sf),
+                                                                                phy->adjustment); 
+							
+						}
+						else if(phy->adjustment < 0)
+						{
+							// VNF is fast
+							//if(phy->adjustment == -1)
+							{
+								//
+								if(phy->sf_offset_filtered > 250)
+								{
+									// VNF is slow
+									phy->insync_minor_adjustment = insync_minor_adjustment_2;
+									phy->insync_minor_adjustment_duration = 2 * ((phy->sf_offset_filtered - 250) / insync_minor_adjustment_2);
+								}
+								else if(phy->sf_offset_filtered < -250)
+								{
+									// VNF is fast
+									phy->insync_minor_adjustment = -(insync_minor_adjustment_2);
+									phy->insync_minor_adjustment_duration = 2 * ((phy->sf_offset_filtered + 250) / -(insync_minor_adjustment_2));
+								}
+							}
+							//else
+							{
+								// out of sync?
+							}
+
+							NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d subframes (adjustment:%d sf_offset_filtered:%d) %d %d %d\n", 
+										NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ind.header.phy_id,
+										phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->sf_offset_filtered,
+										insync_minor_adjustment_1, insync_minor_adjustment_2, phy->sf_offset_trend); 
+						}
+
+						/*
+						if (phy->adjustment > 10 || phy->adjustment < -10)
+						{
+							phy->zero_count++;		// Add one to the getting out of sync counter
+						}
+						else
+						{
+							phy->zero_count = 0;		// Small error - zero the out of sync counter
+						}
+
+						if (phy->zero_count >= 10)	// If we have had 10 consecutive large errors - drop out of sync
+						{
+							NFAPI_TRACE(NFAPI_TRACE_NOTE, "we have fallen out of sync...\n");
+							//pP7SockInfo->syncAchieved = 0;
+						}
+						*/
+					}
+				}
+			}
+
+
+			if(phy->in_sync == 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_NOTE, "***** Adjusting VNF phy_id:%d SFN/SF (%s) from %d to %d (%d) mode:%s zeroCount:%u sync:%s\n", 
+					ind.header.phy_id, (phy->in_sync ? "via sfn" : "now"),
+					NFAPI_SFNSF2DEC(curr_sfn_sf), NFAPI_SFNSF2DEC(new_sfn_sf), phy->adjustment, 
+					phy->filtered_adjust ? "FILTERED" : "ABSOLUTE",
+					phy->zero_count,
+					phy->in_sync ? "IN_SYNC" : "OUT_OF_SYNC");
+
+				phy->sfn_sf = new_sfn_sf;
+			}
+		}
+
+		// reset for next cycle
+		phy->previous_sf_offset_filtered = phy->sf_offset_filtered;
+		phy->min_sync_cycle_count = 2;
+		phy->sf_offset_filtered = 0;
+		phy->sf_offset = 0;
+	}
+	else
+	{
+		phy->previous_t1 = ind.t1;
+		phy->previous_t2 = ind.t2;
+	}
+}
+
+void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	if (pRecvMsg == NULL || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_timing_info: NULL parameters\n");
+		return;
+	}
+
+	nfapi_timing_info_t ind;
+	if(nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(nfapi_timing_info_t), &vnf_p7->_public.codec_config) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to unpack timing_info\n");
+		return;
+	}
+
+        if (vnf_p7 && vnf_p7->p7_connections)
+        {
+          int16_t vnf_pnf_sfnsf_delta = NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf) - NFAPI_SFNSF2DEC(ind.last_sfn_sf);
+
+          //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PNF:SFN/SF:%d VNF:SFN/SF:%d deltaSFNSF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind.last_sfn_sf), NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), vnf_pnf_sfnsf_delta);
+          if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1)
+          {
+            NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n", __FUNCTION__, vnf_pnf_sfnsf_delta, NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), NFAPI_SFNSF2DEC(ind.last_sfn_sf));
+          }
+        }
+}
+
+void vnf_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+{
+	nfapi_p7_message_header_t header;
+
+	// validate the input params
+	if(pRecvMsg == NULL || recvMsgLen < 4 || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
+		return;
+	}
+
+	// unpack the message header
+	if (nfapi_p7_message_header_unpack(pRecvMsg, recvMsgLen, &header, sizeof(header), &vnf_p7->_public.codec_config) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unpack message header failed, ignoring\n");
+		return;
+	}
+
+	// ensure the message is sensible
+	if (recvMsgLen < 8 || pRecvMsg == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_WARN, "Invalid message size: %d, ignoring\n", recvMsgLen);
+		return;
+	}
+
+	switch (header.message_id)
+	{
+		case NFAPI_UL_NODE_SYNC:
+			vnf_handle_ul_node_sync(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+
+		case NFAPI_TIMING_INFO:
+			vnf_handle_timing_info(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+			
+		case NFAPI_HARQ_INDICATION:
+			vnf_handle_harq_indication(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+	
+		case NFAPI_CRC_INDICATION:
+			vnf_handle_crc_indication(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+	
+		case NFAPI_RX_ULSCH_INDICATION:
+			vnf_handle_rx_ulsch_indication(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+	
+		case NFAPI_RACH_INDICATION:
+			vnf_handle_rach_indication(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+	
+		case NFAPI_SRS_INDICATION:
+			vnf_handle_srs_indication(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+
+		case NFAPI_RX_SR_INDICATION:
+			vnf_handle_rx_sr_indication(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+
+		case NFAPI_RX_CQI_INDICATION:
+			vnf_handle_rx_cqi_indication(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+			
+		case NFAPI_LBT_DL_INDICATION:
+			vnf_handle_lbt_dl_indication(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+			
+		case NFAPI_NB_HARQ_INDICATION:
+			vnf_handle_nb_harq_indication(pRecvMsg, recvMsgLen, vnf_p7);
+			break;
+			
+		case NFAPI_NRACH_INDICATION:
+			vnf_handle_nrach_indication(pRecvMsg, recvMsgLen, vnf_p7);
+			break;			
+
+		default:
+			{
+				if(header.message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
+				   header.message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
+				{
+					vnf_handle_p7_vendor_extension(pRecvMsg, recvMsgLen, vnf_p7, header.message_id);
+				}
+				else
+				{
+					NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Unknown message ID %d\n", header.message_id);
+				}
+			}
+			break;
+	}
+}
+
+void vnf_handle_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7) 
+{
+	nfapi_p7_message_header_t messageHeader;
+
+	// validate the input params
+	if(pRecvMsg == NULL || recvMsgLen < 4 || vnf_p7 == NULL)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_p7_message: invalid input params (%d %d %d)\n", pRecvMsg, recvMsgLen, vnf_p7);
+		return;
+	}
+
+	// unpack the message header
+	if (nfapi_p7_message_header_unpack(pRecvMsg, recvMsgLen, &messageHeader, sizeof(nfapi_p7_message_header_t), &vnf_p7->_public.codec_config) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unpack message header failed, ignoring\n");
+		return;
+	}
+
+	if(vnf_p7->_public.checksum_enabled)
+	{
+		uint32_t checksum = nfapi_p7_calculate_checksum(pRecvMsg, recvMsgLen);
+		if(checksum != messageHeader.checksum)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_ERROR, "Checksum verification failed %d %d msg:%d len:%d\n", checksum, messageHeader.checksum, messageHeader.message_id, recvMsgLen);
+			return;
+		}
+	}
+
+	uint8_t m = NFAPI_P7_GET_MORE(messageHeader.m_segment_sequence);
+	uint8_t segment_num = NFAPI_P7_GET_SEGMENT(messageHeader.m_segment_sequence);
+	uint8_t sequence_num = NFAPI_P7_GET_SEQUENCE(messageHeader.m_segment_sequence);
+
+
+	if(m == 0 && segment_num == 0)
+	{
+		// we have a complete message
+		// ensure the message is sensible
+		if (recvMsgLen < 8 || pRecvMsg == NULL)
+		{
+			NFAPI_TRACE(NFAPI_TRACE_WARN, "Invalid message size: %d, ignoring\n", recvMsgLen);
+			return;
+		}
+
+		//vnf_dispatch_p7_message(&messageHeader, pRecvMsg, recvMsgLen, vnf_p7);
+		vnf_dispatch_p7_message(pRecvMsg, recvMsgLen, vnf_p7);
+	}
+	else
+	{
+		nfapi_vnf_p7_connection_info_t* phy = vnf_p7_connection_info_list_find(vnf_p7, messageHeader.phy_id);
+
+		if(phy)
+		{
+			vnf_p7_rx_message_t* rx_msg = vnf_p7_rx_reassembly_queue_add_segment(vnf_p7, &(phy->reassembly_queue), sequence_num, segment_num, m, pRecvMsg, recvMsgLen);
+
+			if(rx_msg->num_segments_received == rx_msg->num_segments_expected)
+			{
+				// send the buffer on
+				uint16_t i = 0;
+				uint16_t length = 0;
+				for(i = 0; i < rx_msg->num_segments_expected; ++i)
+				{
+					length += rx_msg->segments[i].length - (i > 0 ? NFAPI_P7_HEADER_LENGTH : 0);
+				}
+
+				if(phy->reassembly_buffer_size < length)
+				{
+					vnf_p7_free(vnf_p7, phy->reassembly_buffer);
+					phy->reassembly_buffer = 0;
+				}
+
+				if(phy->reassembly_buffer == 0)
+				{
+					NFAPI_TRACE(NFAPI_TRACE_NOTE, "Resizing VNF_P7 Reassembly buffer %d->%d\n", phy->reassembly_buffer_size, length);
+					phy->reassembly_buffer = (uint8_t*)vnf_p7_malloc(vnf_p7, length);
+
+					if(phy->reassembly_buffer == 0)
+					{
+						NFAPI_TRACE(NFAPI_TRACE_NOTE, "Failed to allocate VNF_P7 reassemby buffer len:%d\n", length);
+						return;
+					}
+
+					phy->reassembly_buffer_size = length;
+				}
+
+				uint16_t offset = 0;
+				for(i = 0; i < rx_msg->num_segments_expected; ++i)
+				{
+					if(i == 0)
+					{
+						memcpy(phy->reassembly_buffer, rx_msg->segments[i].buffer, rx_msg->segments[i].length);
+						offset += rx_msg->segments[i].length;
+					}
+					else
+					{
+						memcpy(phy->reassembly_buffer + offset, rx_msg->segments[i].buffer + NFAPI_P7_HEADER_LENGTH, rx_msg->segments[i].length - NFAPI_P7_HEADER_LENGTH);
+						offset += rx_msg->segments[i].length - NFAPI_P7_HEADER_LENGTH;
+					}
+				}
+
+
+				//pnf_dispatch_p7_message(pnf_p7->reassemby_buffer, length, pnf_p7, rx_msg->rx_hr_time);
+				vnf_dispatch_p7_message(phy->reassembly_buffer, length , vnf_p7);
+
+
+				// delete the structure
+				vnf_p7_rx_reassembly_queue_remove_msg(vnf_p7, &(phy->reassembly_queue), rx_msg);
+			}
+
+			vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7, &(phy->reassembly_queue), 1000);
+		}
+		else
+		{
+
+			NFAPI_TRACE(NFAPI_TRACE_INFO, "Unknown phy id %d\n", messageHeader.phy_id);
+		}
+	}
+}
+
+int vnf_p7_read_dispatch_message(vnf_p7_t* vnf_p7)
+{
+	int recvfrom_result = 0;
+	struct sockaddr_in remote_addr;
+	socklen_t remote_addr_size = sizeof(remote_addr);
+
+	do
+	{
+		// peek the header
+		uint8_t header_buffer[NFAPI_P7_HEADER_LENGTH];
+		recvfrom_result = recvfrom(vnf_p7->socket, header_buffer, NFAPI_P7_HEADER_LENGTH, MSG_DONTWAIT | MSG_PEEK, (struct sockaddr*)&remote_addr, &remote_addr_size);
+
+		if(recvfrom_result > 0)
+		{
+			// get the segment size
+			nfapi_p7_message_header_t header;
+			if(nfapi_p7_message_header_unpack(header_buffer, NFAPI_P7_HEADER_LENGTH, &header, sizeof(header), 0) < 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unpack message header failed, ignoring\n");
+				return -1;
+			}
+
+			// resize the buffer if we have a large segment
+			if(header.message_length > vnf_p7->rx_message_buffer_size)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_NOTE, "reallocing rx buffer %d\n", header.message_length); 
+				vnf_p7->rx_message_buffer = realloc(vnf_p7->rx_message_buffer, header.message_length);
+				vnf_p7->rx_message_buffer_size = header.message_length;
+			}
+
+			// read the segment
+			recvfrom_result = recvfrom(vnf_p7->socket, vnf_p7->rx_message_buffer, header.message_length, MSG_WAITALL, (struct sockaddr*)&remote_addr, &remote_addr_size);
+
+			// todo : how to handle incomplete readfroms, need some sort of buffer/select
+
+			if(recvfrom_result == 0)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "recvfrom returned 0\n");
+			}
+			else if(recvfrom_result != header.message_length)
+			{
+				NFAPI_TRACE(NFAPI_TRACE_NOTE, "did not receive the entire message %d %d\n", recvfrom_result, header.message_length); 
+				
+				recvfrom_result += recvfrom(vnf_p7->socket, &vnf_p7->rx_message_buffer[recvfrom_result], header.message_length - recvfrom_result, MSG_WAITALL, (struct sockaddr*)&remote_addr, &remote_addr_size);
+	
+			}
+			
+			
+			if(recvfrom_result > 0)
+			{
+				vnf_handle_p7_message(vnf_p7->rx_message_buffer, recvfrom_result, vnf_p7);
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_ERROR, "recvfrom failed %d %d\n", recvfrom_result, errno);
+			}
+		}
+
+		if(recvfrom_result == -1)
+		{
+			if(errno == EAGAIN || errno == EWOULDBLOCK)
+			{
+				// return to the select
+				//NFAPI_TRACE(NFAPI_TRACE_WARN, "%s recvfrom would block :%d\n", __FUNCTION__, errno);
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_WARN, "%s recvfrom failed errno:%d\n", __FUNCTION__, errno);
+			}
+		}
+	}
+	while(recvfrom_result > 0);
+
+	return 0;
+}
+
+void vnf_p7_release_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header)
+{
+	switch(header->message_id)
+	{
+		case NFAPI_HARQ_INDICATION:
+			{
+				vnf_p7_codec_free(vnf_p7, ((nfapi_harq_indication_t*)(header))->harq_indication_body.harq_pdu_list);
+			}
+			break;
+		case NFAPI_CRC_INDICATION:
+			{
+				vnf_p7_codec_free(vnf_p7, ((nfapi_crc_indication_t*)(header))->crc_indication_body.crc_pdu_list);
+			}
+			break;
+		case NFAPI_RX_ULSCH_INDICATION:
+			{
+				nfapi_rx_indication_t* rx_ind = (nfapi_rx_indication_t*)(header);
+				uint16_t i = 0;
+				for(i = 0; i < rx_ind->rx_indication_body.number_of_pdus; ++i)
+				{
+					vnf_p7_codec_free(vnf_p7, rx_ind->rx_indication_body.rx_pdu_list[i].data);
+				}
+
+				vnf_p7_codec_free(vnf_p7, rx_ind->rx_indication_body.rx_pdu_list);
+			}
+			break;
+		case NFAPI_RACH_INDICATION:
+			{
+				vnf_p7_codec_free(vnf_p7, ((nfapi_rach_indication_t*)(header))->rach_indication_body.preamble_list);
+			}
+			break;
+		case NFAPI_SRS_INDICATION:
+			{
+				vnf_p7_codec_free(vnf_p7, ((nfapi_srs_indication_t*)(header))->srs_indication_body.srs_pdu_list);
+			}
+			break;
+		case NFAPI_RX_SR_INDICATION:
+			{
+				vnf_p7_codec_free(vnf_p7, ((nfapi_sr_indication_t*)(header))->sr_indication_body.sr_pdu_list);
+			}
+			break;
+		case NFAPI_RX_CQI_INDICATION:
+			{
+				vnf_p7_codec_free(vnf_p7, ((nfapi_cqi_indication_t*)(header))->cqi_indication_body.cqi_pdu_list);
+				vnf_p7_codec_free(vnf_p7, ((nfapi_cqi_indication_t*)(header))->cqi_indication_body.cqi_raw_pdu_list);
+			}
+			break;
+	}
+				
+	vnf_p7_free(vnf_p7, header);
+	
+}
+
+void vnf_p7_release_pdu(vnf_p7_t* vnf_p7, void* pdu)
+{
+	vnf_p7_free(vnf_p7, pdu);
+}
+
diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
new file mode 100644
index 0000000000000000000000000000000000000000..a35d8e3c1d1963a2927c981c58d9ac7cf0f486d8
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
@@ -0,0 +1,562 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <time.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "vnf_p7.h"
+
+#define FAPI2_IP_DSCP	0
+
+nfapi_vnf_p7_config_t* nfapi_vnf_p7_config_create()
+{
+	vnf_p7_t* _this = (vnf_p7_t*)calloc(1, sizeof(vnf_p7_t));
+
+	if(_this == 0)
+		return 0;
+
+	// todo : initialize
+	_this->_public.segment_size = 1400;
+	_this->_public.max_num_segments = 8;
+	_this->_public.checksum_enabled = 1;
+	
+	_this->_public.malloc = &malloc;
+	_this->_public.free = &free;	
+
+	_this->_public.codec_config.allocate = &malloc;
+	_this->_public.codec_config.deallocate = &free;
+	
+
+	return &(_this->_public);
+}
+
+void nfapi_vnf_p7_config_destory(nfapi_vnf_p7_config_t* config)
+{
+	free(config);
+}
+
+
+struct timespec timespec_add(struct timespec lhs, struct timespec rhs)
+{
+	struct timespec result;
+
+	result.tv_sec = lhs.tv_sec + rhs.tv_sec;
+	result.tv_nsec = lhs.tv_nsec + rhs.tv_nsec;
+
+	if(result.tv_nsec > 1e9)
+	{
+		result.tv_sec++;
+		result.tv_nsec-= 1e9;
+	}
+
+	return result;
+}
+
+struct timespec timespec_sub(struct timespec lhs, struct timespec rhs)
+{
+	struct timespec result;
+	if ((lhs.tv_nsec-rhs.tv_nsec)<0) 
+	{
+		result.tv_sec = lhs.tv_sec-rhs.tv_sec-1;
+		result.tv_nsec = 1000000000+lhs.tv_nsec-rhs.tv_nsec;
+	} 
+	else 
+	{
+		result.tv_sec = lhs.tv_sec-rhs.tv_sec;
+		result.tv_nsec = lhs.tv_nsec-rhs.tv_nsec;
+	}
+	return result;
+}
+
+// monitor the p7 endpoints and the timing loop and 
+// send indications to mac
+int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
+{
+	if(config == 0)
+		return -1;
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+
+	// Create p7 receive udp port 
+	// todo : this needs updating for Ipv6
+	
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "Initialising VNF P7 port:%u\n", config->port);
+
+	// open the UDP socket
+	if ((vnf_p7->socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P7 socket errno: %d\n", errno);
+		return -1;
+	}
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 socket created...\n");
+
+	// configure the UDP socket options
+	int iptos_value = FAPI2_IP_DSCP << 2;
+	if (setsockopt(vnf_p7->socket, IPPROTO_IP, IP_TOS, &iptos_value, sizeof(iptos_value)) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (IP_TOS) errno: %d\n", errno);
+		return -1;
+	}
+	
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 setsockopt succeeded...\n");
+
+	// Create the address structure
+	struct sockaddr_in addr;
+	memset(&addr, 0, sizeof(addr));
+	addr.sin_family = AF_INET;
+	addr.sin_port = htons(config->port);
+	addr.sin_addr.s_addr = INADDR_ANY;
+
+	// bind to the configured port
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 binding too %s:%d\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
+	if (bind(vnf_p7->socket, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) < 0)
+	//if (sctp_bindx(config->socket, (struct sockaddr *)&addr, sizeof(struct sockaddr_in), 0) < 0)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_ERROR, "After bind errno: %d\n", errno);
+		return -1;
+	}
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 bind succeeded...\n");
+
+
+	//struct timespec original_pselect_timeout;
+	struct timespec pselect_timeout;
+	pselect_timeout.tv_sec = 0;
+	pselect_timeout.tv_nsec = 1000000; // ns in a 1 us
+
+
+	struct timespec pselect_start;
+	struct timespec pselect_stop;
+
+	//struct timespec sf_end;
+
+	long last_millisecond = -1;
+
+
+	struct timespec sf_duration;
+	sf_duration.tv_sec = 0;
+	sf_duration.tv_nsec = 1e6; // We want 1ms pause
+
+	struct timespec sf_start;
+	clock_gettime(CLOCK_MONOTONIC, &sf_start);
+	long millisecond = sf_start.tv_nsec / 1e6;
+	sf_start = timespec_add(sf_start, sf_duration);
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
+
+	while(vnf_p7->terminate == 0)
+	{
+		fd_set rfds;
+		int maxSock = 0;
+		FD_ZERO(&rfds);
+		int selectRetval = 0;
+
+		// Add the p7 socket
+		FD_SET(vnf_p7->socket, &rfds);
+		maxSock = vnf_p7->socket;
+		
+		clock_gettime(CLOCK_MONOTONIC, &pselect_start);
+		//long millisecond = pselect_start.tv_nsec / 1e6;
+
+		if((last_millisecond == -1) || (millisecond == last_millisecond) || (millisecond == (last_millisecond + 1) % 1000) )
+		{
+                  //NFAPI_TRACE(NFAPI_TRACE_INFO, "pselect_start:%d.%d sf_start:%d.%d\n", pselect_start.tv_sec, pselect_start.tv_nsec, sf_start.tv_sec, sf_start.tv_nsec);
+
+
+			if((pselect_start.tv_sec > sf_start.tv_sec) || 
+			   ((pselect_start.tv_sec == sf_start.tv_sec) && (pselect_start.tv_nsec > sf_start.tv_nsec)))
+			{
+				// overran the end of the subframe we do not want to wait
+				pselect_timeout.tv_sec = 0;
+				pselect_timeout.tv_nsec = 0;
+
+				//struct timespec overrun = timespec_sub(pselect_start, sf_start);
+				//NFAPI_TRACE(NFAPI_TRACE_INFO, "Subframe overrun detected of %d.%d running to catchup\n", overrun.tv_sec, overrun.tv_nsec);
+			}
+			else
+			{
+				// still time before the end of the subframe wait
+				pselect_timeout = timespec_sub(sf_start, pselect_start);
+
+#if 0
+                                NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sf_start:%d.%ld pselect_start:%d.%ld pseclect_timeout:%d.%ld\n",
+                                    __FUNCTION__,
+                                    sf_start.tv_sec, sf_start.tv_nsec,
+                                    pselect_start.tv_sec, pselect_start.tv_nsec,
+                                    pselect_timeout.tv_sec, pselect_timeout.tv_nsec);
+#endif
+			}
+
+//original_pselect_timeout = pselect_timeout;
+
+			// detemine how long to sleep in ns before the start of the next 1ms
+			//pselect_timeout.tv_nsec = 1e6 - (pselect_start.tv_nsec % 1000000);
+
+			//uint8_t underrun_possible =0;
+			
+			// if we are not sleeping until the next milisecond due to the
+			// insycn minor adjment flag it so we don't consider it an error
+			//uint8_t underrun_possible =0;
+			/*
+			{
+				nfapi_vnf_p7_connection_info_t* phy = vnf_p7->p7_connections;
+				if(phy && phy->in_sync && phy->insync_minor_adjustment != 0 && phy->insync_minor_adjustment_duration > 0 && pselect_start.tv_nsec != 0)
+				{
+					NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] Subframe minor adjustment %d (%d->%d)\n", phy->insync_minor_adjustment,
+							pselect_timeout.tv_nsec, pselect_timeout.tv_nsec - (phy->insync_minor_adjustment * 1000)) 
+					if(phy->insync_minor_adjustment > 0)
+					{
+						// todo check we don't go below 0
+						if((phy->insync_minor_adjustment * 1000) > pselect_timeout.tv_nsec)
+							pselect_timeout.tv_nsec = 0;
+						else
+							pselect_timeout.tv_nsec = pselect_timeout.tv_nsec - (phy->insync_minor_adjustment * 1000);
+
+
+						//underrun_possible = 1;
+					}
+					else if(phy->insync_minor_adjustment < 0)
+					{
+						// todo check we don't go below 0
+						pselect_timeout.tv_nsec = pselect_timeout.tv_nsec - (phy->insync_minor_adjustment * 1000);
+					}
+
+					//phy->insync_minor_adjustment = 0;
+					phy->insync_minor_adjustment_duration--;
+				}
+			}
+			*/
+			
+
+//long wraps = pselect_timeout.tv_nsec % 1e9;
+
+
+			selectRetval = pselect(maxSock+1, &rfds, NULL, NULL, &pselect_timeout, NULL);
+
+			clock_gettime(CLOCK_MONOTONIC, &pselect_stop);
+
+                        nfapi_vnf_p7_connection_info_t* phy = vnf_p7->p7_connections;
+
+if (selectRetval==-1 && errno == 22)
+{
+  NFAPI_TRACE(NFAPI_TRACE_ERROR, "INVAL: pselect_timeout:%d.%ld adj[dur:%d adj:%d], sf_dur:%d.%ld\n", 
+  pselect_timeout.tv_sec, pselect_timeout.tv_nsec, 
+  phy->insync_minor_adjustment_duration, phy->insync_minor_adjustment, 
+  sf_duration.tv_sec, sf_duration.tv_nsec);
+}
+#if 0
+                        if (selectRetval != 0 || phy->insync_minor_adjustment_duration != 0)
+                          NFAPI_TRACE(NFAPI_TRACE_NOTE, "pselect()=%d maxSock:%d vnf_p7->socket:%d pselect_timeout:%u.%u original_pselect_timeout:%u.%u\n", 
+                              selectRetval, maxSock, vnf_p7->socket, pselect_timeout.tv_sec, pselect_timeout.tv_nsec,
+                              original_pselect_timeout.tv_sec, original_pselect_timeout.tv_nsec);
+#endif
+
+			if(selectRetval == 0)
+			{
+				// calculate the start of the next subframe
+				sf_start = timespec_add(sf_start, sf_duration);
+				//NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
+
+				if(phy && phy->in_sync && phy->insync_minor_adjustment != 0 && phy->insync_minor_adjustment_duration > 0)
+				{
+                                        long insync_minor_adjustment_ns = (phy->insync_minor_adjustment * 1000);
+
+                                        sf_start.tv_nsec -= insync_minor_adjustment_ns;
+
+#if 1
+                                        if (sf_start.tv_nsec > 1e9)
+                                        {
+                                          sf_start.tv_sec++;
+                                          sf_start.tv_nsec-=1e9;
+                                        }
+                                        else if (sf_start.tv_nsec < 0)
+                                        {
+                                          sf_start.tv_sec--;
+                                          sf_start.tv_nsec+=1e9;
+                                        }
+#else
+                                        //NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] BEFORE adjustment - Subframe minor adjustment %dus sf_start.tv_nsec:%d\n", phy->insync_minor_adjustment, sf_start.tv_nsec);
+					if(phy->insync_minor_adjustment > 0)
+					{
+						// decrease the subframe duration a little
+                                                if (sf_start.tv_nsec > insync_minor_adjustment_ns)
+                                                  sf_start.tv_nsec -= insync_minor_adjustment_ns;
+                                                else
+                                                {
+                                                  NFAPI_TRACE(NFAPI_TRACE_ERROR, "[VNF] Adjustment would make it negative sf:%d.%ld adjust:%ld\n\n\n", sf_start.tv_sec, sf_start.tv_nsec, insync_minor_adjustment_ns);
+                                                  sf_start.tv_sec--;
+                                                  sf_start.tv_nsec += 1e9 - insync_minor_adjustment_ns;
+                                                }
+					}
+					else if(phy->insync_minor_adjustment < 0)
+					{
+						// todo check we don't go below 0
+						// increase the subframe duration a little
+						sf_start.tv_nsec += insync_minor_adjustment_ns;
+
+                                                if (sf_start.tv_nsec < 0)
+                                                {
+                                                  NFAPI_TRACE(NFAPI_TRACE_ERROR, "[VNF] OVERFLOW %d.%ld\n\n\n\n", sf_start.tv_sec, sf_start.tv_nsec);
+                                                  sf_start.tv_sec++;
+                                                  sf_start.tv_nsec += 1e9;
+                                                }
+					}
+#endif
+
+					//phy->insync_minor_adjustment = 0;
+                                        phy->insync_minor_adjustment_duration--;
+
+                                        NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] AFTER adjustment - Subframe minor adjustment %dus sf_start.tv_nsec:%d duration:%u\n", 
+                                            phy->insync_minor_adjustment, sf_start.tv_nsec, phy->insync_minor_adjustment_duration);
+
+                                        if (phy->insync_minor_adjustment_duration==0)
+                                        {
+                                          phy->insync_minor_adjustment = 0;
+                                        }
+				}
+				/*
+				long pselect_stop_millisecond = pselect_stop.tv_nsec / 1e6;
+				if(millisecond == pselect_stop_millisecond)
+				{
+					// we have woke up in the same subframe
+					if(underrun_possible == 0)
+						NFAPI_TRACE(NFAPI_TRACE_WARN, "subframe pselect underrun %ld (%d.%d)\n", millisecond, pselect_stop.tv_sec, pselect_stop.tv_nsec);
+				}
+				else if(((millisecond + 1) % 1000) != pselect_stop_millisecond)
+				{
+					// we have overrun the subframe
+					NFAPI_TRACE(NFAPI_TRACE_WARN, "subframe pselect overrun %ld %ld\n", millisecond, pselect_stop_millisecond);
+					NFAPI_TRACE(NFAPI_TRACE_WARN, "subframe underrun %ld\n", millisecond);
+				}
+				last_millisecond = millisecond;
+				*/
+				
+				millisecond ++;
+			}
+		}
+		else
+		{
+			// we have overrun the subframe advance to go and collect $200
+			if((millisecond - last_millisecond) > 3)
+				NFAPI_TRACE(NFAPI_TRACE_WARN, "subframe overrun %ld %ld (%ld)\n", millisecond, last_millisecond, millisecond - last_millisecond + 1);
+
+			last_millisecond = ( last_millisecond + 1 ) % 1000;
+			selectRetval = 0;
+		}
+
+		if(selectRetval == 0)
+		{
+			vnf_p7->sf_start_time_hr = vnf_get_current_time_hr();
+
+			// pselect timed out
+			nfapi_vnf_p7_connection_info_t* curr = vnf_p7->p7_connections;
+
+			while(curr != 0)
+			{
+				curr->sfn_sf = increment_sfn_sf(curr->sfn_sf);
+				
+				vnf_sync(vnf_p7, curr);
+
+				curr = curr->next;
+			}
+
+			send_mac_subframe_indications(vnf_p7);
+
+		}
+		else if(selectRetval > 0)
+		{
+			// have a p7 message
+			if(FD_ISSET(vnf_p7->socket, &rfds))
+			{
+				vnf_p7_read_dispatch_message(vnf_p7);
+			}
+		}
+		else
+		{
+			// pselect error
+			if(selectRetval == -1 && errno == EINTR)
+			{
+				// a sigal was received.
+			}
+			else
+			{
+				NFAPI_TRACE(NFAPI_TRACE_INFO, "P7 select failed result %d errno %d timeout:%d.%d orginal:%d.%d last_ms:%ld ms:%ld\n", selectRetval, errno, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, last_millisecond, millisecond);
+				// should we exit now?
+                                if (selectRetval == -1 && errno == 22) // invalid argument??? not sure about timeout duration
+                                {
+                                  usleep(100000);
+                                }
+			}
+		}
+
+	}
+
+	
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "Closing p7 socket\n");
+	close(vnf_p7->socket);
+
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() returning\n", __FUNCTION__);
+
+	return 0;
+}
+
+int nfapi_vnf_p7_stop(nfapi_vnf_p7_config_t* config)
+{
+	if(config == 0)
+		return -1;
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+	vnf_p7->terminate =1;
+	return 0;
+}
+
+int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id)
+{
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p phy_id:%d pnf_addr:%s pnf_p7_port:%d)\n", __FUNCTION__, config, phy_id,  pnf_p7_addr, pnf_p7_port);
+
+	if(config == 0)
+        {
+          return -1;
+        }
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+
+	nfapi_vnf_p7_connection_info_t* node = (nfapi_vnf_p7_connection_info_t*)malloc(sizeof(nfapi_vnf_p7_connection_info_t));
+
+	memset(node, 0, sizeof(nfapi_vnf_p7_connection_info_t));
+	node->phy_id = phy_id;
+	node->in_sync = 0;
+	node->dl_out_sync_offset = 30;
+	node->dl_out_sync_period = 10;
+	node->dl_in_sync_offset = 30;
+	node->dl_in_sync_period = 512;
+	node->sfn_sf = 0;
+
+	node->min_sync_cycle_count = 8;
+
+	// save the remote endpoint information
+	node->remote_addr.sin_family = AF_INET;
+	node->remote_addr.sin_port = htons(pnf_p7_port);
+	node->remote_addr.sin_addr.s_addr = inet_addr(pnf_p7_addr);
+
+	vnf_p7_connection_info_list_add(vnf_p7, node);
+
+	return 0;
+}
+
+int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id)
+{
+	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(phy_id:%d)\n", __FUNCTION__, phy_id);
+
+	if(config == 0)
+		return -1;
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+
+	nfapi_vnf_p7_connection_info_t* to_delete = vnf_p7_connection_info_list_delete(vnf_p7, phy_id);
+
+	if(to_delete)
+	{
+		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(phy_id:%d) deleting connection info\n", __FUNCTION__, phy_id);
+		free(to_delete);
+	}
+
+	return 0;
+}
+int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p req:%p)\n", __FUNCTION__, config, req);
+
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+	return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
+}
+
+int nfapi_vnf_p7_ul_config_req(nfapi_vnf_p7_config_t* config, nfapi_ul_config_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+	return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
+}
+int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+	return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
+}
+int nfapi_vnf_p7_tx_req(nfapi_vnf_p7_config_t* config, nfapi_tx_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+	return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
+}
+int nfapi_vnf_p7_lbt_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_lbt_dl_config_request_t* req)
+{
+	if(config == 0 || req == 0)
+		return -1;
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+	return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
+}
+int nfapi_vnf_p7_vendor_extension(nfapi_vnf_p7_config_t* config, nfapi_p7_message_header_t* header)
+{
+	if(config == 0 || header == 0)
+		return -1;
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+	return vnf_p7_pack_and_send_p7_msg(vnf_p7, header);
+}
+
+
+int nfapi_vnf_p7_release_msg(nfapi_vnf_p7_config_t* config, nfapi_p7_message_header_t* header)
+{
+	if(config == 0 || header == 0)
+		return -1;
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+	vnf_p7_release_msg(vnf_p7, header);
+
+	return 0;
+
+}
+
+int nfapi_vnf_p7_release_pdu(nfapi_vnf_p7_config_t* config, void* pdu)
+{
+	if(config == 0 || pdu == 0)
+		return -1;
+
+	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+	vnf_p7_release_pdu(vnf_p7, pdu);
+
+	return 0;
+}
diff --git a/nfapi/open-nFAPI/vnf/tests/Makefile.am b/nfapi/open-nFAPI/vnf/tests/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..0c8163102c61a1c196414d4aade3ea939bbde293
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf/tests/Makefile.am
@@ -0,0 +1,30 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+#vnf unit test
+#AUTOMAKE_OPTIONS=subdir-objects
+
+AM_CPPFLAGS = -I$(top_srcdir)/nfapi/inc -I$(top_srcdir)/nfapi/public_inc  -I$(top_srcdir)/common/public_inc -I$(top_srcdir)/vnf/public_inc $(CFLAGS_CUNIT) -Wall -Werror
+
+check_PROGRAMS= test_vnf
+
+test_vnf_SOURCES = vnf_cunit_main.c ../..//common/src/debug.c   
+test_vnf_LDADD=$(top_builddir)/vnf/libnfapi_vnf.a $(top_builddir)/nfapi/libnfapi.a  -L$(libdir) -lpthread -lrt -lsctp -lz -lcunit
+
+LOG_DRIVER = $(top_srcdir)/tap-driver.sh
+TESTS=test_vnf
+EXTRA_DIST = $(TESTS)
+
diff --git a/nfapi/open-nFAPI/vnf/tests/vnf_cunit_main.c b/nfapi/open-nFAPI/vnf/tests/vnf_cunit_main.c
new file mode 100644
index 0000000000000000000000000000000000000000..4df5da7c261d6398cce7aaaf6c3e4d13b8a14500
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf/tests/vnf_cunit_main.c
@@ -0,0 +1,1497 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "CUnit.h"
+#include "Basic.h"
+#include "Automated.h"
+//#include "CUnit/Console.h"
+
+#include "nfapi_interface.h"
+#include "nfapi_vnf_interface.h"
+#include "nfapi.h"
+#include <stdio.h>  // for printf
+#include <pthread.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netinet/sctp.h>
+#include <arpa/inet.h>
+#include "debug.h"
+#include <unistd.h>
+#include <stdlib.h>
+
+/* Test Suite setup and cleanup functions: */
+
+int init_suite(void) { return 0; }
+int clean_suite(void) { return 0; }
+
+#define MAX_PACKED_MESSAGE_SIZE	8192
+
+#define SFNSF2SFN(_sfnsf) ((_sfnsf) >> 4)
+#define SFNSF2SF(_sfnsf) ((_sfnsf) & 0xF)
+
+typedef struct
+{
+	uint8_t enabled;
+	uint8_t started;
+	uint16_t phy_id;
+
+	int p7_rx_port;
+	char* p7_rx_addr;
+
+	struct sockaddr_in p7_rx_sockaddr;
+	int p7_rx_sock;
+
+	struct sockaddr_in p7_tx_sockaddr;
+	int p7_tx_sock;
+} pnf_test_config_phy_t;
+
+typedef struct
+{
+	uint8_t enabled;
+	
+	char* vnf_p5_addr;
+	int vnf_p5_port;
+
+	struct sockaddr_in p5_tx_sockaddr;
+	int p5_sock;
+
+	int p7_rx_port_base;
+
+	pnf_test_config_phy_t phys[4];
+
+} pnf_test_config_t;
+
+pnf_test_config_t pnf_test_config[5];
+
+typedef struct
+{
+	uint8_t enabled;
+	uint8_t state;
+	uint16_t p5_idx;
+	uint16_t phy_id;
+
+	uint8_t vnf_idx;
+	//struct sockaddr_in p7_rx_sockaddr;
+	struct sockaddr_in p7_tx_sockaddr;
+
+} vnf_test_config_phy_t;
+
+typedef struct 
+{
+	uint8_t enabled;
+	pthread_t thread;
+
+	char* vnf_p7_addr;
+	int vnf_p7_port;
+
+	struct sockaddr_in p7_rx_sockaddr;
+
+	nfapi_vnf_p7_config_t* config;
+
+	uint8_t max_phys;
+	uint8_t phy_count;
+	//uint8_t phy_ids[4];
+	
+} vnf_test_config_vnf_t;
+
+typedef struct  
+{
+	char* p5_addr;
+	int p5_port;
+
+	pthread_t thread;
+
+	vnf_test_config_vnf_t vnfs[2];
+
+	uint8_t phy_count;
+	vnf_test_config_phy_t phys[5];
+
+	nfapi_vnf_config_t* p5_vnf_config;
+
+} vnf_test_config_t;
+
+vnf_test_config_t vnf_test_config[5];
+
+void reset_test_configs()
+{
+	memset(&pnf_test_config, 0, sizeof(pnf_test_config));
+	memset(&vnf_test_config, 0, sizeof(vnf_test_config));
+}
+
+void pnf_create_p5_sock(pnf_test_config_t* config)
+{
+	config->p5_sock = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP);
+	
+	config->p5_tx_sockaddr.sin_family = AF_INET;
+	config->p5_tx_sockaddr.sin_port = htons(config->vnf_p5_port);
+	config->p5_tx_sockaddr.sin_addr.s_addr = inet_addr(config->vnf_p5_addr);
+}
+
+void pnf_p5_connect(pnf_test_config_t* config)
+{
+	int connect_result = connect(config->p5_sock, (struct sockaddr *)&config->p5_tx_sockaddr, sizeof(config->p5_tx_sockaddr) );
+
+	printf("connect_result %d %d\n", connect_result, errno);
+}
+
+pnf_test_config_phy_t* find_pnf_phy_config(pnf_test_config_t* config, uint16_t phy_id)
+{
+	int i = 0;
+	for(i = 0; i < 4; ++i)
+	{
+		if(config->phys[i].phy_id == phy_id)
+			return &(config->phys[i]);
+	}
+
+	return 0;
+}
+
+vnf_test_config_phy_t* find_vnf_phy_config(vnf_test_config_t* config, uint16_t phy_id)
+{
+	int i = 0;
+	for(i = 0; i < 4; ++i)
+	{
+		if(config->phys[i].phy_id == phy_id)
+			return &(config->phys[i]);
+	}
+
+	return 0;
+}
+
+
+
+
+/************* Test case functions ****************/
+
+
+void vnf_test_start_no_config(void) 
+{
+	int result = nfapi_vnf_start(0);
+	CU_ASSERT_EQUAL(result, -1);
+}
+
+void* vnf_test_start_thread(void* ptr)
+{
+	int result = nfapi_vnf_start((nfapi_vnf_config_t*)ptr);
+	return (void*)(intptr_t)result;
+}
+
+int pnf_connection_indication_called = 0;
+int pnf_connection_indication(nfapi_vnf_config_t* config, int p5_idx)
+{
+	printf("[VNF] pnf_connection_indication p5_idx:%d\n", p5_idx);
+	pnf_connection_indication_called++;
+
+	nfapi_pnf_param_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_PNF_PARAM_REQUEST;
+	req.header.message_length = 0;
+
+	nfapi_vnf_pnf_param_req(config, p5_idx, &req);
+	
+	return 1;
+}
+
+int pnf_disconnect_indication(nfapi_vnf_config_t* config, int p5_idx)
+{
+	printf("[VNF] pnf_disconnect_indication p5_idx:%d\n", p5_idx);
+	pnf_connection_indication_called++;
+
+	vnf_test_config_t* test_config = (vnf_test_config_t*)(config->user_data);
+	printf("[VNF] pnf_disconnect_indication user_data %p\n", config->user_data);
+
+	int i = 0;
+	for(i = 0; i < test_config->phy_count; ++i)
+	{
+		vnf_test_config_phy_t* phy = &test_config->phys[i];
+		vnf_test_config_vnf_t* vnf = &test_config->vnfs[phy->p5_idx];
+
+		// need to send stop request/response
+
+		nfapi_vnf_p7_del_pnf((vnf->config), phy->phy_id);
+		vnf->phy_count--;
+	}
+
+
+	for(i = 0; i < 2; ++i)
+	{
+		vnf_test_config_vnf_t* vnf = &test_config->vnfs[i];
+	printf("[VNF] pnf_disconnect_indication phy_count:%d\n", vnf->phy_count);
+		if(vnf->enabled == 1)
+		{
+			nfapi_vnf_p7_stop(vnf->config);
+			//vnf->config->terminate = 1;
+
+			int* result;
+	printf("[VNF] waiting for vnf p7 thread to exit\n");
+			pthread_join((vnf->thread), (void**)&result);
+			CU_ASSERT_EQUAL(result, 0);
+
+			vnf->enabled = 0;
+		}
+	}
+	
+	return 1;
+}
+
+int send_p5_message(int p5Sock, nfapi_p4_p5_message_header_t* msg, unsigned msg_size, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	char buffer[256];
+	int encoded_size = nfapi_p5_message_pack(msg, msg_size, buffer, sizeof(buffer), 0);
+	int result = sendto(p5Sock, buffer, encoded_size, 0, (struct sockaddr*)addr, addr_size);
+	(void)result;
+	return 0;
+}
+
+int recv_p5_message(int p5Sock, nfapi_p4_p5_message_header_t* msg, unsigned msg_size)
+{
+	struct sockaddr_in addr2;
+	socklen_t addr2len;
+	char buffer2[256];
+	int result2 = recvfrom(p5Sock, buffer2, sizeof(buffer2), 0, (struct sockaddr*)&addr2, &addr2len); 
+		
+	int unpack_result = nfapi_p5_message_unpack(buffer2, result2, msg, msg_size, 0); //, sizeof(resp));
+	(void)unpack_result;
+	return 0;
+}
+
+int send_pnf_param_response(pnf_test_config_t* config) //int p5Sock, struct sockaddr_in* addr, socklen_t addr_size)
+{
+	nfapi_pnf_param_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_PARAM_RESPONSE;
+
+	resp.header.message_length = 0;
+	resp.error_code = NFAPI_MSG_OK;
+
+	//send_p5_message(p5Sock, &resp, sizeof(resp), addr, addr_size);
+	send_p5_message(config->p5_sock, &resp.header, sizeof(resp), &(config->p5_tx_sockaddr), sizeof(config->p5_tx_sockaddr));
+	return 0;
+}
+
+int create_p7_rx_socket(const char* addr, int port)
+{
+	int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+
+	struct sockaddr_in sock_addr;
+	sock_addr.sin_family = AF_INET;
+	sock_addr.sin_port = htons(port);
+
+	if(addr == 0)
+		sock_addr.sin_addr.s_addr = INADDR_ANY;
+	else
+		sock_addr.sin_addr.s_addr = inet_addr(addr);
+
+	int bind_result = bind(fd, (struct sockaddr*)&sock_addr, sizeof(sock_addr));
+	if(bind_result != 0)
+	{
+		printf("Failed to bind p7 rx socket %d(%d) to %s:%d\n", bind_result, errno, addr, port);
+	}
+
+	
+	return fd;
+}
+
+int create_p7_tx_socket()
+{
+	int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+	return fd;
+}
+
+int send_param_response(pnf_test_config_t* config, uint16_t phy_id)
+{
+	nfapi_param_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PARAM_RESPONSE;
+	resp.header.phy_id = phy_id;
+
+	pnf_test_config_phy_t* phy = find_pnf_phy_config(config, phy_id);
+
+	resp.error_code = NFAPI_MSG_OK;
+
+	resp.nfapi_config.p7_pnf_port.tl.tag = NFAPI_NFAPI_P7_PNF_PORT_TAG;
+	resp.nfapi_config.p7_pnf_port.value = phy->p7_rx_port;
+
+	struct sockaddr_in pnf_p7_sockaddr;
+	pnf_p7_sockaddr.sin_addr.s_addr = inet_addr(phy->p7_rx_addr);
+
+	resp.nfapi_config.p7_pnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG;
+	memcpy(&resp.nfapi_config.p7_pnf_address_ipv4.address[0], &pnf_p7_sockaddr.sin_addr.s_addr, 4);
+
+	send_p5_message(config->p5_sock, &resp.header, sizeof(resp), &(config->p5_tx_sockaddr), sizeof(config->p5_tx_sockaddr));
+	return 0;
+}
+
+int receive_pnf_param_request(pnf_test_config_t* config)
+{
+	nfapi_pnf_param_request_t req;
+	recv_p5_message(config->p5_sock, &req.header, sizeof(req));
+
+	CU_ASSERT_EQUAL(req.header.message_id, NFAPI_PNF_PARAM_REQUEST);
+	if(req.header.message_id == NFAPI_PNF_PARAM_REQUEST)
+	{
+		printf("[PNF] nfapi_pnf_param_request\n");
+	}
+	return 0;
+}
+
+int receive_param_request(pnf_test_config_t* config)
+{
+	nfapi_param_request_t req;
+	recv_p5_message(config->p5_sock, &req.header, sizeof(req));
+
+	CU_ASSERT_EQUAL(req.header.message_id, NFAPI_PARAM_REQUEST);
+	if(req.header.message_id == NFAPI_PARAM_REQUEST)
+	{
+		printf("[PNF] nfapi_param_request phy_id:%d\n", req.header.phy_id);
+	}
+	else
+	{
+		printf("[PNF] ERROR, unexpected message %d phy_id:%d\n", req.header.message_id, req.header.phy_id);
+	}
+	return req.header.phy_id;
+}
+
+int send_pnf_config_response(pnf_test_config_t* config)
+{
+	nfapi_pnf_config_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_CONFIG_RESPONSE;
+	resp.header.message_length = 0;
+	resp.error_code = NFAPI_MSG_OK;
+
+	send_p5_message(config->p5_sock, &resp.header, sizeof(resp), &(config->p5_tx_sockaddr), sizeof(config->p5_tx_sockaddr));
+	return 0;
+}
+
+int send_config_response(pnf_test_config_t* config, uint16_t phy_id)
+{
+	nfapi_config_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_CONFIG_RESPONSE;
+	resp.header.message_length = 0;
+	resp.header.phy_id = phy_id;
+	resp.error_code = NFAPI_MSG_OK;
+
+	send_p5_message(config->p5_sock, &resp.header, sizeof(resp), &(config->p5_tx_sockaddr), sizeof(config->p5_tx_sockaddr));
+	return 0;
+}
+
+
+int receive_pnf_config_request(pnf_test_config_t* config)
+{
+	nfapi_pnf_config_request_t req;
+	recv_p5_message(config->p5_sock, &req.header, sizeof(req));
+
+	CU_ASSERT_EQUAL(req.header.message_id, NFAPI_PNF_CONFIG_REQUEST);
+	if(req.header.message_id == NFAPI_PNF_CONFIG_REQUEST)
+	{
+		printf("decoded nfapi_pnf_config_request\n");
+
+		int i = 0;
+		for(i = 0; i < req.pnf_phy_rf_config.number_phy_rf_config_info; ++i)
+		{
+			nfapi_phy_rf_config_info_t* info = &(req.pnf_phy_rf_config.phy_rf_config[i]);
+			printf("adding pnf phy %d id %d\n",  i, info->phy_id);
+
+			config->phys[i].enabled = 1;
+			config->phys[i].phy_id = info->phy_id;
+		}
+	}
+	return 0;
+}
+
+int receive_config_request(pnf_test_config_t* config)
+{
+	nfapi_config_request_t req;
+	recv_p5_message(config->p5_sock, &req.header, sizeof(req));
+
+	CU_ASSERT_EQUAL(req.header.message_id, NFAPI_CONFIG_REQUEST);
+	if(req.header.message_id == NFAPI_CONFIG_REQUEST)
+	{
+		printf("[PNF] nfapi_config_request phy_id:%d\n", req.header.phy_id);
+
+		pnf_test_config_phy_t* phy = find_pnf_phy_config(config, req.header.phy_id);
+
+		// todo verify that this is the same as a vnf config?
+		phy->p7_tx_sockaddr.sin_family = AF_INET;
+		phy->p7_tx_sockaddr.sin_port = htons(req.nfapi_config.p7_vnf_port.value);
+		memcpy(&phy->p7_tx_sockaddr.sin_addr.s_addr, &req.nfapi_config.p7_vnf_address_ipv4.address, 4);
+		phy->p7_tx_sock = create_p7_tx_socket();
+
+
+		printf("[PNF] vnf p7 address %s:%d\n", inet_ntoa(phy->p7_tx_sockaddr.sin_addr), ntohs(phy->p7_tx_sockaddr.sin_port));
+
+		return req.header.phy_id;
+	}
+
+	return NFAPI_PHY_ID_NA;
+}
+
+int send_pnf_start_response(pnf_test_config_t* config)
+{
+	nfapi_pnf_start_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_START_RESPONSE;
+	resp.header.message_length = 0;
+	resp.error_code = NFAPI_MSG_OK;
+
+	send_p5_message(config->p5_sock, &resp.header, sizeof(resp), &(config->p5_tx_sockaddr), sizeof(config->p5_tx_sockaddr));
+	return 0;
+}
+
+int send_start_response(pnf_test_config_t* config, uint16_t phy_id)
+{
+	nfapi_start_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_START_RESPONSE;
+	resp.header.message_length = 0;
+	resp.header.phy_id  = phy_id;
+	resp.error_code = NFAPI_MSG_OK;
+
+	send_p5_message(config->p5_sock, &resp.header, sizeof(resp), &(config->p5_tx_sockaddr), sizeof(config->p5_tx_sockaddr));
+	return 0;
+}
+
+int receive_pnf_start_request(pnf_test_config_t* config)
+{
+	nfapi_pnf_start_request_t req;
+	recv_p5_message(config->p5_sock, &req.header, sizeof(req));
+
+	CU_ASSERT_EQUAL(req.header.message_id, NFAPI_PNF_START_REQUEST);
+	if(req.header.message_id == NFAPI_PNF_START_REQUEST)
+	{
+		printf("decoded nfapi_pnf_start_request\n");
+
+		int phy_idx = 0;
+		for(phy_idx = 0; phy_idx < 4; ++phy_idx)
+		{
+			if(config->phys[phy_idx].enabled)
+			{
+				pnf_test_config_phy_t* phy = &(config->phys[phy_idx]);
+				phy->p7_rx_port = config->p7_rx_port_base + phy_idx;
+				phy->p7_rx_addr = "127.0.0.1"; 
+			}
+		}
+	}
+	return 0;
+}
+
+int receive_start_request(pnf_test_config_t* config)
+{
+	nfapi_start_request_t req;
+	recv_p5_message(config->p5_sock, &req.header, sizeof(req));
+
+	CU_ASSERT_EQUAL(req.header.message_id, NFAPI_START_REQUEST);
+	if(req.header.message_id == NFAPI_START_REQUEST)
+	{
+		printf("[PNF] nfapi_start_request\n");
+
+		pnf_test_config_phy_t* phy = find_pnf_phy_config(config, req.header.phy_id);
+		printf("[PNF] creating p7 rx socket %s:%d\n", phy->p7_rx_addr, phy->p7_rx_port);
+		phy->p7_rx_sock = create_p7_rx_socket(phy->p7_rx_addr, phy->p7_rx_port);
+		phy->started = 1;
+
+	}
+
+	return req.header.phy_id;
+}
+
+int send_pnf_stop_response(pnf_test_config_t* config, uint16_t phy_id)
+{
+	printf("pnf_stop_response\n");
+	nfapi_pnf_stop_response_t resp;
+	memset(&resp, 0, sizeof(resp));
+	resp.header.message_id = NFAPI_PNF_STOP_RESPONSE;
+	resp.header.message_length = 0;
+	resp.error_code = NFAPI_MSG_OK;
+
+	send_p5_message(config->p5_sock, &resp.header, sizeof(resp), &(config->p5_tx_sockaddr), sizeof(config->p5_tx_sockaddr));
+	return 0;
+}
+
+int receive_pnf_stop_request(pnf_test_config_t* config)
+{
+	printf("pnf_stop_request\n");
+	nfapi_pnf_stop_request_t req;
+	recv_p5_message(config->p5_sock, &req.header, sizeof(req));
+
+	CU_ASSERT_EQUAL(req.header.message_id, NFAPI_PNF_STOP_REQUEST);
+	if(req.header.message_id == NFAPI_PNF_STOP_REQUEST)
+	{
+		printf("decoded nfapi_pnf_stop_request\n");
+	}
+	return 0;
+}
+int pnf_param_response(nfapi_vnf_config_t* config, int p5_idx,nfapi_pnf_param_response_t* response)
+{
+	printf("[VNF] pnf_param_response p5_idx:%d\n", p5_idx);
+	CU_ASSERT_EQUAL(response->error_code, NFAPI_MSG_OK);
+
+	uint16_t phy_id;
+	nfapi_vnf_allocate_phy(config, p5_idx, &phy_id);
+
+	nfapi_pnf_config_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_PNF_CONFIG_REQUEST;
+	req.header.message_length = 0;
+	req.header.phy_id = NFAPI_PHY_ID_NA;
+
+	req.pnf_phy_rf_config.tl.tag = NFAPI_PNF_PHY_RF_TAG;
+	req.pnf_phy_rf_config.number_phy_rf_config_info = 2;
+	nfapi_vnf_allocate_phy(config, p5_idx, &req.pnf_phy_rf_config.phy_rf_config[0].phy_id);
+	nfapi_vnf_allocate_phy(config, p5_idx, &req.pnf_phy_rf_config.phy_rf_config[1].phy_id);
+	
+	uint16_t i = vnf_test_config[0].phy_count;
+
+	vnf_test_config[0].phys[i].enabled = 1;
+	vnf_test_config[0].phys[i].p5_idx = p5_idx;
+	vnf_test_config[0].phys[i].phy_id = req.pnf_phy_rf_config.phy_rf_config[0].phy_id;
+
+	i++;
+
+	vnf_test_config[0].phys[i].enabled = 1;
+	vnf_test_config[0].phys[i].p5_idx = p5_idx;
+	vnf_test_config[0].phys[i].phy_id = req.pnf_phy_rf_config.phy_rf_config[1].phy_id;
+
+	i++;
+	
+	vnf_test_config[0].phy_count = i;
+
+	nfapi_vnf_pnf_config_req(config, p5_idx, &req);
+
+	return 0;
+}
+
+int pnf_config_response(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_config_response_t* response)
+{
+	printf("pnf_config_response\n");
+	CU_ASSERT_EQUAL(response->error_code, NFAPI_MSG_OK);
+
+	nfapi_pnf_start_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_PNF_START_REQUEST;
+	req.header.message_length = 0;
+	req.header.phy_id = response->header.phy_id;
+
+	nfapi_vnf_pnf_start_req(config, p5_idx, &req);
+
+	return 0;
+}
+
+
+void* vnf_test_start_p7_thread(void* ptr)
+{
+	int result = nfapi_vnf_p7_start((nfapi_vnf_p7_config_t*)ptr);
+	(void)result;
+	return 0;
+}
+
+int test_subframe_indication(nfapi_vnf_p7_config_t* config, uint16_t phy_id, uint16_t sfn_sf)
+{
+	//printf("[VNF:%d] (%d:%d) SUBFRAME_IND\n", phy_id, SFNSF2SFN(sfn_sf), SFNSF2SF(sfn_sf));
+
+	nfapi_dl_config_request_t dl_config_req;
+	memset(&dl_config_req, 0, sizeof(dl_config_req));
+	dl_config_req.header.message_id = NFAPI_DL_CONFIG_REQUEST;
+	dl_config_req.header.phy_id = phy_id;
+	dl_config_req.sfn_sf = sfn_sf;
+	nfapi_vnf_p7_dl_config_req(config, &dl_config_req);
+	
+	nfapi_ul_config_request_t ul_config_req;
+	memset(&ul_config_req, 0, sizeof(ul_config_req));
+	ul_config_req.header.message_id = NFAPI_UL_CONFIG_REQUEST;
+	ul_config_req.header.phy_id = phy_id;
+	ul_config_req.sfn_sf = sfn_sf;
+	nfapi_vnf_p7_ul_config_req(config, &ul_config_req);
+
+	nfapi_hi_dci0_request_t hi_dci0_req;
+	memset(&hi_dci0_req, 0, sizeof(hi_dci0_req));
+	hi_dci0_req.header.message_id = NFAPI_HI_DCI0_REQUEST;
+	hi_dci0_req.header.phy_id = phy_id;
+	hi_dci0_req.sfn_sf = sfn_sf;
+	nfapi_vnf_p7_hi_dci0_req(config, &hi_dci0_req);
+
+
+	nfapi_tx_request_t tx_req;
+	memset(&tx_req, 0, sizeof(tx_req));
+	tx_req.header.message_id = NFAPI_TX_REQUEST;
+	tx_req.header.phy_id = phy_id;
+	tx_req.sfn_sf = sfn_sf;
+	nfapi_vnf_p7_tx_req(config, &tx_req);
+	return 0;
+}
+
+int test_harq_indication(nfapi_vnf_p7_config_t* config, nfapi_harq_indication_t* ind)
+{
+	//printf("[VNF:%d] (%d:%d) HARQ_IND\n", ind->header.phy_id, SFNSF2SFN(ind->sfn_sf), SFNSF2SF(ind->sfn_sf));
+	return 0;
+}
+
+int test_nb_harq_indication(nfapi_vnf_p7_config_t* config, nfapi_nb_harq_indication_t* ind)
+{
+	//printf("[VNF:%d] (%d:%d) HARQ_IND\n", ind->header.phy_id, SFNSF2SFN(ind->sfn_sf), SFNSF2SF(ind->sfn_sf));
+	return 0;
+}
+
+
+int test_crc_indication(nfapi_vnf_p7_config_t* config, nfapi_crc_indication_t* ind)
+{
+	//printf("[VNF:%d] (%d:%d) CRC_IND\n", ind->header.phy_id, SFNSF2SFN(ind->sfn_sf), SFNSF2SF(ind->sfn_sf));
+	return 0;
+}
+int test_rx_indication(nfapi_vnf_p7_config_t* config, nfapi_rx_indication_t* ind)
+{
+	//printf("[VNF:%d] (%d:%d) RX_IND\n", ind->header.phy_id, SFNSF2SFN(ind->sfn_sf), SFNSF2SF(ind->sfn_sf));
+	return 0;
+}
+int test_rach_indication(nfapi_vnf_p7_config_t* config, nfapi_rach_indication_t* ind)
+{
+	//printf("[VNF:%d] (%d:%d) RACH_IND\n", ind->header.phy_id, SFNSF2SFN(ind->sfn_sf), SFNSF2SF(ind->sfn_sf));
+	return 0;
+}
+int test_nrach_indication(nfapi_vnf_p7_config_t* config, nfapi_nrach_indication_t* ind)
+{
+	//printf("[VNF:%d] (%d:%d) RACH_IND\n", ind->header.phy_id, SFNSF2SFN(ind->sfn_sf), SFNSF2SF(ind->sfn_sf));
+	return 0;
+}
+int test_srs_indication(nfapi_vnf_p7_config_t* config, nfapi_srs_indication_t* ind)
+{
+	//printf("[VNF:%d] (%d:%d) SRS_IND\n", ind->header.phy_id, SFNSF2SFN(ind->sfn_sf), SFNSF2SF(ind->sfn_sf));
+	return 0;
+}
+int test_sr_indication(nfapi_vnf_p7_config_t* config, nfapi_sr_indication_t* ind)
+{
+	//printf("[VNF:%d] (%d:%d) SR_IND\n", ind->header.phy_id, SFNSF2SFN(ind->sfn_sf), SFNSF2SF(ind->sfn_sf));
+	return 0;
+}
+int test_cqi_indication(nfapi_vnf_p7_config_t* config, nfapi_cqi_indication_t* ind)
+{
+	//printf("[VNF:%d] (%d:%d) CQI_IND\n", ind->header.phy_id, SFNSF2SFN(ind->sfn_sf), SFNSF2SF(ind->sfn_sf));
+	return 0;
+}
+
+int pnf_start_response(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_start_response_t* response)
+{
+	printf("[VNF] pnf_start_response p5_idx:%d\n", p5_idx);
+	CU_ASSERT_EQUAL(response->error_code, NFAPI_MSG_OK);
+
+	return 0;
+}
+
+int pnf_stop_response(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_stop_response_t* response)
+{
+	printf("pnf_stop_response\n");
+	CU_ASSERT_EQUAL(response->error_code, NFAPI_MSG_OK);
+
+	nfapi_vnf_p7_stop(vnf_test_config[0].vnfs[0].config);
+	return 0;
+}
+
+int param_response(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_response_t* response)
+{
+	printf("[VNF] param_response p5_idx:%d phy_id:%d\n", p5_idx, response->header.phy_id);
+	CU_ASSERT_EQUAL(response->error_code, NFAPI_MSG_OK);
+
+	struct sockaddr_in addr;
+	memcpy(&addr.sin_addr.s_addr, &response->nfapi_config.p7_pnf_address_ipv4.address, 4);
+	printf("[VNF] param_response pnf p7 %s:%d\n", inet_ntoa(addr.sin_addr), response->nfapi_config.p7_pnf_port.value);
+
+	// find the vnf phy configuration
+	vnf_test_config_phy_t* phy = find_vnf_phy_config(&(vnf_test_config[0]), response->header.phy_id);
+	
+	// save the pnf p7 connection information
+	phy->p7_tx_sockaddr.sin_port = response->nfapi_config.p7_pnf_port.value;
+	memcpy(&phy->p7_tx_sockaddr.sin_addr.s_addr, &response->nfapi_config.p7_pnf_address_ipv4.address, 4);
+
+	nfapi_config_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_CONFIG_REQUEST;
+	req.header.phy_id = response->header.phy_id;
+
+	vnf_test_config_vnf_t* vnf = &(vnf_test_config[0].vnfs[phy->vnf_idx]);
+	req.nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
+	memcpy(&req.nfapi_config.p7_vnf_address_ipv4.address, &vnf->p7_rx_sockaddr.sin_addr.s_addr, 4);
+
+	req.nfapi_config.p7_vnf_port.tl.tag = NFAPI_NFAPI_P7_VNF_PORT_TAG;
+	req.nfapi_config.p7_vnf_port.value = vnf->p7_rx_sockaddr.sin_port;
+
+	nfapi_vnf_config_req(config, p5_idx, &req);
+	return 0;
+}
+
+int config_response(nfapi_vnf_config_t* config, int p5_idx, nfapi_config_response_t* response)
+{
+	printf("[VNF] config_response p5_idx:%d phy_id:%d\n", p5_idx, response->header.phy_id);
+	return 0;
+	CU_ASSERT_EQUAL(response->error_code, NFAPI_MSG_OK);
+
+}
+
+int send_vnf_start_req(vnf_test_config_t* config, vnf_test_config_phy_t* phy)
+{
+	nfapi_start_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_START_REQUEST;
+	req.header.phy_id = phy->phy_id;
+
+	nfapi_vnf_start_req(config->p5_vnf_config, phy->p5_idx, &req);
+	return 0;
+}
+
+int start_response(nfapi_vnf_config_t* config, int p5_idx, nfapi_start_response_t* response)
+{
+	printf("[VNF] start_response p5_idx:%d phy_id:%d\n", p5_idx, response->header.phy_id);
+	CU_ASSERT_EQUAL(response->error_code, NFAPI_MSG_OK);
+
+	sleep(1);
+	
+	vnf_test_config_phy_t* phy = find_vnf_phy_config(&(vnf_test_config[0]), response->header.phy_id);
+
+	char* addr = inet_ntoa(phy->p7_tx_sockaddr.sin_addr);
+	int port = phy->p7_tx_sockaddr.sin_port;
+
+	vnf_test_config_vnf_t* vnf = &(vnf_test_config[0].vnfs[phy->vnf_idx]);
+
+	nfapi_vnf_p7_add_pnf(vnf->config, addr, port, response->header.phy_id);
+	return 0;
+}
+
+int stop_response(nfapi_vnf_config_t* config, int p5_idx, nfapi_stop_response_t* response)
+{
+	printf("stop_response p5_idx:%d phy_id:%d\n", p5_idx, response->header.phy_id);
+	CU_ASSERT_EQUAL(response->error_code, NFAPI_MSG_OK);
+	return 0;
+}
+
+void  start_vnf_p5(vnf_test_config_t* test_config)
+{
+	test_config->p5_vnf_config = nfapi_vnf_config_create();
+
+	test_config->p5_vnf_config->vnf_p5_port = test_config->p5_port;
+	test_config->p5_vnf_config->vnf_ipv4 = 1;
+	test_config->p5_vnf_config->pnf_connection_indication = &pnf_connection_indication;
+	test_config->p5_vnf_config->pnf_disconnect_indication = &pnf_disconnect_indication;
+	test_config->p5_vnf_config->pnf_param_resp = &pnf_param_response;
+	test_config->p5_vnf_config->pnf_config_resp = &pnf_config_response;
+	test_config->p5_vnf_config->pnf_start_resp = &pnf_start_response;
+	test_config->p5_vnf_config->pnf_stop_resp = &pnf_stop_response;
+	test_config->p5_vnf_config->param_resp = &param_response;
+	test_config->p5_vnf_config->config_resp = &config_response;
+	test_config->p5_vnf_config->start_resp = &start_response;
+	test_config->p5_vnf_config->stop_resp = &stop_response;
+
+	test_config->p5_vnf_config->user_data = test_config;
+
+	pthread_create(&test_config->thread, NULL, &vnf_test_start_thread, test_config->p5_vnf_config);
+
+	sleep(1);
+
+}
+
+void start_vnf_p7(vnf_test_config_vnf_t* vnf)
+{
+	
+	// todo : select which vnf to use for these phy's
+	vnf->enabled = 1;
+
+	vnf->p7_rx_sockaddr.sin_addr.s_addr = inet_addr(vnf->vnf_p7_addr);
+	vnf->p7_rx_sockaddr.sin_port = vnf->vnf_p7_port;
+
+
+	vnf->config = nfapi_vnf_p7_config_create();
+	vnf->config->checksum_enabled = 0;
+	vnf->config->port = vnf->vnf_p7_port;
+	vnf->config->subframe_indication = &test_subframe_indication;
+	vnf->config->harq_indication = &test_harq_indication;
+	vnf->config->crc_indication = &test_crc_indication;
+	vnf->config->rx_indication = &test_rx_indication;
+	vnf->config->rach_indication = &test_rach_indication;
+	vnf->config->srs_indication = &test_srs_indication;
+	vnf->config->sr_indication = &test_sr_indication;
+	vnf->config->cqi_indication = &test_cqi_indication;
+	
+	vnf->config->nb_harq_indication = &test_nb_harq_indication;
+	vnf->config->nrach_indication = &test_nrach_indication;
+	
+
+	vnf->config->segment_size = 1400;
+	vnf->config->max_num_segments = 6;
+
+	pthread_create(&(vnf->thread), NULL, &vnf_test_start_p7_thread, vnf->config);
+
+	vnf->enabled = 1;
+
+	//vnf->phy_count++;
+
+	sleep(1);
+}
+
+void send_p7_segmented_msg(int sock, char* msg, int len, int segment_size, struct sockaddr* addr,  socklen_t addr_len)
+{
+	static uint8_t sequence_num = 0;
+	if(len < segment_size)
+	{
+		msg[7] = sequence_num;
+		sendto(sock, msg, len, 0, addr, addr_len);
+	}
+	else
+	{
+		int msg_body_len = len - 12 ; 
+		int seg_body_len = segment_size - 12 ; 
+		int segments = (msg_body_len / (seg_body_len)) + ((msg_body_len % seg_body_len) ? 1 : 0); 
+
+		//printf("sending segmented message len:%d seg_size:%d count:%d\n", len, segment_size, segments);
+
+		int segment = 0;
+		int offset = 12;
+		for(segment = 0; segment < segments; ++segment)
+		{
+			uint8_t last = 0;
+			uint16_t size = segment_size - 12;
+			if(segment + 1 == segments)
+			{
+				last = 1;
+				size = (msg_body_len) - (seg_body_len * segment);
+			}
+
+			char buffer[segment_size];
+
+			memcpy(&buffer[0], msg, 12);
+			buffer[6] = ((!last) << 7) + segment;
+			buffer[7] = sequence_num;
+
+			// msg length
+			uint8_t* p = (uint8_t*)&buffer[4];
+			push16(size + 12, &p, (uint8_t*)&buffer[size + 12]);
+
+			memcpy(&buffer[12], msg + offset, size);
+			offset += size;
+		
+			sendto(sock, &buffer[0], size + 12, 0, addr, addr_len);
+
+		}
+
+
+	}
+
+	sequence_num++;
+}
+
+void start_phy(vnf_test_config_phy_t* phy)
+{
+
+	nfapi_param_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_PARAM_REQUEST;
+	req.header.phy_id = phy->phy_id;
+
+	nfapi_vnf_config_t* p5_vnf_config = (vnf_test_config[0].p5_vnf_config);
+	
+
+	nfapi_vnf_param_req(p5_vnf_config, phy->p5_idx, &req);
+
+}
+
+
+void vnf_test_start_connect(void)
+{
+	reset_test_configs();
+
+	int segment_size = 256;
+
+	vnf_test_config[0].p5_addr = "127.0.0.1";
+	vnf_test_config[0].p5_port = 4242;
+
+	vnf_test_config[0].vnfs[0].enabled = 0;
+	vnf_test_config[0].vnfs[0].vnf_p7_addr = "127.0.0.1";
+	vnf_test_config[0].vnfs[0].vnf_p7_port = 7878;
+	vnf_test_config[0].vnfs[0].max_phys = 1;
+
+	vnf_test_config[0].vnfs[1].enabled = 0;
+	vnf_test_config[0].vnfs[1].vnf_p7_addr = "127.0.0.1";
+	vnf_test_config[0].vnfs[1].vnf_p7_port = 7879;
+	vnf_test_config[0].vnfs[1].max_phys = 1;
+
+
+	// this is the action that p9 would take to set the vnf p5 address/port
+	pnf_test_config[0].enabled = 1;
+	pnf_test_config[0].vnf_p5_port = vnf_test_config[0].p5_port;
+	pnf_test_config[0].vnf_p5_addr = vnf_test_config[0].p5_addr;
+	pnf_test_config[0].p7_rx_port_base = 8000;
+
+	pnf_test_config[1].enabled = 1;
+	pnf_test_config[1].vnf_p5_port = vnf_test_config[0].p5_port;
+	pnf_test_config[1].vnf_p5_addr = vnf_test_config[0].p5_addr;
+	pnf_test_config[1].p7_rx_port_base = 8100;
+
+	pnf_connection_indication_called = 0;
+
+	start_vnf_p5(&vnf_test_config[0]);
+
+
+	pnf_create_p5_sock(&pnf_test_config[0]);
+	pnf_p5_connect(&pnf_test_config[0]);
+
+	receive_pnf_param_request(&pnf_test_config[0]);
+	send_pnf_param_response(&pnf_test_config[0]);
+
+	receive_pnf_config_request(&pnf_test_config[0]);
+	send_pnf_config_response(&pnf_test_config[0]);
+
+	receive_pnf_start_request(&pnf_test_config[0]);
+	send_pnf_start_response(&pnf_test_config[0]);
+
+	pnf_create_p5_sock(&pnf_test_config[1]);
+
+	pnf_p5_connect(&pnf_test_config[1]);
+
+	receive_pnf_param_request(&pnf_test_config[1]);
+	send_pnf_param_response(&pnf_test_config[1]);
+
+	receive_pnf_config_request(&pnf_test_config[1]);
+	send_pnf_config_response(&pnf_test_config[1]);
+
+	receive_pnf_start_request(&pnf_test_config[1]);
+	send_pnf_start_response(&pnf_test_config[1]);
+
+	// start the vnf_p7 thread and assign by phys to that instance
+
+	start_vnf_p7(&vnf_test_config[0].vnfs[0]);
+	//start_vnf_p7(&vnf_test_config[0].vnfs[1]);
+	
+	printf("---- configuring phy %d -----\n", vnf_test_config[0].phys[0].phy_id);
+	vnf_test_config[0].phys[0].vnf_idx = 0;
+	start_phy(&vnf_test_config[0].phys[0]);
+
+	int phy_id = receive_param_request(&pnf_test_config[0]);
+	send_param_response(&pnf_test_config[0], phy_id); 
+
+	phy_id = receive_config_request(&pnf_test_config[0]);
+	send_config_response(&pnf_test_config[0], phy_id);
+
+	printf("---- configuring phy %d -----\n", vnf_test_config[0].phys[2].phy_id);
+	vnf_test_config[0].phys[2].vnf_idx = 0; 
+	start_phy(&vnf_test_config[0].phys[2]);
+
+	phy_id = receive_param_request(&pnf_test_config[1]);
+	send_param_response(&pnf_test_config[1], phy_id); 
+
+	phy_id = receive_config_request(&pnf_test_config[1]);
+	send_config_response(&pnf_test_config[1], phy_id);
+
+	printf("---- configuring phy %d -----\n", vnf_test_config[0].phys[1].phy_id);
+
+	vnf_test_config[0].phys[1].vnf_idx = 0;
+	start_phy(&vnf_test_config[0].phys[1]);
+
+	phy_id = receive_param_request(&pnf_test_config[0]);
+	send_param_response(&pnf_test_config[0], phy_id); 
+
+	phy_id = receive_config_request(&pnf_test_config[0]);
+	send_config_response(&pnf_test_config[0], phy_id);
+
+	//-------------
+	printf("---- starting phy %d -----\n", vnf_test_config[0].phys[0].phy_id);
+
+	send_vnf_start_req(&vnf_test_config[0], &vnf_test_config[0].phys[0]);
+	phy_id = receive_start_request(&pnf_test_config[0]);
+	send_start_response(&pnf_test_config[0], phy_id);
+/*
+	printf("---- starting phy %d -----\n", vnf_test_config[0].phys[2].phy_id);
+
+	send_vnf_start_req(&vnf_test_config[0], &vnf_test_config[0].phys[2]);
+	phy_id = receive_start_request(&pnf_test_config[1]);
+	send_start_response(&pnf_test_config[1], phy_id);
+
+	printf("---- starting phy %d -----\n", vnf_test_config[0].phys[1].phy_id);
+
+	send_vnf_start_req(&vnf_test_config[0], &vnf_test_config[0].phys[1]);
+	phy_id = receive_start_request(&pnf_test_config[0]);
+	send_start_response(&pnf_test_config[0], phy_id);
+*/
+	//close(pnf_test_config[0].p5_sock);
+
+	char buffer[2048];
+	int buffer_size = sizeof(buffer);
+
+	
+	fd_set rdfs;
+	int exit = 0;
+	while(exit != 1)
+	{
+		int pnf_idx, phy_idx; 
+		int max_fd = 0;
+		FD_ZERO(&rdfs);
+
+		for(pnf_idx = 0; pnf_idx < 4; ++pnf_idx)
+		{
+			if(pnf_test_config[pnf_idx].enabled)
+			{
+				FD_SET(pnf_test_config[pnf_idx].p5_sock, &rdfs);
+				if(pnf_test_config[pnf_idx].p5_sock > max_fd)
+					max_fd = pnf_test_config[pnf_idx].p5_sock;
+			}
+
+			for(phy_idx = 0; phy_idx < 4; ++phy_idx)
+			{
+				pnf_test_config_phy_t* phy_info = &(pnf_test_config[pnf_idx].phys[phy_idx]);
+
+				if(phy_info->started == 1 && phy_info->enabled == 1)
+				{
+					//////////////////printf("adding %d/%d %d %d\n", pnf_idx, phy_idx, phy_info->phy_id, phy_info->p7_rx_sock);
+					FD_SET(phy_info->p7_rx_sock, &rdfs);
+					if(phy_info->p7_rx_sock > max_fd)
+						max_fd = phy_info->p7_rx_sock;
+				}
+			}
+		}
+
+		
+		// changed to select,
+		int select_result = select(max_fd + 1, &rdfs, NULL, NULL, NULL);
+		(void)select_result;
+
+		for(pnf_idx = 0; pnf_idx < 4; ++pnf_idx)
+		{
+			if(pnf_test_config[pnf_idx].enabled)
+			{
+				//pnf_test_config_t* pnf_config = &(pnf_test_config[pnf_idx]);
+			}
+
+			for(phy_idx = 0; phy_idx < 4; ++phy_idx)
+			{
+				pnf_test_config_phy_t* phy_info = &(pnf_test_config[pnf_idx].phys[phy_idx]);
+
+				if(phy_info->enabled)
+				{
+					if(FD_ISSET(phy_info->p7_rx_sock, &rdfs))
+					{
+						//struct sockaddr_in recv_addr;
+						//memset(&recv_addr, 0, sizeof(recv_addr));
+						//socklen_t recv_addr_size;
+						int len = recvfrom(phy_info->p7_rx_sock, &buffer[0], buffer_size, 0, 0, 0);// (struct sockaddr*)&recv_addr, &recv_addr_size);
+
+						if(len == -1)
+						{
+							printf("recvfrom %d failed %d\n", phy_info->p7_rx_sock, errno);
+							continue;
+						}
+
+						nfapi_p7_message_header_t header;
+						nfapi_p7_message_header_unpack(buffer, len, &header, sizeof(header), 0);
+
+						switch(header.message_id)
+						{
+							case NFAPI_DL_NODE_SYNC:
+								{
+									nfapi_dl_node_sync_t msg;
+									nfapi_p7_message_unpack(buffer, len, &msg, sizeof(msg), 0);
+									printf("[PNF:%d] NFAPI_DL_NODE_SYNC t1:%d\n", msg.header.phy_id, msg.t1);
+
+									nfapi_ul_node_sync_t resp;
+									memset(&resp, 0, sizeof(resp));
+									resp.header.message_id = NFAPI_UL_NODE_SYNC;
+									resp.header.phy_id = msg.header.phy_id;
+									resp.t1 = msg.t1;
+									usleep(50);
+									resp.t2 = msg.t1 + 50; // 50 us rx latency
+									resp.t3 = msg.t1 + 10; // 10 us pnf proc
+
+									usleep(50);
+
+									len = nfapi_p7_message_pack(&resp, buffer, buffer_size, 0);
+									// send ul node sycn
+									send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+								}
+								break;
+							case NFAPI_DL_CONFIG_REQUEST:
+								{
+									nfapi_dl_config_request_t msg;
+									nfapi_p7_message_unpack(buffer, len, &msg, sizeof(msg), 0);
+									//printf("[PNF:%d] (%d/%d) NFAPI_DL_CONFIG_REQUEST\n", header.phy_id, SFNSF2SFN(msg.sfn_sf), SFNSF2SF(msg.sfn_sf));
+
+									if(SFNSF2SFN(msg.sfn_sf) == 500)
+										exit = 1;
+									// simulate the uplink messages
+									
+									nfapi_harq_indication_t harq_ind;
+									memset(&harq_ind, 0, sizeof(harq_ind));
+									harq_ind.header.message_id = NFAPI_HARQ_INDICATION;
+									harq_ind.header.phy_id = msg.header.phy_id;
+									harq_ind.sfn_sf = msg.sfn_sf;
+									harq_ind.harq_indication_body.tl.tag = NFAPI_HARQ_INDICATION_BODY_TAG;
+									harq_ind.harq_indication_body.number_of_harqs = 2;
+
+									harq_ind.harq_indication_body.harq_pdu_list = (nfapi_harq_indication_pdu_t*)(malloc(sizeof(nfapi_harq_indication_pdu_t) * harq_ind.harq_indication_body.number_of_harqs));
+
+									int i = 0;
+									for(i = 0; i < harq_ind.harq_indication_body.number_of_harqs; ++i)
+									{
+										harq_ind.harq_indication_body.harq_pdu_list[i].rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
+									}
+									len = nfapi_p7_message_pack(&harq_ind, buffer, buffer_size, 0);
+									//sendto(phy_info->p7_tx_sock, &buffer[0], len, 0, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+									send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+									
+
+
+									//sendto(phy_info->p7_tx_sock, &buffer[0], len, 0, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+
+									free(harq_ind.harq_indication_body.harq_pdu_list);
+
+									nfapi_crc_indication_t crc_ind;
+									memset(&crc_ind, 0, sizeof(crc_ind));
+									crc_ind.header.message_id = NFAPI_CRC_INDICATION;
+									crc_ind.header.phy_id = msg.header.phy_id;
+									crc_ind.sfn_sf = msg.sfn_sf;
+									len = nfapi_p7_message_pack(&crc_ind, buffer, buffer_size, 0);
+									send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+
+									nfapi_sr_indication_t sr_ind;
+									memset(&sr_ind, 0, sizeof(sr_ind));
+									sr_ind.header.message_id = NFAPI_RX_SR_INDICATION;
+									sr_ind.header.phy_id = msg.header.phy_id;
+									sr_ind.sfn_sf = msg.sfn_sf;
+									len = nfapi_p7_message_pack(&sr_ind, buffer, buffer_size, 0);
+									send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+
+									nfapi_cqi_indication_t cqi_ind;
+									memset(&cqi_ind, 0, sizeof(cqi_ind));
+									cqi_ind.header.message_id = NFAPI_RX_CQI_INDICATION;
+									cqi_ind.header.phy_id = msg.header.phy_id;
+									cqi_ind.sfn_sf = msg.sfn_sf;
+									len = nfapi_p7_message_pack(&cqi_ind, buffer, buffer_size, 0);
+									send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+
+									nfapi_rach_indication_t rach_ind;
+									memset(&rach_ind, 0, sizeof(rach_ind));
+									rach_ind.header.message_id = NFAPI_RACH_INDICATION;
+									rach_ind.header.phy_id = msg.header.phy_id;
+									rach_ind.sfn_sf = msg.sfn_sf;
+									len = nfapi_p7_message_pack(&rach_ind, buffer, buffer_size, 0);
+									send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+
+									nfapi_srs_indication_t srs_ind;
+									memset(&srs_ind, 0, sizeof(srs_ind));
+									srs_ind.header.message_id = NFAPI_SRS_INDICATION;
+									srs_ind.header.phy_id = msg.header.phy_id;
+									srs_ind.sfn_sf = msg.sfn_sf;
+									len = nfapi_p7_message_pack(&srs_ind, buffer, buffer_size, 0);
+									send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+
+									nfapi_rx_indication_t rx_ind;
+									memset(&rx_ind, 0, sizeof(rx_ind));
+									rx_ind.header.message_id = NFAPI_RX_ULSCH_INDICATION;
+									rx_ind.header.phy_id = msg.header.phy_id;
+									rx_ind.sfn_sf = msg.sfn_sf;
+									len = nfapi_p7_message_pack(&rx_ind, buffer, buffer_size, 0);
+									send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+
+									if(msg.sfn_sf % 5 == 0)
+									{
+										// periodically send the timing info
+										nfapi_timing_info_t timing_info;
+										memset(&timing_info, 0, sizeof(timing_info));
+										timing_info.header.message_id = NFAPI_TIMING_INFO;
+										timing_info.header.phy_id = msg.header.phy_id;
+										len = nfapi_p7_message_pack(&timing_info, buffer, buffer_size, 0);
+										send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+									}
+									
+									nfapi_nb_harq_indication_t nb_harq_ind;
+									memset(&nb_harq_ind, 0, sizeof(nb_harq_ind));
+									nb_harq_ind.header.message_id = NFAPI_NB_HARQ_INDICATION;
+									nb_harq_ind.header.phy_id = msg.header.phy_id;
+									nb_harq_ind.sfn_sf = msg.sfn_sf;
+									len = nfapi_p7_message_pack(&nb_harq_ind, buffer, buffer_size, 0);
+									send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+
+									nfapi_nrach_indication_t nrach_ind;
+									memset(&nrach_ind, 0, sizeof(nrach_ind));
+									nrach_ind.header.message_id = NFAPI_NRACH_INDICATION;
+									nrach_ind.header.phy_id = msg.header.phy_id;
+									nrach_ind.sfn_sf = msg.sfn_sf;
+									len = nfapi_p7_message_pack(&nrach_ind, buffer, buffer_size, 0);
+									send_p7_segmented_msg(phy_info->p7_tx_sock, &buffer[0], len, segment_size, (struct sockaddr*)&phy_info->p7_tx_sockaddr, sizeof(phy_info->p7_tx_sockaddr));
+
+								}
+								break;
+							case NFAPI_UL_CONFIG_REQUEST:
+								{
+									nfapi_ul_config_request_t msg;
+									nfapi_p7_message_unpack(buffer, len, &msg, sizeof(msg), 0);
+									//printf("[PNF:%d] (%d/%d) NFAPI_UL_CONFIG_REQUEST\n", header.phy_id, SFNSF2SFN(msg.sfn_sf), SFNSF2SF(msg.sfn_sf));
+								}
+								break;
+							case NFAPI_HI_DCI0_REQUEST:
+								{
+									nfapi_hi_dci0_request_t msg;
+									nfapi_p7_message_unpack(buffer, len, &msg, sizeof(msg), 0);
+									//printf("[PNF:%d] (%d/%d) NFAPI_HI_DCI0_REQUEST\n", header.phy_id, SFNSF2SFN(msg.sfn_sf), SFNSF2SF(msg.sfn_sf));
+								}
+								break;
+							case NFAPI_TX_REQUEST:
+								{
+									nfapi_tx_request_t msg;
+									nfapi_p7_message_unpack(buffer, len, &msg, sizeof(msg), 0);
+									//printf("[PNF:%d] (%d/%d) NFAPI_TX_REQUEST\n", header.phy_id, SFNSF2SFN(msg.sfn_sf), SFNSF2SF(msg.sfn_sf));
+								}
+								break;
+						}
+					
+					}
+				}
+			}
+		}
+	}
+
+	printf("Triggering p5 shutdown\n");
+
+	// vnf p5 trigger shutdown
+	nfapi_pnf_stop_request_t stop_req;
+	memset(&stop_req, 0, sizeof(stop_req));
+	stop_req.header.message_id = NFAPI_PNF_STOP_REQUEST;
+	nfapi_vnf_pnf_stop_req(vnf_test_config[0].p5_vnf_config, 0, &stop_req);
+
+	phy_id = receive_pnf_stop_request(&pnf_test_config[0]);
+	send_pnf_stop_response(&pnf_test_config[0], phy_id);
+
+
+	nfapi_vnf_stop(vnf_test_config[0].p5_vnf_config);
+
+
+	
+	int* result;
+	pthread_join((vnf_test_config[0].thread), (void**)&result);
+	CU_ASSERT_EQUAL(result, 0);
+	//CU_ASSERT_EQUAL(pnf_connection_indication_called, 1);
+
+
+	close(pnf_test_config[0].p5_sock);
+}
+
+void vnf_test_start_connect_ipv6(void)
+{
+	char* vnf_addr = "::1";
+	int vnf_port = 4242;
+	pnf_connection_indication_called = 0;
+
+	nfapi_vnf_config_t* config = nfapi_vnf_config_create();
+	config->vnf_p5_port = vnf_port;
+	config->vnf_ipv4 = 0;
+	config->vnf_ipv6 = 1;
+	config->pnf_connection_indication = &pnf_connection_indication;
+	config->pnf_disconnect_indication = &pnf_disconnect_indication;
+	config->pnf_param_resp = &pnf_param_response;
+	config->pnf_config_resp = &pnf_config_response;
+	config->pnf_start_resp = &pnf_start_response;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &vnf_test_start_thread, config);
+
+	sleep(1);
+
+	
+	int p5Sock = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP);
+	
+	struct sockaddr_in6 addr;
+	addr.sin6_family = AF_INET6;
+	addr.sin6_port = htons(vnf_port);
+	//addr.sin6_addr = inet_addr(vnf_addr);
+	inet_pton(AF_INET6, vnf_addr, &addr.sin6_addr);
+
+
+	/*
+	int connect_result = connect(p5Sock, (struct sockaddr *)&addr, sizeof(addr) );
+
+	printf("connect_result %d %d\n", connect_result, errno);
+
+	receive_pnf_param_request(p5Sock);
+	send_pnf_param_response(p5Sock, &addr, sizeof(addr));
+
+	receive_pnf_config_request(p5Sock);
+	send_pnf_config_response(p5Sock, &addr, sizeof(addr));
+
+	receive_pnf_start_request(p5Sock);
+	send_pnf_start_response(p5Sock, &addr, sizeof(addr));
+	*/
+	sleep(4);
+	nfapi_vnf_stop(config);
+	
+	int* result;
+	pthread_join(thread, (void**)&result);
+	CU_ASSERT_EQUAL(result, 0);
+	CU_ASSERT_EQUAL(pnf_connection_indication_called, 1);
+
+
+	close(p5Sock);
+}
+void vnf_test_start_connect_2(void)
+{
+	char* vnf_addr = "127.0.0.1";
+	int vnf_port = 4242;
+	pnf_connection_indication_called = 0;
+
+	nfapi_vnf_config_t * config = nfapi_vnf_config_create();
+	config->vnf_p5_port = vnf_port;
+	config->pnf_connection_indication = &pnf_connection_indication;
+
+	pthread_t thread;
+	pthread_create(&thread, NULL, &vnf_test_start_thread, config);
+
+	sleep(1);
+
+	
+	
+	struct sockaddr_in addr;
+	addr.sin_family = AF_INET;
+	addr.sin_port = htons(vnf_port);
+	addr.sin_addr.s_addr = inet_addr(vnf_addr);
+
+	
+	int p5Sock1 = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP);
+
+	int connect_result_1 = connect(p5Sock1, (struct sockaddr *)&addr, sizeof(addr) );
+
+	printf("connect_result_1 %d %d\n", connect_result_1, errno);
+
+	int p5Sock2 = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP);
+
+	int connect_result_2 = connect(p5Sock2, (struct sockaddr *)&addr, sizeof(addr) );
+
+	printf("connect_result_2 %d %d\n", connect_result_2, errno);
+
+	sleep(1);
+
+	close(p5Sock1);
+
+	sleep(1);
+
+	close(p5Sock2);
+
+	sleep(1);
+
+	nfapi_vnf_stop(config);
+	
+	int* result;
+	pthread_join(thread, (void**)&result);
+	CU_ASSERT_EQUAL(result, 0);
+	CU_ASSERT_EQUAL(pnf_connection_indication_called, 2);
+
+
+	close(p5Sock1);
+	close(p5Sock2);
+}
+
+void vnf_test_p7_segmentation_test1(void)
+{
+
+}
+
+
+/************* Test Runner Code goes here **************/
+
+int main ( void )
+{
+   CU_pSuite pSuite = NULL;
+
+   /* initialize the CUnit test registry */
+   if ( CUE_SUCCESS != CU_initialize_registry() )
+      return CU_get_error();
+
+   /* add a suite to the registry */
+   pSuite = CU_add_suite( "vnf_test_suite", init_suite, clean_suite );
+   if ( NULL == pSuite ) 
+   {
+      CU_cleanup_registry();
+      return CU_get_error();
+   }
+
+        //(NULL == CU_add_test(pSuite, "vnf_test_start_connect_2", vnf_test_start_connect_2)) 
+   /* add the tests to the suite */
+   if ( (NULL == CU_add_test(pSuite, "vnf_test_start_no_config", vnf_test_start_no_config)) ||
+        (NULL == CU_add_test(pSuite, "vnf_test_start_connect", vnf_test_start_connect)) ||
+        (NULL == CU_add_test(pSuite, "vnf_test_p7_segmentation_test1", vnf_test_p7_segmentation_test1))
+      )
+   {
+      CU_cleanup_registry();
+      return CU_get_error();
+   }
+
+   // Run all tests using the basic interface
+   CU_basic_set_mode(CU_BRM_VERBOSE);
+   CU_set_output_filename("vnf_unit_test_results.xml");
+   CU_basic_run_tests();
+
+	CU_pSuite s = CU_get_registry()->pSuite;
+	int count = 0;
+	while(s)
+	{
+		CU_pTest t = s->pTest;
+		while(t)
+		{
+			count++;
+			t = t->pNext;
+		}
+		s = s->pNext;
+	}
+
+	printf("%d..%d\n", 1, count);
+
+
+
+	s = CU_get_registry()->pSuite;
+	count = 1;
+	while(s)
+	{
+		CU_pTest t = s->pTest;
+		while(t)
+		{
+			int pass = 1;
+			CU_FailureRecord* failures = CU_get_failure_list();
+			while(failures)
+			{
+				if(strcmp(failures->pSuite->pName, s->pName) == 0 &&
+				   strcmp(failures->pTest->pName, t->pName) == 0)
+				{
+					pass = 0;
+					failures = 0;
+				}
+				else
+				{
+					failures = failures->pNext;
+				}
+			}
+
+			if(pass)
+				printf("ok %d - %s:%s\n", count, s->pName, t->pName);
+			else 
+				printf("not ok %d - %s:%s\n", count, s->pName, t->pName);
+
+			count++;
+			t = t->pNext;
+		}
+		s = s->pNext;
+	}
+
+   CU_cleanup_registry();
+   return CU_get_error();
+
+}
diff --git a/nfapi/open-nFAPI/vnf_sim/Makefile.am b/nfapi/open-nFAPI/vnf_sim/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..c3e42cebf35fcb6d3744c5953a0c3f0daee0acb6
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf_sim/Makefile.am
@@ -0,0 +1,22 @@
+#
+# Copyright 2017 Cisco Systems, Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+
+AUTOMAKE_OPTIONS=subdir-objects
+AM_CPPFLAGS = -I$(top_srcdir)/vnf_sim/inc -I$(top_srcdir)/sim_common/inc -I$(top_srcdir)/common/public_inc -I$(top_srcdir)/nfapi/inc -I$(top_srcdir)/nfapi/public_inc -I$(top_srcdir)/vnf/inc -I$(top_srcdir)/vnf/public_inc $(XML_CFLAGS) -Wall -Werror -g
+AM_CXXFLAGS = -I$(top_srcidr)/vnf_sim/inc -I$(top_srcdir)/sim_common/inc -I$(top_srcdir)/common/public_inc -I$(top_srcdir)/nfapi/inc -I$(top_srcdir)/nfapi/public_inc -I$(top_srcdir)/vnf/inc -I$(top_srcdir)/vnf/public_inc $(XML_CFLAGS) -std=c++11 $(BOOST_CPPFLAGS) -g
+bin_PROGRAMS = vnfsim
+vnfsim_SOURCES = src/main.cpp src/mac.cpp
+LDADD= $(top_builddir)/vnf/libnfapi_vnf.a $(top_builddir)/common/libnfapi_common.a $(top_builddir)/nfapi/libnfapi.a $(top_builddir)/sim_common/libnfapi_sim_common.a -L$(libdir) -lpthread -lrt -lsctp -lz
diff --git a/nfapi/open-nFAPI/vnf_sim/inc/mac.h b/nfapi/open-nFAPI/vnf_sim/inc/mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..eac5b3b2ac5a854d9afb72462c3ed2c86a52a1b9
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf_sim/inc/mac.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MAC_H_
+#define _MAC_H_
+
+#include "nfapi_interface.h"
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+typedef struct mac mac_t;
+
+typedef struct mac
+{
+	void* user_data;
+
+	void (*dl_config_req)(mac_t* mac, nfapi_dl_config_request_t* req);
+	void (*ul_config_req)(mac_t* mac, nfapi_ul_config_request_t* req);
+	void (*hi_dci0_req)(mac_t* mac, nfapi_hi_dci0_request_t* req);
+	void (*tx_req)(mac_t* mac, nfapi_tx_request_t* req);
+} mac_t;
+
+mac_t* mac_create(uint8_t wireshark_test_mode);
+void mac_destroy(mac_t* mac);
+
+void mac_start_data(mac_t* mac, unsigned rx_port, const char* tx_addres, unsigned tx_port);
+
+void mac_subframe_ind(mac_t* mac, uint16_t phy_id, uint16_t sfn_sf);
+void mac_harq_ind(mac_t* mac, nfapi_harq_indication_t* ind);
+void mac_crc_ind(mac_t* mac, nfapi_crc_indication_t* ind);
+void mac_rx_ind(mac_t* mac, nfapi_rx_indication_t* ind);
+void mac_rach_ind(mac_t* mac, nfapi_rach_indication_t* ind);
+void mac_srs_ind(mac_t* mac, nfapi_srs_indication_t* ind);
+void mac_sr_ind(mac_t* mac, nfapi_sr_indication_t* ind);
+void mac_cqi_ind(mac_t* mac, nfapi_cqi_indication_t* ind);
+void mac_lbt_dl_ind(mac_t* mac, nfapi_lbt_dl_indication_t* ind);
+void mac_nb_harq_ind(mac_t* mac, nfapi_nb_harq_indication_t* ind);
+void mac_nrach_ind(mac_t* mac, nfapi_nrach_indication_t* ind);
+
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
diff --git a/nfapi/open-nFAPI/vnf_sim/src/mac.cpp b/nfapi/open-nFAPI/vnf_sim/src/mac.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..fa6f487be8e2274d55ac10c69b238070abfea6f6
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf_sim/src/mac.cpp
@@ -0,0 +1,1327 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "mac.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <vendor_ext.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <ifaddrs.h>
+#include <netdb.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#include <mutex>
+#include <queue>
+#include <list>
+
+uint32_t rand_range(uint32_t min, uint32_t max)
+{
+	return ((rand() % (max + 1 - min)) + min);
+}
+
+struct mac_pdu
+{
+	mac_pdu() : buffer_len(1500), buffer(0), len(0)
+	{
+		buffer = (char*) malloc(buffer_len);
+	}
+	
+	virtual ~mac_pdu()
+	{
+		free(buffer);
+	}
+
+	unsigned buffer_len;
+	char* buffer;
+	unsigned len;
+};
+
+class mac_private
+{
+		std::mutex mutex;
+		std::queue<mac_pdu*> rx_buffer;
+
+		std::queue<mac_pdu*> free_store;
+	public:
+
+		mac_private(bool _wireshark_test_mode)
+			: byte_count(0), tick(0), wireshark_test_mode(_wireshark_test_mode)
+		{
+
+		}
+
+		mac_pdu* allocate_mac_pdu()
+		{
+			mac_pdu* pdu = 0;
+			mutex.lock();
+			if(free_store.empty())
+			{
+				pdu = new mac_pdu();
+			}
+			else
+			{
+				pdu = free_store.front();
+				free_store.pop();
+			}
+			mutex.unlock();
+			return pdu;
+		}
+
+		void release_mac_pdu(mac_pdu* pdu)
+		{
+			mutex.lock();
+			free_store.push(pdu);
+			mutex.unlock();
+		}
+
+		
+
+		void push_rx_buffer(mac_pdu* buff)
+		{
+			mutex.lock();
+			rx_buffer.push(buff);
+			mutex.unlock();
+		}
+
+		mac_pdu* pop_rx_buffer()
+		{
+			mac_pdu* buff = 0;
+			mutex.lock();
+			if(!rx_buffer.empty())
+			{
+				buff = rx_buffer.front();
+				rx_buffer.pop();
+			}
+			mutex.unlock();
+			return buff;
+		}
+
+		uint32_t byte_count;
+		uint32_t tick;
+		
+		bool wireshark_test_mode;
+
+};
+
+extern "C"
+{
+	typedef struct {
+		mac_t _public;
+
+		int rx_sock;
+		int tx_sock;
+		struct sockaddr_in tx_addr;
+
+		uint32_t tx_byte_count;
+
+		mac_private* mac;
+		
+	} mac_internal_t;
+
+	mac_t* mac_create(uint8_t wireshark_test_mode)
+	{
+		mac_internal_t* instance = (mac_internal_t*)malloc(sizeof(mac_internal_t));
+		instance->mac = new mac_private((wireshark_test_mode >= 1));
+		return (mac_t*)instance;
+	}
+	
+	void mac_destroy(mac_t* mac)
+	{
+		mac_internal_t* instance = (mac_internal_t*)mac;
+		delete instance->mac;
+		free(instance);
+	}
+	
+	void* mac_rx_thread_start(void* ptr)
+	{
+		mac_internal_t* instance = (mac_internal_t*)ptr;
+
+		while(1)
+		{
+			mac_pdu* pdu = instance->mac->allocate_mac_pdu();
+			int len = recvfrom(instance->rx_sock, pdu->buffer, pdu->buffer_len, 0, 0, 0);
+			if(len > 0)
+			{
+				pdu->len = len;
+				instance->mac->push_rx_buffer(pdu);
+			}
+			else
+			{
+				instance->mac->release_mac_pdu(pdu);
+			}
+		}
+		return 0;
+	}
+
+	void mac_start_data(mac_t* mac, unsigned rx_port, const char* tx_address, unsigned tx_port)
+	{
+		mac_internal_t* instance = (mac_internal_t*)mac;
+
+		printf("[MAC] Rx Data from %d\n", rx_port);
+		printf("[MAC] Tx Data to %s.%d\n", tx_address, tx_port);
+
+		instance->rx_sock = socket(AF_INET, SOCK_DGRAM, 0);
+		
+		if(instance->rx_sock < 0)
+		{
+			printf("[MAC] Failed to create socket\n");
+			return;
+		}
+
+		struct sockaddr_in addr;
+		memset(&addr, 0, sizeof(0));
+		addr.sin_family = AF_INET;
+		addr.sin_port = htons(rx_port);
+		addr.sin_addr.s_addr = INADDR_ANY;
+		
+		if(bind(instance->rx_sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) < 0)
+		{
+			printf("[MAC] Failed to bind to %d\n", rx_port);
+			close(instance->rx_sock);
+			return;
+		}
+
+		pthread_t mac_rx_thread;
+		pthread_create(&mac_rx_thread, NULL, &mac_rx_thread_start, instance);
+
+		instance->tx_sock = socket(AF_INET, SOCK_DGRAM, 0);
+		instance->tx_addr.sin_family = AF_INET;
+		instance->tx_addr.sin_port = htons(tx_port);
+		instance->tx_addr.sin_addr.s_addr = inet_addr(tx_address);
+	}
+
+
+	
+	void generate_test_subframe(mac_t *mac, uint16_t phy_id, uint16_t sfn_sf)	
+	{
+		//mac_internal_t* instance = (mac_internal_t*)mac;
+		
+		uint8_t max_num_dl_pdus = 50;
+		nfapi_dl_config_request_pdu_t dl_config_pdus[max_num_dl_pdus];
+		memset(&dl_config_pdus, 0, sizeof(dl_config_pdus));
+		
+		nfapi_dl_config_request_t dl_config_req;
+		memset(&dl_config_req, 0, sizeof(dl_config_req));
+		dl_config_req.header.message_id = NFAPI_DL_CONFIG_REQUEST;
+		dl_config_req.header.phy_id = phy_id;
+		dl_config_req.sfn_sf = sfn_sf;
+		dl_config_req.dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
+		
+		dl_config_req.dl_config_request_body.number_pdu = rand_range(4, max_num_dl_pdus);
+		
+		uint16_t i = 0;
+		for(i = 0; i < dl_config_req.dl_config_request_body.number_pdu; ++i)
+		{
+			dl_config_pdus[i].pdu_type = rand_range(0, 11);
+			
+			switch(dl_config_pdus[i].pdu_type)
+			{
+				case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
+				{
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.dci_format = rand_range(0, 9);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx = rand_range(0, 255);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level  = rand_range(0, 32);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti = rand_range(0, (uint16_t)-1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.resource_allocation_type = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = rand_range(0, 320000);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = rand_range(0, 31);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = rand_range(0, 3);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.transport_block_to_codeword_swap_flag = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.mcs_2 = rand_range(0, 31);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_2 = rand_range(0, 31);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_2 = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.harq_process = rand_range(0, 31);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.tpmi = rand_range(0, 15);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.pmi = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.precoding_information = rand_range(0, 63);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.tpc = rand_range(0, 3);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.downlink_assignment_index = rand_range(0, 15);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.ngap = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.transport_block_size_index = rand_range(0, 31);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.downlink_power_offset = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.allocate_prach_flag = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.preamble_index = rand_range(0, 63);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.prach_mask_index = rand_range(0, 15);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = rand_range(0, 3);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = rand_range(0, 10000);		
+					
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel9.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG;
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel9.mcch_flag = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel9.mcch_change_notification = rand_range(0, 255);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel9.scrambling_identity = rand_range(0, 1);
+					
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG;
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel10.cross_carrier_scheduling_flag = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel10.carrier_indicator = rand_range(0, 7);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel10.srs_flag = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel10.srs_request = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel10.antenna_ports_scrambling_and_layers = rand_range(0, 15);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel10.total_dci_length_including_padding = rand_range(0, 255);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel10.n_dl_rb = rand_range(0, 100);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel11.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG;
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel11.harq_ack_resource_offset = rand_range(0, 3);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel11.pdsch_re_mapping_quasi_co_location_indicator = rand_range(0, 3);
+					
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel12.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG;
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel12.primary_cell_type = rand_range(0, 2);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel12.ul_dl_configuration_flag = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel12.number_ul_dl_configurations = 2;
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel12.ul_dl_configuration_indication[0] = rand_range(1, 5);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel12.ul_dl_configuration_indication[1] = rand_range(1, 5);
+					
+					
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG;
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.laa_end_partial_sf_flag = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.laa_end_partial_sf_configuration = rand_range(0, 255);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.initial_lbt_sf = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.codebook_size_determination = rand_range(0, 1);
+					dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.drms_table_flag = rand_range(0, 1);
+					
+					// if the tpm extention is present of not.
+					if(rand_range(0, 1))
+					{
+						dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm_struct_flag = rand_range(0, 1);
+						dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm.num_prb_per_subband = rand_range(0, 8);
+						dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm.number_of_subbands = rand_range(0, 13);
+						dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm.num_antennas = 1; // rand_range(0, 8);
+						
+						for(int j = 0; j < dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm.number_of_subbands; ++j)
+						{
+							dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[j].subband_index = j;
+							dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[j].scheduled_ues = 1; //rand_range(1, 4);
+							
+							for(int k = 0; k < dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm.num_antennas; ++k)
+								for(int l = 0; l < dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[j].scheduled_ues; ++l)
+									dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm.subband_info[j].precoding_value[k][l] = rand_range(0, 65535);
+						}
+					}
+					else
+					{
+						dl_config_pdus[i].dci_dl_pdu.dci_dl_pdu_rel13.tpm_struct_flag = 0;
+					}
+					
+				}
+				break;
+				
+				case NFAPI_DL_CONFIG_BCH_PDU_TYPE:
+				{
+					dl_config_pdus[i].bch_pdu.bch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG;
+					dl_config_pdus[i].bch_pdu.bch_pdu_rel8.length = rand_range(0, 42);
+					dl_config_pdus[i].bch_pdu.bch_pdu_rel8.pdu_index = rand_range(0, 65535);
+					dl_config_pdus[i].bch_pdu.bch_pdu_rel8.transmission_power = rand_range(0, 10000);
+				}
+				break;
+				
+				case NFAPI_DL_CONFIG_MCH_PDU_TYPE:
+				{
+					dl_config_pdus[i].mch_pdu.mch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG;
+					dl_config_pdus[i].mch_pdu.mch_pdu_rel8.length = rand_range(0, 42);
+					dl_config_pdus[i].mch_pdu.mch_pdu_rel8.pdu_index = rand_range(0, 65535);
+					dl_config_pdus[i].mch_pdu.mch_pdu_rel8.rnti = 0xFFFD;
+					dl_config_pdus[i].mch_pdu.mch_pdu_rel8.resource_allocation_type = 0;
+					dl_config_pdus[i].mch_pdu.mch_pdu_rel8.resource_block_coding = 0;
+					dl_config_pdus[i].mch_pdu.mch_pdu_rel8.modulation = rand_range(0, 8);
+					dl_config_pdus[i].mch_pdu.mch_pdu_rel8.transmission_power = rand_range(0, 10000);
+					dl_config_pdus[i].mch_pdu.mch_pdu_rel8.mbsfn_area_id = rand_range(0, 255);
+				}
+				break;
+			
+				case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE:
+				{
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.length = rand_range(0, 42);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.pdu_index = rand_range(0, 65535);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.rnti = rand_range(1, 65535);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = rand_range(0, 5);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = rand_range(0, 32000);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.modulation = rand_range(2, 8);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.redundancy_version = rand_range(0, 3);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.transport_blocks = rand_range(1, 2);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = rand_range(0, 13);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.number_of_layers = rand_range(1, 8);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 2; //rand_range(0, 13);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.codebook_index[0] = rand_range(0, 15);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.codebook_index[1] = rand_range(0, 15);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = rand_range(0, 14);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.pa = rand_range(0, 7);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.ngap = rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.nprb = rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.transmission_mode = rand_range(1, 10);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 2; //rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 2; //rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.bf_vector[0].subband_index = rand_range(0, 4);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.bf_vector[0].num_antennas = 1;	
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.bf_vector[0].bf_value[0] = rand_range(0, 128);	
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.bf_vector[1].subband_index = rand_range(0, 4);	
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.bf_vector[1].num_antennas = 1;
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel8.bf_vector[1].bf_value[0] = rand_range(0, 128);	
+					
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel9.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG;
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel9.nscid = rand_range(0, 1);	
+					
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel10.csi_rs_flag = rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel10.csi_rs_resource_config_r10 = 0;
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel10.csi_rs_zero_tx_power_resource_config_bitmap_r10 = rand_range(0, 65535);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel10.csi_rs_number_nzp_configuration = 1;
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel10.csi_rs_resource_config[0] = rand_range(0, 31);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel10.pdsch_start = rand_range(0, 4);		
+					
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel11.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG;
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel11.drms_config_flag = rand_range(0, 1);	
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel11.drms_scrambling = rand_range(0, 503);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel11.csi_config_flag = rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel11.csi_scrambling = rand_range(0, 503);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel11.pdsch_re_mapping_flag = rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel11.pdsch_re_mapping_atenna_ports = rand_range(1,4);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel11.pdsch_re_mapping_freq_shift = rand_range(0, 5);
+					
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel12.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG;
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel12.altcqi_table_r12 = rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel12.maxlayers = rand_range(1, 8);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel12.n_dl_harq = rand_range(0, 255);
+					
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel13.dwpts_symbols = rand_range(3, 14);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel13.initial_lbt_sf = rand_range(0, 1);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel13.ue_type = rand_range(0, 2);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = rand_range(0, 2);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = rand_range(0, 10239);
+					dl_config_pdus[i].dlsch_pdu.dlsch_pdu_rel13.drms_table_flag = rand_range(0, 1);
+				}
+				break;
+			
+				case NFAPI_DL_CONFIG_PCH_PDU_TYPE:
+				{
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG;
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.length = rand_range(0, 42);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.pdu_index = rand_range(0, 65535);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.p_rnti = 0xFFFE;
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.resource_allocation_type = rand_range(2, 6);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.virtual_resource_block_assignment_flag = rand_range(0, 1);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.resource_block_coding = rand_range(0, 34000);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.mcs = 0;
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.redundancy_version = 0;
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.number_of_transport_blocks = 1;
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.transmission_scheme = rand_range(1, 6);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.number_of_layers = rand_range(1, 4);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.codebook_index = 0;
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.ue_category_capacity = rand_range(0, 14);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.pa = rand_range(0, 7);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.transmission_power = rand_range(0, 10000);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.nprb = rand_range(0, 1);
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel8.ngap = rand_range(0, 1);	
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG;
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel13.ue_mode = rand_range(0, 1);	
+					dl_config_pdus[i].pch_pdu.pch_pdu_rel13.initial_transmission_sf_io = rand_range(0, 10239);
+				}
+				break;
+			
+				case NFAPI_DL_CONFIG_PRS_PDU_TYPE:
+				{
+					dl_config_pdus[i].prs_pdu.prs_pdu_rel9.tl.tag = NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG;
+					dl_config_pdus[i].prs_pdu.prs_pdu_rel9.transmission_power = rand_range(0, 10000);	
+					dl_config_pdus[i].prs_pdu.prs_pdu_rel9.prs_bandwidth = rand_range(6, 100);
+					dl_config_pdus[i].prs_pdu.prs_pdu_rel9.prs_cyclic_prefix_type = rand_range(0, 1);
+					dl_config_pdus[i].prs_pdu.prs_pdu_rel9.prs_muting = rand_range(0, 1);
+				}
+				break;
+	
+				case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE:
+				{
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG;
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel10.csi_rs_antenna_port_count_r10 = rand_range(1, 16);
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel10.csi_rs_resource_config_r10 = 0;
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel10.transmission_power = rand_range(0, 10000);
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel10.csi_rs_zero_tx_power_resource_config_bitmap_r10 = rand_range(0, 8);
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel10.csi_rs_number_of_nzp_configuration = 2;
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel10.csi_rs_resource_config[0] = rand_range(0, 31);
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel10.csi_rs_resource_config[1] = rand_range(0, 31);
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG;
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel13.csi_rs_class = rand_range(0, 2);
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel13.cdm_type = rand_range(0, 1);
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel13.num_bf_vector = 0; // set to zero as not clear how to handle bf value array
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel13.bf_vector[0].csi_rs_resource_index = rand_range(0, 7);
+					dl_config_pdus[i].csi_rs_pdu.csi_rs_pdu_rel13.bf_vector[0].bf_value[0] = 42;
+				}
+				break;
+	
+				case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE:
+				{
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG;
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.dci_format = rand_range(0, 9);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.cce_idx = rand_range(0, 255);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.aggregation_level  = rand_range(0, 32);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.rnti = rand_range(0, (uint16_t)-1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.resource_allocation_type = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.virtual_resource_block_assignment_flag = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.resource_block_coding = rand_range(0, 320000);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.mcs_1 = rand_range(0, 31);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.redundancy_version_1 = rand_range(0, 3);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.new_data_indicator_1 = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.transport_block_to_codeword_swap_flag = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.mcs_2 = rand_range(0, 31);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.redundancy_version_2 = rand_range(0, 31);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.new_data_indicator_2 = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.harq_process = rand_range(0, 31);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.tpmi = rand_range(0, 15);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.pmi = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.precoding_information = rand_range(0, 63);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.tpc = rand_range(0, 3);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.downlink_assignment_index = rand_range(0, 15);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.ngap = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.transport_block_size_index = rand_range(0, 31);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.downlink_power_offset = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.allocate_prach_flag = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.preamble_index = rand_range(0, 63);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.prach_mask_index = rand_range(0, 15);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.rnti_type = rand_range(0, 3);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel8.transmission_power = rand_range(0, 10000);	
+					
+					
+					
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel9.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG;
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel9.mcch_flag = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel9.mcch_change_notification = rand_range(0, 255);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel9.scrambling_identity = rand_range(0, 1);
+					
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG;
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel10.cross_carrier_scheduling_flag = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel10.carrier_indicator = rand_range(0, 7);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel10.srs_flag = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel10.srs_request = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel10.antenna_ports_scrambling_and_layers = rand_range(0, 15);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel10.total_dci_length_including_padding = rand_range(0, 255);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel10.n_dl_rb = rand_range(0, 100);
+					
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel11.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG;
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel11.harq_ack_resource_offset = rand_range(0, 3);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel11.pdsch_re_mapping_quasi_co_location_indicator = rand_range(0, 3);
+					
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel12.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG;
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel12.primary_cell_type = rand_range(0, 2);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel12.ul_dl_configuration_flag = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel12.number_ul_dl_configurations = 2;
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel12.ul_dl_configuration_indication[0] = rand_range(1, 5);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel12.ul_dl_configuration_indication[1] = rand_range(1, 5);
+					
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG;
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel13.laa_end_partial_sf_flag = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel13.laa_end_partial_sf_configuration = rand_range(0, 255);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel13.initial_lbt_sf = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel13.codebook_size_determination = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_pdu_rel13.drms_table_flag = rand_range(0, 1);
+
+					dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG;
+					dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.epdcch_resource_assignment_flag = rand_range(0, 1);
+					dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.epdcch_id = rand_range(0, 503);
+					dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.epdcch_start_symbol = rand_range(1, 4);
+					dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.epdcch_num_prb = rand_range(2, 8);
+					for(int j = 0; j < dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.epdcch_num_prb; ++j)
+						dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.epdcch_prb_index[j] = rand_range(0, 99);
+					dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.bf_vector.subband_index = rand_range(0, 25);	
+					dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.bf_vector.num_antennas= rand_range(1, 4);
+					for(int j = 0; j < dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.epdcch_num_prb; ++j)
+						dl_config_pdus[i].epdcch_pdu.epdcch_params_rel11.bf_vector.bf_value[j] = rand_range(0, 65535);
+					
+	
+					dl_config_pdus[i].epdcch_pdu.epdcch_params_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG;
+					dl_config_pdus[i].epdcch_pdu.epdcch_params_rel13.dwpts_symbols = rand_range(3, 14);
+					dl_config_pdus[i].epdcch_pdu.epdcch_params_rel13.initial_lbt_sf = rand_range(0, 1);
+				}
+				break;
+				
+				case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE:
+				{
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG;
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band = rand_range(0, 15);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = rand_range(2, 6);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = rand_range(0, 14);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = rand_range(0, 1);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = rand_range(1, 4);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = rand_range(0, 22);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = rand_range(2, 24);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = rand_range(0, 4);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.rnti = rand_range(1, 65535);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.ce_mode = rand_range(1, 2);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.drms_scrambling_init = rand_range(0, 503);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.initial_transmission_sf_io = rand_range(0, 10239);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.transmission_power = rand_range(0, 10000);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.dci_format = rand_range(10, 12);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = rand_range(0, 0xFFFF);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.mcs = rand_range(0, 15);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = rand_range(1, 8);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = rand_range(0, 3);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = rand_range(0, 1);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.harq_process = rand_range(0, 15);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = rand_range(0, 4);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.tpmi = rand_range(0, 15);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = rand_range(0, 1);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.pmi = rand_range(0, 1);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.harq_resource_offset = rand_range(0, 3);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.dci_subframe_repetition_number = rand_range(1, 4);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.tpc = rand_range(0, 3);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index_length = rand_range(0, 4);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index = rand_range(0, 15);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.allocate_prach_flag = rand_range(0, 63);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.preamble_index = rand_range(0, 15);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.prach_mask_index = rand_range(0, 3);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.starting_ce_level = rand_range(0, 1);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.srs_request = rand_range(0, 1);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity_flag = rand_range(0, 1);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity = rand_range(0, 3);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.frequency_hopping_enabled_flag = rand_range(0, 1);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.paging_direct_indication_differentiation_flag = rand_range(0, 1);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.direct_indication = rand_range(0, 255);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.total_dci_length_including_padding = rand_range(0, 1);
+					dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = rand_range(0, 8);
+					for(int j = 0 ; j < dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports; ++j)
+						dl_config_pdus[i].mpdcch_pdu.mpdcch_pdu_rel13.precoding_value[j] = rand_range(0, 65535);
+				}
+				break;
+				
+				case NFAPI_DL_CONFIG_NBCH_PDU_TYPE:
+				{
+					dl_config_pdus[i].nbch_pdu.nbch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG;
+					dl_config_pdus[i].nbch_pdu.nbch_pdu_rel13.length = rand_range(0, 5555);
+					dl_config_pdus[i].nbch_pdu.nbch_pdu_rel13.pdu_index = rand_range(0, 65535);
+					dl_config_pdus[i].nbch_pdu.nbch_pdu_rel13.transmission_power = rand_range(0, 10000);
+					dl_config_pdus[i].nbch_pdu.nbch_pdu_rel13.hyper_sfn_2_lsbs = rand_range(0, 3);
+				}
+				break;
+				
+				case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE:
+				{
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG;
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.length = rand_range(0, 5555);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.pdu_index = rand_range(0, 65535);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.ncce_index = rand_range(0, 1);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.aggregation_level = rand_range(1, 2);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.start_symbol = rand_range(0, 4);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.rnti_type = rand_range(0, 3);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.rnti = rand_range(1, 65535);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.scrambling_reinitialization_batch_index = rand_range(1, 4);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.nrs_antenna_ports_assumed_by_the_ue = rand_range(1, 2);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.dci_format = rand_range(0, 1);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.scheduling_delay = rand_range(0, 7);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.resource_assignment = rand_range(0, 7);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.repetition_number = rand_range(0, 15); 
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.mcs = rand_range(0, 13);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.new_data_indicator = rand_range(0, 1);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource = rand_range(0, 15);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.npdcch_order_indication = rand_range(0, 1);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.starting_number_of_nprach_repetitions = rand_range(0, 3);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.subcarrier_indication_of_nprach = rand_range(0, 63);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.paging_direct_indication_differentation_flag = rand_range(0, 1);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.direct_indication = rand_range(0, 255);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number  = rand_range(0, 7);
+					dl_config_pdus[i].npdcch_pdu.npdcch_pdu_rel13.total_dci_length_including_padding = rand_range(0, 255);
+				}
+				break;
+				
+				case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE:
+				{
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG;
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.length = rand_range(0, 5555);
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.pdu_index = rand_range(0, 65535);
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.start_symbol = rand_range(0, 4);
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.rnti_type = rand_range(0, 1);
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.rnti = rand_range(1, 65535);
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.resource_assignment = rand_range(0, 7);
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.repetition_number = rand_range(0, 15);
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.modulation = 2;
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.number_of_subframes_for_resource_assignment = rand_range(1, 10);
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.scrambling_sequence_initialization_cinit = rand_range(0, 65535);
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.sf_idx = rand_range(1, 10240);
+					dl_config_pdus[i].ndlsch_pdu.ndlsch_pdu_rel13.nrs_antenna_ports_assumed_by_the_ue = rand_range(1, 2);
+				}
+				break;
+				
+			};
+		}
+
+
+		dl_config_req.dl_config_request_body.dl_config_pdu_list = dl_config_pdus;		
+		mac->dl_config_req(mac, &dl_config_req);
+		
+		uint8_t num_ul_pdus = 18;
+		nfapi_ul_config_request_pdu_t ul_config_pdus[num_ul_pdus];
+		memset(&ul_config_pdus, 0, sizeof(ul_config_pdus));
+		
+		nfapi_ul_config_request_t ul_config_req;
+		memset(&ul_config_req, 0, sizeof(ul_config_req));
+		ul_config_req.header.message_id = NFAPI_UL_CONFIG_REQUEST;
+		ul_config_req.header.phy_id = phy_id;
+		ul_config_req.sfn_sf = sfn_sf;
+		ul_config_req.ul_config_request_body.tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
+		ul_config_req.ul_config_request_body.number_of_pdus = num_ul_pdus;
+		ul_config_req.ul_config_request_body.rach_prach_frequency_resources = rand_range(0, 255);
+		ul_config_req.ul_config_request_body.srs_present = rand_range(0, 1);
+		
+		auto ul_config_ulsch_pdu_test_gen = [](nfapi_ul_config_ulsch_pdu& ulsch_pdu)
+		{
+			ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
+			ulsch_pdu.ulsch_pdu_rel8.handle = rand_range(0, 50000);
+			ulsch_pdu.ulsch_pdu_rel8.size = rand_range(0, 32000);
+			ulsch_pdu.ulsch_pdu_rel8.rnti = rand_range(1, 65535);
+			ulsch_pdu.ulsch_pdu_rel8.resource_block_start = rand_range(0, 99);
+			ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = rand_range(1, 100);
+			ulsch_pdu.ulsch_pdu_rel8.modulation_type = rand_range(2, 6);
+			ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = rand_range(0, 7);
+			ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = rand_range(0, 1);
+			ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = rand_range(0, 3);
+			ulsch_pdu.ulsch_pdu_rel8.new_data_indication = rand_range(0, 1);
+			ulsch_pdu.ulsch_pdu_rel8.redundancy_version = rand_range(0, 3);
+			ulsch_pdu.ulsch_pdu_rel8.harq_process_number = rand_range(0, 15);
+			ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = rand_range(0, 1);
+			ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = rand_range(0, 5);
+			ulsch_pdu.ulsch_pdu_rel8.n_srs = rand_range(0, 1);
+			ulsch_pdu.ulsch_pdu_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG;
+			ulsch_pdu.ulsch_pdu_rel10.resource_allocation_type = rand_range(0, 1);
+			ulsch_pdu.ulsch_pdu_rel10.resource_block_coding = rand_range(0, 35000);
+			ulsch_pdu.ulsch_pdu_rel10.transport_blocks = rand_range(1, 2);
+			ulsch_pdu.ulsch_pdu_rel10.transmission_scheme = rand_range(0, 1);
+			ulsch_pdu.ulsch_pdu_rel10.number_of_layers = rand_range(1, 4);
+			ulsch_pdu.ulsch_pdu_rel10.codebook_index = rand_range(0, 23);
+			ulsch_pdu.ulsch_pdu_rel10.disable_sequence_hopping_flag = rand_range(0, 1);		
+			ulsch_pdu.ulsch_pdu_rel11.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG;
+			ulsch_pdu.ulsch_pdu_rel11.virtual_cell_id_enabled_flag = rand_range(0, 1);
+			ulsch_pdu.ulsch_pdu_rel11.npusch_identity = rand_range(0, 509);
+			ulsch_pdu.ulsch_pdu_rel11.dmrs_config_flag = rand_range(0, 1);
+			ulsch_pdu.ulsch_pdu_rel11.ndmrs_csh_identity = rand_range(0, 509);
+			ulsch_pdu.ulsch_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG;
+			ulsch_pdu.ulsch_pdu_rel13.ue_type = rand_range(0, 2);
+			ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = rand_range(1, 2048);
+			ulsch_pdu.ulsch_pdu_rel13.repetition_number = rand_range(1, 2048);
+			ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = rand_range(0, 10239);
+			ulsch_pdu.ulsch_pdu_rel13.empty_symbols_due_to_re_tunning = rand_range(0, 8);
+		};
+		
+		auto ul_config_cqi_ri_info_test_gen = [](nfapi_ul_config_cqi_ri_information& cqi_ri_information)
+		{
+			cqi_ri_information.cqi_ri_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG;
+			cqi_ri_information.cqi_ri_information_rel8.dl_cqi_pmi_size_rank_1 = rand_range(0, 255);
+			cqi_ri_information.cqi_ri_information_rel8.dl_cqi_pmi_size_rank_greater_1 = rand_range(0, 255);
+			cqi_ri_information.cqi_ri_information_rel8.ri_size = rand_range(0, 3);
+			cqi_ri_information.cqi_ri_information_rel8.delta_offset_cqi = rand_range(0, 15);
+			cqi_ri_information.cqi_ri_information_rel8.delta_offset_ri = rand_range(0, 15);
+
+			cqi_ri_information.cqi_ri_information_rel9.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG;
+			cqi_ri_information.cqi_ri_information_rel9.report_type = 1; // rand_range(0, 1);
+			cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = rand_range(0, 15);
+			cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = rand_range(0, 15);
+			
+			if(cqi_ri_information.cqi_ri_information_rel9.report_type == 0)
+			{
+				cqi_ri_information.cqi_ri_information_rel9.periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size = rand_range(0, 255);
+				cqi_ri_information.cqi_ri_information_rel9.periodic_cqi_pmi_ri_report.control_type = rand_range(0, 1);
+			}
+			else
+			{
+				cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1;
+				cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = rand_range(0, 3);
+				cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0] = rand_range(0, 255);
+			}
+			
+			cqi_ri_information.cqi_ri_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG;
+			cqi_ri_information.cqi_ri_information_rel13.report_type = rand_range(0, 1);
+			
+			if(cqi_ri_information.cqi_ri_information_rel13.report_type == 0)
+			{
+				cqi_ri_information.cqi_ri_information_rel13.periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size_2 = rand_range(255, 10000);
+			}
+		};
+		
+		auto ul_config_init_tx_params_test_gen = [](nfapi_ul_config_initial_transmission_parameters& initial_transmission_parameters)
+		{
+			initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG;
+			initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = rand_range(0, 1);
+			initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = rand_range(1, 100);
+		};
+		
+		auto ul_config_harqinfo_test_gen = [](nfapi_ul_config_ulsch_harq_information& harq_information)
+		{
+			harq_information.harq_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG;
+			harq_information.harq_information_rel10.harq_size = rand_range(0, 21);
+			harq_information.harq_information_rel10.delta_offset_harq = rand_range(0, 15);
+			harq_information.harq_information_rel10.ack_nack_mode = rand_range(0, 5);
+			harq_information.harq_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG;
+			harq_information.harq_information_rel13.harq_size_2 = rand_range(0, 21);
+			harq_information.harq_information_rel13.delta_offset_harq_2 = rand_range(0, 15);	
+		};
+
+		auto ul_config_sr_info_test_gen = [](nfapi_ul_config_sr_information& sr_info)
+		{
+			sr_info.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG;
+			sr_info.sr_information_rel8.pucch_index = rand_range(0, 2047);
+			sr_info.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG;
+			sr_info.sr_information_rel10.number_of_pucch_resources = rand_range(1, 2);
+			sr_info.sr_information_rel10.pucch_index_p1 = rand_range(0, 2047);
+		};
+		
+		auto ul_config_ue_info_test_gen = [](nfapi_ul_config_ue_information& ue_information)
+		{
+			ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
+			ue_information.ue_information_rel8.handle = rand_range(0, 99999);
+			ue_information.ue_information_rel8.rnti = rand_range(1, 65535);
+			ue_information.ue_information_rel11.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG;
+			ue_information.ue_information_rel11.virtual_cell_id_enabled_flag = rand_range(0, 1);
+			ue_information.ue_information_rel11.npusch_identity = rand_range(0, 503);
+			ue_information.ue_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG;
+			ue_information.ue_information_rel13.ue_type = rand_range(0, 2);
+			ue_information.ue_information_rel13.empty_symbols = rand_range(0, 2);
+			ue_information.ue_information_rel13.total_number_of_repetitions = rand_range(1, 32);
+			ue_information.ue_information_rel13.repetition_number = rand_range(1, 32);
+		};
+		
+		auto ul_config_cqi_info_test_gen = [](nfapi_ul_config_cqi_information& cqi_information)
+		{
+			cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
+			cqi_information.cqi_information_rel8.pucch_index = rand_range(0, 1184);
+			cqi_information.cqi_information_rel8.dl_cqi_pmi_size = rand_range(0, 255);
+			cqi_information.cqi_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG;
+			cqi_information.cqi_information_rel10.number_of_pucch_resource = rand_range(1, 2);
+			cqi_information.cqi_information_rel10.pucch_index_p1 = rand_range(0, 1184);
+			cqi_information.cqi_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG;
+			cqi_information.cqi_information_rel13.csi_mode = rand_range(0, 2);
+			cqi_information.cqi_information_rel13.dl_cqi_pmi_size_2 = rand_range(0, 999);
+			cqi_information.cqi_information_rel13.starting_prb = rand_range(0, 109);
+			cqi_information.cqi_information_rel13.n_prb = rand_range(0, 7);
+			cqi_information.cqi_information_rel13.cdm_index = rand_range(0, 1);
+			cqi_information.cqi_information_rel13.n_srs = rand_range(0, 1);
+		};
+		
+		auto ul_config_harq_info_test_gen = [](nfapi_ul_config_harq_information& harq_information)
+		{
+			harq_information.harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG;
+			harq_information.harq_information_rel10_tdd.harq_size = rand_range(0, 21);
+			harq_information.harq_information_rel10_tdd.ack_nack_mode = rand_range(0, 5);
+			harq_information.harq_information_rel10_tdd.number_of_pucch_resources = rand_range(0, 4);
+			harq_information.harq_information_rel10_tdd.n_pucch_1_0 = rand_range(0, 2047);
+			harq_information.harq_information_rel10_tdd.n_pucch_1_1 = rand_range(0, 2047);
+			harq_information.harq_information_rel10_tdd.n_pucch_1_2 = rand_range(0, 2047);
+			harq_information.harq_information_rel10_tdd.n_pucch_1_3 = rand_range(0, 2047);
+			harq_information.harq_information_rel8_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG;
+			harq_information.harq_information_rel8_fdd.n_pucch_1_0 = rand_range(0, 2047);
+			harq_information.harq_information_rel8_fdd.harq_size = rand_range(1, 2);
+			harq_information.harq_information_rel9_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG;
+			harq_information.harq_information_rel9_fdd.harq_size = rand_range(1, 10);
+			harq_information.harq_information_rel9_fdd.ack_nack_mode = rand_range(0, 4);
+			harq_information.harq_information_rel9_fdd.number_of_pucch_resources = rand_range(0, 4);
+			harq_information.harq_information_rel9_fdd.n_pucch_1_0 = rand_range(0, 2047);
+			harq_information.harq_information_rel9_fdd.n_pucch_1_1 = rand_range(0, 2047);
+			harq_information.harq_information_rel9_fdd.n_pucch_1_2 = rand_range(0, 2047);
+			harq_information.harq_information_rel9_fdd.n_pucch_1_3 = rand_range(0, 2047);
+			harq_information.harq_information_rel11.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG;
+			harq_information.harq_information_rel11.num_ant_ports = rand_range(1, 2);
+			harq_information.harq_information_rel11.n_pucch_2_0 = rand_range(0, 2047);
+			harq_information.harq_information_rel11.n_pucch_2_1 = rand_range(0, 2047);
+			harq_information.harq_information_rel11.n_pucch_2_2 = rand_range(0, 2047);
+			harq_information.harq_information_rel11.n_pucch_2_3 = rand_range(0, 2047);
+			harq_information.harq_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG;
+			harq_information.harq_information_rel13.harq_size_2 = rand_range(0, 999);
+			harq_information.harq_information_rel13.starting_prb = rand_range(0, 109);
+			harq_information.harq_information_rel13.n_prb = rand_range(0, 7);
+			harq_information.harq_information_rel13.cdm_index = rand_range(0, 1);
+			harq_information.harq_information_rel13.n_srs = rand_range(0, 1);
+		};		
+		
+		
+		ul_config_pdus[0].pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
+		ul_config_ulsch_pdu_test_gen(ul_config_pdus[0].ulsch_pdu);
+
+		ul_config_pdus[1].pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE;
+		ul_config_ulsch_pdu_test_gen(ul_config_pdus[1].ulsch_cqi_ri_pdu.ulsch_pdu);
+		ul_config_cqi_ri_info_test_gen(ul_config_pdus[1].ulsch_cqi_ri_pdu.cqi_ri_information);
+		ul_config_init_tx_params_test_gen(ul_config_pdus[1].ulsch_cqi_ri_pdu.initial_transmission_parameters);	
+
+		ul_config_pdus[2].pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE;
+		ul_config_ulsch_pdu_test_gen(ul_config_pdus[2].ulsch_harq_pdu.ulsch_pdu);
+		ul_config_harqinfo_test_gen(ul_config_pdus[2].ulsch_harq_pdu.harq_information);
+		ul_config_init_tx_params_test_gen(ul_config_pdus[2].ulsch_harq_pdu.initial_transmission_parameters);
+		
+		ul_config_pdus[3].pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE;
+		ul_config_ulsch_pdu_test_gen(ul_config_pdus[3].ulsch_cqi_harq_ri_pdu.ulsch_pdu);		
+		ul_config_cqi_ri_info_test_gen(ul_config_pdus[3].ulsch_cqi_harq_ri_pdu.cqi_ri_information);	
+		ul_config_harqinfo_test_gen(ul_config_pdus[3].ulsch_cqi_harq_ri_pdu.harq_information);
+		ul_config_init_tx_params_test_gen(ul_config_pdus[3].ulsch_cqi_harq_ri_pdu.initial_transmission_parameters);
+		
+		
+		ul_config_pdus[4].pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
+		ul_config_ue_info_test_gen(ul_config_pdus[4].uci_cqi_pdu.ue_information);
+		ul_config_cqi_info_test_gen(ul_config_pdus[4].uci_cqi_pdu.cqi_information);
+
+		ul_config_pdus[5].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE;
+		ul_config_ue_info_test_gen(ul_config_pdus[5].uci_sr_pdu.ue_information);
+		ul_config_sr_info_test_gen(ul_config_pdus[5].uci_sr_pdu.sr_information);
+
+		
+		ul_config_pdus[6].pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE;
+		ul_config_ue_info_test_gen(ul_config_pdus[6].uci_harq_pdu.ue_information);
+		ul_config_harq_info_test_gen(ul_config_pdus[6].uci_harq_pdu.harq_information);
+		
+		
+		ul_config_pdus[7].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE;
+		ul_config_ue_info_test_gen(ul_config_pdus[7].uci_sr_harq_pdu.ue_information);
+		ul_config_sr_info_test_gen(ul_config_pdus[7].uci_sr_harq_pdu.sr_information);
+		ul_config_harq_info_test_gen(ul_config_pdus[7].uci_sr_harq_pdu.harq_information);
+		
+		ul_config_pdus[8].pdu_type = NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE;
+		ul_config_ue_info_test_gen(ul_config_pdus[8].uci_cqi_harq_pdu.ue_information);
+		ul_config_cqi_info_test_gen(ul_config_pdus[8].uci_cqi_harq_pdu.cqi_information);
+		ul_config_harq_info_test_gen(ul_config_pdus[8].uci_cqi_harq_pdu.harq_information);
+		
+		ul_config_pdus[9].pdu_type = NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE;
+		ul_config_ue_info_test_gen(ul_config_pdus[9].uci_cqi_sr_pdu.ue_information);
+		ul_config_cqi_info_test_gen(ul_config_pdus[9].uci_cqi_sr_pdu.cqi_information);
+		ul_config_sr_info_test_gen(ul_config_pdus[9].uci_cqi_sr_pdu.sr_information);
+		
+		ul_config_pdus[10].pdu_type = NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE;
+		ul_config_ue_info_test_gen(ul_config_pdus[10].uci_cqi_sr_harq_pdu.ue_information);
+		ul_config_cqi_info_test_gen(ul_config_pdus[10].uci_cqi_sr_harq_pdu.cqi_information);
+		ul_config_sr_info_test_gen(ul_config_pdus[10].uci_cqi_sr_harq_pdu.sr_information);
+		ul_config_harq_info_test_gen(ul_config_pdus[10].uci_cqi_sr_harq_pdu.harq_information);
+		
+		ul_config_pdus[11].pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE;
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG;
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel8.handle = rand_range(0, 9999);
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel8.size = rand_range(1, 999);
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel8.rnti = rand_range(1, 65535);
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel8.srs_bandwidth = rand_range(0, 3);
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel8.frequency_domain_position = rand_range(0, 23);
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = rand_range(0, 3);
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel8.transmission_comb = rand_range(0, 3);
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel8.i_srs = rand_range(0, 1023);
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = rand_range(0, 11);
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG;
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel10.antenna_port = rand_range(0, 2);
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG;
+		ul_config_pdus[11].srs_pdu.srs_pdu_rel13.number_of_combs = rand_range(0, 1);
+		
+		ul_config_pdus[12].pdu_type = NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE;
+		ul_config_ue_info_test_gen(ul_config_pdus[12].harq_buffer_pdu.ue_information);		
+		
+		ul_config_pdus[13].pdu_type = NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE;
+		ul_config_ulsch_pdu_test_gen(ul_config_pdus[13].ulsch_uci_csi_pdu.ulsch_pdu);
+		ul_config_cqi_info_test_gen(ul_config_pdus[13].ulsch_uci_csi_pdu.csi_information);
+		
+		ul_config_pdus[14].pdu_type = NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE;
+		ul_config_ulsch_pdu_test_gen(ul_config_pdus[14].ulsch_uci_harq_pdu.ulsch_pdu);
+		ul_config_harq_info_test_gen(ul_config_pdus[14].ulsch_uci_harq_pdu.harq_information);
+		
+		ul_config_pdus[15].pdu_type = NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE;
+		ul_config_ulsch_pdu_test_gen(ul_config_pdus[15].ulsch_csi_uci_harq_pdu.ulsch_pdu);
+		ul_config_cqi_info_test_gen(ul_config_pdus[15].ulsch_csi_uci_harq_pdu.csi_information);
+		ul_config_harq_info_test_gen(ul_config_pdus[15].ulsch_csi_uci_harq_pdu.harq_information);
+		
+		ul_config_pdus[16].pdu_type = NFAPI_UL_CONFIG_NULSCH_PDU_TYPE;
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG;
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.nulsch_format = rand_range(0, 1);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.handle = rand_range(0, 0xFFFF);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.size = rand_range(0, 65535);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.rnti = rand_range(1, 65535);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.subcarrier_indication = rand_range(0, 47);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.resource_assignment = rand_range(0, 7);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.mcs = rand_range(0, 12);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.redudancy_version = rand_range(0, 1);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.repetition_number = rand_range(0, 7);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.new_data_indication = rand_range(0, 1);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.n_srs = rand_range(0, 1);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.scrambling_sequence_initialization_cinit = rand_range(0, 65535);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.sf_idx = rand_range(0, 40960);
+		
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel8.handle = rand_range(0, 0xFF);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel8.rnti = rand_range(1, 65535);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel11.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG;
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel11.virtual_cell_id_enabled_flag = rand_range(0, 1);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel11.npusch_identity = rand_range(0, 503);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG;
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.ue_type = rand_range(0, 2);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.empty_symbols = rand_range(0, 0x3);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.total_number_of_repetitions = rand_range(1, 32);
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.repetition_number = rand_range(1, 32);
+		
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.nb_harq_information.nb_harq_information_rel13_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG;
+		ul_config_pdus[16].nulsch_pdu.nulsch_pdu_rel13.nb_harq_information.nb_harq_information_rel13_fdd.harq_ack_resource = rand_range(0, 15);
+		
+		ul_config_pdus[17].pdu_type = NFAPI_UL_CONFIG_NRACH_PDU_TYPE;
+		ul_config_pdus[17].nrach_pdu.nrach_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG;
+		ul_config_pdus[17].nrach_pdu.nrach_pdu_rel13.nprach_config_0 = rand_range(0, 1);
+		ul_config_pdus[17].nrach_pdu.nrach_pdu_rel13.nprach_config_1 = rand_range(0, 1);
+		ul_config_pdus[17].nrach_pdu.nrach_pdu_rel13.nprach_config_2 = rand_range(0, 1);
+		
+		ul_config_req.ul_config_request_body.ul_config_pdu_list = ul_config_pdus;	
+		mac->ul_config_req(mac, &ul_config_req);
+		
+		
+		uint8_t num_dci_pdus = 4;
+		uint8_t num_hi_pdus = 1;
+		nfapi_hi_dci0_request_pdu_t hi_dci0_pdus[num_dci_pdus + num_hi_pdus];
+		memset(&hi_dci0_pdus, 0, sizeof(hi_dci0_pdus));
+		
+		nfapi_hi_dci0_request_t hi_dci0_req;
+		memset(&hi_dci0_req, 0, sizeof(hi_dci0_req));
+		hi_dci0_req.header.message_id = NFAPI_HI_DCI0_REQUEST;
+		hi_dci0_req.header.phy_id = phy_id;
+		hi_dci0_req.sfn_sf = sfn_sf;
+		
+		hi_dci0_req.hi_dci0_request_body.tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
+		hi_dci0_req.hi_dci0_request_body.sfnsf = sfn_sf;
+		hi_dci0_req.hi_dci0_request_body.number_of_dci = num_dci_pdus;
+		hi_dci0_req.hi_dci0_request_body.number_of_hi = num_hi_pdus;
+		
+		hi_dci0_pdus[0].pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE;
+		hi_dci0_pdus[0].hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG;
+		hi_dci0_pdus[0].hi_pdu.hi_pdu_rel8.resource_block_start = rand_range(0, 100);
+		hi_dci0_pdus[0].hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = rand_range(0, 7);
+		hi_dci0_pdus[0].hi_pdu.hi_pdu_rel8.hi_value = rand_range(0, 1);
+		hi_dci0_pdus[0].hi_pdu.hi_pdu_rel8.i_phich = rand_range(0, 1);
+		hi_dci0_pdus[0].hi_pdu.hi_pdu_rel8.transmission_power = rand_range(0, 10000);
+		hi_dci0_pdus[0].hi_pdu.hi_pdu_rel10.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG;	
+		hi_dci0_pdus[0].hi_pdu.hi_pdu_rel10.flag_tb2 = rand_range(0, 1);
+		hi_dci0_pdus[0].hi_pdu.hi_pdu_rel10.hi_value_2 = rand_range(0, 1);
+		
+		hi_dci0_pdus[1].pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.dci_format = rand_range(0, 4);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.cce_index = rand_range(0, 88);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.aggregation_level = rand_range(1, 8);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.rnti = rand_range(1, 65535);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.resource_block_start = rand_range(0, 100);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.number_of_resource_block = rand_range(0, 100);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.mcs_1 = rand_range(0, 31);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.cyclic_shift_2_for_drms = rand_range(0, 7);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.frequency_hopping_enabled_flag = rand_range(0, 1);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.frequency_hopping_bits = rand_range(0, 3);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.new_data_indication_1 = rand_range(0, 1);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.ue_tx_antenna_seleciton = rand_range(0, 2);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.tpc = rand_range(0, 3);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.cqi_csi_request = rand_range(0, 7);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.ul_index = rand_range(0, 3);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.dl_assignment_index = rand_range(1, 4);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.tpc_bitmap = rand_range(0, 9999);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel8.transmission_power = rand_range(0, 10000);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG;
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.cross_carrier_scheduling_flag = rand_range(0, 1);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.carrier_indicator = rand_range(0, 7);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.size_of_cqi_csi_feild = rand_range(0, 2);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.srs_flag = rand_range(0, 1);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.srs_request = rand_range(0, 1);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.resource_allocation_flag = rand_range(0, 1);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.resource_allocation_type = rand_range(0, 1);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.resource_block_coding = rand_range(0, 9999);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.mcs_2 = rand_range(0, 31);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.new_data_indication_2 = rand_range(0, 1);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.number_of_antenna_ports = rand_range(0, 2);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.tpmi = rand_range(0, 63);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.total_dci_length_including_padding = rand_range(0, 255);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel10.n_ul_rb = rand_range(6, 100);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel12.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG;
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel12.pscch_resource = rand_range(0, 16);
+		hi_dci0_pdus[1].dci_pdu.dci_pdu_rel12.time_resource_pattern = rand_range(0, 32);
+		
+		
+		hi_dci0_pdus[2].pdu_type = NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE;
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG;
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.dci_format = rand_range(0, 4);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.cce_index = rand_range(0, 88);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.aggregation_level = rand_range(1, 8);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.rnti = rand_range(1, 65535);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.resource_block_start = rand_range(0, 100);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.number_of_resource_block = rand_range(0, 100);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.mcs_1 = rand_range(0, 31);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.cyclic_shift_2_for_drms = rand_range(0, 7);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.frequency_hopping_enabled_flag = rand_range(0, 1);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.frequency_hopping_bits = rand_range(0, 3);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.new_data_indication_1 = rand_range(0, 1);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.ue_tx_antenna_seleciton = rand_range(0, 2);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.tpc = rand_range(0, 3);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.cqi_csi_request = rand_range(0, 7);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.ul_index = rand_range(0, 3);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.dl_assignment_index = rand_range(1, 4);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.tpc_bitmap = rand_range(0, 9999);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel8.transmission_power = rand_range(0, 10000);		
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.tl.tag = NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG;
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.cross_carrier_scheduling_flag = rand_range(0, 1);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.carrier_indicator = rand_range(0, 7);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.size_of_cqi_csi_feild = rand_range(0, 2);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.srs_flag = rand_range(0, 1);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.srs_request = rand_range(0, 1);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.resource_allocation_flag = rand_range(0, 1);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.resource_allocation_type = rand_range(0, 1);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.resource_block_coding = rand_range(0, 9999);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.mcs_2 = rand_range(0, 31);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.new_data_indication_2 = rand_range(0, 1);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.number_of_antenna_ports = rand_range(0, 2);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.tpmi = rand_range(0, 63);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.total_dci_length_including_padding = rand_range(0, 255);
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_dci_pdu_rel10.n_ul_rb = rand_range(6, 100);			
+		hi_dci0_pdus[2].epdcch_dci_pdu.epdcch_parameters_rel11.tl.tag = NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG;
+		
+		hi_dci0_pdus[3].pdu_type = NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE;
+		hi_dci0_pdus[3].mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.tl.tag = NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG;
+
+		hi_dci0_pdus[4].pdu_type = NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE;
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.tl.tag = NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG;
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.ncce_index = rand_range(0, 1);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.aggregation_level = rand_range(1, 2);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.start_symbol = rand_range(0, 4);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.rnti = rand_range(1, 65535);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.scrambling_reinitialization_batch_index = rand_range(1, 4);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.nrs_antenna_ports_assumed_by_the_ue = rand_range(1, 2);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.subcarrier_indication = rand_range(0, 63);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.resource_assignment = rand_range(0, 7);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.scheduling_delay = rand_range(0, 3);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.mcs = rand_range(0, 12);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.redudancy_version = rand_range(0, 1);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.repetition_number = rand_range(0, 7);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.new_data_indicator = rand_range(0, 1);
+		hi_dci0_pdus[4].npdcch_dci_pdu.npdcch_dci_pdu_rel13.dci_subframe_repetition_number = rand_range(0, 3);
+		
+		hi_dci0_req.hi_dci0_request_body.hi_dci0_pdu_list = hi_dci0_pdus;
+		mac->hi_dci0_req(mac, &hi_dci0_req);
+
+		uint8_t num_tx_pdus = 2;
+		nfapi_tx_request_pdu_t tx_pdus[num_tx_pdus];
+		memset(&tx_pdus, 0, sizeof(tx_pdus));
+		
+		nfapi_tx_request_t tx_req;
+		memset(&tx_req, 0, sizeof(tx_req));
+		tx_req.header.message_id = NFAPI_TX_REQUEST;
+		tx_req.header.phy_id = phy_id;
+		tx_req.sfn_sf = sfn_sf;
+		
+		tx_req.tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+		tx_req.tx_request_body.number_of_pdus = num_tx_pdus;
+		
+		uint32_t data[2];
+		data[0] = 0x11223344;
+		data[1] = 0x55667788;
+		
+		tx_pdus[0].pdu_length = 8;
+		tx_pdus[0].pdu_index = 1;
+		tx_pdus[0].num_segments = 2;
+		tx_pdus[0].segments[0].segment_length = 4;
+		tx_pdus[0].segments[0].segment_data = (uint8_t*)&data[0];
+		tx_pdus[0].segments[1].segment_length = 4;
+		tx_pdus[0].segments[1].segment_data = (uint8_t*)&data[1];
+		
+		tx_pdus[1].pdu_length = 8;
+		tx_pdus[1].pdu_index = 2;
+		tx_pdus[1].num_segments = 2;
+		tx_pdus[1].segments[0].segment_length = 4;
+		tx_pdus[1].segments[0].segment_data = (uint8_t*)&data[0];
+		tx_pdus[1].segments[1].segment_length = 4;
+		tx_pdus[1].segments[1].segment_data = (uint8_t*)&data[1];		
+		
+		
+		tx_req.tx_request_body.tx_pdu_list = tx_pdus;
+		mac->tx_req(mac, &tx_req);
+	}
+	
+	void generate_subframe(mac_t *mac, uint16_t phy_id, uint16_t sfn_sf)
+	{
+		mac_internal_t* instance = (mac_internal_t*)mac;
+				
+		nfapi_dl_config_request_t dl_config_req;
+		memset(&dl_config_req, 0, sizeof(dl_config_req));
+		dl_config_req.header.message_id = NFAPI_DL_CONFIG_REQUEST;
+		dl_config_req.header.phy_id = phy_id;
+		dl_config_req.sfn_sf = sfn_sf;
+
+		dl_config_req.dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
+		dl_config_req.dl_config_request_body.number_pdu = 8;
+
+		nfapi_dl_config_request_pdu_t pdus[8];
+		memset(&pdus, 0, sizeof(pdus));
+		for(int i = 0; i < 8; i++)
+		{
+			pdus[i].pdu_type = NFAPI_DL_CONFIG_BCH_PDU_TYPE;
+
+			pdus[i].bch_pdu.bch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG;
+			pdus[i].bch_pdu.bch_pdu_rel8.length = 42;
+			pdus[i].bch_pdu.bch_pdu_rel8.pdu_index = i;
+			pdus[i].bch_pdu.bch_pdu_rel8.transmission_power = 56;
+
+		}
+
+		dl_config_req.dl_config_request_body.dl_config_pdu_list = pdus;
+
+		/*
+		vendor_ext_tlv_1 ve;
+		ve.tl.tag = VENDOR_EXT_TLV_1_TAG;
+		ve.dummy = 999;
+		dl_config_req.vendor_extension = &ve.tl;
+		*/
+
+		mac->dl_config_req(mac, &dl_config_req);	
+
+
+		nfapi_ul_config_request_t ul_config_req;
+		memset(&ul_config_req, 0, sizeof(ul_config_req));
+		ul_config_req.header.message_id = NFAPI_UL_CONFIG_REQUEST;
+		ul_config_req.header.phy_id = phy_id;
+		ul_config_req.sfn_sf = sfn_sf;
+		mac->ul_config_req(mac, &ul_config_req);
+
+		nfapi_hi_dci0_request_t hi_dci0_req;
+		memset(&hi_dci0_req, 0, sizeof(hi_dci0_req));
+		hi_dci0_req.header.message_id = NFAPI_HI_DCI0_REQUEST;
+		hi_dci0_req.header.phy_id = phy_id;
+		hi_dci0_req.sfn_sf = sfn_sf;
+		mac->hi_dci0_req(mac, &hi_dci0_req);
+
+
+
+		nfapi_tx_request_t tx_req;
+		memset(&tx_req, 0, sizeof(tx_req));
+		tx_req.header.message_id = NFAPI_TX_REQUEST;
+		tx_req.header.phy_id = phy_id;
+		tx_req.sfn_sf = sfn_sf;
+
+		nfapi_tx_request_pdu_t tx_pdus[8];
+
+		tx_req.tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+		tx_req.tx_request_body.number_of_pdus = 0;
+		tx_req.tx_request_body.tx_pdu_list = &tx_pdus[0];
+
+		mac_pdu* buff = 0;
+		int i = 0;
+		std::list<mac_pdu*> free_list;
+		do
+		{
+			buff = instance->mac->pop_rx_buffer();
+			if(buff != 0)
+			{
+				if(buff->len == 0)
+				{
+					printf("[MAC] Buffer length = 0\n");
+				}
+
+				tx_req.tx_request_body.tx_pdu_list[i].pdu_length = buff->len;
+				tx_req.tx_request_body.tx_pdu_list[i].pdu_index = i;
+				tx_req.tx_request_body.tx_pdu_list[i].num_segments = 1;
+				tx_req.tx_request_body.tx_pdu_list[i].segments[0].segment_length = buff->len;
+				tx_req.tx_request_body.tx_pdu_list[i].segments[0].segment_data = (uint8_t*)buff->buffer;
+
+				tx_req.tx_request_body.number_of_pdus++;
+				i++;
+
+				instance->mac->byte_count += buff->len;
+
+				free_list.push_back(buff);
+			}
+		}while(buff != 0 && i < 8);
+
+		mac->tx_req(mac, &tx_req);
+
+		//for(int j = 0; j < tx_req.tx_request_body.number_of_pdus; ++j)
+		for(mac_pdu* pdu : free_list)
+		{
+			instance->mac->release_mac_pdu(pdu);
+			//free(tx_req.tx_request_body.tx_pdu_list[j].segments[0].segment_data);
+		}
+	}
+	
+	void mac_subframe_ind(mac_t *mac, uint16_t phy_id, uint16_t sfn_sf)
+	{
+
+		
+		//printf("[MAC] subframe indication phyid:%d sfnsf:%d\n", phy_id, sfn_sf);
+		mac_internal_t* instance = (mac_internal_t*)mac;
+
+		if(instance->mac->tick == 1000)
+		{
+			if(instance->mac->byte_count > 0)
+			{
+				printf("[MAC] Rx rate %d bytes/sec\n", instance->mac->byte_count);
+				instance->mac->byte_count = 0;
+			}
+			instance->mac->tick = 0;
+		}
+		instance->mac->tick++;
+		
+		if(instance->mac->wireshark_test_mode)
+		{
+			generate_test_subframe(mac, phy_id, sfn_sf);
+		}
+		else
+		{
+			generate_subframe(mac, phy_id, sfn_sf);
+		}
+	}	
+	
+	void mac_harq_ind(mac_t* mac, nfapi_harq_indication_t* ind)
+	{
+	}
+	void mac_crc_ind(mac_t* mac, nfapi_crc_indication_t* ind)
+	{
+	}
+	void mac_rx_ind(mac_t* mac, nfapi_rx_indication_t* ind)
+	{
+		mac_internal_t* instance = (mac_internal_t*)mac;
+
+		for(int i = 0; i < ind->rx_indication_body.number_of_pdus; ++i)
+		{
+			uint16_t len = ind->rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length;
+			uint8_t* data = ind->rx_indication_body.rx_pdu_list[i].data;
+			//printf("[MAC] sfnsf:%d len:%d\n", ind->sfn_sf,len);
+			//
+			instance->tx_byte_count += len;
+
+			int sendto_result = sendto(instance->tx_sock, data, len, 0, (struct sockaddr*)&(instance->tx_addr), sizeof(instance->tx_addr));
+			
+			if(sendto_result < 0)
+			{
+				// error
+			}
+		}
+
+	}
+	void mac_rach_ind(mac_t* mac, nfapi_rach_indication_t* ind)
+	{
+	}
+	void mac_srs_ind(mac_t* mac, nfapi_srs_indication_t* ind)
+	{
+	}
+	void mac_sr_ind(mac_t* mac, nfapi_sr_indication_t* ind)
+	{
+	}
+	void mac_cqi_ind(mac_t* mac, nfapi_cqi_indication_t* ind)
+	{
+	}
+	void mac_lbt_dl_ind(mac_t* mac, nfapi_lbt_dl_indication_t* ind)
+	{
+	}
+	void mac_nb_harq_ind(mac_t* mac, nfapi_nb_harq_indication_t* ind)
+	{
+	}
+	void mac_nrach_ind(mac_t* mac, nfapi_nrach_indication_t* ind)
+	{
+	}
+}
+
diff --git a/nfapi/open-nFAPI/vnf_sim/src/main.cpp b/nfapi/open-nFAPI/vnf_sim/src/main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5dc7161157defe8b5c6e3b8d5b10c445cf79a25d
--- /dev/null
+++ b/nfapi/open-nFAPI/vnf_sim/src/main.cpp
@@ -0,0 +1,1525 @@
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include <string.h>
+#include "debug.h"
+#include <map>
+#include <vector>
+#include <list>
+#include <string>
+#include <algorithm>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <ifaddrs.h>
+#include <netdb.h>
+
+#include "pool.h"
+
+#include <boost/foreach.hpp>
+#include <boost/property_tree/xml_parser.hpp>
+#include <boost/property_tree/ptree.hpp>
+#include <boost/exception/diagnostic_information.hpp> 
+#include <boost/exception_ptr.hpp> 
+
+extern "C" {
+#include <nfapi_vnf_interface.h>
+#include <nfapi.h>
+#include "mac.h"
+
+#include <vendor_ext.h>
+
+//int vnf_main(int iPortP5, int, int);
+int start_simulated_mac(int*, int*);
+int read_xml(const char *xml_file);
+
+}
+
+static uint32_t rand_range(uint32_t min, uint32_t max)
+{
+	return ((rand() % (max + 1 - min)) + min);
+}
+
+
+void* vnf_allocate(size_t size)
+{
+	return (void*)memory_pool::allocate(size);
+}
+
+void vnf_deallocate(void* ptr)
+{
+	memory_pool::deallocate((uint8_t*)ptr);
+}
+
+
+
+class udp_data
+{
+	public:
+		bool enabled;
+		uint32_t rx_port;
+		uint32_t tx_port;
+		std::string tx_addr;
+};
+
+
+class phy_info
+{
+	public:
+
+		uint16_t index;
+		uint16_t id;
+
+		std::vector<uint16_t> rfs;
+		std::vector<uint16_t> excluded_rfs;
+
+		int remote_port;
+		std::string remote_addr;
+
+		uint16_t earfcn;
+
+};
+
+class rf_info
+{
+	public:
+
+		uint16_t index;
+		uint16_t band;
+};
+
+class pnf_info
+{
+	public:
+
+		std::vector<phy_info> phys;
+		std::vector<rf_info> rfs;
+};
+
+class vnf_p7_info
+{
+	public:
+
+		vnf_p7_info()
+			: thread_started(false), 
+			  config(nfapi_vnf_p7_config_create(), 
+				     [] (nfapi_vnf_p7_config_t* f) { nfapi_vnf_p7_config_destory(f); }),
+			  mac(0)
+		{
+			local_port = 0;
+			
+			timing_window = 0;
+			periodic_timing_enabled = 0;
+			aperiodic_timing_enabled = 0;
+			periodic_timing_period = 0;
+			
+			//config = nfapi_vnf_p7_config_create();
+		}
+		
+		vnf_p7_info(const vnf_p7_info& other)  = default;
+		
+		vnf_p7_info(vnf_p7_info&& other) = default;
+		
+		vnf_p7_info& operator=(const vnf_p7_info&) = default;
+		
+		vnf_p7_info& operator=(vnf_p7_info&&) = default;
+		
+		
+		
+		virtual	~vnf_p7_info()
+		{
+			//NFAPI_TRACE(NFAPI_TRACE_INFO, "*** vnf_p7_info delete ***\n");
+			
+			//nfapi_vnf_p7_config_destory(config);
+			
+			// should we delete the mac?
+		}
+		
+
+		int local_port;
+		std::string local_addr;
+
+		unsigned timing_window;
+		unsigned periodic_timing_enabled;
+		unsigned aperiodic_timing_enabled;
+		unsigned periodic_timing_period;
+
+		// This is not really the right place if we have multiple PHY, 
+		// should be part of the phy struct
+		udp_data udp;
+
+		bool thread_started;
+
+		//nfapi_vnf_p7_config_t* config;
+		std::shared_ptr<nfapi_vnf_p7_config_t> config;
+
+		mac_t* mac;
+
+
+};
+
+class vnf_info
+{
+	public:
+	
+		uint8_t wireshark_test_mode;
+
+		std::map<uint16_t, pnf_info> pnfs;
+
+		std::vector<vnf_p7_info> p7_vnfs;
+		
+};
+
+
+/// maybe these should be in the mac file...
+int phy_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessage, uint8_t *end, void** ve, nfapi_p7_codec_config_t* codec)
+{
+	(void)tl;
+	(void)ppReadPackedMessage;
+	(void)ve;
+	return -1;
+}
+
+int phy_pack_vendor_extension_tlv(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* codec)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "phy_pack_vendor_extension_tlv\n");
+
+	nfapi_tl_t* tlv = (nfapi_tl_t*)ve;
+	switch(tlv->tag)
+	{
+		case VENDOR_EXT_TLV_1_TAG:
+			{
+				//NFAPI_TRACE(NFAPI_TRACE_INFO, "Packing VENDOR_EXT_TLV_1\n");
+				vendor_ext_tlv_1* ve = (vendor_ext_tlv_1*)tlv;
+				if(!push32(ve->dummy, ppWritePackedMsg, end))
+					return 0;
+				return 1;
+			}
+			break;
+		default:
+			return -1;
+			break;
+	}
+}
+
+int vnf_sim_pack_vendor_extension_tlv(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* codec)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "pnf_sim_pack_vendor_extension_tlv\n");
+	nfapi_tl_t* tlv = (nfapi_tl_t*)ve;
+	switch(tlv->tag)
+	{
+		case VENDOR_EXT_TLV_2_TAG:
+			{
+				//NFAPI_TRACE(NFAPI_TRACE_INFO, "Packing VENDOR_EXT_TLV_2\n");
+				vendor_ext_tlv_2* ve = (vendor_ext_tlv_2*)tlv;
+				if(!push32(ve->dummy, ppWritePackedMsg, end))
+					return 0;
+				return 1;
+			}
+			break;
+	}
+	return -1;
+}
+
+int vnf_sim_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessage, uint8_t *end, void** ve, nfapi_p4_p5_codec_config_t* codec)
+{
+	return -1;
+}
+
+
+
+
+int phy_unpack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t** ppReadPackedMessage, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+	if(header->message_id == P7_VENDOR_EXT_IND)
+	{
+		vendor_ext_p7_ind* req = (vendor_ext_p7_ind*)(header);
+		if(!pull16(ppReadPackedMessage, &req->error_code, end))
+			return 0;
+	}
+	return 1;
+}
+
+int phy_pack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t** ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+	if(header->message_id == P7_VENDOR_EXT_REQ)
+	{
+		//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+		vendor_ext_p7_req* req = (vendor_ext_p7_req*)(header);
+		if(!(push16(req->dummy1, ppWritePackedMsg, end) &&
+			 push16(req->dummy2, ppWritePackedMsg, end)))
+			return 0;
+	}
+	return 1;
+}
+
+int vnf_sim_unpack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t* header, uint8_t** ppReadPackedMessage, uint8_t *end, nfapi_p4_p5_codec_config_t* codec)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+	if(header->message_id == P5_VENDOR_EXT_RSP)
+	{
+		vendor_ext_p5_rsp* req = (vendor_ext_p5_rsp*)(header);
+		return(!pull16(ppReadPackedMessage, &req->error_code, end));
+	}
+	return 0;
+}
+
+int vnf_sim_pack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t* header, uint8_t** ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* codec)
+{
+	//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
+	if(header->message_id == P5_VENDOR_EXT_REQ)
+	{
+		vendor_ext_p5_req* req = (vendor_ext_p5_req*)(header);
+		//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s %d %d\n", __FUNCTION__, req->dummy1, req->dummy2);
+		return (!(push16(req->dummy1, ppWritePackedMsg, end) &&
+				  push16(req->dummy2, ppWritePackedMsg, end)));
+	}
+	return 0;
+}
+
+void vnf_sim_trace(nfapi_trace_level_t level, const char* message, ...)
+{
+	va_list args;
+	va_start(args, message);
+	vprintf(message, args);
+	va_end(args);
+}
+
+void mac_dl_config_req(mac_t* mac, nfapi_dl_config_request_t* req)
+{
+	vnf_p7_info* info = (vnf_p7_info*)(mac->user_data);
+
+	nfapi_vnf_p7_dl_config_req(info->config.get(), req);
+}
+
+void mac_ul_config_req(mac_t* mac, nfapi_ul_config_request_t* req)
+{
+	vnf_p7_info* info = (vnf_p7_info*)(mac->user_data);
+
+	nfapi_vnf_p7_ul_config_req(info->config.get(), req);
+}
+
+void mac_hi_dci0_req(mac_t* mac, nfapi_hi_dci0_request_t* req)
+{
+	vnf_p7_info* info = (vnf_p7_info*)(mac->user_data);
+
+	nfapi_vnf_p7_hi_dci0_req(info->config.get(), req);
+}
+
+void mac_tx_req(mac_t* mac, nfapi_tx_request_t* req)
+{
+	vnf_p7_info* info = (vnf_p7_info*)(mac->user_data);
+
+	nfapi_vnf_p7_tx_req(info->config.get(), req);
+}
+
+int phy_subframe_indication(struct nfapi_vnf_p7_config* config, uint16_t phy_id, uint16_t sfn_sf)
+{
+	//printf("[VNF_SIM] subframe indication %d\n", sfn_sf);
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_subframe_ind(p7_vnf->mac, phy_id, sfn_sf);
+	return 0;
+}
+int phy_harq_indication(struct nfapi_vnf_p7_config* config, nfapi_harq_indication_t* ind)
+{
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_harq_ind(p7_vnf->mac, ind);
+	return 1;
+}
+int phy_crc_indication(struct nfapi_vnf_p7_config* config, nfapi_crc_indication_t* ind)
+{
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_crc_ind(p7_vnf->mac, ind);
+	return 1;
+}
+int phy_rx_indication(struct nfapi_vnf_p7_config* config, nfapi_rx_indication_t* ind)
+{
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_rx_ind(p7_vnf->mac, ind);
+	return 1;
+}
+int phy_rach_indication(struct nfapi_vnf_p7_config* config, nfapi_rach_indication_t* ind)
+{
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_rach_ind(p7_vnf->mac, ind);
+	return 1;
+}
+int phy_srs_indication(struct nfapi_vnf_p7_config* config, nfapi_srs_indication_t* ind)
+{
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_srs_ind(p7_vnf->mac, ind);
+	return 1;
+}
+int phy_sr_indication(struct nfapi_vnf_p7_config* config, nfapi_sr_indication_t* ind)
+{
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_sr_ind(p7_vnf->mac, ind);
+	return 1;
+}
+int phy_cqi_indication(struct nfapi_vnf_p7_config* config, nfapi_cqi_indication_t* ind)
+{
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_cqi_ind(p7_vnf->mac, ind);
+	return 1;
+}
+int phy_lbt_dl_indication(struct nfapi_vnf_p7_config* config, nfapi_lbt_dl_indication_t* ind)
+{
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_lbt_dl_ind(p7_vnf->mac, ind);
+	return 1;
+}
+int phy_nb_harq_indication(struct nfapi_vnf_p7_config* config, nfapi_nb_harq_indication_t* ind)
+{
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_nb_harq_ind(p7_vnf->mac, ind);
+	return 1;
+}
+int phy_nrach_indication(struct nfapi_vnf_p7_config* config, nfapi_nrach_indication_t* ind)
+{
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
+	mac_nrach_ind(p7_vnf->mac, ind);
+	return 1;
+}
+int phy_vendor_ext(struct nfapi_vnf_p7_config* config, nfapi_p7_message_header_t* msg)
+{
+	if(msg->message_id == P7_VENDOR_EXT_IND)
+	{
+		//vendor_ext_p7_ind* ind = (vendor_ext_p7_ind*)msg;
+		//printf("[VNF_SIM] vendor_ext (error_code:%d)\n", ind->error_code);
+	}
+	else
+	{
+		printf("[VNF_SIM] unknown %d\n", msg->message_id);
+	}
+	return 0;
+}
+nfapi_p7_message_header_t* phy_allocate_p7_vendor_ext(uint16_t message_id, uint16_t* msg_size)
+{
+	if(message_id == P7_VENDOR_EXT_IND)
+	{
+		*msg_size = sizeof(vendor_ext_p7_ind);
+		return (nfapi_p7_message_header_t*)malloc(sizeof(vendor_ext_p7_ind));
+	}
+	return 0;
+}
+void phy_deallocate_p7_vendor_ext(nfapi_p7_message_header_t* header)
+{
+	free(header);
+}
+
+//static pthread_t vnf_start_pthread;
+static pthread_t vnf_p7_start_pthread;
+void* vnf_p7_start_thread(void *ptr)
+{
+  printf("%s()\n", __FUNCTION__);
+
+  //std::shared_ptr<nfapi_vnf_p7_config> config = std::shared_ptr<nfapi_vnf_p7_config>(ptr);
+  nfapi_vnf_p7_config_t *config = (nfapi_vnf_p7_config_t *)ptr;
+
+  nfapi_vnf_p7_start(config);
+
+  return 0;
+}
+
+void set_thread_priority(int priority)
+{
+	//printf("%s(priority:%d)\n", __FUNCTION__, priority);
+	
+	pthread_attr_t ptAttr;
+	
+	struct sched_param schedParam;
+	schedParam.__sched_priority = priority; //79;
+	if(sched_setscheduler(0, SCHED_RR, &schedParam) != 0)
+	{
+		printf("Failed to set scheduler to SCHED_RR\n");
+	}
+
+	if(pthread_attr_setschedpolicy(&ptAttr, SCHED_RR) != 0)
+	{
+		printf("Failed to set pthread sched policy SCHED_RR\n");
+	}
+
+	pthread_attr_setinheritsched(&ptAttr, PTHREAD_EXPLICIT_SCHED);
+
+	struct sched_param thread_params;
+	thread_params.sched_priority = 20;
+	if(pthread_attr_setschedparam(&ptAttr, &thread_params) != 0)
+	{
+		printf("failed to set sched param\n");
+	}
+}
+
+void* vnf_p7_thread_start(void* ptr)
+{
+  printf("%s()\n", __FUNCTION__);
+
+	set_thread_priority(79);
+
+	vnf_p7_info* p7_vnf = (vnf_p7_info*)ptr;
+
+	p7_vnf->config->port = p7_vnf->local_port;
+	p7_vnf->config->subframe_indication = &phy_subframe_indication;
+	p7_vnf->config->harq_indication = &phy_harq_indication;
+	p7_vnf->config->crc_indication = &phy_crc_indication;
+	p7_vnf->config->rx_indication = &phy_rx_indication;
+	p7_vnf->config->rach_indication = &phy_rach_indication;
+	p7_vnf->config->srs_indication = &phy_srs_indication;
+	p7_vnf->config->sr_indication = &phy_sr_indication;
+	p7_vnf->config->cqi_indication = &phy_cqi_indication;
+	p7_vnf->config->lbt_dl_indication = &phy_lbt_dl_indication;
+	p7_vnf->config->nb_harq_indication = &phy_nb_harq_indication;
+	p7_vnf->config->nrach_indication = &phy_nrach_indication;
+	p7_vnf->config->malloc = &vnf_allocate;
+	p7_vnf->config->free = &vnf_deallocate;
+
+	p7_vnf->config->trace = &vnf_sim_trace;
+
+	p7_vnf->config->vendor_ext = &phy_vendor_ext;
+	p7_vnf->config->user_data = p7_vnf;
+
+	p7_vnf->mac->user_data = p7_vnf;
+
+	p7_vnf->config->codec_config.unpack_p7_vendor_extension = &phy_unpack_p7_vendor_extension;
+	p7_vnf->config->codec_config.pack_p7_vendor_extension = &phy_pack_p7_vendor_extension;
+	p7_vnf->config->codec_config.unpack_vendor_extension_tlv = &phy_unpack_vendor_extension_tlv;
+	p7_vnf->config->codec_config.pack_vendor_extension_tlv = &phy_pack_vendor_extension_tlv;
+	p7_vnf->config->codec_config.allocate = &vnf_allocate;
+	p7_vnf->config->codec_config.deallocate = &vnf_deallocate;
+
+	p7_vnf->config->allocate_p7_vendor_ext = &phy_allocate_p7_vendor_ext;
+	p7_vnf->config->deallocate_p7_vendor_ext = &phy_deallocate_p7_vendor_ext;
+
+        printf("[VNF] Creating VNF NFAPI start thread %s\n", __FUNCTION__);
+        pthread_create(&vnf_p7_start_pthread, NULL, &vnf_p7_start_thread, p7_vnf->config.get());
+
+	return 0;
+}
+
+int pnf_connection_indication_cb(nfapi_vnf_config_t* config, int p5_idx)
+{
+	printf("[VNF_SIM] pnf connection indication idx:%d\n", p5_idx);
+
+	pnf_info pnf;
+	vnf_info* vnf = (vnf_info*)(config->user_data);
+	vnf->pnfs.insert(std::pair<uint16_t, pnf_info>(p5_idx, pnf));
+
+	nfapi_pnf_param_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_PNF_PARAM_REQUEST;
+	nfapi_vnf_pnf_param_req(config, p5_idx, &req);
+	return 0;
+}
+int pnf_disconnection_indication_cb(nfapi_vnf_config_t* config, int p5_idx)
+{
+	printf("[VNF_SIM] pnf disconnection indication idx:%d\n", p5_idx);
+
+	
+	vnf_info* vnf = (vnf_info*)(config->user_data);
+	auto find_result = vnf->pnfs.find(p5_idx);
+	
+	if(find_result != vnf->pnfs.end())
+	{
+		pnf_info& pnf = find_result->second;
+
+		for(phy_info& phy : pnf.phys)
+		{
+			vnf_p7_info& p7_vnf = vnf->p7_vnfs[0];
+			nfapi_vnf_p7_del_pnf((p7_vnf.config.get()), phy.id);
+		}
+	}
+
+	return 0;
+}
+
+int pnf_param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_response_t* resp)
+{
+	printf("[VNF_SIM] pnf param response idx:%d error:%d\n", p5_idx, resp->error_code);
+
+	vnf_info* vnf = (vnf_info*)(config->user_data);
+
+	auto find_result = vnf->pnfs.find(p5_idx);
+	if(find_result != vnf->pnfs.end())
+	{
+		pnf_info& pnf = find_result->second;
+
+		for(int i = 0; i < resp->pnf_phy.number_of_phys; ++i)
+		{
+			phy_info phy;
+			phy.index = resp->pnf_phy.phy[i].phy_config_index;
+
+			printf("[VNF_SIM] (PHY:%d) phy_config_idx:%d\n", i, resp->pnf_phy.phy[i].phy_config_index);
+
+			nfapi_vnf_allocate_phy(config, p5_idx, &(phy.id));
+
+
+
+			for(int j = 0; j < resp->pnf_phy.phy[i].number_of_rfs; ++j)
+			{
+				printf("[VNF_SIM] (PHY:%d) (RF%d) %d\n", i, j, resp->pnf_phy.phy[i].rf_config[j].rf_config_index);
+				phy.rfs.push_back(resp->pnf_phy.phy[i].rf_config[j].rf_config_index);
+			}
+
+
+			pnf.phys.push_back(phy);
+		}
+		for(int i = 0; i < resp->pnf_rf.number_of_rfs; ++i)
+		{
+			rf_info rf;
+			rf.index = resp->pnf_rf.rf[i].rf_config_index;
+
+			printf("[VNF_SIM] (RF:%d) rf_config_idx:%d\n", i, resp->pnf_rf.rf[i].rf_config_index);
+
+			pnf.rfs.push_back(rf);
+		}
+
+		nfapi_pnf_config_request_t req;
+		memset(&req, 0, sizeof(req));
+		req.header.message_id = NFAPI_PNF_CONFIG_REQUEST;
+
+		req.pnf_phy_rf_config.tl.tag = NFAPI_PNF_PHY_RF_TAG;
+		req.pnf_phy_rf_config.number_phy_rf_config_info = pnf.phys.size();
+
+		for(unsigned i = 0; i < pnf.phys.size(); ++i)
+		{
+			req.pnf_phy_rf_config.phy_rf_config[i].phy_id = pnf.phys[i].id;
+			req.pnf_phy_rf_config.phy_rf_config[i].phy_config_index = pnf.phys[i].index;
+			req.pnf_phy_rf_config.phy_rf_config[i].rf_config_index = pnf.phys[i].rfs[0];
+		}
+
+
+		nfapi_vnf_pnf_config_req(config, p5_idx, &req);
+	}
+	return 0;
+}
+
+int pnf_config_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_config_response_t* resp)
+{
+	printf("[VNF_SIM] pnf config response idx:%d\n", p5_idx);
+	
+	if(1)
+	{
+		vnf_info* vnf = (vnf_info*)(config->user_data);
+		auto find_result = vnf->pnfs.find(p5_idx);
+		if(find_result != vnf->pnfs.end())
+		{
+			//pnf_info& pnf = find_result->second;
+
+			nfapi_pnf_start_request_t req;
+			memset(&req, 0, sizeof(req));
+			req.header.message_id = NFAPI_PNF_START_REQUEST;
+			nfapi_vnf_pnf_start_req(config, p5_idx, &req);
+		}
+	}
+	else
+	{
+		// Rather than send the pnf_start_request we will demonstrate
+		// sending a vendor extention message. The start request will be
+		// send when the vendor extension response is received 
+
+		//vnf_info* vnf = (vnf_info*)(config->user_data);
+		vendor_ext_p5_req req;
+		memset(&req, 0, sizeof(req));
+		req.header.message_id = P5_VENDOR_EXT_REQ;
+		req.dummy1 = 45;
+		req.dummy2 = 1977;
+		nfapi_vnf_vendor_extension(config, p5_idx, &req.header);
+	}
+	return 0;
+}
+
+int pnf_start_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_start_response_t* resp)
+{
+	printf("[VNF_SIM] pnf start response idx:%d\n", p5_idx);
+
+	vnf_info* vnf = (vnf_info*)(config->user_data);
+	vnf_p7_info& p7_vnf = vnf->p7_vnfs[0];
+
+	if(p7_vnf.thread_started == false)
+	{
+		pthread_t vnf_p7_thread;
+		pthread_create(&vnf_p7_thread, NULL, &vnf_p7_thread_start, &p7_vnf);
+		p7_vnf.thread_started = true;
+	}
+	else
+	{
+		// P7 thread already running. 
+	}
+
+	// start all the phys in the pnf.
+	
+	auto find_result = vnf->pnfs.find(p5_idx);
+	if(find_result != vnf->pnfs.end())
+	{
+		pnf_info& pnf = find_result->second;
+
+		for(unsigned i = 0; i < pnf.phys.size(); ++i)
+		{
+			pnf_info& pnf = find_result->second;
+
+			nfapi_param_request_t req;
+			memset(&req, 0, sizeof(req));
+			req.header.message_id = NFAPI_PARAM_REQUEST;
+			req.header.phy_id = pnf.phys[i].id;
+			nfapi_vnf_param_req(config, p5_idx, &req);
+		}
+	}
+
+	return 0;
+}
+int param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_response_t* resp)
+{
+	printf("[VNF_SIM] param response idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+
+	vnf_info* vnf = (vnf_info*)(config->user_data);
+
+	auto find_result = vnf->pnfs.find(p5_idx);
+	if(find_result != vnf->pnfs.end())
+	{
+		pnf_info& pnf = find_result->second;
+		
+		
+		auto found = std::find_if(pnf.phys.begin(), pnf.phys.end(), [&](phy_info& item)
+								  { return item.id == resp->header.phy_id; });
+
+		if(found != pnf.phys.end())
+		{
+			phy_info& phy = (*found);
+
+			phy.remote_port = resp->nfapi_config.p7_pnf_port.value;
+			
+			struct sockaddr_in pnf_p7_sockaddr;
+			memcpy(&pnf_p7_sockaddr.sin_addr.s_addr, &(resp->nfapi_config.p7_pnf_address_ipv4.address[0]), 4);
+
+			phy.remote_addr = inet_ntoa(pnf_p7_sockaddr.sin_addr);
+
+			// for now just 1
+			vnf_p7_info& p7_vnf = vnf->p7_vnfs[0];
+
+			printf("[VNF_SIM] %d.%d pnf p7 %s:%d timing %d %d %d %d\n", p5_idx, phy.id, phy.remote_addr.c_str(), phy.remote_port, p7_vnf.timing_window, p7_vnf.periodic_timing_period, p7_vnf.aperiodic_timing_enabled, p7_vnf.periodic_timing_period);
+
+
+			nfapi_config_request_t req;
+			memset(&req, 0, sizeof(req));
+			req.header.message_id = NFAPI_CONFIG_REQUEST;
+			req.header.phy_id = phy.id;
+
+			
+			req.nfapi_config.p7_vnf_port.tl.tag = NFAPI_NFAPI_P7_VNF_PORT_TAG;
+			req.nfapi_config.p7_vnf_port.value = p7_vnf.local_port;
+			req.num_tlv++;
+
+			req.nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
+			struct sockaddr_in vnf_p7_sockaddr;
+			vnf_p7_sockaddr.sin_addr.s_addr = inet_addr(p7_vnf.local_addr.c_str());
+			memcpy(&(req.nfapi_config.p7_vnf_address_ipv4.address[0]), &vnf_p7_sockaddr.sin_addr.s_addr, 4);
+			req.num_tlv++;
+
+			req.nfapi_config.timing_window.tl.tag = NFAPI_NFAPI_TIMING_WINDOW_TAG;
+			req.nfapi_config.timing_window.value = p7_vnf.timing_window;
+			req.num_tlv++;
+
+			if(p7_vnf.periodic_timing_enabled || p7_vnf.aperiodic_timing_enabled)
+			{
+				req.nfapi_config.timing_info_mode.tl.tag = NFAPI_NFAPI_TIMING_INFO_MODE_TAG;
+				req.nfapi_config.timing_info_mode.value = (p7_vnf.aperiodic_timing_enabled << 1) | (p7_vnf.periodic_timing_enabled);
+				req.num_tlv++;
+
+				if(p7_vnf.periodic_timing_enabled)
+				{
+					req.nfapi_config.timing_info_period.tl.tag = NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG;
+					req.nfapi_config.timing_info_period.value = p7_vnf.periodic_timing_period;
+					req.num_tlv++;
+				}
+			}
+
+			req.nfapi_config.earfcn.tl.tag = NFAPI_NFAPI_EARFCN_TAG;
+			req.nfapi_config.earfcn.value = phy.earfcn;
+			req.num_tlv++;
+			
+			
+			if(1)
+			{
+				// Poplate all tlv for wireshark testing
+				req.subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG;
+				req.num_tlv++;
+				
+				req.subframe_config.pcfich_power_offset.tl.tag = NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG;
+				req.num_tlv++;
+				req.subframe_config.pb.tl.tag = NFAPI_SUBFRAME_CONFIG_PB_TAG;
+				req.num_tlv++;
+				req.subframe_config.dl_cyclic_prefix_type.tl.tag = NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG;
+				req.num_tlv++;
+				req.subframe_config.ul_cyclic_prefix_type.tl.tag = NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG;
+				req.num_tlv++;
+	
+				req.rf_config.dl_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG;
+				req.num_tlv++;
+				req.rf_config.ul_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG;
+				req.num_tlv++;
+				req.rf_config.reference_signal_power.tl.tag = NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG;
+				req.num_tlv++;
+				req.rf_config.tx_antenna_ports.tl.tag = NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG;
+				req.num_tlv++;
+				req.rf_config.rx_antenna_ports.tl.tag = NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG;		
+				req.num_tlv++;
+	
+				req.phich_config.phich_resource.tl.tag = NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG;
+				req.num_tlv++;
+				req.phich_config.phich_duration.tl.tag = NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG;
+				req.num_tlv++;
+				req.phich_config.phich_power_offset.tl.tag = NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG;	
+				req.num_tlv++;
+	
+				req.sch_config.primary_synchronization_signal_epre_eprers.tl.tag = NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG;
+				req.num_tlv++;
+				req.sch_config.secondary_synchronization_signal_epre_eprers.tl.tag = NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG;
+				req.num_tlv++;
+				req.sch_config.physical_cell_id.tl.tag = NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG;				
+				req.num_tlv++;
+	
+				req.prach_config.configuration_index.tl.tag = NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG;
+				req.num_tlv++;
+				req.prach_config.root_sequence_index.tl.tag = NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG;
+				req.num_tlv++;
+				req.prach_config.zero_correlation_zone_configuration.tl.tag = NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG;
+				req.num_tlv++;
+				req.prach_config.high_speed_flag.tl.tag = NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG;
+				req.num_tlv++;
+				req.prach_config.frequency_offset.tl.tag = NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG;				
+				req.num_tlv++;
+	
+				req.pusch_config.hopping_mode.tl.tag = NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG;
+				req.num_tlv++;
+				req.pusch_config.hopping_offset.tl.tag = NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG;
+				req.num_tlv++;
+				req.pusch_config.number_of_subbands.tl.tag = NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG;
+				req.num_tlv++;
+	
+				req.pucch_config.delta_pucch_shift.tl.tag = NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG;
+				req.num_tlv++;
+				req.pucch_config.n_cqi_rb.tl.tag = NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG;
+				req.num_tlv++;
+				req.pucch_config.n_an_cs.tl.tag = NFAPI_PUCCH_CONFIG_N_AN_CS_TAG;
+				req.num_tlv++;
+				req.pucch_config.n1_pucch_an.tl.tag = NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG;
+				req.num_tlv++;
+	
+				req.srs_config.bandwidth_configuration.tl.tag = NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG;
+				req.num_tlv++;
+				req.srs_config.max_up_pts.tl.tag = NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG;
+				req.num_tlv++;
+				req.srs_config.srs_subframe_configuration.tl.tag = NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG;
+				req.num_tlv++;
+				req.srs_config.srs_acknack_srs_simultaneous_transmission.tl.tag = NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG;				
+				req.num_tlv++;
+	
+				req.uplink_reference_signal_config.uplink_rs_hopping.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG;
+				req.num_tlv++;
+				req.uplink_reference_signal_config.group_assignment.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG;
+				req.num_tlv++;
+				req.uplink_reference_signal_config.cyclic_shift_1_for_drms.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG;				
+				req.num_tlv++;
+	
+				req.laa_config.ed_threshold_lbt_pdsch.tl.tag = NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_PDSCH_TAG;
+				req.num_tlv++;
+				req.laa_config.ed_threshold_lbt_drs.tl.tag = NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_DRS_TAG;
+				req.num_tlv++;
+				req.laa_config.pd_threshold.tl.tag = NFAPI_LAA_CONFIG_PD_THRESHOLD_TAG;
+				req.num_tlv++;
+				req.laa_config.multi_carrier_type.tl.tag = NFAPI_LAA_CONFIG_MULTI_CARRIER_TYPE_TAG;
+				req.num_tlv++;
+				req.laa_config.multi_carrier_tx.tl.tag = NFAPI_LAA_CONFIG_MULTI_CARRIER_TX_TAG;
+				req.num_tlv++;
+				req.laa_config.multi_carrier_freeze.tl.tag = NFAPI_LAA_CONFIG_MULTI_CARRIER_FREEZE_TAG;
+				req.num_tlv++;
+				req.laa_config.tx_antenna_ports_drs.tl.tag = NFAPI_LAA_CONFIG_TX_ANTENNA_PORTS_FOR_DRS_TAG;
+				req.num_tlv++;
+				req.laa_config.tx_power_drs.tl.tag = NFAPI_LAA_CONFIG_TRANSMISSION_POWER_FOR_DRS_TAG;				
+				req.num_tlv++;
+	
+				req.emtc_config.pbch_repetitions_enable_r13.tl.tag = NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_catm_root_sequence_index.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CATM_ROOT_SEQUENCE_INDEX_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_catm_zero_correlation_zone_configuration.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CATM_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_catm_high_speed_flag.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CATM_HIGH_SPEED_FLAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_0_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_0_configuration_index.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_0_frequency_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_0_starting_subframe_periodicity.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_0_hopping_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_0_hopping_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_1_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_1_configuration_index.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_1_frequency_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_1_starting_subframe_periodicity.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_1_hopping_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_1_hopping_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_2_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_2_configuration_index.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_2_frequency_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_2_starting_subframe_periodicity.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_2_hopping_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_2_hopping_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_3_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_3_configuration_index.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_3_frequency_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_3_starting_subframe_periodicity.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_3_hopping_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG;
+				req.num_tlv++;
+				req.emtc_config.prach_ce_level_3_hopping_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG;
+				req.num_tlv++;
+				req.emtc_config.pucch_interval_ulhoppingconfigcommonmodea.tl.tag = NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG;
+				req.num_tlv++;
+				req.emtc_config.pucch_interval_ulhoppingconfigcommonmodeb.tl.tag = NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG;			
+				req.num_tlv++;
+				
+				req.nb_iot_config.operating_mode.tl.tag = NFAPI_NB_IOT_CONFIG_OPERATING_MODE_TAG;
+				req.nb_iot_config.operating_mode.value = rand_range(0, 3);
+				req.num_tlv++;				
+				req.nb_iot_config.anchor.tl.tag = NFAPI_NB_IOT_CONFIG_ANCHOR_TAG;
+				req.nb_iot_config.anchor.value = rand_range(0, 1);
+				req.num_tlv++;
+				req.nb_iot_config.prb_index.tl.tag = NFAPI_NB_IOT_CONFIG_PRB_INDEX_TAG;
+				req.nb_iot_config.prb_index.value = rand_range(0, 0x1F);
+				req.num_tlv++;
+				req.nb_iot_config.control_region_size.tl.tag = NFAPI_NB_IOT_CONFIG_CONTROL_REGION_SIZE_TAG;
+				req.nb_iot_config.control_region_size.value = rand_range(1, 4);
+				req.num_tlv++;
+				req.nb_iot_config.assumed_crs_aps.tl.tag = NFAPI_NB_IOT_CONFIG_ASSUMED_CRS_APS_TAG;
+				req.nb_iot_config.assumed_crs_aps.value = rand_range(0, 1);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_0_enabled.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_ENABLED_TAG;
+				req.nb_iot_config.nprach_config_0_enabled.value = rand_range(0, 1);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_0_sf_periodicity.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SF_PERIODICITY_TAG;
+				req.nb_iot_config.nprach_config_0_sf_periodicity.value = rand_range(0, 7);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_0_start_time.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_START_TIME_TAG;
+				req.nb_iot_config.nprach_config_0_start_time.value = rand_range(0, 7);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_0_subcarrier_offset.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SUBCARRIER_OFFSET_TAG;
+				req.nb_iot_config.nprach_config_0_subcarrier_offset.value = rand_range(0, 6);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_0_number_of_subcarriers.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_SUBCARRIERS_TAG;
+				req.nb_iot_config.nprach_config_0_number_of_subcarriers.value = rand_range(0, 3);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_0_cp_length.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_CP_LENGTH_TAG;
+				req.nb_iot_config.nprach_config_0_cp_length.value = rand_range(0, 1);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_0_number_of_repetitions_per_attempt.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+				req.nb_iot_config.nprach_config_0_number_of_repetitions_per_attempt.value = rand_range(0, 7);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_1_enabled.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_ENABLED_TAG;
+				req.nb_iot_config.nprach_config_1_enabled.value = rand_range(0, 1);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_1_sf_periodicity.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SF_PERIODICITY_TAG;
+				req.nb_iot_config.nprach_config_1_sf_periodicity.value = rand_range(0, 7);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_1_start_time.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_START_TIME_TAG;
+				req.nb_iot_config.nprach_config_1_start_time.value = rand_range(0, 7);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_1_subcarrier_offset.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SUBCARRIER_OFFSET_TAG;
+				req.nb_iot_config.nprach_config_1_subcarrier_offset.value = rand_range(0, 6);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_1_number_of_subcarriers.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_SUBCARRIERS_TAG;
+				req.nb_iot_config.nprach_config_1_number_of_subcarriers.value = rand_range(0, 3);				
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_1_cp_length.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_CP_LENGTH_TAG;
+				req.nb_iot_config.nprach_config_1_cp_length.value = rand_range(0, 1);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_1_number_of_repetitions_per_attempt.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+				req.nb_iot_config.nprach_config_1_number_of_repetitions_per_attempt.value = rand_range(0, 7);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_2_enabled.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_ENABLED_TAG;
+				req.nb_iot_config.nprach_config_2_enabled.value = rand_range(0, 1);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_2_sf_periodicity.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SF_PERIODICITY_TAG;
+				req.nb_iot_config.nprach_config_2_sf_periodicity.value = rand_range(0, 7);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_2_start_time.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_START_TIME_TAG;
+				req.nb_iot_config.nprach_config_2_start_time.value = rand_range(0, 7);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_2_subcarrier_offset.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SUBCARRIER_OFFSET_TAG;
+				req.nb_iot_config.nprach_config_2_subcarrier_offset.value = rand_range(0, 6);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_2_number_of_subcarriers.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_SUBCARRIERS_TAG;
+				req.nb_iot_config.nprach_config_2_number_of_subcarriers.value = rand_range(0, 3);				
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_2_cp_length.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_CP_LENGTH_TAG;
+				req.nb_iot_config.nprach_config_2_cp_length.value = rand_range(0, 1);
+				req.num_tlv++;
+				req.nb_iot_config.nprach_config_2_number_of_repetitions_per_attempt.tl.tag = NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+				req.nb_iot_config.nprach_config_2_number_of_repetitions_per_attempt.value = rand_range(0, 7);				
+				req.num_tlv++;
+				req.nb_iot_config.three_tone_base_sequence.tl.tag = NFAPI_NB_IOT_CONFIG_THREE_TONE_BASE_SEQUENCE_TAG;
+				req.nb_iot_config.three_tone_base_sequence.value = rand_range(0, 0x0F);				
+				req.num_tlv++;
+				req.nb_iot_config.six_tone_base_sequence.tl.tag = NFAPI_NB_IOT_CONFIG_SIX_TONE_BASE_SEQUENCE_TAG;
+				req.nb_iot_config.six_tone_base_sequence.value = rand_range(0, 0x03);				
+				req.num_tlv++;
+				req.nb_iot_config.twelve_tone_base_sequence.tl.tag = NFAPI_NB_IOT_CONFIG_TWELVE_TONE_BASE_SEQUENCE_TAG;
+				req.nb_iot_config.twelve_tone_base_sequence.value = rand_range(0, 0x1F);				
+				req.num_tlv++;
+				req.nb_iot_config.three_tone_cyclic_shift.tl.tag = NFAPI_NB_IOT_CONFIG_THREE_TONE_CYCLIC_SHIFT_TAG;
+				req.nb_iot_config.three_tone_cyclic_shift.value = rand_range(0, 5); // what is the max
+				req.num_tlv++;
+				req.nb_iot_config.six_tone_cyclic_shift.tl.tag = NFAPI_NB_IOT_CONFIG_SIX_TONE_CYCLIC_SHIFT_TAG;
+				req.nb_iot_config.six_tone_cyclic_shift.value = rand_range(0, 5); // what is the max
+				req.num_tlv++;
+				req.nb_iot_config.dl_gap_config_enable.tl.tag = NFAPI_NB_IOT_CONFIG_DL_GAP_CONFIG_ENABLE_TAG;
+				req.nb_iot_config.dl_gap_config_enable.value = rand_range(0, 1);
+				req.num_tlv++;
+				req.nb_iot_config.dl_gap_threshold.tl.tag = NFAPI_NB_IOT_CONFIG_DL_GAP_THRESHOLD_TAG;
+				req.nb_iot_config.dl_gap_threshold.value = rand_range(0, 3);
+				req.num_tlv++;
+				req.nb_iot_config.dl_gap_periodicity.tl.tag = NFAPI_NB_IOT_CONFIG_DL_GAP_PERIODICITY_TAG;
+				req.nb_iot_config.dl_gap_periodicity.value = rand_range(0, 3);
+				req.num_tlv++;
+				req.nb_iot_config.dl_gap_duration_coefficient.tl.tag = NFAPI_NB_IOT_CONFIG_DL_GAP_DURATION_COEFFICIENT_TAG;
+				req.nb_iot_config.dl_gap_duration_coefficient.value = rand_range(0, 3);
+				req.num_tlv++;
+				
+				req.tdd_frame_structure_config.subframe_assignment.tl.tag = NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG;
+				req.num_tlv++;
+				req.tdd_frame_structure_config.special_subframe_patterns.tl.tag = NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG;		
+				req.num_tlv++;
+				
+				req.l23_config.data_report_mode.tl.tag = NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG;
+				req.num_tlv++;
+				req.l23_config.sfnsf.tl.tag = NFAPI_L23_CONFIG_SFNSF_TAG;				
+				req.num_tlv++;
+			}
+
+			vendor_ext_tlv_2 ve2;
+			memset(&ve2, 0, sizeof(ve2));
+			ve2.tl.tag = VENDOR_EXT_TLV_2_TAG;
+			ve2.dummy = 2016;
+			req.vendor_extension = &ve2.tl;
+
+			nfapi_vnf_config_req(config, p5_idx, &req);
+		}
+		else
+		{
+			printf("[VNF_SIM] param response failed to find pnf %d phy %d\n", p5_idx, resp->header.phy_id);
+		}
+	}
+	else
+	{
+		printf("[VNF_SIM] param response failed to find pnf %d\n", p5_idx);
+	}
+
+	return 0;
+}
+
+int config_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_config_response_t* resp)
+{
+	printf("[VNF_SIM] config response idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+
+
+	nfapi_start_request_t req;
+	memset(&req, 0, sizeof(req));
+	req.header.message_id = NFAPI_START_REQUEST;
+	req.header.phy_id = resp->header.phy_id;
+	nfapi_vnf_start_req(config, p5_idx, &req);
+
+	return 0;
+}
+
+void test_p4_requests(nfapi_vnf_config_t* config, int p5_idx, int phy_id)
+{
+	{
+		nfapi_measurement_request_t req;
+		memset(&req, 0, sizeof(req));
+		req.header.message_id = NFAPI_MEASUREMENT_REQUEST;
+		req.header.phy_id = phy_id;
+		
+		req.dl_rs_tx_power.tl.tag = NFAPI_MEASUREMENT_REQUEST_DL_RS_XTX_POWER_TAG;
+		req.dl_rs_tx_power.value = 42;
+		req.received_interference_power.tl.tag = NFAPI_MEASUREMENT_REQUEST_RECEIVED_INTERFERENCE_POWER_TAG;
+		req.received_interference_power.value = 42;
+		req.thermal_noise_power.tl.tag = NFAPI_MEASUREMENT_REQUEST_THERMAL_NOISE_POWER_TAG;
+		req.thermal_noise_power.value = 42;
+		
+		nfapi_vnf_measurement_req(config, p5_idx, &req);
+	}
+	{
+		nfapi_rssi_request_t lte_req;
+		memset(&lte_req, 0, sizeof(lte_req));
+		lte_req.header.message_id = NFAPI_RSSI_REQUEST;
+		lte_req.header.phy_id = phy_id;
+		
+		lte_req.rat_type = NFAPI_RAT_TYPE_LTE;
+		lte_req.lte_rssi_request.tl.tag = NFAPI_LTE_RSSI_REQUEST_TAG;
+		lte_req.lte_rssi_request.frequency_band_indicator = 2;
+		lte_req.lte_rssi_request.measurement_period = 1000;
+		lte_req.lte_rssi_request.bandwidth = 50;
+		lte_req.lte_rssi_request.timeout = 0;
+		lte_req.lte_rssi_request.number_of_earfcns = 2;
+		lte_req.lte_rssi_request.earfcn[0] = 389;
+		lte_req.lte_rssi_request.earfcn[1] = 123;
+		
+		nfapi_vnf_rssi_request(config, p5_idx, &lte_req);
+		
+		nfapi_rssi_request_t utran_req;
+		memset(&utran_req, 0, sizeof(utran_req));
+		utran_req.header.message_id = NFAPI_RSSI_REQUEST;
+		utran_req.header.phy_id = phy_id;
+		
+		utran_req.rat_type = NFAPI_RAT_TYPE_UTRAN;
+		utran_req.utran_rssi_request.tl.tag = NFAPI_UTRAN_RSSI_REQUEST_TAG;
+		utran_req.utran_rssi_request.frequency_band_indicator = 2;
+		utran_req.utran_rssi_request.measurement_period = 1000;
+		utran_req.utran_rssi_request.timeout = 0;
+		utran_req.utran_rssi_request.number_of_uarfcns = 2;
+		utran_req.utran_rssi_request.uarfcn[0] = 2348;
+		utran_req.utran_rssi_request.uarfcn[1] = 52;
+		
+		nfapi_vnf_rssi_request(config, p5_idx, &utran_req);		
+		
+		
+		nfapi_rssi_request_t geran_req;
+		memset(&geran_req, 0, sizeof(geran_req));
+		geran_req.header.message_id = NFAPI_RSSI_REQUEST;
+		geran_req.header.phy_id = phy_id;
+		
+		geran_req.rat_type = NFAPI_RAT_TYPE_GERAN;
+		geran_req.geran_rssi_request.tl.tag = NFAPI_GERAN_RSSI_REQUEST_TAG;
+		geran_req.geran_rssi_request.frequency_band_indicator = 2;
+		geran_req.geran_rssi_request.measurement_period = 1000;
+		geran_req.geran_rssi_request.timeout = 0;
+		geran_req.geran_rssi_request.number_of_arfcns = 1;
+		geran_req.geran_rssi_request.arfcn[0].arfcn = 34;
+		geran_req.geran_rssi_request.arfcn[0].direction = 0;
+		
+		nfapi_vnf_rssi_request(config, p5_idx, &geran_req);		
+	}
+	{
+		nfapi_cell_search_request_t lte_req;
+		memset(&lte_req, 0, sizeof(lte_req));
+		lte_req.header.message_id = NFAPI_CELL_SEARCH_REQUEST;
+		lte_req.header.phy_id = phy_id;		
+		
+		lte_req.rat_type = NFAPI_RAT_TYPE_LTE;
+		lte_req.lte_cell_search_request.tl.tag = NFAPI_LTE_CELL_SEARCH_REQUEST_TAG;
+		lte_req.lte_cell_search_request.earfcn = 1234;
+		lte_req.lte_cell_search_request.measurement_bandwidth = 50;
+		lte_req.lte_cell_search_request.exhaustive_search = 1;
+		lte_req.lte_cell_search_request.timeout = 1000;
+		lte_req.lte_cell_search_request.number_of_pci = 1;
+		lte_req.lte_cell_search_request.pci[0] = 234;
+		
+		nfapi_vnf_cell_search_request(config, p5_idx, &lte_req);
+		
+		nfapi_cell_search_request_t utran_req;
+		memset(&utran_req, 0, sizeof(utran_req));
+		utran_req.header.message_id = NFAPI_CELL_SEARCH_REQUEST;
+		utran_req.header.phy_id = phy_id;		
+		
+		utran_req.rat_type = NFAPI_RAT_TYPE_UTRAN;
+		utran_req.utran_cell_search_request.tl.tag = NFAPI_UTRAN_CELL_SEARCH_REQUEST_TAG;
+		utran_req.utran_cell_search_request.uarfcn = 1234;
+		utran_req.utran_cell_search_request.exhaustive_search = 0;
+		utran_req.utran_cell_search_request.timeout = 1000;
+		utran_req.utran_cell_search_request.number_of_psc = 1;
+		utran_req.utran_cell_search_request.psc[0] = 234;
+		
+		nfapi_vnf_cell_search_request(config, p5_idx, &utran_req);		
+		
+		nfapi_cell_search_request_t geran_req;
+		memset(&geran_req, 0, sizeof(geran_req));
+		geran_req.header.message_id = NFAPI_CELL_SEARCH_REQUEST;
+		geran_req.header.phy_id = phy_id;		
+		
+		geran_req.rat_type = NFAPI_RAT_TYPE_GERAN;
+		geran_req.geran_cell_search_request.tl.tag = NFAPI_GERAN_CELL_SEARCH_REQUEST_TAG;
+		geran_req.geran_cell_search_request.timeout = 1000;
+		geran_req.geran_cell_search_request.number_of_arfcn = 1;
+		geran_req.geran_cell_search_request.arfcn[0] = 8765;
+		
+		nfapi_vnf_cell_search_request(config, p5_idx, &geran_req);				
+	}
+	{
+		nfapi_broadcast_detect_request_t lte_req;
+		memset(&lte_req, 0, sizeof(lte_req));
+		lte_req.header.message_id = NFAPI_BROADCAST_DETECT_REQUEST;
+		lte_req.header.phy_id = phy_id;		
+		
+		lte_req.rat_type = NFAPI_RAT_TYPE_LTE;
+		lte_req.lte_broadcast_detect_request.tl.tag = NFAPI_LTE_BROADCAST_DETECT_REQUEST_TAG;
+		lte_req.lte_broadcast_detect_request.earfcn = 1234;
+		lte_req.lte_broadcast_detect_request.pci = 50;
+		lte_req.lte_broadcast_detect_request.timeout = 1000;
+		
+		lte_req.pnf_cell_search_state.tl.tag = NFAPI_PNF_CELL_SEARCH_STATE_TAG;
+		lte_req.pnf_cell_search_state.length = 3;
+		
+		nfapi_vnf_broadcast_detect_request(config, p5_idx, &lte_req);
+		
+		nfapi_broadcast_detect_request_t utran_req;
+		memset(&utran_req, 0, sizeof(utran_req));
+		utran_req.header.message_id = NFAPI_BROADCAST_DETECT_REQUEST;
+		utran_req.header.phy_id = phy_id;		
+		
+		utran_req.rat_type = NFAPI_RAT_TYPE_LTE;
+		utran_req.utran_broadcast_detect_request.tl.tag = NFAPI_UTRAN_BROADCAST_DETECT_REQUEST_TAG;
+		utran_req.utran_broadcast_detect_request.uarfcn = 1234;
+		utran_req.utran_broadcast_detect_request.psc = 50;
+		utran_req.utran_broadcast_detect_request.timeout = 1000;
+		
+		utran_req.pnf_cell_search_state.tl.tag = NFAPI_PNF_CELL_SEARCH_STATE_TAG;
+		utran_req.pnf_cell_search_state.length = 3;
+		
+		nfapi_vnf_broadcast_detect_request(config, p5_idx, &utran_req);		
+	}
+	{
+		nfapi_system_information_schedule_request_t lte_req;
+		memset(&lte_req, 0, sizeof(lte_req));
+		lte_req.header.message_id = NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST;
+		lte_req.header.phy_id = phy_id;		
+		
+		lte_req.rat_type = NFAPI_RAT_TYPE_LTE;
+		lte_req.lte_system_information_schedule_request.tl.tag = NFAPI_LTE_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG;
+		lte_req.lte_system_information_schedule_request.earfcn = 1234;
+		lte_req.lte_system_information_schedule_request.pci = 50;
+		lte_req.lte_system_information_schedule_request.downlink_channel_bandwidth = 100;
+		lte_req.lte_system_information_schedule_request.phich_configuration = 3;
+		lte_req.lte_system_information_schedule_request.number_of_tx_antenna = 2;
+		lte_req.lte_system_information_schedule_request.retry_count = 4;
+		lte_req.lte_system_information_schedule_request.timeout = 1000;
+		
+		lte_req.pnf_cell_broadcast_state.tl.tag = NFAPI_PNF_CELL_BROADCAST_STATE_TAG;
+		lte_req.pnf_cell_broadcast_state.length = 3;
+		
+		nfapi_vnf_system_information_schedule_request(config, p5_idx, &lte_req);
+	}
+	{
+		nfapi_system_information_request_t lte_req;
+		memset(&lte_req, 0, sizeof(lte_req));
+		lte_req.header.message_id = NFAPI_SYSTEM_INFORMATION_REQUEST;
+		lte_req.header.phy_id = phy_id;		
+		
+		lte_req.rat_type = NFAPI_RAT_TYPE_LTE;		
+		lte_req.lte_system_information_request.tl.tag = NFAPI_LTE_SYSTEM_INFORMATION_REQUEST_TAG;
+		lte_req.lte_system_information_request.earfcn = 1234;
+		lte_req.lte_system_information_request.pci= 456;
+		lte_req.lte_system_information_request.downlink_channel_bandwidth = 5;
+		lte_req.lte_system_information_request.phich_configuration = 2;
+		lte_req.lte_system_information_request.number_of_tx_antenna = 2;
+		lte_req.lte_system_information_request.number_of_si_periodicity = 1;
+		lte_req.lte_system_information_request.si_periodicity[0].si_periodicity = 3;
+		lte_req.lte_system_information_request.si_periodicity[0].si_index = 3;
+		lte_req.lte_system_information_request.si_window_length = 15;
+		lte_req.lte_system_information_request.timeout = 1000;
+		
+		nfapi_vnf_system_information_request(config, p5_idx, &lte_req);
+		
+		nfapi_system_information_request_t utran_req;
+		memset(&utran_req, 0, sizeof(utran_req));
+		utran_req.header.message_id = NFAPI_SYSTEM_INFORMATION_REQUEST;
+		utran_req.header.phy_id = phy_id;		
+		
+		utran_req.rat_type = NFAPI_RAT_TYPE_UTRAN;
+		utran_req.utran_system_information_request.tl.tag = NFAPI_UTRAN_SYSTEM_INFORMATION_REQUEST_TAG;
+		utran_req.utran_system_information_request.uarfcn = 1234;
+		utran_req.utran_system_information_request.psc = 456;
+		utran_req.utran_system_information_request.timeout = 1000;
+		
+		nfapi_vnf_system_information_request(config, p5_idx, &utran_req);		
+		
+		nfapi_system_information_request_t geran_req;
+		memset(&geran_req, 0, sizeof(geran_req));
+		geran_req.header.message_id = NFAPI_SYSTEM_INFORMATION_REQUEST;
+		geran_req.header.phy_id = phy_id;		
+		
+		geran_req.rat_type = NFAPI_RAT_TYPE_GERAN;
+		geran_req.geran_system_information_request.tl.tag = NFAPI_GERAN_SYSTEM_INFORMATION_REQUEST_TAG;
+		geran_req.geran_system_information_request.arfcn = 1234;
+		geran_req.geran_system_information_request.bsic = 21;
+		geran_req.geran_system_information_request.timeout = 1000;
+		
+		nfapi_vnf_system_information_request(config, p5_idx, &geran_req);	
+	}
+	{
+		nfapi_nmm_stop_request_t req;
+		memset(&req, 0, sizeof(req));
+		req.header.message_id = NFAPI_NMM_STOP_REQUEST;
+		req.header.phy_id = phy_id;		
+		nfapi_vnf_nmm_stop_request(config, p5_idx, &req);	
+	}
+}
+
+
+int start_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_start_response_t* resp)
+{
+	printf("[VNF_SIM] start response idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+
+	vnf_info* vnf = (vnf_info*)(config->user_data);
+	
+	if(vnf->wireshark_test_mode)
+		test_p4_requests(config, p5_idx,  resp->header.phy_id);
+
+	auto find_result = vnf->pnfs.find(p5_idx);
+	if(find_result != vnf->pnfs.end())
+	{
+		pnf_info& pnf = find_result->second;
+		
+		
+		auto found = std::find_if(pnf.phys.begin(), pnf.phys.end(), [&](phy_info& item)
+								  { return item.id == resp->header.phy_id; });
+
+		if(found != pnf.phys.end())
+		{
+			phy_info& phy = (*found);
+
+			vnf_p7_info& p7_vnf = vnf->p7_vnfs[0];
+
+			nfapi_vnf_p7_add_pnf((p7_vnf.config.get()), phy.remote_addr.c_str(), phy.remote_port, phy.id);
+			
+
+		}
+
+
+	}
+	return 0;
+}
+
+
+nfapi_p4_p5_message_header_t* vnf_sim_allocate_p4_p5_vendor_ext(uint16_t message_id, uint16_t* msg_size)
+{
+	if(message_id == P5_VENDOR_EXT_RSP)
+	{
+		*msg_size = sizeof(vendor_ext_p5_rsp);
+		return (nfapi_p4_p5_message_header_t*)malloc(sizeof(vendor_ext_p5_rsp));
+	}
+	return 0;
+}
+void vnf_sim_deallocate_p4_p5_vendor_ext(nfapi_p4_p5_message_header_t* header)
+{
+	free(header);
+}
+int vendor_ext_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_p4_p5_message_header_t* msg)
+{
+	printf("[VNF_SIM] %s\n", __FUNCTION__);
+
+	switch(msg->message_id)
+	{
+		case P5_VENDOR_EXT_RSP:
+			{
+				vendor_ext_p5_rsp* rsp = (vendor_ext_p5_rsp*)msg;
+				printf("[VNF_SIM] P5_VENDOR_EXT_RSP error_code:%d\n", rsp->error_code);
+
+				// send the start request
+	
+				nfapi_pnf_start_request_t req;
+				memset(&req, 0, sizeof(req));
+				req.header.message_id = NFAPI_PNF_START_REQUEST;
+				nfapi_vnf_pnf_start_req(config, p5_idx, &req);
+			}
+			break;
+
+	}
+
+	return 0;
+}
+
+int read_vnf_xml(vnf_info& vnf, const char* xml_file)
+{
+	try
+	{
+		
+		std::ifstream input(xml_file);
+	
+		using boost::property_tree::ptree;
+		ptree pt;
+	
+		read_xml(input, pt);
+		
+		
+	
+		for(const auto& v : pt.get_child("vnf.vnf_p7_list"))
+		{
+			if(v.first == "vnf_p7")
+			{
+				vnf_p7_info vnf_p7;
+				vnf_p7.local_port = v.second.get<unsigned>("port");
+				vnf_p7.local_addr = v.second.get<std::string>("address");
+	
+				vnf_p7.timing_window = v.second.get<unsigned>("timing_window");
+				vnf_p7.periodic_timing_enabled = v.second.get<unsigned>("periodic_timing_enabled");
+				vnf_p7.aperiodic_timing_enabled = v.second.get<unsigned>("aperiodic_timing_enabled");
+				vnf_p7.periodic_timing_period = v.second.get<unsigned>("periodic_timing_window");
+	
+				
+				boost::optional<const boost::property_tree::ptree&> d = v.second.get_child_optional("data.udp");
+				if(d.is_initialized())
+				{
+					vnf_p7.udp.enabled = true;
+					vnf_p7.udp.rx_port = d.get().get<unsigned>("rx_port");
+					vnf_p7.udp.tx_port = d.get().get<unsigned>("tx_port");
+					vnf_p7.udp.tx_addr = d.get().get<std::string>("tx_addr");
+				}
+				else
+				{
+					vnf_p7.udp.enabled = false;
+				}
+				
+				vnf.wireshark_test_mode = v.second.get<unsigned>("wireshark_test_mode", 0);
+	
+				vnf_p7.mac = mac_create(vnf.wireshark_test_mode);
+				vnf_p7.mac->dl_config_req = &mac_dl_config_req;
+				vnf_p7.mac->ul_config_req = &mac_ul_config_req;
+				vnf_p7.mac->hi_dci0_req = &mac_hi_dci0_req;
+				vnf_p7.mac->tx_req = &mac_tx_req;
+	
+				if(vnf_p7.udp.enabled)
+				{
+					mac_start_data(vnf_p7.mac, 
+								   vnf_p7.udp.rx_port, 
+								   vnf_p7.udp.tx_addr.c_str(), 
+								   vnf_p7.udp.tx_port);
+				}
+	
+				vnf.p7_vnfs.push_back(vnf_p7);
+			}
+		}
+	}
+	catch(std::exception& e)
+	{
+		printf("%s", e.what());
+		return -1;
+	}
+	catch(boost::exception& e)
+	{
+		printf("%s", boost::diagnostic_information(e).c_str());
+	}
+
+	struct ifaddrs *ifaddr;
+	getifaddrs(&ifaddr);
+
+
+	while(ifaddr)
+	{
+		int family = ifaddr->ifa_addr->sa_family;
+		if(family == AF_INET)
+		{
+			char host[128];
+			getnameinfo(ifaddr->ifa_addr, sizeof(sockaddr_in), host, sizeof(host),	NULL, 0, 0);
+			printf("%s\n", host);
+		}
+		ifaddr = ifaddr->ifa_next;
+	}
+	
+	return 0;
+
+}
+
+
+int main(int argc, char *argv[])
+{
+	if (argc < 3)
+	{
+		printf("Use parameters: <P5 Port> <xml config file>\n");
+		return 0;
+	}
+
+	set_thread_priority(50);
+
+	vnf_info vnf;
+
+	if(read_vnf_xml(vnf, argv[2]) < 0)
+	{
+		printf("Failed to read xml file>\n");
+		return 0;
+	}
+
+	nfapi_vnf_config_t* config = nfapi_vnf_config_create();
+
+	config->vnf_ipv4 = 1;
+	config->vnf_p5_port = atoi(argv[1]);
+	config->pnf_connection_indication = &pnf_connection_indication_cb;
+	config->pnf_disconnect_indication = &pnf_disconnection_indication_cb;
+	config->pnf_param_resp = &pnf_param_resp_cb;
+	config->pnf_config_resp = &pnf_config_resp_cb;
+	config->pnf_start_resp = &pnf_start_resp_cb;
+	config->param_resp = &param_resp_cb;
+	config->config_resp = &config_resp_cb;
+	config->start_resp = &start_resp_cb;
+	config->vendor_ext = &vendor_ext_cb;
+	
+	
+	
+	config->trace = &vnf_sim_trace;
+	
+	config->malloc = &vnf_allocate;
+	config->free = &vnf_deallocate;
+
+	config->user_data = &vnf;
+
+	config->codec_config.unpack_vendor_extension_tlv = &vnf_sim_unpack_vendor_extension_tlv;
+	config->codec_config.pack_vendor_extension_tlv = &vnf_sim_pack_vendor_extension_tlv;
+
+	config->codec_config.unpack_p4_p5_vendor_extension = &vnf_sim_unpack_p4_p5_vendor_extension;
+	config->codec_config.pack_p4_p5_vendor_extension = &vnf_sim_pack_p4_p5_vendor_extension;
+	config->allocate_p4_p5_vendor_ext = &vnf_sim_allocate_p4_p5_vendor_ext;
+	config->deallocate_p4_p5_vendor_ext = &vnf_sim_deallocate_p4_p5_vendor_ext;
+	config->codec_config.allocate = &vnf_allocate;
+	config->codec_config.deallocate = &vnf_deallocate;
+
+
+	printf("Calling nfapi_vnf_start\n");
+	return nfapi_vnf_start(config);
+}
diff --git a/nfapi/open-nFAPI/xml/pnf_phy_1_A.xml b/nfapi/open-nFAPI/xml/pnf_phy_1_A.xml
new file mode 100644
index 0000000000000000000000000000000000000000..45f8f468319d5a9ef3fe401a5ecb8e6b644f7111
--- /dev/null
+++ b/nfapi/open-nFAPI/xml/pnf_phy_1_A.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pnf>
+	<sync_mode>0</sync_mode>
+	<location_mode>0</location_mode>
+	<location_coordinates></location_coordinates>
+
+	<dl_config_timing>500</dl_config_timing>
+	<ul_config_timing>500</ul_config_timing>
+	<tx_timing>500</tx_timing>
+	<hi_dci0_timing>500</hi_dci0_timing>
+
+	<max_phys>1</max_phys>
+	<max_total_bandwidth>30</max_total_bandwidth>
+	<max_total_num_dl_layers>1</max_total_num_dl_layers>
+	<max_total_num_ul_layers>1</max_total_num_ul_layers>
+
+	<shared_bands>0</shared_bands>
+	<shared_pas>0</shared_pas>
+
+	<maximum_total_power>0</maximum_total_power>
+
+	<oui>ALPHA</oui>
+
+
+	<phys>
+		<phy>
+			<index>88</index>
+			<port>2500</port>
+			<address>192.168.1.74</address>
+
+			<duplex_mode>1</duplex_mode>
+
+			<downlink_channel_bandwidth_support>22</downlink_channel_bandwidth_support>
+			<uplink_channel_bandwidth_support>22</uplink_channel_bandwidth_support>
+
+			<number_of_dl_layers>1</number_of_dl_layers>
+			<number_of_ul_layers>1</number_of_ul_layers>
+
+			<3gpp_release_supported>31</3gpp_release_supported>
+
+			<nmm_modes_supported>0</nmm_modes_supported>
+			
+			<dl_ues_per_subframe>8</dl_ues_per_subframe>
+			<ul_ues_per_subframe>8</ul_ues_per_subframe>
+
+			<!-- todo adn the other release parameters -->
+
+			<rfs>
+				<index>0</index>
+			</rfs>
+			<excluded_rfs>
+				<index>1</index>
+			</excluded_rfs>
+
+			<data>
+				<udp>
+					<rx_port>5201</rx_port>
+					<tx_addr>192.168.1.28</tx_addr>
+					<tx_port>5200</tx_port>
+				</udp>
+			</data>
+		</phy>
+	</phys>
+	<rfs>
+		<rf>
+			<index>0</index>
+			<band>2</band>
+			<max_transmit_power>-30</max_transmit_power>
+			<min_transmit_power>-230</min_transmit_power>
+			<num_antennas_supported>2</num_antennas_supported>
+			<min_downlink_frequency>1890</min_downlink_frequency>
+			<max_downlink_frequency>1890</max_downlink_frequency>
+			<max_uplink_frequency>1890</max_uplink_frequency>
+			<min_uplink_frequency>1890</min_uplink_frequency>
+		</rf>
+		<rf>
+			<index>1</index>
+			<band>3</band>
+			<max_transmit_power>-30</max_transmit_power>
+			<min_transmit_power>-230</min_transmit_power>
+			<num_antennas_supported>2</num_antennas_supported>
+			<min_downlink_frequency>1890</min_downlink_frequency>
+			<max_downlink_frequency>1890</max_downlink_frequency>
+			<max_uplink_frequency>1890</max_uplink_frequency>
+			<min_uplink_frequency>1890</min_uplink_frequency>
+		</rf>
+	</rfs>
+</pnf>
diff --git a/nfapi/open-nFAPI/xml/pnf_phy_1_A_ws.xml b/nfapi/open-nFAPI/xml/pnf_phy_1_A_ws.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5eb02841481391ec81e15d965d43431bd15af450
--- /dev/null
+++ b/nfapi/open-nFAPI/xml/pnf_phy_1_A_ws.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pnf>
+	<wireshark_test_mode>1</wireshark_test_mode>
+	
+	<sync_mode>0</sync_mode>
+	<location_mode>0</location_mode>
+	<location_coordinates></location_coordinates>
+
+	<dl_config_timing>500</dl_config_timing>
+	<ul_config_timing>500</ul_config_timing>
+	<tx_timing>500</tx_timing>
+	<hi_dci0_timing>500</hi_dci0_timing>
+
+	<max_phys>1</max_phys>
+	<max_total_bandwidth>30</max_total_bandwidth>
+	<max_total_num_dl_layers>1</max_total_num_dl_layers>
+	<max_total_num_ul_layers>1</max_total_num_ul_layers>
+
+	<shared_bands>0</shared_bands>
+	<shared_pas>0</shared_pas>
+
+	<maximum_total_power>0</maximum_total_power>
+
+	<oui>ALPHA</oui>
+
+
+	<phys>
+		<phy>
+			<index>88</index>
+			<port>2500</port>
+			<address>127.0.0.1</address>
+
+			<duplex_mode>1</duplex_mode>
+
+			<downlink_channel_bandwidth_support>22</downlink_channel_bandwidth_support>
+			<uplink_channel_bandwidth_support>22</uplink_channel_bandwidth_support>
+
+			<number_of_dl_layers>1</number_of_dl_layers>
+			<number_of_ul_layers>1</number_of_ul_layers>
+
+			<3gpp_release_supported>31</3gpp_release_supported>
+
+			<nmm_modes_supported>0</nmm_modes_supported>
+			
+			<dl_ues_per_subframe>8</dl_ues_per_subframe>
+			<ul_ues_per_subframe>8</ul_ues_per_subframe>
+
+			<!-- todo adn the other release parameters -->
+
+			<rfs>
+				<index>0</index>
+			</rfs>
+			<excluded_rfs>
+				<index>1</index>
+			</excluded_rfs>
+
+			<data>
+				<udp>
+					<rx_port>7722</rx_port>
+					<tx_addr>127.0.0.1</tx_addr>
+					<tx_port>7733</tx_port>
+				</udp>
+			</data>
+		</phy>
+	</phys>
+	<rfs>
+		<rf>
+			<index>0</index>
+			<band>2</band>
+			<max_transmit_power>-30</max_transmit_power>
+			<min_transmit_power>-230</min_transmit_power>
+			<num_antennas_supported>2</num_antennas_supported>
+			<min_downlink_frequency>1890</min_downlink_frequency>
+			<max_downlink_frequency>1890</max_downlink_frequency>
+			<max_uplink_frequency>1890</max_uplink_frequency>
+			<min_uplink_frequency>1890</min_uplink_frequency>
+		</rf>
+		<rf>
+			<index>1</index>
+			<band>3</band>
+			<max_transmit_power>-30</max_transmit_power>
+			<min_transmit_power>-230</min_transmit_power>
+			<num_antennas_supported>2</num_antennas_supported>
+			<min_downlink_frequency>1890</min_downlink_frequency>
+			<max_downlink_frequency>1890</max_downlink_frequency>
+			<max_uplink_frequency>1890</max_uplink_frequency>
+			<min_uplink_frequency>1890</min_uplink_frequency>
+		</rf>
+	</rfs>
+</pnf>
diff --git a/nfapi/open-nFAPI/xml/pnf_phy_1_B.xml b/nfapi/open-nFAPI/xml/pnf_phy_1_B.xml
new file mode 100644
index 0000000000000000000000000000000000000000..302e1e19c537ec8a08a8f91ea8ba1715687bf4d1
--- /dev/null
+++ b/nfapi/open-nFAPI/xml/pnf_phy_1_B.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pnf>
+	<sync_mode>0</sync_mode>
+	<location_mode>0</location_mode>
+	<location_coordinates></location_coordinates>
+
+	<dl_config_timing>500</dl_config_timing>
+	<ul_config_timing>500</ul_config_timing>
+	<tx_timing>500</tx_timing>
+	<hi_dci0_timing>500</hi_dci0_timing>
+
+	<max_phys>1</max_phys>
+	<max_total_bandwidth>30</max_total_bandwidth>
+	<max_total_num_dl_layers>1</max_total_num_dl_layers>
+	<max_total_num_ul_layers>1</max_total_num_ul_layers>
+
+	<shared_bands>0</shared_bands>
+	<shared_pas>0</shared_pas>
+
+	<maximum_total_power>0</maximum_total_power>
+
+	<oui>ALPHA</oui>
+
+
+	<phys>
+		<phy>
+			<index>89</index>
+			<port>2510</port>
+			<address>127.0.0.1</address>
+
+			<duplex_mode>1</duplex_mode>
+
+			<downlink_channel_bandwidth_support>22</downlink_channel_bandwidth_support>
+			<uplink_channel_bandwidth_support>22</uplink_channel_bandwidth_support>
+
+			<number_of_dl_layers>1</number_of_dl_layers>
+			<number_of_ul_layers>1</number_of_ul_layers>
+
+			<3gpp_release_supported>31</3gpp_release_supported>
+
+			<nmm_modes_supported>0</nmm_modes_supported>
+			
+			<dl_ues_per_subframe>8</dl_ues_per_subframe>
+			<ul_ues_per_subframe>8</ul_ues_per_subframe>
+
+			<!-- todo adn the other release parameters -->
+
+			<rfs>
+				<index>0</index>
+			</rfs>
+			<excluded_rfs>
+				<index>1</index>
+			</excluded_rfs>
+
+			<data>
+				<udp>
+					<rx_port>7744</rx_port>
+					<tx_addr>127.0.0.1</tx_addr>
+					<tx_port>7755</tx_port>
+				</udp>
+			</data>
+		</phy>
+	</phys>
+	<rfs>
+		<rf>
+			<index>0</index>
+			<band>2</band>
+			<max_transmit_power>-30</max_transmit_power>
+			<min_transmit_power>-230</min_transmit_power>
+			<num_antennas_supported>2</num_antennas_supported>
+			<min_downlink_frequency>1890</min_downlink_frequency>
+			<max_downlink_frequency>1890</max_downlink_frequency>
+			<max_uplink_frequency>1890</max_uplink_frequency>
+			<min_uplink_frequency>1890</min_uplink_frequency>
+		</rf>
+		<rf>
+			<index>1</index>
+			<band>3</band>
+			<max_transmit_power>-30</max_transmit_power>
+			<min_transmit_power>-230</min_transmit_power>
+			<num_antennas_supported>2</num_antennas_supported>
+			<min_downlink_frequency>1890</min_downlink_frequency>
+			<max_downlink_frequency>1890</max_downlink_frequency>
+			<max_uplink_frequency>1890</max_uplink_frequency>
+			<min_uplink_frequency>1890</min_uplink_frequency>
+		</rf>
+	</rfs>
+</pnf>
diff --git a/nfapi/open-nFAPI/xml/pnf_phy_2_A.xml b/nfapi/open-nFAPI/xml/pnf_phy_2_A.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b820fa135e5c70bac7ee133d8509291bbb41ac9e
--- /dev/null
+++ b/nfapi/open-nFAPI/xml/pnf_phy_2_A.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pnf>
+	<sync_mode>0</sync_mode>
+	<location_mode>0</location_mode>
+	<location_coordinates></location_coordinates>
+
+	<dl_config_timing>500</dl_config_timing>
+	<ul_config_timing>500</ul_config_timing>
+	<tx_timing>500</tx_timing>
+	<hi_dci0_timing>500</hi_dci0_timing>
+
+	<max_phys>1</max_phys>
+	<max_total_bandwidth>30</max_total_bandwidth>
+	<max_total_num_dl_layers>1</max_total_num_dl_layers>
+	<max_total_num_ul_layers>1</max_total_num_ul_layers>
+
+	<shared_bands>0</shared_bands>
+	<shared_pas>0</shared_pas>
+
+	<maximum_total_power>0</maximum_total_power>
+
+	<oui>ALPHA</oui>
+	
+	<phys>
+		<phy>
+			<index>88</index>
+			<port>2500</port>
+			<address>127.0.0.1</address>
+
+			<duplex_mode>1</duplex_mode>
+			<downlink_channel_bandwidth_support>22</downlink_channel_bandwidth_support>
+			<uplink_channel_bandwidth_support>22</uplink_channel_bandwidth_support>
+			<number_of_dl_layers>1</number_of_dl_layers>
+			<number_of_ul_layers>1</number_of_ul_layers>
+			<3gpp_release_supported>31</3gpp_release_supported>
+			<nmm_modes_supported>0</nmm_modes_supported>
+			<dl_ues_per_subframe>8</dl_ues_per_subframe>
+			<ul_ues_per_subframe>8</ul_ues_per_subframe>
+
+			<rfs>
+				<index>0</index>
+			</rfs>
+			<excluded_rfs/>
+		</phy>
+		<phy>
+			<index>44</index>
+			<port>2600</port>
+			<address>127.0.0.1</address>
+
+			<duplex_mode>1</duplex_mode>
+			<downlink_channel_bandwidth_support>22</downlink_channel_bandwidth_support>
+			<uplink_channel_bandwidth_support>22</uplink_channel_bandwidth_support>
+			<number_of_dl_layers>1</number_of_dl_layers>
+			<number_of_ul_layers>1</number_of_ul_layers>
+			<3gpp_release_supported>31</3gpp_release_supported>
+			<nmm_modes_supported>0</nmm_modes_supported>
+			<dl_ues_per_subframe>8</dl_ues_per_subframe>
+			<ul_ues_per_subframe>8</ul_ues_per_subframe>
+
+			<rfs>
+				<index>1</index>
+			</rfs>
+			<excluded_rfs/>
+		</phy>
+	</phys>
+	<rfs>
+		<rf>
+			<index>0</index>
+			<band>2</band>
+			<max_transmit_power>-30</max_transmit_power>
+			<min_transmit_power>-230</min_transmit_power>
+			<num_antennas_supported>2</num_antennas_supported>
+			<min_downlink_frequency>1890</min_downlink_frequency>
+			<max_downlink_frequency>1890</max_downlink_frequency>
+			<max_uplink_frequency>1890</max_uplink_frequency>
+			<min_uplink_frequency>1890</min_uplink_frequency>
+		</rf>
+		<rf>
+			<index>1</index>
+			<band>4</band>
+			<max_transmit_power>-30</max_transmit_power>
+			<min_transmit_power>-230</min_transmit_power>
+			<num_antennas_supported>2</num_antennas_supported>
+			<min_downlink_frequency>1890</min_downlink_frequency>
+			<max_downlink_frequency>1890</max_downlink_frequency>
+			<max_uplink_frequency>1890</max_uplink_frequency>
+			<min_uplink_frequency>1890</min_uplink_frequency>
+		</rf>
+	</rfs>
+</pnf>
diff --git a/nfapi/open-nFAPI/xml/vnf_A.xml b/nfapi/open-nFAPI/xml/vnf_A.xml
new file mode 100644
index 0000000000000000000000000000000000000000..3791239ce7821929893d206605b487efd3e4a4f3
--- /dev/null
+++ b/nfapi/open-nFAPI/xml/vnf_A.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<vnf>
+	<vnf_p7_list>
+		<vnf_p7>
+			<port>5201</port>
+			<address>192.168.1.28</address>
+			<timing_window>10</timing_window>
+			<periodic_timing_enabled>0</periodic_timing_enabled>
+			<periodic_timing_window>0</periodic_timing_window>
+			<aperiodic_timing_enabled>0</aperiodic_timing_enabled>
+
+			<data>
+				<udp>
+					<rx_port>8891</rx_port>
+					<tx_addr>192.168.1.28</tx_addr>
+					<tx_port>8892</tx_port>
+				</udp>
+			</data>
+		</vnf_p7>
+	</vnf_p7_list>
+</vnf>
diff --git a/nfapi/open-nFAPI/xml/vnf_A_ws.xml b/nfapi/open-nFAPI/xml/vnf_A_ws.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c26adc3cfa11980c9f9697eceefe6de602eb6846
--- /dev/null
+++ b/nfapi/open-nFAPI/xml/vnf_A_ws.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<vnf>
+	
+	<vnf_p7_list>
+		<vnf_p7>
+			<wireshark_test_mode>1</wireshark_test_mode>
+			<port>5200</port>
+			<address>127.0.0.1</address>
+			<timing_window>10</timing_window>
+			<periodic_timing_enabled>0</periodic_timing_enabled>
+			<periodic_timing_window>0</periodic_timing_window>
+			<aperiodic_timing_enabled>0</aperiodic_timing_enabled>
+
+			<data>
+				<udp>
+					<rx_port>8891</rx_port>
+					<tx_addr>127.0.0.1</tx_addr>
+					<tx_port>8892</tx_port>
+				</udp>
+			</data>
+		</vnf_p7>
+	</vnf_p7_list>
+</vnf>
diff --git a/nfapi/open-nfapi.oai.patch b/nfapi/open-nfapi.oai.patch
new file mode 100644
index 0000000000000000000000000000000000000000..5b91e3675b0ab0483cd68d940595c58e2060ea29
--- /dev/null
+++ b/nfapi/open-nfapi.oai.patch
@@ -0,0 +1,20010 @@
+diff --git a/common/public_inc/debug.h b/common/public_inc/debug.h
+index 05e9870..14f97a1 100644
+--- a/common/public_inc/debug.h
++++ b/common/public_inc/debug.h
+@@ -39,7 +39,8 @@ extern nfapi_trace_fn_t nfapi_trace_g;
+ extern nfapi_trace_level_t nfapi_trace_level_g;
+ 
+ /*! NFAPI trace macro */
+-#define NFAPI_TRACE(level, format, ...) { if(nfapi_trace_g && ((nfapi_trace_level_t)level <= nfapi_trace_level_g)) (*nfapi_trace_g)(level, format, ##__VA_ARGS__); }
++//#define NFAPI_TRACE(level, format, ...) { if(nfapi_trace_g && ((nfapi_trace_level_t)level <= nfapi_trace_level_g)) (*nfapi_trace_g)(level, format, ##__VA_ARGS__); }
++#define NFAPI_TRACE(level, format, ...) { if (nfapi_trace_g) (*nfapi_trace_g)(level, format, ##__VA_ARGS__); }
+ 
+ /*! Function to change the trace level 
+  * \param new_level The modified trace level
+diff --git a/nfapi/public_inc/nfapi_interface.h b/nfapi/public_inc/nfapi_interface.h
+index 2d58c2a..f665d11 100644
+--- a/nfapi/public_inc/nfapi_interface.h
++++ b/nfapi/public_inc/nfapi_interface.h
+@@ -1772,7 +1772,7 @@ typedef struct {
+ 	uint8_t number_of_cc;
+ 	struct {
+ 		uint8_t ri_size;
+-		uint8_t dl_cqi_pmi_size;
++		uint8_t dl_cqi_pmi_size[8];
+ 	} cc[NFAPI_MAX_CC];
+ } nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t;
+ 
+diff --git a/nfapi/src/nfapi.c b/nfapi/src/nfapi.c
+index 0e06963..3f017bc 100644
+--- a/nfapi/src/nfapi.c
++++ b/nfapi/src/nfapi.c
+@@ -823,6 +823,10 @@ uint8_t pack_tlv(uint16_t tag, void *tlv, uint8_t **ppWritePackedMsg, uint8_t *e
+ 		{
+ 			NFAPI_TRACE(NFAPI_TRACE_WARN, "Warning pack_tlv tag 0x%x does not match expected 0x%x\n", tl->tag, tag);
+ 		}
++                else
++                {
++			//NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning pack_tlv tag 0x%x ZERO does not match expected 0x%x\n", tl->tag, tag);
++                }
+ 	}
+ 
+ 	return 1;
+diff --git a/nfapi/src/nfapi_p7.c b/nfapi/src/nfapi_p7.c
+index a3b0141..69ff860 100644
+--- a/nfapi/src/nfapi_p7.c
++++ b/nfapi/src/nfapi_p7.c
+@@ -111,6 +111,8 @@ static uint8_t pack_dl_config_dci_dl_pdu_rel8_value(void* tlv, uint8_t **ppWrite
+ {
+ 	nfapi_dl_config_dci_dl_pdu_rel8_t* value = (nfapi_dl_config_dci_dl_pdu_rel8_t*)tlv;
+ 	
++        //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() dci_format:%u\n", __FUNCTION__, value->dci_format);
++
+ 	return ( push8(value->dci_format, ppWritePackedMsg, end) &&
+ 			 push8(value->cce_idx, ppWritePackedMsg, end) &&
+ 			 push8(value->aggregation_level, ppWritePackedMsg, end) &&
+@@ -234,6 +236,8 @@ static uint8_t pack_dl_config_bch_pdu_rel8_value(void* tlv, uint8_t **ppWritePac
+ {
+ 	nfapi_dl_config_bch_pdu_rel8_t* value = (nfapi_dl_config_bch_pdu_rel8_t*)tlv;
+ 	
++        //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s()\n", __FUNCTION__);
++
+ 	return( push16(value->length, ppWritePackedMsg, end) &&
+ 			push16(value->pdu_index, ppWritePackedMsg, end) &&
+ 			push16(value->transmission_power, ppWritePackedMsg, end));
+@@ -545,6 +549,8 @@ static uint8_t pack_dl_config_request_body_value(void* tlv, uint8_t **ppWritePac
+ {
+ 	nfapi_dl_config_request_body_t* value = (nfapi_dl_config_request_body_t*)tlv;
+ 
++        //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() dci:%u pdu:%u pdsch:%u rnti:%u pcfich:%u\n", __FUNCTION__, value->number_dci, value->number_pdu, value->number_pdsch_rnti, value->transmission_power_pcfich);
++
+ 	if(!(push8(value->number_pdcch_ofdm_symbols, ppWritePackedMsg, end) &&
+ 		 push8(value->number_dci, ppWritePackedMsg, end) &&
+ 		 push16(value->number_pdu, ppWritePackedMsg, end) &&
+@@ -574,6 +580,8 @@ static uint8_t pack_dl_config_request_body_value(void* tlv, uint8_t **ppWritePac
+ 		{
+ 			case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
+ 				{
++                                  //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE\n", __FUNCTION__);
++
+ 					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel8_value) &&
+ 					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel9_value) &&
+ 					pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel10_value) &&
+@@ -587,6 +595,8 @@ static uint8_t pack_dl_config_request_body_value(void* tlv, uint8_t **ppWritePac
+ 				break;
+ 			case NFAPI_DL_CONFIG_BCH_PDU_TYPE:
+ 				{
++                                  //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() NFAPI_DL_CONFIG_BCH_PDU_TYPE\n", __FUNCTION__);
++
+ 					if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG, &pdu->bch_pdu.bch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_bch_pdu_rel8_value)))
+ 						return 0;
+ 				}
+@@ -684,10 +694,21 @@ static uint8_t pack_dl_config_request(void *msg, uint8_t **ppWritePackedMsg, uin
+ {
+ 	nfapi_dl_config_request_t *pNfapiMsg = (nfapi_dl_config_request_t*)msg;
+ 	
+-	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+-			 pack_tlv(NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, ppWritePackedMsg, end, &pack_dl_config_request_body_value) &&
+-			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
++	//return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
++			 //pack_tlv(NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, ppWritePackedMsg, end, &pack_dl_config_request_body_value) &&
++			 //pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
++        { 
++          uint8_t x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end);
++          uint8_t y = pack_tlv(NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, ppWritePackedMsg, end, &pack_dl_config_request_body_value);
++          uint8_t z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
+ 
++          if (!x || !y || !z)
++          {
++            NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST x:%u y:%u z:%u \n", __FUNCTION__,x,y,z);
++          }
++
++          return x && y && z;
++        }
+ }
+ 
+ static uint8_t pack_ul_config_request_ulsch_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t * end)
+@@ -796,9 +817,10 @@ static uint8_t pack_ul_config_request_cqi_ri_rel9_value(void *tlv, uint8_t **ppW
+ 					if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].ri_size, ppWritePackedMsg, end) == 0)
+ 						return 0;
+ 
+-					if(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].ri_size > 0)
++                                        uint8_t j;
++                                        for(j = 0; j < 8; ++j)
+ 					{
+-						if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].dl_cqi_pmi_size, ppWritePackedMsg, end) == 0)
++                                              if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].dl_cqi_pmi_size[j], ppWritePackedMsg, end) == 0)
+ 							return 0;
+ 					}
+ 				}
+@@ -1518,7 +1540,21 @@ static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg,
+ 		for(j = 0; j < pdu->num_segments; ++j)
+ 		{
+ 			// Use -1 as it is unbounded 
+-			if(pusharray8(pdu->segments[j].segment_data, (uint32_t)(-1), pdu->segments[j].segment_length, ppWritePackedMsg, end) == 0)
++			// DJP - does not handle -1
++                        // DJP - if(pusharray8(pdu->segments[j].segment_data, (uint32_t)(-1), pdu->segments[j].segment_length, ppWritePackedMsg, end) == 0)
++			int push_ret = pusharray8(pdu->segments[j].segment_data, 65535, pdu->segments[j].segment_length, ppWritePackedMsg, end);
++                        
++                        if (0 && pdu->segments[j].segment_length == 3)
++                        {
++                          NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, 
++                          pdu->segments[j].segment_data[0], 
++                          pdu->segments[j].segment_data[1], 
++                          pdu->segments[j].segment_data[2]
++                          );
++                        }
++                        //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() segment_data:%p segment_length:%u pusharray8()=%d\n", __FUNCTION__, pdu->segments[j].segment_data, pdu->segments[j].segment_length, push_ret);
++
++                        if (push_ret == 0)
+ 			{
+ 				return 0;
+ 			}
+@@ -1532,9 +1568,13 @@ static uint8_t pack_tx_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e
+ {
+ 	nfapi_tx_request_t *pNfapiMsg = (nfapi_tx_request_t*)msg;
+ 	
+-	return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
+-			 pack_tlv(NFAPI_TX_REQUEST_BODY_TAG, &pNfapiMsg->tx_request_body, ppWritePackedMsg, end, &pack_tx_request_body_value) &&
+-			 pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
++	int x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end);
++        int y = pack_tlv(NFAPI_TX_REQUEST_BODY_TAG, &pNfapiMsg->tx_request_body, ppWritePackedMsg, end, &pack_tx_request_body_value);
++        int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
++
++        //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() x:%d y:%d z:%d\n", __FUNCTION__, x, y, z);
++
++        return x && y && z;
+ }
+ 
+ static uint8_t pack_rx_ue_information_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+@@ -1844,6 +1884,8 @@ static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWriteP
+ {
+ 	nfapi_rx_indication_body_t* value = (nfapi_rx_indication_body_t*)tlv;
+ 
++        //printf("RX ULSCH BODY\n");
++
+ 	if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0)
+ 		return 0;
+ 
+@@ -1851,21 +1893,26 @@ static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWriteP
+ 	uint16_t i = 0;
+ 	uint16_t offset = 2; // taking into account the number_of_pdus
+ 	uint16_t total_number_of_pdus = value->number_of_pdus;
++        //printf("ULSCH:pdus:%d\n", total_number_of_pdus);
++
+ 	for(i = 0; i < total_number_of_pdus; ++i)
+ 	{
+ 		nfapi_rx_indication_pdu_t* pdu = &(value->rx_pdu_list[i]);
+ 		if(pdu->rx_ue_information.tl.tag == NFAPI_RX_UE_INFORMATION_TAG)
+ 		{
++                  //printf("NFAPI_RX_UE_INFORMATION_TAG\n");
+ 			offset += 4 + 6; 
+ 		}
+ 				
+ 		if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG)
+ 		{
++                  //printf("NFAPI_RX_INDICATION_REL8_TAG\n");
+ 			offset += 4 + 7;
+ 		}
+ 
+ 		if(pdu->rx_indication_rel9.tl.tag == NFAPI_RX_INDICATION_REL9_TAG)
+ 		{
++                  //printf("NFAPI_RX_INDICATION_REL9_TAG\n");
+ 			offset += 4 + 2;
+ 		}
+ 	}
+@@ -2592,11 +2639,16 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
+ 		return -1;
+ 	}
+ 
++        if (pMessageHeader->message_id != NFAPI_TIMING_INFO)
++        {
++          //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() message_id:0x%04x phy_id:%u m_segment_sequence:%u timestamp:%u\n", __FUNCTION__, pMessageHeader->message_id, pMessageHeader->phy_id, pMessageHeader->m_segment_sequence, pMessageHeader->transmit_timestamp);
++        }
+ 	// look for the specific message
+ 	uint8_t result = 0;
+ 	switch (pMessageHeader->message_id)
+ 	{
+ 		case NFAPI_DL_CONFIG_REQUEST:
++                  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST\n", __FUNCTION__);
+ 			result = pack_dl_config_request(pMessageHeader, &pWritePackedMessage, end, config);
+ 			break;
+ 
+@@ -2609,6 +2661,7 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
+ 			break;
+ 
+ 		case NFAPI_TX_REQUEST:
++                        //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_TX_REQUEST\n", __FUNCTION__);
+ 			result = pack_tx_request(pMessageHeader, &pWritePackedMessage, end, config);
+ 			break;
+ 
+@@ -2621,6 +2674,7 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
+ 			break;
+ 
+ 		case NFAPI_RX_ULSCH_INDICATION:
++                        //printf("RX ULSCH\n");
+ 			result = pack_rx_ulsch_indication(pMessageHeader, &pWritePackedMessage, end, config);
+ 			break;
+ 
+@@ -3482,9 +3536,10 @@ static uint8_t unpack_ul_config_cqi_ri_info_rel9_value(void *tlv, uint8_t **ppRe
+ 					if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].ri_size, end) == 0)
+ 						return 0;
+ 
+-					if(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].ri_size > 0)
++                                        uint8_t j;
++                                        for(j = 0; j < 8; ++j)
+ 					{
+-						if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].dl_cqi_pmi_size, end) == 0)
++						if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].dl_cqi_pmi_size[j], end) == 0)
+ 							return 0;
+ 					}
+ 				}
+@@ -4394,6 +4449,14 @@ static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
+ 					{
+ 						if(!pullarray8(ppReadPackedMsg, pdu->segments[0].segment_data, pdu->segments[0].segment_length, pdu->segments[0].segment_length, end))
+ 							return 0;
++                                                if (0 && pdu->segments[0].segment_length == 3)
++                                                {
++                                                  NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, 
++                                                      pdu->segments[0].segment_data[0], 
++                                                      pdu->segments[0].segment_data[1], 
++                                                      pdu->segments[0].segment_data[2]
++                                                      );
++                                                }
+ 					}
+ 					else
+ 					{
+diff --git a/pnf/public_inc/nfapi_pnf_interface.h b/pnf/public_inc/nfapi_pnf_interface.h
+index f93624d..b25caf2 100644
+--- a/pnf/public_inc/nfapi_pnf_interface.h
++++ b/pnf/public_inc/nfapi_pnf_interface.h
+@@ -319,10 +319,10 @@ typedef struct nfapi_pnf_config
+  *  0 will be returned if it fails.
+  * 
+  * \code
+- * nfapi_pnf_config_t* config = nfapi_pnf_config_create();
++ * nfapi_pnf_config_t* config = nfapi_pnf_config_create(void);
+  * \endcode
+  */
+-nfapi_pnf_config_t* nfapi_pnf_config_create();
++nfapi_pnf_config_t* nfapi_pnf_config_create(void);
+ 
+ /*! Delete a pnf configuration 
+  * \param config A pointer to a pnf configuraiton
+@@ -681,7 +681,7 @@ typedef struct nfapi_pnf_p7_config
+ /*! Create and initialise a nfapi_pnf_p7_config structure
+  * \return A pointer to a PNF P7 config structure
+  */
+-nfapi_pnf_p7_config_t* nfapi_pnf_p7_config_create();
++nfapi_pnf_p7_config_t* nfapi_pnf_p7_config_create(void);
+ 
+ /*! Delete an nfapi_pnf_p7_config structure
+  * \param config 
+diff --git a/pnf/src/pnf.c b/pnf/src/pnf.c
+index d6cf364..d0a7fa6 100644
+--- a/pnf/src/pnf.c
++++ b/pnf/src/pnf.c
+@@ -412,10 +412,10 @@ void pnf_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
+ 	{
+ 		nfapi_start_request_t req;
+ 	
+-		NFAPI_TRACE(NFAPI_TRACE_INFO, "START.request received\n");
+-	
+ 		nfapi_pnf_config_t* config = &(pnf->_public);
+ 	
++		NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() START.request received state:%d\n", __FUNCTION__, config->state);
++	
+ 		// unpack the message
+ 		if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
+ 		{
+diff --git a/pnf/src/pnf_interface.c b/pnf/src/pnf_interface.c
+index 74f29a0..7310fc0 100644
+--- a/pnf/src/pnf_interface.c
++++ b/pnf/src/pnf_interface.c
+@@ -76,6 +76,7 @@ int nfapi_pnf_start(nfapi_pnf_config_t* config)
+ 
+ 		sleep(1);
+ 	}
++	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() terminate=1 - EXITTING............\n", __FUNCTION__);
+ 
+ 	return 0;
+ }
+@@ -227,7 +228,7 @@ int nfapi_pnf_start_resp(nfapi_pnf_config_t* config, nfapi_start_response_t* res
+ 	}
+ 	else
+ 	{
+-		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: unknow phy id %d\n", __FUNCTION__, resp->header.phy_id);
++		NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: unknown phy id %d\n", __FUNCTION__, resp->header.phy_id);
+ 		return -1;
+ 	}
+ 
+diff --git a/pnf/src/pnf_p7.c b/pnf/src/pnf_p7.c
+index 0fd7828..02b828d 100644
+--- a/pnf/src/pnf_p7.c
++++ b/pnf/src/pnf_p7.c
+@@ -25,12 +25,64 @@
+ #include <unistd.h>
+ #include <errno.h>
+ #include <pthread.h>
++#include <stdio.h>
+ 
+ #include "pnf_p7.h"
+ 
+ #define FAPI2_IP_DSCP	0
+ 
+-uint32_t get_current_time_hr()
++extern uint16_t sf_ahead;
++//uint16_t sf_ahead=4;
++
++void add_sf(uint16_t *frameP, uint16_t *subframeP, int offset)
++{
++    *frameP    = *frameP + ((*subframeP + offset) / 10);
++
++    *subframeP = ((*subframeP + offset) % 10);
++}
++
++void subtract_sf(uint16_t *frameP, uint16_t *subframeP, int offset)
++{
++  if (*subframeP < offset)
++  {
++    *frameP = (*frameP+1024-1)%1024;
++  }
++  *subframeP = (*subframeP+10-offset)%10;
++}
++
++uint16_t sfnsf_add_sf(uint16_t sfnsf, int offset)
++{
++  uint16_t new_sfnsf;
++  uint16_t sfn = NFAPI_SFNSF2SFN(sfnsf);
++  uint16_t sf  = NFAPI_SFNSF2SF(sfnsf);
++
++  //printf("%s() sfn:%u sf:%u\n", __FUNCTION__, sfn, sf);
++  add_sf(&sfn, &sf, offset);
++
++  new_sfnsf = sfn<<4|sf;
++
++  //printf("%s() sfn:%u sf:%u offset:%d sfnsf:%d(DEC:%d) new:%d(DEC:%d)\n", __FUNCTION__, sfn, sf, offset, sfnsf, NFAPI_SFNSF2DEC(sfnsf), new_sfnsf, NFAPI_SFNSF2DEC(new_sfnsf));
++
++  return new_sfnsf;
++}
++
++uint16_t sfnsf_subtract_sf(uint16_t sfnsf, int offset)
++{
++  uint16_t new_sfnsf;
++  uint16_t sfn = NFAPI_SFNSF2SFN(sfnsf);
++  uint16_t sf  = NFAPI_SFNSF2SF(sfnsf);
++
++  //printf("%s() sfn:%u sf:%u\n", __FUNCTION__, sfn, sf);
++  subtract_sf(&sfn, &sf, offset);
++
++  new_sfnsf = sfn<<4|sf;
++
++  //printf("%s() offset:%d sfnsf:%d(DEC:%d) new:%d(DEC:%d)\n", __FUNCTION__, offset, sfnsf, NFAPI_SFNSF2DEC(sfnsf), new_sfnsf, NFAPI_SFNSF2DEC(new_sfnsf));
++
++  return new_sfnsf;
++}
++
++uint32_t pnf_get_current_time_hr(void)
+ {
+ 	struct timeval now;
+ 	(void)gettimeofday(&now, NULL);
+@@ -64,11 +116,14 @@ void pnf_p7_free(pnf_p7_t* pnf_p7, void* ptr)
+ // todo : for now these just malloc/free need to move to a memory cache
+ nfapi_dl_config_request_t* allocate_nfapi_dl_config_request(pnf_p7_t* pnf_p7) 
+ { 
+-	return pnf_p7_malloc(pnf_p7, sizeof(nfapi_dl_config_request_t));
++	void *ptr= pnf_p7_malloc(pnf_p7, sizeof(nfapi_dl_config_request_t));
++        //printf("%s() ptr:%p\n", __FUNCTION__, ptr);
++        return ptr;
+ }
+ 
+ void deallocate_nfapi_dl_config_request(nfapi_dl_config_request_t* req, pnf_p7_t* pnf_p7) 
+ { 
++  //printf("%s() SFN/SF:%d %s req:%p pdu_list:%p\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pnf_p7->_public.codec_config.deallocate ? "DEALLOCATE" : "FREE", req, req->dl_config_request_body.dl_config_pdu_list);
+ 	if(pnf_p7->_public.codec_config.deallocate)
+ 	{
+ 		(pnf_p7->_public.codec_config.deallocate)(req->dl_config_request_body.dl_config_pdu_list);
+@@ -77,17 +132,21 @@ void deallocate_nfapi_dl_config_request(nfapi_dl_config_request_t* req, pnf_p7_t
+ 	{
+ 		free(req->dl_config_request_body.dl_config_pdu_list);
+ 	}
++        req->dl_config_request_body.dl_config_pdu_list=0;
+ 
+ 	pnf_p7_free(pnf_p7, req);
+ }
+ 
+ nfapi_ul_config_request_t* allocate_nfapi_ul_config_request(pnf_p7_t* pnf_p7) 
+ { 
+-	return pnf_p7_malloc(pnf_p7, sizeof(nfapi_ul_config_request_t));
++	void *ptr= pnf_p7_malloc(pnf_p7, sizeof(nfapi_ul_config_request_t));
++        //printf("%s() ptr:%p\n", __FUNCTION__, ptr);
++        return ptr;
+ }
+ 
+ void deallocate_nfapi_ul_config_request(nfapi_ul_config_request_t* req, pnf_p7_t* pnf_p7) 
+ { 
++  //printf("%s() SFN/SF:%d %s req:%p pdu_list:%p\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pnf_p7->_public.codec_config.deallocate ? "DEALLOCATE" : "FREE", req, req->ul_config_request_body.ul_config_pdu_list);
+ 	if(pnf_p7->_public.codec_config.deallocate)
+ 	{
+ 		(pnf_p7->_public.codec_config.deallocate)(req->ul_config_request_body.ul_config_pdu_list);
+@@ -96,6 +155,7 @@ void deallocate_nfapi_ul_config_request(nfapi_ul_config_request_t* req, pnf_p7_t
+ 	{
+ 		free(req->ul_config_request_body.ul_config_pdu_list);
+ 	}
++        req->ul_config_request_body.ul_config_pdu_list=0;
+ 
+ 	pnf_p7_free(pnf_p7, req);
+ }
+@@ -107,6 +167,7 @@ nfapi_hi_dci0_request_t* allocate_nfapi_hi_dci0_request(pnf_p7_t* pnf_p7)
+ 
+ void deallocate_nfapi_hi_dci0_request(nfapi_hi_dci0_request_t* req, pnf_p7_t* pnf_p7) 
+ { 
++  //printf("%s() SFN/SF:%d %s req:%p pdu_list:%p\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pnf_p7->_public.codec_config.deallocate ? "DEALLOCATE" : "FREE", req, req->hi_dci0_request_body.hi_dci0_pdu_list);
+ 	if(pnf_p7->_public.codec_config.deallocate)
+ 	{
+ 		(pnf_p7->_public.codec_config.deallocate)(req->hi_dci0_request_body.hi_dci0_pdu_list);
+@@ -115,6 +176,7 @@ void deallocate_nfapi_hi_dci0_request(nfapi_hi_dci0_request_t* req, pnf_p7_t* pn
+ 	{
+ 		free(req->hi_dci0_request_body.hi_dci0_pdu_list);
+ 	}
++        req->hi_dci0_request_body.hi_dci0_pdu_list=0;
+ 
+ 	pnf_p7_free(pnf_p7, req);
+ }
+@@ -127,6 +189,9 @@ nfapi_tx_request_t* allocate_nfapi_tx_request(pnf_p7_t* pnf_p7)
+ void deallocate_nfapi_tx_request(nfapi_tx_request_t* req, pnf_p7_t* pnf_p7) 
+ { 
+ 	int i = 0;
++
++  //printf("%s() SFN/SF:%d %s req:%p pdu[0]:data:%p\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pnf_p7->_public.codec_config.deallocate ? "DEALLOCATE" : "FREE", req, req->tx_request_body.tx_pdu_list[i].segments[0].segment_data);
++
+ 	for(i = 0; i < req->tx_request_body.number_of_pdus; ++i)
+ 	{
+ 		void* data = req->tx_request_body.tx_pdu_list[i].segments[0].segment_data;
+@@ -139,6 +204,7 @@ void deallocate_nfapi_tx_request(nfapi_tx_request_t* req, pnf_p7_t* pnf_p7)
+ 		{
+ 			free(data);
+ 		}
++                data=0;
+ 	}
+ 
+ 
+@@ -150,6 +216,7 @@ void deallocate_nfapi_tx_request(nfapi_tx_request_t* req, pnf_p7_t* pnf_p7)
+ 	{
+ 		free(req->tx_request_body.tx_pdu_list);
+ 	}
++        req->tx_request_body.tx_pdu_list=0;
+ 
+ 	pnf_p7_free(pnf_p7, req);
+ }
+@@ -169,6 +236,7 @@ void deallocate_nfapi_lbt_dl_config_request(nfapi_lbt_dl_config_request_t* req,
+ 	{
+ 		free(req->lbt_dl_config_request_body.lbt_dl_config_req_pdu_list);
+ 	}
++        req->lbt_dl_config_request_body.lbt_dl_config_req_pdu_list=0;
+ 
+ 	pnf_p7_free(pnf_p7, req);
+ }
+@@ -307,11 +375,11 @@ void pnf_p7_rx_reassembly_queue_remove_old_msgs(pnf_p7_t* pnf_p7, pnf_p7_rx_reas
+ }
+ 
+ 
+-uint32_t get_sf_time(uint32_t now_hr, uint32_t sf_start_hr)
++static uint32_t get_sf_time(uint32_t now_hr, uint32_t sf_start_hr)
+ {
+ 	if(now_hr < sf_start_hr)
+ 	{
+-		NFAPI_TRACE(NFAPI_TRACE_INFO, "now is earlier that start of subframe\n");
++		NFAPI_TRACE(NFAPI_TRACE_INFO, "now is earlier than start of subframe now_hr:%u sf_start_hr:%u\n", now_hr, sf_start_hr);
+ 		return 0;
+ 	}
+ 	else
+@@ -482,29 +550,41 @@ void pnf_pack_and_send_timing_info(pnf_p7_t* pnf_p7)
+ 
+ void send_dummy_subframe(pnf_p7_t* pnf_p7, uint16_t sfn_sf)
+ {
++  struct timespec t;
++  clock_gettime( CLOCK_MONOTONIC, &t);
++
++  //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(sfn_sf:%d) t:%ld.%09ld\n", __FUNCTION__, NFAPI_SFNSF2DEC(sfn_sf), t.tv_sec, t.tv_nsec);
++
++	if(pnf_p7->_public.tx_req && pnf_p7->_public.dummy_subframe.tx_req)
++	{
++		pnf_p7->_public.dummy_subframe.tx_req->sfn_sf = sfn_sf;
++		//NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy tx_req - enter\n");
++		(pnf_p7->_public.tx_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.tx_req);
++		//NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy tx_req - exit\n");
++	}
+ 	if(pnf_p7->_public.dl_config_req && pnf_p7->_public.dummy_subframe.dl_config_req)
+ 	{
+ 		pnf_p7->_public.dummy_subframe.dl_config_req->sfn_sf = sfn_sf;
++		//NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy dl_config_req - enter\n");
+ 		(pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req);
++		//NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy dl_config_req - exit\n");
+ 	}
+ 	if(pnf_p7->_public.ul_config_req && pnf_p7->_public.dummy_subframe.ul_config_req)
+ 	{
+ 		pnf_p7->_public.dummy_subframe.ul_config_req->sfn_sf = sfn_sf;
++		NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy ul_config_req - enter\n");
+ 		(pnf_p7->_public.ul_config_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.ul_config_req);
+ 	}
+ 	if(pnf_p7->_public.hi_dci0_req && pnf_p7->_public.dummy_subframe.hi_dci0_req)
+ 	{
+ 		pnf_p7->_public.dummy_subframe.hi_dci0_req->sfn_sf = sfn_sf;
++		NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy hi_dci0 - enter\n");
+ 		(pnf_p7->_public.hi_dci0_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.hi_dci0_req);
+ 	}
+-	if(pnf_p7->_public.tx_req && pnf_p7->_public.dummy_subframe.tx_req)
+-	{
+-		pnf_p7->_public.dummy_subframe.tx_req->sfn_sf = sfn_sf;
+-		(pnf_p7->_public.tx_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.tx_req);
+-	}
+ 	if(pnf_p7->_public.lbt_dl_config_req && pnf_p7->_public.dummy_subframe.lbt_dl_config_req)
+ 	{
+ 		pnf_p7->_public.dummy_subframe.lbt_dl_config_req->sfn_sf = sfn_sf;
++		NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy lbt - enter\n");
+ 		(pnf_p7->_public.lbt_dl_config_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.lbt_dl_config_req);
+ 	}
+ }
+@@ -526,10 +606,14 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
+ 		return -1;
+ 	}
+ 
++#if 1
+ 	// save the curren time and sfn_sf
+-	pnf_p7->sf_start_time_hr = get_current_time_hr();
++	pnf_p7->sf_start_time_hr = pnf_get_current_time_hr();
+ 	pnf_p7->sfn_sf = sfn_sf;
+ 
++        uint32_t sfn_sf_tx = sfnsf_add_sf(sfn_sf, sf_ahead);
++        uint32_t tx_sfn_sf_dec = NFAPI_SFNSF2DEC(sfn_sf_tx);
++
+ 	// If the subframe_buffer has been configured
+ 	if(pnf_p7->_public.subframe_buffer_size != 0)
+ 	{
+@@ -550,6 +634,10 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
+ 			NFAPI_TRACE(NFAPI_TRACE_INFO, "Applying shift %d to sfn/sf (%d -> %d)\n", pnf_p7->sfn_sf_shift, NFAPI_SFNSF2DEC(sfn_sf), shifted_sfn_sf);
+ 			sfn_sf = shifted_sfn_sf;
+ 
++                        //
++                        // DJP - why does the shift not apply to pnf_p7->sfn_sf???
++                        //
++
+ 			pnf_p7->sfn_sf_shift = 0;
+ 		}
+ 
+@@ -558,77 +646,119 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
+ 
+ 		nfapi_pnf_p7_subframe_buffer_t* subframe_buffer = &(pnf_p7->subframe_buffer[buffer_index]);
+ 
++		uint8_t tx_buffer_index = tx_sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
++		nfapi_pnf_p7_subframe_buffer_t* tx_subframe_buffer = &(pnf_p7->subframe_buffer[tx_buffer_index]);
++
++                //printf("sfn_sf_dec:%d tx_sfn_sf_dec:%d\n", sfn_sf_dec, tx_sfn_sf_dec);
++
++                if (0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() shift:%d subframe_buffer->sfn_sf:%d tx_subframe_buffer->sfn_sf:%d sfn_sf:%d subframe_buffer[buffer_index:%u dl_config_req:%p tx_req:%p] "
++                    "TX:sfn_sf:%d:tx_buffer_index:%d[dl_config_req:%p tx_req:%p]\n", 
++                    __FUNCTION__, 
++                    pnf_p7->sfn_sf_shift, 
++                    NFAPI_SFNSF2DEC(subframe_buffer->sfn_sf), 
++                    NFAPI_SFNSF2DEC(tx_subframe_buffer->sfn_sf), 
++                       sfn_sf_dec,    buffer_index,    subframe_buffer->dl_config_req,    subframe_buffer->tx_req, 
++                    tx_sfn_sf_dec, tx_buffer_index, tx_subframe_buffer->dl_config_req, tx_subframe_buffer->tx_req);
++
+ 		// if the subframe buffer sfn sf is set then we have atlease 1 message
+ 		// from the vnf. 
+ 		// todo : how to handle the messages we don't have, send dummies for
+ 		// now
+-		if(subframe_buffer->sfn_sf == sfn_sf)
++
++                //printf("tx_subframe_buffer->sfn_sf:%d sfn_sf_tx:%d\n", tx_subframe_buffer->sfn_sf, sfn_sf_tx);
++                //printf("subframe_buffer->sfn_sf:%d sfn_sf:%d\n", subframe_buffer->sfn_sf, sfn_sf);
++		if(tx_subframe_buffer->sfn_sf == sfn_sf_tx)
+ 		{
+-			if(subframe_buffer->dl_config_req != 0)
++			if(tx_subframe_buffer->tx_req != 0)
+ 			{
+-				if(pnf_p7->_public.dl_config_req)
+-					(pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), subframe_buffer->dl_config_req);
++				if(pnf_p7->_public.tx_req)
++					(pnf_p7->_public.tx_req)(&(pnf_p7->_public), tx_subframe_buffer->tx_req);
+ 
+-				deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7);
++				//deallocate_nfapi_tx_request(subframe_buffer->tx_req, pnf_p7);
+ 			}
+ 			else
+ 			{
+ 				// send dummy
+-				if(pnf_p7->_public.dl_config_req && pnf_p7->_public.dummy_subframe.dl_config_req)
++				if(pnf_p7->_public.tx_req && pnf_p7->_public.dummy_subframe.tx_req)
+ 				{
+-					pnf_p7->_public.dummy_subframe.dl_config_req->sfn_sf = sfn_sf;
+-					(pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req);
++					pnf_p7->_public.dummy_subframe.tx_req->sfn_sf = sfn_sf_tx;
++					(pnf_p7->_public.tx_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.tx_req);
+ 				}
+ 			}
+ 
+-			if(subframe_buffer->ul_config_req != 0)
++			if(tx_subframe_buffer->dl_config_req != 0)
+ 			{
+-				if(pnf_p7->_public.ul_config_req)
+-					(pnf_p7->_public.ul_config_req)(&(pnf_p7->_public), subframe_buffer->ul_config_req);
++				if(pnf_p7->_public.dl_config_req)
++					(pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), tx_subframe_buffer->dl_config_req);
+ 
+-				deallocate_nfapi_ul_config_request(subframe_buffer->ul_config_req, pnf_p7);
++				//deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7);
+ 			}
+ 			else
+ 			{
+ 				// send dummy
+-				if(pnf_p7->_public.ul_config_req && pnf_p7->_public.dummy_subframe.ul_config_req)
++				if(pnf_p7->_public.dl_config_req && pnf_p7->_public.dummy_subframe.dl_config_req)
+ 				{
+-					pnf_p7->_public.dummy_subframe.ul_config_req->sfn_sf = sfn_sf;
+-					(pnf_p7->_public.ul_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.ul_config_req);
++					pnf_p7->_public.dummy_subframe.dl_config_req->sfn_sf = sfn_sf_tx;
++					(pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req);
+ 				}
+ 			}
+ 
+-			if(subframe_buffer->hi_dci0_req != 0)
++			if(tx_subframe_buffer->hi_dci0_req != 0)
+ 			{
+ 				if(pnf_p7->_public.hi_dci0_req)
+-					(pnf_p7->_public.hi_dci0_req)(&(pnf_p7->_public), subframe_buffer->hi_dci0_req);
++					(pnf_p7->_public.hi_dci0_req)(&(pnf_p7->_public), tx_subframe_buffer->hi_dci0_req);
+ 
+-				deallocate_nfapi_hi_dci0_request(subframe_buffer->hi_dci0_req, pnf_p7);
++				//deallocate_nfapi_hi_dci0_request(subframe_buffer->hi_dci0_req, pnf_p7);
+ 			}
+ 			else
+ 			{
+ 				//send dummy
+ 				if(pnf_p7->_public.hi_dci0_req && pnf_p7->_public.dummy_subframe.hi_dci0_req)
+ 				{
+-					pnf_p7->_public.dummy_subframe.hi_dci0_req->sfn_sf = sfn_sf;
++					pnf_p7->_public.dummy_subframe.hi_dci0_req->sfn_sf = sfn_sf_tx;
+ 					(pnf_p7->_public.hi_dci0_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.hi_dci0_req);
+ 				}
+ 			}
+ 
+-			if(subframe_buffer->tx_req != 0)
++                        if(tx_subframe_buffer->dl_config_req != 0)
++                        {
++                          deallocate_nfapi_dl_config_request(tx_subframe_buffer->dl_config_req, pnf_p7);
++                          tx_subframe_buffer->dl_config_req = 0;
++                        }
++			if(tx_subframe_buffer->tx_req != 0)
++                        {
++                          deallocate_nfapi_tx_request(tx_subframe_buffer->tx_req, pnf_p7);
++                          tx_subframe_buffer->tx_req = 0;
++                        }
++                        if(tx_subframe_buffer->hi_dci0_req != 0)
++                        {
++                          deallocate_nfapi_hi_dci0_request(tx_subframe_buffer->hi_dci0_req, pnf_p7);
++                          tx_subframe_buffer->hi_dci0_req = 0;
++                        }
++                }
++		else
++		{
++                  // If we ever need to "send" a dummy ul_config this won't work!!!
++                  send_dummy_subframe(pnf_p7, sfn_sf_tx);
++		}
++
++                if(subframe_buffer->sfn_sf == sfn_sf)
++		{
++
++			if(subframe_buffer->ul_config_req != 0)
+ 			{
+-				if(pnf_p7->_public.tx_req)
+-					(pnf_p7->_public.tx_req)(&(pnf_p7->_public), subframe_buffer->tx_req);
++				if(pnf_p7->_public.ul_config_req)
++					(pnf_p7->_public.ul_config_req)(&(pnf_p7->_public), subframe_buffer->ul_config_req);
+ 
+-				deallocate_nfapi_tx_request(subframe_buffer->tx_req, pnf_p7);
++				//deallocate_nfapi_ul_config_request(subframe_buffer->ul_config_req, pnf_p7);
+ 			}
+ 			else
+ 			{
+ 				// send dummy
+-				if(pnf_p7->_public.tx_req && pnf_p7->_public.dummy_subframe.tx_req)
++				if(pnf_p7->_public.ul_config_req && pnf_p7->_public.dummy_subframe.ul_config_req)
+ 				{
+-					pnf_p7->_public.dummy_subframe.tx_req->sfn_sf = sfn_sf;
+-					(pnf_p7->_public.tx_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.tx_req);
++					pnf_p7->_public.dummy_subframe.ul_config_req->sfn_sf = sfn_sf;
++					(pnf_p7->_public.ul_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.ul_config_req);
+ 				}
+ 			}
+ 
+@@ -637,7 +767,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
+ 				if(pnf_p7->_public.lbt_dl_config_req)
+ 					(pnf_p7->_public.lbt_dl_config_req)(&(pnf_p7->_public), subframe_buffer->lbt_dl_config_req);
+ 
+-				deallocate_nfapi_lbt_dl_config_request(subframe_buffer->lbt_dl_config_req, pnf_p7);
++				//deallocate_nfapi_lbt_dl_config_request(subframe_buffer->lbt_dl_config_req, pnf_p7);
+ 			}
+ 			else
+ 			{
+@@ -650,14 +780,35 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
+ 
+ 			}
+ 
+-			memset(&(pnf_p7->subframe_buffer[buffer_index]), 0, sizeof(nfapi_pnf_p7_subframe_buffer_t));
+-			pnf_p7->subframe_buffer[buffer_index].sfn_sf = -1;
+-		}
+-		else
+-		{
+-			send_dummy_subframe(pnf_p7, sfn_sf);
++                        //if(subframe_buffer->dl_config_req != 0)
++                          //deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7);
++			//if(subframe_buffer->tx_req != 0)
++                          //deallocate_nfapi_tx_request(subframe_buffer->tx_req, pnf_p7);
++                        if(subframe_buffer->ul_config_req != 0)
++                        {
++                          deallocate_nfapi_ul_config_request(subframe_buffer->ul_config_req, pnf_p7);
++                          subframe_buffer->ul_config_req = 0;
++
++                        }
++                        //if(subframe_buffer->hi_dci0_req != 0)
++                          //deallocate_nfapi_hi_dci0_request(subframe_buffer->hi_dci0_req, pnf_p7);
++			if(subframe_buffer->lbt_dl_config_req != 0)
++                        {
++                          deallocate_nfapi_lbt_dl_config_request(subframe_buffer->lbt_dl_config_req, pnf_p7);
++                          subframe_buffer->lbt_dl_config_req = 0;
++                        }
++                } // sfn_sf match
++
++                if (subframe_buffer->dl_config_req == 0 && subframe_buffer->tx_req == 0 && subframe_buffer->ul_config_req == 0 && subframe_buffer->lbt_dl_config_req == 0)
++                {
++                  memset(&(pnf_p7->subframe_buffer[buffer_index]), 0, sizeof(nfapi_pnf_p7_subframe_buffer_t));
++                  pnf_p7->subframe_buffer[buffer_index].sfn_sf = -1;
+ 		}
+ 
++                //printf("pnf_p7->_public.timing_info_mode_periodic:%d pnf_p7->timing_info_period_counter:%d pnf_p7->_public.timing_info_period:%d\n", pnf_p7->_public.timing_info_mode_periodic, pnf_p7->timing_info_period_counter, pnf_p7->_public.timing_info_period);
++                //printf("pnf_p7->_public.timing_info_mode_aperiodic:%d pnf_p7->timing_info_aperiodic_send:%d\n", pnf_p7->_public.timing_info_mode_aperiodic, pnf_p7->timing_info_aperiodic_send);
++                //printf("pnf_p7->timing_info_ms_counter:%d\n", pnf_p7->timing_info_ms_counter);
++
+ 		// send the periodic timing info if configured
+ 		if(pnf_p7->_public.timing_info_mode_periodic && (pnf_p7->timing_info_period_counter++) == pnf_p7->_public.timing_info_period)
+ 		{
+@@ -678,14 +829,15 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
+ 	}
+ 	else
+ 	{
+-		send_dummy_subframe(pnf_p7, sfn_sf);
++		//send_dummy_subframe(pnf_p7, sfn_sf_tx);
+ 	}
+ 
+ 
++        //printf("pnf_p7->tick:%d\n", pnf_p7->tick);
+ 	if(pnf_p7->tick == 1000)
+ 	{
+ 
+-		NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF P7:%d] DL:(%d/%d) UL:(%d/%d) HI:(%d/%d) TX:(%d/%d)\n", pnf_p7->_public.phy_id,
++		NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF P7:%d] (ONTIME/LATE) DL:(%d/%d) UL:(%d/%d) HI:(%d/%d) TX:(%d/%d)\n", pnf_p7->_public.phy_id,
+ 					pnf_p7->stats.dl_conf_ontime, pnf_p7->stats.dl_conf_late, 
+ 					pnf_p7->stats.ul_conf_ontime, pnf_p7->stats.ul_conf_late, 
+ 					pnf_p7->stats.hi_dci0_ontime, pnf_p7->stats.hi_dci0_late, 
+@@ -694,6 +846,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
+ 		memset(&pnf_p7->stats, 0, sizeof(pnf_p7->stats));
+ 	}
+ 	pnf_p7->tick++;
++#endif
+ 
+ 	if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
+ 	{
+@@ -724,7 +877,7 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
+ 			if(recv_sfn_sf_dec > ((current_sfn_sf_dec + timing_window) % NFAPI_MAX_SFNSFDEC))
+ 			{
+ 				// out of window
+-				//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is late %d (with wrap)\n", current_sfn_sf_dec, name, recv_sfn_sf_dec);
++				NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is late %d (with wrap)\n", current_sfn_sf_dec, name, recv_sfn_sf_dec);
+ 			}
+ 			else
+ 			{
+@@ -736,7 +889,7 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
+ 		else
+ 		{
+ 			// too late
+-			//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in late %d (%d)\n", current_sfn_sf_dec, name, recv_sfn_sf_dec, (current_sfn_sf_dec - recv_sfn_sf_dec));
++			NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in late %d (delta:%d)\n", current_sfn_sf_dec, name, recv_sfn_sf_dec, (current_sfn_sf_dec - recv_sfn_sf_dec));
+ 		}
+ 
+ 	}
+@@ -751,8 +904,8 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
+ 		}
+ 		else
+ 		{
+-			// to far in the future
+-			//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is out of window %d (%d) [%d]\n", current_sfn_sf_dec, name, recv_sfn_sf_dec,  (recv_sfn_sf_dec - current_sfn_sf_dec), timing_window);
++			// too far in the future
++			NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is out of window %d (delta:%d) [max:%d]\n", current_sfn_sf_dec, name, recv_sfn_sf_dec,  (recv_sfn_sf_dec - current_sfn_sf_dec), timing_window);
+ 		}
+ 
+ 	}
+@@ -785,15 +938,35 @@ void pnf_handle_dl_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_
+ 			return;
+ 		}
+ 
+-		if(is_p7_request_in_window(req->sfn_sf, "dl_config_request", pnf_p7))
+-		{
+-			uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
+-			uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
++                if (
++                    0 && 
++                    (NFAPI_SFNSF2DEC(req->sfn_sf) % 100 ==0 ||
++                     NFAPI_SFNSF2DEC(req->sfn_sf) % 105 ==0 
++                    )
++                )
++                  NFAPI_TRACE(NFAPI_TRACE_INFO, "DL_CONFIG.req sfn_sf:%d pdcch:%u dci:%u pdu:%u pdsch_rnti:%u pcfich:%u\n", 
++                      NFAPI_SFNSF2DEC(req->sfn_sf),
++                      req->dl_config_request_body.number_pdcch_ofdm_symbols,
++                      req->dl_config_request_body.number_dci,
++                      req->dl_config_request_body.number_pdu,
++                      req->dl_config_request_body.number_pdsch_rnti,
++                      req->dl_config_request_body.transmission_power_pcfich
++                      );
++
++                if(is_p7_request_in_window(req->sfn_sf, "dl_config_request", pnf_p7))
++                {
++                  uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
++                  uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
++
++                        struct timespec t;
++                        clock_gettime(CLOCK_MONOTONIC, &t);
++
++                  NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE DL_CONFIG_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_sf_dec, buffer_index);
+ 
+ 			// if there is already an dl_config_req make sure we free it.
+ 			if(pnf_p7->subframe_buffer[buffer_index].dl_config_req != 0)
+ 			{
+-				NFAPI_TRACE(NFAPI_TRACE_NOTE, "HERE HERE HERE\n");
++				NFAPI_TRACE(NFAPI_TRACE_NOTE, "%s() is_p7_request_in_window()=TRUE buffer_index occupied - free it first sfn_sf:%d buffer_index:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), buffer_index);
+ 				//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing dl_config_req at index %d (%d/%d)", 
+ 				//			pMyPhyInfo->sfnSf, bufferIdx,
+ 				//			SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf));
+@@ -860,6 +1033,11 @@ void pnf_handle_ul_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_
+ 			uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
+ 			uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
+ 
++                        struct timespec t;
++                        clock_gettime(CLOCK_MONOTONIC, &t);
++
++                        NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE UL_CONFIG_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_sf_dec, buffer_index);
++
+ 			if(pnf_p7->subframe_buffer[buffer_index].ul_config_req != 0)
+ 			{
+ 				//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing ul_config_req at index %d (%d/%d)", 
+@@ -876,7 +1054,7 @@ void pnf_handle_ul_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_
+ 		}
+ 		else
+ 		{
+-			//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] NOT storing ul_config_req SFN/SF %d/%d\n", pMyPhyInfo->sfnSf, SFNSF2SFN(req->sfn_sf), SFNSF2SF(req->sfn_sf));
++			NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] NOT storing ul_config_req OUTSIDE OF TRANSMIT BUFFER WINDOW SFN/SF %d\n", NFAPI_SFNSF2DEC(pnf_p7->sfn_sf), NFAPI_SFNSF2DEC(req->sfn_sf));
+ 			deallocate_nfapi_ul_config_request(req, pnf_p7);
+ 
+ 			if(pnf_p7->_public.timing_info_mode_aperiodic)
+@@ -994,6 +1172,16 @@ void pnf_handle_tx_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
+ 			uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
+ 			uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
+ 
++                        struct timespec t;
++                        clock_gettime(CLOCK_MONOTONIC, &t);
++
++                        NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE TX_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_sf_dec, buffer_index);
++
++                        if (0 && NFAPI_SFNSF2DEC(req->sfn_sf)%100==0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX_REQ.req sfn_sf:%d pdus:%d - TX_REQ is within window\n",
++                            __FUNCTION__,
++                            NFAPI_SFNSF2DEC(req->sfn_sf),
++                            req->tx_request_body.number_of_pdus);
++
+ 			if(pnf_p7->subframe_buffer[buffer_index].tx_req != 0)
+ 			{
+ 				//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing tx_req at index %d (%d/%d)", 
+@@ -1010,6 +1198,8 @@ void pnf_handle_tx_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
+ 		}
+ 		else
+ 		{
++                  NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() TX_REQUEST Request is outside of window REQ:SFN_SF:%d CURR:SFN_SF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), NFAPI_SFNSF2DEC(pnf_p7->sfn_sf));
++
+ 			deallocate_nfapi_tx_request(req, pnf_p7);
+ 
+ 			if(pnf_p7->_public.timing_info_mode_aperiodic)
+@@ -1126,12 +1316,27 @@ uint32_t calculate_t2(uint32_t now_time_hr, uint16_t sfn_sf, uint32_t sf_start_t
+ 	uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
+ 	uint32_t t2 = (NFAPI_SFNSF2DEC(sfn_sf) * 1000) + sf_time_us;
+ 
++        if (0)
++        {
++          static uint32_t prev_t2 = 0;
++
++          NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(now_time_hr:%u sfn_sf:%d sf_start_time_Hr:%u) sf_time_us:%u t2:%u prev_t2:%u diff:%u\n",
++              __FUNCTION__,
++              now_time_hr, NFAPI_SFNSF2DEC(sfn_sf), sf_start_time_hr,
++              sf_time_us,
++              t2,
++              prev_t2,
++              t2-prev_t2);
++
++          prev_t2 = t2;
++        }
++
+ 	return t2;
+ }
+ 
+ uint32_t calculate_t3(uint16_t sfn_sf, uint32_t sf_start_time_hr)
+ {
+-	uint32_t now_time_hr = get_current_time_hr();
++	uint32_t now_time_hr = pnf_get_current_time_hr();
+ 
+ 	uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
+ 
+@@ -1391,6 +1596,8 @@ void pnf_nfapi_p7_read_dispatch_message(pnf_p7_t* pnf_p7, uint32_t now_hr_time)
+ 			// read the segment
+ 			recvfrom_result = recvfrom(pnf_p7->p7_sock, pnf_p7->rx_message_buffer, header.message_length, MSG_DONTWAIT, (struct sockaddr*)&remote_addr, &remote_addr_size);
+ 
++		now_hr_time = pnf_get_current_time_hr(); //DJP - moved to here - get closer timestamp???
++
+ 			if(recvfrom_result > 0)
+ 			{
+ 				pnf_handle_p7_message(pnf_p7->rx_message_buffer, recvfrom_result, pnf_p7, now_hr_time);
+@@ -1417,7 +1624,10 @@ void pnf_nfapi_p7_read_dispatch_message(pnf_p7_t* pnf_p7, uint32_t now_hr_time)
+ 
+ 		// need to update the time as we would only use the value from the
+ 		// select
+-		now_hr_time = get_current_time_hr();
++#if 0
++// DJP - why do this here and not on return from recv???
++		now_hr_time = pnf_get_current_time_hr();
++#endif
+ 	}
+ 	while(recvfrom_result > 0);
+ }
+@@ -1512,7 +1722,7 @@ int pnf_p7_message_pump(pnf_p7_t* pnf_p7)
+ 
+ 		selectRetval = select(pnf_p7->p7_sock+1, &rfds, NULL, NULL, &timeout);
+ 
+-		uint32_t now_hr_time = get_current_time_hr();
++		uint32_t now_hr_time = pnf_get_current_time_hr();
+ 
+ 		if(selectRetval == 0)
+ 		{	
+diff --git a/pnf_sim/src/main.cpp b/pnf_sim/src/main.cpp
+index 38767d8..e2622cf 100644
+--- a/pnf_sim/src/main.cpp
++++ b/pnf_sim/src/main.cpp
+@@ -1124,16 +1124,18 @@ int fapi_rx_ulsch_ind(fapi_t* fapi, fapi_rx_ulsch_ind_t* ind)
+ 	rx_ind.header.phy_id = data->p7_config->phy_id;
+ 	rx_ind.sfn_sf = ind->sfn_sf;
+ 	
+-	if(((pnf_info*)(data->config->user_data))->wireshark_test_mode)
++	if(1)//((pnf_info*)(data->config->user_data))->wireshark_test_mode)
+ 	{
+ 		rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
+-		rx_ind.rx_indication_body.number_of_pdus = 8;
++		rx_ind.rx_indication_body.number_of_pdus = 1;
+ 		
+ 		uint8_t rx_data[1024];
+ 		
+ 		nfapi_rx_indication_pdu_t pdus[rx_ind.rx_indication_body.number_of_pdus];
+ 		memset(&pdus, 0, sizeof(pdus));
+ 		
++                strcpy((char*)rx_data, (char*)"123456789");
++
+ 		for(int i = 0; i < rx_ind.rx_indication_body.number_of_pdus;++i)
+ 		{
+ 		
+@@ -1142,13 +1144,13 @@ int fapi_rx_ulsch_ind(fapi_t* fapi, fapi_rx_ulsch_ind_t* ind)
+ 			pdus[i].rx_ue_information.rnti = rand_range(1, 65535);
+ 			
+ 			pdus[i].rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
+-			pdus[i].rx_indication_rel8.length = rand_range(0, 1024);
+-			pdus[i].rx_indication_rel8.offset = 1;
++			pdus[i].rx_indication_rel8.length = 10;//rand_range(0, 1024);
++			pdus[i].rx_indication_rel8.offset = 0;//djp - 1;
+ 			pdus[i].rx_indication_rel8.ul_cqi = rand_range(0, 255);
+ 			pdus[i].rx_indication_rel8.timing_advance = rand_range(0, 63);
+ 			
+-			pdus[i].rx_indication_rel9.tl.tag = NFAPI_RX_INDICATION_REL9_TAG;
+-			pdus[i].rx_indication_rel9.timing_advance_r9 = rand_range(0, 7690);
++			//pdus[i].rx_indication_rel9.tl.tag = NFAPI_RX_INDICATION_REL9_TAG;
++			//pdus[i].rx_indication_rel9.timing_advance_r9 = rand_range(0, 7690);
+ 			
+ 			pdus[i].data = &rx_data[0];
+ 		}
+diff --git a/vnf/inc/vnf_p7.h b/vnf/inc/vnf_p7.h
+index ab9a335..fc2ab4e 100644
+--- a/vnf/inc/vnf_p7.h
++++ b/vnf/inc/vnf_p7.h
+@@ -116,7 +116,8 @@ typedef struct {
+ 	
+ } vnf_p7_t;
+ 
+-uint32_t get_current_time_hr();
++uint32_t vnf_get_current_time_hr(void);
++
+ uint16_t increment_sfn_sf(uint16_t sfn_sf);
+ int vnf_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info);
+ int send_mac_subframe_indications(vnf_p7_t* config);
+diff --git a/vnf/public_inc/nfapi_vnf_interface.h b/vnf/public_inc/nfapi_vnf_interface.h
+index 6659e5d..4629013 100644
+--- a/vnf/public_inc/nfapi_vnf_interface.h
++++ b/vnf/public_inc/nfapi_vnf_interface.h
+@@ -450,7 +450,7 @@ typedef struct nfapi_vnf_config
+ /*! Creates and initialise the vnf config structure before use
+  * \return A pointer to a vnf config structure
+  */
+-nfapi_vnf_config_t* nfapi_vnf_config_create();
++nfapi_vnf_config_t* nfapi_vnf_config_create(void);
+ 
+ /*! Delete an vnf config
+  */
+@@ -864,7 +864,7 @@ typedef struct nfapi_vnf_p7_config
+ /*! Creates and initializes the nfapi_vnf_p7_config structure before use
+  *  \return A pointer to an allocated vnf p7 configuration
+  */
+-nfapi_vnf_p7_config_t* nfapi_vnf_p7_config_create();
++nfapi_vnf_p7_config_t* nfapi_vnf_p7_config_create(void);
+ 
+ /*! Cleanup and delete nfapi_vnf_p7_config structure
+  *  \param config A pointer to an vnf p7 configuration structure
+diff --git a/vnf/src/vnf.c b/vnf/src/vnf.c
+index fea3cf7..6800ee2 100644
+--- a/vnf/src/vnf.c
++++ b/vnf/src/vnf.c
+@@ -82,11 +82,18 @@ void nfapi_vnf_pnf_list_add(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_t* no
+ 
+ nfapi_vnf_pnf_info_t* nfapi_vnf_pnf_list_find(nfapi_vnf_config_t* config, int p5_idx)
+ {
++	NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s : config->pnf_list:%p\n", __FUNCTION__, config->pnf_list);
++
+ 	nfapi_vnf_pnf_info_t* curr = config->pnf_list;
+ 	while(curr != 0)
+ 	{
+ 		if(curr->p5_idx == p5_idx)
++                {
++                  NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s : curr->p5_idx:%d p5_idx:%d\n", __FUNCTION__, curr->p5_idx, p5_idx);
+ 			return curr;
++                        }
++
++                NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s : curr->next:%p\n", __FUNCTION__, curr->next);
+ 
+ 		curr = curr->next;
+ 	}
+diff --git a/vnf/src/vnf_interface.c b/vnf/src/vnf_interface.c
+index e559730..0aba0a2 100644
+--- a/vnf/src/vnf_interface.c
++++ b/vnf/src/vnf_interface.c
+@@ -342,6 +342,7 @@ int nfapi_vnf_start(nfapi_vnf_config_t* config)
+ 				{
+ 					NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF connection (fd:%d) accepted from %s:%d \n", p5Sock,  inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
+ 					nfapi_vnf_pnf_info_t* pnf = (nfapi_vnf_pnf_info_t*)malloc(sizeof(nfapi_vnf_pnf_info_t));
++					NFAPI_TRACE(NFAPI_TRACE_INFO, "MALLOC nfapi_vnf_pnf_info_t for pnf_list pnf:%p\n", pnf);
+ 					memset(pnf, 0, sizeof(nfapi_vnf_pnf_info_t));
+ 					pnf->p5_sock = p5Sock;
+ 					pnf->p5_idx = p5_idx++;
+@@ -663,7 +664,7 @@ int nfapi_vnf_allocate_phy(nfapi_vnf_config_t* config, int p5_idx, uint16_t* phy
+ 	info->p5_idx = p5_idx;
+ 	info->phy_id = vnf->next_phy_id++;
+ 
+-	info->timing_window = 10;
++	info->timing_window = 30;       // This seems to override what gets set by the user - why???
+ 	info->timing_info_mode = 0x03;
+ 	info->timing_info_period = 128;
+ 
+diff --git a/vnf/src/vnf_p7.c b/vnf/src/vnf_p7.c
+index 8630385..1304176 100644
+--- a/vnf/src/vnf_p7.c
++++ b/vnf/src/vnf_p7.c
+@@ -15,6 +15,8 @@
+  */
+ 
+ 
++#include <time.h>
++
+ #include <sys/time.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -159,7 +161,7 @@ vnf_p7_rx_message_t* vnf_p7_rx_reassembly_queue_add_segment(vnf_p7_t* vnf_p7, vn
+ 		msg->sequence_number = sequence_number;
+ 		msg->num_segments_expected = m ? 255 : segment_number + 1;
+ 		msg->num_segments_received = 1;
+-		msg->rx_hr_time = get_current_time_hr();
++		msg->rx_hr_time = vnf_get_current_time_hr();
+ 
+ 		msg->segments[segment_number].buffer = (uint8_t*)vnf_p7_malloc(vnf_p7, data_len);
+ 		memcpy(msg->segments[segment_number].buffer, data, data_len);
+@@ -216,7 +218,7 @@ void vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7_t* vnf_p7, vnf_p7_rx_reas
+ 	vnf_p7_rx_message_t* iterator = queue->msg_queue;
+ 	vnf_p7_rx_message_t* previous = 0;
+ 
+-	uint32_t rx_hr_time = get_current_time_hr();
++	uint32_t rx_hr_time = vnf_get_current_time_hr();
+ 
+ 	while(iterator != 0)
+ 	{
+@@ -254,7 +256,7 @@ void vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7_t* vnf_p7, vnf_p7_rx_reas
+ 	}
+ }
+ 
+-uint32_t get_current_time_hr()
++uint32_t vnf_get_current_time_hr()
+ {
+ 	struct timeval now;
+ 	(void)gettimeofday(&now, NULL);
+@@ -297,7 +299,7 @@ struct timespec timespec_delta(struct timespec start, struct timespec end)
+ 	return temp;
+ }
+ 
+-uint32_t get_sf_time(uint32_t now_hr, uint32_t sf_start_hr)
++static uint32_t get_sf_time(uint32_t now_hr, uint32_t sf_start_hr)
+ {
+ 	if(now_hr < sf_start_hr)
+ 	{
+@@ -321,7 +323,7 @@ uint32_t get_sf_time(uint32_t now_hr, uint32_t sf_start_hr)
+ 
+ uint32_t calculate_t1(uint16_t sfn_sf, uint32_t sf_start_time_hr)
+ {
+-	uint32_t now_time_hr = get_current_time_hr();
++	uint32_t now_time_hr = vnf_get_current_time_hr();
+ 
+ 	uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
+ 
+@@ -344,7 +346,7 @@ uint32_t calculate_t4(uint32_t now_time_hr, uint16_t sfn_sf, uint32_t sf_start_t
+ 
+ uint32_t calculate_transmit_timestamp(uint16_t sfn_sf, uint32_t sf_start_time_hr)
+ {
+-	uint32_t now_time_hr = get_current_time_hr();
++	uint32_t now_time_hr = vnf_get_current_time_hr();
+ 
+ 	uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
+ 
+@@ -410,6 +412,8 @@ int vnf_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* hea
+ 		
+ 		int len = nfapi_p7_message_pack(header, buffer, sizeof(buffer), &vnf_p7->_public.codec_config);
+ 		
++                //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() phy_id:%d nfapi_p7_message_pack()=len=%d vnf_p7->_public.segment_size:%u\n", __FUNCTION__, header->phy_id, len, vnf_p7->_public.segment_size);
++
+ 		if(len < 0) 
+ 		{
+ 			NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() failed to pack p7 message phy_id:%d\n", __FUNCTION__, header->phy_id);
+@@ -429,6 +433,7 @@ int vnf_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* hea
+ 			int segment = 0;
+ 			int offset = NFAPI_P7_HEADER_LENGTH;
+ 			uint8_t tx_buffer[vnf_p7->_public.segment_size];
++                        NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() MORE THAN ONE SEGMENT phy_id:%d nfapi_p7_message_pack()=len=%d vnf_p7->_public.segment_size:%u\n", __FUNCTION__, header->phy_id, len, vnf_p7->_public.segment_size);
+ 			for(segment = 0; segment < segment_count; ++segment)
+ 			{
+ 				uint8_t last = 0;
+@@ -851,7 +856,7 @@ void vnf_handle_p7_vendor_extension(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vn
+ 
+ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+ {
+-	uint32_t now_time_hr = get_current_time_hr();
++	uint32_t now_time_hr = vnf_get_current_time_hr();
+ 
+ 	if (pRecvMsg == NULL || vnf_p7  == NULL)
+ 	{
+@@ -871,7 +876,7 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+ 	nfapi_vnf_p7_connection_info_t* phy = vnf_p7_connection_info_list_find(vnf_p7, ind.header.phy_id);
+ 	uint32_t t4 = calculate_t4(now_time_hr, phy->sfn_sf, vnf_p7->sf_start_time_hr);
+ 
+-	uint32_t tx_2_rx = t4 - ind.t1;
++	uint32_t tx_2_rx = t4>ind.t1 ? t4 - ind.t1 : t4 + NFAPI_MAX_SFNSFDEC - ind.t1 ;
+ 	uint32_t pnf_proc_time = ind.t3 - ind.t2;
+ 
+ 	// divide by 2 using shift operator
+@@ -881,7 +886,7 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+ 	{
+ 		phy->latency[phy->min_sync_cycle_count] = latency;
+ 
+-		NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%d/%d) PNF to VNF !sync phy_id:%d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d\n",
++		NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) PNF to VNF !sync phy_id:%d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d\n",
+ 				NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ind.header.phy_id, ind.t1, ind.t2, ind.t3, t4, 
+ 				tx_2_rx, pnf_proc_time, latency);
+ 	}
+@@ -923,15 +928,27 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+ 
+ 		if(1)
+ 		{
+-			NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n", 
+-					NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ind.header.phy_id,
++                  struct timespec ts;
++                  clock_gettime(CLOCK_MONOTONIC, &ts);
++
++			NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) %d.%d PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n", 
++					NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
+ 					ind.t1, ind.t2, ind.t3, t4, 
+-					tx_2_rx, pnf_proc_time, latency, phy->sf_offset, phy->sf_offset_filtered,
++					tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->sf_offset, phy->sf_offset_filtered,
+ 					(ind.t1<phy->previous_t1), (ind.t2<phy->previous_t2));
+ 		}
+ 
+ 	}
+ 
++        if (phy->filtered_adjust && (phy->sf_offset_filtered > 1e6 || phy->sf_offset_filtered < -1e6))
++        {
++          phy->filtered_adjust = 0;
++          phy->zero_count=0;
++          phy->min_sync_cycle_count = 2;
++          phy->in_sync = 0;
++          NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s - ADJUST TOO BAD - go out of filtered phy->sf_offset_filtered:%d\n", __FUNCTION__, phy->sf_offset_filtered);
++        }
++
+ 	if(phy->min_sync_cycle_count)
+ 		phy->min_sync_cycle_count--;
+ 
+@@ -954,7 +971,6 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+ 			phy->sf_offset = ind.t2 - (ind.t1 - phy->average_latency);
+ 
+ 			sfn_sf_dec += (phy->sf_offset / 1000);
+-
+ 		}
+ 		else
+ 		{
+@@ -976,12 +992,11 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+ 		{
+ 			phy->adjustment = NFAPI_SFNSF2DEC(new_sfn_sf) - NFAPI_SFNSF2DEC(curr_sfn_sf);
+ 
+-			//NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF phy_id:%d adjustment%d\n", ind.header.phy_id, phy->adjustment);
++			NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF phy_id:%d adjustment%d phy->previous_sf_offset_filtered:%d phy->previous_sf_offset_filtered:%d phy->sf_offset_trend:%d\n", ind.header.phy_id, phy->adjustment, phy->previous_sf_offset_filtered, phy->previous_sf_offset_filtered, phy->sf_offset_trend);
+ 
+ 			phy->previous_t1 = 0;
+ 			phy->previous_t2 = 0;
+ 
+-
+ 			if(phy->previous_sf_offset_filtered > 0)
+ 			{
+ 				if( phy->sf_offset_filtered > phy->previous_sf_offset_filtered)
+@@ -1083,9 +1098,14 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+ 
+ 						if(phy->insync_minor_adjustment != 0)
+ 						{
+-							NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d suframes (sf_offset_filtered:%d) %d %d %d\n", 
++							NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d subframes (sf_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adjustment:%d\n", 
+ 										NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ind.header.phy_id,
+-										phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->sf_offset_filtered, insync_minor_adjustment_1, insync_minor_adjustment_2, phy->sf_offset_trend); 
++										phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, 
++                                                                                phy->sf_offset_filtered, 
++                                                                                insync_minor_adjustment_1, insync_minor_adjustment_2, phy->sf_offset_trend,
++                                                                                NFAPI_SFNSF2DEC(new_sfn_sf),
++                                                                                NFAPI_SFNSF2DEC(curr_sfn_sf),
++                                                                                phy->adjustment); 
+ 						}
+ 					}
+ 				}
+@@ -1121,10 +1141,13 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+ 								// out of sync?
+ 							}
+ 							
+-							NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d suframes (adjusment:%d sf_offset_filtered:%d) %d %d %d\n", 
++							NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d subframes (adjustment:%d sf_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adj:%d\n", 
+ 										NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ind.header.phy_id,
+ 										phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->sf_offset_filtered,
+-										insync_minor_adjustment_1, insync_minor_adjustment_2, phy->sf_offset_trend); 
++										insync_minor_adjustment_1, insync_minor_adjustment_2, phy->sf_offset_trend,
++                                                                                NFAPI_SFNSF2DEC(new_sfn_sf),
++                                                                                NFAPI_SFNSF2DEC(curr_sfn_sf),
++                                                                                phy->adjustment); 
+ 							
+ 						}
+ 						else if(phy->adjustment < 0)
+@@ -1151,7 +1174,7 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+ 								// out of sync?
+ 							}
+ 
+-							NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d suframes (adjusment:%d sf_offset_filtered:%d) %d %d %d\n", 
++							NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d subframes (adjustment:%d sf_offset_filtered:%d) %d %d %d\n", 
+ 										NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ind.header.phy_id,
+ 										phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->sf_offset_filtered,
+ 										insync_minor_adjustment_1, insync_minor_adjustment_2, phy->sf_offset_trend); 
+@@ -1219,7 +1242,16 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+ 		return;
+ 	}
+ 
+-	// todo : how to use this?
++        if (vnf_p7 && vnf_p7->p7_connections)
++        {
++          int16_t vnf_pnf_sfnsf_delta = NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf) - NFAPI_SFNSF2DEC(ind.last_sfn_sf);
++
++          //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PNF:SFN/SF:%d VNF:SFN/SF:%d deltaSFNSF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind.last_sfn_sf), NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), vnf_pnf_sfnsf_delta);
++          if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1)
++          {
++            NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n", __FUNCTION__, vnf_pnf_sfnsf_delta, NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), NFAPI_SFNSF2DEC(ind.last_sfn_sf));
++          }
++        }
+ }
+ 
+ void vnf_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
+diff --git a/vnf/src/vnf_p7_interface.c b/vnf/src/vnf_p7_interface.c
+index ab4f00c..a35d8e3 100644
+--- a/vnf/src/vnf_p7_interface.c
++++ b/vnf/src/vnf_p7_interface.c
+@@ -142,6 +142,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
+ 	NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 bind succeeded...\n");
+ 
+ 
++	//struct timespec original_pselect_timeout;
+ 	struct timespec pselect_timeout;
+ 	pselect_timeout.tv_sec = 0;
+ 	pselect_timeout.tv_nsec = 1000000; // ns in a 1 us
+@@ -157,13 +158,13 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
+ 
+ 	struct timespec sf_duration;
+ 	sf_duration.tv_sec = 0;
+-	sf_duration.tv_nsec = 1000000; // ns in a 1 us
++	sf_duration.tv_nsec = 1e6; // We want 1ms pause
+ 
+ 	struct timespec sf_start;
+ 	clock_gettime(CLOCK_MONOTONIC, &sf_start);
+ 	long millisecond = sf_start.tv_nsec / 1e6;
+ 	sf_start = timespec_add(sf_start, sf_duration);
+-	//NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
++	NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
+ 
+ 	while(vnf_p7->terminate == 0)
+ 	{
+@@ -181,6 +182,8 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
+ 
+ 		if((last_millisecond == -1) || (millisecond == last_millisecond) || (millisecond == (last_millisecond + 1) % 1000) )
+ 		{
++                  //NFAPI_TRACE(NFAPI_TRACE_INFO, "pselect_start:%d.%d sf_start:%d.%d\n", pselect_start.tv_sec, pselect_start.tv_nsec, sf_start.tv_sec, sf_start.tv_nsec);
++
+ 
+ 			if((pselect_start.tv_sec > sf_start.tv_sec) || 
+ 			   ((pselect_start.tv_sec == sf_start.tv_sec) && (pselect_start.tv_nsec > sf_start.tv_nsec)))
+@@ -196,16 +199,26 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
+ 			{
+ 				// still time before the end of the subframe wait
+ 				pselect_timeout = timespec_sub(sf_start, pselect_start);
++
++#if 0
++                                NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sf_start:%d.%ld pselect_start:%d.%ld pseclect_timeout:%d.%ld\n",
++                                    __FUNCTION__,
++                                    sf_start.tv_sec, sf_start.tv_nsec,
++                                    pselect_start.tv_sec, pselect_start.tv_nsec,
++                                    pselect_timeout.tv_sec, pselect_timeout.tv_nsec);
++#endif
+ 			}
+ 
++//original_pselect_timeout = pselect_timeout;
++
+ 			// detemine how long to sleep in ns before the start of the next 1ms
+ 			//pselect_timeout.tv_nsec = 1e6 - (pselect_start.tv_nsec % 1000000);
+ 
+-			//uint8_t underun_possiable =0;
++			//uint8_t underrun_possible =0;
+ 			
+ 			// if we are not sleeping until the next milisecond due to the
+ 			// insycn minor adjment flag it so we don't consider it an error
+-			//uint8_t underun_possiable =0;
++			//uint8_t underrun_possible =0;
+ 			/*
+ 			{
+ 				nfapi_vnf_p7_connection_info_t* phy = vnf_p7->p7_connections;
+@@ -222,7 +235,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
+ 							pselect_timeout.tv_nsec = pselect_timeout.tv_nsec - (phy->insync_minor_adjustment * 1000);
+ 
+ 
+-						//underun_possiable = 1;
++						//underrun_possible = 1;
+ 					}
+ 					else if(phy->insync_minor_adjustment < 0)
+ 					{
+@@ -237,41 +250,98 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
+ 			*/
+ 			
+ 
++//long wraps = pselect_timeout.tv_nsec % 1e9;
++
++
+ 			selectRetval = pselect(maxSock+1, &rfds, NULL, NULL, &pselect_timeout, NULL);
+ 
+ 			clock_gettime(CLOCK_MONOTONIC, &pselect_stop);
+ 
++                        nfapi_vnf_p7_connection_info_t* phy = vnf_p7->p7_connections;
++
++if (selectRetval==-1 && errno == 22)
++{
++  NFAPI_TRACE(NFAPI_TRACE_ERROR, "INVAL: pselect_timeout:%d.%ld adj[dur:%d adj:%d], sf_dur:%d.%ld\n", 
++  pselect_timeout.tv_sec, pselect_timeout.tv_nsec, 
++  phy->insync_minor_adjustment_duration, phy->insync_minor_adjustment, 
++  sf_duration.tv_sec, sf_duration.tv_nsec);
++}
++#if 0
++                        if (selectRetval != 0 || phy->insync_minor_adjustment_duration != 0)
++                          NFAPI_TRACE(NFAPI_TRACE_NOTE, "pselect()=%d maxSock:%d vnf_p7->socket:%d pselect_timeout:%u.%u original_pselect_timeout:%u.%u\n", 
++                              selectRetval, maxSock, vnf_p7->socket, pselect_timeout.tv_sec, pselect_timeout.tv_nsec,
++                              original_pselect_timeout.tv_sec, original_pselect_timeout.tv_nsec);
++#endif
++
+ 			if(selectRetval == 0)
+ 			{
+-				// calcualte the start of the next subframe
++				// calculate the start of the next subframe
+ 				sf_start = timespec_add(sf_start, sf_duration);
+ 				//NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
+ 
+-				nfapi_vnf_p7_connection_info_t* phy = vnf_p7->p7_connections;
+ 				if(phy && phy->in_sync && phy->insync_minor_adjustment != 0 && phy->insync_minor_adjustment_duration > 0)
+ 				{
+-					NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] Subframe minor adjustment %dus\n", phy->insync_minor_adjustment);
++                                        long insync_minor_adjustment_ns = (phy->insync_minor_adjustment * 1000);
++
++                                        sf_start.tv_nsec -= insync_minor_adjustment_ns;
++
++#if 1
++                                        if (sf_start.tv_nsec > 1e9)
++                                        {
++                                          sf_start.tv_sec++;
++                                          sf_start.tv_nsec-=1e9;
++                                        }
++                                        else if (sf_start.tv_nsec < 0)
++                                        {
++                                          sf_start.tv_sec--;
++                                          sf_start.tv_nsec+=1e9;
++                                        }
++#else
++                                        //NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] BEFORE adjustment - Subframe minor adjustment %dus sf_start.tv_nsec:%d\n", phy->insync_minor_adjustment, sf_start.tv_nsec);
+ 					if(phy->insync_minor_adjustment > 0)
+ 					{
+ 						// decrease the subframe duration a little
+-						sf_start.tv_nsec = sf_start.tv_nsec - (phy->insync_minor_adjustment * 1000);
++                                                if (sf_start.tv_nsec > insync_minor_adjustment_ns)
++                                                  sf_start.tv_nsec -= insync_minor_adjustment_ns;
++                                                else
++                                                {
++                                                  NFAPI_TRACE(NFAPI_TRACE_ERROR, "[VNF] Adjustment would make it negative sf:%d.%ld adjust:%ld\n\n\n", sf_start.tv_sec, sf_start.tv_nsec, insync_minor_adjustment_ns);
++                                                  sf_start.tv_sec--;
++                                                  sf_start.tv_nsec += 1e9 - insync_minor_adjustment_ns;
++                                                }
+ 					}
+ 					else if(phy->insync_minor_adjustment < 0)
+ 					{
+ 						// todo check we don't go below 0
+ 						// increase the subframe duration a little
+-						sf_start.tv_nsec = sf_start.tv_nsec - (phy->insync_minor_adjustment * 1000);
++						sf_start.tv_nsec += insync_minor_adjustment_ns;
++
++                                                if (sf_start.tv_nsec < 0)
++                                                {
++                                                  NFAPI_TRACE(NFAPI_TRACE_ERROR, "[VNF] OVERFLOW %d.%ld\n\n\n\n", sf_start.tv_sec, sf_start.tv_nsec);
++                                                  sf_start.tv_sec++;
++                                                  sf_start.tv_nsec += 1e9;
++                                                }
+ 					}
++#endif
+ 
+ 					//phy->insync_minor_adjustment = 0;
+-					phy->insync_minor_adjustment_duration--;
++                                        phy->insync_minor_adjustment_duration--;
++
++                                        NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] AFTER adjustment - Subframe minor adjustment %dus sf_start.tv_nsec:%d duration:%u\n", 
++                                            phy->insync_minor_adjustment, sf_start.tv_nsec, phy->insync_minor_adjustment_duration);
++
++                                        if (phy->insync_minor_adjustment_duration==0)
++                                        {
++                                          phy->insync_minor_adjustment = 0;
++                                        }
+ 				}
+ 				/*
+ 				long pselect_stop_millisecond = pselect_stop.tv_nsec / 1e6;
+ 				if(millisecond == pselect_stop_millisecond)
+ 				{
+ 					// we have woke up in the same subframe
+-					if(underun_possiable == 0)
++					if(underrun_possible == 0)
+ 						NFAPI_TRACE(NFAPI_TRACE_WARN, "subframe pselect underrun %ld (%d.%d)\n", millisecond, pselect_stop.tv_sec, pselect_stop.tv_nsec);
+ 				}
+ 				else if(((millisecond + 1) % 1000) != pselect_stop_millisecond)
+@@ -298,7 +368,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
+ 
+ 		if(selectRetval == 0)
+ 		{
+-			vnf_p7->sf_start_time_hr = get_current_time_hr();
++			vnf_p7->sf_start_time_hr = vnf_get_current_time_hr();
+ 
+ 			// pselect timed out
+ 			nfapi_vnf_p7_connection_info_t* curr = vnf_p7->p7_connections;
+@@ -326,14 +396,18 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
+ 		else
+ 		{
+ 			// pselect error
+-			if(selectRetval == EINTR)
++			if(selectRetval == -1 && errno == EINTR)
+ 			{
+ 				// a sigal was received.
+ 			}
+ 			else
+ 			{
+-				NFAPI_TRACE(NFAPI_TRACE_INFO, "P7 select failed result %d errno %d timeout:%d.%d\n", selectRetval, errno, pselect_timeout.tv_sec, pselect_timeout.tv_nsec);
++				NFAPI_TRACE(NFAPI_TRACE_INFO, "P7 select failed result %d errno %d timeout:%d.%d orginal:%d.%d last_ms:%ld ms:%ld\n", selectRetval, errno, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, last_millisecond, millisecond);
+ 				// should we exit now?
++                                if (selectRetval == -1 && errno == 22) // invalid argument??? not sure about timeout duration
++                                {
++                                  usleep(100000);
++                                }
+ 			}
+ 		}
+ 
+@@ -360,10 +434,12 @@ int nfapi_vnf_p7_stop(nfapi_vnf_p7_config_t* config)
+ 
+ int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id)
+ {
+-	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(phy_id:%d pnf_addr:%s:%d)\n", __FUNCTION__, phy_id,  pnf_p7_addr, pnf_p7_port);
++	NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p phy_id:%d pnf_addr:%s pnf_p7_port:%d)\n", __FUNCTION__, config, phy_id,  pnf_p7_addr, pnf_p7_port);
+ 
+ 	if(config == 0)
+-		return -1;
++        {
++          return -1;
++        }
+ 
+ 	vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
+ 
+@@ -411,6 +487,8 @@ int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id)
+ }
+ int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req)
+ {
++	//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p req:%p)\n", __FUNCTION__, config, req);
++
+ 	if(config == 0 || req == 0)
+ 		return -1;
+ 
+diff --git a/vnf_sim/src/mac.cpp b/vnf_sim/src/mac.cpp
+index aa97f72..fa6f487 100644
+--- a/vnf_sim/src/mac.cpp
++++ b/vnf_sim/src/mac.cpp
+@@ -743,7 +743,7 @@ extern "C"
+ 			{
+ 				cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1;
+ 				cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = rand_range(0, 3);
+-				cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size = rand_range(0, 255);
++				cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0] = rand_range(0, 255);
+ 			}
+ 			
+ 			cqi_ri_information.cqi_ri_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG;
+diff --git a/vnf_sim/src/main.cpp b/vnf_sim/src/main.cpp
+index b79ac40..5dc7161 100644
+--- a/vnf_sim/src/main.cpp
++++ b/vnf_sim/src/main.cpp
+@@ -428,6 +428,20 @@ void phy_deallocate_p7_vendor_ext(nfapi_p7_message_header_t* header)
+ 	free(header);
+ }
+ 
++//static pthread_t vnf_start_pthread;
++static pthread_t vnf_p7_start_pthread;
++void* vnf_p7_start_thread(void *ptr)
++{
++  printf("%s()\n", __FUNCTION__);
++
++  //std::shared_ptr<nfapi_vnf_p7_config> config = std::shared_ptr<nfapi_vnf_p7_config>(ptr);
++  nfapi_vnf_p7_config_t *config = (nfapi_vnf_p7_config_t *)ptr;
++
++  nfapi_vnf_p7_start(config);
++
++  return 0;
++}
++
+ void set_thread_priority(int priority)
+ {
+ 	//printf("%s(priority:%d)\n", __FUNCTION__, priority);
+@@ -458,6 +472,8 @@ void set_thread_priority(int priority)
+ 
+ void* vnf_p7_thread_start(void* ptr)
+ {
++  printf("%s()\n", __FUNCTION__);
++
+ 	set_thread_priority(79);
+ 
+ 	vnf_p7_info* p7_vnf = (vnf_p7_info*)ptr;
+@@ -494,10 +510,10 @@ void* vnf_p7_thread_start(void* ptr)
+ 	p7_vnf->config->allocate_p7_vendor_ext = &phy_allocate_p7_vendor_ext;
+ 	p7_vnf->config->deallocate_p7_vendor_ext = &phy_deallocate_p7_vendor_ext;
+ 
+-	nfapi_vnf_p7_start(p7_vnf->config.get());
++        printf("[VNF] Creating VNF NFAPI start thread %s\n", __FUNCTION__);
++        pthread_create(&vnf_p7_start_pthread, NULL, &vnf_p7_start_thread, p7_vnf->config.get());
+ 
+ 	return 0;
+-
+ }
+ 
+ int pnf_connection_indication_cb(nfapi_vnf_config_t* config, int p5_idx)
+diff --git a/wireshark/packet-nfapi.c b/wireshark/packet-nfapi.c
+index da0edb0..7e0f23f 100755
+--- a/wireshark/packet-nfapi.c
++++ b/wireshark/packet-nfapi.c
+@@ -1,6069 +1,12284 @@
+-/*
++/* packet-nfapi.c
++* Routines for Network Function Application Platform Interface (nFAPI) dissection
+ * Copyright 2017 Cisco Systems, Inc.
+ *
+-* Licensed under the Apache License, Version 2.0 (the "License");
+-* you may not use this file except in compliance with the License.
+-* You may obtain a copy of the License at
++* Wireshark - Network traffic analyzer
++* By Gerald Combs <gerald@wireshark.org>
++* Copyright 1998 Gerald Combs
++*
++* This program is free software; you can redistribute it and/or
++* modify it under the terms of the GNU General Public License
++* as published by the Free Software Foundation; either version 2
++* of the License, or (at your option) any later version.
++*
++* This program is distributed in the hope that it will be useful,
++* but WITHOUT ANY WARRANTY; without even the implied warranty of
++* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++* GNU General Public License for more details.
++*
++* You should have received a copy of the GNU General Public License
++* along with this program; if not, write to the Free Software
++* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+-* http://www.apache.org/licenses/LICENSE-2.0
++* References:
++* SCF082.09.04  http://scf.io/en/documents/082_-_nFAPI_and_FAPI_specifications.php
+ *
+-* Unless required by applicable law or agreed to in writing, software
+-* distributed under the License is distributed on an "AS IS" BASIS,
+-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-* See the License for the specific language governing permissions and
+-* limitations under the License.
+ */
+-
+-
+-#include "config.h" 
+-
+-#include <windows.h>
+-#include <stdio.h>
+-#include <stdint.h>
+-
+-#include <epan/packet.h>
+-#include <epan/exceptions.h>
+-#include <epan/prefs.h>
+-#include <epan/expert.h>
+-#include <epan/reassemble.h>
+-
++
++#include "config.h"
++
++#include <epan/packet.h>
++#include <epan/exceptions.h>
++#include <epan/expert.h>
++#include <epan/reassemble.h>
++#include <epan/wmem/wmem.h>
++
++#include <ptvcursor.h>
++
++void proto_register_nfapi(void);
++void proto_reg_handoff_nfapi(void);
++
+ #define NFAPI_HEADER_LENGTH 8
+-#define NFAPI_P7_HEADER_LENGTH 16
+-
+-typedef int(*Decode_operation)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset);
+-
+-static const value_string nfapi_error_vals[] = {
+-	{ 0x0, "MSG_OK" },
+-	{ 0x1, "MSG_INVALID_STATE" },
+-	{ 0x2, "MSG_INVALID_CONFIG" },
+-	{ 0x3, "SFN_OUT_OF_SYNC" },
+-	{ 0x4, "MSG_SUBFRAME_ERR" },
+-	{ 0x5, "MSG_BCH_MISSING" },
+-	{ 0x6, "MSG_BCH_MISSING" },
+-	{ 0x7, "MSG_HI_ERR" },
+-	{ 0x8, "MSG_TX_ERR" },
+-	{ 0, NULL },
+-};
+-
+-static const value_string nfapi_p4_error_vals[] = {
+-	{ 100, "MSG_OK" },
+-	{ 101, "MSG_INVALID_STATE" },
+-	{ 102, "MSG_INVALID_CONFIG" },
+-	{ 103, "MSG_RAT_NOT_SUPPORTED" },
+-	{ 200, "MSG_NMM_STOP_OK" },
+-	{ 201, "MSG_NMM_STOP_IGNORED" },
+-	{ 202, "MSG_NMM_STOP_INVALID_STATE" },
+-	{ 300, "MSG_PROCEDURE_COMPLETE" },
+-	{ 301, "MSG_PROCEDURE_STOPPED" },
+-	{ 302, "MSG_PARTIAL_RESULTS" },
+-	{ 303, "MSG_TIMEOUT" },
+-	{ 0, NULL },
+-};
+-
+-static const value_string nfapi_rat_type_vals[] = {
+-	{ 0, "LTE" },
+-	{ 1, "UTRAN" },
+-	{ 2, "GERAN" },
+-	{ 0, NULL },
+-};
+-
+-typedef enum{
+-	UN_ALIGNED_SYNCHRONIZATION = 0,
+-	INTERNAL_PNF_FRAME_ALIGNMENT,
+-	ABSOLUTE_TIME_ALIGNED_SYNCHRONIZATION
+-} nfapi_sync_mode_e;
+-
+-static const value_string nfapi_sync_mode_vals[] = {
+-	{ UN_ALIGNED_SYNCHRONIZATION, "UN-ALIGNED SYNCHRONIZATION" },
+-	{ INTERNAL_PNF_FRAME_ALIGNMENT, "INTERNAL PNF FRAME ALIGNMENT" },
+-	{ ABSOLUTE_TIME_ALIGNED_SYNCHRONIZATION, "ABSOLUTE TIME ALIGNED SYNCHRONIZATION" }
+-};
+-
+-typedef enum {
+-	NONE = 0,
+-	GPS,
+-	GLONASS,
+-	BEIDOU
+-} location_mode_e;
+-
+-static const value_string location_mode_vals[] = {
+-	{ NONE, "NONE" },
+-	{ GPS, "GPS" },
+-	{ GLONASS, "GLONASS" },
+-	{ BEIDOU, "BeiDou" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string nfapi_uplink_rs_hopping_vals[] = {
+-	{ 0, "RS_NO_HOPPING" },
+-	{ 1, "RS_GROUP_HOPPING" },
+-	{ 2, "RS_SEQUENCE_HOPPING" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string nfapi_laa_carrier_type_vals[] = {
+-	{ 0, "No multi carrier support" },
+-	{ 1, "Mode A1" },
+-	{ 2, "Mode A12" },
+-	{ 3, "Mode B1" },
+-	{ 4, "Mode B2" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string nfapi_mutli_carrier_lbt_support_vals[] = {
+-	{ 0, "Multi carrier Mode A1" },
+-	{ 1, "Multi carrier Mode A2" },
+-	{ 2, "Multi carrier Mode B1" },
+-	{ 3, "Multi carrier Mode B2" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string nfapi_lbt_dl_req_pdu_type[] = {
+-	{ 0, "LBT_PDSCH_REQ PDU" },
+-	{ 1, "LBT_DRS_REQ PDU" },
+-	{ 0, NULL }
+-};
+-
+-
+-static const value_string nfapi_lbt_dl_ind_pdu_type[] = {
+-	{ 0, "LBT_PDSCH_RSP PDU" },
+-	{ 1, "LBT_DRS_RSP PDU" },
+-
+-	{ 0, NULL }
+-};
+-
+-
+-
+-
+-/* These are definitions where data 0 & 1 represent/provide a string name*/
+-
+-static const true_false_string true_false_strname = {
+-	"TRUE",
+-	"FALSE"
+-};
+-
+-static const true_false_string  nfapi_csi_report_type_strname = {
+-	"Periodic",
+-	"Aperiodic",
+-};
+-
+-static const true_false_string nfapi_control_type_string_name = {
+-	"CQI/PMI",
+-	"RI",
+-};
+-
+-static const true_false_string transport_block_to_codeword_swap_flag = {
+-	"NO_SWAPPING",
+-	"SWAPPED"
+-};
+-
+-static const true_false_string virtual_resource_block_assignment_flag = {
+-	"LOCALIZED",
+-	"DISTRIBUTED"
+-};
+-
+-static const true_false_string ngap_string_name = {
+-	"N-GAP 1",
+-	"N-GAP 2"
+-};
+-
+-static const true_false_string  nprb_strname = {
+-	"= 2",
+-	"= 3",
+-};
+-
+-static const true_false_string cyclic_prefix_type_strname = {
+-	"CP_NORMAL",
+-	"CP_EXTENDED"
+-};
+-
+-static const true_false_string support_strname = {
+-	"No Support",
+-	"Support"
+-};
+-
+-static const true_false_string partial_sf_support_strname =
+-{
+-	"Start partial SF support",
+-	"End partial SF support"
+-};
+-
+-static const true_false_string phich_duration_strname = {
+-	"PHICH_D_NORMAL",
+-	"PHICH_D_EXTENDED"
+-};
+-
+-static const true_false_string high_speed_flag_strname = {
+-	"HS_UNRESTRICTED_SET",
+-	"HS_RESTRICTED_SET"
+-};
+-
+-static const true_false_string hopping_mode_strname = {
+-	"HM_INTER_SF",
+-	"HM_INTRA_INTER_SF"
+-};
+-
+-static const true_false_string enabled_disabled_strname = {
+-	"Enabled",
+-	"Disabled"
+-};
+-
+-static const true_false_string srs_simult_tx_strname = {
+-	"No Simultaneous Transmission",
+-	"Simultaneous Transmission"
+-};
+-
+-static const true_false_string crc_flag_strname = {
+-	"CRC_CORRECT",
+-	"CRC_ERROR"
+-};
+-
+-static const true_false_string hi_value_strname = {
+-	"HI_NACK",
+-	"HI_ACK"
+-};
+-
+-static const true_false_string flag_tb2_strname = {
+-	"HI_NOT_PRESENT",
+-	"HI_PRESENT"
+-};
+-
+-static const true_false_string nfapi_multi_carrier_tx_strname = {
+-	"Mutual transmission (self-deferral support for current carrier)",
+-	"Transmit on channel access win (no self-deferral)"
+-};
+-
+-static const true_false_string nfapi_multi_carrier_freeze_strname = {
+-	"Absence of other technology isn’t guaranteed",
+-	"Absence of other technology is guaranteed"
+-};
+-
+-static const value_string nfapi_dl_config_pdu_type_vals[] = {
+-	{ 0, "DL_CONFIG_DCI_DL_PDU" },
+-	{ 1, "DL_CONFIG_BCH_PDU" },
+-	{ 2, "DL_CONFIG_MCH_PDU" },
+-	{ 3, "DL_CONFIG_DLSCH_PDU" },
+-	{ 4, "DL_CONFIG_PCH_PDU" },
+-	{ 5, "DL_CONFIG_PRS_PDU" },
+-	{ 6, "DL_CONFIG_CSI_RS_PDU" },
+-	{ 7, "DL_CONFIG_EPDCCH_DL_PDU" },
+-	{ 8, "DL_CONFIG_EPDCCH_DL_PDU" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string nfapi_duplex_mode_vals[] = {
+-	{ 0, "TDD" },
+-	{ 1, "FDD" },
+-	{ 2, "HD-FDD" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string modulation_vals[] = {
+-	{ 2, "QPSK" },
+-	{ 4, "16QAM" },
+-	{ 6, "64QAM" },
+-	{ 8, "256QAM" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string pch_modulation_vals[] = {
+-	{ 0, "QPSK" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string ue_mode_vals[] = {
+-	{ 0, "non LC/CE UE" },
+-	{ 1, "LC/CE UE" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string csi_rs_class_vals[] = {
+-	{ 0, "not used" },
+-	{ 1, "Class A" },
+-	{ 1, "Class B" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string csi_rs_cdm_type_vals[] = {
+-	{ 0, "cdm 2" },
+-	{ 1, "cdm 4" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string antenna_ports_vals[] = {
+-	{ 0, "1 antenna ports" },
+-	{ 1, "2 antenna ports" },
+-	{ 2, "4 antenna ports" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string combs_vals[] = {
+-	{ 0, "2 TC" },
+-	{ 1, "4 TC" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string resource_allocation_type_vals[] = {
+-	{ 0, "type 0" },
+-	{ 1, "type 1" },
+-	{ 2, "type 2 1A/1B/1D" },
+-	{ 3, "type 2 1C" },
+-	{ 4, "type 2 6-1A" },
+-	{ 5, "type UEModeB" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string transmission_scheme_vals[] = {
+-	{ 0, "SINGLE_ANTENNA_PORT_0" },
+-	{ 1, "TX_DIVERSITY" },
+-	{ 2, "LARGE_DELAY_CDD" },
+-	{ 3, "CLOSED_LOOP_SPATIAL_MULTIPLEXING" },
+-	{ 4, "MULTI_USER_MIMO" },
+-	{ 5, "CLOSED_LOOP_RANK_1_PRECODING" },
+-	{ 6, "SINGLE_ANTENNA_PORT_5" },
+-	{ 7, "SINGLE_ANTENNA_PORT_7" },
+-	{ 8, "SINGLE_ANTENNA_PORT_8" },
+-	{ 9, "DUAL_LAYER_TX_PORT_7_AND_8" },
+-	{ 10, "UP_TO_8_LAYER_TX" },
+-	{ 11, "SINGLE_ANTENNA_PORT_11" },
+-	{ 12, "SINGLE_ANTENNA_PORT_13" },
+-	{ 13, "SINGLE_ANTENNA_PORT_11_13" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string ul_transmission_scheme_vals[] = {
+-	{ 0, "SINGLE_ANTENNA_PORT_10" },
+-	{ 1, "CLOSED_LOOP_SPATIAL_MULTIPLEXING" },
+-};
+-
+-static const value_string dci_format_vals[] = {
+-	{ 0, "1" },
+-	{ 1, "1A" },
+-	{ 2, "1B" },
+-	{ 3, "1C" },
+-	{ 4, "1D" },
+-	{ 5, "2" },
+-	{ 6, "2A" },
+-	{ 7, "2B" },
+-	{ 8, "2C" },
+-	{ 9, "2D" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string pa_vals[] = {
+-	{ 0, "-6dB" },
+-	{ 1, "-4.77dB" },
+-	{ 2, "-3dB" },
+-	{ 3, "-1.77dB" },
+-	{ 4, "0dB" },
+-	{ 5, "1dB" },
+-	{ 6, "2dB" },
+-	{ 7, "3dB" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string transmission_mode_vals[] = {
+-	{ 1, "Mode 1" },
+-	{ 2, "Mode 2" },
+-	{ 3, "Mode 3" },
+-	{ 4, "Mode 4" },
+-	{ 5, "Mode 5" },
+-	{ 6, "Mode 6" },
+-	{ 7, "Mode 7" },
+-	{ 8, "Mode 8" },
+-	{ 9, "Mode 9" },
+-	{ 10, "Mode 10" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string nfapi_ul_config_pdu_type_vals[] = {
+-	{ 0, "ULSCH" },
+-	{ 1, "ULSCH_CQI_RI" },
+-	{ 2, "ULSCH_HARQ" },
+-	{ 3, "ULSCH_CQI_HARQ_RI" },
+-	{ 4, "UCI_CQI" },
+-	{ 5, "UCI_SR" },
+-	{ 6, "UCI_HARQ" },
+-	{ 7, "UCI_SR_HARQ" },
+-	{ 8, "UCI_CQI_HARQ" },
+-	{ 9, "UCI_CQI_SR" },
+-	{ 10, "UCI_CQI_SR_HARQ" },
+-	{ 11, "SRS" },
+-	{ 12, "HARQ_BUFFER" },
+-	{ 13, "ULSCH_UCI_CSI" },
+-	{ 14, "ULSCH_UCI_HARQ" },
+-	{ 15, "ULSCH_CSI_UCI_HARQ" },
+-	{ 0, NULL }
+-};
+-
+-typedef enum {
+-	NFAPI_ACK_NACK_MODE_BUNDLING = 0,
+-	NFAPI_ACK_NACK_MODE_MULTIPLEXING,
+-	NFAPI_ACK_NACK_MODE_FORMAT_1B_WITH_CHAN_SEL,
+-	NFAPI_ACK_NACK_MODE_FORMAT_3,
+-} nfapi_ack_nack_mode_e;
+-
+-static const value_string nfapi_ack_nack_mode_vals[] = {
+-	{ NFAPI_ACK_NACK_MODE_BUNDLING, "Bundling" },
+-	{ NFAPI_ACK_NACK_MODE_MULTIPLEXING, "Multiplexing" },
+-	{ NFAPI_ACK_NACK_MODE_FORMAT_1B_WITH_CHAN_SEL, "Format 1b with channel selection" },
+-	{ NFAPI_ACK_NACK_MODE_FORMAT_3, "Format 3" },
+-	{ 0, NULL }
+-};
+-
+-typedef enum {
+-	NFAPI_ANTENNA_PORT1 = 0,
+-	NFAPI_ANTENNA_PORT2,
+-	NFAPI_ANTENNA_PORT4,
+-} nfapi_ack_nack_mode_e;
+-
+-static const value_string nfapi_antenna_port_vals[] = {
+-	{ NFAPI_ANTENNA_PORT1, "1 " },
+-	{ NFAPI_ANTENNA_PORT2, "2 " },
+-	{ NFAPI_ANTENNA_PORT4, "4 " },
+-	{ 0, NULL }
+-};
+-
+-typedef enum{
+-	PHICH_R_ONE_SIXTH = 0,
+-	PHICH_R_HALF,
+-	PHICH_R_ONE,
+-	PHICH_R_TWO
+-} nfapi_phich_resource_e;
+-
+-static const value_string nfapi_phich_resource_vals[] = {
+-	{ PHICH_R_ONE_SIXTH, "PHICH_R_ONE_SIXTH " },
+-	{ PHICH_R_HALF, "PHICH_R_HALF" },
+-	{ PHICH_R_ONE, "PHICH_R_ONE" },
+-	{ PHICH_R_TWO, "PHICH_R_TWO" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string local_distributed_vals[] = {
+-	{ 0, "localized" },
+-	{ 1, "distributed" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string transport_block_to_codeword_swap_flag_vals[] = {
+-	{ 0, "no swapping" },
+-	{ 1, "swapped" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string ngap_vals[] = {
+-	{ 0, "Ngap1" },
+-	{ 1, "Ngap2" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string true_false_vals[] = {
+-	{ 0, "false" },
+-	{ 1, "true" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string exhustive_search_vals[] = {
+-	{ 0, "non-exhaustive search" },
+-	{ 1, "exhaustive search" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string not_used_enabled_vals[] = {
+-	{ 0, "not used" },
+-	{ 1, "enabled" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string hopping_vals[] = {
+-	{ 0, "no hopping" },
+-	{ 1, "hopping enabled" },
+-	{ 0, NULL }
+-};
+-
+-
+-static const value_string rnti_type_vals[] = {
+-	{ 1, "C-RNTI" },
+-	{ 2, "RA-RNTI, P-RNTI, SI-RNTI, SC-RNTI, G-RNTI" },
+-	{ 3, "SPS-CRNTI" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string primary_cells_type_vals[] = {
+-	{ 1, "TDD" },
+-	{ 2, "FDD" },
+-	{ 3, "HD_FDD" },
+-	{ 0, NULL }
+-};
+-
+-static const value_string ul_rssi_supported_vals[] = {
+-	{ 0, "Uplink RSSI not supported" },
+-	{ 1, "Uplink RSSI supported" },
+-	{ 0, NULL}
+-};
+-
+-
+-typedef enum
+-{
+-	NMM_NONE = 0,
+-	NMM_ONLY,
+-	NMM_IN_CONFIGURED_STATE,
+-	NMM_IN_RUNNING_STATE,
+-	NMM_IN_CONFIGURED_AND_RUNNING_STATE
+-} nmm_modes_supported_e;
+-
+-static const value_string nmm_modes_supported_vals[] =
+-{
+-	{ NMM_NONE, "NONE" },
+-	{ NMM_ONLY, "NMM_ONLY" },
+-	{ NMM_IN_CONFIGURED_STATE, "NMM_IN_CONFIGURED_STATE" },
+-	{ NMM_IN_RUNNING_STATE, "NMM_IN_RUNNING_STATE" },
+-	{ NMM_IN_CONFIGURED_AND_RUNNING_STATE, "NMM_IN_CONFIGURED_AND_RUNNING_STAT" },
+-	{ 0, NULL }
+-};
+-
+-
+-
+-
+-
+-static int proto_nfapi = -1;
+-
+-/* These are for the subtrees */
+-static gint ett_nfapi_message_tree = -1;
+-static gint ett_nfapi_p4_p5_message_header = -1;
+-static gint ett_nfapi_p7_message_header = -1;
+-static gint ett_nfapi_tlv_tree = -1;
+-static gint ett_nfapi_tl = -1;
+-static gint ett_nfapi_pnf_param_response = -1;
+-static gint ett_nfapi_pnf_phy = -1;
+-static gint ett_nfapi_pnf_phy_rel10 = -1;
+-static gint ett_nfapi_pnf_phy_rel11 = -1;
+-static gint ett_nfapi_pnf_phy_rel12 = -1;
+-static gint ett_nfapi_pnf_phy_rel13 = -1;
+-static gint ett_nfapi_pnf_rf = -1;
+-static gint ett_nfapi_phy_rf_config_info = -1;
+-static gint ett_nfapi_pnf_phy_rf_config = -1;
+-static gint ett_nfapi_pnf_phy_rf_config_instance = -1;
+-static gint ett_nfapi_phy_state = -1;
+-static gint ett_nfapi_l1_status = -1;
+-static gint ett_nfapi_rf_bands = -1;
+-static gint ett_nfapi_tx_antenna_ports = -1;
+-static gint ett_nfapi_harq_ack_nack_data = -1;
+-static gint ett_nfapi_harq_data = -1;
+-static gint ett_nfapi_cc = -1;
+-static gint ett_nfapi_rbs = -1;
+-static gint ett_nfapi_antennas = -1;
+-static gint ett_nfapi_dl_config_dci_dl_pdu_rel8 = -1;
+-static gint ett_nfapi_dl_config_dci_dl_pdu_rel9 = -1;
+-static gint ett_nfapi_dl_config_dci_dl_pdu_rel10 = -1;
+-static gint ett_nfapi_dl_config_dci_dl_pdu = -1;
+-static gint ett_nfapi_dl_config_request_pdu = -1;
+-static gint ett_nfapi_dl_config_request_body = -1;
+-static gint ett_nfapi_dl_config_request_pdu_list = -1;
+-static gint ett_nfapi_ul_config_request_pdu_list = -1;
+-static gint ett_nfapi_hi_dci0_request_pdu_list = -1;
+-static gint ett_nfapi_tx_request_pdu_list = -1;
+-static gint ett_nfapi_rx_indication_pdu_list = -1;
+-static gint ett_nfapi_harq_indication_pdu_list = -1;
+-static gint ett_nfapi_crc_indication_pdu_list = -1;
+-static gint ett_nfapi_sr_indication_pdu_list = -1;
+-static gint ett_nfapi_cqi_indication_pdu_list = -1;
+-static gint ett_nfapi_preamble_indication_pdu_list = -1;
+-static gint ett_nfapi_srs_indication_pdu_list = -1;
+-static gint ett_nfapi_lbt_dl_config_pdu_list = -1;
+-static gint ett_nfapi_lbt_dl_indication_pdu_list = -1;
+-static gint ett_nfapi_dl_node_sync = -1;
+-static gint ett_nfapi_ul_node_sync = -1;
+-static gint ett_nfapi_timing_info = -1;
+-static gint ett_nfapi_dl_config_request_dlsch_pdu_rel8 = -1;
+-static gint ett_nfapi_subbands = -1;
+-static gint ett_nfapi_dl_config_request_dlsch_pdu_rel9 = -1;
+-static gint ett_nfapi_dl_config_request_dlsch_pdu_rel10 = -1;
+-static gint ett_nfapi_dl_config_bch_pdu_rel8 = -1;
+-static gint ett_nfapi_dl_config_mch_pdu_rel8 = -1;
+-static gint ett_nfapi_dl_config_pch_pdu_rel8 = -1;
+-static gint ett_nfapi_dl_config_prs_pdu_rel9 = -1;
+-static gint ett_nfapi_dl_config_csi_rs_pdu_rel10 = -1;
+-static gint ett_nfapi_ul_config_request_body = -1;
+-static gint ett_nfapi_ul_config_harq_buffer_pdu = -1;
+-static gint ett_nfapi_ul_config_ue_information_rel8 = -1;
+-static gint ett_nfapi_ul_config_sr_information_pdu_rel8 = -1;
+-static gint ett_nfapi_ul_config_ulsch_pdu_rel8 = -1;
+-static gint ett_nfapi_ul_config_ulsch_pdu_rel10 = -1;
+-static gint ett_nfapi_ul_config_cqi_ri_information_rel8 = -1;
+-static gint ett_nfapi_ul_config_cqi_ri_information_rel9 = -1;
+-static gint ett_nfapi_ul_config_ulsch_harq_information_rel10 = -1;
+-static gint ett_nfapi_ul_config_initial_transmission_parameters_rel8 = -1;
+-static gint ett_nfapi_ul_config_cqi_information_rel8 = -1;
+-static gint ett_nfapi_ul_config_cqi_information_rel10 = -1;
+-static gint ett_nfapi_ul_config_sr_information_rel8 = -1;
+-static gint ett_nfapi_ul_config_sr_information_rel10 = -1;
+-static gint ett_nfapi_ul_config_harq_information_rel10_tdd = -1;
+-static gint ett_nfapi_ul_config_harq_information_rel8_fdd = -1;
+-static gint ett_nfapi_ul_config_harq_information_rel9_fdd = -1;
+-static gint ett_nfapi_ul_config_srs_pdu_rel8 = -1;
+-static gint ett_nfapi_ul_config_srs_pdu_rel10 = -1;
+-static gint ett_nfapi_crc_indication_body = -1;
+-static gint ett_nfapi_bf_vector_antennas = -1;
+-static gint ett_nfapi_bf_vectors = -1;
+-static gint ett_nfapi_csi_rs_resource_configs = -1;
+-static gint ett_nfapi_csi_rs_bf_vector = -1;
+-static gint ett_nfapi_epdcch_prbs = -1;
+-static gint ett_nfapi_precoding = -1;
+-static gint ett_nfapi_earfcn_list = -1;
+-static gint ett_nfapi_uarfcn_list = -1;
+-static gint ett_nfapi_arfcn_list = -1;
+-static gint ett_nfapi_rssi_list = -1;
+-static gint ett_nfapi_pci_list = -1;
+-static gint ett_nfapi_psc_list = -1;
+-static gint ett_nfapi_lte_cells_found_list = -1;
+-static gint ett_nfapi_utran_cells_found_list = -1;
+-static gint ett_nfapi_geran_cells_found_list = -1;
+-static gint ett_nfapi_si_periodicity_list = -1;
+-
+-static expert_field ei_invalid_range = EI_INIT;
+-static expert_field ei_power_invalid = EI_INIT;
+-static expert_field ei_ref_sig_power_invalid = EI_INIT;
+-
+-
+-static int hf_nfapi_message_tree = -1;
+-
+-static int hf_nfapi_p4_p5_message_header = -1;
+-static int hf_nfapi_p4_p5_message_header_phy_id = -1;
+-static int hf_nfapi_p4_p5_message_header_message_id = -1;
+-static int hf_nfapi_p4_p5_message_header_message_length = -1;
+-static int hf_nfapi_p4_p5_message_header_spare = -1;
+-
+-static int hf_nfapi_p7_message_header = -1;
+-static int hf_nfapi_p7_message_header_phy_id = -1;
+-static int hf_nfapi_p7_message_header_message_id = -1;
+-static int hf_nfapi_p7_message_header_message_length = -1;
+-static int hf_nfapi_p7_message_header_m = -1;
+-static int hf_nfapi_p7_message_header_segment = -1;
+-static int hf_nfapi_p7_message_header_sequence_number = -1;
+-static int hf_nfapi_p7_message_header_checksum = -1;
+-static int hf_nfapi_p7_message_header_transmit_timestamp = -1;
+-
+-static int hf_nfapi_tlv_tree = -1;
+-
+-static int hf_nfapi_tl = -1;
+-static int hf_nfapi_tl_tag = -1;
+-static int hf_nfapi_tl_length = -1;
+-static int hf_nfapi_tag_uint8_value = -1;
+-static int hf_nfapi_tag_uint16_value = -1;
+-
+-static int hf_nfapi_pnf_param_general = -1;
+-static int hf_nfapi_sync_mode = -1;
+-static int hf_nfapi_location_mode = -1;
+-static int hf_nfapi_location_coordinates = -1;
+-static int hf_nfapi_location_coordinates_length = -1;
+-static int hf_nfapi_dl_config_timing = -1;
+-static int hf_nfapi_tx_timing = -1;
+-static int hf_nfapi_ul_config_timing = -1;
+-static int hf_nfapi_hi_dci0_timing = -1;
+-static int hf_nfapi_maximum_number_phys = -1;
+-static int hf_nfapi_maximum_total_bandwidth = -1;
+-static int hf_nfapi_maximum_total_number_dl_layers = -1;
+-static int hf_nfapi_maximum_total_number_ul_layers = -1;
+-static int hf_nfapi_shared_bands = -1;
+-static int hf_nfapi_shared_pa = -1;
+-static int hf_nfapi_maximum_total_power = -1;
+-static int hf_nfapi_oui= -1;
+-
+-static int hf_nfapi_pdu = -1;
+-
+-static int hf_nfapi_pnf_phy = -1;
+-static int hf_nfapi_pnf_phy_nfapi_tl = -1; /* structure hf_nfapi_tl*/
+-static int hf_nfapi_pnf_phy_number_phy = -1;
+-static int hf_nfapi_pnf_phy_config_index = -1;
+-static int hf_nfapi_number_of_rf_exclusions = -1;
+-static int hf_nfapi_dl_bandwidth_support = -1;
+-static int hf_nfapi_ul_bandwidth_support = -1;
+-static int hf_nfapi_downlink_channel_bandwidth_supported = -1;
+-static int hf_nfapi_uplink_channel_bandwidth_supported = -1;
+-static int hf_nfapi_number_of_dl_layers_supported = -1;
+-static int hf_nfapi_number_of_ul_layers_supported = -1;
+-static int hf_nfapi_maximum_3gpp_release_supported = -1;
+-static int hf_nfapi_nmm_modes_supported = -1;
+-
+-
+-static int hf_nfapi_pnf_rf = -1;
+-static int hf_nfapi_pnf_rf_nfapi_tl = -1;
+-static int hf_nfapi_number_of_rfs = -1;
+-static int hf_nfapi_rf_config_index = -1;
+-static int hf_nfapi_band = -1;
+-static int hf_nfapi_maximum_transmit_power = -1;
+-static int hf_nfapi_earfcn = -1;
+-static int hf_nfapi_minimum_transmit_power = -1;
+-static int hf_nfapi_number_of_antennas_suppported = -1;
+-static int hf_nfapi_minimum_downlink_frequency = -1;
+-static int hf_nfapi_maximum_downlink_frequency = -1;
+-static int hf_nfapi_minimum_uplink_frequency = -1;
+-static int hf_nfapi_maximum_uplink_frequency = -1;
+-
+-static int hf_nfapi_number_of_rf_bands = -1;
+-static int hf_nfapi_nmm_uplink_rssi_supported = -1;
+-
+-static int hf_nfapi_phy_rf_config_info = -1;
+-static int hf_nfapi_phy_rf_config_info_phy_id = -1;
+-static int hf_nfapi_phy_rf_config_info_band = -1;
+-
+-static int hf_nfapi_pnf_phy_rf_config = -1;
+-static int hf_nfapi_pnf_phy_rf_config_number_phy_rf_config_info = -1;
+-static int hf_nfapi_pnf_phy_rf_config_array_phy_rf_config_info = -1;
+-
+-static int hf_nfapi_pnf_phy_rel10 = -1;
+-static int hf_nfapi_transmission_mode7_supported = -1;
+-static int hi_nfapi_transmission_mode8_supported = -1;
+-static int hi_nfapi_two_antennas_ports_for_pucch = -1;
+-static int hi_nfapi_transmission_mode_9_supported = -1;
+-static int hi_nfapi_simultaneous_pucch_pusch = -1;
+-static int hi_nfapi_for_layer_tx_with_tm3_and_tm4 = -1;
+-
+-static int hf_nfapi_pnf_phy_rel11 = -1;
+-static int hf_nfapi_epdcch_supported = -1;
+-static int hi_nfapi_multi_ack_csi_reporting = -1;
+-static int hi_nfapi_pucch_tx_diversity_with_channel_selection = -1;
+-static int hi_nfapi_ul_comp_supported = -1;
+-static int hi_nfapi_transmission_mode_5_supported = -1;
+-
+-static int hf_nfapi_pnf_phy_rel12 = -1;
+-static int hf_nfapi_csi_subframe_set = -1;
+-static int hi_nfapi_enhanced_4tx_codebook = -1;
+-static int hi_nfapi_drs_supported = -1;
+-static int hi_nfapi_ul_64qam_supported = -1;
+-static int hi_nfapi_transmission_mode_10_supported = -1;
+-static int hi_nfapi_alternative_tbs_indices = -1;
+-
+-static int hf_nfapi_pnf_phy_rel13 = -1;
+-static int hf_nfapi_pucch_format_4_supported = -1;
+-static int hf_nfapi_pucch_format_5_supported = -1;
+-static int hf_nfapi_more_than_5_ca_supported = -1;
+-static int hf_nfapi_laa_supported = -1;
+-static int hf_nfapi_laa_ending_in_dwpts_supported = -1;
+-static int hf_nfapi_laa_starting_in_second_slot_supported = -1;
+-static int hf_nfapi_beamforming_supported = -1;
+-static int hf_nfapi_csi_rs_enhancements_supported = -1;
+-static int hf_nfapi_drms_enhancements_supported = -1;
+-static int hf_nfapi_srs_enhancements_supported = -1;
+-
+-
+-// P5 Message Structures
+-static int hf_nfapi_pnf_param_response_pnf_param_general = -1;
+-static int hf_nfapi_pnf_param_response_pnf_phy = -1;
+-static int hf_nfapi_pnf_param_response_pnf_rf = -1;
+-
+-static int hf_nfapi_pnf_param_request = -1;
+-static int hf_nfapi_pnf_param_response = -1;
+-static int hf_nfapi_pnf_config_request = -1;
+-static int hf_nfapi_pnf_config_response = -1;
+-static int hf_nfapi_pnf_start_request = -1;
+-static int hf_nfapi_pnf_start_response = -1;
+-static int hf_nfapi_pnf_stop_request = -1;
+-static int hf_nfapi_pnf_stop_response = -1;
+-static int hf_nfapi_param_response = -1;
+-static int hf_nfapi_start_request = -1;
+-static int hf_nfapi_start_response = -1;
+-static int hf_nfapi_stop_request = -1;
+-static int hf_nfapi_stop_response = -1;
+-
+-static int hf_nfapi_uint8_tag = -1;
+-static int hf_nfapi_uint16_tag = -1;
+-
+-static int hf_nfapi_error_code = -1;
+-static int hf_nfapi_p4_error_code = -1;
+-static int hf_nfapi_rat_type = -1;
+-static int hf_nfapi_num_tlv = -1;
+-static int hf_nfapi_phy_state = -1;
+-//	static int hf_nfapi_bandwidth_support = -1;
+-	
+-static int hf_nfapi_modulation_support = -1;
+-static int hf_nfapi_phy_antenna_capability = -1;
+-static int hf_nfapi_release_capability = -1;
+-static int hf_nfapi_mbsfn_capability = -1;
+-
+-static int hf_nfapi_laa_capability = -1;
+-static int hf_nfapi_pd_sensing_lbt_support = -1;
+-static int hf_nfapi_multi_carrier_lbt_support = -1;
+-static int hf_nfapi_partial_sf_support = -1;
+-	
+-/* nfapi nfapi */
+-static int hf_nfapi_pnf_address = -1;
+-static int hf_nfapi_pnf_address_ipv4 = -1;
+-static int hf_nfapi_pnf_address_ipv6 = -1;
+-
+-static int hf_nfapi_vnf_address = -1;
+-static int hf_nfapi_vnf_address_ipv4 = -1;
+-static int hf_nfapi_vnf_address_ipv6 = -1;
+-	
+-static int hf_nfapi_pnf_port = -1;
+-static int hf_nfapi_vnf_port = -1;
+-static int hf_nfapi_dl_ue_per_sf = -1;
+-static int hf_nfapi_ul_ue_per_sf = -1;
+-
+-static int hf_nfapi_rf_bands = -1;
+-static int hf_nfapi_rf_bands_nfapi_tl = -1;
+-static int hf_nfapi_rf_bands_count = -1;
+-static int hf_nfapi_rf_bands_value = -1;
+-
+-static int hf_nfapi_timing_window = -1;
+-static int hf_nfapi_timing_info_mode = -1;
+-static int hf_nfapi_timing_info_period = -1;
+-static int hf_nfapi_max_transmit_power = -1;
+-	
+-/* subframe config */
+-static int hf_nfapi_duplex_mode = -1;
+-static int hf_nfapi_pcfich_power_offset = -1;
+-static int hf_nfapi_pb = -1;
+-static int hf_nfapi_dl_cyclic_prefix_type = -1;
+-static int hf_nfapi_ul_cyclic_prefix_type = -1;
+-
+-static int hf_nfapi_tx_antenna_ports = -1;
+-static int hf_nfapi_rx_antenna_ports = -1;
+-
+-
+-
+-/* RF Config */
+-static int hf_nfapi_downlink_channel_bandwidth = -1;
+-static int hf_nfapi_uplink_channel_bandwidth = -1;
+-static int hf_nfapi_reference_signal_power = -1;
+-
+-/* PHICH config*/
+-static int hf_nfapi_phich_resource = -1;
+-static int hf_nfapi_phich_duration = -1;
+-static int hf_nfapi_phich_power_offset = -1;
+-
+-static int hf_nfapi_value_float = -1;
+-
+-/* SCH Config */
+-static int hf_nfapi_primary_synchronization_signal_epre_eprers = -1;
+-static int hf_nfapi_secondary_synchronization_signal_epre_eprers = -1;
+-static int hf_nfapi_physical_cell_id = -1;
+-
+-/* PRACH config */
+-static int hf_nfapi_configuration_index = -1;
+-static int hf_nfapi_root_sequence_index = -1;
+-static int hf_nfapi_zero_correlation_zone_configuration = -1;
+-static int hf_nfapi_high_speed_flag = -1;
+-static int hf_nfapi_frequency_offset = -1;
+-
+-/* PUSCH config */
+-static int hf_nfapi_hopping_mode = -1;
+-static int hf_nfapi_hopping_offset = -1;
+-
+-/* PUCCH config */
+-static int hf_nfapi_delta_pucch_shift = -1;
+-static int hf_nfapi_n_cqi_rb = -1;
+-static int hf_nfapi_n_an_cs = -1;
+-static int hf_nfapi_n1_pucch_an = -1;
+-
+-/* SRS config */
+-static int hf_nfapi_bandwidth_configuration = -1;
+-static int hf_nfapi_max_up_pts = -1;
+-static int hf_nfapi_srs_subframe_configuration = -1;
+-static int hf_nfapi_srs_acknack_srs_simultaneous_transmission = -1;
+-
+-/* uplink reference signal config */
+-static int hf_nfapi_uplink_rs_hopping = -1;
+-static int hf_nfapi_group_assignment = -1;
+-static int hf_nfapi_cyclic_shift_1_for_drms = -1;
+-
+-/* tdd frame structure */
+-static int hf_nfapi_subframe_assignment = -1;
+-static int hf_nfapi_special_subframe_patterns = -1;
+-
+-/* laa config */
+-static int hf_nfapi_ed_threshold_for_lbt_for_pdsch = -1;
+-static int hf_nfapi_ed_threshold_for_lbt_for_drs = -1;
+-static int hf_nfapi_pd_threshold = -1;
+-static int hf_nfapi_multi_carrier_type = -1;
+-static int hf_nfapi_multi_carrier_tx = -1;
+-static int hf_nfapi_multi_carrier_freeze = -1;
+-static int hf_nfapi_tx_antenna_ports_for_drs = -1;
+-static int hf_nfapi_transmission_power_for_drs = -1;
+-
+-/* eMTC config */
+-static int hf_nfapi_pbch_repetitions_enabled_r13 = -1;
+-static int hf_nfapi_prach_cat_m_root_sequence_index = -1;
+-static int hf_nfapi_prach_cat_m_zero_correlation_zone_configuration = -1;
+-static int hf_nfapi_prach_cat_m_high_speed_flag = -1;
+-
+-static int hf_nfapi_prach_ce_level_0_enable = -1;
+-static int hf_nfapi_prach_ce_level_0_configuration_index = -1;
+-static int hf_nfapi_prach_ce_level_0_frequency_offset = -1;
+-static int hf_nfapi_prach_ce_level_0_number_of_repetitions_per_attempt = -1;
+-static int hf_nfapi_prach_ce_level_0_starting_subframe_periodicity = -1;
+-static int hf_nfapi_prach_ce_level_0_hopping_enabled = -1;
+-static int hf_nfapi_prach_ce_level_0_hopping_offset = -1;
+-
+-static int hf_nfapi_prach_ce_level_1_enable = -1;
+-static int hf_nfapi_prach_ce_level_1_configuration_index = -1;
+-static int hf_nfapi_prach_ce_level_1_frequency_offset = -1;
+-static int hf_nfapi_prach_ce_level_1_number_of_repetitions_per_attempt = -1;
+-static int hf_nfapi_prach_ce_level_1_starting_subframe_periodicity = -1;
+-static int hf_nfapi_prach_ce_level_1_hopping_enabled = -1;
+-static int hf_nfapi_prach_ce_level_1_hopping_offset = -1;
+-
+-static int hf_nfapi_prach_ce_level_2_enable = -1;
+-static int hf_nfapi_prach_ce_level_2_configuration_index = -1;
+-static int hf_nfapi_prach_ce_level_2_frequency_offset = -1;
+-static int hf_nfapi_prach_ce_level_2_number_of_repetitions_per_attempt = -1;
+-static int hf_nfapi_prach_ce_level_2_starting_subframe_periodicity = -1;
+-static int hf_nfapi_prach_ce_level_2_hopping_enabled = -1;
+-static int hf_nfapi_prach_ce_level_2_hopping_offset = -1;
+-
+-static int hf_nfapi_prach_ce_level_3_enable = -1;
+-static int hf_nfapi_prach_ce_level_3_configuration_index = -1;
+-static int hf_nfapi_prach_ce_level_3_frequency_offset = -1;
+-static int hf_nfapi_prach_ce_level_3_number_of_repetitions_per_attempt = -1;
+-static int hf_nfapi_prach_ce_level_3_starting_subframe_periodicity = -1;
+-static int hf_nfapi_prach_ce_level_3_hopping_enabled = -1;
+-static int hf_nfapi_prach_ce_level_3_hopping_offset = -1;
+-static int hf_nfapi_pucch_internal_ul_hopping_config_common_mode_b = -1;
+-static int hf_nfapi_pucch_internal_ul_hopping_config_common_mode_a = -1;
+-
+-static int hf_nfapi_dl_modulation_support = -1;
+-static int hf_nfapi_ul_modulation_support = -1;
+-
+-/* 123 config */
+-static int hf_nfapi_data_report_mode = -1;
+-static int hf_nfapi_sfnsf = -1;
+-
+-// P7 Sub Structures
+-static int hf_nfapi_dl_config_dci_dl_pdu_rel8 = -1;
+-static int hf_nfapi_dci_format = -1;
+-static int hf_nfapi_cce_idx = -1;
+-static int hf_nfapi_aggregation_level = -1;
+-static int hf_nfapi_mcs_1 = -1;
+-static int hf_nfapi_redundancy_version_1 = -1;
+-static int hf_nfapi_new_data_indicator_1 = -1;
+-static int hf_nfapi_mcs_2 = -1;
+-static int hf_nfapi_redundancy_version_2 = -1;
+-static int hf_nfapi_new_data_indicator_2 = -1;
+-static int hf_nfapi_harq_process = -1;
+-static int hf_nfapi_tpmi = -1;
+-static int hf_nfapi_pmi = -1;
+-static int hf_nfapi_precoding_information = -1;
+-static int hf_nfapi_tpc = -1;
+-static int hf_nfapi_downlink_assignment_index = -1;
+-static int hf_nfapi_transport_block_size_index = -1;
+-static int hf_nfapi_downlink_power_offset = -1;
+-static int hf_nfapi_allocate_prach_flag = -1;
+-static int hf_nfapi_preamble_index = -1;
+-static int hf_nfapi_prach_mask_index = -1;
+-static int hf_nfapi_rnti_type = -1;
+-
+-static int hf_nfapi_dl_config_dci_dl_pdu_rel9 = -1;
+-static int hf_nfapi_mcch_flag = -1;
+-static int hf_nfapi_mcch_change_notification = -1;
+-static int hf_nfapi_scrambling_identity = -1;
+-
+-static int hf_nfapi_dl_config_dci_dl_pdu_rel10 = -1;
+-static int hf_nfapi_cross_carrier_scheduling_flag = -1;
+-static int hf_nfapi_carrier_indicator = -1;
+-static int hf_nfapi_srs_flag = -1;
+-static int hf_nfapi_srs_request = -1;
+-static int hf_nfapi_antenna_ports_scrambling_and_layers = -1;
+-static int hf_nfapi_total_dci_length_including_padding = -1;
+-static int hf_nfapi_n_dl_rb = -1;
+-
+-static int hf_nfapi_dl_config_dci_dl_pdu_rel11 = -1;
+-static int hf_nfapi_harq_ack_resource_offset = -1;
+-static int hf_nfapi_pdsch_re_mapping_and_quasi_co_location_indicator = -1;
+-static int hf_nfapi_dl_config_dci_dl_pdu_rel12 = -1;
+-static int hf_nfapi_primary_cell_type = -1;
+-static int hf_nfapi_ul_dl_configuration_flag = -1;
+-static int hf_nfapi_number_of_ul_dl_configurations = -1;
+-static int hf_nfapi_ul_dl_configuration_index = -1;
+-static int hf_nfapi_dl_config_dci_dl_pdu_rel13 = -1;
+-static int hf_nfapi_laa_end_partial_sf_flag = -1;
+-static int hf_nfapi_laa_end_partial_sf_configuration = -1;
+-static int hf_nfapi_initial_lbt_sf = -1;
+-static int hf_nfapi_codebooksize_determination_r13 = -1;
+-static int hf_nfapi_rel13_drms_table_flag = -1;
+-
+-
+-static int hf_nfapi_dl_config_dci_dl_pdu = -1;
+-static int hf_nfapi_dl_config_dci_dl_pdu_nfapi_dl_config_dci_dl_pdu_rel8 = -1;
+-static int hf_nfapi_dl_config_dci_dl_pdu_nfapi_dl_config_dci_dl_pdu_rel9 = -1;
+-static int hf_nfapi_dl_config_dci_dl_pdu_nfapi_dl_config_dci_dl_pdu_rel10 = -1;
+-
+-static int hf_nfapi_bf_vector_antennas = -1;
+-static int hf_nfapi_subbands = -1;
+-static int hf_nfapi_bf_vectors = -1;
+-static int hf_nfapi_csi_rs_resource_config = -1;
+-static int hf_nfapi_csi_rs_number_if_nzp_configurations = -1;
+-static int hf_nfapi_csi_rs_resource_configs = -1;
+-static int hf_nfapi_pdsch_start = -1;
+-static int hf_nfapi_drms_config_flag = -1;
+-static int hf_nfapi_drms_scrambling = -1;
+-static int hf_nfapi_csi_config_flag = -1;
+-static int hf_nfapi_csi_scrambling = -1;
+-static int hf_nfapi_pdsch_re_mapping_flag = -1;
+-static int hf_nfapi_pdsch_re_mapping_antenna_ports = -1;
+-static int hf_nfapi_pdsch_re_mapping_freq_shift = -1;
+-static int hf_nfapi_alt_cqi_table_r12 = -1;
+-static int hf_nfapi_max_layers = -1;
+-static int hf_nfapi_n_dl_harq = -1;
+-static int hf_nfapi_dwpts_symbols = -1;
+-static int hf_nfapi_ue_type = -1;
+-static int hf_nfapi_pdsch_payload_type = -1;
+-static int hf_nfapi_initial_transmission_sf = -1;
+-static int hf_nfapi_req13_drms_table_flag = -1;
+-static int hf_nfapi_prnti = -1;
+-static int hf_nfapi_mcs = -1;
+-static int hf_nfapi_number_of_transport_blocks = -1;
+-static int hf_nfapi_ue_mode = -1;
+-static int hf_prs_bandwidth = -1;
+-static int hf_prs_cyclic_prefix_type = -1;
+-static int hf_prs_muting = -1;
+-static int hf_nfapi_csi_rs_number_of_nzp_configuration = -1;
+-static int hf_nfapi_csi_rs_resource_index = -1;
+-static int hf_nfapi_csi_rs_class = -1;
+-static int hf_nfapi_cdm_type = -1;
+-static int hf_nfapi_csi_rs_bf_vector = -1;
+-static int hf_nfapi_edpcch_prb_index = -1;
+-static int hf_nfapi_epdcch_resource_assignment_flag = -1;
+-static int hf_nfapi_epdcch_id = -1;
+-static int hf_nfapi_epdcch_start_symbol = -1;
+-static int hf_nfapi_epdcch_num_prb = -1;
+-static int hf_nfapi_epdcch_prbs = -1;
+-static int hf_nfapi_precoding_value = -1;
+-static int hf_nfapi_mpdcch_narrowband = -1;
+-static int hf_nfapi_number_of_prb_pairs = -1;
+-static int hf_nfapi_resource_block_assignment = -1;
+-static int hf_nfapi_start_symbol = -1;
+-static int hf_nfapi_ecce_index = -1;
+-static int hf_nfapi_ce_mode = -1;
+-static int hf_nfapi_drms_scrabmling_init = -1;
+-static int hf_nfapi_pdsch_reception_levels = -1;
+-static int hf_nfapi_new_data_indicator = -1;
+-static int hf_nfapi_tpmi_length = -1;
+-static int hf_nfapi_pmi_flag = -1;
+-static int hf_nfapi_harq_resource_offset = -1;
+-static int hf_nfapi_dci_subframe_repetition_number = -1;
+-static int hf_nfapi_downlink_assignment_index_length = -1;
+-static int hf_nfapi_starting_ce_level = -1;
+-static int hf_nfapi_antenna_ports_and_scrambling_identity_flag = -1;
+-static int hf_nfapi_antenna_ports_and_scrambling_identity = -1;
+-static int hf_nfapi_paging_direct_indication_differentiation_flag = -1;
+-static int hf_nfapi_direct_indication = -1;
+-static int hf_nfapi_number_of_tx_antenna_ports = -1;
+-static int hf_nfapi_precoding = -1;
+-
+-
+-
+-// P7 Message Structures
+-static int hf_nfapi_dl_node_sync = -1;
+-static int hf_nfapi_dl_node_sync_nfapi_p7_message_header = -1;
+-static int hf_nfapi_dl_node_sync_t1 = -1;
+-static int hf_nfapi_dl_node_sync_delta_sfn_sf = -1;
+-
+-static int hf_nfapi_ul_node_sync = -1;
+-static int hf_nfapi_ul_node_sync_nfapi_p7_message_header = -1;
+-static int hf_nfapi_ul_node_sync_t1 = -1;
+-static int hf_nfapi_ul_node_sync_t2 = -1;
+-static int hf_nfapi_ul_node_sync_t3 = -1;
+-
+-static int hf_nfapi_timing_info = -1;
+-static int hf_nfapi_timing_info_nfapi_p7_message_header = -1;
+-static int hf_nfapi_timing_info_last_sfn_sf = -1;
+-static int hf_nfapi_timing_info_time_since_last_timing_info = -1;
+-static int hf_nfapi_timing_info_dl_config_jitter = -1;
+-static int hf_nfapi_timing_info_tx_request_jitter = -1;
+-static int hf_nfapi_timing_info_ul_config_jitter = -1;
+-static int hf_nfapi_timing_info_hi_dci0_jitter = -1;
+-static int hf_nfapi_timing_info_dl_config_latest_delay = -1;
+-static int hf_nfapi_timing_info_tx_request_latest_delay = -1;
+-static int hf_nfapi_timing_info_ul_config_latest_delay = -1;
+-static int hf_nfapi_timing_info_hi_dci0_latest_delay = -1;
+-static int hf_nfapi_timing_info_dl_config_earliest_arrival = -1;
+-static int hf_nfapi_timing_info_tx_request_earliest_arrival = -1;
+-static int hf_nfapi_timing_info_ul_config_earliest_arrival = -1;
+-static int hf_nfapi_timing_info_hi_dci0_earliest_arrival = -1;
+-
+-static int hf_nfapi_dl_config_request = -1;
+-static int hf_nfapi_sfn_sf = -1;
+-
+-static int hf_nfapi_dl_config_request_body = -1;
+-static int hf_nfapi_number_pdcch_ofdm_symbols = -1;
+-static int hf_nfapi_number_dci = -1;
+-static int hf_nfapi_number_pdus = -1;
+-static int hf_nfapi_number_pdsch_rnti = -1;
+-static int hf_nfapi_transmission_power_pcfich = -1;
+-
+-static int hf_nfapi_number_of_harqs = -1;
+-static int hf_nfapi_number_of_crcs = -1;
+-static int hf_nfapi_number_of_srs = -1;
+-static int hf_nfapi_number_of_cqi = -1;
+-static int hf_nfapi_number_of_preambles = -1;
+-static int hf_nfapi_number_of_srss = -1;
+-static int hf_nfapi_lbt_dl_req_pdu_type = -1;
+-static int hf_nfapi_lbt_dl_ind_pdu_type = -1;
+-
+-static int hf_nfapi_dl_config_request_pdu_list = -1;
+-static int hf_nfapi_ul_config_request_pdu_list = -1;
+-static int hf_nfapi_hi_dci0_request_pdu_list = -1;
+-static int hf_nfapi_tx_request_pdu_list = -1;
+-static int hf_nfapi_rx_indication_pdu_list = -1;
+-static int hf_nfapi_harq_indication_pdu_list = -1;
+-static int hf_nfapi_crc_indication_pdu_list = -1;
+-static int hf_nfapi_sr_indication_pdu_list = -1;
+-static int hf_nfapi_cqi_indication_pdu_list = -1;
+-static int hf_nfapi_preamble_indication_pdu_list = -1;
+-static int hf_nfapi_srs_indication_pdu_list = -1;
+-static int hf_nfapi_lbt_dl_config_pdu_list = -1;
+-static int hf_nfapi_lbt_dl_indication_pdu_list = -1;
+-
+-
+-static int hf_nfapi_dl_config_pdu_type = -1;
+-static int hf_nfapi_pdu_size = -1;
+-static int hf_nfapi_instance_length = -1;
+-
+-static int hf_nfapi_dl_config_dlsch_pdu_rel8 = -1;
+-static int hf_nfapi_length;
+-static int hf_nfapi_pdu_index = -1;
+-static int hf_nfapi_rnti = -1;
+-static int hf_nfapi_resource_allocation_type = -1;
+-static int hf_nfapi_virtual_resource_block_assignment_flag = -1;
+-static int hf_nfapi_resource_block_coding = -1;
+-static int hf_nfapi_modulation = -1;
+-static int hf_nfapi_redundancy_version = -1;
+-static int hf_nfapi_transport_blocks = -1;
+-static int hf_nfapi_transport_block_to_codeword_swap_flag = -1;
+-static int hf_nfapi_transmission_scheme = -1;
+-static int hf_nfapi_ul_transmission_scheme = -1;
+-static int hf_nfapi_number_of_layers = -1;
+-static int hf_nfapi_number_of_subbands = -1;
+-static int hf_nfapi_codebook_index = -1;
+-static int hf_nfapi_ue_category_capacity = -1;
+-static int hf_nfapi_pa = -1;
+-static int hf_nfapi_delta_power_offset_index = -1;
+-static int hf_nfapi_ngap = -1;
+-static int hf_nfapi_nprb = -1;
+-static int hf_nfapi_transmission_mode = -1;
+-static int hf_nfapi_num_bf_prb_per_subband = -1;
+-
+-static int hf_nfapi_num_bf_vector = -1;
+-static int hf_nfapi_bf_vector_subband_index = -1;
+-static int hf_nfapi_bf_vector_num_antennas = -1;
+-static int hf_nfapi_bf_vector_bf_value = -1;
+-
+-static int hf_nfapi_dl_config_dlsch_pdu_rel9 = -1;
+-static int hf_nfapi_nscid = -1;
+-
+-static int hf_nfapi_dl_config_dlsch_pdu_rel10 = -1;
+-static int hf_nfapi_csi_rs_flag = -1;
+-static int hf_nfapi_csi_rs_resource_config_r10 = -1;
+-static int hf_nfapi_csi_rs_zero_tx_power_resource_config_bitmap_r10 = -1;
+-
+-static int hf_nfapi_dl_config_bch_pdu_rel8 = -1;
+-static int hf_nfapi_transmission_power = -1;
+-
+-static int hf_nfapi_dl_config_mch_pdu_rel8 = -1;
+-static int hf_nfapi_mbsfn_area_id = -1;
+-
+-static int hf_nfapi_dl_config_pch_pdu_rel8 = -1;
+-
+-static int hf_nfapi_dl_config_prs_pdu_rel9 = -1;
+-static int hf_nfapi_prs_bandwidth = -1;
+-static int hf_nfapi_prs_cyclic_prefix_type = -1;
+-		
+-static int hf_nfapi_dl_config_csi_rs_pdu_rel10 = -1;
+-static int hf_nfapi_csi_rs_antenna_port_count_r10 = -1;
+-
+-static int hf_nfapi_ul_config_request = -1;
+-static int hf_nfapi_ul_config_request_body = -1;
+-static int hf_nfapi_ul_config_pdu_type = -1;
+-
+-static int hf_nfapi_rach_prach_frequency_resources = -1;
+-static int hf_nfapi_srs_present = -1;
+-static int hf_nfapi_ul_config_harq_buffer_pdu = -1;
+-
+-static int hf_nfapi_ul_config_ue_information_rel8 = -1;
+-static int hf_nfapi_handle = -1;
+-static int hf_nfapi_ul_config_sr_information_pdu_rel8 = -1;
+-static int hf_nfapi_pucch_index = -1;
+-static int hf_nfapi_size = -1;
+-static int hf_nfapi_resource_block_start = -1;
+-static int hf_nfapi_number_of_resource_blocks = -1;
+-static int hf_nfapi_cyclic_shift_2_for_drms = -1;
+-static int hf_nfapi_frequency_hopping_enabled_flag = -1;
+-static int hf_nfapi_frequency_hopping_bits = -1;
+-static int hf_nfapi_new_data_indication = -1;
+-static int hf_nfapi_harq_process_number = -1;
+-static int hf_nfapi_ul_tx_mode = -1;
+-static int hf_nfapi_current_tx_nb = -1;
+-static int hf_nfapi_n_srs = -1;
+-static int hf_nfapi_disable_sequence_hopping_flag = -1;
+-static int hf_nfapi_dl_cqi_pmi_size_rank_1 = -1;
+-static int hf_nfapi_dl_cqi_pmi_size_rank_greater_1 = -1;
+-static int hf_nfapi_ri_size = -1;
+-static int hf_nfapi_delta_offset_cqi = -1;
+-static int hf_nfapi_delta_offset_ri = -1;
+-static int hf_nfapi_harq_size = -1;
+-static int hf_nfapi_delta_offset_harq = -1;
+-static int hf_nfapi_ack_nack_mode = -1;
+-static int hf_nfapi_n_srs_initial = -1;
+-static int hf_nfapi_initial_number_of_resource_blocks = -1;
+-static int hf_nfapi_dl_cqi_pmi_size = -1;
+-static int hf_nfapi_report_type = -1;
+-static int hf_nfapi_dl_cqi_ri_pmi_size = -1;
+-static int hf_nfapi_control_type = -1;
+-static int hf_nfapi_number_of_cc = -1;
+-static int hf_nfapi_virtual_cell_id_enabled_flag = -1;
+-static int hf_nfapi_npusch_identity = -1;
+-static int hf_nfapi_ndrms_csh_identity = -1;
+-static int hf_nfapi_total_number_of_repetitions = -1;
+-static int hf_nfapi_repetition_number = -1;
+-static int hf_nfapi_initial_sf_io = -1;
+-static int hf_nfapi_empty_symbols_due_to_retunning = -1;
+-static int hf_nfapi_dl_cqi_ri_pmi_size_2 = -1;
+-static int hf_nfapi_npucch_identity = -1;
+-static int hf_nfapi_harq_size_2 = -1;
+-static int hf_nfapi_delta_offset_harq_2 = -1;
+-static int hf_nfapi_empty_symbols = -1;
+-static int hf_nfapi_total_number_of_repetitons = -1;
+-static int hf_nfapi_csi_mode = -1;
+-static int hf_nfapi_dl_cqi_pmi_size_2 = -1;
+-static int hf_nfapi_statring_prb = -1;
+-static int hf_nfapi_cdm_index = -1;
+-static int hf_nfapi_nsrs = -1;
+-static int hf_nfapi_num_ant_ports = -1;
+-static int hf_nfapi_n_pucch_2_0 = -1;
+-static int hf_nfapi_n_pucch_2_1 = -1;
+-static int hf_nfapi_n_pucch_2_2 = -1;
+-static int hf_nfapi_n_pucch_2_3 = -1;
+-static int hf_nfapi_starting_prb = -1;
+-static int hf_nfapi_antenna_port = -1;
+-static int hf_nfapi_number_of_combs = -1;
+-
+-
+-
+-static int hf_nfapi_number_of_pucch_resource = -1;
+-static int hf_nfapi_pucch_index_p1 = -1;
+-static int hf_nfapi_n_pucch_1_0 = -1;
+-static int hf_nfapi_n_pucch_1_1 = -1;
+-static int hf_nfapi_n_pucch_1_2 = -1;
+-static int hf_nfapi_n_pucch_1_3 = -1;
+-static int hf_nfapi_srs_bandwidth = -1;
+-static int hf_nfapi_frequency_domain_position = -1;
+-static int hf_nfapi_srs_hopping_bandwidth = -1;
+-static int hf_nfapi_transmission_comb = -1;
+-static int hf_nfapi_i_srs = -1;
+-static int hf_nfapi_sounding_reference_cyclic_shift = -1;
+-static int hf_nfapi_antenna_ports = -1;
+-static int hf_nfapi_ul_config_srs_pdu_rel10 = -1;
+-static int hf_nfapi_ul_config_srs_pdu_rel8 = -1;
+-static int hf_nfapi_ul_config_harq_information_rel9_fdd = -1;
+-static int hf_nfapi_ul_config_harq_information_rel8_fdd = -1;
+-static int hf_nfapi_ul_config_harq_information_rel10_tdd = -1;
+-static int hf_nfapi_ul_config_sr_information_rel10 = -1;
+-static int hf_nfapi_ul_config_sr_information_rel8 = -1;
+-static int hf_nfapi_ul_config_cqi_information_rel10 = -1;
+-static int hf_nfapi_ul_config_cqi_information_rel8 = -1;
+-static int hf_nfapi_ul_config_initial_transmission_parameters_rel8 = -1;
+-static int hf_nfapi_ul_config_ulsch_harq_information_rel10 = -1;
+-
+-/* Tx request */
+-static int hf_nfapi_pdu_length = -1;
+-static int hf_nfapi_num_segments = -1;
+-static int hf_nfapi_segment_length = -1;
+-static int hf_nfapi_segment_data = -1;
+-
+-/* CRC Indication */
+-static int hf_nfapi_crc_indication_body = -1;
+-static int hf_nfapi_crc_flag = -1;
+-
+-static int hf_nfapi_number_of_hi_pdus = -1;
+-static int hf_nfapi_number_of_dci_pdus = -1;
+-static int hf_nfapi_pdu_type = -1;
+-static int hf_nfapi_hi_value = -1;
+-static int hf_nfapi_i_phich = -1;
+-static int hf_nfapi_flag_tb2 = -1;
+-static int hf_nfapi_hi_value_2 = -1;
+-static int hf_nfapi_ue_tx_antenna_selection = -1;
+-static int hf_nfapi_cqi_csi_request = -1;
+-static int hf_nfapi_ul_index = -1;
+-static int hf_nfapi_dl_assignment_index = -1;
+-static int hf_nfapi_tpc_bitmap = -1;
+-static int hf_nfapi_new_data_indication_two = -1;
+-static int hf_nfapi_size_of_cqi_csi_feild = -1;
+-static int hf_nfapi_resource_allocation_flag = -1;
+-static int hf_nfapi_number_of_antenna_ports =-1 ;
+-
+-static int hf_nfapi_n_ul_rb = -1;
+-static int hf_nfapi_pscch_resource = -1;
+-static int hf_nfapi_time_resource_pattern = -1;
+-static int hf_nfapi_mpdcch_transmission_type = -1;
+-static int hf_nfapi_drms_scrambling_init = -1;
+-static int hf_nfapi_pusch_repetition_levels = -1;
+-static int hf_nfapi_frequency_hopping_flag = -1;
+-static int hf_nfapi_csi_request = -1;
+-static int hf_nfapi_dai_presence_flag = -1;
+-static int hf_nfapi_total_dci_length_include_padding = -1;
+-static int hf_nfapi_data_offset = -1;
+-static int hf_nfapi_ul_cqi = -1;
+-static int hf_nfapi_timing_advance_r9 = -1;
+-static int hf_nfapi_timing_advance = -1;
+-static int hf_nfapi_harq_data_value_0 = -1;
+-static int hf_nfapi_harq_data_value_1 = -1;
+-static int hf_nfapi_harq_data_value_2 = -1;
+-static int hf_nfapi_harq_data_value_3 = -1;
+-static int hf_nfapi_harq_mode = -1;
+-static int hf_nfapi_number_of_ack_nack = -1;
+-static int hf_nfapi_harq_ack_nack_data = -1;
+-static int hf_nfapi_harq_tb_1 = -1;
+-static int hf_nfapi_harq_tb_2 = -1;
+-static int hf_nfapi_harq_tb_n = -1;
+-static int hf_nfapi_harq_data = -1;
+-static int hf_nfapi_channel = -1;
+-static int hf_nfapi_ri = -1;
+-static int hf_nfapi_number_of_cc_reported = -1;
+-static int hf_nfapi_cc = -1;
+-static int hf_nfapi_preamble = -1;
+-static int hf_nfapi_rach_resource_type = -1;
+-static int hf_nfapi_snr = -1;
+-static int hf_nfapi_doppler_estimation = -1;
+-static int hf_nfapi_rb_start = -1;
+-static int hf_nfapi_rbs = -1;
+-static int hf_nfapi_up_pts_symbol = -1;
+-static int hf_nfapi_number_prb_per_subband = -1;
+-static int hf_nfapi_number_antennas = -1;
+-static int hf_nfapi_subband_index = -1;
+-static int hf_nfapi_antennas = -1;
+-static int hf_nfapi_channel_coefficient = -1;
+-static int hf_nfapi_ul_rtoa = -1;
+-static int hf_nfapi_mp_cca = -1;
+-static int hf_nfapi_n_cca = -1;
+-static int hf_nfapi_offset = -1;
+-static int hf_nfapi_lte_txop_sf = -1;
+-static int hf_nfapi_txop_sfn_sf_end = -1;
+-static int hf_nfapi_lbt_mode = -1;
+-static int hf_nfapi_sfn_sf_end = -1;
+-static int hf_nfapi_result = -1;
+-static int hf_nfapi_txop_symbols = -1;
+-static int hf_nfapi_initial_partial_sf = -1;
+-
+-
+-static int hf_nfapi_frequency_band_indicator = -1;
+-static int hf_nfapi_measurement_period = -1;
+-static int hf_nfapi_bandwidth = -1;
+-static int hf_nfapi_timeout = -1;
+-static int hf_nfapi_number_of_earfcns = -1;
+-static int hf_nfapi_earfcn_list = -1;
+-static int hf_nfapi_uarfcn = -1;
+-static int hf_nfapi_number_of_uarfcns = -1;
+-static int hf_nfapi_uarfcn_list = -1;
+-static int hf_nfapi_arfcn = -1;
+-static int hf_nfapi_arfcn_direction = -1;
+-static int hf_nfapi_number_of_arfcns = -1;
+-static int hf_nfapi_arfcn_list = -1;
+-static int hf_nfapi_rssi = -1;
+-static int hf_nfapi_number_of_rssi = -1;
+-static int hf_nfapi_rssi_list = -1;
+-static int hf_nfapi_pci = -1;
+-static int hf_nfapi_measurement_bandwidth = -1;
+-static int hf_nfapi_exhaustive_search = -1;
+-static int hf_nfapi_number_of_pci = -1;
+-static int hf_nfapi_pci_list = -1;
+-static int hf_nfapi_psc = -1;
+-static int hf_nfapi_number_of_psc = -1;
+-static int hf_nfapi_psc_list = -1;
+-static int hf_nfapi_rsrp = -1;
+-static int hf_nfapi_rsrq = -1;
+-static int hf_nfapi_number_of_lte_cells_found = -1;
+-static int hf_nfapi_lte_cells_found_list = -1;
+-static int hf_nfapi_rscp = -1;
+-static int hf_nfapi_enco = -1;
+-static int hf_nfapi_number_of_utran_cells_found = -1;
+-static int hf_nfapi_utran_cells_found_list = -1;
+-static int hf_nfapi_bsic = -1;
+-static int hf_nfapi_rxlev = -1;
+-static int hf_nfapi_rxqual = -1;
+-static int hf_nfapi_sfn_offset = -1;
+-static int hf_nfapi_number_of_geran_cells_found = -1;
+-static int hf_nfapi_geran_cells_found_list = -1;
+-static int hf_nfapi_number_of_tx_antenna = -1;
+-static int hf_nfapi_mib_length = -1;
+-static int hf_nfapi_mib = -1;
+-static int hf_nfapi_phich_configuration = -1;
+-static int hf_nfapi_retry_count = -1;
+-static int hf_nfapi_sib1 = -1;
+-static int hf_nfapi_si_periodicity = -1;
+-static int hf_nfapi_si_index = -1;
+-static int hf_nfapi_number_of_si_periodicity = -1;
+-static int hf_nfapi_si_periodicity_list = -1;
+-static int hf_nfapi_si_window_length = -1;
+-static int hf_nfapi_sib_type = -1;
+-static int hf_nfapi_sib_len = -1;
+-static int hf_nfapi_sib = -1;
+-static int hf_nfapi_si_len = -1;
+-static int hf_nfapi_si = -1;
+-
+-static int hf_nfapi_pnf_search_state = -1;
+-static int hf_nfapi_pnf_broadcast_state = -1;
+-
+-static const value_string message_id_vals[]	= {	{ 0x80, "DL_CONFIG.request"},
+-												{ 0x81, "UL_CONFIG.request"},
+-												{ 0x82, "SUBFRAME_INDICATION"},
+-												{ 0x83, "HI_DCI0.request"},
+-												{ 0x84, "TX.request"},
+-												{ 0x85, "HARQ.indication"},
+-												{ 0x86, "CRC.indication"},
+-												{ 0x87, "RX_ULSCH.indication"},
+-												{ 0x88, "RACH.indication" },
+-												{ 0x89, "SRS.indication" },
+-												{ 0x8A, "RX_SR.indication" },
+-												{ 0x8B, "RX_CQI.indication" },
+-												{ 0x8C,	"LBT_DL_CONFIG.request" } ,
+-												{ 0x8D,	"LBT_DL.indication" } , 
+-
+-												{ 0x0100, "PNF_PARAM.request" },
+-												{ 0x0101, "PNF_PARAM.response" },
+-												{ 0x0102, "PNF_CONFIG.request" },
+-												{ 0x0103, "PNF_CONFIG.response" },
+-												{ 0x0104, "PNF_START.request" },
+-												{ 0x0105, "PNF_START.response" },
+-												{ 0x0106, "PNF_STOP.request" },
+-												{ 0x0107, "PNF_STOP.response" },
+-												{ 0x0108, "PARAM.request" },
+-												{ 0x0109, "PARAM.response" },
+-												{ 0x010A, "CONFIG.request" },
+-												{ 0x010B, "CONFIG.response" },
+-												{ 0x010C, "START.request" },
+-												{ 0x010D, "START.response" },
+-												{ 0x010E, "STOP.request" },
+-												{ 0x010F, "STOP.response" },
+-												{ 0x0110, "MEASUREMENT.request" },
+-												{ 0x0111, "MEASUREMENT.response" },
+-
+-												{ 0x0180, "UL_NODE_SYNC" },
+-												{ 0x0181, "DL_NODE_SYNC" },
+-												{ 0x0182, "TIMING_INFO" },
+-
+-												{ 0x0200, "RSSI.request" },
+-												{ 0x0201, "RSSI.response" },
+-												{ 0x0202, "RSSI.indication" },
+-												{ 0x0203, "CELL_SEARCH.request" },
+-												{ 0x0204, "CELL_SEARCH.response" },
+-												{ 0x0205, "CELL_SEARCH.indication" },
+-												{ 0x0206, "BROADCAST_DETECT.request" },
+-												{ 0x0207, "BROADCAST_DETECT.response" },
+-												{ 0x0208, "BROADCAST_DETECT.indication" },
+-												{ 0x0209, "SYSTEM_INFORMATION_SCHEDULE.request" },
+-												{ 0x020A, "SYSTEM_INFORMATION_SCHEDULE.response" },
+-												{ 0x020B, "SYSTEM_INFORMATION_SCHEDULE.indication" },
+-												{ 0x020C, "SYSTEM_INFORMATION.request" },
+-												{ 0x020D, "SYSTEM_INFORMATION.response" },
+-												{ 0x020E, "SYSTEM_INFORMATION.indication" },
+-												{ 0x020F, "NMM_STOP.request" },
+-												{ 0x0210, "NMM_STOP.response" },
+-
+-												{ 0 , NULL },	
+-};
+-
+-
+-typedef int(*tlv_decode)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end);
+-
+-typedef struct
+-{
+-	uint16_t tag_id;
+-	char* name;
+-	tlv_decode decode;
+-} tlv_t;
+-
+-static int dissect_tlv_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint end);
+-
+-
+-
+-
+-static guint8 proto_tree_add_uint8(proto_tree *tree, int hfindex, tvbuff_t *tvb, guint* offset, char* units)
+-{
+-	guint8 value = tvb_get_guint8(tvb, *offset);
+-	proto_item * item =  proto_tree_add_item(tree, hfindex, tvb, *offset, 1, ENC_NA);
+-
+-	if (units != NULL)
+-	{
+-		proto_item_append_text(item, " ");
+-		proto_item_append_text(item, units);
+-	}
+-
+-	*offset += 1;
+-
+-	return value;
+-}
+-
+-static guint8 proto_tree_add_uint8_with_range(proto_tree *tree, int hfindex, tvbuff_t *tvb, guint* offset, packet_info *pinfo, guint8 min, guint8 max, char* units)
+-{
+-	guint8 value = tvb_get_guint8(tvb, *offset);
+-	proto_item * item = proto_tree_add_item(tree, hfindex, tvb, *offset, 1, ENC_NA);
+-
+-	if (units != NULL)
+-	{
+-		proto_item_append_text(item, " ");
+-		proto_item_append_text(item, units);
+-	}
+-
+-	*offset += 1;
+-
+-	if (value < min || value > max)
+-	{
+-		expert_add_info(pinfo, tree, &ei_invalid_range);
+-	}
+-
+-
+-	return value;
+-}
+-
+-static guint16 proto_tree_add_uint16(proto_tree *tree, int hfindex, tvbuff_t *tvb, guint* offset, char* units)
+-{
+-	guint16 value = tvb_get_guint16(tvb, *offset, ENC_NA);
+-	proto_item * item =  proto_tree_add_item(tree, hfindex, tvb, *offset, 2, ENC_NA);
+-
+-	if (units != NULL)
+-	{
+-		proto_item_append_text(item, " ");
+-		proto_item_append_text(item, units);
+-	}
+-
+-	*offset += 2;
+-
+-	return value;
+-}
+-
+-static void proto_tree_add_int16(proto_tree *tree, int hfindex, tvbuff_t *tvb, guint* offset, char* units)
+-{
+-	proto_item * item = proto_tree_add_item(tree, hfindex, tvb, *offset, 2, ENC_NA);
+-
+-	if (units != NULL)
+-	{
+-		proto_item_append_text(item, " ");
+-		proto_item_append_text(item, units);
+-	}
+-
+-	*offset += 2;
+-}
+-
+-typedef int(*uint8_value_conversion)(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint8 value);
+-
+-static guint8 proto_tree_add_uint8_with_conversion(proto_tree *tree, int hfindex, tvbuff_t *tvb, guint* offset, uint8_value_conversion conversion)
+-{
+-	guint8 value = tvb_get_guint8(tvb, *offset);
+-
+-	conversion(tree, hfindex, tvb, offset, value);
+-
+-	*offset += 1;
+-
+-	return value;
+-}
+-
+-typedef int(*uint16_value_conversion)(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint16 value);
+-
+-static guint16 proto_tree_add_uint16_with_conversion(proto_tree *tree, int hfindex, tvbuff_t *tvb, guint* offset, uint16_value_conversion conversion)
+-{
+-	guint16 value = tvb_get_guint16(tvb, *offset, ENC_NA);
+-
+-	conversion(tree, hfindex, tvb, offset, value);
+-
+-	*offset += 2;
+-
+-	return value;
+-}
+-
+-typedef int(*int16_value_conversion)(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, gint16 value);
+-
+-static gint16 proto_tree_add_int16_with_conversion(proto_tree *tree, int hfindex, tvbuff_t *tvb, guint* offset, int16_value_conversion conversion)
+-{
+-	gint16 value = (gint16)(tvb_get_guint16(tvb, *offset, ENC_NA));
+-
+-	conversion(tree, hfindex, tvb, offset, value);
+-
+-	*offset += 2;
+-
+-	return value;
+-}
+-
+-
+-static void proto_tree_add_uint32(proto_tree *tree, int hfindex, tvbuff_t *tvb, guint* offset, char* units)
+-{
+-	proto_item * item = proto_tree_add_item(tree, hfindex, tvb, *offset, 4, ENC_NA);
+-
+-	if (units != NULL)
+-	{
+-		proto_item_append_text(item, " ");
+-		proto_item_append_text(item, units);
+-	}
+-
+-	*offset += 4;
+-}
+-
+-static void proto_tree_add_uint8_array(proto_tree *tree, int hfindex, guint len, tvbuff_t *tvb, guint* offset)
+-{
+-	proto_tree_add_item(tree, hfindex, tvb, *offset, len, ENC_NA);
+-
+-	*offset += len;
+-}
+-
+-
+-
+-
+-
+-int dissect_array_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end, const char* name, guint32 hf_idx, guint32 ett_idx, guint32 count, tlv_decode decode)
+-{
+-	guint16 i = 0;
+-
+-	if (count > 0)
+-	{
+-		proto_item *list_ti = proto_tree_add_string_format(tree, hf_idx, tvb, *offset, 2, "", name);
+-		proto_tree *list_tree = proto_item_add_subtree(list_ti, ett_idx);
+-
+-		gint start_of_list = *offset;
+-
+-		for (i = 0; i < count; ++i)
+-		{
+-			proto_item *item_ti = proto_tree_add_string_format(list_tree, hf_idx, tvb, *offset, 2, "", "[%d]", i);
+-			proto_tree *item_tree = proto_item_add_subtree(item_ti, ett_idx);
+-
+-			gint start_of_item = *offset;
+-
+-			decode(tvb, pinfo, item_tree, data, offset, end);
+-
+-			if (item_ti != NULL)
+-				item_ti->finfo->length = *offset - start_of_item;
+-		}
+-
+-		if (list_ti != NULL)
+-			list_ti->finfo->length = *offset - start_of_list;
+-	}
+-
+-	return 0;
+-}
+-
+-int dissect_pnf_param_general_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_sync_mode, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_location_mode, tvb, offset, 0);
+-	guint16 len = proto_tree_add_uint16(tree, hf_nfapi_location_coordinates_length, tvb, offset, 0);
+-	if (len > 0)
+-		proto_tree_add_uint8_array(tree, hf_nfapi_location_coordinates, len, tvb, offset);
+-	proto_tree_add_uint32(tree, hf_nfapi_dl_config_timing, tvb, offset, "milliseconds");
+-	proto_tree_add_uint32(tree, hf_nfapi_tx_timing, tvb, offset, "milliseconds");
+-	proto_tree_add_uint32(tree, hf_nfapi_ul_config_timing, tvb, offset, "milliseconds");
+-	proto_tree_add_uint32(tree, hf_nfapi_hi_dci0_timing, tvb, offset, "milliseconds");
+-	proto_tree_add_uint16(tree, hf_nfapi_maximum_number_phys, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_maximum_total_bandwidth, tvb, offset, "(100 khz)");
+-	proto_tree_add_uint8(tree, hf_nfapi_maximum_total_number_dl_layers, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_maximum_total_number_ul_layers, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_shared_bands, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_shared_pa, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_maximum_total_power, tvb, offset, 0);
+-	proto_tree_add_uint8_array(tree, hf_nfapi_oui, 3, tvb, offset);
+-	
+-	return 0;
+-}
+-
+-int dissect_pnf_rf_config_instance_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_rf_config_index, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_pnf_phy_instance_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_config_index, tvb, offset, 0);
+-	guint16 num_rf_configs = proto_tree_add_uint16(tree, hf_nfapi_number_of_rfs, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "RF Config List", hf_nfapi_pnf_phy, ett_nfapi_pnf_phy, num_rf_configs, dissect_pnf_rf_config_instance_value);
+-	guint16 num_rf_exclusions = proto_tree_add_uint16(tree, hf_nfapi_number_of_rf_exclusions, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "RF Exclustion List", hf_nfapi_pnf_phy, ett_nfapi_pnf_phy, num_rf_exclusions, dissect_pnf_rf_config_instance_value);
+-	proto_tree_add_uint16(tree, hf_nfapi_downlink_channel_bandwidth_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_uplink_channel_bandwidth_supported, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_dl_layers_supported, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_ul_layers_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_maximum_3gpp_release_supported, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_nmm_modes_supported, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_pnf_phy_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_phy = proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_number_phy, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "PHY List", hf_nfapi_pnf_phy, ett_nfapi_pnf_phy, num_phy, dissect_pnf_phy_instance_value);
+-
+-
+-	return 0;
+-
+-}
+-
+-
+-int dissect_pnf_rf_config_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_rf_config_index, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_band, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_maximum_transmit_power, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_minimum_transmit_power, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_antennas_suppported, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_minimum_downlink_frequency, tvb, offset, "(100 khz)");
+-	proto_tree_add_uint32(tree, hf_nfapi_maximum_downlink_frequency, tvb, offset, "(100 khz)");
+-	proto_tree_add_uint32(tree, hf_nfapi_minimum_uplink_frequency, tvb, offset, "(100 khz)");
+-	proto_tree_add_uint32(tree, hf_nfapi_maximum_uplink_frequency, tvb, offset, "(100 khz)");
+-
+-	return 0;
+-}
+-
+-
+-int dissect_pnf_rf_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_rf = proto_tree_add_uint16(tree, hf_nfapi_number_of_rfs, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "RF List", hf_nfapi_pnf_phy_rf_config_array_phy_rf_config_info, ett_nfapi_pnf_phy_rf_config, num_rf, dissect_pnf_rf_config_value);
+-
+-	return 0;
+-
+-}
+-
+-int dissect_pnf_phy_rel10_instance_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_config_index, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_transmission_mode7_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_transmission_mode8_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_two_antennas_ports_for_pucch, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_transmission_mode_9_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_simultaneous_pucch_pusch, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_for_layer_tx_with_tm3_and_tm4, tvb, offset, 0);
+-
+-	return 0;
+-}
+-
+-int dissect_pnf_phy_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_phy = proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_number_phy, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "PHY Rel 10 List", hf_nfapi_pnf_phy, ett_nfapi_pnf_phy_rel10, num_phy, dissect_pnf_phy_rel10_instance_value);
+-
+-	return 0;
+-}
+-
+-int dissect_pnf_phy_rel11_instance_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_config_index, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_epdcch_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_multi_ack_csi_reporting, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_pucch_tx_diversity_with_channel_selection, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_ul_comp_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_transmission_mode_5_supported, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_pnf_phy_rel11_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_phy = proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_number_phy, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "PHY Rel 11 List", hf_nfapi_pnf_phy, ett_nfapi_pnf_phy_rel11, num_phy, dissect_pnf_phy_rel11_instance_value);
+-	return 0;
+-}
+-
+-int dissect_pnf_phy_rel12_instance_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_config_index, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_csi_subframe_set, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_enhanced_4tx_codebook, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_drs_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_ul_64qam_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_transmission_mode_10_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hi_nfapi_alternative_tbs_indices, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_pnf_phy_rel12_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_phy = proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_number_phy, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "PHY Rel 12 List", hf_nfapi_pnf_phy, ett_nfapi_pnf_phy_rel12, num_phy, dissect_pnf_phy_rel12_instance_value);
+-	return 0;
+-}
+-
+-int dissect_pnf_phy_rel13_instance_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_config_index, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pucch_format_4_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pucch_format_5_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_more_than_5_ca_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_laa_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_laa_ending_in_dwpts_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_laa_starting_in_second_slot_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_beamforming_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_csi_rs_enhancements_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_drms_enhancements_supported, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_srs_enhancements_supported, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_pnf_phy_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_phy = proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_number_phy, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "PHY Rel 13 List", hf_nfapi_pnf_phy, ett_nfapi_pnf_phy_rel13, num_phy, dissect_pnf_phy_rel13_instance_value);
+-	return 0;
+-}
+-
+-int dissect_pnf_phy_rf_config_instance_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_phy_rf_config_info_phy_id, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_config_index, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_rf_config_index, tvb, offset, 0);
+-	return 0;
+-}
+-
+-
+-int dissect_pnf_phy_rf_config_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_configs = proto_tree_add_uint16(tree, hf_nfapi_pnf_phy_number_phy, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "PHY RF Config List", hf_nfapi_pnf_phy_rf_config, ett_nfapi_pnf_phy_rf_config, num_configs, dissect_pnf_phy_rf_config_instance_value);
+-	return 0;
+-}
+-
+-int bandwidth_conversion(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint16 value)
+-{
+-	/*
+-	guint8 comma = 0;
+-
+-	proto_item_append_text(item, "(");
+-
+-	if (value & 0x1)
+-	{
+-		proto_item_append_text(item, "6 Mhz");
+-		comma = 1;
+-	}
+-
+-	if (comma)
+-		proto_item_append_text(item, ", ");
+-
+-	if (value & 0x2)
+-	{
+-		proto_item_append_text(item, "15 Mhz");
+-		comma = 1;
+-	}
+-
+-	if (comma)
+-		proto_item_append_text(item, ", ");
+-
+-	if (value & 0x4)
+-	{
+-		proto_item_append_text(item, "25 Mhz");
+-		comma = 1;
+-	}
+-
+-	if (comma)
+-		proto_item_append_text(item, ", ");
+-
+-	if (value & 0x8)
+-	{
+-		proto_item_append_text(item, "50 Mhz");
+-		comma = 1;
+-	}
+-
+-	if (comma)
+-		proto_item_append_text(item, ", ");
+-
+-	if (value & 0x10)
+-	{
+-		proto_item_append_text(item, "75 Mhz");
+-		comma = 1;
+-	}
+-
+-	if (comma)
+-		proto_item_append_text(item, ", ");
+-
+-	if (value & 0x20)
+-	{
+-		proto_item_append_text(item, "100 Mhz");
+-		comma = 1;
+-	}
+-
+-	proto_item_append_text(item, ")");
+-	*/
+-	proto_tree_add_uint_format_value(tree, hfindex, tvb, *offset, 2, value, "?? (%d)", value);
+-	return 0;
+-
+-}
+-
+-int sfn_sf_conversion(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint16 value)
+-{
+-	proto_tree_add_uint_format_value(tree, hfindex, tvb, *offset, 2, value, "%d/%d (%d)", value >> 3, value & 0x0007, value);
+-	return 0;
+-}
+-
+-
+-int dissect_duplex_mode_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_duplex_mode, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int power_offset_conversion(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint16 value)
+-{
+-	proto_tree_add_uint_format_value(tree, hfindex, tvb, *offset, 2, value, "%.2f dB (%d)", (((float)value * 0.001) - 6.0), value);
+-	return 0;
+-}
+-
+-int dissect_pcfich_power_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 value = proto_tree_add_uint16_with_conversion(tree, hf_nfapi_pcfich_power_offset, tvb, offset, power_offset_conversion);
+-
+-	if (value > 10000)
+-	{
+-		expert_add_info(pinfo, tree, &ei_power_invalid);
+-	}
+-
+-	return 0;
+-}
+-
+-int dissect_pb_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 value = proto_tree_add_uint16(tree, hf_nfapi_pb, tvb, offset, 0);
+-
+-	if (value > 3)
+-	{
+-		expert_add_info(pinfo, tree, &ei_power_invalid);
+-	}
+-	return 0;
+-}
+-
+-int dissect_dl_cyclic_prefix_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_dl_cyclic_prefix_type, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_cyclic_prefix_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_ul_cyclic_prefix_type, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_dl_channel_bandwidth_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_downlink_channel_bandwidth, tvb, offset, bandwidth_conversion);
+-	return 0;
+-}
+-int dissect_ul_channel_bandwidth_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_uplink_channel_bandwidth, tvb, offset, bandwidth_conversion);
+-	return 0;
+-}
+-
+-
+-int reference_signal_power_conversion(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint16 value)
+-{
+-	proto_tree_add_uint_format_value(tree, hfindex, tvb, *offset, 2, value, "%.2f dB (%d)", (((float)value * 0.25) - 63.75), value);
+-	return 0;
+-}
+-
+-int dissect_reference_signal_power_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_reference_signal_power, tvb, offset, reference_signal_power_conversion);
+-	return 0;
+-}
+-int dissect_tx_antenna_ports_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_tx_antenna_ports, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_rx_antenna_ports_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_rx_antenna_ports, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_phich_resource_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_phich_resource, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_phich_duration_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_phich_duration, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_phich_power_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_phich_power_offset, tvb, offset, power_offset_conversion);
+-	return 0;
+-}
+-int dissect_psch_synch_signal_epre_eprers_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_primary_synchronization_signal_epre_eprers, tvb, offset, power_offset_conversion);
+-	return 0;
+-}
+-int dissect_physical_cell_id_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_physical_cell_id, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ssch_synch_signal_epre_eprers_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_secondary_synchronization_signal_epre_eprers, tvb, offset, power_offset_conversion);
+-	return 0;
+-}
+-int dissect_prach_configuration_index_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_configuration_index, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_prach_root_sequence_index_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_root_sequence_index, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_prach_zero_correlation_zone_configuration_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_zero_correlation_zone_configuration, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_prach_high_speed_flag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_high_speed_flag, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_prach_frequency_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_frequency_offset, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_pusch_hopping_mode_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_hopping_mode, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_pusch_hopping_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_hopping_offset, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_pusch_number_of_subbands_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_number_of_subbands, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_pucch_delta_pucch_shift_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_delta_pucch_shift, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_pucch_n_cqi_rb_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_n_cqi_rb, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_pucch_n_an_cs_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_n_an_cs, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_pucch_n1_pucch_an_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_n1_pucch_an, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_srs_bandwidth_configuration_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_bandwidth_configuration, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_srs_max_uppts_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_max_up_pts, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_srs_subframe_configuration_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_srs_subframe_configuration, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_srs_acknack_srs_sim_tx_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_srs_acknack_srs_simultaneous_transmission, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_uplink_rs_hopping_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_uplink_rs_hopping, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_group_assignment_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_group_assignment, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_cyclic_shift_1_for_drms_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_cyclic_shift_1_for_drms, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_tdd_subframe_assignement_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_subframe_assignment, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_tdd_subframe_patterns_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_special_subframe_patterns, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int laa_threshold_conversion(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint16 value)
+-{
+-	proto_tree_add_uint_format_value(tree, hfindex, tvb, *offset, 2, value, "%.2f dB (%d)", (float)(value * -100.00), value);
+-	return 0;
+-}
+-
+-int dissect_laa_ed_threashold_for_lbt_for_pdsch_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_ed_threshold_for_lbt_for_pdsch, tvb, offset, laa_threshold_conversion);
+-	return 0;
+-}
+-int dissect_laa_ed_threashold_for_lbt_for_drs_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_ed_threshold_for_lbt_for_drs, tvb, offset, laa_threshold_conversion);
+-	return 0;
+-}
+-int dissect_laa_pd_threshold_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_pd_threshold, tvb, offset, laa_threshold_conversion);
+-	return 0;
+-}
+-int dissect_laa_multi_carrier_type_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_multi_carrier_type, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_laa_multi_carrier_tx_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_multi_carrier_tx, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_laa_multi_carrier_freeze_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_multi_carrier_freeze, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_laa_tx_antenna_port_for_drs_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_tx_antenna_ports_for_drs, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_laa_transmission_power_for_drs_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power_for_drs, tvb, offset, power_offset_conversion);
+-	return 0;
+-}
+-
+-int dissect_emtc_pbch_repeitions_enabled_r13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pbch_repetitions_enabled_r13, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_cat_m_root_sequence_index_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_cat_m_root_sequence_index, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_cat_m_zero_correlation_zone_configuration_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_cat_m_zero_correlation_zone_configuration, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_cat_m_high_speed_flag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_cat_m_high_speed_flag, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_emtc_prach_ce_level_0_enabled_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_0_enable, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_ce_level_0_configuration_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_0_configuration_index, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_ce_level_0_frequency_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_0_frequency_offset, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_0_num_of_repeitions_per_attempt_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_0_number_of_repetitions_per_attempt, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_ce_level_0_starting_subframe_periodicity_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_0_starting_subframe_periodicity, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_0_hopping_enabled_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_0_hopping_enabled, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_0_hopping_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_0_hopping_offset, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_emtc_prach_ce_level_1_enabled_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_1_enable, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_ce_level_1_configuration_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_1_configuration_index, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_ce_level_1_frequency_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_1_frequency_offset, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_1_num_of_repeitions_per_attempt_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_1_number_of_repetitions_per_attempt, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_ce_level_1_starting_subframe_periodicity_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_1_starting_subframe_periodicity, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_1_hopping_enabled_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_1_hopping_enabled, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_1_hopping_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_1_hopping_offset, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_emtc_prach_ce_level_2_enabled_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_2_enable, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_ce_level_2_configuration_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_2_configuration_index, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_ce_level_2_frequency_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_2_frequency_offset, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_2_num_of_repeitions_per_attempt_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_2_number_of_repetitions_per_attempt, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_ce_level_2_starting_subframe_periodicity_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_2_starting_subframe_periodicity, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_2_hopping_enabled_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_2_hopping_enabled, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_2_hopping_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_2_hopping_offset, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_emtc_prach_ce_level_3_enabled_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_3_enable, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_ce_level_3_configuration_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_3_configuration_index, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_prach_ce_level_3_frequency_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_3_frequency_offset, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_3_num_of_repeitions_per_attempt_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_3_number_of_repetitions_per_attempt, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_ce_level_3_starting_subframe_periodicity_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_3_starting_subframe_periodicity, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_3_hopping_enabled_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_3_hopping_enabled, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_preach_ce_level_3_hopping_offset_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_prach_ce_level_3_hopping_offset, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_emtc_pucch_interval_ul_hopping_config_common_mode_a_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pucch_internal_ul_hopping_config_common_mode_a, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_emtc_pucch_interval_ul_hopping_config_common_mode_b_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pucch_internal_ul_hopping_config_common_mode_b, tvb, offset, 0);
+-	return 0;
+-}
+-
+-
+-int dissect_dl_bandwidth_support_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_dl_bandwidth_support, tvb, offset, bandwidth_conversion);
+-	return 0;
+-}
+-
+-int dissect_ul_bandwidth_support_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_ul_bandwidth_support, tvb, offset, bandwidth_conversion);
+-	return 0;
+-}
+-
+-int dl_modulation_conversion(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint16 value)
+-{
+-	proto_tree_add_uint_format_value(tree, hfindex, tvb, *offset, 2, value, "?? (%d)", value);
+-	return 0;
+-}
+-
+-int dissect_dl_modulation_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_dl_modulation_support, tvb, offset, dl_modulation_conversion);
+-	return 0;
+-}
+-
+-int ul_modulation_conversion(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint16 value)
+-{
+-	proto_tree_add_uint_format_value(tree, hfindex, tvb, *offset, 2, value, "?? (%d)", value);
+-	return 0;
+-}
+-int dissect_ul_modulation_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_ul_modulation_support, tvb, offset, ul_modulation_conversion);
+-	return 0;
+-}
+-int dissect_phy_antenna_capability_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_phy_antenna_capability, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int release_capability_conversion(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint16 value)
+-{
+-	proto_tree_add_uint_format_value(tree, hfindex, tvb, *offset, 2, value, "?? (%d)", value);
+-	return 0;
+-}
+-int dissect_release_capability_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_release_capability, tvb, offset, release_capability_conversion);
+-	return 0;
+-}
+-int dissect_mbsfn_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_mbsfn_capability, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_laa_support_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_laa_capability, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_laa_pd_sensing_lbt_support_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pd_sensing_lbt_support, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_laa_multi_carrier_lbt_support_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_multi_carrier_lbt_support, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_laa_partial_sf_support_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_partial_sf_support, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_data_report_mode_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_data_report_mode, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_sfn_sf_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_sfnsf, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_phy_state_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_phy_state, tvb, offset, 0);
+-	return 0;
+-}
+-
+-
+-
+-int dissect_p7_vnf_address_ipv4_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8_array(tree, hf_nfapi_vnf_address_ipv4, 4, tvb, offset);
+-	return 0;
+-}
+-int dissect_p7_vnf_address_ipv6_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8_array(tree, hf_nfapi_vnf_address_ipv4, 16, tvb, offset);
+-	return 0;
+-}
+-int dissect_p7_vnf_port_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_vnf_port, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_p7_pnf_address_ipv4_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8_array(tree, hf_nfapi_pnf_address_ipv4, 4, tvb, offset);
+-	return 0;
+-}
+-int dissect_p7_pnf_address_ipv6_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8_array(tree, hf_nfapi_pnf_address_ipv4, 16, tvb, offset);
+-	return 0;
+-}
+-int dissect_p7_pnf_port_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pnf_port, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_downlink_ues_per_subframe_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_dl_ue_per_sf, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_uplink_ues_per_subframe_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_ue_per_sf, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_rf_band_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_band, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_rf_bands_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 count = proto_tree_add_uint16(tree, hf_nfapi_number_of_rf_bands, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "RF Band List", hf_nfapi_rf_bands, ett_nfapi_rf_bands, count, dissect_rf_band_value);
+-	return 0;
+-}
+-
+-int dissect_timing_window_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_timing_window, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_timing_info_mode_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_timing_info_mode, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_timing_info_period_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_timing_info_period, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_maximum_transmit_power_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_maximum_transmit_power, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_earfcn_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_earfcn, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_nmm_gsm_frequency_bands_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 count = proto_tree_add_uint16(tree, hf_nfapi_number_of_rf_bands, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "RF Band List", hf_nfapi_rf_bands, ett_nfapi_rf_bands, count, dissect_rf_band_value);
+-	return 0;
+-}
+-int dissect_nmm_umts_frequency_bands_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 count = proto_tree_add_uint16(tree, hf_nfapi_number_of_rf_bands, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "RF Band List", hf_nfapi_rf_bands, ett_nfapi_rf_bands, count, dissect_rf_band_value);
+-	return 0;
+-}
+-int dissect_nmm_lte_frequency_bands_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 count = proto_tree_add_uint16(tree, hf_nfapi_number_of_rf_bands, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "RF Band List", hf_nfapi_rf_bands, ett_nfapi_rf_bands, count, dissect_rf_band_value);
+-	return 0;
+-}
+-int dissect_nmm_uplink_rssi_supported_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_nmm_uplink_rssi_supported, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_dl_config_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_dl_config_pdu_type, tvb, offset, 0);
+-	guint8 size = proto_tree_add_uint8(tree, hf_nfapi_pdu_size, tvb, offset, 0);
+-
+-	guint pdu_end = (*offset + size - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-
+-	return 0;
+-}
+-
+-
+-static int dissect_dl_config_request_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_number_pdcch_ofdm_symbols, tvb, offset, 0);
+-	guint16 num_pdu = proto_tree_add_uint8(tree, hf_nfapi_number_dci, tvb, offset, 0);
+-	num_pdu += proto_tree_add_uint16(tree, hf_nfapi_number_pdus, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_pdsch_rnti, tvb, offset, 0);
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power_pcfich, tvb, offset, power_offset_conversion);
+-
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "DL Config PDU List", hf_nfapi_dl_config_request_pdu_list, ett_nfapi_dl_config_request_pdu_list, num_pdu, dissect_dl_config_pdu);
+-
+-
+-	return 0;
+-}
+-
+-static int dissect_dl_config_request_bch_pdu_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_length, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pdu_index, tvb, offset, 0);
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power, tvb, offset, power_offset_conversion);
+-	return 0;
+-}
+-
+-static int dissect_dl_config_request_dl_dci_pdu_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_dci_format, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_cce_idx, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_aggregation_level, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_rnti, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_allocation_type, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_virtual_resource_block_assignment_flag, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_resource_block_coding, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_mcs_1, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_redundancy_version_1, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_new_data_indicator_1, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_transport_block_to_codeword_swap_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_mcs_2, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_redundancy_version_2, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_new_data_indicator_2, tvb, offset, 0);
+-	proto_tree_add_uint8_with_range(tree, hf_nfapi_harq_process, tvb, offset, pinfo, 0, 15, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_tpmi, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_precoding_information, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_tpc, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_downlink_assignment_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ngap, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_transport_block_size_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_downlink_power_offset, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_allocate_prach_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_preamble_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_prach_mask_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_rnti_type, tvb, offset, 0);
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power, tvb, offset, power_offset_conversion);
+-	return 0;
+-}
+-static int dissect_dl_config_request_dl_dci_pdu_rel9_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_mcch_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_mcch_change_notification, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_scrambling_identity, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_dl_config_request_dl_dci_pdu_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_cross_carrier_scheduling_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_carrier_indicator, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_size_of_cqi_csi_feild, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_srs_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_srs_request, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_antenna_ports_scrambling_and_layers, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_total_dci_length_including_padding, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_n_dl_rb, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_dl_config_request_dl_dci_pdu_rel11_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_ack_resource_offset, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_pdsch_re_mapping_and_quasi_co_location_indicator, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_ul_dl_configuration_index_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_dl_configuration_index, tvb, offset, 0);
+-	return 0;
+-}
+-
+-
+-static int dissect_dl_config_request_dl_dci_pdu_rel12_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_primary_cell_type, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_dl_configuration_flag, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_number_of_ul_dl_configurations, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "UL/DL Configurations", hf_nfapi_pnf_phy, ett_nfapi_pnf_phy, count, dissect_ul_dl_configuration_index_value);
+-
+-	return 0;
+-}
+-static int dissect_dl_config_request_dl_dci_pdu_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_laa_end_partial_sf_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_laa_end_partial_sf_configuration, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_initial_lbt_sf, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_codebooksize_determination_r13, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_rel13_drms_table_flag, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_dl_config_request_mch_pdu_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_length, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pdu_index, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_rnti, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_allocation_type, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_resource_block_coding, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_modulation, tvb, offset, 0);
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power, tvb, offset, power_offset_conversion);
+-	proto_tree_add_uint16(tree, hf_nfapi_mbsfn_area_id, tvb, offset, 0);
+-
+-	return 0;
+-}
+-
+-int dissect_codebook_index_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_codebook_index, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_bf_vector_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_bf_vector_bf_value, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_bf_vector_type_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_bf_vector_subband_index, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_bf_vector_num_antennas, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "Antennas", hf_nfapi_bf_vector_antennas, ett_nfapi_bf_vector_antennas, count, dissect_bf_vector_value);
+-	return 0;
+-}
+-
+-static int dissect_dl_config_request_dlsch_pdu_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_length, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pdu_index, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_rnti, tvb, offset, 0);		
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_allocation_type, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_virtual_resource_block_assignment_flag, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_resource_block_coding, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_modulation, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_redundancy_version, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_transport_blocks, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_transport_block_to_codeword_swap_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_transmission_scheme, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_layers, tvb, offset, 0);
+-	guint8 num_subbands = proto_tree_add_uint8(tree, hf_nfapi_number_of_subbands, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "Subbands", hf_nfapi_subbands, ett_nfapi_subbands, num_subbands, dissect_codebook_index_value);
+-	proto_tree_add_uint8(tree, hf_nfapi_ue_category_capacity, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_pa, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_delta_power_offset_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ngap, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_nprb, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_transmission_mode, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_num_bf_prb_per_subband, tvb, offset, 0);
+-	guint8 num_vectors = proto_tree_add_uint8(tree, hf_nfapi_num_bf_vector, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "Beamforming Vectors", hf_nfapi_bf_vectors, ett_nfapi_bf_vectors, num_vectors, dissect_bf_vector_type_value);
+-
+-	
+-	return 0;
+-}
+-
+-int dissect_csi_rs_resource_config_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_csi_rs_resource_config, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_dl_config_request_dlsch_pdu_rel9_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_nscid, tvb, offset, 0);
+-
+-	return 0;
+-}
+-static int dissect_dl_config_request_dlsch_pdu_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_csi_rs_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_csi_rs_resource_config_r10, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_csi_rs_zero_tx_power_resource_config_bitmap_r10, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_csi_rs_number_if_nzp_configurations, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "CSI-RS Resource Configs", hf_nfapi_csi_rs_resource_configs, ett_nfapi_csi_rs_resource_configs, count, dissect_csi_rs_resource_config_value);
+-	proto_tree_add_uint8(tree, hf_nfapi_pdsch_start, tvb, offset, 0);
+-
+-	return 0;
+-}
+-static int dissect_dl_config_request_dlsch_pdu_rel11_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_drms_config_flag, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_drms_scrambling, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_csi_config_flag, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_csi_scrambling, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_pdsch_re_mapping_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_pdsch_re_mapping_antenna_ports, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_pdsch_re_mapping_freq_shift, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_dl_config_request_dlsch_pdu_rel12_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_alt_cqi_table_r12, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_max_layers, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_n_dl_harq, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_dl_config_request_dlsch_pdu_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_dwpts_symbols, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_initial_lbt_sf, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ue_type, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_pdsch_payload_type, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_initial_transmission_sf, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_req13_drms_table_flag, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_dl_config_request_pch_pdu_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_length, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pdu_index, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_prnti, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_allocation_type, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_virtual_resource_block_assignment_flag, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_resource_block_coding, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_mcs, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_redundancy_version, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_transport_blocks, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_transport_block_to_codeword_swap_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_transmission_scheme, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_layers, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_codebook_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ue_category_capacity, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_pa, tvb, offset, 0);
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power, tvb, offset, power_offset_conversion);
+-	proto_tree_add_uint8(tree, hf_nfapi_nprb, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ngap, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_dl_config_request_pch_pdu_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_ue_mode, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_initial_transmission_sf, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_dl_config_request_prs_pdu_rel9_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power, tvb, offset, power_offset_conversion);
+-	proto_tree_add_uint8(tree, hf_prs_bandwidth, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_prs_cyclic_prefix_type, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_prs_muting, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_dl_config_request_csi_rs_pdu_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_csi_rs_antenna_port_count_r10, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_csi_rs_resource_config_r10, tvb, offset, 0);
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power, tvb, offset, power_offset_conversion);
+-	proto_tree_add_uint16(tree, hf_nfapi_csi_rs_zero_tx_power_resource_config_bitmap_r10, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_csi_rs_number_if_nzp_configurations, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "CSI-RS Resource Configs", hf_nfapi_csi_rs_resource_configs, ett_nfapi_csi_rs_resource_configs, count, dissect_csi_rs_resource_config_value);
+-	return 0;
+-}
+-
+-
+-int dissect_csi_rs_bf_vector_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_csi_rs_resource_index, tvb, offset, 0);
+-	//proto_tree_add_uint8(tree, hf_nfapi_csi_rs_resource_config, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_dl_config_request_csi_rs_pdu_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_csi_rs_class, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_cdm_type, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_num_bf_vector, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "Beamforming Vector", hf_nfapi_csi_rs_bf_vector, ett_nfapi_csi_rs_bf_vector, count, dissect_csi_rs_bf_vector_value);
+-	return 0;
+-}
+-
+-int dissect_epdcch_prb_index_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_edpcch_prb_index, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_dl_config_request_edpcch_params_rel11_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_epdcch_resource_assignment_flag, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_epdcch_id, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_epdcch_start_symbol, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_epdcch_num_prb, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "PRBs", hf_nfapi_epdcch_prbs, ett_nfapi_epdcch_prbs, count, dissect_epdcch_prb_index_value);
+-	dissect_bf_vector_type_value(tvb, pinfo, tree, data, offset, end);
+-
+-	return 0;
+-}
+-static int dissect_dl_config_request_edpcch_params_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_dwpts_symbols, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_initial_lbt_sf, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_precoding_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_precoding_value, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_dl_config_request_mpdpcch_pdu_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_mpdcch_narrowband, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_prb_pairs, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_block_assignment, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_start_symbol, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ecce_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_aggregation_level, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_rnti_type, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_rnti, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ce_mode, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_drms_scrabmling_init, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_initial_transmission_sf, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_transmission_power, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_dci_format, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_resource_block_coding	, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_mcs, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_pdsch_reception_levels , tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_redundancy_version, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_new_data_indicator, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_process, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_tpmi_length, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_tpmi, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_pmi_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_resource_offset, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_dci_subframe_repetition_number, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_tpc, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_downlink_assignment_index_length, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_downlink_assignment_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_allocate_prach_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_preamble_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_prach_mask_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_starting_ce_level, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_srs_request, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_antenna_ports_and_scrambling_identity_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_antenna_ports_and_scrambling_identity, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_frequency_hopping_enabled_flag , tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_paging_direct_indication_differentiation_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_direct_indication, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_total_dci_length_including_padding, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_number_of_tx_antenna_ports, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "Precoding", hf_nfapi_precoding, ett_nfapi_precoding, count, dissect_precoding_value);
+-	
+-	return 0;
+-}
+-
+-int dissect_ul_config_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_config_pdu_type, tvb, offset, 0);
+-	guint8 size = proto_tree_add_uint8(tree, hf_nfapi_pdu_size, tvb, offset, 0);
+-
+-	guint pdu_end = (*offset + size - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-
+-	return 0;
+-}
+-
+-static int  dissect_ul_config_request_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint8 num_pdu = proto_tree_add_uint8(tree, hf_nfapi_number_pdus, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_rach_prach_frequency_resources, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_srs_present, tvb, offset, 0);
+-
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "UL Config PDU List", hf_nfapi_ul_config_request_pdu_list, ett_nfapi_ul_config_request_pdu_list, num_pdu, dissect_ul_config_pdu);
+-
+-	return 0;
+-}
+-
+-
+-int dissect_ul_config_ulsch_pdu_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint32(tree, hf_nfapi_handle, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_size, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_rnti, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_block_start, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_resource_blocks, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_modulation, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_cyclic_shift_2_for_drms, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_frequency_hopping_enabled_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_frequency_hopping_bits, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_new_data_indication, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_redundancy_version, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_process_number, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_tx_mode, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_current_tx_nb, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_n_srs, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_ulsch_pdu_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_allocation_type, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_resource_block_coding, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_transport_blocks, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_transmission_scheme, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_layers, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_codebook_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_disable_sequence_hopping_flag, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_ulsch_pdu_rel11_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_virtual_cell_id_enabled_flag, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_npusch_identity, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_drms_config_flag, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_ndrms_csh_identity, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_ulsch_pdu_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_ue_type, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_total_number_of_repetitions, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_repetition_number, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_initial_sf_io, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_empty_symbols_due_to_retunning, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_init_tx_params_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_n_srs_initial, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_initial_number_of_resource_blocks, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_cqi_ri_info_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_dl_cqi_pmi_size_rank_1, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_dl_cqi_pmi_size_rank_greater_1, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ri_size, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_delta_offset_cqi, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_delta_offset_ri, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_cqi_ri_info_rel9_later_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint8 type = proto_tree_add_uint8(tree, hf_nfapi_report_type, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_delta_offset_cqi, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_delta_offset_ri, tvb, offset, 0);
+-
+-	switch (type)
+-	{
+-		case 0:
+-		{
+-			proto_tree_add_uint8(tree, hf_nfapi_dl_cqi_ri_pmi_size, tvb, offset, 0);
+-			proto_tree_add_uint8(tree, hf_nfapi_control_type, tvb, offset, 0);
+-			break;
+-		}
+-		case 1:
+-		{
+-			/*guint8 num_cc = */proto_tree_add_uint8(tree, hf_nfapi_number_of_cc, tvb, offset, 0);
+-
+-			// todo ...
+-
+-			break;
+-		}
+-	}
+-	return 0;
+-}
+-int dissect_ul_config_cqi_ri_info_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_dl_cqi_ri_pmi_size_2, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_harq_info_ulsch_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_size, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_delta_offset_harq, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ack_nack_mode, tvb, offset, 0);
+-
+-	return 0;
+-}
+-int dissect_ul_config_harq_info_ulsch_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_harq_size_2, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_delta_offset_harq_2, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_ue_info_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint32(tree, hf_nfapi_handle, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_rnti, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_ue_info_rel11_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_virtual_cell_id_enabled_flag, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_npucch_identity, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_ue_info_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_ue_type, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_empty_symbols, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_total_number_of_repetitions, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_repetition_number, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_cqi_info_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pucch_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_dl_cqi_pmi_size, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_cqi_info_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_pucch_resource, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pucch_index_p1, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_cqi_info_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_csi_mode, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_dl_cqi_pmi_size_2, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_statring_prb, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_nprb, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_cdm_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_nsrs, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_sr_info_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_pucch_index, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_sr_info_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_pucch_resource, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pucch_index_p1, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_harq_info_uci_rel10_tdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_size, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ack_nack_mode, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_pucch_resource, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_1_0, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_1_1, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_1_2, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_1_3, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_harq_info_uci_rel8_fdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_1_0, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_size, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_harq_info_uci_rel9_later_fdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_size, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ack_nack_mode, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_pucch_resource, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_1_0, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_1_1, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_1_2, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_1_3, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_harq_info_uci_rel11_fdd_tdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_num_ant_ports, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_2_0, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_2_1, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_2_2, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_n_pucch_2_3, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_harq_info_uci_rel13_fdd_tdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_harq_size_2, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_starting_prb, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_nprb, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_cdm_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_nsrs, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_srs_info_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint32(tree, hf_nfapi_handle, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_size, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_rnti, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_srs_bandwidth, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_frequency_domain_position, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_srs_hopping_bandwidth, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_transmission_comb, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_i_srs, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_sounding_reference_cyclic_shift, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_srs_info_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_antenna_port, tvb, offset, 0);
+-	return 0;
+-}
+-int dissect_ul_config_srs_info_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_combs, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_hi_dci0_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_pdu_type, tvb, offset, 0);
+-	guint8 size = proto_tree_add_uint8(tree, hf_nfapi_pdu_size, tvb, offset, 0);
+-
+-	guint pdu_end = (*offset + size - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-
+-	return 0;
+-}
+-
+-static int dissect_hi_dci0_request_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_sfn_sf, tvb, offset, 0);
+-	guint8 num_pdu = proto_tree_add_uint8(tree, hf_nfapi_number_of_dci_pdus, tvb, offset, 0);
+-	num_pdu += proto_tree_add_uint8(tree, hf_nfapi_number_of_hi_pdus, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "HI DCI0 PDU List", hf_nfapi_hi_dci0_request_pdu_list, ett_nfapi_hi_dci0_request_pdu_list, num_pdu, dissect_hi_dci0_pdu);
+-	return 0;
+-}
+-
+-static int dissect_hi_dci0_hi_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_block_start, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_cyclic_shift_2_for_drms, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_hi_value, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_i_phich, tvb, offset, 0);
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power, tvb, offset, power_offset_conversion);
+-	return 0;
+-}
+-static int dissect_hi_dci0_hi_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_flag_tb2, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_hi_value_2, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_hi_dci0_dci_ul_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_dci_format, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_cce_idx, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_aggregation_level, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_rnti, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_block_start, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_resource_blocks, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_mcs_1, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_cyclic_shift_2_for_drms, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_frequency_hopping_enabled_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_frequency_hopping_bits, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_new_data_indication, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ue_tx_antenna_selection, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_tpc, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_cqi_csi_request, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_dl_assignment_index, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_tpc_bitmap, tvb, offset, 0);
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power, tvb, offset, power_offset_conversion);
+-	return 0;
+-}
+-static int dissect_hi_dci0_dci_ul_rel10_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_cross_carrier_scheduling_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_carrier_indicator, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_size_of_cqi_csi_feild, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_srs_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_srs_request, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_allocation_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_resource_allocation_type, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_resource_block_coding, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_mcs_2, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_new_data_indication_two, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_antenna_ports, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_tpmi, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_total_dci_length_including_padding, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_n_ul_rb, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_hi_dci0_dci_ul_rel12_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_pscch_resource, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_time_resource_pattern, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_hi_dci0_edpcch_dci_ul_rel11_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_epdcch_resource_assignment_flag, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_epdcch_id, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_epdcch_start_symbol, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_epdcch_num_prb, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "PRBs", hf_nfapi_epdcch_prbs, ett_nfapi_epdcch_prbs, count, dissect_epdcch_prb_index_value);
+-	dissect_bf_vector_type_value(tvb, pinfo, tree, data, offset, end);
+-	return 0;
+-}
+-
+-static int dissect_hi_dci0_mdpcch_dci_ul_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_mpdcch_narrowband, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_prb_pairs, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_resource_block_assignment, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_mpdcch_transmission_type, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_start_symbol, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ecce_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_aggregation_level, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_rnti_type, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ce_mode, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_drms_scrambling_init, tvb, offset, 0);
+-	proto_tree_add_uint16_with_conversion(tree, hf_nfapi_transmission_power, tvb, offset, power_offset_conversion);
+-	proto_tree_add_uint8(tree, hf_nfapi_dci_format, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_resource_blocks, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_mcs, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_pusch_repetition_levels, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_frequency_hopping_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_new_data_indication, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_process, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_redundancy_version, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_tpc, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_csi_request, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_dai_presence_flag, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_dl_assignment_index, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_srs_request, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_dci_subframe_repetition_number, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_tpc_bitmap, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_total_dci_length_include_padding, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_number_of_tx_antenna_ports, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "TX Antenna Ports", hf_nfapi_tx_antenna_ports, ett_nfapi_tx_antenna_ports, count, dissect_precoding_value);
+-
+-
+-	return 0;
+-}
+-static int dissect_rx_ue_info_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint32(tree, hf_nfapi_handle, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_rnti, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_rx_indication_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_length, tvb, offset, 0);
+-	int data_offset = proto_tree_add_uint16(tree, hf_nfapi_data_offset, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_cqi, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_timing_advance, tvb, offset, 0);
+-	return data_offset;
+-}
+-static int dissect_rx_indication_rel9_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_timing_advance_r9, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_harq_indication_data_bundling_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_0, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_1, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_harq_indication_data_multplexing_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_0, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_1, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_2, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_3, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_harq_indication_data_special_bundling_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_0, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_harq_indication_data_channel_selection_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_0, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_harq_indication_data_format_3_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_0, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_harq_indication_data_format_4_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_0, tvb, offset, 0);
+-	return 0;
+-}
+-
+-
+-static int dissect_harq_indication_data_format_5_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_data_value_0, tvb, offset, 0);
+-	return 0;
+-}
+-
+-
+-
+-static int dissect_harq_indication_rel8_tdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint8 mode = proto_tree_add_uint8(tree, hf_nfapi_harq_mode, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_ack_nack, tvb, offset, 0);
+-
+-	switch (mode)
+-	{
+-		case 0:
+-		{
+-			dissect_harq_indication_data_bundling_value(tvb, pinfo, tree, data, offset, end);
+-			break;
+-		}
+-		case 1:
+-		{
+-			dissect_harq_indication_data_multplexing_value(tvb, pinfo, tree, data, offset, end);
+-			break;
+-		}
+-		case 2:
+-		{
+-			dissect_harq_indication_data_special_bundling_value(tvb, pinfo, tree, data, offset, end);
+-			break;
+-		}
+-	};
+-
+-	return 0;
+-}
+-static int dissect_harq_indication_rel9_later_tdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint8 mode = proto_tree_add_uint8(tree, hf_nfapi_harq_mode, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_number_of_ack_nack, tvb, offset, 0);
+-
+-	// Have to do this as the mode value is need to decode the value
+-	guint16 i = 0;
+-
+-	proto_item *list_ti = proto_tree_add_string_format(tree, hf_nfapi_harq_ack_nack_data, tvb, *offset, 2, "", "ACK/NACK Data");
+-	proto_tree *list_tree = proto_item_add_subtree(list_ti, ett_nfapi_harq_ack_nack_data);
+-
+-	for (i = 0; i < count; ++i)
+-	{
+-
+-		proto_item *item_ti = proto_tree_add_string_format(list_tree, hf_nfapi_harq_ack_nack_data, tvb, *offset, 2, "", "[%d]", i);
+-		proto_tree *item_tree = proto_item_add_subtree(item_ti, ett_nfapi_harq_ack_nack_data);
+-
+-		switch (mode)
+-		{
+-			case 0:
+-			{
+-				dissect_harq_indication_data_bundling_value(tvb, pinfo, item_tree, data, offset, end);
+-				break;
+-			}
+-			case 1:
+-			{
+-				dissect_harq_indication_data_multplexing_value(tvb, pinfo, item_tree, data, offset, end);
+-				break;
+-			}
+-			case 2:
+-			{
+-				dissect_harq_indication_data_special_bundling_value(tvb, pinfo, item_tree, data, offset, end);
+-				break;
+-			}
+-			case 3:
+-			{
+-				dissect_harq_indication_data_channel_selection_value(tvb, pinfo, item_tree, data, offset, end);
+-				break;
+-			}
+-			case 4:
+-			{
+-				dissect_harq_indication_data_format_3_value(tvb, pinfo, item_tree, data, offset, end);
+-				break;
+-			}
+-		};
+-	}
+-
+-	return 0;
+-}
+-static int dissect_harq_indication_rel13_later_tdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint8 mode = proto_tree_add_uint8(tree, hf_nfapi_harq_mode, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_number_of_ack_nack, tvb, offset, 0);
+-
+-	// Have to do this as the mode value is need to decode the value
+-	guint16 i = 0;
+-
+-	proto_item *list_ti = proto_tree_add_string_format(tree, hf_nfapi_harq_ack_nack_data, tvb, *offset, 2, "", "ACK/NACK Data");
+-	proto_tree *list_tree = proto_item_add_subtree(list_ti, ett_nfapi_harq_ack_nack_data);
+-
+-	for (i = 0; i < count; ++i)
+-	{
+-		proto_item *item_ti = proto_tree_add_string_format(list_tree, hf_nfapi_harq_ack_nack_data, tvb, *offset, 2, "", "[%d]", i);
+-		proto_tree *item_tree = proto_item_add_subtree(item_ti, ett_nfapi_harq_ack_nack_data);
+-
+-		switch (mode)
+-		{
+-		case 0:
+-		{
+-			dissect_harq_indication_data_bundling_value(tvb, pinfo, item_tree, data, offset, end);
+-			break;
+-		}
+-		case 1:
+-		{
+-			dissect_harq_indication_data_multplexing_value(tvb, pinfo, item_tree, data, offset, end);
+-			break;
+-		}
+-		case 2:
+-		{
+-			dissect_harq_indication_data_special_bundling_value(tvb, pinfo, item_tree, data, offset, end);
+-			break;
+-		}
+-		case 3:
+-		{
+-			dissect_harq_indication_data_channel_selection_value(tvb, pinfo, item_tree, data, offset, end);
+-			break;
+-		}
+-		case 4:
+-		{
+-			dissect_harq_indication_data_format_3_value(tvb, pinfo, item_tree, data, offset, end);
+-			break;
+-		}
+-		case 5:
+-		{
+-			dissect_harq_indication_data_format_4_value(tvb, pinfo, item_tree, data, offset, end);
+-			break;
+-		}
+-		case 6:
+-		{
+-			dissect_harq_indication_data_format_5_value(tvb, pinfo, item_tree, data, offset, end);
+-			break;
+-		}
+-		};
+-	}
+-
+-	return 0;
+-}
+-static int dissect_harq_indication_rel8_fdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_tb_1, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_tb_2, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_harq_tb_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_harq_tb_n, tvb, offset, 0);
+-	return 0;
+-}
+-
+-
+-static int dissect_harq_indication_rel9_later_fdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_mode, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_number_of_ack_nack, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "HARQ TB List", hf_nfapi_harq_data, ett_nfapi_harq_data, count, dissect_harq_tb_value);
+-	return 0;
+-}
+-static int dissect_harq_indication_rel13_later_fdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_harq_mode, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_number_of_ack_nack, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "HARQ TB List", hf_nfapi_harq_data, ett_nfapi_harq_data, count, dissect_harq_tb_value);
+-	return 0;
+-}
+-static int dissect_ul_cqi_information_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_cqi, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_channel, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_crc_indication_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_crc_flag, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_rx_cqi_indication_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_length, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_data_offset, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_cqi, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ri, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_timing_advance, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_ri_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_ri, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_rx_cqi_indication_rel9_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_length, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_data_offset, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_ul_cqi, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_number_of_cc_reported, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "CC List", hf_nfapi_cc, ett_nfapi_cc, count, dissect_ri_value);
+-	proto_tree_add_uint16(tree, hf_nfapi_timing_advance, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_timing_advance_r9, tvb, offset, 0);
+-
+-	return 0;
+-}
+-static int dissect_rach_indication_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_rnti, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_preamble, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_timing_advance, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_rach_indication_rel9_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_timing_advance_r9, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_rach_indication_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_rach_resource_type, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_snr_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_snr, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_srs_indication_rel8_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_doppler_estimation, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_timing_advance, tvb, offset, 0);
+-	guint8 count = proto_tree_add_uint8(tree, hf_nfapi_number_of_resource_blocks, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_rb_start, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "RB List", hf_nfapi_rbs, ett_nfapi_rbs, count, dissect_snr_value);
+-
+-
+-	return 0;
+-}
+-static int dissect_srs_indication_rel9_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_timing_advance_r9, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_srs_indication_rel10_tdd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_up_pts_symbol, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_tdd_channel_measuerment_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_number_prb_per_subband, tvb, offset, 0);
+-	guint8 num_subbands = proto_tree_add_uint8(tree, hf_nfapi_number_of_subbands, tvb, offset, 0);
+-	guint8 num_phy_ant = proto_tree_add_uint8(tree, hf_nfapi_number_antennas, tvb, offset, 0);
+-
+-	guint16 i = 0;
+-	guint16 j = 0;
+-
+-	proto_item *sb_list_ti = proto_tree_add_string_format(tree, hf_nfapi_subbands, tvb, *offset, 2, "", "Subbands");
+-	proto_tree *sb_list_tree = proto_item_add_subtree(sb_list_ti, ett_nfapi_subbands);
+-
+-	for (i = 0; i < num_subbands; ++i)
+-	{
+-		proto_item *sb_item_ti = proto_tree_add_string_format(sb_list_tree, hf_nfapi_subbands, tvb, *offset, 2, "", "[%d]", i);
+-		proto_tree *sb_item_tree = proto_item_add_subtree(sb_item_ti, ett_nfapi_subbands);
+-
+-		proto_tree_add_uint8(sb_item_ti, hf_nfapi_subband_index, tvb, offset, 0);
+-
+-
+-		proto_item *ant_list_ti = proto_tree_add_string_format(sb_item_tree, hf_nfapi_antennas, tvb, *offset, 2, "", "Physical Antennas");
+-		proto_tree *ant_list_tree = proto_item_add_subtree(ant_list_ti, ett_nfapi_antennas);
+-
+-		for (j = 0; j < num_phy_ant; ++j)
+-		{
+-			proto_item *ant_item_ti = proto_tree_add_string_format(ant_list_tree, hf_nfapi_antennas, tvb, *offset, 2, "", "[%d]", j);
+-			proto_tree *ant_item_tree = proto_item_add_subtree(ant_item_ti, ett_nfapi_antennas);
+-
+-			proto_tree_add_uint16(ant_item_tree, hf_nfapi_channel_coefficient, tvb, offset, 0);
+-		}
+-	}
+-
+-	return 0;
+-}
+-
+-static int dissect_srs_indication_rel11_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_ul_rtoa, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_lbt_dl_config_request_pdsch_req_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint32(tree, hf_nfapi_handle, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_mp_cca, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_n_cca, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_offset, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_lte_txop_sf, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_txop_sfn_sf_end, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_lbt_mode, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_lbt_dl_config_request_drs_req_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint32(tree, hf_nfapi_handle, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_offset, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_sfn_sf_end, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_lbt_mode, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_lbt_dl_config_request_pdsch_resp_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint32(tree, hf_nfapi_handle, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_result, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_txop_symbols, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_initial_partial_sf, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_lbt_dl_config_request_drs_resp_rel13_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint32(tree, hf_nfapi_handle, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_result, tvb, offset, 0);
+-	return 0;
+-}
+-
+-int dissect_tx_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 len = proto_tree_add_uint16(tree, hf_nfapi_pdu_length, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pdu_index, tvb, offset, 0);
+-
+-	proto_tree_add_uint8_array(tree, hf_nfapi_pdu, len, tvb, offset);
+-
+-	return 0;
+-}
+-
+-static int dissect_tx_request_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_pdu = proto_tree_add_uint16(tree, hf_nfapi_number_pdus, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "TX PDU List", hf_nfapi_tx_request_pdu_list, ett_nfapi_tx_request_pdu_list, num_pdu, dissect_tx_pdu);
+-	return 0;
+-
+-}
+-
+-int dissect_rx_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	//guint end = (*offset + size - 2);
+-	//dissect_tlv_list(tvb, pinfo, tree, data, offset, end);
+-	return 0;
+-}
+-
+-
+-
+-int dissect_harq_indication_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 pdu_len = proto_tree_add_uint16(tree, hf_nfapi_instance_length, tvb, offset, 0);
+-	guint pdu_end = (*offset + pdu_len - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-	return 0;
+-}
+-
+-static int dissect_harq_indication_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_pdu = proto_tree_add_uint16(tree, hf_nfapi_number_of_harqs, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "HARQ PDU List", hf_nfapi_harq_indication_pdu_list, ett_nfapi_harq_indication_pdu_list, num_pdu, dissect_harq_indication_pdu);
+-	return 0;
+-}
+-
+-int dissect_crc_indication_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 pdu_len = proto_tree_add_uint16(tree, hf_nfapi_instance_length, tvb, offset, 0);
+-	guint pdu_end = (*offset + pdu_len - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-	return 0;
+-}
+-
+-
+-static int dissect_crc_indication_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_pdu = proto_tree_add_uint16(tree, hf_nfapi_number_of_crcs, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "CRC PDU List", hf_nfapi_crc_indication_pdu_list, ett_nfapi_crc_indication_pdu_list, num_pdu, dissect_crc_indication_pdu);
+-	return 0;
+-}
+-int dissect_sr_indication_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 pdu_len = proto_tree_add_uint16(tree, hf_nfapi_instance_length, tvb, offset, 0);
+-	guint pdu_end = (*offset + pdu_len - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-	return 0;
+-}
+-
+-static int dissect_rx_sr_indication_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_pdu = proto_tree_add_uint16(tree, hf_nfapi_number_of_srs, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "SR PDU List", hf_nfapi_sr_indication_pdu_list, ett_nfapi_sr_indication_pdu_list, num_pdu, dissect_sr_indication_pdu);
+-	return 0;
+-}
+-int dissect_cqi_indication_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 pdu_len = proto_tree_add_uint16(tree, hf_nfapi_instance_length, tvb, offset, 0);
+-	guint pdu_end = (*offset + pdu_len - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-	return 0;
+-}
+-static int dissect_rx_cqi_indication_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_pdu = proto_tree_add_uint16(tree, hf_nfapi_number_of_cqi, tvb, offset, 0);
+-
+-	guint16* lengths = malloc(num_pdu * 2);
+-	memset(lengths, 0, num_pdu * 2);
+-
+-	guint8 tmp_offset = *offset;
+-
+-	int i = 0;
+-	for (i = 0; i < num_pdu; ++i)
+-	{
+-		guint16 instance_len = tvb_get_guint16(tvb, tmp_offset, ENC_NA);
+-		tmp_offset += 2;
+-		guint8 pdu_end = tmp_offset + instance_len;
+-
+-		while (tmp_offset < pdu_end)
+-		{
+-			guint16 tlv_id = tvb_get_guint16(tvb, tmp_offset, ENC_NA);
+-			tmp_offset += 2;
+-			guint16 tlv_len = tvb_get_guint16(tvb, tmp_offset, ENC_NA);
+-			tmp_offset += 2;
+-
+-			if (tlv_id == 0x202F)
+-			{
+-				lengths[i] = tvb_get_guint16(tvb, tmp_offset, ENC_NA);
+-			}
+-			else if (tlv_id == 0x2030)
+-			{
+-				lengths[i] = tvb_get_guint16(tvb, tmp_offset, ENC_NA);
+-			}
+-
+-			tmp_offset += tlv_len;
+-		}
+-
+-	}
+-
+-
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "CQI PDU List", hf_nfapi_cqi_indication_pdu_list, ett_nfapi_cqi_indication_pdu_list, num_pdu, dissect_cqi_indication_pdu);
+-
+-
+-	for (i = 0; i < num_pdu; ++i)
+-	{
+-		proto_tree_add_uint8_array(tree, hf_nfapi_pdu, lengths[i], tvb, offset);
+-	}
+-
+-	free(lengths);
+-
+-	return 0;
+-}
+-int dissect_preamble_indication_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 pdu_len = proto_tree_add_uint16(tree, hf_nfapi_instance_length, tvb, offset, 0);
+-	guint pdu_end = (*offset + pdu_len - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-	return 0;
+-}
+-static int dissect_rach_indication_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_pdu = proto_tree_add_uint16(tree, hf_nfapi_number_of_preambles, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "Preamble PDU List", hf_nfapi_preamble_indication_pdu_list, ett_nfapi_preamble_indication_pdu_list, num_pdu, dissect_preamble_indication_pdu);
+-	return 0;
+-}
+-int dissect_srs_indication_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 pdu_len = proto_tree_add_uint16(tree, hf_nfapi_instance_length, tvb, offset, 0);
+-	guint pdu_end = (*offset + pdu_len - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-	return 0;
+-}
+-static int dissect_srs_indication_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-
+-	guint8 num_pdu = proto_tree_add_uint8(tree, hf_nfapi_number_of_srss, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "SRS PDU List", hf_nfapi_srs_indication_pdu_list, ett_nfapi_srs_indication_pdu_list, num_pdu, dissect_srs_indication_pdu);
+-	return 0;
+-}
+-int dissect_lbt_dl_config_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_lbt_dl_req_pdu_type, tvb, offset, 0);
+-	guint8 size = proto_tree_add_uint8(tree, hf_nfapi_pdu_size, tvb, offset, 0);
+-	guint pdu_end = (*offset + size - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-	return 0;
+-}
+-static int dissect_lbt_dl_config_request_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint8 num_pdu = proto_tree_add_uint8(tree, hf_nfapi_number_pdus, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "LBT DL PDU List", hf_nfapi_lbt_dl_config_pdu_list, ett_nfapi_lbt_dl_config_pdu_list, num_pdu, dissect_lbt_dl_config_pdu);
+-
+-	return 0;
+-}
+-int dissect_lbt_dl_indication_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_lbt_dl_ind_pdu_type, tvb, offset, 0);
+-	guint8 size = proto_tree_add_uint8(tree, hf_nfapi_pdu_size, tvb, offset, 0);
+-	guint pdu_end = (*offset + size - 2);
+-	dissect_tlv_list(tvb, pinfo, tree, data, offset, pdu_end);
+-	return 0;
+-}
+-static int dissect_lbt_indication_message_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint8 num_pdu = proto_tree_add_uint8(tree, hf_nfapi_number_pdus, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "LBT DL PDU List", hf_nfapi_lbt_dl_indication_pdu_list, ett_nfapi_lbt_dl_indication_pdu_list, num_pdu, dissect_lbt_dl_indication_pdu);
+-	return 0;
+-}
+-
+-static int dissect_lte_rssi_request_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_frequency_band_indicator, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_measurement_period, tvb, offset, "ms");
+-	proto_tree_add_uint8(tree, hf_nfapi_bandwidth, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, "ms");
+-	guint8 num_earfcns = proto_tree_add_uint8(tree, hf_nfapi_number_of_earfcns, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "EARFCNs", hf_nfapi_earfcn_list, ett_nfapi_earfcn_list, num_earfcns, dissect_earfcn_value);
+-	return 0;
+-}
+-
+-int dissect_uarfcn_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_uarfcn, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_utran_rssi_request_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_frequency_band_indicator, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_measurement_period, tvb, offset, "ms");
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, "ms");
+-	guint8 num_uarfcns = proto_tree_add_uint8(tree, hf_nfapi_number_of_uarfcns, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "UARFCNs", hf_nfapi_uarfcn_list, ett_nfapi_uarfcn_list, num_uarfcns, dissect_uarfcn_value);
+-	return 0;
+-}
+-
+-int dissect_arfcn_dir_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_arfcn, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_arfcn_direction, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_geran_rssi_request_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_frequency_band_indicator, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_measurement_period, tvb, offset, "ms");
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, "ms");
+-	guint8 num_arfcns = proto_tree_add_uint8(tree, hf_nfapi_number_of_arfcns, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "ARFCNs", hf_nfapi_arfcn_list, ett_nfapi_arfcn_list, num_arfcns, dissect_arfcn_dir_value);
+-	return 0;
+-}
+-
+-
+-int rssi_conversion(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, gint16 value)
+-{
+-	proto_tree_add_int_format_value(tree, hfindex, tvb, *offset, 2, value, "%.2f dB (%d)", ((float)value * 0.1), value);
+-	return 0;
+-}
+-int dissect_rssi_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_int16_with_conversion(tree, hf_nfapi_rssi, tvb, offset, rssi_conversion);
+-	return 0;
+-}
+-static int dissect_rssi_indication_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_rssi = proto_tree_add_uint16(tree, hf_nfapi_number_of_rssi, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "ARFCNs", hf_nfapi_rssi_list, ett_nfapi_rssi_list, num_rssi, dissect_rssi_value);
+-	return 0;
+-}
+-
+-int dissect_pci_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pci, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_lte_cell_search_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_earfcn, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_measurement_bandwidth, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_exhaustive_search, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, "ms");
+-	guint8 num_pci = proto_tree_add_uint8(tree, hf_nfapi_number_of_pci, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "PCIs", hf_nfapi_pci_list, ett_nfapi_pci_list, num_pci, dissect_pci_value);
+-	return 0;
+-}
+-
+-int dissect_psc_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_psc, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_utran_cell_search_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_uarfcn, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_exhaustive_search, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, "ms");
+-	guint8 num_psc = proto_tree_add_uint8(tree, hf_nfapi_number_of_psc, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "PSCs", hf_nfapi_psc_list, ett_nfapi_psc_list, num_psc, dissect_psc_value);
+-	return 0;
+-}
+-
+-int dissect_arfcn_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_arfcn, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_geran_cell_search_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, "ms");
+-	guint8 num_arfcn = proto_tree_add_uint8(tree, hf_nfapi_number_of_arfcns, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "ARFCNs", hf_nfapi_arfcn_list, ett_nfapi_arfcn_list, num_arfcn, dissect_arfcn_value);
+-	return 0;
+-}
+-
+-int neg_pow_conversion(proto_item* tree, int hfindex, tvbuff_t *tvb, guint* offset, guint8 value)
+-{
+-	proto_tree_add_uint_format_value(tree, hfindex, tvb, *offset, 1, value, "%d dB (%d)", ((gint16)value * (-1)), value);
+-	return 0;
+-}
+-
+-int dissect_lte_cell_found_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_pci, tvb, offset, 0);
+-	proto_tree_add_uint8_with_conversion(tree, hf_nfapi_rsrp, tvb, offset, neg_pow_conversion);
+-	proto_tree_add_uint8_with_conversion(tree, hf_nfapi_rsrq, tvb, offset, neg_pow_conversion);
+-	proto_tree_add_int16(tree, hf_nfapi_frequency_offset, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_lte_cell_search_indication_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_lte_cells = proto_tree_add_uint16(tree, hf_nfapi_number_of_lte_cells_found, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "LTE Cells Found", hf_nfapi_lte_cells_found_list, ett_nfapi_lte_cells_found_list, num_lte_cells, dissect_lte_cell_found_value);
+-	return 0;
+-}
+-int dissect_utran_cell_found_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_psc, tvb, offset, 0);
+-	proto_tree_add_uint8_with_conversion(tree, hf_nfapi_rscp, tvb, offset, neg_pow_conversion);
+-	proto_tree_add_uint8_with_conversion(tree, hf_nfapi_enco, tvb, offset, neg_pow_conversion);
+-	proto_tree_add_int16(tree, hf_nfapi_frequency_offset, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_utran_cell_search_indication_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_utran_cells = proto_tree_add_uint16(tree, hf_nfapi_number_of_utran_cells_found, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "UTRAN Cells Found", hf_nfapi_utran_cells_found_list, ett_nfapi_utran_cells_found_list, num_utran_cells, dissect_utran_cell_found_value);
+-	return 0;
+-}
+-
+-int dissect_geran_cell_found_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_arfcn, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_bsic, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_rxlev, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_rxqual, tvb, offset, 0);
+-	proto_tree_add_int16(tree, hf_nfapi_frequency_offset, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_sfn_offset, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_geran_cell_search_indication_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 num_geran_cells = proto_tree_add_uint16(tree, hf_nfapi_number_of_geran_cells_found, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "GERAN Cells Found", hf_nfapi_geran_cells_found_list, ett_nfapi_geran_cells_found_list, num_geran_cells, dissect_geran_cell_found_value);
+-
+-	return 0;
+-}
+-static int dissect_pnf_cell_search_state_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8_array(tree, hf_nfapi_pnf_search_state, *end - *offset, tvb, offset);
+-	return 0;
+-}
+-
+-static int dissect_pnf_cell_broadcast_state_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8_array(tree, hf_nfapi_pnf_broadcast_state, *end - *offset, tvb, offset);
+-	return 0;
+-}
+-static int dissect_lte_broadcast_detect_request_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_earfcn, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pci, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, "ms");
+-	return 0;
+-}
+-static int dissect_utran_broadcast_detect_request_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_uarfcn, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_psc, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, "ms");
+-	return 0;
+-}
+-
+-static int dissect_lte_broadcast_detect_indication_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_tx_antenna, tvb, offset, 0);
+-	guint16 mib_len = proto_tree_add_uint16(tree, hf_nfapi_mib_length, tvb, offset, 0);
+-	proto_tree_add_uint8_array(tree, hf_nfapi_mib, mib_len, tvb, offset);
+-	proto_tree_add_uint32(tree, hf_nfapi_sfn_offset, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_utran_broadcast_detect_indication_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 mib_len = proto_tree_add_uint16(tree, hf_nfapi_mib_length, tvb, offset, 0);
+-	proto_tree_add_uint8_array(tree, hf_nfapi_mib, mib_len, tvb, offset);
+-	proto_tree_add_uint32(tree, hf_nfapi_sfn_offset, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_lte_system_information_schedule_request_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_earfcn, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pci, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_downlink_channel_bandwidth, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_phich_configuration, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_tx_antenna, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_retry_count, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, 0);
+-	return 0;
+-}
+-//static int dissect_pnf_cell_broadcast_state_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-//{
+-//	return 0;
+-//}
+-static int dissect_lte_system_information_schedule_indication_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	// this needs to be SIB 1
+-	proto_tree_add_uint8_array(tree, hf_nfapi_sib1, (*end - *offset), tvb, offset);
+-	return 0;
+-}
+-
+-int dissect_si_periodicity_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_si_periodicity, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_si_index, tvb, offset, 0);
+-	return 0;
+-}
+-
+-static int dissect_lte_system_information_request_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_earfcn, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_pci, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_downlink_channel_bandwidth, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_phich_configuration, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_number_of_tx_antenna, tvb, offset, 0);
+-	guint8 si_priodicity = proto_tree_add_uint8(tree, hf_nfapi_number_of_si_periodicity, tvb, offset, 0);
+-	dissect_array_value(tvb, pinfo, tree, data, offset, end, "Number SI Periodicity", hf_nfapi_si_periodicity_list, ett_nfapi_si_periodicity_list, si_priodicity, dissect_si_periodicity_value);
+-	proto_tree_add_uint8(tree, hf_nfapi_si_window_length, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, 0);
+-
+-	return 0;
+-}
+-static int dissect_utran_system_information_request_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_uarfcn, tvb, offset, 0);
+-	proto_tree_add_uint16(tree, hf_nfapi_psc, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, 0);
+-	return 0;
+-}
+-static int dissect_geran_system_information_request_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint16(tree, hf_nfapi_arfcn, tvb, offset, 0);
+-	proto_tree_add_uint8(tree, hf_nfapi_bsic, tvb, offset, 0);
+-	proto_tree_add_uint32(tree, hf_nfapi_timeout, tvb, offset, 0);
+-	return 0;
+-}
+-//static int dissect_pnf_cell_broadcast_state_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-//{
+-//	return 0;
+-//}
+-static int dissect_lte_system_information_indication_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	proto_tree_add_uint8(tree, hf_nfapi_sib_type, tvb, offset, 0);
+-	guint16 sib_len = proto_tree_add_uint16(tree, hf_nfapi_sib_len, tvb, offset, 0);
+-	proto_tree_add_uint8_array(tree, hf_nfapi_sib, sib_len, tvb, offset);
+-	return 0;
+-}
+-static int dissect_utran_system_information_indication_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 sib_len = proto_tree_add_uint16(tree, hf_nfapi_sib_len, tvb, offset, 0);
+-	proto_tree_add_uint8_array(tree, hf_nfapi_sib, sib_len, tvb, offset);
+-	return 0;
+-}
+-static int dissect_geran_system_information_indication_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint16 si_len = proto_tree_add_uint16(tree, hf_nfapi_si_len, tvb, offset, 0);
+-	proto_tree_add_uint8_array(tree, hf_nfapi_si, si_len, tvb, offset);
+-	return 0;
+-}
+-
+-static int dissect_rx_indication_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end);
+-
+-const tlv_t tags[] =
+-{
+-	{ 0x1000, "PNF Param General", dissect_pnf_param_general_value },
+-	{ 0x1001, "PNF PHY", dissect_pnf_phy_value },
+-	{ 0x1002, "PNF RF", dissect_pnf_rf_value },
+-	{ 0x100A, "PNF PHY Rel 10", dissect_pnf_phy_rel10_value },
+-	{ 0x100B, "PNF PHY Rel 11", dissect_pnf_phy_rel11_value },
+-	{ 0x100C, "PNF PHY Rel 12", dissect_pnf_phy_rel12_value },
+-	{ 0x100D, "PNF PHY Rel 13", dissect_pnf_phy_rel13_value },
+-	{ 0x1003, "PNF PHY RF Config", dissect_pnf_phy_rf_config_value },
+-
+-	{ 0x0001, "Subframe config - Duplex Mode", dissect_duplex_mode_value },
+-	{ 0x0002, "Subframe config - PCFICH power offset TLV", dissect_pcfich_power_offset_value },
+-	{ 0x0003, "Subframe config - P-B", dissect_pb_value },
+-	{ 0x0004, "Subframe config - DL cyclic prefix type", dissect_dl_cyclic_prefix_value },
+-	{ 0x0005, "Subframe config - UL cyclic prefix type", dissect_ul_cyclic_prefix_value },
+-	{ 0x000A, "RF config - Downlink channel bandwidth", dissect_dl_channel_bandwidth_value },
+-	{ 0x000B, "RF config - Uplink channel bandwidth", dissect_ul_channel_bandwidth_value },
+-	{ 0x000C, "RF config - Reference signal power", dissect_reference_signal_power_value },
+-	{ 0x000D, "RF config - Tx antenna ports", dissect_tx_antenna_ports_value },
+-	{ 0x000E, "RF config - Rx Antenna ports", dissect_rx_antenna_ports_value },
+-	{ 0x0014, "PHICH config - PHICH resource", dissect_phich_resource_value },
+-	{ 0x0015, "PHICH config - PHICH duration", dissect_phich_duration_value },
+-	{ 0x0016, "PHICH config - PHICH power offset", dissect_phich_power_offset_value },
+-	{ 0x001E, "SCH config - Primary synchronization signal EPRE/EPRERS", dissect_psch_synch_signal_epre_eprers_value },
+-	{ 0x001F, "SCH config - Secondary synchronization signal EPRE/EPRERS", dissect_ssch_synch_signal_epre_eprers_value },
+-	{ 0x0020, "SCH config - Physical Cell Id", dissect_physical_cell_id_value },
+-	{ 0x0028, "PRACH config - Configuration index", dissect_prach_configuration_index_value },
+-	{ 0x0029, "PRACH config - Root sequence index", dissect_prach_root_sequence_index_value },
+-	{ 0x002A, "PRACH config - Zero correlation zone configuration", dissect_prach_zero_correlation_zone_configuration_value },
+-	{ 0x002B, "PRACH config - High speed flag", dissect_prach_high_speed_flag_value },
+-	{ 0x002C, "PRACH config - Frequency offset", dissect_prach_frequency_offset_value },
+-	{ 0x0032, "PUSCH config - Hopping mode", dissect_pusch_hopping_mode_value },
+-	{ 0x0033, "PUSCH config - Hopping offset", dissect_pusch_hopping_offset_value },
+-	{ 0x0034, "PUSCH config - Number of sub-bands", dissect_pusch_number_of_subbands_value },
+-	{ 0x003C, "PUCCH config - Delta PUCCH Shift", dissect_pucch_delta_pucch_shift_value },
+-	{ 0x003D, "PUCCH config - N_CQI RB", dissect_pucch_n_cqi_rb_value },
+-	{ 0x003E, "PUCCH config - N_AN CS", dissect_pucch_n_an_cs_value },
+-	{ 0x003F, "PUCCH config - N1Pucch-AN", dissect_pucch_n1_pucch_an_value },
+-	{ 0x0046, "SRS config - Bandwidth configuration", dissect_srs_bandwidth_configuration_value },
+-	{ 0x0047, "SRS config - MaxUpPTS", dissect_srs_max_uppts_value },
+-	{ 0x0048, "SRS config - SRS subframe configuration", dissect_srs_subframe_configuration_value },
+-	{ 0x0049, "SRS config - SRS AckNack SRS simultaneous transmission", dissect_srs_acknack_srs_sim_tx_value },
+-	{ 0x0050, "Uplink reference signal config - Uplink RS hopping", dissect_uplink_rs_hopping_value },
+-	{ 0x0051, "Uplink reference signal config - Group assignment (delta sequence-shift pattern)", dissect_group_assignment_value },
+-	{ 0x0052, "Uplink reference signal config - Cyclic Shift 1 for DMRS", dissect_cyclic_shift_1_for_drms_value },
+-	{ 0x005A, "TDD frame structure config - Subframe assignment", dissect_tdd_subframe_assignement_value },
+-	{ 0x005B, "TDD frame structure config - Special sub-frame patterns", dissect_tdd_subframe_patterns_value },
+-	{ 0x0064, "LAA config - ED Threshold for LBT for PDSCH", dissect_laa_ed_threashold_for_lbt_for_pdsch_value },
+-	{ 0x0065, "LAA config - ED Threshold for LBT for DRS", dissect_laa_ed_threashold_for_lbt_for_drs_value },
+-	{ 0x0066, "LAA config - PD Threshold", dissect_laa_pd_threshold_value },
+-	{ 0x0067, "LAA config - Multi carrier type", dissect_laa_multi_carrier_type_value },
+-	{ 0x0068, "LAA config - Multi carrier TX", dissect_laa_multi_carrier_tx_value },
+-	{ 0x0069, "LAA config - Multi carrier freeze ", dissect_laa_multi_carrier_freeze_value },
+-	{ 0x006A, "LAA config - Tx antenna ports for DRS", dissect_laa_tx_antenna_port_for_drs_value },
+-	{ 0x006B, "LAA config - Transmission power for DRS", dissect_laa_transmission_power_for_drs_value },
+-
+-	{ 0x0078, "eMTC config - PBCH Repetitions enable R13", dissect_emtc_pbch_repeitions_enabled_r13_value },
+-	{ 0x0079, "eMTC config - PRACH CAT-M Root sequence index", dissect_emtc_prach_cat_m_root_sequence_index_value },
+-	{ 0x007A, "eMTC config - PRACH CAT-M Zero correlation zone configuration", dissect_emtc_prach_cat_m_zero_correlation_zone_configuration_value },
+-	{ 0x007B, "eMTC config - PRACH CAT-M High speed flag", dissect_emtc_prach_cat_m_high_speed_flag_value },
+-	{ 0x007C, "eMTC config - PRACH CE level #0 Enable", dissect_emtc_prach_ce_level_0_enabled_value },
+-	{ 0x007D, "eMTC config - PRACH CE level #0 Configuration index", dissect_emtc_prach_ce_level_0_configuration_offset_value },
+-	{ 0x007E, "eMTC config - PRACH CE level #0 Frequency offset", dissect_emtc_prach_ce_level_0_frequency_offset_value },
+-	{ 0x007F, "eMTC config - PRACH CE level #0 Number of repetitions per attempt", dissect_emtc_preach_ce_level_0_num_of_repeitions_per_attempt_value },
+-	{ 0x0080, "eMTC config - CE level #0 Starting subframe periodicity", dissect_emtc_ce_level_0_starting_subframe_periodicity_value },
+-	{ 0x0081, "eMTC config - PRACH CE level #0 Hopping Enable", dissect_emtc_preach_ce_level_0_hopping_enabled_value },
+-	{ 0x0082, "eMTC config - PRACH CE level #0 Hopping Offset", dissect_emtc_preach_ce_level_0_hopping_offset_value },
+-	{ 0x0083, "eMTC config - PRACH CE level #1 Enable", dissect_emtc_prach_ce_level_1_enabled_value },
+-	{ 0x0084, "eMTC config - PRACH CE level #1 Configuration index", dissect_emtc_prach_ce_level_1_configuration_offset_value },
+-	{ 0x0085, "eMTC config - PRACH CE level #1 Frequency offset", dissect_emtc_prach_ce_level_1_frequency_offset_value },
+-	{ 0x0086, "eMTC config - PRACH CE level #1 Number of repetitions per attempt", dissect_emtc_preach_ce_level_1_num_of_repeitions_per_attempt_value },
+-	{ 0x0087, "eMTC config - CE level #1 Starting subframe periodicity", dissect_emtc_ce_level_1_starting_subframe_periodicity_value },
+-	{ 0x0088, "eMTC config - PRACH CE level #1 Hopping Enable", dissect_emtc_preach_ce_level_1_hopping_enabled_value },
+-	{ 0x0089, "eMTC config - PRACH CE level #1 Hopping Offset", dissect_emtc_preach_ce_level_1_hopping_offset_value },
+-	{ 0x008A, "eMTC config - PRACH CE level #2 Enable", dissect_emtc_prach_ce_level_2_enabled_value },
+-	{ 0x008B, "eMTC config - PRACH CE level #2 Configuration index", dissect_emtc_prach_ce_level_2_configuration_offset_value },
+-	{ 0x008C, "eMTC config - PRACH CE level #2 Frequency offset", dissect_emtc_prach_ce_level_2_frequency_offset_value },
+-	{ 0x008D, "eMTC config - PRACH CE level #2 Number of repetitions per attempt", dissect_emtc_preach_ce_level_2_num_of_repeitions_per_attempt_value },
+-	{ 0x008E, "eMTC config - CE level #2 Starting subframe periodicity", dissect_emtc_ce_level_2_starting_subframe_periodicity_value },
+-	{ 0x008F, "eMTC config - PRACH CE level #2 Hopping Enable", dissect_emtc_preach_ce_level_2_hopping_enabled_value },
+-	{ 0x0090, "eMTC config - PRACH CE level #2 Hopping Offset", dissect_emtc_preach_ce_level_2_hopping_offset_value },
+-	{ 0x0091, "eMTC config - PRACH CE level #3 Enable", dissect_emtc_prach_ce_level_3_enabled_value },
+-	{ 0x0092, "eMTC config - PRACH CE level #3 Configuration index", dissect_emtc_prach_ce_level_3_configuration_offset_value },
+-	{ 0x0093, "eMTC config - PRACH CE level #3 Frequency offset", dissect_emtc_prach_ce_level_3_frequency_offset_value },
+-	{ 0x0094, "eMTC config - PRACH CE level #3 Number of repetitions per attempt", dissect_emtc_preach_ce_level_3_num_of_repeitions_per_attempt_value },
+-	{ 0x0095, "eMTC config - CE level #3 Starting subframe periodicity", dissect_emtc_ce_level_3_starting_subframe_periodicity_value },
+-	{ 0x0096, "eMTC config - PRACH CE level #3 Hopping Enable", dissect_emtc_preach_ce_level_3_hopping_enabled_value },
+-	{ 0x0097, "eMTC config - PRACH CE level #3 Hopping Offset", dissect_emtc_preach_ce_level_3_hopping_offset_value },
+-	{ 0x0098, "eMTC config - PUCCH Interval - ULHoppingConfigCommonModeA", dissect_emtc_pucch_interval_ul_hopping_config_common_mode_a_value },
+-	{ 0x0099, "eMTC config - PUCCH Interval - ULHoppingConfigCommonModeB", dissect_emtc_pucch_interval_ul_hopping_config_common_mode_b_value },
+-	
+-	{ 0x00C8, "Layer 2/3 - Downlink Bandwidth Support", dissect_dl_bandwidth_support_value },
+-	{ 0x00C9, "Layer 2/3 - Uplink Bandwidth Support", dissect_ul_bandwidth_support_value },
+-	{ 0x00CA, "Layer 2/3 - Downlink modulation support", dissect_dl_modulation_value },
+-	{ 0x00CB, "Layer 2/3 - Uplink modulation support", dissect_ul_modulation_value },
+-	{ 0x00CC, "Layer 2/3 - PHY antenna capability", dissect_phy_antenna_capability_value },
+-	{ 0x00CD, "Layer 2/3 - Release capability", dissect_release_capability_value },
+-	{ 0x00CE, "Layer 2/3 - MBSFN capability", dissect_mbsfn_value },
+-
+-	{ 0x00D1, "LAA Capability - LAA support", dissect_laa_support_value },
+-	{ 0x00D1, "LAA Capability - PD sensing LBT support", dissect_laa_pd_sensing_lbt_support_value },
+-	{ 0x00D1, "LAA Capability - Multi carrier LBT support", dissect_laa_multi_carrier_lbt_support_value },
+-	{ 0x00D1, "LAA Capability - Partial SF support", dissect_laa_partial_sf_support_value },
+-
+-	{ 0x00F0, "Layer 2/3 - Data report mode", dissect_data_report_mode_value },
+-	{ 0x00F1, "Layer 2/3 - SFN/SF", dissect_sfn_sf_value },
+-	{ 0x00FA, "Layer 1 - PHY state", dissect_phy_state_value },
+-
+-	{ 0x0100, "NFAPI - P7 VNF Address IPv4", dissect_p7_vnf_address_ipv4_value },
+-	{ 0x0101, "NFAPI - P7 VNF Address IPv4", dissect_p7_vnf_address_ipv6_value },
+-	{ 0x0102, "NFAPI - P7 Port", dissect_p7_vnf_port_value },
+-	{ 0x0103, "NFAPI - P7 PNF Address IPv4", dissect_p7_pnf_address_ipv4_value },
+-	{ 0x0104, "NFAPI - P7 PNF Address IPv4", dissect_p7_pnf_address_ipv6_value },
+-	{ 0x0105, "NFAPI - P7 Port", dissect_p7_pnf_port_value },
+-	{ 0x010A, "NFAPI - Downlink UEs per Subframe", dissect_downlink_ues_per_subframe_value },
+-	{ 0x010B, "NFAPI - Uplink UEs per Subframe", dissect_uplink_ues_per_subframe_value },
+-
+-	{ 0x0114, "NFAPI - nFAPI RF Bands", dissect_rf_bands_value },
+-
+-	{ 0x011E, "NFAPI - Timing window", dissect_timing_window_value },
+-	{ 0x011F, "NFAPI - Timing info mode", dissect_timing_info_mode_value },
+-	{ 0x0120, "NFAPI - Timing info period", dissect_timing_info_period_value },
+-	{ 0x0128, "NFAPI - Maximum Transmit Power", dissect_maximum_transmit_power_value },
+-	{ 0x0129, "NFAPI - EARFCN", dissect_earfcn_value },
+-	{ 0x0130, "NFAPI - NMM GSM Frequency Bands", dissect_nmm_gsm_frequency_bands_value },
+-	{ 0x0131, "NFAPI - NMM UMTS Frequency Bands", dissect_nmm_umts_frequency_bands_value },
+-	{ 0x0132, "NFAPI - NMM LTE Frequency Bands", dissect_nmm_lte_frequency_bands_value },
+-	{ 0x0133, "NFAPI - NMM Uplink RSSI supported", dissect_nmm_uplink_rssi_supported_value },
+-
+-	{ 0x2000, "DL Config Request Body", dissect_dl_config_request_body_value },
+-
+-	{ 0x2001, "DL DCI PDU Release 8", dissect_dl_config_request_dl_dci_pdu_rel8_value },
+-	{ 0x2002, "DL DCI PDU Release 9", dissect_dl_config_request_dl_dci_pdu_rel9_value },
+-	{ 0x2003, "DL DCI PDU Release 10", dissect_dl_config_request_dl_dci_pdu_rel10_value },
+-	{ 0x2039, "DL DCI PDU Release 11", dissect_dl_config_request_dl_dci_pdu_rel11_value },
+-	{ 0x203A, "DL DCI PDU Release 12", dissect_dl_config_request_dl_dci_pdu_rel12_value },
+-	{ 0x203B, "DL DCI PDU Release 13", dissect_dl_config_request_dl_dci_pdu_rel13_value },
+-
+-
+-	{ 0x2004, "BCH PDU Release 8", dissect_dl_config_request_bch_pdu_rel8_value },
+-
+-	{ 0x2005, "MCH PDU Release 8", dissect_dl_config_request_mch_pdu_rel8_value },
+-
+-	{ 0x2006, "DLSCH PDU Release 8", dissect_dl_config_request_dlsch_pdu_rel8_value },
+-	{ 0x2007, "DLSCH PDU Release 9", dissect_dl_config_request_dlsch_pdu_rel9_value },
+-	{ 0x2008, "DLSCH PDU Release 10", dissect_dl_config_request_dlsch_pdu_rel10_value },
+-	{ 0x203C, "DLSCH PDU Release 11", dissect_dl_config_request_dlsch_pdu_rel11_value },
+-	{ 0x203D, "DLSCH PDU Release 12", dissect_dl_config_request_dlsch_pdu_rel12_value },
+-	{ 0x203E, "DLSCH PDU Release 13", dissect_dl_config_request_dlsch_pdu_rel13_value },
+-
+-	{ 0x2009, "PCH PDU Release 8", dissect_dl_config_request_pch_pdu_rel8_value },
+-	{ 0x203F, "PCH PDU Release 13", dissect_dl_config_request_pch_pdu_rel13_value },
+-
+-	{ 0x200A, "PRS PDU Release 9", dissect_dl_config_request_prs_pdu_rel9_value },
+-
+-	{ 0x200B, "CSI-RS PDU Release 10", dissect_dl_config_request_csi_rs_pdu_rel10_value },
+-	{ 0x2040, "CSI-RS PDU Release 13", dissect_dl_config_request_csi_rs_pdu_rel13_value },
+-
+-	//{ 0x2001, "EDPCCH PDU Release 8", ?? },
+-	//{ 0x2002, "EDPCCH PDU Release 8", ?? },
+-	//{ 0x2003, "EDPCCH PDU Release 8", ?? },
+-	//{ 0x2039, "EDPCCH PDU Release 11", ?? },
+-	//{ 0x203A, "EDPCCH PDU Release 12", ?? },
+-	//{ 0x203B, "EDPCCH PDU Release 13", ?? },
+-	{ 0x2041, "EDPCCH PDU Release 11 Parameters", dissect_dl_config_request_edpcch_params_rel11_value },
+-	{ 0x2042, "EDPCCH PDU Release 13 Parameters", dissect_dl_config_request_edpcch_params_rel13_value },
+-
+-	{ 0x205B, "MPDCCH PDU Release 13", dissect_dl_config_request_mpdpcch_pdu_rel13_value },
+-
+-
+-	{ 0x200C, "UL Config Request Body", dissect_ul_config_request_body_value },
+-	{ 0x200D, "ULSCH PDU Release 8", dissect_ul_config_ulsch_pdu_rel8_value },
+-	{ 0x200E, "ULSCH PDU Release 10", dissect_ul_config_ulsch_pdu_rel10_value },
+-	{ 0x2043, "ULSCH PDU Release 11", dissect_ul_config_ulsch_pdu_rel11_value },
+-	{ 0x2044, "ULSCH PDU Release 13", dissect_ul_config_ulsch_pdu_rel13_value },
+-	{ 0x200F, "Initial Transmission Paramters Release 8", dissect_ul_config_init_tx_params_rel8_value },
+-	{ 0x2010, "CQI RI Information Release 8", dissect_ul_config_cqi_ri_info_rel8_value },
+-	{ 0x2011, "CQI RI Information Release 9 or later", dissect_ul_config_cqi_ri_info_rel9_later_value },
+-	{ 0x2045, "CQI RI Information Release 13", dissect_ul_config_cqi_ri_info_rel13_value },
+-	{ 0x2012, "HARQ Information (ULSCH) Release 10", dissect_ul_config_harq_info_ulsch_rel10_value },
+-	{ 0x2046, "HARQ Information (ULSCH) Release 13", dissect_ul_config_harq_info_ulsch_rel13_value },
+-	{ 0x2013, "UE Information Release 8", dissect_ul_config_ue_info_rel8_value },
+-	{ 0x2047, "UE Information Release 11", dissect_ul_config_ue_info_rel11_value },
+-	{ 0x2048, "UE Information Release 13", dissect_ul_config_ue_info_rel13_value },
+-	{ 0x2014, "CQI Information Release 8", dissect_ul_config_cqi_info_rel8_value },
+-	{ 0x2015, "CQI Information Release 10", dissect_ul_config_cqi_info_rel10_value },
+-	{ 0x2049, "CQI Information Release 13", dissect_ul_config_cqi_info_rel13_value },
+-	{ 0x2016, "SR Information Release 8", dissect_ul_config_sr_info_rel8_value },
+-	{ 0x2017, "SR Information Release 10", dissect_ul_config_sr_info_rel10_value },
+-	{ 0x2018, "HARQ Information (UCI) Release 10 TDD", dissect_ul_config_harq_info_uci_rel10_tdd_value },
+-	{ 0x2019, "HARQ Information (UCI) Release 8 FDD", dissect_ul_config_harq_info_uci_rel8_fdd_value },
+-	{ 0x201A, "HARQ Information (UCI) Release 9 or later FDD", dissect_ul_config_harq_info_uci_rel9_later_fdd_value },
+-	{ 0x204A, "HARQ Information (UCI) Release 11 FDD/TDD", dissect_ul_config_harq_info_uci_rel11_fdd_tdd_value },
+-	{ 0x204B, "HARQ Information (UCI) Release 13 FDD/TDD", dissect_ul_config_harq_info_uci_rel13_fdd_tdd_value },
+-	{ 0x201B, "SRS Information Release 8", dissect_ul_config_srs_info_rel8_value },
+-	{ 0x201C, "SRS Information Release 10", dissect_ul_config_srs_info_rel10_value },
+-	{ 0x204C, "SRS Information Release 13", dissect_ul_config_srs_info_rel13_value },
+-
+-	{ 0x201D, "HI DCI0 Request Body", dissect_hi_dci0_request_body_value },
+-	{ 0x201E, "HI PDU Release 8", dissect_hi_dci0_hi_rel8_value },
+-	{ 0x201F, "HI PDU Release 10", dissect_hi_dci0_hi_rel10_value },
+-	{ 0x2020, "DCI UL PDU Release 8", dissect_hi_dci0_dci_ul_rel8_value },
+-	{ 0x2021, "DCI UL PDU Release 10", dissect_hi_dci0_dci_ul_rel10_value },
+-	{ 0x204D, "DCI UL PDU Release 12", dissect_hi_dci0_dci_ul_rel12_value },
+-	//{ 0x2041, "EDPCCH DCI UL PDU Release 11", dissect_hi_dci0_edpcch_dci_ul_rel11_value },
+-	{ 0x204E, "MDPCCH DCI UL PDU Release 13", dissect_hi_dci0_mdpcch_dci_ul_rel13_value },
+-
+-	{ 0x2022, "Tx Request Body", dissect_tx_request_body_value },
+-
+-	{ 0x2038, "RX UE Information", dissect_rx_ue_info_value },
+-
+-	{ 0x2023, "RX Indication Body", dissect_rx_indication_body_value },
+-	{ 0x2024, "RX PDU Release 8", dissect_rx_indication_rel8_value },
+-	{ 0x2025, "RX PDU Release 9", dissect_rx_indication_rel9_value },
+-
+-	{ 0x2026, "HARQ Indication Body", dissect_harq_indication_body_value },
+-	{ 0x2027, "HARQ PDU Release 8 TDD", dissect_harq_indication_rel8_tdd_value },
+-	{ 0x2028, "HARQ PDU Release 9 or later TDD", dissect_harq_indication_rel9_later_tdd_value },
+-	{ 0x204F, "HARQ PDU Release 13 or later TDD", dissect_harq_indication_rel13_later_tdd_value },
+-	{ 0x2029, "HARQ PDU Release 8 FDD", dissect_harq_indication_rel8_fdd_value },
+-	{ 0x202A, "HARQ PDU Release 9 or later FDD", dissect_harq_indication_rel9_later_fdd_value },
+-	{ 0x2050, "HARQ PDU Release 13 or later FDD", dissect_harq_indication_rel13_later_fdd_value },
+-	{ 0x2052, "UL CQI Information", dissect_ul_cqi_information_value },
+-
+-	{ 0x202B, "CRC Indication Body", dissect_crc_indication_body_value },
+-	{ 0x202C, "CRC PDU Release 8", dissect_crc_indication_rel8_value },
+-
+-	{ 0x202D, "RX SR Indication Body", dissect_rx_sr_indication_body_value },
+-
+-	{ 0x202E, "RX CQI Indication Body", dissect_rx_cqi_indication_body_value },
+-	{ 0x202F, "CQI PDU Release 8", dissect_rx_cqi_indication_rel8_value },
+-	{ 0x2030, "CQI PDU Release 9", dissect_rx_cqi_indication_rel9_value },
+-
+-	{ 0x2031, "RACH Indication Body", dissect_rach_indication_body_value },
+-	{ 0x2032, "Preamable PDU Release 8", dissect_rach_indication_rel8_value },
+-	{ 0x2033, "Preamable PDU Release 9", dissect_rach_indication_rel9_value },
+-	{ 0x2051, "Preamable PDU Release 13", dissect_rach_indication_rel13_value },
+-
+-	{ 0x2034, "SRS Indication Body", dissect_srs_indication_body_value },
+-	{ 0x2035, "SRS PDU Release 8", dissect_srs_indication_rel8_value },
+-	{ 0x2036, "SRS PDU Release 9", dissect_srs_indication_rel9_value },
+-	{ 0x2037, "SRS PDU Release 10 TDD", dissect_srs_indication_rel10_tdd_value },
+-	{ 0x2054, "TDD Channel Measurement", dissect_tdd_channel_measuerment_value },
+-	{ 0x2053, "SRS PDU Release 11", dissect_srs_indication_rel11_value },
+-
+-
+-	{ 0x2055, "LBT DL Config Request Body", dissect_lbt_dl_config_request_body_value },
+-	{ 0x2056, "LBT PDSCH Req PDU Release 13", dissect_lbt_dl_config_request_pdsch_req_rel13_value },
+-	{ 0x2057, "LBT DRS req PDU Release 13", dissect_lbt_dl_config_request_drs_req_rel13_value },
+-
+-	{ 0x2058, "LBT DL Indication Message Body", dissect_lbt_indication_message_body_value },
+-	{ 0x2056, "LBT PDSCH Resp PDU Release 13", dissect_lbt_dl_config_request_pdsch_resp_rel13_value },
+-	{ 0x2057, "LBT DRS Resp PDU Release 13", dissect_lbt_dl_config_request_drs_resp_rel13_value },
+-
+-	{ 0x3000, "LTE RSSI Request", dissect_lte_rssi_request_value },
+-	{ 0x3001, "UTRAN RSSI Request", dissect_utran_rssi_request_value },
+-	{ 0x3002, "GERAN RSSI Request", dissect_geran_rssi_request_value },
+-	{ 0x3003, "RSSI Indication", dissect_rssi_indication_value },
+-	{ 0x3004, "LTE CELL SEARCH Request", dissect_lte_cell_search_value },
+-	{ 0x3005, "UTRAN CELL SEARCH Request", dissect_utran_cell_search_value },
+-	{ 0x3006, "GERAN CELL SEARCH Request", dissect_geran_cell_search_value },
+-	{ 0x3007, "LTE CELL SEARCH Indication", dissect_lte_cell_search_indication_value },
+-	{ 0x3008, "UTRAN CELL SEARCH Indication", dissect_utran_cell_search_indication_value },
+-	{ 0x3009, "GERAN CELL SEARCH Indication", dissect_geran_cell_search_indication_value },
+-	{ 0x300a, "PNF CELL SEARCH STATE", dissect_pnf_cell_search_state_value },
+-	{ 0x300b, "LTE BROADCAST DETECT Request", dissect_lte_broadcast_detect_request_value },
+-	{ 0x300c, "UTRAN BROADCAST DETECT Request", dissect_utran_broadcast_detect_request_value },
+-	{ 0x300d, "PNF CELL SEARCH STATE", dissect_pnf_cell_search_state_value },
+-	{ 0x300e, "LTE BROADCAST DETECT Indication", dissect_lte_broadcast_detect_indication_value },
+-	{ 0x300f, "UTRAN BROADCAST DETECT Indication", dissect_utran_broadcast_detect_indication_value },
+-	{ 0x3010, "PNF CELL BROADCAST STATE", dissect_pnf_cell_broadcast_state_value },
+-	{ 0x3011, "LTE SYSTEM INFORMATION SCHEDULE Request", dissect_lte_system_information_schedule_request_value },
+-	{ 0x3012, "PNF CELL BROADCAST STATE", dissect_pnf_cell_broadcast_state_value },
+-	{ 0x3013, "LTE SYSTEM INFORMATION SCHEDULE Indication", dissect_lte_system_information_schedule_indication_value },
+-	{ 0x3014, "LTE SYSTEM INFORMATION Request", dissect_lte_system_information_request_value },
+-	{ 0x3015, "UTRAN SYSTEM INFORMATION Request", dissect_utran_system_information_request_value },
+-	{ 0x3016, "GERAN SYSTEM INFORMATION Request", dissect_geran_system_information_request_value },
+-	{ 0x3017, "PNF CELL BROADCAST STATE", dissect_pnf_cell_broadcast_state_value },
+-	{ 0x3018, "LTE SYSTEM INFORMATION Indication", dissect_lte_system_information_indication_value },
+-	{ 0x3019, "UTRAN SYSTEM INFORMATION Indication", dissect_utran_system_information_indication_value },
+-	{ 0x301a, "GERAN SYSTEM INFORMATION Indication", dissect_geran_system_information_indication_value },
+-
+-
+-
+-
+-};
+-
+-int look_up_tlv(int tag_id)
+-{
+-	int i;
+-	int num_tags = sizeof(tags) / sizeof(tlv_t);
+-
+-	for (i = 0; i < num_tags; i++)
+-	{
+-		if (tag_id == tags[i].tag_id)
+-			return i;
+-	}
+-	return -1;
+-}
+-
+-static int dissect_tl_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset)
+-{
+-	proto_item *tl_ti = proto_tree_add_string_format(tree, hf_nfapi_tl, tvb, *offset, 4, "", "TL");
+-	proto_tree *tl_tree = proto_item_add_subtree(tl_ti, ett_nfapi_tl);
+-
+-	proto_tree_add_uint16(tl_tree, hf_nfapi_tl_tag, tvb, offset, 0);
+-	proto_tree_add_uint16(tl_tree, hf_nfapi_tl_length, tvb, offset, "bytes");
+-
+-	return 0;
+-
+-}
+-
+-static int dissect_tlv_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint len)
+-{	
+-	while (*offset < len)
+-	{
+-		guint16 tlv_id = tvb_get_guint16(tvb, *offset, ENC_NA);
+-		guint16 tlv_len = tvb_get_guint16(tvb, *offset + 2, ENC_NA);
+-
+-		int tlv_index = look_up_tlv(tlv_id);
+-
+-		char* tlv_name = tlv_index != -1 ? tags[tlv_index].name : "Unknown";
+-
+-		proto_item *tlv_ti = proto_tree_add_string_format(tree, hf_nfapi_tlv_tree, tvb, *offset, tlv_len + 4, "", tlv_name);
+-		proto_tree *tlv_tree = proto_item_add_subtree(tlv_ti, ett_nfapi_tlv_tree);
+-
+-		dissect_tl_header(tvb, pinfo, tlv_tree, data, offset);
+-
+-		if (tags[tlv_index].decode != NULL)
+-		{
+-			guint tmp = *offset;
+-			guint end = *offset + tlv_len;
+-			tags[tlv_index].decode(tvb, pinfo, tlv_tree, data, &tmp, &end);
+-			*offset += tlv_len;
+-		}
+-		else
+-		{
+-			*offset += tlv_len;
+-		}
+-	}
+-
+-	return 0;
+-}
+-
+-static int dissect_rx_indication_body_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint* end)
+-{
+-	guint number_of_pdu_addr = *offset;
+-	guint16 count = proto_tree_add_uint16(tree, hf_nfapi_number_pdus, tvb, offset, 0);
+-	//dissect_array_value(tvb, pinfo, tree, data, offset, "RX PDU List", hf_nfapi_rx_indication_pdu_list, ett_nfapi_rx_indication_pdu_list, num_pdu, dissect_rx_pdu);
+-
+-	guint16* lengths = malloc(count * 2);
+-	memset(lengths, 0, count * 2);
+-
+-	guint16 i = 0;
+-
+-	if (count > 0)
+-	{
+-		proto_item *list_ti = proto_tree_add_string_format(tree, hf_nfapi_rx_indication_pdu_list, tvb, *offset, 2, "", "RX PDU List");
+-		proto_tree *list_tree = proto_item_add_subtree(list_ti, ett_nfapi_rx_indication_pdu_list);
+-
+-		//for (i = 0; i < count; ++i)
+-		proto_tree *item_tree = 0;
+-
+-		guint pdu_end = *end;
+-		while (*offset < *end && *offset < pdu_end)
+-		{
+-
+-			guint16 tlv_id = tvb_get_guint16(tvb, *offset, ENC_NA);
+-			guint16 tlv_len = tvb_get_guint16(tvb, *offset + 2, ENC_NA);
+-
+-			if (tlv_id == 0x2038)
+-			{
+-				proto_item *item_ti = proto_tree_add_string_format(list_tree, hf_nfapi_rx_indication_pdu_list, tvb, *offset, 2, "", "[%d]", i);
+-				item_tree = proto_item_add_subtree(item_ti, ett_nfapi_rx_indication_pdu_list);
+-
+-				i++;
+-			}
+-
+-			int tlv_index = look_up_tlv(tlv_id);
+-
+-			char* tlv_name = tlv_index != -1 ? tags[tlv_index].name : "Unknown";
+-
+-			proto_item *tlv_ti = proto_tree_add_string_format(item_tree, hf_nfapi_tlv_tree, tvb, *offset, tlv_len + 4, "", tlv_name);
+-			proto_tree *tlv_tree = proto_item_add_subtree(tlv_ti, ett_nfapi_tlv_tree);
+-
+-
+-	
+-
+-			dissect_tl_header(tvb, pinfo, tlv_tree, data, offset);
+-
+-			guint tmp_offset = *offset;
+-
+-			if (tlv_id == 0x2038)
+-			{
+-				dissect_rx_ue_info_value(tvb, pinfo, tlv_tree, data, &tmp_offset, end);
+-			}
+-
+-			else if (tlv_id == 0x2024)
+-			{
+-				//int data_offset = dissect_rx_indication_rel8_value(tvb, pinfo, tlv_tree, data, &tmp_offset, end);
+-
+-				lengths[i-1] = proto_tree_add_uint16(tlv_tree, hf_nfapi_length, tvb, &tmp_offset, 0);
+-				int data_offset = proto_tree_add_uint16(tlv_tree, hf_nfapi_data_offset, tvb, &tmp_offset, 0);
+-				proto_tree_add_uint8(tlv_tree, hf_nfapi_ul_cqi, tvb, &tmp_offset, 0);
+-				proto_tree_add_uint16(tlv_tree, hf_nfapi_timing_advance, tvb, &tmp_offset, 0);
+-				
+-				if ((data_offset > 0) && (pdu_end == *end))
+-				{
+-					pdu_end = number_of_pdu_addr + data_offset;
+-				}
+-
+-			}
+-			else if (tlv_id == 0x2025)
+-			{
+-				dissect_rx_indication_rel9_value(tvb, pinfo, tlv_tree, data, &tmp_offset, end);
+-			}
+-
+-
+-			*offset += tlv_len;
+-		}
+-
+-	}
+-
+-	for (i = 0; i < count; ++i)
+-	{
+-		proto_tree_add_uint8_array(tree, hf_nfapi_pdu, lengths[i], tvb, offset);
+-	}
+-
+-	free(lengths);
+-
+-	// more to follow here ??
+-	return 0;
+-
+-}
+-
+-
+-// ----------------------------------------------------------------------------|
+-
+-
+-static int dissect_p45_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset)
+-{
+-	proto_item *p4_p5_header_ti = proto_tree_add_string_format(tree, hf_nfapi_p4_p5_message_header, tvb, *offset, NFAPI_HEADER_LENGTH, "", "P4 P5 Header");
+-	proto_tree *p4_p5_header_tree = proto_item_add_subtree(p4_p5_header_ti, ett_nfapi_p4_p5_message_header);
+-
+-	proto_tree_add_uint16(p4_p5_header_tree, hf_nfapi_p4_p5_message_header_phy_id, tvb, offset, 0);
+-	proto_tree_add_uint16(p4_p5_header_tree, hf_nfapi_p4_p5_message_header_message_id, tvb, offset, 0);
+-	proto_tree_add_uint16(p4_p5_header_tree, hf_nfapi_p4_p5_message_header_message_length, tvb, offset, 0);
+-	proto_tree_add_uint16(p4_p5_header_tree, hf_nfapi_p4_p5_message_header_spare, tvb, offset, 0);
+-
+-	return 0;
+-}
+-
+-static int dissect_p7_header_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset, guint8* m, guint8* seg, guint8* seq)
+-{
+-	proto_item *p7_header_ti = proto_tree_add_string_format(tree, hf_nfapi_p7_message_header, tvb, *offset, NFAPI_P7_HEADER_LENGTH, "", "P7 Header");
+-	proto_tree *p7_header_tree = proto_item_add_subtree(p7_header_ti, ett_nfapi_p7_message_header);
+-
+-	proto_tree_add_uint16(p7_header_tree, hf_nfapi_p7_message_header_phy_id, tvb, offset, 0);
+-	proto_tree_add_uint16(p7_header_tree, hf_nfapi_p7_message_header_message_id, tvb, offset, 0);
+-	proto_tree_add_uint16(p7_header_tree, hf_nfapi_p7_message_header_message_length, tvb, offset, "bytes");
+-
+-	// decoding bits for p7 header
+-
+-	guint8 m_seg = tvb_get_guint8(tvb, *offset);
+-	*m = (m_seg & 0x80) >> 7;
+-	*seg = m_seg & 0x7F;
+-
+-
+-	proto_tree_add_bits_item(p7_header_tree, hf_nfapi_p7_message_header_m, tvb, (*offset) * 8, 1, ENC_NA);
+-	proto_tree_add_bits_item(p7_header_tree, hf_nfapi_p7_message_header_segment, tvb, ((*offset) * 8) + 1, 7, ENC_NA);
+-	*offset += 1;
+-
+-	*seq = tvb_get_guint8(tvb, *offset);
+-	proto_tree_add_uint8(p7_header_tree, hf_nfapi_p7_message_header_sequence_number, tvb, offset, 0);
+-
+-
+-	proto_tree_add_uint32(p7_header_tree, hf_nfapi_p7_message_header_checksum, tvb, offset, 0);
+-	proto_tree_add_uint32(p7_header_tree, hf_nfapi_p7_message_header_transmit_timestamp, tvb, offset, "microseconds");
+-
+-	return 0;
+-
+-}
+-
+-
+-
+-
+-static int dissect_p7_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data, guint* offset)
+-{
+-	proto_item *p7_header_ti = proto_tree_add_string_format(tree, hf_nfapi_p7_message_header, tvb, *offset, NFAPI_P7_HEADER_LENGTH, "", "P7 Header");
+-	proto_tree *p7_header_tree = proto_item_add_subtree(p7_header_ti, ett_nfapi_p7_message_header);
+-
+-	proto_tree_add_uint16(p7_header_tree, hf_nfapi_p7_message_header_phy_id, tvb, offset, 0);
+-	proto_tree_add_uint16(p7_header_tree, hf_nfapi_p7_message_header_message_id, tvb, offset, 0);
+-	proto_tree_add_uint16(p7_header_tree, hf_nfapi_p7_message_header_message_length, tvb, offset, "bytes");
+-
+-
+-	proto_tree_add_bits_item(p7_header_tree, hf_nfapi_p7_message_header_m, tvb, (*offset) * 8, 1, ENC_NA);
+-	proto_tree_add_bits_item(p7_header_tree, hf_nfapi_p7_message_header_segment, tvb, ((*offset) * 8) + 1, 7, ENC_NA);
+-	*offset += 1;
+-
+-	proto_tree_add_uint8(p7_header_tree, hf_nfapi_p7_message_header_sequence_number, tvb, offset, 0);
+-	
+-
+-	proto_tree_add_uint32(p7_header_tree, hf_nfapi_p7_message_header_checksum, tvb, offset, 0);
+-	proto_tree_add_uint32(p7_header_tree, hf_nfapi_p7_message_header_transmit_timestamp, tvb, offset, "microseconds");
+-
+-	return 0;
+-
+-}
+-
+-static reassembly_table ul_p7_reassemble_table;
+-static reassembly_table dl_p7_reassemble_table;
+-
+-
+-
+-static int hf_msg_fragments = -1;
+-static int hf_msg_fragment = -1;
+-static int hf_msg_fragment_overlap = -1;
+-static int hf_msg_fragment_overlap_conflicts = -1;
+-static int hf_msg_fragment_multiple_tails = -1;
+-static int hf_msg_fragment_too_long_fragment = -1;
+-static int hf_msg_fragment_error = -1;
+-static int hf_msg_fragment_count = -1;
+-static int hf_msg_reassembled_in = -1;
+-static int hf_msg_reassembled_length = -1;
+-static int hf_msg_reassembled_data = -1;
+-static gint ett_msg_fragment = -1;
+-static gint ett_msg_fragments = -1;
+-
+-static const fragment_items msg_frag_items = {
+-	/* Fragment subtrees */
+-	&ett_msg_fragment,
+-	&ett_msg_fragments,
+-	/* Fragment fields */
+-	&hf_msg_fragments,
+-	&hf_msg_fragment,
+-	&hf_msg_fragment_overlap,
+-	&hf_msg_fragment_overlap_conflicts,
+-	&hf_msg_fragment_multiple_tails,
+-	&hf_msg_fragment_too_long_fragment,
+-	&hf_msg_fragment_error,
+-	&hf_msg_fragment_count,
+-	/* Reassembled in field */
+-	&hf_msg_reassembled_in,
+-	/* Reassembled length field */
+-	&hf_msg_reassembled_length,
+-	NULL,
+-	/* Tag */
+-	"Message fragments"
+-};
+-
+-static int dissect_nfapi_ul_p7(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
+-{
+-	guint8 m;
+-	guint8 seg;
+-	guint8 seq;
+-	guint offset = 0;
+-
+-	guint16 msg_id = tvb_get_guint16(tvb, 2, ENC_NA);
+-	guint16 msg_len	= tvb_get_guint16(tvb, 4, ENC_NA);
+-
+-	dissect_p7_header_new(tvb, pinfo, tree, data, &offset, &m, &seg, &seq);
+-	
+-	guint8 save_fragmented = pinfo->fragmented;
+-
+-	// not sure why I need to do this, but if I don't it does not reasses the protocol
+-	pinfo->fd->flags.visited = 0;
+-
+-	if (m == 1 || (m == 0 && seg > 0))
+-	{
+-		pinfo->fragmented = TRUE;
+-
+-		fragment_head *fd_head = fragment_add_seq_check(&ul_p7_reassemble_table, tvb, offset, pinfo, seq, NULL, seg, msg_len - offset, (m == 1));
+-
+-		guint8 reassembled = 0;
+-		if (fd_head)
+-		{
+-			tvbuff_t * new_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled UL P7", fd_head, &msg_frag_items, NULL, tree);
+-
+-			if (new_tvb)
+-			{ 
+-				// set the tvb to the new reassembled buffer.
+-				tvb = new_tvb;
+-				reassembled = 1;
+-				col_append_fstr(pinfo->cinfo, COL_INFO, "[NFAPI P7 Reassembled %d]", seg);
+-
+-				// reset the offset for the new tvb
+-				offset = 0;
+-			}
+-			else
+-			{
+-				// Is this a failure to reassemble the data
+-				return 0;
+-			}
+-		}
+-		else
+-		{
+-			// this is a segement skip the body
+-			col_append_fstr(pinfo->cinfo, COL_INFO, "[NFAPI P7 Segment %d]", seg);
+-			return 0;
+-		}
+-	}
+-		
+-	pinfo->fragmented = save_fragmented;
+-	
+-	{
+-		switch (msg_id)
+-		{
+-			//HARQ.indication
+-			case 0x85: 
+-			{
+-				proto_tree_add_uint16_with_conversion(tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-				dissect_tlv_list(tvb, pinfo, tree, data, &offset, tvb_reported_length(tvb));
+-			}
+-			break;
+-			//CRC.indication
+-			case 0x86:
+-			{
+-				proto_tree_add_uint16_with_conversion(tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-				dissect_tlv_list(tvb, pinfo, tree, data, &offset, tvb_reported_length(tvb));
+-			}
+-			break;
+-			//RX_ULSCH.indication
+-			case 0x87:
+-			{
+-				proto_tree_add_uint16_with_conversion(tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-				dissect_tlv_list(tvb, pinfo, tree, data, &offset, tvb_reported_length(tvb));
+-			}
+-			break;
+-			//RACH.indication
+-			case 0x88:
+-			{
+-				proto_tree_add_uint16_with_conversion(tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-				dissect_tlv_list(tvb, pinfo, tree, data, &offset, tvb_reported_length(tvb));
+-			}
+-			break;
+-			//SRS.indication
+-			case 0x89:
+-			{
+-				proto_tree_add_uint16_with_conversion(tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-				dissect_tlv_list(tvb, pinfo, tree, data, &offset, tvb_reported_length(tvb));
+-			}
+-			break;
+-			//RX_SR.indication
+-			case 0x8A:
+-			{
+-				proto_tree_add_uint16_with_conversion(tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-				dissect_tlv_list(tvb, pinfo, tree, data, &offset, tvb_reported_length(tvb));
+-			}
+-			break;
+-			//RX_CQI.indication
+-			case 0x8B:
+-			{
+-				proto_tree_add_uint16_with_conversion(tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-				dissect_tlv_list(tvb, pinfo, tree, data, &offset, tvb_reported_length(tvb));
+-			}
+-			break;
+-		};
+-	}
+-	
+-	return 0;
+-}
+-
+-static int dissect_nfapi_dl_p7(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
+-{
+-	guint8 m;
+-	guint8 seg;
+-	guint8 seq;
+-	guint offset = 0;
+-
+-	guint16 msg_id = tvb_get_guint16(tvb, 2, ENC_NA);
+-	guint16 msg_len = tvb_get_guint16(tvb, 4, ENC_NA);
+-
+-	dissect_p7_header_new(tvb, pinfo, tree, data, &offset, &m, &seg, &seq);
+-
+-	guint8 save_fragmented = pinfo->fragmented;
+-
+-	// not sure why I need to do this, but if I don't it does not reasses the protocol
+-	pinfo->fd->flags.visited = 0;
+-
+-	if (m == 1 || (m == 0 && seg > 0))
+-	{
+-		pinfo->fragmented = TRUE;
+-
+-		fragment_head *fd_head = fragment_add_seq_check(&dl_p7_reassemble_table, tvb, offset, pinfo, seq, NULL, seg, msg_len - offset, (m == 1));
+-
+-		guint8 reassembled = 0;
+-		if (fd_head)
+-		{
+-			tvbuff_t * new_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled DL P7", fd_head, &msg_frag_items, NULL, tree);
+-
+-			if (new_tvb)
+-			{
+-				// set the tvb to the new reassembled buffer.
+-				tvb = new_tvb;
+-				reassembled = 1;
+-				col_append_fstr(pinfo->cinfo, COL_INFO, "[NFAPI P7 Reassembled %d]", seg);
+-
+-				// reset the offset for the new tvb
+-				offset = 0;
+-			}
+-			else
+-			{
+-				// Is this a failure to reassemble the data
+-				return 0;
+-			}
+-		}
+-		else
+-		{
+-			// this is a segement skip the body
+-			col_append_fstr(pinfo->cinfo, COL_INFO, "[NFAPI P7 Segment %d]", seg);
+-			return 0;
+-		}
+-	}
+-
+-	pinfo->fragmented = save_fragmented;
+-
+-	{
+-		switch (msg_id)
+-		{
+-			// DL_CONFIG.request
+-			case 0x80:
+-			{
+-				//dissect_p7_header(tvb, pinfo, tree, data, &offset);
+-				proto_tree_add_uint16_with_conversion(tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-				dissect_tlv_list(tvb, pinfo, tree, data, &offset, tvb_reported_length(tvb));
+-				break;
+-			}
+-	
+-		};
+-	}
+-
+-	return 0;
+-}
+-
+-
+-static int dissect_nfapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
+-{
+-	col_set_str(pinfo->cinfo, COL_PROTOCOL, "NFAPI");
+-
+-	guint16 msg_id = tvb_get_guint16(tvb, 2, ENC_NA);
+-	guint16 msg_len = tvb_get_guint16(tvb, 4, ENC_NA);
+-
+-	const gchar* message_str = val_to_str_const(msg_id, message_id_vals, "Unknown");
+-
+-	col_clear(pinfo->cinfo,COL_INFO);
+-	col_append_fstr(pinfo->cinfo, COL_INFO, " %s ", message_str);
+-
+-	proto_item *msg_tree_ti = proto_tree_add_string_format(tree, hf_nfapi_message_tree,
+-															tvb, 0, msg_len,
+-															"", message_str);
+-
+-	proto_tree *msg_tree = proto_item_add_subtree(msg_tree_ti, ett_nfapi_message_tree);
+-
+-	guint offset = 0;
+-
+-
+-	switch (msg_id)
+-	{
+-		// HARQ.indication
+-		case 0x85:
+-		// CRC.indication
+-		case 0x86:
+-		// RX_ULSCH.indicatoin
+-		case 0x87:
+-		// RACH.indication
+-		case 0x88:
+-		// SRS.indication
+-		case 0x89:
+-		// RX_SR.indication
+-		case 0x8A:
+-		// RX_CQI.indication
+-		case 0x8B:
+-		{
+-			dissect_nfapi_ul_p7(tvb, pinfo, msg_tree, data);
+-		}
+-		break;
+-
+-		// DL_CONFIG.request
+-		case 0x80:
+-		{
+-			dissect_nfapi_dl_p7(tvb, pinfo, msg_tree, data);
+-			//dissect_p7_header(tvb, pinfo, msg_tree, data, &offset);
+-			//proto_tree_add_uint16_with_conversion(msg_tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-			//dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
+-		}
+-	
+-		// UL_CONFIG.request
+-		case 0x81:
+-		{
+-			dissect_p7_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint16_with_conversion(msg_tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-		}
+-		break;
+-		// HI_DCI0.request
+-		case 0x83:
+-		{
+-			dissect_p7_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint16_with_conversion(msg_tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-		}
+-		break;
+-		// TX.request
+-		case 0x84:
+-		{
+-			dissect_p7_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint16_with_conversion(msg_tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-		}
+-		break;
+-
+-		// LBT_DL_CONFIG.request
+-		case 0x8C:
+-		{
+-			dissect_p7_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint16_with_conversion(msg_tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-		}
++#define NFAPI_P7_HEADER_LENGTH 16
++
++static const unit_name_string khz_100_units_db = { " (100)khz", NULL };
++
++typedef enum{
++	NFAPI_DL_CONFIG_REQUEST_MSG_ID = 0x0080,
++	NFAPI_UL_CONFIG_REQUEST_MSG_ID,
++	NFAPI_SUBFRAME_INDICATION_MSG_ID,
++	NFAPI_HI_DCI0_REQUEST_MSG_ID,
++	NFAPI_TX_REQUEST_MSG_ID,
++	NFAPI_HARQ_INDICATION_MSG_ID,
++	NFAPI_CRC_INDICATION_MSG_ID,
++	NFAPI_RX_ULSCH_INDICATION_MSG_ID,
++	NFAPI_RACH_INDICATION_MSG_ID,
++	NFAPI_SRS_INDICATION_MSG_ID,
++	NFAPI_RX_SR_INDICATION_MSG_ID,
++	NFAPI_RX_CQI_INDICATION_MSG_ID,
++	NFAPI_LBT_DL_CONFIG_REQUEST_MSG_ID,
++	NFAPI_LBT_DL_INDICATION_MSG_ID,
++
++	NFAPI_PNF_PARAM_REQUEST_MSG_ID = 0x0100,
++	NFAPI_PNF_PARAM_RESPONSE_MSG_ID,
++	NFAPI_PNF_CONFIG_REQUEST_MSG_ID,
++	NFAPI_PNF_CONFIG_RESPONSE_MSG_ID,
++	NFAPI_PNF_START_REQUEST_MSG_ID,
++	NFAPI_PNF_START_RESPONSE_MSG_ID,
++	NFAPI_PNF_STOP_REQUEST_MSG_ID,
++	NFAPI_PNF_STOP_RESPONSE_MSG_ID,
++	NFAPI_PARAM_REQUEST_MSG_ID,
++	NFAPI_PARAM_RESPONSE_MSG_ID,
++	NFAPI_CONFIG_REQUEST_MSG_ID,
++	NFAPI_CONFIG_RESPONSE_MSG_ID,
++	NFAPI_START_REQUEST_MSG_ID,
++	NFAPI_START_RESPONSE_MSG_ID,
++	NFAPI_STOP_REQUEST_MSG_ID,
++	NFAPI_STOP_RESPONSE_MSG_ID,
++	NFAPI_MEASUREMENT_REQUEST_MSG_ID,
++	NFAPI_MEASUREMENT_RESPONSE_MSG_ID,
++
++	NFAPI_DL_NODE_SYNC_MSG_ID = 0x0180,
++	NFAPI_UL_NODE_SYNC_MSG_ID,
++	NFAPI_TIMING_INFO_MSG_ID,
++
++	NFAPI_RSSI_REQUEST_MSG_ID = 0x0200,
++	NFAPI_RSSI_RESPONSE_MSG_ID,
++	NFAPI_RSSI_INDICATION_MSG_ID,
++	NFAPI_CELL_SEARCH_REQUEST_MSG_ID,
++	NFAPI_CELL_SEARCH_RESPONSE_MSG_ID,
++	NFAPI_CELL_SEARCH_INDICATION_MSG_ID,
++	NFAPI_BROADCAST_DETECT_REQUEST_MSG_ID,
++	NFAPI_BROADCAST_DETECT_RESPONSE_MSG_ID,
++	NFAPI_BROADCAST_DETECT_INDICATION_MSG_ID,
++	NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST_MSG_ID,
++	NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE_MSG_ID,
++	NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION_MSG_ID,
++	NFAPI_SYSTEM_INFORMATION_REQUEST_MSG_ID,
++	NFAPI_SYSTEM_INFORMATION_RESPONSE_MSG_ID,
++	NFAPI_SYSTEM_INFORMATION_INDICATION_MSG_ID,
++	NFAPI_NMM_STOP_REQUEST_MSG_ID,
++	NFAPI_NMM_STOP_RESPONSE_MSG_ID,
++} nfapi_message_id_e;
++
++static const value_string nfapi_error_vals[] = {
++	{ 0x0, "MSG_OK" },
++	{ 0x1, "MSG_INVALID_STATE" },
++	{ 0x2, "MSG_INVALID_CONFIG" },
++	{ 0x3, "SFN_OUT_OF_SYNC" },
++	{ 0x4, "MSG_SUBFRAME_ERR" },
++	{ 0x5, "MSG_BCH_MISSING" },
++	{ 0x6, "MSG_BCH_MISSING" },
++	{ 0x7, "MSG_HI_ERR" },
++	{ 0x8, "MSG_TX_ERR" },
++	{ 0, NULL },
++};
++
++static const value_string nfapi_p4_error_vals[] = {
++	{ 100, "MSG_OK" },
++	{ 101, "MSG_INVALID_STATE" },
++	{ 102, "MSG_INVALID_CONFIG" },
++	{ 103, "MSG_RAT_NOT_SUPPORTED" },
++	{ 200, "MSG_NMM_STOP_OK" },
++	{ 201, "MSG_NMM_STOP_IGNORED" },
++	{ 202, "MSG_NMM_STOP_INVALID_STATE" },
++	{ 300, "MSG_PROCEDURE_COMPLETE" },
++	{ 301, "MSG_PROCEDURE_STOPPED" },
++	{ 302, "MSG_PARTIAL_RESULTS" },
++	{ 303, "MSG_TIMEOUT" },
++	{ 0, NULL },
++};
++
++static const value_string nfapi_rat_type_vals[] = {
++	{ 0, "LTE" },
++	{ 1, "UTRAN" },
++	{ 2, "GERAN" },
++	{ 0, NULL },
++};
++
++typedef enum{
++	UN_ALIGNED_SYNCHRONIZATION = 0,
++	INTERNAL_PNF_FRAME_ALIGNMENT,
++	ABSOLUTE_TIME_ALIGNED_SYNCHRONIZATION
++} nfapi_sync_mode_e;
++
++static const value_string nfapi_sync_mode_vals[] = {
++	{ UN_ALIGNED_SYNCHRONIZATION, "UN-ALIGNED SYNCHRONIZATION" },
++	{ INTERNAL_PNF_FRAME_ALIGNMENT, "INTERNAL PNF FRAME ALIGNMENT" },
++	{ ABSOLUTE_TIME_ALIGNED_SYNCHRONIZATION, "ABSOLUTE TIME ALIGNED SYNCHRONIZATION" },
++	{ 0, NULL },
++};
++
++typedef enum {
++	NONE = 0,
++	GPS,
++	GLONASS,
++	BEIDOU
++} location_mode_e;
++
++static const value_string location_mode_vals[] = {
++	{ NONE, "NONE" },
++	{ GPS, "GPS" },
++	{ GLONASS, "GLONASS" },
++	{ BEIDOU, "BeiDou" },
++	{ 0, NULL }
++};
++
++static const value_string nfapi_uplink_rs_hopping_vals[] = {
++	{ 0, "RS_NO_HOPPING" },
++	{ 1, "RS_GROUP_HOPPING" },
++	{ 2, "RS_SEQUENCE_HOPPING" },
++	{ 0, NULL }
++};
++
++static const value_string nfapi_laa_carrier_type_vals[] = {
++	{ 0, "No multi carrier support" },
++	{ 1, "Mode A1" },
++	{ 2, "Mode A12" },
++	{ 3, "Mode B1" },
++	{ 4, "Mode B2" },
++	{ 0, NULL }
++};
++
++static const value_string nfapi_mutli_carrier_lbt_support_vals[] = {
++	{ 0, "Multi carrier Mode A1" },
++	{ 1, "Multi carrier Mode A2" },
++	{ 2, "Multi carrier Mode B1" },
++	{ 3, "Multi carrier Mode B2" },
++	{ 0, NULL }
++};
++
++static const value_string nfapi_lbt_dl_req_pdu_type[] = {
++	{ 0, "LBT_PDSCH_REQ PDU" },
++	{ 1, "LBT_DRS_REQ PDU" },
++	{ 0, NULL }
++};
++
++
++static const value_string nfapi_lbt_dl_ind_pdu_type[] = {
++	{ 0, "LBT_PDSCH_RSP PDU" },
++	{ 1, "LBT_DRS_RSP PDU" },
++	{ 0, NULL }
++};
++
++static const value_string nfapi_phy_state_vals[] = {
++	{ 0, "IDLE" },
++	{ 1, "CONFIGURED" },
++	{ 2, "RUNNING" },
++	{ 0, NULL },
++};
++
++
++/* These are definitions where data 0 & 1 represent/provide a string name*/
++static const true_false_string  nfapi_csi_report_type_strname = {
++	"Periodic",
++	"Aperiodic",
++};
++
++static const true_false_string nfapi_control_type_string_name = {
++	"CQI/PMI",
++	"RI",
++};
++
++static const true_false_string cyclic_prefix_type_strname = {
++	"CP_NORMAL",
++	"CP_EXTENDED"
++};
++
++static const true_false_string support_strname = {
++	"No Support",
++	"Support"
++};
++
++static const true_false_string partial_sf_support_strname =
++{
++	"Start partial SF support",
++	"End partial SF support"
++};
++
++static const true_false_string phich_duration_strname = {
++	"PHICH_D_NORMAL",
++	"PHICH_D_EXTENDED"
++};
++
++static const true_false_string high_speed_flag_strname = {
++	"HS_UNRESTRICTED_SET",
++	"HS_RESTRICTED_SET"
++};
++
++static const true_false_string hopping_mode_strname = {
++	"HM_INTER_SF",
++	"HM_INTRA_INTER_SF"
++};
++
++static const true_false_string srs_simult_tx_strname = {
++	"No Simultaneous Transmission",
++	"Simultaneous Transmission"
++};
++
++static const true_false_string crc_flag_strname = {
++	"CRC_ERROR",
++	"CRC_CORRECT"
++};
++
++static const true_false_string hi_value_strname = {
++	"HI_ACK",
++	"HI_NACK"
++};
++
++static const true_false_string flag_tb2_strname = {
++	"HI_NOT_PRESENT",
++	"HI_PRESENT"
++};
++
++static const true_false_string nfapi_multi_carrier_tx_strname = {
++	"Mutual transmission (self-deferral support for current carrier)",
++	"Transmit on channel access win (no self-deferral)"
++};
++
++static const true_false_string nfapi_multi_carrier_freeze_strname = {
++	"Absence of other technology is not guaranteed",
++	"Absence of other technology is guaranteed"
++};
++
++static const true_false_string initial_partial_sf_strname = {
++	"Full SF",
++	"Partial SF"
++};
++
++static const true_false_string lbt_mode_strname = {
++	"Full LBT",
++	"Partial LBT"
++};
++
++static const true_false_string data_report_mode_vals = {
++	"Crc reported in CRC.indication",
++	"Crc reported in RX.indication"
++};
++
++static const true_false_string mcch_flag_string_name = {
++	"MCCH or SC-MCCH change notification field is not valid",
++	"MCCH or SC-MCCH change notification field is valid"
++};
++
++static const true_false_string cross_carrier_scheduling_flag_strname = {
++	"Carrier indicator field is not valid",
++	"Carrier indicator field is valid"
++};
++
++static const true_false_string srs_flag_strname = {
++	"SRS request field is not valid",
++	"SRS request field is valid"
++};
++static const true_false_string srs_request_strname = {
++	"SRS not requested",
++	"SRS requested"
++};
++
++static const true_false_string ul_dl_configuration_flag_strname = {
++	"UL/DL configuration field is not valid",
++	"UL/DL configuration field is valid"
++};
++
++static const true_false_string prs_cyclic_prefix_type_strname = {
++	"normal cyclic prefix",
++	"extended cyclic prefix"
++};
++
++static const true_false_string prs_muting_strname = {
++	"no muting",
++	"muting"
++};
++
++
++static const value_string nfapi_dl_config_pdu_type_vals[] = {
++	{ 0, "DL_CONFIG_DCI_DL_PDU" },
++	{ 1, "DL_CONFIG_BCH_PDU" },
++	{ 2, "DL_CONFIG_MCH_PDU" },
++	{ 3, "DL_CONFIG_DLSCH_PDU" },
++	{ 4, "DL_CONFIG_PCH_PDU" },
++	{ 5, "DL_CONFIG_PRS_PDU" },
++	{ 6, "DL_CONFIG_CSI_RS_PDU" },
++	{ 7, "DL_CONFIG_EPDCCH_DL_PDU" },
++	{ 8, "DL_CONFIG_EPDCCH_DL_PDU" },
++	{ 0, NULL }
++};
++
++static const value_string nfapi_duplex_mode_vals[] = {
++	{ 0, "TDD" },
++	{ 1, "FDD" },
++	{ 2, "HD-FDD" },
++	{ 0, NULL }
++};
++
++static const value_string modulation_vals[] = {
++	{ 2, "QPSK" },
++	{ 4, "16QAM" },
++	{ 6, "64QAM" },
++	{ 8, "256QAM" },
++	{ 0, NULL }
++};
++
++static const value_string pch_modulation_vals[] = {
++	{ 0, "QPSK" },
++	{ 0, NULL }
++};
++
++static const value_string ue_mode_vals[] = {
++	{ 0, "non LC/CE UE" },
++	{ 1, "LC/CE UE" },
++	{ 0, NULL }
++};
++
++static const value_string csi_rs_class_vals[] = {
++	{ 0, "not used" },
++	{ 1, "Class A" },
++	{ 1, "Class B" },
++	{ 0, NULL }
++};
++
++static const value_string csi_rs_cdm_type_vals[] = {
++	{ 0, "cdm 2" },
++	{ 1, "cdm 4" },
++	{ 0, NULL }
++};
++
++static const value_string antenna_ports_vals[] = {
++	{ 0, "1 antenna ports" },
++	{ 1, "2 antenna ports" },
++	{ 2, "4 antenna ports" },
++	{ 0, NULL }
++};
++
++static const value_string combs_vals[] = {
++	{ 0, "2 TC" },
++	{ 1, "4 TC" },
++	{ 0, NULL }
++};
++
++static const value_string resource_allocation_type_vals[] = {
++	{ 0, "type 0" },
++	{ 1, "type 1" },
++	{ 2, "type 2 1A/1B/1D" },
++	{ 3, "type 2 1C" },
++	{ 4, "type 2 6-1A" },
++	{ 5, "type UEModeB" },
++	{ 6, "NB index" },
++	{ 0, NULL }
++};
++
++static const value_string transmission_scheme_vals[] = {
++	{ 0, "SINGLE_ANTENNA_PORT_0" },
++	{ 1, "TX_DIVERSITY" },
++	{ 2, "LARGE_DELAY_CDD" },
++	{ 3, "CLOSED_LOOP_SPATIAL_MULTIPLEXING" },
++	{ 4, "MULTI_USER_MIMO" },
++	{ 5, "CLOSED_LOOP_RANK_1_PRECODING" },
++	{ 6, "SINGLE_ANTENNA_PORT_5" },
++	{ 7, "SINGLE_ANTENNA_PORT_7" },
++	{ 8, "SINGLE_ANTENNA_PORT_8" },
++	{ 9, "DUAL_LAYER_TX_PORT_7_AND_8" },
++	{ 10, "UP_TO_8_LAYER_TX" },
++	{ 11, "SINGLE_ANTENNA_PORT_11" },
++	{ 12, "SINGLE_ANTENNA_PORT_13" },
++	{ 13, "DUAL_LAYER_TX_PORT_11_13" },
++	{ 0, NULL }
++};
++
++static const value_string ul_transmission_scheme_vals[] = {
++	{ 0, "SINGLE_ANTENNA_PORT_10" },
++	{ 1, "CLOSED_LOOP_SPATIAL_MULTIPLEXING" },
++	{ 0, NULL },
++};
++
++static const value_string dl_dci_format_vals[] = {
++	{ 0, "1" },
++	{ 1, "1A" },
++	{ 2, "1B" },
++	{ 3, "1C" },
++	{ 4, "1D" },
++	{ 5, "2" },
++	{ 6, "2A" },
++	{ 7, "2B" },
++	{ 8, "2C" },
++	{ 9, "2D" },
++	{ 10, "6-1A" },
++	{ 11, "6-1B" },
++	{ 12, "6-2" },
++	{ 0, NULL }
++};
++
++static const value_string ul_dci_format_vals[] = {
++	{ 0, "0" },
++	{ 1, "3" },
++	{ 2, "3A" },
++	{ 3, "4" },
++	{ 4, "5" },
++	{ 0, NULL }
++};
++
++static const value_string mpdcch_ul_dci_format_vals[] = {
++	{ 1, "3" },
++	{ 2, "3A" },
++	{ 4, "6-0A" },
++	{ 5, "6-0B" },
++	{ 0, NULL }
++};
++
++
++static const value_string pa_vals[] = {
++	{ 0, "-6dB" },
++	{ 1, "-4.77dB" },
++	{ 2, "-3dB" },
++	{ 3, "-1.77dB" },
++	{ 4, "0dB" },
++	{ 5, "1dB" },
++	{ 6, "2dB" },
++	{ 7, "3dB" },
++	{ 0, NULL }
++};
++
++static const value_string transmission_mode_vals[] = {
++	{ 1, "Mode 1" },
++	{ 2, "Mode 2" },
++	{ 3, "Mode 3" },
++	{ 4, "Mode 4" },
++	{ 5, "Mode 5" },
++	{ 6, "Mode 6" },
++	{ 7, "Mode 7" },
++	{ 8, "Mode 8" },
++	{ 9, "Mode 9" },
++	{ 10, "Mode 10" },
++	{ 0, NULL }
++};
++
++static const value_string nfapi_ul_config_pdu_type_vals[] = {
++	{ 0, "ULSCH" },
++	{ 1, "ULSCH_CQI_RI" },
++	{ 2, "ULSCH_HARQ" },
++	{ 3, "ULSCH_CQI_HARQ_RI" },
++	{ 4, "UCI_CQI" },
++	{ 5, "UCI_SR" },
++	{ 6, "UCI_HARQ" },
++	{ 7, "UCI_SR_HARQ" },
++	{ 8, "UCI_CQI_HARQ" },
++	{ 9, "UCI_CQI_SR" },
++	{ 10, "UCI_CQI_SR_HARQ" },
++	{ 11, "SRS" },
++	{ 12, "HARQ_BUFFER" },
++	{ 13, "ULSCH_UCI_CSI" },
++	{ 14, "ULSCH_UCI_HARQ" },
++	{ 15, "ULSCH_CSI_UCI_HARQ" },
++	{ 0, NULL }
++};
++
++static const value_string nfapi_tdd_ack_nack_mode_vals[] = {
++	{ 0, "Bundling" },
++	{ 1, "Multiplexing" },
++	{ 2, "Format 1b with channel selection" },
++	{ 3, "Format 3" },
++	{ 4, "Format 4" },
++	{ 5, "Format 5" },
++	{ 0, NULL }
++};
++static const value_string nfapi_fdd_ack_nack_mode_vals[] = {
++	{ 0, "Format 1a/1b" },
++	{ 1, "Channel selection" },
++	{ 2, "Format 3" },
++	{ 3, "Format 4" },
++	{ 4, "Format 5" },
++	{ 0, NULL }
++};
++
++static const value_string nfapi_phich_resource_vals[] = {
++	{ 0, "PHICH_R_ONE_SIXTH " },
++	{ 1, "PHICH_R_HALF" },
++	{ 2, "PHICH_R_ONE" },
++	{ 3, "PHICH_R_TWO" },
++	{ 0, NULL }
++};
++
++static const value_string local_distributed_vals[] = {
++	{ 0, "localized" },
++	{ 1, "distributed" },
++	{ 0, NULL }
++};
++
++static const value_string transport_block_to_codeword_swap_flag_vals[] = {
++	{ 0, "no swapping" },
++	{ 1, "swapped" },
++	{ 0, NULL }
++};
++
++static const value_string ngap_vals[] = {
++	{ 0, "Ngap1" },
++	{ 1, "Ngap2" },
++	{ 0, NULL }
++};
++
++static const value_string pmi_vals[] = {
++	{ 0, "Use precoding indicated in TPMI field" },
++	{ 1, "Use precoding indicated in last PMI report on PUSCH" },
++	{ 2, "use precoding indicated in TPM field" },
++	{ 0, NULL }
++};
++
++static const value_string true_false_vals[] = {
++	{ 0, "false" },
++	{ 1, "true" },
++	{ 0, NULL }
++};
++
++static const value_string exhustive_search_vals[] = {
++	{ 0, "non-exhaustive search" },
++	{ 1, "exhaustive search" },
++	{ 0, NULL }
++};
++
++static const value_string not_used_enabled_vals[] = {
++	{ 0, "not used" },
++	{ 1, "enabled" },
++	{ 0, NULL }
++};
++
++static const value_string hopping_vals[] = {
++	{ 0, "no hopping" },
++	{ 1, "hopping enabled" },
++	{ 0, NULL }
++};
++
++
++static const value_string mpdcch_rnti_type_vals[] = {
++	{ 1, "Temporary C-RNTI" },
++	{ 2, "RA-RNTI" },
++	{ 3, "P-RNTI" },
++	{ 4, "other" },
++	{ 0, NULL }
++};
++
++static const value_string rnti_type_vals[] = {
++	{ 1, "C-RNTI" },
++	{ 2, "RA-RNTI, P-RNTI, SI-RNTI, SC-RNTI, G-RNTI" },
++	{ 3, "SPS-CRNTI" },
++	{ 0, NULL }
++};
++
++static const value_string primary_cells_type_vals[] = {
++	{ 1, "TDD" },
++	{ 2, "FDD" },
++	{ 3, "HD_FDD" },
++	{ 0, NULL }
++};
++
++static const value_string ul_rssi_supported_vals[] = {
++	{ 0, "Uplink RSSI not supported" },
++	{ 1, "Uplink RSSI supported" },
++	{ 0, NULL }
++};
++
++static const value_string nprb_vals[] = {
++	{ 0, "2" },
++	{ 1, "3" },
++	{ 0, NULL }
++};
++
++static const value_string nmm_modes_supported_vals[] =
++{
++	{ 0, "NONE" },
++	{ 1, "NMM_ONLY" },
++	{ 2, "NMM_IN_CONFIGURED_STATE" },
++	{ 3, "NMM_IN_RUNNING_STATE" },
++	{ 4, "NMM_IN_CONFIGURED_AND_RUNNING_STATE" },
++	{ 0, NULL }
++};
++
++static const value_string dlsch_re13_ue_type_vals[] = {
++	{ 0, "non LC/CE UE" },
++	{ 1, "LC/CE CEModeA UE" },
++	{ 2, "LC/CE CEModeB UE" },
++	{ 0, NULL }
++};
++
++static const value_string dlsch_re13_pdsch_payload_type_vals[] = {
++	{ 0, "PDSCH carrying SIB1-BR " },
++	{ 1, "PDSCH carrying SI message (except for SIB1-BR or PCH)" },
++	{ 2, "PDSCH carrying other" },
++	{ 0, NULL }
++};
++
++static const value_string csi_rs_flags_strname[] = {
++	{ 0, "CSI - RS parameters are not valid" },
++	{ 1, "CSI - RS parameters are valid" },
++	{ 0, NULL}
++};
++
++
++static const value_string paging_direct_indication_differtiation_flag_vals[] = {
++	{ 0, "Direct Information" },
++	{ 1, "Paging" },
++	{ 0, NULL }
++};
++
++static const value_string ul_tx_mode_vals[] = {
++	{ 0, "SISO/MIMO" },
++	{ 1, "MIMO" },
++	{ 0, NULL }
++};
++
++static const value_string n_srs_vals[] = {
++	{ 0, "No overlap" },
++	{ 1, "Overlap" },
++	{ 0, NULL }
++};
++
++static const value_string n_srs_initial_vals[] = {
++	{ 0, "Last OFDM symbol is not punctured" },
++	{ 1, "Last OFDM symbol is punctured." },
++	{ 0, NULL }
++};
++
++
++static const value_string csi_mode_vals[] = {
++	{ 0, "PUCCH format 2/2a/2b/3" },
++	{ 1, "PUCCH format 4" },
++	{ 2, "PUCCH format 5" },
++	{ 0, NULL }
++};
++
++static const value_string hi_dci0_pdu_type_vals[] = {
++	{ 0, "HI" },
++	{ 1, "DCI UL" },
++	{ 2, "EDPCCH DCI UL" },
++	{ 3, "MDPCCH DCI UL" },
++	{ 0, NULL }
++};
++
++static const value_string ue_tx_antenna_selection_vals[] = {
++	{ 0, "Not Configured" },
++	{ 1, "Configured and using UE port 0" },
++	{ 2, "Configured and using UE port 1" },
++	{ 0, NULL }
++};
++
++static const value_string size_of_cqi_csi_feild_vals[] = {
++	{ 0, "1 bit" },
++	{ 1, "2 bits" },
++	{ 2, "3 bits" },
++	{ 0, NULL }
++};
++
++static const value_string number_of_antenna_port_vals[] = {
++	{ 0, "1 antenna port" },
++	{ 1, "2 antenna ports" },
++	{ 2, "4 antenna ports" },
++	{ 0, NULL }
++};
++
++static const value_string ce_mode_vals[] = {
++	{ 1, "CEModeA" },
++	{ 2, "CEModeB" },
++	{ 0, NULL }
++};
++
++
++static const value_string csi_request_vals[] = {
++	{ 0, "Aperiodic CSI not requested" },
++	{ 1, "Aperiodic CSI requested" },
++	{ 0, NULL }
++};
++
++static const value_string tdd_harq_mode_vals[] = {
++	{ 0, "Format 1a/1b BUNDLING" },
++	{ 1, "Format 1a/1b MULTIPLEXING" },
++	{ 2, "Format 1a/1b  SPECIAL BUNDLING" },
++	{ 3, "Channel Selection" },
++	{ 4, "Format 3" },
++	{ 5, "Format 4" },
++	{ 6, "Format 5" },
++	{ 0, NULL }
++};
++
++static const value_string fdd_harq_mode_vals[] = {
++	{ 0, "Format 1a/1b" },
++	{ 1, "Channel Selection" },
++	{ 2, "Format 3" },
++	{ 3, "Format 4" },
++	{ 4, "Format 5" },
++	{ 0, NULL }
++};
++
++static const value_string harq_value_vals[] = {
++	{ 1, "ACK" },
++	{ 2, "NACK" },
++	{ 3, "ACK or NACK" },
++	{ 4, "DTX" },
++	{ 5, "ACK or DTX" },
++	{ 6, "NACK or DTX" },
++	{ 7, "ACK or NACK or DTX" },
++	{ 0, NULL }
++};
++
++
++static const value_string harq_special_value_vals[] = {
++	{ 0, "0 or None" },
++	{ 1, "1 or 4 or 7 ACKs reported" },
++	{ 2, "2 or 5 or 8 ACKs reported" },
++	{ 3, "3 or 6 or 9 ACKs reported" },
++	{ 4, "DTX (UE did not transmit anything)" },
++	{ 0, NULL }
++};
++
++static const value_string channel_vals[] = {
++	{ 0, "PUCCH" },
++	{ 1, "PUSCH" },
++	{ 0, NULL }
++};
++
++static const value_string rach_resource_type_vals[] = {
++	{ 0, "Non LC / CE RACH" },
++	{ 1, "LC / CE RACH CE level 0" },
++	{ 2, "LC / CE RACH CE level 1" },
++	{ 3, "LC / CE RACH CE level 2" },
++	{ 4, "LC / CE RACH CE level 3" },
++	{ 0, NULL }
++};
++
++static const value_string up_pts_symbol_vals[] = {
++	{ 0, "Symbol 0" },
++	{ 1, "Symbol 1" },
++	{ 0, NULL }
++};
++
++static const value_string arfcn_direction_vals[] = {
++	{ 0, "DL" },
++	{ 1, "UL" },
++	{ 0, NULL }
++};
++
++static int proto_nfapi = -1;
++
++/* These are for the subtrees */
++static gint ett_nfapi_message_tree = -1;
++static gint ett_nfapi_p4_p5_message_header = -1;
++static gint ett_nfapi_p7_message_header = -1;
++static gint ett_nfapi_tlv_tree = -1;
++static gint ett_nfapi_tl = -1;
++static gint ett_nfapi_pnf_phy = -1;
++static gint ett_nfapi_pnf_phy_rel10 = -1;
++static gint ett_nfapi_pnf_phy_rel11 = -1;
++static gint ett_nfapi_pnf_phy_rel12 = -1;
++static gint ett_nfapi_pnf_phy_rel13 = -1;
++static gint ett_nfapi_pnf_phy_rf_config = -1;
++static gint ett_nfapi_rf_bands = -1;
++static gint ett_nfapi_tx_antenna_ports = -1;
++static gint ett_nfapi_harq_ack_nack_data = -1;
++static gint ett_nfapi_harq_data = -1;
++static gint ett_nfapi_cqi_pmi_size = -1;
++static gint ett_nfapi_cc = -1;
++static gint ett_nfapi_rbs = -1;
++static gint ett_nfapi_antennas = -1;
++static gint ett_nfapi_dl_config_request_pdu_list = -1;
++static gint ett_nfapi_ul_config_request_pdu_list = -1;
++static gint ett_nfapi_hi_dci0_request_pdu_list = -1;
++static gint ett_nfapi_tx_request_pdu_list = -1;
++static gint ett_nfapi_rx_indication_pdu_list = -1;
++static gint ett_nfapi_harq_indication_pdu_list = -1;
++static gint ett_nfapi_crc_indication_pdu_list = -1;
++static gint ett_nfapi_sr_indication_pdu_list = -1;
++static gint ett_nfapi_cqi_indication_pdu_list = -1;
++static gint ett_nfapi_preamble_indication_pdu_list = -1;
++static gint ett_nfapi_srs_indication_pdu_list = -1;
++static gint ett_nfapi_lbt_dl_config_pdu_list = -1;
++static gint ett_nfapi_lbt_dl_indication_pdu_list = -1;
++static gint ett_nfapi_subbands = -1;
++static gint ett_nfapi_bf_vector_antennas = -1;
++static gint ett_nfapi_bf_vectors = -1;
++static gint ett_nfapi_csi_rs_resource_configs = -1;
++static gint ett_nfapi_csi_rs_bf_vector = -1;
++static gint ett_nfapi_epdcch_prbs = -1;
++static gint ett_nfapi_precoding = -1;
++static gint ett_nfapi_earfcn_list = -1;
++static gint ett_nfapi_uarfcn_list = -1;
++static gint ett_nfapi_arfcn_list = -1;
++static gint ett_nfapi_rssi_list = -1;
++static gint ett_nfapi_pci_list = -1;
++static gint ett_nfapi_psc_list = -1;
++static gint ett_nfapi_lte_cells_found_list = -1;
++static gint ett_nfapi_utran_cells_found_list = -1;
++static gint ett_nfapi_geran_cells_found_list = -1;
++static gint ett_nfapi_si_periodicity_list = -1;
++static gint ett_nfapi_downlink_bandwidth_support = -1;
++static gint ett_nfapi_uplink_bandwidth_support = -1;
++static gint ett_nfapi_downlink_modulation_support = -1;
++static gint ett_nfapi_uplink_modulation_support = -1;
++static gint ett_nfapi_received_interference_power_mesurement_results = -1;
++static gint ett_nfapi_release_support = -1;
++static expert_field ei_invalid_range = EI_INIT;
++static expert_field ei_invalid_tlv_length = EI_INIT;
++
++static int hf_nfapi_p4_p5_message_header_phy_id = -1;
++static int hf_nfapi_p4_p5_message_header_message_id = -1;
++static int hf_nfapi_p4_p5_message_header_message_length = -1;
++static int hf_nfapi_p4_p5_message_header_spare = -1;
++static int hf_nfapi_p7_message_header_phy_id = -1;
++static int hf_nfapi_p7_message_header_message_id = -1;
++static int hf_nfapi_p7_message_header_message_length = -1;
++static int hf_nfapi_p7_message_header_m = -1;
++static int hf_nfapi_p7_message_header_segment = -1;
++static int hf_nfapi_p7_message_header_sequence_number = -1;
++static int hf_nfapi_p7_message_header_checksum = -1;
++static int hf_nfapi_p7_message_header_transmit_timestamp = -1;
++static int hf_nfapi_tl_tag = -1;
++static int hf_nfapi_tl_length = -1;
++static int hf_nfapi_sync_mode = -1;
++static int hf_nfapi_location_mode = -1;
++static int hf_nfapi_location_coordinates = -1;
++static int hf_nfapi_location_coordinates_length = -1;
++static int hf_nfapi_dl_config_timing = -1;
++static int hf_nfapi_tx_timing = -1;
++static int hf_nfapi_ul_config_timing = -1;
++static int hf_nfapi_hi_dci0_timing = -1;
++static int hf_nfapi_maximum_number_phys = -1;
++static int hf_nfapi_maximum_total_bandwidth = -1;
++static int hf_nfapi_maximum_total_number_dl_layers = -1;
++static int hf_nfapi_maximum_total_number_ul_layers = -1;
++static int hf_nfapi_shared_bands = -1;
++static int hf_nfapi_shared_pa = -1;
++static int hf_nfapi_maximum_total_power = -1;
++static int hf_nfapi_oui = -1;
++static int hf_nfapi_pdu = -1;
++static int hf_nfapi_pnf_phy_number_phy = -1;
++static int hf_nfapi_pnf_phy_config_index = -1;
++static int hf_nfapi_number_of_rf_exclusions = -1;
++static int hf_nfapi_dl_bandwidth_support = -1;
++static int hf_nfapi_dl_bandwidth_support_6 = -1;
++static int hf_nfapi_dl_bandwidth_support_15 = -1;
++static int hf_nfapi_dl_bandwidth_support_25 = -1;
++static int hf_nfapi_dl_bandwidth_support_50 = -1;
++static int hf_nfapi_dl_bandwidth_support_75 = -1;
++static int hf_nfapi_dl_bandwidth_support_100 = -1;
++static int hf_nfapi_ul_bandwidth_support = -1;
++static int hf_nfapi_ul_bandwidth_support_6 = -1;
++static int hf_nfapi_ul_bandwidth_support_15= -1;
++static int hf_nfapi_ul_bandwidth_support_25 = -1;
++static int hf_nfapi_ul_bandwidth_support_50 = -1;
++static int hf_nfapi_ul_bandwidth_support_75 = -1;
++static int hf_nfapi_ul_bandwidth_support_100 = -1;
++static int hf_nfapi_downlink_channel_bandwidth_supported = -1;
++static int hf_nfapi_uplink_channel_bandwidth_supported = -1;
++static int hf_nfapi_number_of_dl_layers_supported = -1;
++static int hf_nfapi_number_of_ul_layers_supported = -1;
++static int hf_nfapi_maximum_3gpp_release_supported = -1;
++static int hf_nfapi_maximum_3gpp_release_supported_rel8 = -1;
++static int hf_nfapi_maximum_3gpp_release_supported_rel9 = -1;
++static int hf_nfapi_maximum_3gpp_release_supported_rel10 = -1;
++static int hf_nfapi_maximum_3gpp_release_supported_rel11 = -1;
++static int hf_nfapi_maximum_3gpp_release_supported_rel12 = -1;
++static int hf_nfapi_maximum_3gpp_release_supported_rel13 = -1;
++static int hf_nfapi_nmm_modes_supported = -1;
++static int hf_nfapi_number_of_rfs = -1;
++static int hf_nfapi_rf_config_index = -1;
++static int hf_nfapi_band = -1;
++static int hf_nfapi_maximum_transmit_power = -1;
++static int hf_nfapi_maximum_transmit_power_2 = -1;
++static int hf_nfapi_earfcn = -1;
++static int hf_nfapi_minimum_transmit_power = -1;
++static int hf_nfapi_number_of_antennas_suppported = -1;
++static int hf_nfapi_minimum_downlink_frequency = -1;
++static int hf_nfapi_maximum_downlink_frequency = -1;
++static int hf_nfapi_minimum_uplink_frequency = -1;
++static int hf_nfapi_maximum_uplink_frequency = -1;
++static int hf_nfapi_number_of_rf_bands = -1;
++static int hf_nfapi_nmm_uplink_rssi_supported = -1;
++static int hf_nfapi_phy_rf_config_info_phy_id = -1;
++static int hf_nfapi_transmission_mode7_supported = -1;
++static int hi_nfapi_transmission_mode8_supported = -1;
++static int hi_nfapi_two_antennas_ports_for_pucch = -1;
++static int hi_nfapi_transmission_mode_9_supported = -1;
++static int hi_nfapi_simultaneous_pucch_pusch = -1;
++static int hi_nfapi_four_layer_tx_with_tm3_and_tm4 = -1;
++static int hf_nfapi_epdcch_supported = -1;
++static int hi_nfapi_multi_ack_csi_reporting = -1;
++static int hi_nfapi_pucch_tx_diversity_with_channel_selection = -1;
++static int hi_nfapi_ul_comp_supported = -1;
++static int hi_nfapi_transmission_mode_5_supported = -1;
++static int hf_nfapi_csi_subframe_set = -1;
++static int hi_nfapi_enhanced_4tx_codebook = -1;
++static int hi_nfapi_drs_supported = -1;
++static int hi_nfapi_ul_64qam_supported = -1;
++static int hi_nfapi_transmission_mode_10_supported = -1;
++static int hi_nfapi_alternative_tbs_indices = -1;
++static int hf_nfapi_pucch_format_4_supported = -1;
++static int hf_nfapi_pucch_format_5_supported = -1;
++static int hf_nfapi_more_than_5_ca_supported = -1;
++static int hf_nfapi_laa_supported = -1;
++static int hf_nfapi_laa_ending_in_dwpts_supported = -1;
++static int hf_nfapi_laa_starting_in_second_slot_supported = -1;
++static int hf_nfapi_beamforming_supported = -1;
++static int hf_nfapi_csi_rs_enhancements_supported = -1;
++static int hf_nfapi_drms_enhancements_supported = -1;
++static int hf_nfapi_srs_enhancements_supported = -1;
++static int hf_nfapi_dl_rs_tx_power = -1;
++static int hf_nfapi_received_interference_power = -1;
++static int hf_nfapi_thermal_noise_power = -1;
++static int hf_nfapi_dl_rs_tx_power_measurement = -1;
++static int hf_nfapi_received_interference_power_measurement = -1;
++static int hf_nfapi_thermal_noise_power_measurement = -1;
++
++// P5 Message Structures
++static int hf_nfapi_error_code = -1;
++static int hf_nfapi_p4_error_code = -1;
++static int hf_nfapi_rat_type = -1;
++static int hf_nfapi_num_tlv = -1;
++static int hf_nfapi_phy_state = -1;
++static int hf_nfapi_phy_antenna_capability = -1;
++static int hf_nfapi_release_capability = -1;
++static int hf_nfapi_mbsfn_capability = -1;
++static int hf_nfapi_laa_capability = -1;
++static int hf_nfapi_pd_sensing_lbt_support = -1;
++static int hf_nfapi_multi_carrier_lbt_support = -1;
++static int hf_nfapi_partial_sf_support = -1;
++
++static int hf_nfapi_pnf_address_ipv4 = -1;
++static int hf_nfapi_pnf_address_ipv6 = -1;
++static int hf_nfapi_vnf_address_ipv4 = -1;
++static int hf_nfapi_vnf_address_ipv6 = -1;
++static int hf_nfapi_pnf_port = -1;
++static int hf_nfapi_vnf_port = -1;
++static int hf_nfapi_dl_ue_per_sf = -1;
++static int hf_nfapi_ul_ue_per_sf = -1;
++static int hf_nfapi_timing_window = -1;
++static int hf_nfapi_timing_info_mode = -1;
++static int hf_nfapi_timing_info_period = -1;
++static int hf_nfapi_duplex_mode = -1;
++static int hf_nfapi_pcfich_power_offset = -1;
++static int hf_nfapi_pb = -1;
++static int hf_nfapi_dl_cyclic_prefix_type = -1;
++static int hf_nfapi_ul_cyclic_prefix_type = -1;
++static int hf_nfapi_tx_antenna_ports = -1;
++static int hf_nfapi_rx_antenna_ports = -1;
++static int hf_nfapi_downlink_channel_bandwidth = -1;
++static int hf_nfapi_uplink_channel_bandwidth = -1;
++static int hf_nfapi_reference_signal_power = -1;
++static int hf_nfapi_phich_resource = -1;
++static int hf_nfapi_phich_duration = -1;
++static int hf_nfapi_phich_power_offset = -1;
++static int hf_nfapi_primary_synchronization_signal_epre_eprers = -1;
++static int hf_nfapi_secondary_synchronization_signal_epre_eprers = -1;
++static int hf_nfapi_physical_cell_id = -1;
++static int hf_nfapi_configuration_index = -1;
++static int hf_nfapi_root_sequence_index = -1;
++static int hf_nfapi_zero_correlation_zone_configuration = -1;
++static int hf_nfapi_high_speed_flag = -1;
++static int hf_nfapi_frequency_offset = -1;
++static int hf_nfapi_hopping_mode = -1;
++static int hf_nfapi_hopping_offset = -1;
++static int hf_nfapi_delta_pucch_shift = -1;
++static int hf_nfapi_n_cqi_rb = -1;
++static int hf_nfapi_n_an_cs = -1;
++static int hf_nfapi_n1_pucch_an = -1;
++static int hf_nfapi_bandwidth_configuration = -1;
++static int hf_nfapi_max_up_pts = -1;
++static int hf_nfapi_srs_subframe_configuration = -1;
++static int hf_nfapi_srs_acknack_srs_simultaneous_transmission = -1;
++static int hf_nfapi_uplink_rs_hopping = -1;
++static int hf_nfapi_group_assignment = -1;
++static int hf_nfapi_cyclic_shift_1_for_drms = -1;
++static int hf_nfapi_subframe_assignment = -1;
++static int hf_nfapi_special_subframe_patterns = -1;
++static int hf_nfapi_ed_threshold_for_lbt_for_pdsch = -1;
++static int hf_nfapi_ed_threshold_for_lbt_for_drs = -1;
++static int hf_nfapi_pd_threshold = -1;
++static int hf_nfapi_multi_carrier_type = -1;
++static int hf_nfapi_multi_carrier_tx = -1;
++static int hf_nfapi_multi_carrier_freeze = -1;
++static int hf_nfapi_tx_antenna_ports_for_drs = -1;
++static int hf_nfapi_transmission_power_for_drs = -1;
++static int hf_nfapi_pbch_repetitions_enabled_r13 = -1;
++static int hf_nfapi_prach_cat_m_root_sequence_index = -1;
++static int hf_nfapi_prach_cat_m_zero_correlation_zone_configuration = -1;
++static int hf_nfapi_prach_cat_m_high_speed_flag = -1;
++static int hf_nfapi_prach_ce_level_0_enable = -1;
++static int hf_nfapi_prach_ce_level_0_configuration_index = -1;
++static int hf_nfapi_prach_ce_level_0_frequency_offset = -1;
++static int hf_nfapi_prach_ce_level_0_number_of_repetitions_per_attempt = -1;
++static int hf_nfapi_prach_ce_level_0_starting_subframe_periodicity = -1;
++static int hf_nfapi_prach_ce_level_0_hopping_enabled = -1;
++static int hf_nfapi_prach_ce_level_0_hopping_offset = -1;
++static int hf_nfapi_prach_ce_level_1_enable = -1;
++static int hf_nfapi_prach_ce_level_1_configuration_index = -1;
++static int hf_nfapi_prach_ce_level_1_frequency_offset = -1;
++static int hf_nfapi_prach_ce_level_1_number_of_repetitions_per_attempt = -1;
++static int hf_nfapi_prach_ce_level_1_starting_subframe_periodicity = -1;
++static int hf_nfapi_prach_ce_level_1_hopping_enabled = -1;
++static int hf_nfapi_prach_ce_level_1_hopping_offset = -1;
++static int hf_nfapi_prach_ce_level_2_enable = -1;
++static int hf_nfapi_prach_ce_level_2_configuration_index = -1;
++static int hf_nfapi_prach_ce_level_2_frequency_offset = -1;
++static int hf_nfapi_prach_ce_level_2_number_of_repetitions_per_attempt = -1;
++static int hf_nfapi_prach_ce_level_2_starting_subframe_periodicity = -1;
++static int hf_nfapi_prach_ce_level_2_hopping_enabled = -1;
++static int hf_nfapi_prach_ce_level_2_hopping_offset = -1;
++static int hf_nfapi_prach_ce_level_3_enable = -1;
++static int hf_nfapi_prach_ce_level_3_configuration_index = -1;
++static int hf_nfapi_prach_ce_level_3_frequency_offset = -1;
++static int hf_nfapi_prach_ce_level_3_number_of_repetitions_per_attempt = -1;
++static int hf_nfapi_prach_ce_level_3_starting_subframe_periodicity = -1;
++static int hf_nfapi_prach_ce_level_3_hopping_enabled = -1;
++static int hf_nfapi_prach_ce_level_3_hopping_offset = -1;
++static int hf_nfapi_pucch_internal_ul_hopping_config_common_mode_b = -1;
++static int hf_nfapi_pucch_internal_ul_hopping_config_common_mode_a = -1;
++static int hf_nfapi_dl_modulation_support = -1;
++static int hf_nfapi_dl_modulation_support_qpsk = -1;
++static int hf_nfapi_dl_modulation_support_16qam = -1;
++static int hf_nfapi_dl_modulation_support_64qam = -1;
++static int hf_nfapi_dl_modulation_support_256qam = -1;
++static int hf_nfapi_ul_modulation_support = -1;
++static int hf_nfapi_ul_modulation_support_qpsk = -1;
++static int hf_nfapi_ul_modulation_support_16qam = -1;
++static int hf_nfapi_ul_modulation_support_64qam = -1;
++static int hf_nfapi_data_report_mode = -1;
++static int hf_nfapi_sfnsf = -1;
++
++// P7 Sub Structures
++static int hf_nfapi_dl_dci_format = -1;
++static int hf_nfapi_ul_dci_format = -1;
++static int hf_nfapi_mpdcch_ul_dci_format = -1;
++static int hf_nfapi_cce_idx = -1;
++static int hf_nfapi_aggregation_level = -1;
++static int hf_nfapi_mcs_1 = -1;
++static int hf_nfapi_redundancy_version_1 = -1;
++static int hf_nfapi_new_data_indicator_1 = -1;
++static int hf_nfapi_mcs_2 = -1;
++static int hf_nfapi_redundancy_version_2 = -1;
++static int hf_nfapi_new_data_indicator_2 = -1;
++static int hf_nfapi_harq_process = -1;
++static int hf_nfapi_tpmi = -1;
++static int hf_nfapi_pmi = -1;
++static int hf_nfapi_precoding_information = -1;
++static int hf_nfapi_tpc = -1;
++static int hf_nfapi_downlink_assignment_index = -1;
++static int hf_nfapi_transport_block_size_index = -1;
++static int hf_nfapi_downlink_power_offset = -1;
++static int hf_nfapi_allocate_prach_flag = -1;
++static int hf_nfapi_preamble_index = -1;
++static int hf_nfapi_prach_mask_index = -1;
++static int hf_nfapi_rnti_type = -1;
++static int hf_nfapi_mpdcch_rnti_type = -1;
++static int hf_nfapi_mcch_flag = -1;
++static int hf_nfapi_mcch_change_notification = -1;
++static int hf_nfapi_scrambling_identity = -1;
++static int hf_nfapi_cross_carrier_scheduling_flag = -1;
++static int hf_nfapi_carrier_indicator = -1;
++static int hf_nfapi_srs_flag = -1;
++static int hf_nfapi_srs_request = -1;
++static int hf_nfapi_antenna_ports_scrambling_and_layers = -1;
++static int hf_nfapi_total_dci_length_including_padding = -1;
++static int hf_nfapi_harq_ack_resource_offset = -1;
++static int hf_nfapi_pdsch_re_mapping_and_quasi_co_location_indicator = -1;
++static int hf_nfapi_primary_cell_type = -1;
++static int hf_nfapi_ul_dl_configuration_flag = -1;
++static int hf_nfapi_number_of_ul_dl_configurations = -1;
++static int hf_nfapi_ul_dl_configuration_index = -1;
++static int hf_nfapi_laa_end_partial_sf_flag = -1;
++static int hf_nfapi_laa_end_partial_sf_configuration = -1;
++static int hf_nfapi_initial_lbt_sf = -1;
++static int hf_nfapi_codebooksize_determination_r13 = -1;
++static int hf_nfapi_rel13_drms_table_flag = -1;
++static int hf_nfapi_csi_rs_resource_config = -1;
++static int hf_nfapi_csi_rs_number_of_nzp_configurations = -1;
++static int hf_nfapi_pdsch_start = -1;
++static int hf_nfapi_drms_config_flag = -1;
++static int hf_nfapi_drms_scrambling = -1;
++static int hf_nfapi_csi_config_flag = -1;
++static int hf_nfapi_csi_scrambling = -1;
++static int hf_nfapi_pdsch_re_mapping_flag = -1;
++static int hf_nfapi_pdsch_re_mapping_antenna_ports = -1;
++static int hf_nfapi_pdsch_re_mapping_freq_shift = -1;
++static int hf_nfapi_alt_cqi_table_r12 = -1;
++static int hf_nfapi_max_layers = -1;
++static int hf_nfapi_n_dl_harq = -1;
++static int hf_nfapi_dwpts_symbols = -1;
++static int hf_nfapi_ue_type = -1;
++static int hf_nfapi_pdsch_payload_type = -1;
++static int hf_nfapi_initial_transmission_sf = -1;
++static int hf_nfapi_req13_drms_table_flag = -1;
++static int hf_nfapi_prnti = -1;
++static int hf_nfapi_mcs = -1;
++static int hf_nfapi_number_of_transport_blocks = -1;
++static int hf_nfapi_ue_mode = -1;
++static int hf_prs_bandwidth = -1;
++static int hf_prs_cyclic_prefix_type = -1;
++static int hf_prs_muting = -1;
++static int hf_nfapi_csi_rs_resource_index = -1;
++static int hf_nfapi_csi_rs_class = -1;
++static int hf_nfapi_cdm_type = -1;
++static int hf_nfapi_edpcch_prb_index = -1;
++static int hf_nfapi_epdcch_resource_assignment_flag = -1;
++static int hf_nfapi_epdcch_id = -1;
++static int hf_nfapi_epdcch_start_symbol = -1;
++static int hf_nfapi_epdcch_num_prb = -1;
++static int hf_nfapi_precoding_value = -1;
++static int hf_nfapi_mpdcch_narrowband = -1;
++static int hf_nfapi_number_of_prb_pairs = -1;
++static int hf_nfapi_resource_block_assignment = -1;
++static int hf_nfapi_start_symbol = -1;
++static int hf_nfapi_ecce_index = -1;
++static int hf_nfapi_ce_mode = -1;
++static int hf_nfapi_drms_scrabmling_init = -1;
++static int hf_nfapi_pdsch_reception_levels = -1;
++static int hf_nfapi_new_data_indicator = -1;
++static int hf_nfapi_tpmi_length = -1;
++static int hf_nfapi_pmi_flag = -1;
++static int hf_nfapi_harq_resource_offset = -1;
++static int hf_nfapi_dci_subframe_repetition_number = -1;
++static int hf_nfapi_downlink_assignment_index_length = -1;
++static int hf_nfapi_starting_ce_level = -1;
++static int hf_nfapi_antenna_ports_and_scrambling_identity_flag = -1;
++static int hf_nfapi_antenna_ports_and_scrambling_identity = -1;
++static int hf_nfapi_paging_direct_indication_differentiation_flag = -1;
++static int hf_nfapi_direct_indication = -1;
++static int hf_nfapi_number_of_tx_antenna_ports = -1;
++
++// P7 Message Structures
++static int hf_nfapi_dl_node_sync_t1 = -1;
++static int hf_nfapi_dl_node_sync_delta_sfn_sf = -1;
++static int hf_nfapi_ul_node_sync_t1 = -1;
++static int hf_nfapi_ul_node_sync_t2 = -1;
++static int hf_nfapi_ul_node_sync_t3 = -1;
++static int hf_nfapi_timing_info_last_sfn_sf = -1;
++static int hf_nfapi_timing_info_time_since_last_timing_info = -1;
++static int hf_nfapi_timing_info_dl_config_jitter = -1;
++static int hf_nfapi_timing_info_tx_request_jitter = -1;
++static int hf_nfapi_timing_info_ul_config_jitter = -1;
++static int hf_nfapi_timing_info_hi_dci0_jitter = -1;
++static int hf_nfapi_timing_info_dl_config_latest_delay = -1;
++static int hf_nfapi_timing_info_tx_request_latest_delay = -1;
++static int hf_nfapi_timing_info_ul_config_latest_delay = -1;
++static int hf_nfapi_timing_info_hi_dci0_latest_delay = -1;
++static int hf_nfapi_timing_info_dl_config_earliest_arrival = -1;
++static int hf_nfapi_timing_info_tx_request_earliest_arrival = -1;
++static int hf_nfapi_timing_info_ul_config_earliest_arrival = -1;
++static int hf_nfapi_timing_info_hi_dci0_earliest_arrival = -1;
++static int hf_nfapi_sfn_sf = -1;
++static int hf_nfapi_number_pdcch_ofdm_symbols = -1;
++static int hf_nfapi_number_dci = -1;
++static int hf_nfapi_number_pdus = -1;
++static int hf_nfapi_number_pdsch_rnti = -1;
++static int hf_nfapi_transmission_power_pcfich = -1;
++static int hf_nfapi_number_of_harqs = -1;
++static int hf_nfapi_number_of_crcs = -1;
++static int hf_nfapi_number_of_srs = -1;
++static int hf_nfapi_number_of_cqi = -1;
++static int hf_nfapi_number_of_preambles = -1;
++static int hf_nfapi_number_of_srss = -1;
++static int hf_nfapi_lbt_dl_req_pdu_type = -1;
++static int hf_nfapi_lbt_dl_ind_pdu_type = -1;
++static int hf_nfapi_dl_config_pdu_type = -1;
++static int hf_nfapi_pdu_size = -1;
++static int hf_nfapi_instance_length = -1;
++static int hf_nfapi_length;
++static int hf_nfapi_pdu_index = -1;
++static int hf_nfapi_rnti = -1;
++static int hf_nfapi_resource_allocation_type = -1;
++static int hf_nfapi_virtual_resource_block_assignment_flag = -1;
++static int hf_nfapi_resource_block_coding = -1;
++static int hf_nfapi_modulation = -1;
++static int hf_nfapi_redundancy_version = -1;
++static int hf_nfapi_transport_blocks = -1;
++static int hf_nfapi_transport_block_to_codeword_swap_flag = -1;
++static int hf_nfapi_transmission_scheme = -1;
++static int hf_nfapi_ul_transmission_scheme = -1;
++static int hf_nfapi_number_of_layers = -1;
++static int hf_nfapi_number_of_subbands = -1;
++static int hf_nfapi_codebook_index = -1;
++static int hf_nfapi_ue_category_capacity = -1;
++static int hf_nfapi_pa = -1;
++static int hf_nfapi_delta_power_offset_index = -1;
++static int hf_nfapi_ngap = -1;
++static int hf_nfapi_nprb = -1;
++static int hf_nfapi_transmission_mode = -1;
++static int hf_nfapi_num_bf_prb_per_subband = -1;
++static int hf_nfapi_num_bf_vector = -1;
++static int hf_nfapi_bf_vector_subband_index = -1;
++static int hf_nfapi_bf_vector_num_antennas = -1;
++static int hf_nfapi_bf_vector_bf_value = -1;
++static int hf_nfapi_nscid = -1;
++static int hf_nfapi_csi_rs_flag = -1;
++static int hf_nfapi_csi_rs_resource_config_r10 = -1;
++static int hf_nfapi_csi_rs_zero_tx_power_resource_config_bitmap_r10 = -1;
++static int hf_nfapi_transmission_power = -1;
++static int hf_nfapi_mbsfn_area_id = -1;
++static int hf_nfapi_csi_rs_antenna_port_count_r10 = -1;
++static int hf_nfapi_ul_config_pdu_type = -1;
++static int hf_nfapi_rach_prach_frequency_resources = -1;
++static int hf_nfapi_srs_present = -1;
++static int hf_nfapi_handle = -1;
++static int hf_nfapi_pucch_index = -1;
++static int hf_nfapi_size = -1;
++static int hf_nfapi_resource_block_start = -1;
++static int hf_nfapi_number_of_resource_blocks = -1;
++static int hf_nfapi_cyclic_shift_2_for_drms = -1;
++static int hf_nfapi_frequency_hopping_enabled_flag = -1;
++static int hf_nfapi_frequency_hopping_bits = -1;
++static int hf_nfapi_new_data_indication = -1;
++static int hf_nfapi_harq_process_number = -1;
++static int hf_nfapi_ul_tx_mode = -1;
++static int hf_nfapi_current_tx_nb = -1;
++static int hf_nfapi_n_srs = -1;
++static int hf_nfapi_disable_sequence_hopping_flag = -1;
++static int hf_nfapi_dl_cqi_pmi_size_rank_1 = -1;
++static int hf_nfapi_dl_cqi_pmi_size_rank_greater_1 = -1;
++static int hf_nfapi_ri_size = -1;
++static int hf_nfapi_delta_offset_cqi = -1;
++static int hf_nfapi_delta_offset_ri = -1;
++static int hf_nfapi_harq_size = -1;
++static int hf_nfapi_delta_offset_harq = -1;
++static int hf_nfapi_tdd_ack_nack_mode = -1;
++static int hf_nfapi_fdd_ack_nack_mode = -1;
++static int hf_nfapi_n_srs_initial = -1;
++static int hf_nfapi_initial_number_of_resource_blocks = -1;
++static int hf_nfapi_dl_cqi_pmi_size = -1;
++static int hf_nfapi_report_type = -1;
++static int hf_nfapi_dl_cqi_ri_pmi_size = -1;
++static int hf_nfapi_control_type = -1;
++static int hf_nfapi_number_of_cc = -1;
++static int hf_nfapi_virtual_cell_id_enabled_flag = -1;
++static int hf_nfapi_npusch_identity = -1;
++static int hf_nfapi_ndrms_csh_identity = -1;
++static int hf_nfapi_total_number_of_repetitions = -1;
++static int hf_nfapi_repetition_number = -1;
++static int hf_nfapi_initial_sf_io = -1;
++static int hf_nfapi_empty_symbols_due_to_retunning = -1;
++static int hf_nfapi_dl_cqi_ri_pmi_size_2 = -1;
++static int hf_nfapi_npucch_identity = -1;
++static int hf_nfapi_harq_size_2 = -1;
++static int hf_nfapi_delta_offset_harq_2 = -1;
++static int hf_nfapi_empty_symbols = -1;
++static int hf_nfapi_csi_mode = -1;
++static int hf_nfapi_dl_cqi_pmi_size_2 = -1;
++static int hf_nfapi_statring_prb = -1;
++static int hf_nfapi_cdm_index = -1;
++static int hf_nfapi_nsrs = -1;
++static int hf_nfapi_num_ant_ports = -1;
++static int hf_nfapi_n_pucch_2_0 = -1;
++static int hf_nfapi_n_pucch_2_1 = -1;
++static int hf_nfapi_n_pucch_2_2 = -1;
++static int hf_nfapi_n_pucch_2_3 = -1;
++static int hf_nfapi_starting_prb = -1;
++static int hf_nfapi_antenna_port = -1;
++static int hf_nfapi_number_of_combs = -1;
++static int hf_nfapi_number_of_pucch_resource = -1;
++static int hf_nfapi_pucch_index_p1 = -1;
++static int hf_nfapi_n_pucch_1_0 = -1;
++static int hf_nfapi_n_pucch_1_1 = -1;
++static int hf_nfapi_n_pucch_1_2 = -1;
++static int hf_nfapi_n_pucch_1_3 = -1;
++static int hf_nfapi_srs_bandwidth = -1;
++static int hf_nfapi_frequency_domain_position = -1;
++static int hf_nfapi_srs_hopping_bandwidth = -1;
++static int hf_nfapi_transmission_comb = -1;
++static int hf_nfapi_i_srs = -1;
++static int hf_nfapi_sounding_reference_cyclic_shift = -1;
++static int hf_nfapi_pdu_length = -1;
++static int hf_nfapi_crc_flag = -1;
++static int hf_nfapi_number_of_hi_pdus = -1;
++static int hf_nfapi_number_of_dci_pdus = -1;
++static int hf_nfapi_hi_dci0_pdu_type = -1;
++static int hf_nfapi_hi_value = -1;
++static int hf_nfapi_i_phich = -1;
++static int hf_nfapi_flag_tb2 = -1;
++static int hf_nfapi_hi_value_2 = -1;
++static int hf_nfapi_ue_tx_antenna_selection = -1;
++static int hf_nfapi_cqi_csi_request = -1;
++static int hf_nfapi_ul_index = -1;
++static int hf_nfapi_dl_assignment_index = -1;
++static int hf_nfapi_tpc_bitmap = -1;
++static int hf_nfapi_new_data_indication_two = -1;
++static int hf_nfapi_size_of_cqi_csi_feild = -1;
++static int hf_nfapi_resource_allocation_flag = -1;
++static int hf_nfapi_number_of_antenna_ports = -1;
++static int hf_nfapi_n_ul_rb = -1;
++static int hf_nfapi_pscch_resource = -1;
++static int hf_nfapi_time_resource_pattern = -1;
++static int hf_nfapi_mpdcch_transmission_type = -1;
++static int hf_nfapi_drms_scrambling_init = -1;
++static int hf_nfapi_pusch_repetition_levels = -1;
++static int hf_nfapi_frequency_hopping_flag = -1;
++static int hf_nfapi_csi_request = -1;
++static int hf_nfapi_dai_presence_flag = -1;
++static int hf_nfapi_total_dci_length_include_padding = -1;
++static int hf_nfapi_data_offset = -1;
++static int hf_nfapi_ul_cqi = -1;
++static int hf_nfapi_timing_advance_r9 = -1;
++static int hf_nfapi_timing_advance = -1;
++static int hf_nfapi_harq_data_value_0 = -1;
++static int hf_nfapi_harq_data_value_0_special = -1;
++static int hf_nfapi_harq_data_value_1 = -1;
++static int hf_nfapi_harq_data_value_2 = -1;
++static int hf_nfapi_harq_data_value_3 = -1;
++static int hf_nfapi_tdd_harq_mode = -1;
++static int hf_nfapi_fdd_harq_mode = -1;
++static int hf_nfapi_number_of_ack_nack = -1;
++static int hf_nfapi_harq_tb_1 = -1;
++static int hf_nfapi_harq_tb_2 = -1;
++static int hf_nfapi_harq_tb_n = -1;
++static int hf_nfapi_channel = -1;
++static int hf_nfapi_ri = -1;
++static int hf_nfapi_number_of_cc_reported = -1;
++static int hf_nfapi_preamble = -1;
++static int hf_nfapi_rach_resource_type = -1;
++static int hf_nfapi_snr = -1;
++static int hf_nfapi_doppler_estimation = -1;
++static int hf_nfapi_rb_start = -1;
++static int hf_nfapi_up_pts_symbol = -1;
++static int hf_nfapi_number_prb_per_subband = -1;
++static int hf_nfapi_number_antennas = -1;
++static int hf_nfapi_subband_index = -1;
++static int hf_nfapi_channel_coefficient = -1;
++static int hf_nfapi_ul_rtoa = -1;
++static int hf_nfapi_mp_cca = -1;
++static int hf_nfapi_n_cca = -1;
++static int hf_nfapi_offset = -1;
++static int hf_nfapi_lte_txop_sf = -1;
++static int hf_nfapi_txop_sfn_sf_end = -1;
++static int hf_nfapi_lbt_mode = -1;
++static int hf_nfapi_sfn_sf_end = -1;
++static int hf_nfapi_result = -1;
++static int hf_nfapi_txop_symbols = -1;
++static int hf_nfapi_initial_partial_sf = -1;
++static int hf_nfapi_frequency_band_indicator = -1;
++static int hf_nfapi_measurement_period = -1;
++static int hf_nfapi_bandwidth = -1;
++static int hf_nfapi_timeout = -1;
++static int hf_nfapi_number_of_earfcns = -1;
++static int hf_nfapi_uarfcn = -1;
++static int hf_nfapi_number_of_uarfcns = -1;
++static int hf_nfapi_arfcn = -1;
++static int hf_nfapi_arfcn_direction = -1;
++static int hf_nfapi_number_of_arfcns = -1;
++static int hf_nfapi_rssi = -1;
++static int hf_nfapi_number_of_rssi = -1;
++static int hf_nfapi_pci = -1;
++static int hf_nfapi_measurement_bandwidth = -1;
++static int hf_nfapi_exhaustive_search = -1;
++static int hf_nfapi_number_of_pci = -1;
++static int hf_nfapi_psc = -1;
++static int hf_nfapi_number_of_psc = -1;
++static int hf_nfapi_rsrp = -1;
++static int hf_nfapi_rsrq = -1;
++static int hf_nfapi_number_of_lte_cells_found = -1;
++static int hf_nfapi_rscp = -1;
++static int hf_nfapi_enco = -1;
++static int hf_nfapi_number_of_utran_cells_found = -1;
++static int hf_nfapi_bsic = -1;
++static int hf_nfapi_rxlev = -1;
++static int hf_nfapi_rxqual = -1;
++static int hf_nfapi_sfn_offset = -1;
++static int hf_nfapi_number_of_geran_cells_found = -1;
++static int hf_nfapi_number_of_tx_antenna = -1;
++static int hf_nfapi_mib_length = -1;
++static int hf_nfapi_mib = -1;
++static int hf_nfapi_phich_configuration = -1;
++static int hf_nfapi_retry_count = -1;
++static int hf_nfapi_sib1 = -1;
++static int hf_nfapi_si_periodicity = -1;
++static int hf_nfapi_si_index = -1;
++static int hf_nfapi_number_of_si_periodicity = -1;
++static int hf_nfapi_si_window_length = -1;
++static int hf_nfapi_sib_type = -1;
++static int hf_nfapi_sib_len = -1;
++static int hf_nfapi_sib = -1;
++static int hf_nfapi_si_len = -1;
++static int hf_nfapi_si = -1;
++static int hf_nfapi_pnf_search_state = -1;
++static int hf_nfapi_pnf_broadcast_state = -1;
++
++static const value_string message_id_vals[] =
++{
++	{ NFAPI_DL_CONFIG_REQUEST_MSG_ID, "DL_CONFIG.request" },
++	{ NFAPI_UL_CONFIG_REQUEST_MSG_ID, "UL_CONFIG.request" },
++	{ NFAPI_SUBFRAME_INDICATION_MSG_ID, "SUBFRAME_INDICATION" },
++	{ NFAPI_HI_DCI0_REQUEST_MSG_ID, "HI_DCI0.request" },
++	{ NFAPI_TX_REQUEST_MSG_ID, "TX.request" },
++	{ NFAPI_HARQ_INDICATION_MSG_ID, "HARQ.indication" },
++	{ NFAPI_CRC_INDICATION_MSG_ID, "CRC.indication" },
++	{ NFAPI_RX_ULSCH_INDICATION_MSG_ID, "RX_ULSCH.indication" },
++	{ NFAPI_RACH_INDICATION_MSG_ID, "RACH.indication" },
++	{ NFAPI_SRS_INDICATION_MSG_ID, "SRS.indication" },
++	{ NFAPI_RX_SR_INDICATION_MSG_ID, "RX_SR.indication" },
++	{ NFAPI_RX_CQI_INDICATION_MSG_ID, "RX_CQI.indication" },
++	{ NFAPI_LBT_DL_CONFIG_REQUEST_MSG_ID, "LBT_DL_CONFIG.request" },
++	{ NFAPI_LBT_DL_INDICATION_MSG_ID, "LBT_DL.indication" },
++
++	{ NFAPI_PNF_PARAM_REQUEST_MSG_ID, "PNF_PARAM.request" },
++	{ NFAPI_PNF_PARAM_RESPONSE_MSG_ID, "PNF_PARAM.response" },
++	{ NFAPI_PNF_CONFIG_REQUEST_MSG_ID, "PNF_CONFIG.request" },
++	{ NFAPI_PNF_CONFIG_RESPONSE_MSG_ID, "PNF_CONFIG.response" },
++	{ NFAPI_PNF_START_REQUEST_MSG_ID, "PNF_START.request" },
++	{ NFAPI_PNF_START_RESPONSE_MSG_ID, "PNF_START.response" },
++	{ NFAPI_PNF_STOP_REQUEST_MSG_ID, "PNF_STOP.request" },
++	{ NFAPI_PNF_STOP_RESPONSE_MSG_ID, "PNF_STOP.response" },
++	{ NFAPI_PARAM_REQUEST_MSG_ID, "PARAM.request" },
++	{ NFAPI_PARAM_RESPONSE_MSG_ID, "PARAM.response" },
++	{ NFAPI_CONFIG_REQUEST_MSG_ID, "CONFIG.request" },
++	{ NFAPI_CONFIG_RESPONSE_MSG_ID, "CONFIG.response" },
++	{ NFAPI_START_REQUEST_MSG_ID, "START.request" },
++	{ NFAPI_START_RESPONSE_MSG_ID, "START.response" },
++	{ NFAPI_STOP_REQUEST_MSG_ID, "STOP.request" },
++	{ NFAPI_STOP_RESPONSE_MSG_ID, "STOP.response" },
++	{ NFAPI_MEASUREMENT_REQUEST_MSG_ID, "MEASUREMENT.request" },
++	{ NFAPI_MEASUREMENT_RESPONSE_MSG_ID, "MEASUREMENT.response" },
++
++	{ NFAPI_DL_NODE_SYNC_MSG_ID, "UL_NODE_SYNC" },
++	{ NFAPI_UL_NODE_SYNC_MSG_ID, "DL_NODE_SYNC" },
++	{ NFAPI_TIMING_INFO_MSG_ID, "TIMING_INFO" },
++
++	{ NFAPI_RSSI_REQUEST_MSG_ID, "RSSI.request" },
++	{ NFAPI_RSSI_RESPONSE_MSG_ID, "RSSI.response" },
++	{ NFAPI_RSSI_INDICATION_MSG_ID, "RSSI.indication" },
++	{ NFAPI_CELL_SEARCH_REQUEST_MSG_ID, "CELL_SEARCH.request" },
++	{ NFAPI_CELL_SEARCH_RESPONSE_MSG_ID, "CELL_SEARCH.response" },
++	{ NFAPI_CELL_SEARCH_INDICATION_MSG_ID, "CELL_SEARCH.indication" },
++	{ NFAPI_BROADCAST_DETECT_REQUEST_MSG_ID, "BROADCAST_DETECT.request" },
++	{ NFAPI_BROADCAST_DETECT_RESPONSE_MSG_ID, "BROADCAST_DETECT.response" },
++	{ NFAPI_BROADCAST_DETECT_INDICATION_MSG_ID, "BROADCAST_DETECT.indication" },
++	{ NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST_MSG_ID, "SYSTEM_INFORMATION_SCHEDULE.request" },
++	{ NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE_MSG_ID, "SYSTEM_INFORMATION_SCHEDULE.response" },
++	{ NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION_MSG_ID, "SYSTEM_INFORMATION_SCHEDULE.indication" },
++	{ NFAPI_SYSTEM_INFORMATION_REQUEST_MSG_ID, "SYSTEM_INFORMATION.request" },
++	{ NFAPI_SYSTEM_INFORMATION_RESPONSE_MSG_ID, "SYSTEM_INFORMATION.response" },
++	{ NFAPI_SYSTEM_INFORMATION_INDICATION_MSG_ID, "SYSTEM_INFORMATION.indication" },
++	{ NFAPI_NMM_STOP_REQUEST_MSG_ID, "NMM_STOP.request" },
++	{ NFAPI_NMM_STOP_RESPONSE_MSG_ID, "NMM_STOP.response" },
++
++	{ 0, NULL },
++};
++
++typedef void(*tlv_decode)(ptvcursor_t * ptvc, packet_info* pinfo);
++
++typedef struct
++{
++	guint16 tag_id;
++	char* name;
++	tlv_decode decode;
++} tlv_t;
++
++static void dissect_tlv_list(ptvcursor_t * ptvc, packet_info* pinfo, gint len);
++
++static void dissect_array_value(ptvcursor_t * ptvc, packet_info* pinfo, const char* name, guint32 ett_idx, guint32 count, tlv_decode decode)
++{
++	guint16 i = 0;
++
++	if (count > 0)
++	{
++		ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_idx, "%s", name);
++
++		for (i = 0; i < count; ++i)
++		{
++			ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_idx, "[%d]", i);
++			decode(ptvc, pinfo);
++			ptvcursor_pop_subtree(ptvc);
++		}
++
++		ptvcursor_pop_subtree(ptvc);
++	}
++}
++
++static void dissect_pnf_param_general_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// nFAPI Sync Mode
++	guint8 nfapi_sync_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_sync_mode, 1, ENC_BIG_ENDIAN);
++	if (nfapi_sync_mode_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid nfapi sync mode value [0..2]");
++	}
++
++	// Location Mode
++	guint8 location_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_location_mode, 1, ENC_BIG_ENDIAN);
++	if (location_mode_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid location mode value [0..3]");
++	}
++
++	guint16 len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_location_coordinates_length, 2, ENC_BIG_ENDIAN);
++	if (len > 0)
++		ptvcursor_add(ptvc, hf_nfapi_location_coordinates, len, ENC_NA);
++	ptvcursor_add(ptvc, hf_nfapi_dl_config_timing, 4, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_tx_timing, 4, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_ul_config_timing, 4, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_hi_dci0_timing, 4, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_maximum_number_phys, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_maximum_total_bandwidth, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_maximum_total_number_dl_layers, 1, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_maximum_total_number_ul_layers, 1, ENC_BIG_ENDIAN);
++
++	// Shared Bands
++	guint8 shared_bands_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_shared_bands, 1, ENC_BIG_ENDIAN);
++	if (shared_bands_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid shared bands value [0..1]");
++	}
++
++	// Shared PA
++	guint8 shared_pa_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_shared_pa, 1, ENC_BIG_ENDIAN);
++	if (shared_pa_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid shared pa value [0..1]");
++	}
++
++	ptvcursor_add(ptvc, hf_nfapi_maximum_total_power, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_oui, 3, ENC_HOST_ENDIAN);
++}
++static void dissect_pnf_rf_config_instance_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_rf_config_index, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_pnf_phy_instance_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_config_index, 2, ENC_BIG_ENDIAN);
++
++	guint16 num_rf_configs = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_rfs, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "RF Config List", ett_nfapi_pnf_phy, num_rf_configs, dissect_pnf_rf_config_instance_value);
++
++	guint16 num_rf_exclusions = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_rf_exclusions, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "RF Exclustion List", ett_nfapi_pnf_phy, num_rf_exclusions, dissect_pnf_rf_config_instance_value);
++
++	// Downlink Channel Bandwidth Supported
++	guint16 downlink_channel_bandwidth_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add_no_advance(ptvc, hf_nfapi_downlink_channel_bandwidth_supported, 2, ENC_BIG_ENDIAN);
++	if (downlink_channel_bandwidth_supported_value > 0x3F)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid downlink channel bandwidht supported bits [0..0x3F]");
++	}
++
++	proto_tree* dl_bw_support_tree = proto_item_add_subtree(item, ett_nfapi_downlink_bandwidth_support);
++
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_6, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 15, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_15, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 14, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_25, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 13, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_50, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 12, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_75, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 11, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_100, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 10, 1, ENC_NA);
++
++	ptvcursor_advance(ptvc, 2);
++
++
++
++	// Uplink Channel Bandwidth Supported
++	guint16 uplink_channel_bandwidth_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add_no_advance(ptvc, hf_nfapi_uplink_channel_bandwidth_supported, 2, ENC_BIG_ENDIAN);
++	if (uplink_channel_bandwidth_supported_value > 0x3F)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid uplink channel bandwidht supported bits [0..0x3F]");
++	}
++
++	proto_tree* ul_bw_support_tree = proto_item_add_subtree(item, ett_nfapi_uplink_bandwidth_support);
++
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_6, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 15, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_15, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 14, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_25, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 13, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_50, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 12, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_75, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 11, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_100, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 10, 1, ENC_NA);
++
++	ptvcursor_advance(ptvc, 2);
++
++	// Number of DL layers supported
++	guint8 number_of_dl_layer_supported_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_dl_layers_supported, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_dl_layer_supported_value == 1 || number_of_dl_layer_supported_value == 2 ||
++		  number_of_dl_layer_supported_value == 4 || number_of_dl_layer_supported_value == 8))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of dl layers supported value [1, 2, 4, 8]");
++	}
++
++	// Number of DL layers supported
++	guint8 number_of_ul_layer_supported_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_ul_layers_supported, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_ul_layer_supported_value == 1 || number_of_ul_layer_supported_value == 2 ||
++		  number_of_ul_layer_supported_value == 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ul layers supported value [1, 2, 4]");
++	}
++
++	// Maximum 3GPP Release Supported
++	guint16 maximum_3gpp_release_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add_no_advance(ptvc, hf_nfapi_maximum_3gpp_release_supported, 2, ENC_BIG_ENDIAN);
++	if (maximum_3gpp_release_supported_value > 0x3F)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid maximum 3GPP release supported value [0..0x3F]");
++	}
++
++	proto_tree* release_support_tree = proto_item_add_subtree(item, ett_nfapi_release_support);
++
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel8, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 15, 1, ENC_NA);
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel9, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 14, 1, ENC_NA);
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel10, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 13, 1, ENC_NA);
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel11, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 12, 1, ENC_NA);
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel12, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 11, 1, ENC_NA);
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel13, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 10, 1, ENC_NA);
++
++	ptvcursor_advance(ptvc, 2);
++
++
++	// NMM Modes Supported
++	guint8 nmm_modes_supported_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_nmm_modes_supported, 1, ENC_BIG_ENDIAN);
++	if (nmm_modes_supported_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid nmm modes supported value [0..3]");
++	}
++}
++
++static void dissect_pnf_phy_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 num_phy = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_number_phy, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "PHY List", ett_nfapi_pnf_phy, num_phy, dissect_pnf_phy_instance_value);
++}
++
++static void dissect_pnf_rf_config_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	ptvcursor_add(ptvc, hf_nfapi_rf_config_index, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_band, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_maximum_transmit_power, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_minimum_transmit_power, 2, ENC_BIG_ENDIAN);
++
++	guint8 number_of_antennas_supported_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_antennas_suppported, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_antennas_supported_value == 1 || number_of_antennas_supported_value == 2 ||
++		  number_of_antennas_supported_value == 4 || number_of_antennas_supported_value == 8))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of supported antennas [1, 2, 4, 8]");
++	}
++
++	ptvcursor_add(ptvc, hf_nfapi_minimum_downlink_frequency, 4, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_maximum_downlink_frequency, 4, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_minimum_uplink_frequency, 4, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_maximum_uplink_frequency, 4, ENC_BIG_ENDIAN);
++}
++
++
++static void dissect_pnf_rf_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 num_rf = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_rfs, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "RF List", ett_nfapi_pnf_phy_rf_config, num_rf, dissect_pnf_rf_config_value);
++}
++
++static void dissect_pnf_phy_rel10_instance_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// PHY Config Index
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_config_index, 2, ENC_BIG_ENDIAN);
++
++	// Transmission mode 7 supported
++	guint16 transmission_mode7_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_mode7_supported, 2, ENC_BIG_ENDIAN);
++	if (transmission_mode7_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission mode 7 supported value [0..1]");
++	}
++
++	// Two antennas ports for PUCCH
++	guint16 transmission_mode8_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_transmission_mode8_supported, 2, ENC_BIG_ENDIAN);
++	if (transmission_mode8_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission mode 8 supported value [0..1]");
++	}
++
++	// Transmission mode 8 supported
++	guint16 two_antennas_port_for_pucch_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_two_antennas_ports_for_pucch, 2, ENC_BIG_ENDIAN);
++	if (two_antennas_port_for_pucch_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid two antennas ports for pucch value [0..1]");
++	}
++
++	// Transmission mode 9 supported
++	guint16 transmission_mode9_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_transmission_mode_9_supported, 2, ENC_BIG_ENDIAN);
++	if (transmission_mode9_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission mode 9 supported value [0..1]");
++	}
++
++	// Simultaneous PUCCH PUSCH
++	guint16 simultaenous_pucch_pusch_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_simultaneous_pucch_pusch, 2, ENC_BIG_ENDIAN);
++	if (simultaenous_pucch_pusch_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid simultaneous pucch pusch supported value [0..1]");
++	}
++
++	// Four layer Tx with TM3 and TM4
++	guint16 four_layer_tx_with_tm3_and_tm4_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_four_layer_tx_with_tm3_and_tm4, 2, ENC_BIG_ENDIAN);
++	if (four_layer_tx_with_tm3_and_tm4_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid four layer tx with tm3 and tm4 value [0..1]");
++	}
++}
++
++static void dissect_pnf_phy_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 num_phy = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_number_phy, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "PHY Rel 10 List", ett_nfapi_pnf_phy_rel10, num_phy, dissect_pnf_phy_rel10_instance_value);
++}
++
++static void dissect_pnf_phy_rel11_instance_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// PHY Config Index
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_config_index, 2, ENC_BIG_ENDIAN);
++
++	// ePDCCH supported
++	guint16 epdcch_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_epdcch_supported, 2, ENC_BIG_ENDIAN);
++	if (epdcch_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid edpcch supported value [0..1]");
++	}
++
++	// Multi ACK CSI reporting
++	guint16 multi_ack_csi_reporting_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_multi_ack_csi_reporting, 2, ENC_BIG_ENDIAN);
++	if (multi_ack_csi_reporting_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid multi ack csi reporting value [0..1]");
++	}
++
++	// PUCCH Tx diversity with channel selection
++	guint16 pucch_tx_diversity_with_channel_selection_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_pucch_tx_diversity_with_channel_selection, 2, ENC_BIG_ENDIAN);
++	if (pucch_tx_diversity_with_channel_selection_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pucch tx diversity with channel selection value [0..1]");
++	}
++
++	// UL CoMP supported
++	guint16 ul_comp_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_ul_comp_supported, 2, ENC_BIG_ENDIAN);
++	if (ul_comp_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ul comp supported value [0..1]");
++	}
++
++	// Transmission mode 5 supported
++	guint16 transmission_mode_5_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_transmission_mode_5_supported, 2, ENC_BIG_ENDIAN);
++	if (transmission_mode_5_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission mode 5 supported value [0..1]");
++	}
++}
++
++static void dissect_pnf_phy_rel11_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 num_phy = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_number_phy, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "PHY Rel 11 List", ett_nfapi_pnf_phy_rel11, num_phy, dissect_pnf_phy_rel11_instance_value);
++}
++
++static void dissect_pnf_phy_rel12_instance_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// PHY Config Index
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_config_index, 2, ENC_BIG_ENDIAN);
++
++	// CSI subframe set
++	guint16 csi_subframe_set_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_subframe_set, 2, ENC_BIG_ENDIAN);
++	if (csi_subframe_set_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi subframe set value [0..1]");
++	}
++
++	// Enhanced 4TX codebook
++	guint16 enhanced_4tx_codebook_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_enhanced_4tx_codebook, 2, ENC_BIG_ENDIAN);
++	if (enhanced_4tx_codebook_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid enhanced 4TX codebook value [0..1]");
++	}
++
++	// DRS supported
++	guint16 drs_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_drs_supported, 2, ENC_BIG_ENDIAN);
++	if (drs_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid drs supported value [0..1]");
++	}
++
++	// UL 64QAM supported
++	guint16 ul_64qam_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_ul_64qam_supported, 2, ENC_BIG_ENDIAN);
++	if (ul_64qam_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ul 64 QAM supported value [0..1]");
++	}
++
++	// Transmission mode 10 supported
++	guint16 transmission_mode_10_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_transmission_mode_10_supported, 2, ENC_BIG_ENDIAN);
++	if (transmission_mode_10_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission mode 10 supported value [0..1]");
++	}
++
++	// Alternative TBS indices
++	guint16 alternative_tbs_indices_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hi_nfapi_alternative_tbs_indices, 2, ENC_BIG_ENDIAN);
++	if (alternative_tbs_indices_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid alternative tbs indicies supported value [0..1]");
++	}
++}
++
++static void dissect_pnf_phy_rel12_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 num_phy = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_number_phy, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "PHY Rel 12 List", ett_nfapi_pnf_phy_rel12, num_phy, dissect_pnf_phy_rel12_instance_value);
++}
++
++static void dissect_pnf_phy_rel13_instance_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// PHY Config Index
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_config_index, 2, ENC_BIG_ENDIAN);
++
++	// PUCCH format 4 supported
++	guint16 pucch_format_4_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pucch_format_4_supported, 2, ENC_BIG_ENDIAN);
++	if (pucch_format_4_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pucch format 4 supported value [0..1]");
++	}
++
++	// PUCCH format 5 supported
++	guint16 pucch_format_5_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pucch_format_5_supported, 2, ENC_BIG_ENDIAN);
++	if (pucch_format_5_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pucch format 5 supported value [0..1]");
++	}
++
++	// More than 5 CA support
++	guint16 more_than_5_ca_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_more_than_5_ca_supported, 2, ENC_BIG_ENDIAN);
++	if (more_than_5_ca_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid more than 5 ca supported value [0..1]");
++	}
++
++	// LAA supported
++	guint16 laa_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_laa_supported, 2, ENC_BIG_ENDIAN);
++	if (laa_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid laa supported value [0..1]");
++	}
++
++	// LAA ending in DwPTS supported
++	guint16 laa_ending_in_dwpts_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_laa_ending_in_dwpts_supported, 2, ENC_BIG_ENDIAN);
++	if (laa_ending_in_dwpts_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid laa ending in dwpts supported value [0..1]");
++	}
++
++	// LAA starting in second slot Supported
++	guint16 laa_starting_in_second_slot_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_laa_starting_in_second_slot_supported, 2, ENC_BIG_ENDIAN);
++	if (laa_starting_in_second_slot_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid laa starting in second slot supported value [0..1]");
++	}
++
++	// Beamforming Supported
++	guint16 beamingforming_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_beamforming_supported, 2, ENC_BIG_ENDIAN);
++	if (beamingforming_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid beamforming supported value [0..1]");
++	}
++
++	// CSI-RS enhancements supported
++	guint16 csi_rs_enhancements_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_rs_enhancements_supported, 2, ENC_BIG_ENDIAN);
++	if (csi_rs_enhancements_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi rs enhancements supported value [0..1]");
++	}
++
++	// DMRS enhancements supported
++	guint16 drms_enhancements_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_drms_enhancements_supported, 2, ENC_BIG_ENDIAN);
++	if (drms_enhancements_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid drms enhancements supported value [0..1]");
++	}
++
++	// SRS enhancements supported
++	guint16 srs_enhancements_supported_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_srs_enhancements_supported, 2, ENC_BIG_ENDIAN);
++	if (srs_enhancements_supported_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs enhancements supported value [0..1]");
++	}
++
++}
++
++static void dissect_pnf_phy_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 num_phy = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_number_phy, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "PHY Rel 13 List", ett_nfapi_pnf_phy_rel13, num_phy, dissect_pnf_phy_rel13_instance_value);
++}
++
++static void dissect_pnf_phy_rf_config_instance_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_phy_rf_config_info_phy_id, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_config_index, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_rf_config_index, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_pnf_phy_rf_config_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 num_configs = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pnf_phy_number_phy, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "PHY RF Config List", ett_nfapi_pnf_phy_rf_config, num_configs, dissect_pnf_phy_rf_config_instance_value);
++}
++
++static void dissect_dl_rs_tx_power_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_dl_rs_tx_power, 2, ENC_BIG_ENDIAN);
++
++	if (!(value >= 1 && value <= 255))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value [1..255]");
++	}
++}
++static void dissect_received_interference_power_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_received_interference_power, 2, ENC_BIG_ENDIAN);
++
++	if (!(value >= 1 && value <= 255))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value [1..255]");
++	}
++}
++static void dissect_thermal_noise_power_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_thermal_noise_power, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_dl_rs_tx_power_measurement_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_dl_rs_tx_power_measurement, 2, ENC_BIG_ENDIAN);
++}
++
++static void dissect_received_interference_power_result_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_received_interference_power_measurement, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_received_interference_power_measurement_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 num_resource_block = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_resource_blocks, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "Results", ett_nfapi_received_interference_power_mesurement_results, num_resource_block, dissect_received_interference_power_result_value);
++}
++static void dissect_thermal_noise_power_measurement_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_thermal_noise_power_measurement, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_duplex_mode_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_duplex_mode, 2, ENC_BIG_ENDIAN);
++
++	if (value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid duplex mode [0..2]");
++	}
++}
++static void dissect_pcfich_power_offset_value(ptvcursor_t* ptvc, packet_info *pinfo)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_pcfich_power_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid power level [0..10000]");
++	}
++}
++static void dissect_pb_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_pb, 2, ENC_BIG_ENDIAN);
++
++	if (value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid downlink power allocation index [0..3]");
++	}
++}
++
++static void dissect_dl_cyclic_prefix_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_dl_cyclic_prefix_type, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dl cyclic prefix type [0..1]");
++	}
++}
++static void dissect_ul_cyclic_prefix_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_ul_cyclic_prefix_type, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ul cyclic prefix type [0..1]");
++	}
++}
++static void dissect_dl_channel_bandwidth_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_downlink_channel_bandwidth, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 6 || value == 15 || value == 25 || value == 50 || value == 75 || value == 100))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid downlink bandwidth value [6, 15, 25, 50, 75, 100]");
++	}
++}
++static void dissect_ul_channel_bandwidth_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_uplink_channel_bandwidth, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 6 || value == 15 || value == 25 || value == 50 || value == 75 || value == 100))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid uplink bandwidth value [6, 15, 25, 50, 75, 100]");
++	}
++}
++static void dissect_reference_signal_power_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_reference_signal_power, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid reference signal power [0..255]");
++	}
++
++}
++static void dissect_tx_antenna_ports_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_tx_antenna_ports, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 1 || value == 2 || value == 4 || value == 8 || value == 16))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tx antenna ports value [1, 2, 4, 8, 16]");
++	}
++}
++static void dissect_rx_antenna_ports_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_rx_antenna_ports, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 1 || value == 2 || value == 4 || value == 8 || value == 16))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rx antenna ports value [1, 2, 4, 8, 16]");
++	}
++}
++static void dissect_phich_resource_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_phich_resource, 2, ENC_BIG_ENDIAN);
++
++	if (value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid phich resource value [0..3]");
++	}
++}
++static void dissect_phich_duration_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_phich_duration, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid phich duration value [0..1]");
++	}
++}
++static void dissect_phich_power_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_phich_power_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid phich power offset value [0..10000]");
++	}
++}
++static void dissect_psch_synch_signal_epre_eprers_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_primary_synchronization_signal_epre_eprers, 2, ENC_BIG_ENDIAN);
++
++	if (value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid primary synchronization signal epre/eprers value [0..10000]");
++	}
++}
++static void dissect_physical_cell_id_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_physical_cell_id, 2, ENC_BIG_ENDIAN);
++
++	if (value > 503)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid physical cell id [0..503]");
++	}
++}
++static void dissect_ssch_synch_signal_epre_eprers_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_secondary_synchronization_signal_epre_eprers, 2, ENC_BIG_ENDIAN);
++
++	if (value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid secondary synchronization signal epre/eprers value [0..10000]");
++	}
++}
++static void dissect_prach_configuration_index_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_configuration_index, 2, ENC_BIG_ENDIAN);
++
++	if (value > 63)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach configuration index [0..63]");
++	}
++}
++static void dissect_prach_root_sequence_index_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_root_sequence_index, 2, ENC_BIG_ENDIAN);
++
++	if (value > 837)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach root sequency index [0..837]");
++	}
++}
++static void dissect_prach_zero_correlation_zone_configuration_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_zero_correlation_zone_configuration, 2, ENC_BIG_ENDIAN);
++
++	// How do differentiate between fdd 0..6 and tdd 0..15 ranges?
++	if (value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid zero correlation zone configuration [0..15]");
++	}
++}
++static void dissect_prach_high_speed_flag_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_high_speed_flag, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid high speed flag value [0..1]");
++	}
++}
++static void dissect_prach_frequency_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_frequency_offset, 2, ENC_BIG_ENDIAN);
++
++	// How to determine the ul channel bandiwdth?
++	if (value > (100 -6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach frequency offset value [0..94]");
++	}
++}
++static void dissect_pusch_hopping_mode_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_hopping_mode, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pusch hopping mode value [0..1]");
++	}
++}
++static void dissect_pusch_hopping_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_hopping_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > 98)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pusch hopping offset value [0..98]");
++	}
++}
++static void dissect_pusch_number_of_subbands_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_number_of_subbands, 2, ENC_BIG_ENDIAN);
++
++	if (!(value >= 1 && value <= 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of sub-bands [1..4]");
++	}
++}
++static void dissect_pucch_delta_pucch_shift_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_delta_pucch_shift, 2, ENC_BIG_ENDIAN);
++
++	if (!(value >= 1 && value <= 3))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid delta pucch shift [1..3]");
++	}
++}
++static void dissect_pucch_n_cqi_rb_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_n_cqi_rb, 2, ENC_BIG_ENDIAN);
++
++	if (value > 98)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n cqi rb value [0..98]");
++	}
++}
++static void dissect_pucch_n_an_cs_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_n_an_cs, 2, ENC_BIG_ENDIAN);
++
++	if (value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n an cs value [0..7]");
++	}
++}
++static void dissect_pucch_n1_pucch_an_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_n1_pucch_an, 2, ENC_BIG_ENDIAN);
++
++	if (value > 2047)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n1pucch an value [0..2047]");
++	}
++}
++static void dissect_srs_bandwidth_configuration_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_bandwidth_configuration, 2, ENC_BIG_ENDIAN);
++
++	if (value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs bandwidth configuration value [0..7]");
++	}
++}
++static void dissect_srs_max_uppts_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_max_up_pts, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid max up pts value [0..1]");
++	}
++}
++static void dissect_srs_subframe_configuration_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_srs_subframe_configuration, 2, ENC_BIG_ENDIAN);
++
++	if (value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs subframe configuration value [0..15]");
++	}
++}
++static void dissect_srs_acknack_srs_sim_tx_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_srs_acknack_srs_simultaneous_transmission, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs ack nack srs simultaneous transmission value [0..1]");
++	}
++}
++static void dissect_uplink_rs_hopping_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_uplink_rs_hopping, 2, ENC_BIG_ENDIAN);
++
++	if (value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid uplink rs hopping value [0..2]");
++	}
++}
++static void dissect_group_assignment_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_group_assignment, 2, ENC_BIG_ENDIAN);
++
++	if (value > 29)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid group assignment value [0..29]");
++	}
++}
++static void dissect_cyclic_shift_1_for_drms_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_cyclic_shift_1_for_drms, 2, ENC_BIG_ENDIAN);
++
++	if (value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cyclic shift 1 for drms value [0..7]");
++	}
++}
++static void dissect_tdd_subframe_assignement_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_subframe_assignment, 2, ENC_BIG_ENDIAN);
++
++	if (value > 6)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tdd subframe assignment value [0..6]");
++	}
++}
++static void dissect_tdd_subframe_patterns_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_special_subframe_patterns, 2, ENC_BIG_ENDIAN);
++
++	if (value > 9)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid special subframe pattern value [0..9]");
++	}
++}
++static void dissect_laa_ed_threashold_for_lbt_for_pdsch_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_ed_threshold_for_lbt_for_pdsch, 2, ENC_BIG_ENDIAN);
++
++	if (value > 70)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ed threshold for ltb for pdsch value [0..70]");
++	}
++}
++static void dissect_laa_ed_threashold_for_lbt_for_drs_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_ed_threshold_for_lbt_for_drs, 2, ENC_BIG_ENDIAN);
++
++	if (value > 70)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ed threshold for ltb for drs value [0..70]");
++	}
++}
++static void dissect_laa_pd_threshold_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_pd_threshold, 2, ENC_BIG_ENDIAN);
++
++	if (value > 70 && value != 65535)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pd threshold value [0..70, 65536]");
++	}
++}
++static void dissect_laa_multi_carrier_type_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_multi_carrier_type, 2, ENC_BIG_ENDIAN);
++
++	if (value > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mutli carrier type [0..4]");
++	}
++}
++static void dissect_laa_multi_carrier_tx_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_multi_carrier_tx, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mutli carrier tx value [0..1]");
++	}
++}
++static void dissect_laa_multi_carrier_freeze_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_multi_carrier_freeze, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mutli carrier freeze value [0..1]");
++	}
++}
++static void dissect_laa_tx_antenna_port_for_drs_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_tx_antenna_ports_for_drs, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 1 || value == 2 || value == 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tx antenna ports for drs value [1, 2, 4]");
++	}
++}
++static void dissect_laa_transmission_power_for_drs_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_transmission_power_for_drs, 2, ENC_BIG_ENDIAN);
++
++	if (value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power for drs [0..10000]");
++	}
++}
++static void dissect_emtc_pbch_repeitions_enabled_r13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_pbch_repetitions_enabled_r13, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pbch repetitions enabled r13 value [0..1]");
++	}
++}
++static void dissect_emtc_prach_cat_m_root_sequence_index_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_cat_m_root_sequence_index, 2, ENC_BIG_ENDIAN);
++
++	if (value > 837)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach cat-m root sequence index value [0..837]");
++	}
++}
++static void dissect_emtc_prach_cat_m_zero_correlation_zone_configuration_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_cat_m_zero_correlation_zone_configuration, 2, ENC_BIG_ENDIAN);
++
++	if (value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach cat-m zero correlation zone configuration value [0..15]");
++	}
++}
++static void dissect_emtc_prach_cat_m_high_speed_flag_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_cat_m_high_speed_flag, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach cat-m high speed flag value [0..1]");
++	}
++}
++static void dissect_emtc_prach_ce_level_0_enabled_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_0_enable, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #0 enable value [0..1]");
++	}
++}
++static void dissect_emtc_prach_ce_level_0_configuration_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_0_configuration_index, 2, ENC_BIG_ENDIAN);
++
++	if (value > 63)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #0 configuration index value [0..63]");
++	}
++}
++static void dissect_emtc_prach_ce_level_0_frequency_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_0_frequency_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > (100 - 6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #0 frequency offset value [0..94]");
++	}
++}
++static void dissect_emtc_preach_ce_level_0_num_of_repeitions_per_attempt_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_0_number_of_repetitions_per_attempt, 2, ENC_BIG_ENDIAN);
++
++	if (!( value == 1 || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 ||
++		   value == 64 || value == 128))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #0 number of repetitions per attempt value [1, 2, 4, 8, 16, 32, 64, 128]");
++	}
++}
++static void dissect_emtc_ce_level_0_starting_subframe_periodicity_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_0_starting_subframe_periodicity, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 0xFFF || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 ||
++		  value == 64 || value == 128 || value == 256))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #0 starting subframe periodicity value [2, 4, 8, 16, 32, 64, 128, 256, 0xFFFF]");
++	}
++}
++static void dissect_emtc_preach_ce_level_0_hopping_enabled_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_0_hopping_enabled, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #0 hopping enabled value [0..1]");
++	}
++}
++static void dissect_emtc_preach_ce_level_0_hopping_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_0_hopping_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > 94)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #0 hopping offset value [0..94]");
++	}
++}
++static void dissect_emtc_prach_ce_level_1_enabled_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_1_enable, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #1 enable value [0..1]");
++	}
++}
++static void dissect_emtc_prach_ce_level_1_configuration_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_1_configuration_index, 2, ENC_BIG_ENDIAN);
++
++	if (value > 63)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #1 configuration index value [0..63]");
++	}
++}
++static void dissect_emtc_prach_ce_level_1_frequency_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_1_frequency_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > (100 - 6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #1 frequency offset value [0..94]");
++	}
++}
++static void dissect_emtc_preach_ce_level_1_num_of_repeitions_per_attempt_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_1_number_of_repetitions_per_attempt, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 1 || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 ||
++		value == 64 || value == 128))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #1 number of repetitions per attempt value [1, 2, 4, 8, 16, 32, 64, 128]");
++	}
++}
++static void dissect_emtc_ce_level_1_starting_subframe_periodicity_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_1_starting_subframe_periodicity, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 0xFFF || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 ||
++		value == 64 || value == 128 || value == 256))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #1 starting subframe periodicity value [2, 4, 8, 16, 32, 64, 128, 256, 0xFFFF]");
++	}
++}
++static void dissect_emtc_preach_ce_level_1_hopping_enabled_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_1_hopping_enabled, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #1 hopping enabled value [0..1]");
++	}
++}
++static void dissect_emtc_preach_ce_level_1_hopping_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_1_hopping_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > 94)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #1 hopping offset value [0..94]");
++	}
++}
++static void dissect_emtc_prach_ce_level_2_enabled_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_2_enable, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #2 enable value [0..1]");
++	}
++}
++static void dissect_emtc_prach_ce_level_2_configuration_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_2_configuration_index, 2, ENC_BIG_ENDIAN);
++
++	if (value > 63)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #2 configuration index value [0..63]");
++	}
++}
++static void dissect_emtc_prach_ce_level_2_frequency_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_2_frequency_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > (100 - 6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #2 frequency offset value [0..94]");
++	}
++}
++static void dissect_emtc_preach_ce_level_2_num_of_repeitions_per_attempt_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_2_number_of_repetitions_per_attempt, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 1 || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 ||
++		value == 64 || value == 128))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #2 number of repetitions per attempt value [1, 2, 4, 8, 16, 32, 64, 128]");
++	}
++}
++static void dissect_emtc_ce_level_2_starting_subframe_periodicity_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_2_starting_subframe_periodicity, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 0xFFF || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 ||
++		value == 64 || value == 128 || value == 256))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #2 starting subframe periodicity value [2, 4, 8, 16, 32, 64, 128, 256, 0xFFFF]");
++	}
++}
++static void dissect_emtc_preach_ce_level_2_hopping_enabled_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_2_hopping_enabled, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #2 hopping enabled value [0..1]");
++	}
++}
++static void dissect_emtc_preach_ce_level_2_hopping_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_2_hopping_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > 94)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #2 hopping offset value [0..94]");
++	}
++}
++static void dissect_emtc_prach_ce_level_3_enabled_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_3_enable, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #3 enable value [0..1]");
++	}
++}
++static void dissect_emtc_prach_ce_level_3_configuration_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_3_configuration_index, 2, ENC_BIG_ENDIAN);
++
++	if (value > 63)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #2 configuration index value [0..63]");
++	}
++}
++static void dissect_emtc_prach_ce_level_3_frequency_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_3_frequency_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > (100 - 6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #3 frequency offset value [0..94]");
++	}
++}
++static void dissect_emtc_preach_ce_level_3_num_of_repeitions_per_attempt_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_3_number_of_repetitions_per_attempt, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 1 || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 ||
++		value == 64 || value == 128))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #3 number of repetitions per attempt value [1, 2, 4, 8, 16, 32, 64, 128]");
++	}
++}
++static void dissect_emtc_ce_level_3_starting_subframe_periodicity_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_3_starting_subframe_periodicity, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 0xFFF || value == 2 || value == 4 || value == 8 || value == 16 || value == 32 ||
++		value == 64 || value == 128 || value == 256))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #3 starting subframe periodicity value [2, 4, 8, 16, 32, 64, 128, 256, 0xFFFF]");
++	}
++}
++static void dissect_emtc_preach_ce_level_3_hopping_enabled_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_3_hopping_enabled, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #3 hopping enabled value [0..1]");
++	}
++}
++static void dissect_emtc_preach_ce_level_3_hopping_offset_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_prach_ce_level_3_hopping_offset, 2, ENC_BIG_ENDIAN);
++
++	if (value > 94)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach ce level #3 hopping offset value [0..94]");
++	}
++}
++static void dissect_emtc_pucch_interval_ul_hopping_config_common_mode_a_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_pucch_internal_ul_hopping_config_common_mode_a, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 1 || value == 2 || value == 4 || value == 8 || value == 5 || value == 10 || value == 20))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pucch internal ul hopping config common mode a value [1, 2, 4, 8] or [1, 5, 10, 20]");
++	}
++}
++static void dissect_emtc_pucch_interval_ul_hopping_config_common_mode_b_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_pucch_internal_ul_hopping_config_common_mode_b, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 2 || value == 4 || value == 8 || value == 16 || value == 5 || value == 10 || value == 20 || value == 40))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pucch internal ul hopping config common mode a value [2, 4, 8, 16] or [5, 10, 20, 40]");
++	}
++}
++static void dissect_dl_bandwidth_support_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add_no_advance(ptvc, hf_nfapi_dl_bandwidth_support, 2, ENC_BIG_ENDIAN);
++
++	if (value > 0x1F)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid downlink bandwidth support bit [0..0x1F]");
++	}
++
++	proto_tree* dl_bw_support_tree = proto_item_add_subtree(item, ett_nfapi_downlink_bandwidth_support);
++
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_6, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 15, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_15, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 14, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_25, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 13, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_50, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 12, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_75, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 11, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_bw_support_tree, hf_nfapi_dl_bandwidth_support_100, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 10, 1, ENC_NA);
++
++	ptvcursor_advance(ptvc, 2);
++}
++static void dissect_ul_bandwidth_support_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add_no_advance(ptvc, hf_nfapi_ul_bandwidth_support, 2, ENC_BIG_ENDIAN);
++
++	if (value > 0x1F)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid uplink bandwidth support bit [0..0x1F]");
++	}
++
++	proto_tree* ul_bw_support_tree = proto_item_add_subtree(item, ett_nfapi_uplink_bandwidth_support);
++
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_6, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 15, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_15, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 14, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_25, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 13, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_50, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 12, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_75, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 11, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_bw_support_tree, hf_nfapi_ul_bandwidth_support_100, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 10, 1, ENC_NA);
++
++	ptvcursor_advance(ptvc, 2);
++
++}
++static void dissect_dl_modulation_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add_no_advance(ptvc, hf_nfapi_dl_modulation_support, 2, ENC_BIG_ENDIAN);
++
++	if (value > 0x7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid downlink modulation support bit [0..0x7]");
++	}
++
++	proto_tree* dl_mod_support_tree = proto_item_add_subtree(item, ett_nfapi_downlink_modulation_support);
++
++	proto_tree_add_bits_item(dl_mod_support_tree, hf_nfapi_dl_modulation_support_qpsk, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 15, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_mod_support_tree, hf_nfapi_dl_modulation_support_16qam, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 14, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_mod_support_tree, hf_nfapi_dl_modulation_support_64qam, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 13, 1, ENC_NA);
++	proto_tree_add_bits_item(dl_mod_support_tree, hf_nfapi_dl_modulation_support_256qam, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 12, 1, ENC_NA);
++
++	ptvcursor_advance(ptvc, 2);
++}
++static void dissect_ul_modulation_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add_no_advance(ptvc, hf_nfapi_ul_modulation_support, 2, ENC_BIG_ENDIAN);
++
++	if (value > 0x7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid uplink modulation support bit [0..0x7]");
++	}
++
++	proto_tree* ul_mod_support_tree = proto_item_add_subtree(item, ett_nfapi_uplink_modulation_support);
++
++	proto_tree_add_bits_item(ul_mod_support_tree, hf_nfapi_ul_modulation_support_qpsk, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 15, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_mod_support_tree, hf_nfapi_ul_modulation_support_16qam, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 14, 1, ENC_NA);
++	proto_tree_add_bits_item(ul_mod_support_tree, hf_nfapi_ul_modulation_support_64qam, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 13, 1, ENC_NA);
++
++	ptvcursor_advance(ptvc, 2);
++}
++static void dissect_phy_antenna_capability_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_phy_antenna_capability, 2, ENC_BIG_ENDIAN);
++
++	if (!(value == 1 || value == 2 || value == 4 || value == 8 || value == 16))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid phy antenna capability [1, 2, 4, 8, 16]");
++	}
++}
++static void dissect_release_capability_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add_no_advance(ptvc, hf_nfapi_release_capability, 2, ENC_BIG_ENDIAN);
++
++	if (value > 0x3F)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid release capability value [0..0x3F]");
++	}
++
++	proto_tree* release_support_tree = proto_item_add_subtree(item, ett_nfapi_release_support);
++
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel8, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 15, 1, ENC_NA);
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel9, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 14, 1, ENC_NA);
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel10, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 13, 1, ENC_NA);
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel11, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 12, 1, ENC_NA);
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel12, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 11, 1, ENC_NA);
++	proto_tree_add_bits_item(release_support_tree, hf_nfapi_maximum_3gpp_release_supported_rel13, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8 + 10, 1, ENC_NA);
++
++	ptvcursor_advance(ptvc, 2);
++}
++static void dissect_mbsfn_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_mbsfn_capability, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mbsfn capability bit [0..0x1]");
++	}
++}
++static void dissect_laa_support_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_laa_capability, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid laa support bit [0..0x1]");
++	}
++}
++static void dissect_laa_pd_sensing_lbt_support_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_pd_sensing_lbt_support, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pd sensing lbt support bit [0..0x1]");
++	}
++}
++static void dissect_laa_multi_carrier_lbt_support_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_multi_carrier_lbt_support, 2, ENC_BIG_ENDIAN);
++
++	if (value > 0xF)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid multi carrier LBT support bit [0..0xF]");
++	}
++}
++static void dissect_laa_partial_sf_support_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_partial_sf_support, 2, ENC_BIG_ENDIAN);
++
++	if (value > 0x1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid partial SF support bit [0..0x1]");
++	}
++}
++static void dissect_data_report_mode_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_data_report_mode, 2, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid data report mode value [0..1]");
++	}
++}
++static void dissect_sfn_sf_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_sfnsf, 2, ENC_BIG_ENDIAN);
++
++	guint16 sfn = value >> 0x4;
++	guint16 sf = value & 0x000F;
++	if (sfn > 1023 || sf > 9)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid sfn/sf value sfn:%d [0..1023] sf:%d [0..9]", sfn, sf);
++	}
++}
++static void dissect_phy_state_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_phy_state, 2, ENC_BIG_ENDIAN);
++
++	if (value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid phy state [0..2]");
++	}
++}
++static void dissect_p7_vnf_address_ipv4_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_vnf_address_ipv4, 4, ENC_NA);
++}
++static void dissect_p7_vnf_address_ipv6_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_vnf_address_ipv6, 16, ENC_NA);
++}
++static void dissect_p7_vnf_port_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_vnf_port, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_p7_pnf_address_ipv4_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_pnf_address_ipv4, 4, ENC_NA);
++}
++static void dissect_p7_pnf_address_ipv6_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_pnf_address_ipv6, 16, ENC_NA);
++}
++static void dissect_p7_pnf_port_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_pnf_port, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_downlink_ues_per_subframe_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_dl_ue_per_sf, 1, ENC_BIG_ENDIAN);
++}
++static void dissect_uplink_ues_per_subframe_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_ul_ue_per_sf, 1, ENC_BIG_ENDIAN);
++}
++static void dissect_rf_band_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_band, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_rf_bands_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 count = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_rf_bands, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "RF Band List", ett_nfapi_rf_bands, count, dissect_rf_band_value);
++}
++static void dissect_timing_window_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_timing_window, 1, ENC_BIG_ENDIAN);
++
++	if (value > 30)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing window value [0..30]");
++	}
++}
++static void dissect_timing_info_mode_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_timing_info_mode, 1, ENC_BIG_ENDIAN);
++
++	if (value > 0x3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing info mode [0..0x3]");
++	}
++}
++static void dissect_timing_info_period_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_timing_info_period, 1, ENC_BIG_ENDIAN);
++
++	// Compiler throws an hissy fit that value <= 255 is always true... Yes, but I am trying to
++	// follow the specification...
++	if (!(value >= 1 /* && value <= 255*/))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing info period [1..255]");
++	}
++}
++static void dissect_maximum_transmit_power_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_maximum_transmit_power_2, 2, ENC_BIG_ENDIAN);
++
++	if (value > 700)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid maxiumum transmit power [0..700]");
++	}
++}
++static void dissect_earfcn_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_earfcn, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_nmm_gsm_frequency_bands_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 count = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_rf_bands, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "RF Band List", ett_nfapi_rf_bands, count, dissect_rf_band_value);
++}
++static void dissect_nmm_umts_frequency_bands_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 count = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_rf_bands, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "RF Band List", ett_nfapi_rf_bands, count, dissect_rf_band_value);
++}
++static void dissect_nmm_lte_frequency_bands_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 count = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_rf_bands, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "RF Band List", ett_nfapi_rf_bands, count, dissect_rf_band_value);
++}
++static void dissect_nmm_uplink_rssi_supported_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_nmm_uplink_rssi_supported, 1, ENC_BIG_ENDIAN);
++
++	if (value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid nmm uplink rssi supported value [0..1]");
++	}
++}
++static void dissect_dl_config_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_dl_config_pdu_type, 1, ENC_BIG_ENDIAN);
++	guint8 size = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pdu_size, 1, ENC_BIG_ENDIAN);
++
++	guint pdu_end = (ptvcursor_current_offset(ptvc) + size - 2);
++	dissect_tlv_list(ptvc, pinfo, pdu_end);
++}
++static void dissect_dl_config_request_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Number of PDCCH OFDM symbols
++	guint8 number_of_pdcch_ofdm_symbols_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item  = ptvcursor_add(ptvc, hf_nfapi_number_pdcch_ofdm_symbols, 1, ENC_BIG_ENDIAN);
++	if (number_of_pdcch_ofdm_symbols_value > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of pdcch ofdm symbols value [0..4]");
++	}
++
++	// Number of DCIs
++	guint8 number_of_dcis_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_dci, 1, ENC_BIG_ENDIAN);
++
++	// Number of  PDUs
++	guint16 number_of_pdus_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_pdus, 2, ENC_BIG_ENDIAN);
++	if (number_of_pdus_value > 514)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of pdus value [0..514]");
++	}
++
++	// Number of PDSCH RNTIs
++	ptvcursor_add(ptvc, hf_nfapi_number_pdsch_rnti, 1, ENC_BIG_ENDIAN);
++
++	// Transmission power for PCFICH
++	guint16 transmission_power_for_pdsch_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_power_pcfich, 2, ENC_BIG_ENDIAN);
++	if (transmission_power_for_pdsch_value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power for pcfich value [0..10000]");
++	}
++
++	dissect_array_value(ptvc, pinfo, "DL Config PDU List", ett_nfapi_dl_config_request_pdu_list, number_of_dcis_value + number_of_pdus_value, dissect_dl_config_pdu);
++}
++static void dissect_dl_config_request_bch_pdu_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Length
++	ptvcursor_add(ptvc, hf_nfapi_length, 2, ENC_BIG_ENDIAN);
++
++	// PDU index
++	ptvcursor_add(ptvc, hf_nfapi_pdu_index, 2, ENC_BIG_ENDIAN);
++
++	// Transmission power
++	guint16 transmission_power_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_power, 2, ENC_BIG_ENDIAN);
++	if (transmission_power_value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power value [0..10000]");
++	}
++
++}
++static void dissect_dl_config_request_dl_dci_pdu_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// DCI format
++	guint8 dci_format_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_dl_dci_format, 1, ENC_BIG_ENDIAN);
++	if (dci_format_value > 9)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dci format value [0..9]");
++	}
++
++	// CCE index
++	guint8 cce_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cce_idx, 1, ENC_BIG_ENDIAN);
++	if (cce_index_value > 88)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cce index value [0..88]");
++	}
++
++	// Aggregation level
++	guint8 aggregation_level_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_aggregation_level, 1, ENC_BIG_ENDIAN);
++	if (!(aggregation_level_value == 1 || aggregation_level_value == 2 || aggregation_level_value == 4 ||
++		  aggregation_level_value == 8 || aggregation_level_value == 16 || aggregation_level_value == 32))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid aggregation level value [1, 2, 4, 8, 16, 32]");
++	}
++
++	// RNTI
++	guint16 rnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	if (rnti_value < 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti value [1..65535]");
++	}
++
++	// Resource allocation type
++	guint8 resource_allocation_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_allocation_type, 1, ENC_BIG_ENDIAN);
++	if (resource_allocation_type_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource allocation type value [0..1]");
++	}
++
++	// Virtual resource block assignment flag
++	guint8 virtual_resource_block_assignment_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_virtual_resource_block_assignment_flag, 1, ENC_BIG_ENDIAN);
++	if (virtual_resource_block_assignment_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid virtual resource block assignment flag value [0..1]");
++	}
++
++	// Resource block coding
++	ptvcursor_add(ptvc, hf_nfapi_resource_block_coding, 4, ENC_BIG_ENDIAN);
++
++	// MCS_1
++	guint8 mcs_1_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mcs_1, 1, ENC_BIG_ENDIAN);
++	if (mcs_1_value > 31)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mcs 1 value [0..31]");
++	}
++
++	// Redundancy version_1
++	guint8 redundancy_version_1_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_redundancy_version_1, 1, ENC_BIG_ENDIAN);
++	if (redundancy_version_1_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid redundancy version 1 value [0..3]");
++	}
++
++	// New data indicator_1
++	guint8 new_data_indicator_1_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_new_data_indicator_1, 1, ENC_BIG_ENDIAN);
++	if (new_data_indicator_1_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid new data indicator 1 value [0..1]");
++	}
++
++	// Transport block to codeword swap flag
++	guint8 transport_block_to_codeword_swap_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transport_block_to_codeword_swap_flag, 1, ENC_BIG_ENDIAN);
++	if (transport_block_to_codeword_swap_flag_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transport block to codeword swap flag value [0..1]");
++	}
++
++	// MCS_2
++	guint8 mcs_2_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mcs_2, 1, ENC_BIG_ENDIAN);
++	if (mcs_2_value > 31)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mcs 2 value [0..31]");
++	}
++
++	// Redundancy version_2
++	guint8 redundancy_version_2_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_redundancy_version_2, 1, ENC_BIG_ENDIAN);
++	if (redundancy_version_2_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid redundancy version 2 value [0..3]");
++	}
++
++	// New Data indicator_2
++	guint8 new_data_indicator_2_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_new_data_indicator_2, 1, ENC_BIG_ENDIAN);
++	if (new_data_indicator_2_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid new data indicator 2 value [0..1]");
++	}
++
++	// HARQ process
++	guint8 harq_process_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_process, 1, ENC_BIG_ENDIAN);
++	if (harq_process_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq process value [0..15]");
++	}
++
++	// TPMI
++	guint8 tpmi_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tpmi, 1, ENC_BIG_ENDIAN);
++	if (tpmi_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tpmi value [0..3]");
++	}
++
++	// PMI
++	guint8 pmi_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pmi, 1, ENC_BIG_ENDIAN);
++	if (pmi_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tpmi value [0..2]");
++	}
++
++	// Precoding information
++	guint8 precoding_information_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_precoding_information, 1, ENC_BIG_ENDIAN);
++	if (precoding_information_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid precoding information value [0..15]");
++	}
++
++	// TPC
++	guint8 tpc_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tpc, 1, ENC_BIG_ENDIAN);
++	if (tpc_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tpc value [0..3]");
++	}
++
++	// Downlink assignment index
++	guint8 downlink_assignment_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_downlink_assignment_index, 1, ENC_BIG_ENDIAN);
++	if (downlink_assignment_index_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid downlink assignment value [0..15]");
++	}
++
++	// NGAP
++	guint8 ngap_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ngap, 1, ENC_BIG_ENDIAN);
++	if (ngap_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ngap value [0..1]");
++	}
++
++	// Transport block size index
++	guint8 transport_block_size_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transport_block_size_index, 1, ENC_BIG_ENDIAN);
++	if (transport_block_size_index_value > 31)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transport block size index value [0..31]");
++	}
++
++	// Downlink power offset
++	guint8 downlink_power_offset_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_downlink_power_offset, 1, ENC_BIG_ENDIAN);
++	if (downlink_power_offset_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid downlink power offset value [0..1]");
++	}
++
++	// Allocate PRACH flag
++	guint8 allocate_prach_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_allocate_prach_flag, 1, ENC_BIG_ENDIAN);
++	if (allocate_prach_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid allocate prach flag value [0..1]");
++	}
++
++	// Preamble index
++	guint8 preamble_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_preamble_index, 1, ENC_BIG_ENDIAN);
++	if (preamble_index_value > 63)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid preamble index value [0..63]");
++	}
++
++	// PRACH mask index
++	guint8 prach_mask_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_prach_mask_index, 1, ENC_BIG_ENDIAN);
++	if (prach_mask_index_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach mask index value [0..15]");
++	}
++
++	// RNTI type
++	guint8 rnti_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_rnti_type, 1, ENC_BIG_ENDIAN);
++	if (!(rnti_type_value >= 1 && rnti_type_value <= 3))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti type value [1..3]");
++	}
++
++	// Transmission power
++	guint16 transmission_power_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_power, 2, ENC_BIG_ENDIAN);
++	if (transmission_power_value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power value value [0..10000]");
++	}
++
++}
++static void dissect_dl_config_request_dl_dci_pdu_rel9_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// MCCH flag
++	guint8 mcch_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mcch_flag, 1, ENC_BIG_ENDIAN);
++	if (mcch_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mcch flag value [0..1]");
++	}
++
++	// MCCH change notification
++	ptvcursor_add(ptvc, hf_nfapi_mcch_change_notification, 1, ENC_BIG_ENDIAN);
++
++	// Scrambling identity
++	guint8 scrambling_identity_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_scrambling_identity, 1, ENC_BIG_ENDIAN);
++	if (scrambling_identity_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid scrambling identity value [0..1]");
++	}
++
++}
++static void dissect_dl_config_request_dl_dci_pdu_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Cross carrier scheduling flag
++	guint8 cross_carrier_scheduling_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cross_carrier_scheduling_flag, 1, ENC_BIG_ENDIAN);
++	if (cross_carrier_scheduling_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cross carrier scheduling flag value [0..1]");
++	}
++
++	// Carrier indicator
++	guint8 carrier_indicator_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_carrier_indicator, 1, ENC_BIG_ENDIAN);
++	if (carrier_indicator_value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid carrier indicator value [0..7]");
++	}
++
++	// SRS flag
++	guint8 srs_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_srs_flag, 1, ENC_BIG_ENDIAN);
++	if (srs_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs flag value [0..1]");
++	}
++
++	// SRS request
++	guint8 srs_request_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_srs_request, 1, ENC_BIG_ENDIAN);
++	if (srs_request_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs request value [0..1]");
++	}
++
++	// Antenna ports, scrambling and layers
++	guint8 antenna_ports_scrambling_and_layers_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_antenna_ports_scrambling_and_layers, 1, ENC_BIG_ENDIAN);
++	if (antenna_ports_scrambling_and_layers_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid antenna ports scrambling and layers value [0..15]");
++	}
++
++	// Total DCI length including padding
++	ptvcursor_add(ptvc, hf_nfapi_total_dci_length_including_padding, 1, ENC_BIG_ENDIAN);
++
++	// N_DL_RB
++	// TODO : This is missing from the encoder....
++	//ptvcursor_add(ptvc, hf_nfapi_n_dl_rb, 1, ENC_BIG_ENDIAN);
++}
++static void dissect_dl_config_request_dl_dci_pdu_rel11_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// HARQ-ACK resource offset
++	guint8 harq_ack_resource_offset_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_ack_resource_offset, 1, ENC_BIG_ENDIAN);
++	if (harq_ack_resource_offset_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid hack ack resource offset value [0..3]");
++	}
++
++	// PDSCH RE Mapping and Quasi-Co-Location Indicator
++	guint8 pdsch_re_mapping_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pdsch_re_mapping_and_quasi_co_location_indicator, 1, ENC_BIG_ENDIAN);
++	if (pdsch_re_mapping_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pdsch re mapping value [0..3]");
++	}
++
++}
++static void dissect_ul_dl_configuration_index_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// UL/DL configuration indication
++	guint8 ul_dl_configuration_indication_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_ul_dl_configuration_index, 1, ENC_BIG_ENDIAN);
++	if (!(ul_dl_configuration_indication_value >= 1 && ul_dl_configuration_indication_value <= 5))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ul/dl configuration indication value [1..5]");
++	}
++}
++static void dissect_dl_config_request_dl_dci_pdu_rel12_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Primary cell type
++	guint8 primary_cell_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_primary_cell_type, 1, ENC_BIG_ENDIAN);
++	if (primary_cell_type_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid primary cell type value [0..2]");
++	}
++
++	// UL/DL configuration flag
++	guint8 ul_dl_configuration_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ul_dl_configuration_flag, 1, ENC_BIG_ENDIAN);
++	if (ul_dl_configuration_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ul/dl configuration flag value [0..1]");
++	}
++
++	// Number of UL / DL configurations
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_ul_dl_configurations, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "UL/DL Configurations", ett_nfapi_pnf_phy, count, dissect_ul_dl_configuration_index_value);
++}
++static void dissect_dl_config_request_dl_dci_pdu_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_laa_end_partial_sf_flag, 1, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_laa_end_partial_sf_configuration, 1, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_initial_lbt_sf, 1, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_codebooksize_determination_r13, 1, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_rel13_drms_table_flag, 1, ENC_BIG_ENDIAN);
++}
++static void dissect_dl_config_request_mch_pdu_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_length, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_pdu_index, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_resource_allocation_type, 1, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_resource_block_coding, 4, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_modulation, 1, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_transmission_power, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_mbsfn_area_id, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_codebook_index_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 codebook_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_codebook_index, 1, ENC_BIG_ENDIAN);
++	if (codebook_index_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid codebook index value [0..15]");
++	}
++}
++static void dissect_bf_vector_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_bf_vector_bf_value, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_bf_vector_type_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_bf_vector_subband_index, 1, ENC_BIG_ENDIAN);
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_bf_vector_num_antennas, 1, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "Antennas",  ett_nfapi_bf_vector_antennas, count, dissect_bf_vector_value);
++}
++static void dissect_dl_config_request_dlsch_pdu_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Length
++	ptvcursor_add(ptvc, hf_nfapi_length, 2, ENC_BIG_ENDIAN);
++
++	// PDU index
++	ptvcursor_add(ptvc, hf_nfapi_pdu_index, 2, ENC_BIG_ENDIAN);
++
++	// RNTI
++	guint16 rnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	if (!(rnti_value >= 1 /* && rnti_value <= 65535)*/))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid codebook index value [1..65535]");
++	}
++
++	// Resource allocation type
++	guint8 resource_allocation_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_allocation_type, 1, ENC_BIG_ENDIAN);
++	if (resource_allocation_type_value > 5)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource allocation type value [0..5]");
++	}
++
++	// Virtual resource block assignment flag
++	guint8 virtual_resource_block_assignment_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_virtual_resource_block_assignment_flag, 1, ENC_BIG_ENDIAN);
++	if (virtual_resource_block_assignment_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid virtual resource block allocation assignment value [0..1]");
++	}
++
++	// Resource block coding
++	ptvcursor_add(ptvc, hf_nfapi_resource_block_coding, 4, ENC_BIG_ENDIAN);
++
++	// Modulation
++	guint8 modulation_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_modulation, 1, ENC_BIG_ENDIAN);
++	if (!(modulation_value == 2 || modulation_value == 4 || modulation_value == 6 || modulation_value == 8))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid modulation value [2, 4, 6, 8]");
++	}
++
++	// Redundancy version
++	guint8 redundancy_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_redundancy_version, 1, ENC_BIG_ENDIAN);
++	if (redundancy_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid redundancy value [0..3]");
++	}
++
++	// Transport blocks
++	guint8 transport_blocks_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transport_blocks, 1, ENC_BIG_ENDIAN);
++	if (!(transport_blocks_value >= 1 && transport_blocks_value <= 2))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transport blocks value [1..2]");
++	}
++
++	// Transport block to codeword swap flag
++	guint8 transport_blocks_to_codeword_swap_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transport_block_to_codeword_swap_flag, 1, ENC_BIG_ENDIAN);
++	if (transport_blocks_to_codeword_swap_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transport block to codeword swap flag value [0..1]");
++	}
++
++	// Transmission scheme
++	guint8 transmission_scheme_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_scheme, 1, ENC_BIG_ENDIAN);
++	if (transmission_scheme_value > 13)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission scheme value [0..13]");
++	}
++
++	// Number of layers
++	guint8 number_of_layers_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_layers, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_layers_value >= 1 && number_of_layers_value <= 8))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of layers value [1..8]");
++	}
++
++	// Number of subbands
++	guint8 num_subbands = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_subbands, 1, ENC_BIG_ENDIAN);
++	if (num_subbands > 13)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of subbands value [0..13]");
++	}
++
++	dissect_array_value(ptvc, pinfo, "Subbands", ett_nfapi_subbands, num_subbands, dissect_codebook_index_value);
++
++	// UE category capacity
++	guint8 ue_category_capacity_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ue_category_capacity, 1, ENC_BIG_ENDIAN);
++	if (ue_category_capacity_value > 14)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ue category capacity value [0..14]");
++	}
++
++	// P-A
++	guint8 pa_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pa, 1, ENC_BIG_ENDIAN);
++	if (pa_value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid p-a value [0..7]");
++	}
++
++	// Delta power offset index
++	guint8 delta_power_offset_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_delta_power_offset_index, 1, ENC_BIG_ENDIAN);
++	if (delta_power_offset_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid delta power offset value [0..1]");
++	}
++
++	// NGAP
++	guint8 ngap_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ngap, 1, ENC_BIG_ENDIAN);
++	if (ngap_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ngap value [0..1]");
++	}
++
++	// NPRB
++	guint8 nrpb_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_nprb, 1, ENC_BIG_ENDIAN);
++	if (nrpb_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid nprb value [0..1]");
++	}
++
++	// Transmission mode
++	guint8 transmission_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_mode, 1, ENC_BIG_ENDIAN);
++	if (!(transmission_mode_value >= 1 && transmission_mode_value <= 10))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission mode value [1..10]");
++	}
++
++	// numBfPRBperSubband
++	ptvcursor_add(ptvc, hf_nfapi_num_bf_prb_per_subband, 1, ENC_BIG_ENDIAN);
++
++	// numBfVector
++	guint8 num_vectors = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_num_bf_vector, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "Beamforming Vectors", ett_nfapi_bf_vectors, num_vectors, dissect_bf_vector_type_value);
++}
++static void dissect_csi_rs_resource_config_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 csi_rs_resource_config_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_csi_rs_resource_config, 1, ENC_BIG_ENDIAN);
++	if (csi_rs_resource_config_value > 31)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi-rs resource config value [0..31]");
++	}
++}
++static void dissect_dl_config_request_dlsch_pdu_rel9_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 nscid_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_nscid, 1, ENC_BIG_ENDIAN);
++	if (nscid_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid nscid value [0..1]");
++	}
++}
++static void dissect_dl_config_request_dlsch_pdu_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// CSI-RS flag
++	guint8 csi_rs_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_rs_flag, 1, ENC_BIG_ENDIAN);
++	if (csi_rs_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi-rs flag value [0..1]");
++	}
++
++	// CSI-RS resource config R10
++	ptvcursor_add(ptvc, hf_nfapi_csi_rs_resource_config_r10, 1, ENC_BIG_ENDIAN);
++
++	// CSI-RS zero Tx power resource config bitmap R10
++	ptvcursor_add(ptvc, hf_nfapi_csi_rs_zero_tx_power_resource_config_bitmap_r10, 2, ENC_BIG_ENDIAN);
++
++	// CSI-RS Number of NZP configuration
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_rs_number_of_nzp_configurations, 1, ENC_BIG_ENDIAN);
++	if (count > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi-rs number of nzp configuration value [0..3]");
++	}
++
++	// CSI-RS configuration
++	dissect_array_value(ptvc, pinfo, "CSI-RS Resource Configs", ett_nfapi_csi_rs_resource_configs, count, dissect_csi_rs_resource_config_value);
++
++	// PDSCH start
++	guint8 pdsch_start_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pdsch_start, 1, ENC_BIG_ENDIAN);
++	if (pdsch_start_value > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pdsch start value [0..4]");
++	}
++
++}
++static void dissect_dl_config_request_dlsch_pdu_rel11_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// DMRS Config flag
++	guint8 drms_config_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_drms_config_flag, 1, ENC_BIG_ENDIAN);
++	if (drms_config_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid drms config flag value [0..1]");
++	}
++
++	// DMRS-Scrambling
++	guint16 drms_scrambling_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_drms_scrambling, 2, ENC_BIG_ENDIAN);
++	if (drms_scrambling_value > 503)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid drms scrambling value [0..503]");
++	}
++
++	// CSI Config flag
++	guint8 csi_config_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_config_flag, 1, ENC_BIG_ENDIAN);
++	if (csi_config_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi config flag value [0..1]");
++	}
++
++	// CSI- Scrambling
++	guint16 csi_scrambling_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_scrambling, 2, ENC_BIG_ENDIAN);
++	if (csi_scrambling_value > 503)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi scrambling value [0..503]");
++	}
++
++	// PDSCH RE mapping flag
++	guint8 pdsch_re_mapping_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pdsch_re_mapping_flag, 1, ENC_BIG_ENDIAN);
++	if (pdsch_re_mapping_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pdsch re mapping flag value [0..1]");
++	}
++
++	// PDSCH RE mapping antenna ports
++	guint8 pdsch_re_mapping_antenna_ports_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pdsch_re_mapping_antenna_ports, 1, ENC_BIG_ENDIAN);
++	if (!(pdsch_re_mapping_antenna_ports_value == 1 || pdsch_re_mapping_antenna_ports_value == 2 ||
++		  pdsch_re_mapping_antenna_ports_value == 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pdsch re mapping antenna ports value [1, 2, 4]");
++	}
++
++	// PDSCH RE mapping freq shift
++	guint8 pdsch_re_mapping_freq_shift_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pdsch_re_mapping_freq_shift, 1, ENC_BIG_ENDIAN);
++	if (pdsch_re_mapping_freq_shift_value > 5)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pdsch re mapping freq shift value [0..5]");
++	}
++}
++static void dissect_dl_config_request_dlsch_pdu_rel12_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// altCQI-Table-r12
++	guint8 alt_cqi_table_r12_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_alt_cqi_table_r12, 1, ENC_BIG_ENDIAN);
++	if (alt_cqi_table_r12_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid alt cqi table r12 value [0..1]");
++	}
++
++	// MaxLayers
++	guint8 max_layers_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_max_layers, 1, ENC_BIG_ENDIAN);
++	if (!(max_layers_value >= 1 && max_layers_value <= 8))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid max layers value [1..8]");
++	}
++
++	ptvcursor_add(ptvc, hf_nfapi_n_dl_harq, 1, ENC_BIG_ENDIAN);
++}
++static void dissect_dl_config_request_dlsch_pdu_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// DwPTS Symbols
++	guint8 dwpts_symbols_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_dwpts_symbols, 1, ENC_BIG_ENDIAN);
++	if (!(dwpts_symbols_value == 3 || dwpts_symbols_value == 6 || dwpts_symbols_value == 9 ||
++		dwpts_symbols_value == 10 || dwpts_symbols_value == 11 || dwpts_symbols_value == 12 ||
++		dwpts_symbols_value == 14))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dwpts symbols value [3, 6, 9, 10, 11, 12, 14]");
++	}
++
++	// Initial LBT SF
++	guint8 initial_lbt_sf_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_initial_lbt_sf, 1, ENC_BIG_ENDIAN);
++	if (initial_lbt_sf_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid initial lbt sf value [0..1]");
++	}
++
++	// UE Type
++	guint8 ue_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ue_type, 1, ENC_BIG_ENDIAN);
++	if (ue_type_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ue type value [0..2]");
++	}
++
++	// PDSCH Payload Type
++	guint8 pdsch_payload_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pdsch_payload_type, 1, ENC_BIG_ENDIAN);
++	if (pdsch_payload_type_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pdsch payload type value [0..2]");
++	}
++
++	// Initial transmission SF (io)
++	guint16 initial_transmission_sf_io_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_initial_transmission_sf, 2, ENC_BIG_ENDIAN);
++	if (!(initial_transmission_sf_io_value <= 10239 || initial_transmission_sf_io_value == 0xFFFF))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid initial transmission sf io value [0..10239, 0xFFFF]");
++	}
++
++	// Rel-13-DMRS-tabe flag
++	guint8 rel13_drms_table_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_req13_drms_table_flag, 1, ENC_BIG_ENDIAN);
++	if (rel13_drms_table_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rel13 drms table flag value [0..1]");
++	}
++}
++static void dissect_dl_config_request_pch_pdu_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Length
++	ptvcursor_add(ptvc, hf_nfapi_length, 2, ENC_BIG_ENDIAN);
++
++	// PDU index
++	ptvcursor_add(ptvc, hf_nfapi_pdu_index, 2, ENC_BIG_ENDIAN);
++
++	// P-RNTI
++	guint16 prnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_prnti, 2, ENC_BIG_ENDIAN);
++	if (prnti_value != 0xFFFE)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prnti value [0xFFFE]");
++	}
++
++	// Resource allocation type
++	guint8 resource_allocation_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_allocation_type, 1, ENC_BIG_ENDIAN);
++	if (!(resource_allocation_type_value == 2 || resource_allocation_type_value == 3 || resource_allocation_type_value == 6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource allocate type value [2, 3, 6]");
++	}
++
++	// Virtual resource block assignment flag
++	guint8 virtual_resource_block_assignment_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_virtual_resource_block_assignment_flag, 1, ENC_BIG_ENDIAN);
++	if (virtual_resource_block_assignment_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid virtual resource block assignment flag value [0..1]");
++	}
++
++	// Resource block coding
++	ptvcursor_add(ptvc, hf_nfapi_resource_block_coding, 4, ENC_BIG_ENDIAN);
++
++	// MCS
++	guint8 mcs_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mcs, 1, ENC_BIG_ENDIAN);
++	if (mcs_value != 0)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mcs value [0]");
++	}
++
++	// Redundancy version
++	guint8 redundancy_version_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_redundancy_version, 1, ENC_BIG_ENDIAN);
++	if (redundancy_version_value != 0)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid redundancy value [0]");
++	}
++
++	// Number of transport blocks
++	guint8 number_of_transport_blocks_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_transport_blocks, 1, ENC_BIG_ENDIAN);
++	if (number_of_transport_blocks_value != 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transport blocks value [1]");
++	}
++
++	// Transport block to codeword swap flag
++	ptvcursor_add(ptvc, hf_nfapi_transport_block_to_codeword_swap_flag, 1, ENC_BIG_ENDIAN);
++
++	// Transmission scheme
++	guint8 transmission_scheme_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_scheme, 1, ENC_BIG_ENDIAN);
++	if (!(transmission_scheme_value == 0 || transmission_scheme_value == 1 || transmission_scheme_value == 6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission schemes value [0, 1, 6]");
++	}
++
++	// Number of layers
++	guint8 number_of_layers_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_layers, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_layers_value >= 1 && number_of_layers_value <= 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of layers value [1..4]");
++	}
++
++	// Codebook index
++	ptvcursor_add(ptvc, hf_nfapi_codebook_index, 1, ENC_BIG_ENDIAN);
++
++	// UE category capacity
++	guint8 ue_category_capacity_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ue_category_capacity, 1, ENC_BIG_ENDIAN);
++	if (ue_category_capacity_value > 14)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ue category capacity value [0..14]");
++	}
++
++	// P-A
++	guint8 p_a_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pa, 1, ENC_BIG_ENDIAN);
++	if (p_a_value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid p-a value value [0..7]");
++	}
++
++	// Transmission power
++	guint16 transmission_power_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_power, 2, ENC_BIG_ENDIAN);
++	if (transmission_power_value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power value [0..10000]");
++	}
++
++	// NPRB
++	guint8 nprb_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_nprb, 1, ENC_BIG_ENDIAN);
++	if (nprb_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid nprb value [0..1]");
++	}
++
++	// NGAP
++	guint8 ngap_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ngap, 1, ENC_BIG_ENDIAN);
++	if (ngap_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ngap value [0..1]");
++	}
++
++}
++static void dissect_dl_config_request_pch_pdu_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// UE mode
++	guint8 ue_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ue_mode, 1, ENC_BIG_ENDIAN);
++	if (ue_mode_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ue mode value [0..1]");
++	}
++
++	// Initial transmission SF (io)
++	guint16 initial_transmission_sf_io_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_initial_transmission_sf, 2, ENC_BIG_ENDIAN);
++	if (!(initial_transmission_sf_io_value <= 10239 || initial_transmission_sf_io_value == 0xFFFF))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid initial transmission sf io value [0..10239, 0xFFFF]");
++	}
++}
++static void dissect_dl_config_request_prs_pdu_rel9_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Transmission power
++	guint16 transmission_power_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_power, 2, ENC_BIG_ENDIAN);
++	if (transmission_power_value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power value [0..10000]");
++	}
++
++	// PRS bandwidth
++	guint8 prs_bandwidth_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_prs_bandwidth, 1, ENC_BIG_ENDIAN);
++	if (!(prs_bandwidth_value == 6 || prs_bandwidth_value == 15 || prs_bandwidth_value == 25 ||
++		  prs_bandwidth_value == 50 || prs_bandwidth_value == 75 || prs_bandwidth_value == 100))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prs bandwidth value [6, 15, 25, 50, 75, 100]");
++	}
++
++	// PRS cyclic prefix type
++	guint8 prs_cyclic_prefix_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_prs_cyclic_prefix_type, 1, ENC_BIG_ENDIAN);
++	if (prs_cyclic_prefix_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prs cyclic prefix value [0..1]");
++	}
++
++	// PRS muting
++	guint8 prs_muting_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_prs_muting, 1, ENC_BIG_ENDIAN);
++	if (prs_muting_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prs muting value [0..1]");
++	}
++}
++static void dissect_dl_config_request_csi_rs_pdu_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// CSI-RS antenna port count R10
++	guint8 csi_rs_antenna_port_count_r10_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_rs_antenna_port_count_r10, 1, ENC_BIG_ENDIAN);
++	if (!(csi_rs_antenna_port_count_r10_value == 1 || csi_rs_antenna_port_count_r10_value == 2 ||
++		  csi_rs_antenna_port_count_r10_value == 4 || csi_rs_antenna_port_count_r10_value == 8 ||
++		  csi_rs_antenna_port_count_r10_value == 12 || csi_rs_antenna_port_count_r10_value == 16))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi rs antenna port count r10 value [1, 2, 4, 6, 8, 10]");
++	}
++
++	// CSI-RS resource config R10
++	ptvcursor_add(ptvc, hf_nfapi_csi_rs_resource_config_r10, 1, ENC_BIG_ENDIAN);
++
++	// Transmission power
++	guint16 transmission_power_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_power, 2, ENC_BIG_ENDIAN);
++	if (transmission_power_value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power value [0..10000]");
++	}
++
++	// CSI-RS zero Tx power resource config bitmap R10
++	ptvcursor_add(ptvc, hf_nfapi_csi_rs_zero_tx_power_resource_config_bitmap_r10, 2, ENC_BIG_ENDIAN);
++
++	// CSI-RS Number of NZP configuration
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_rs_number_of_nzp_configurations, 1, ENC_BIG_ENDIAN);
++	if (count > 8)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi-rs number of nzp configuration value [0..8]");
++	}
++
++	// CSI-RS configuration
++	dissect_array_value(ptvc, pinfo, "CSI-RS Resource Configs", ett_nfapi_csi_rs_resource_configs, count, dissect_csi_rs_resource_config_value);
++}
++static void dissect_csi_rs_bf_vector_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_csi_rs_resource_index, 1, ENC_BIG_ENDIAN);
++	if (count > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi-rs resource index value [0..7]");
++	}
++
++	// todo : how to work out the antenna port count for the bfValue
++}
++static void dissect_dl_config_request_csi_rs_pdu_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Class
++	guint8 class_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_rs_class, 1, ENC_BIG_ENDIAN);
++	if (class_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid class value [0..2]");
++	}
++
++	// cdmType
++	guint8 cdm_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cdm_type, 1, ENC_BIG_ENDIAN);
++	if (cdm_type_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cdm type value [0..1]");
++	}
++
++	// numBfVector
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_num_bf_vector, 1, ENC_BIG_ENDIAN);
++	if (!((class_value == 1 && count == 0) || (class_value == 2 && count <= 8)))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid num bf vector value [0] or [0..8]");
++	}
++
++	dissect_array_value(ptvc, pinfo, "Beamforming Vector", ett_nfapi_csi_rs_bf_vector, count, dissect_csi_rs_bf_vector_value);
++}
++static void dissect_epdcch_prb_index_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// EPDCCH PRB index
++	guint8 epdcch_prb_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_edpcch_prb_index, 1, ENC_BIG_ENDIAN);
++	if (epdcch_prb_index_value > 99)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid epdcch prb_index value [0..99]");
++	}
++}
++static void dissect_dl_config_request_edpcch_params_rel11_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// EPDCCH Resource assignment flag
++	guint8 epdcch_resource_assignment_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_epdcch_resource_assignment_flag, 1, ENC_BIG_ENDIAN);
++	if (epdcch_resource_assignment_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid epdcch resource assignment flag value [0..1]");
++	}
++
++	// EPDCCH ID
++	guint16 epdcch_id_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_epdcch_id, 2, ENC_BIG_ENDIAN);
++	if (epdcch_id_value > 503)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid epdcch id value [0..503]");
++	}
++
++	// EPDCCH Start Symbol
++	guint8 epdcch_start_symbol_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_epdcch_start_symbol, 1, ENC_BIG_ENDIAN);
++	if (!(epdcch_start_symbol_value >= 1 && epdcch_start_symbol_value <= 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid epdcch start symbol value [1..4]");
++	}
++
++	// EPDCCH NumPRB
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_epdcch_num_prb, 1, ENC_BIG_ENDIAN);
++	if (!(count == 2 || count == 4 || count == 8))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid epdcch num prb value [2, 4, 8]");
++	}
++
++	dissect_array_value(ptvc, pinfo, "PRBs", ett_nfapi_epdcch_prbs, count, dissect_epdcch_prb_index_value);
++
++	dissect_bf_vector_type_value(ptvc, pinfo);
++}
++static void dissect_dl_config_request_edpcch_params_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// DwPTS Symbols
++	guint8 dwtps_symbols_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_initial_lbt_sf, 1, ENC_BIG_ENDIAN);
++	if (!(dwtps_symbols_value == 3 || dwtps_symbols_value == 6 || dwtps_symbols_value == 9 ||
++		dwtps_symbols_value == 10 || dwtps_symbols_value == 11 || dwtps_symbols_value == 12 ||
++		dwtps_symbols_value == 14))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dwpts symbols value [3, 6, 9, 10, 11, 12, 14]");
++	}
++
++	// Initial LBT SF
++	guint8 initial_lbt_sf_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_dwpts_symbols, 1, ENC_BIG_ENDIAN);
++	if (initial_lbt_sf_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid initial lbt sf value [0..1]");
++	}
++
++}
++static void dissect_precoding_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add(ptvc, hf_nfapi_precoding_value, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_dl_config_request_mpdpcch_pdu_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// MPDCCH Narrowband
++	guint8 mpdcch_narrowband_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mpdcch_narrowband, 1, ENC_BIG_ENDIAN);
++	if (mpdcch_narrowband_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mpdcch narrowband value [0..15]");
++	}
++
++	// Number of PRB pairs
++	guint8 number_of_prb_pair_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_prb_pairs, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_prb_pair_value == 2 || number_of_prb_pair_value == 4 || number_of_prb_pair_value == 6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of prb pair value [2, 4, 6]");
++	}
++
++	// Resource Block Assignment
++	guint8 resource_block_assignment_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_block_assignment, 1, ENC_BIG_ENDIAN);
++	if (resource_block_assignment_value > 14)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource block assignment value [0..14]");
++	}
++
++	// MPDCCH transmission type
++	guint8 mpdcch_transmission_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mpdcch_transmission_type, 1, ENC_BIG_ENDIAN);
++	if (mpdcch_transmission_type_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mpdcch transmission type value [0..1]");
++	}
++
++	// Start symbol
++	guint8 start_symbol_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_start_symbol, 1, ENC_BIG_ENDIAN);
++	if (!(start_symbol_value >= 1 && start_symbol_value <=4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid start symbol value [1..4]");
++	}
++
++	// ECCE index
++	guint8 ecce_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ecce_index, 1, ENC_BIG_ENDIAN);
++	if (ecce_index_value > 22)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ecce index value [0..22]");
++	}
++
++	// Aggregation level
++	guint8 aggregation_level_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_aggregation_level, 1, ENC_BIG_ENDIAN);
++	if (!(aggregation_level_value == 2 || aggregation_level_value == 4 || aggregation_level_value == 8 ||
++		aggregation_level_value == 16 || aggregation_level_value == 24))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid aggregation level value [2, 4, 8, 16, 24]");
++	}
++
++	// RNTI type
++	guint8 rnti_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mpdcch_rnti_type, 1, ENC_BIG_ENDIAN);
++	if (rnti_type_value > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti type value [0..4]");
++	}
++
++	// RNTI
++	guint16 rnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	if (!(rnti_value >= 1))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti value [1..65535]");
++	}
++
++	// CEMode
++	guint8 cemode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ce_mode, 1, ENC_BIG_ENDIAN);
++	if (!(cemode_value >= 1 && cemode_value <= 2))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cemode value [1..2]");
++	}
++
++	// DMRS scrambling init
++	guint16 drms_scrambling_init_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_drms_scrabmling_init, 2, ENC_BIG_ENDIAN);
++	if (drms_scrambling_init_value > 503)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid drms scrambling init value [0..503]");
++	}
++
++	// Initial transmission SF (io)
++	guint16 initial_transmission_sf_io_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_initial_transmission_sf, 2, ENC_BIG_ENDIAN);
++	if (!(initial_transmission_sf_io_value <= 10239 || initial_transmission_sf_io_value == 0xFFFF))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid initial transmission sf io value [0..10239, 0xFFFF]");
++	}
++
++	// Transmission power
++	guint16 transmission_power_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_power, 2, ENC_BIG_ENDIAN);
++	if (transmission_power_value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power value [0..10000]");
++	}
++
++	// DCI format
++	guint8 dci_format_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_dl_dci_format, 1, ENC_BIG_ENDIAN);
++	if (!(dci_format_value == 10 || dci_format_value == 11 || dci_format_value == 12))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dci format value [10, 11, 12]");
++	}
++
++	// Resource block coding
++	ptvcursor_add(ptvc, hf_nfapi_resource_block_coding, 2, ENC_BIG_ENDIAN);
++
++	// MCS
++	guint8 mcs_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mcs, 1, ENC_BIG_ENDIAN);
++	if (mcs_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power value [0..15]");
++	}
++
++	// PDSCH repetition levels
++	guint8 pdsch_repetition_levels_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pdsch_reception_levels, 1, ENC_BIG_ENDIAN);
++	if (!(pdsch_repetition_levels_value >= 1 && pdsch_repetition_levels_value <= 8))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pdsch repetition levels value [1..8]");
++	}
++
++	// Redundancy version
++	guint8 redundancy_version_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_redundancy_version, 1, ENC_BIG_ENDIAN);
++	if (redundancy_version_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid redundancy version value [0..3]");
++	}
++
++	// New data indicator
++	guint8 new_data_indicator_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_new_data_indicator, 1, ENC_BIG_ENDIAN);
++	if (new_data_indicator_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid new data indicator value [0..1]");
++	}
++
++	// HARQ process
++	guint8 harq_process_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_process, 1, ENC_BIG_ENDIAN);
++	if (harq_process_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq process value [0..15]");
++	}
++
++	// TPMI length
++	guint8 tpmi_length_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tpmi_length, 1, ENC_BIG_ENDIAN);
++	if (!(tpmi_length_value == 0 || tpmi_length_value == 2 || tpmi_length_value == 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tpmi length value [0, 2, 4]");
++	}
++
++	// TPMI
++	guint8 tpmi_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tpmi, 1, ENC_BIG_ENDIAN);
++	if (tpmi_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tpmi value [0..15]");
++	}
++
++	// PMI flag
++	guint8 pmi_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pmi_flag, 1, ENC_BIG_ENDIAN);
++	if (pmi_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pmi flag value [0..1]");
++	}
++
++	// PMI
++	guint8 pmi_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pmi, 1, ENC_BIG_ENDIAN);
++	if (pmi_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pmi value [0..1]");
++	}
++
++	// HARQ resource offset
++	guint8 harq_resource_offset_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_resource_offset, 1, ENC_BIG_ENDIAN);
++	if (harq_resource_offset_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq resource offset value [0..3]");
++	}
++
++	// DCI subframe repetition number
++	guint8 dci_subframe_reptition_number_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_dci_subframe_repetition_number, 1, ENC_BIG_ENDIAN);
++	if (!(dci_subframe_reptition_number_value >= 1 && dci_subframe_reptition_number_value <= 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dci subframe repetition number value [1..4]");
++	}
++
++	// TPC
++	guint8 tpc_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tpc, 1, ENC_BIG_ENDIAN);
++	if (tpc_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tpc value [0..3]");
++	}
++
++	// Downlink assignment index Length
++	guint8 downlink_assignment_index_length_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_downlink_assignment_index_length, 1, ENC_BIG_ENDIAN);
++	if (!(downlink_assignment_index_length_value == 0 || downlink_assignment_index_length_value == 2 ||
++		downlink_assignment_index_length_value == 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid downlink assignmnet index value [0, 2, 4]");
++	}
++
++	// Downlink assignment index
++	guint8 downlink_assignment_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_downlink_assignment_index, 1, ENC_BIG_ENDIAN);
++	if (downlink_assignment_index_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid downlink assignment index value [0..15]");
++	}
++
++	// Allocate PRACH flag
++	guint8 allocate_prach_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_allocate_prach_flag, 1, ENC_BIG_ENDIAN);
++	if (allocate_prach_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid allocate prach flag value [0..1]");
++	}
++
++	// Preamble index
++	guint8 preamble_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_preamble_index, 1, ENC_BIG_ENDIAN);
++	if (preamble_index_value > 63)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid preamble index value [0..63]");
++	}
++
++	// PRACH mask index
++	guint8 prach_mask_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_prach_mask_index, 1, ENC_BIG_ENDIAN);
++	if (prach_mask_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid prach mask index value [0..15]");
++	}
++
++	// Starting CE Level
++	guint8 starting_ce_level_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_starting_ce_level, 1, ENC_BIG_ENDIAN);
++	if (starting_ce_level_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid starting ce level value [0..3]");
++	}
++
++	// SRS request
++	guint8 srs_request_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_srs_request, 1, ENC_BIG_ENDIAN);
++	if (srs_request_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs request value [0..1]");
++	}
++
++	// Antenna ports and scrambling identity flag
++	guint8 antenna_ports_and_scrambling_identity_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_antenna_ports_and_scrambling_identity_flag, 1, ENC_BIG_ENDIAN);
++	if (antenna_ports_and_scrambling_identity_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid antenna ports and scrambling identity flag value [0..1]");
++	}
++
++	// Antenna ports and scrambling identity
++	guint8 antenna_ports_and_scrambling_identity_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_antenna_ports_and_scrambling_identity, 1, ENC_BIG_ENDIAN);
++	if (antenna_ports_and_scrambling_identity_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid antenna ports and scrambling identity value [0..3]");
++	}
++
++	// Frequency hopping enabled flag
++	guint8 frequency_hopping_enabled_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_frequency_hopping_enabled_flag, 1, ENC_BIG_ENDIAN);
++	if (frequency_hopping_enabled_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid frequency hopping enabled flag value [0..1]");
++	}
++
++	// Paging/Direct indication differentiation flag
++	guint8 paging_direct_indicaton_differentiation_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_paging_direct_indication_differentiation_flag, 1, ENC_BIG_ENDIAN);
++	if (paging_direct_indicaton_differentiation_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid paging/direct indication differentiation flag value [0..1]");
++	}
++
++	// Direct indication
++	ptvcursor_add(ptvc, hf_nfapi_direct_indication, 1, ENC_BIG_ENDIAN);
++
++	// Total DCI length including padding
++	item = ptvcursor_add(ptvc, hf_nfapi_total_dci_length_including_padding, 1, ENC_BIG_ENDIAN);
++
++	// Number of TX Antenna ports
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_tx_antenna_ports, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "Precoding", ett_nfapi_precoding, count, dissect_precoding_value);
++}
++static void dissect_ul_config_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// PDU Type
++	guint8 ul_pdu_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ul_config_pdu_type, 1, ENC_BIG_ENDIAN);
++	if (ul_pdu_type_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ul pdu type value [0..15]");
++	}
++
++	guint8 size = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pdu_size, 1, ENC_BIG_ENDIAN);
++
++	guint pdu_end = (ptvcursor_current_offset(ptvc) + size - 2);
++	dissect_tlv_list(ptvc, pinfo, pdu_end);
++}
++static void  dissect_ul_config_request_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Number of PDUs
++	guint8 num_pdu = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_pdus, 1, ENC_BIG_ENDIAN);
++
++	// RACH/PRACH frequency resources
++	guint8 rach_prach_frequency_resources_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_rach_prach_frequency_resources, 1, ENC_BIG_ENDIAN);
++	if (rach_prach_frequency_resources_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rach prach frequency resources value [0..1]");
++	}
++
++	// SRS present
++	guint8 srs_present_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_srs_present, 1, ENC_BIG_ENDIAN);
++	if (srs_present_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs present value [0..1]");
++	}
++
++	dissect_array_value(ptvc, pinfo, "UL Config PDU List", ett_nfapi_ul_config_request_pdu_list, num_pdu, dissect_ul_config_pdu);
++}
++static void dissect_ul_config_ulsch_pdu_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Handle
++	ptvcursor_add(ptvc, hf_nfapi_handle, 4, ENC_BIG_ENDIAN);
++
++	// Size
++	ptvcursor_add(ptvc, hf_nfapi_size, 2, ENC_BIG_ENDIAN);
++
++	// RNTI
++	guint16 rnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	if (!(rnti_value >= 1))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti value [1..65535]");
++	}
++
++	// Resource block start
++	guint8 resource_block_start_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_block_start, 1, ENC_BIG_ENDIAN);
++	if (resource_block_start_value > 99)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource block start value [0..99]");
++	}
++
++	// Number of resource blocks
++	guint8 number_of_resource_blocks_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_resource_blocks, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_resource_blocks_value >= 1 && number_of_resource_blocks_value <= 100))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of resource blocks value [1..100]");
++	}
++
++	// Modulation type
++	guint8 modulation_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_modulation, 1, ENC_BIG_ENDIAN);
++	if (!(modulation_type_value == 2 || modulation_type_value == 4 || modulation_type_value ==  6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid modulation type value [2, 4, 6]");
++	}
++
++	// Cyclic Shift 2 for DMRS
++	guint8 cyclic_shift_2_for_drms_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cyclic_shift_2_for_drms, 1, ENC_BIG_ENDIAN);
++	if (cyclic_shift_2_for_drms_value > 99)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cyclic shift 2 for drms value [0..7]");
++	}
++
++	// Frequency hopping enabled flag
++	guint8 frequency_hopping_enabled_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_frequency_hopping_enabled_flag, 1, ENC_BIG_ENDIAN);
++	if (frequency_hopping_enabled_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid frequency hopping enabled flag value [0..1]");
++	}
++
++	// Frequency hopping bits
++	guint8 frequency_hopping_bits_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_frequency_hopping_bits, 1, ENC_BIG_ENDIAN);
++	if (frequency_hopping_bits_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid frequency hopping bits value [0..3]");
++	}
++
++	// New data indication
++	guint8 new_data_indication_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_new_data_indication, 1, ENC_BIG_ENDIAN);
++	if (new_data_indication_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid new data indicator value [0..1]");
++	}
++
++	// Redundancy version
++	guint8 redundancy_version_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_redundancy_version, 1, ENC_BIG_ENDIAN);
++	if (redundancy_version_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid redundancy version value [0..3]");
++	}
++
++	// HARQ process number
++	guint8 harq_process_number_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_process_number, 1, ENC_BIG_ENDIAN);
++	if (harq_process_number_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq process number value [0..15]");
++	}
++
++	// UL Tx mode
++	guint8 ul_tx_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ul_tx_mode, 1, ENC_BIG_ENDIAN);
++	if (ul_tx_mode_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ul tx mode value [0..1]");
++	}
++
++	// Current TX NB
++	ptvcursor_add(ptvc, hf_nfapi_current_tx_nb, 1, ENC_BIG_ENDIAN);
++
++	// N srs
++	guint8 n_srs_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_srs, 1, ENC_BIG_ENDIAN);
++	if (n_srs_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n_srs value [0..1]");
++	}
++}
++static void dissect_ul_config_ulsch_pdu_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Resource allocation type
++	guint8 resource_allocation_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_allocation_type, 1, ENC_BIG_ENDIAN);
++	if (resource_allocation_type_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource allocation type value [0..1]");
++	}
++
++	// Resource block coding
++	ptvcursor_add(ptvc, hf_nfapi_resource_block_coding, 4, ENC_BIG_ENDIAN);
++
++	// Transport blocks
++	guint8 transport_blocks_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transport_blocks, 1, ENC_BIG_ENDIAN);
++	if (!(transport_blocks_value >= 1 && transport_blocks_value <= 2))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transport blocks value [1..2]");
++	}
++
++	// Transmission scheme
++	guint8 transmission_scheme_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ul_transmission_scheme, 1, ENC_BIG_ENDIAN);
++	if (transmission_scheme_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission scheme value [0..1]");
++	}
++
++	// Number Of layers
++	guint8 number_of_layers_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_layers, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_layers_value >= 1 && number_of_layers_value <=4 ))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of layers value [1..4]");
++	}
++
++	// Codebook Index
++	guint8 codebook_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_codebook_index, 1, ENC_BIG_ENDIAN);
++	if (codebook_index_value > 23)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid codebook index value [0..23]");
++	}
++
++	// Disable sequence hopping flag
++	guint8 disable_sequence_hopping_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_disable_sequence_hopping_flag, 1, ENC_BIG_ENDIAN);
++	if (disable_sequence_hopping_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid disable sequence hopping flag value [0..1]");
++	}
++}
++static void dissect_ul_config_ulsch_pdu_rel11_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Virtual cell ID enabled flag
++	guint8 virtual_cell_id_enabled_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_virtual_cell_id_enabled_flag, 1, ENC_BIG_ENDIAN);
++	if (virtual_cell_id_enabled_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid virtual cell id enabled flag value [0..1]");
++	}
++
++	// nPUSCH Identity
++	guint16 npusch_identity_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_npusch_identity, 2, ENC_BIG_ENDIAN);
++	if (npusch_identity_value > 509)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npusch identity value [0..509]");
++	}
++
++	// DMRS Config flag
++	guint8 drms_config_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_drms_config_flag, 1, ENC_BIG_ENDIAN);
++	if (drms_config_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid drms config flag value [0..1]");
++	}
++
++	// nDMRS-CSH Identity
++	guint16 ndrms_csh_identity_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ndrms_csh_identity, 2, ENC_BIG_ENDIAN);
++	if (ndrms_csh_identity_value > 509)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ndrms-csh identity value [0..509]");
++	}
++
++}
++static void dissect_ul_config_ulsch_pdu_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// UE Type
++	guint8 ue_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ue_type, 1, ENC_BIG_ENDIAN);
++	if (ue_type_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ue type value [0..2]");
++	}
++
++	// Total Number of repetitions
++	guint16 total_number_of_repetitions_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_total_number_of_repetitions, 2, ENC_BIG_ENDIAN);
++	if (!(total_number_of_repetitions_value >= 1 && total_number_of_repetitions_value <= 2048))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid total number of repetitions value [1..2048]");
++	}
++
++	// Repetition Number
++	guint16 repetition_number_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_repetition_number, 2, ENC_BIG_ENDIAN);
++	if (!(repetition_number_value >= 1 && repetition_number_value <= 2048))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid repetition number value [1..2048]");
++	}
++
++	// Initial transmission SF (io)
++	guint16 intial_transmission_sf_io_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_initial_sf_io, 2, ENC_BIG_ENDIAN);
++	if (!(intial_transmission_sf_io_value <= 10239 || intial_transmission_sf_io_value == 0xFFFF))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid repetition number value [0..10239, 0xFFFF]");
++	}
++
++	// Empy symbols due to re-tunning
++	// todo : decode as a bitmap
++	ptvcursor_add(ptvc, hf_nfapi_empty_symbols_due_to_retunning, 1, ENC_BIG_ENDIAN);
++}
++static void dissect_ul_config_init_tx_params_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// N srs initial
++	guint8 n_srs_initial_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_srs_initial, 1, ENC_BIG_ENDIAN);
++	if (n_srs_initial_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n srs initial value [0..1]");
++	}
++
++	// Initial number of resource blocks
++	guint8 initial_number_of_resource_blocks_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_initial_number_of_resource_blocks, 1, ENC_BIG_ENDIAN);
++	if (!(initial_number_of_resource_blocks_value >= 1 && initial_number_of_resource_blocks_value <= 100))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid initial number of reosurce blocks value [1..100]");
++	}
++
++}
++static void dissect_ul_config_cqi_ri_info_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// DL CQI/PMI Size Rank = 1
++	ptvcursor_add(ptvc, hf_nfapi_dl_cqi_pmi_size_rank_1, 1, ENC_BIG_ENDIAN);
++
++	// DL CQI/PMI Size Rank>1
++	ptvcursor_add(ptvc, hf_nfapi_dl_cqi_pmi_size_rank_greater_1, 1, ENC_BIG_ENDIAN);
++
++	// RI Size
++	guint8 ri_size_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ri_size, 1, ENC_BIG_ENDIAN);
++	if (ri_size_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ri size value [0..3]");
++	}
++
++	// Delta Offset CQI
++	guint8 delta_offset_cqi_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_delta_offset_cqi, 1, ENC_BIG_ENDIAN);
++	if (delta_offset_cqi_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid delta offset cqi value [0..15]");
++	}
++
++	// Delta Offset RI
++	guint8 delta_offset_ri_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_delta_offset_ri, 1, ENC_BIG_ENDIAN);
++	if (delta_offset_ri_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid delta offset ri value [0..15]");
++	}
++}
++static void dissect_ul_cqi_pmi_size(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Delta Offset RI
++	guint8 dl_cqi_pmi_size_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_delta_offset_ri, 1, ENC_BIG_ENDIAN);
++	if (dl_cqi_pmi_size_value > 255)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid delta offset ri value [0..255]");
++	}
++}
++
++static void dissect_ul_config_cqi_ri_info_rel9_later_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++	// Report type
++	guint8 type = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_report_type, 1, ENC_BIG_ENDIAN);
++	if (type > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid report type value [0..1]");
++	}
++
++	// Delta offset CQI
++	guint8 delta_offset_cqi_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_delta_offset_cqi, 1, ENC_BIG_ENDIAN);
++	if (delta_offset_cqi_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid delta offset cqi value [0..15]");
++	}
++
++	// Delta offset RI
++	guint8 delta_offset_ri_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_delta_offset_ri, 1, ENC_BIG_ENDIAN);
++	if (delta_offset_ri_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid delta offset ri value [0..15]");
++	}
++
++	switch (type)
++	{
++		case 0:
++		{
++			// DL CQI/PMI/RI size
++			ptvcursor_add(ptvc, hf_nfapi_dl_cqi_ri_pmi_size, 1, ENC_BIG_ENDIAN);
++
++			// Control Type
++			guint8 control_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++			ptvcursor_add(ptvc, hf_nfapi_control_type, 1, ENC_BIG_ENDIAN);
++			if (control_type_value > 1)
++			{
++				expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid control type value [0..1]");
++			}
++			break;
++		}
++		case 1:
++		{
++			// todo : encoder not right for this case.
++			gint8 num_cc_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++			ptvcursor_add(ptvc, hf_nfapi_number_of_cc, 1, ENC_BIG_ENDIAN);
++
++			if (!(num_cc_value >= 1 && num_cc_value <= 32))
++			{
++				expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of cc value [1..32]");
++			}
++
++                        // UL CONFIG CQI PMI SIZE
++                        dissect_array_value(ptvc, pinfo, "CQI PMI SIZE", ett_nfapi_cqi_pmi_size, 8, dissect_ul_cqi_pmi_size);
++
++			/*
++			ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_tlv_tree, "CCs");
++
++			for (int i = 0; i < num_cc; ++i)
++			{
++				ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_tlv_tree, "[%d]", i);
++
++				guint8 ri_size = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++				ptvcursor_add(ptvc, hf_nfapi_ri_size, 1, ENC_BIG_ENDIAN);
++
++				ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_tlv_tree, "Rank");
++
++				for (int j = 0; j < ri_size; ++j)
++				{
++					ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_tlv_tree, "[%d]", j);
++					ptvcursor_add(ptvc, hf_nfapi_dl_cqi_pmi_size, 1, ENC_BIG_ENDIAN);
++					ptvcursor_pop_subtree(ptvc);
++				}
++
++				ptvcursor_pop_subtree(ptvc);
++
++				ptvcursor_pop_subtree(ptvc);
++			}
++
++			ptvcursor_pop_subtree(ptvc);
++			*/
++
++			break;
++		}
++	}
++}
++static void dissect_ul_config_cqi_ri_info_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// DL CQI/PMI/RI size 2
++	guint16 dl_cqi_ri_pmi_size_2_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_dl_cqi_ri_pmi_size_2, 2, ENC_BIG_ENDIAN);
++	if (dl_cqi_ri_pmi_size_2_value < 255)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dl cqi ri pmi size 2 value [>= 255]");
++	}
++}
++static void dissect_ul_config_harq_info_ulsch_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// HARQ Size
++	guint8 harq_size_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_size, 1, ENC_BIG_ENDIAN);
++	if (harq_size_value > 21)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq size value [0..21]");
++	}
++
++	// Delta Offset HARQ
++	guint8 delta_offset_harq_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_delta_offset_harq, 1, ENC_BIG_ENDIAN);
++	if (delta_offset_harq_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid delta offset harq value [0..15]");
++	}
++
++	// ACK_NACK mode
++	guint8 ack_nack_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tdd_ack_nack_mode, 1, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value > 5)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ack nack mode value [0..5]");
++	}
++}
++static void dissect_ul_config_harq_info_ulsch_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// HARQ Size 2
++	ptvcursor_add(ptvc, hf_nfapi_harq_size_2, 2, ENC_BIG_ENDIAN);
++
++	// Delta Offset HARQ 2
++	guint8 delta_offset_harq_2_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_delta_offset_harq_2, 1, ENC_BIG_ENDIAN);
++	if (delta_offset_harq_2_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid delta offset harq 2 value [0..15]");
++	}
++}
++static void dissect_ul_config_ue_info_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Handle
++	ptvcursor_add(ptvc, hf_nfapi_handle, 4, ENC_BIG_ENDIAN);
++
++	// RNTI
++	guint16 rnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	if (rnti_value < 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti value [1..65535]");
++	}
++}
++static void dissect_ul_config_ue_info_rel11_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Virtual cell ID enabled flag
++	guint8 virtual_cell_id_enabled_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_virtual_cell_id_enabled_flag, 1, ENC_BIG_ENDIAN);
++	if (virtual_cell_id_enabled_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid virtual cell id enabled flag value [0..1]");
++	}
++
++	// nPUCCH Identity
++	guint16 npucch_identity_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_npucch_identity, 2, ENC_BIG_ENDIAN);
++	if (npucch_identity_value > 503)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npucch identity value [0..503]");
++	}
++
++}
++static void dissect_ul_config_ue_info_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// UE Type
++	guint8 ue_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ue_type, 1, ENC_BIG_ENDIAN);
++	if (ue_type_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ue type value [0..2]");
++	}
++
++	// Empty symbols
++	// todo : use bit map decoding
++	ptvcursor_add(ptvc, hf_nfapi_empty_symbols, 1, ENC_BIG_ENDIAN);
++
++	// Total Number of repetitions
++	guint16 total_number_of_repetitions_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_total_number_of_repetitions, 2, ENC_BIG_ENDIAN);
++	if (!(total_number_of_repetitions_value >= 1 && total_number_of_repetitions_value <= 32))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid total number of repetitions value [1..32]");
++	}
++
++	// Repetition Number
++	guint16 repetition_number_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_repetition_number, 2, ENC_BIG_ENDIAN);
++	if (!(repetition_number_value >= 1 && repetition_number_value <= 32))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid repetition number value [1..32]");
++	}
++
++}
++static void dissect_ul_config_cqi_info_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// PUCCH index
++	guint16 pucch_index_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pucch_index, 2, ENC_BIG_ENDIAN);
++	if (pucch_index_value > 1184)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pucch index value [0..1184]");
++	}
++
++	// DL CQI/PMI Size
++	ptvcursor_add(ptvc, hf_nfapi_dl_cqi_pmi_size, 1, ENC_BIG_ENDIAN);
++}
++static void dissect_ul_config_cqi_info_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Number of PUCCH Resources
++	guint8 number_of_pucch_resources_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_pucch_resource, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_pucch_resources_value >= 1 && number_of_pucch_resources_value <= 2))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of pucch resources value [1..2]");
++	}
++
++	//PUCCH Index P1
++	guint16 pucch_index_p1_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pucch_index_p1, 2, ENC_BIG_ENDIAN);
++	if (pucch_index_p1_value > 1184)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pucch index p1 value [0..1184]");
++	}
++}
++static void dissect_ul_config_cqi_info_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// CSI_mode
++	guint8 csi_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_mode, 1, ENC_BIG_ENDIAN);
++	if (csi_mode_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi mode value [0..2]");
++	}
++
++	// DL CQI/PMI Size 2
++	ptvcursor_add(ptvc, hf_nfapi_dl_cqi_pmi_size_2, 2, ENC_BIG_ENDIAN);
++
++	// Starting PRB
++	guint8 starting_prb_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_statring_prb, 1, ENC_BIG_ENDIAN);
++	if (starting_prb_value > 109)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid starting prb value [0..109]");
++	}
++
++	// n_PRB
++	guint8 n_prb_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_nprb, 1, ENC_BIG_ENDIAN);
++	if (n_prb_value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n prb value [0..7]");
++	}
++
++	// cdm_Index
++	guint8 cdm_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cdm_index, 1, ENC_BIG_ENDIAN);
++	if (cdm_index_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cdm index value [0..1]");
++	}
++
++	// N srs
++	guint8 n_srs_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_nsrs, 1, ENC_BIG_ENDIAN);
++	if (n_srs_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n srs value [0..1]");
++	}
++
++}
++static void dissect_ul_config_sr_info_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 pucch_index_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_pucch_index, 2, ENC_BIG_ENDIAN);
++	if (pucch_index_value > 2047)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pucch index value [0..2047]");
++	}
++}
++static void dissect_ul_config_sr_info_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Number of PUCCH Resources
++	guint8 number_of_pucch_resources_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_pucch_resource, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_pucch_resources_value >= 1 && number_of_pucch_resources_value <= 2))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of pucch resources value [0..2047]");
++	}
++
++	// PUCCH Index P1
++	guint16 pucch_index_p1_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pucch_index_p1, 2, ENC_BIG_ENDIAN);
++	if (pucch_index_p1_value > 2047)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pucch index p1 value [0..2047]");
++	}
++}
++static void dissect_ul_config_harq_info_uci_rel10_tdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// HARQ size
++	guint8 harq_size_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_size, 1, ENC_BIG_ENDIAN);
++	if (harq_size_value > 21)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq size value [0..21]");
++	}
++
++	// ACK_NACK mode
++	guint8 ack_nack_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tdd_ack_nack_mode, 1, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value > 5)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ack nack mode value [0..5]");
++	}
++
++	// Number of PUCCH resources
++	guint8 number_of_pucch_resources_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_pucch_resource, 1, ENC_BIG_ENDIAN);
++	if (number_of_pucch_resources_value > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of pucch resources value [0..4]");
++	}
++
++	// n_PUCCH_1_0
++	guint16 npucch_1_0_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_1_0, 2, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value == 0 || ack_nack_mode_value == 1 || ack_nack_mode_value == 2)
++	{
++		if (npucch_1_0_value > 2047)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n pucch 1 0 value [0..2047] (All Format 1a/1b)");
++		}
++	}
++	else if (ack_nack_mode_value == 3)
++	{
++		if (npucch_1_0_value > 549)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n pucch 1 0 value [0..549] (Format 3)");
++		}
++	}
++
++	// n_PUCCH_1_1
++	guint16 npucch_1_1_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_1_1, 2, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value == 0 || ack_nack_mode_value == 1 || ack_nack_mode_value == 2)
++	{
++		if (npucch_1_1_value > 2047)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n pucch 1 1 value [0..2047] (All Format 1a/1b)");
++		}
++	}
++
++	// n_PUCCH_1_2
++	guint16 npucch_1_2_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_1_2, 2, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value == 2)
++	{
++		if (npucch_1_2_value > 2047)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n pucch 1 2 value [0..2047] (All Format 1a/1b)");
++		}
++	}
++
++	// n_PUCCH_1_3
++	guint16 npucch_1_3_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_1_3, 2, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value == 2)
++	{
++		if (npucch_1_3_value > 2047)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n pucch 1 3 value [0..2047] (All Format 1a/1b)");
++		}
++	}
++}
++static void dissect_ul_config_harq_info_uci_rel8_fdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// n_PUCCH_1_0
++	// todo : how to work out the ack_nack mode?
++	guint16 npucch_1_0_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_1_0, 2, ENC_BIG_ENDIAN);
++	if (npucch_1_0_value > 2047)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n pucch 1 0 value [0..2047]");
++	}
++
++	// HARQ Size
++	guint8 harq_size_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_size, 1, ENC_BIG_ENDIAN);
++	if (!(harq_size_value >= 1 && harq_size_value <= 2))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq size value [1..2]");
++	}
++}
++static void dissect_ul_config_harq_info_uci_rel9_later_fdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// HARQ Size
++	guint8 harq_size_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* harq_size_item = ptvcursor_add(ptvc, hf_nfapi_harq_size, 1, ENC_BIG_ENDIAN);
++
++	// ACK_NAK mode
++	guint8 ack_nack_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_fdd_ack_nack_mode, 1, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ack nack mode value [0..4]");
++	}
++
++	if (ack_nack_mode_value == 0 || ack_nack_mode_value == 2)
++	{
++		if (!(harq_size_value >= 1 && harq_size_value <= 10))
++		{
++			expert_add_info_format(pinfo, harq_size_item, &ei_invalid_range, "Invalid harq size value [1..10] (Format 1a/1b/3)");
++		}
++	}
++	else if (ack_nack_mode_value == 3 ||  ack_nack_mode_value == 4)
++	{
++		if (harq_size_value != 0)
++		{
++			expert_add_info_format(pinfo, harq_size_item, &ei_invalid_range, "Invalid harq size value [0] (Format 4/5)");
++		}
++	}
++
++	// Number of PUCCH Resources
++	guint8 number_of_pucch_resources_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_pucch_resource, 1, ENC_BIG_ENDIAN);
++	if (number_of_pucch_resources_value == 0 || number_of_pucch_resources_value == 2)
++	{
++		if (!(number_of_pucch_resources_value >= 1 && number_of_pucch_resources_value <= 4))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq size value [1..4] (Format 1a/1b/3)");
++		}
++	}
++	else if (number_of_pucch_resources_value == 3 || number_of_pucch_resources_value == 4)
++	{
++		if (number_of_pucch_resources_value != 0)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq size value [0] (Format 4/5)");
++		}
++	}
++
++	// n_PUCCH_1_0
++	guint16 npucch_1_0_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_1_0, 2, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value == 0 || ack_nack_mode_value == 1)
++	{
++		if (npucch_1_0_value > 2047)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npucch 1 0 value [0..2047] (Format 1a/1b/channel selection)");
++		}
++	}
++	else if (ack_nack_mode_value == 2)
++	{
++		if (npucch_1_0_value > 549)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npucch 1 0 value [0..549] (Format 3)");
++		}
++	}
++
++	// n_PUCCH_1_1
++	guint16 npucch_1_1_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_1_1, 2, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value == 0 || ack_nack_mode_value == 1)
++	{
++		if (npucch_1_1_value > 2047)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npucch 1 1 value [0..2047] (Format 1a/1b/channel selection)");
++		}
++	}
++
++	// n_PUCCH_1_2
++	guint16 npucch_1_2_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_1_2, 2, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value == 0 || ack_nack_mode_value == 1)
++	{
++		if (npucch_1_2_value > 2047)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npucch 1 2 value [0..2047] (Format 1a/1b/channel selection)");
++		}
++	}
++
++	// n_PUCCH_1_3
++	guint16 npucch_1_3_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_1_3, 2, ENC_BIG_ENDIAN);
++	if (ack_nack_mode_value == 0 || ack_nack_mode_value == 1)
++	{
++		if (npucch_1_3_value > 2047)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npucch 1 3 value [0..2047] (Format 1a/1b/channel selection)");
++		}
++	}
++}
++static void dissect_ul_config_harq_info_uci_rel11_fdd_tdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Num_ant_ports
++	guint8 num_ant_ports_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_num_ant_ports, 1, ENC_BIG_ENDIAN);
++	if (!(num_ant_ports_value >= 1 && num_ant_ports_value <= 2))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid num ant ports value [1..2]");
++	}
++
++	// n_PUCCH_2_0
++	// todo : how to work out the ack nack mode
++	guint16 npucch_2_0_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_2_0, 2, ENC_BIG_ENDIAN);
++	if (npucch_2_0_value > 2047)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npucch 2 0 value [0..2047]");
++	}
++
++	// n_PUCCH_2_1
++	guint16 npucch_2_1_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_2_1, 2, ENC_BIG_ENDIAN);
++	if (npucch_2_1_value > 2047)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npucch 2 1 value [0..2047]");
++	}
++
++	// n_PUCCH_2_2
++	guint16 npucch_2_2_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_2_2, 2, ENC_BIG_ENDIAN);
++	if (npucch_2_2_value > 2047)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npucch 2 2 value [0..2047]");
++	}
++
++	// n_PUCCH_2_3
++	guint16 npucch_2_3_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_pucch_2_3, 2, ENC_BIG_ENDIAN);
++	if (npucch_2_3_value > 2047)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid npucch 2 3 value [0..2047]");
++	}
++
++}
++static void dissect_ul_config_harq_info_uci_rel13_fdd_tdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// HARQ Size 2
++	ptvcursor_add(ptvc, hf_nfapi_harq_size_2, 2, ENC_BIG_ENDIAN);
++
++	// Starting PRB
++	guint8 starting_prb_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_starting_prb, 1, ENC_BIG_ENDIAN);
++	if (starting_prb_value > 109)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid starting prb value [0..109]");
++	}
++
++	// n_PRB
++	guint8 n_prb_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_nprb, 1, ENC_BIG_ENDIAN);
++	if (n_prb_value > 109)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n prb value [0..7]");
++	}
++
++	// cdm_Index
++	guint8 cdm_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cdm_index, 1, ENC_BIG_ENDIAN);
++	if (cdm_index_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cdm index value [0..1]");
++	}
++
++	// N srs
++	guint8 n_srs_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_nsrs, 1, ENC_BIG_ENDIAN);
++	if (n_srs_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n srs value [0..1]");
++	}
++}
++static void dissect_ul_config_srs_info_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Handle
++	ptvcursor_add(ptvc, hf_nfapi_handle, 4, ENC_BIG_ENDIAN);
++
++	// Size
++	ptvcursor_add(ptvc, hf_nfapi_size, 2, ENC_BIG_ENDIAN);
++
++	// RNTI
++	guint16 rnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	if (rnti_value < 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti value [1..65535]");
++	}
++
++	// SRS Bandwidth
++	guint8 srs_bandwidth_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_srs_bandwidth, 1, ENC_BIG_ENDIAN);
++	if (srs_bandwidth_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs bandwidth value [0..3]");
++	}
++
++	// Frequency Domain Position
++	guint8 frequency_domain_position_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_frequency_domain_position, 1, ENC_BIG_ENDIAN);
++	if (frequency_domain_position_value > 23)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid frequency domain bandwidth value [0..23]");
++	}
++
++	// SRS Hopping Bandwidth
++	guint8 srs_hopping_bandwidth_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_srs_hopping_bandwidth, 1, ENC_BIG_ENDIAN);
++	if (srs_hopping_bandwidth_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs hopping bandwidth value [0..3]");
++	}
++
++	// Transmission Comb
++	guint8 transmission_comb_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_comb, 1, ENC_BIG_ENDIAN);
++	if (transmission_comb_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission comb value [0..3]");
++	}
++
++	// ISRS / SRS-ConfigIndex
++	guint16 srs_config_index_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_i_srs, 2, ENC_BIG_ENDIAN);
++	if (srs_config_index_value > 1023)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid isrs/srs-configindex value [0..1023]");
++	}
++
++	// Sounding Reference Cyclic Shift
++	guint8 sounding_reference_cyclic_shift_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_sounding_reference_cyclic_shift, 1, ENC_BIG_ENDIAN);
++	if (sounding_reference_cyclic_shift_value > 11)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid sounding reference cyclic shift value [0..11]");
++	}
++}
++static void dissect_ul_config_srs_info_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 antenna_port_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_antenna_port, 1, ENC_BIG_ENDIAN);
++	if (antenna_port_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid antenna port value [0..2]");
++	}
++}
++static void dissect_ul_config_srs_info_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 number_of_combs_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_number_of_combs, 1, ENC_BIG_ENDIAN);
++	if (number_of_combs_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of combs value [0..1]");
++	}
++}
++static void dissect_hi_dci0_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++
++	// PDU Type
++	guint8 pdu_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_hi_dci0_pdu_type, 1, ENC_BIG_ENDIAN);
++	if (pdu_type_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pdu type value [0..3]");
++	}
++
++	// PDU Size
++	guint8 size = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pdu_size, 1, ENC_BIG_ENDIAN);
++
++	guint pdu_end = (ptvcursor_current_offset(ptvc) + size - 2);
++	dissect_tlv_list(ptvc, pinfo, pdu_end);
++}
++static void dissect_hi_dci0_request_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// SFN/SF
++	ptvcursor_add(ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++
++	// Number of DCI
++	guint8 num_pdu = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_dci_pdus, 1, ENC_BIG_ENDIAN);
++
++	// Number of  HI
++	num_pdu += tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_hi_pdus, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "HI DCI0 PDU List", ett_nfapi_hi_dci0_request_pdu_list, num_pdu, dissect_hi_dci0_pdu);
++}
++static void dissect_hi_dci0_hi_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Resource block start
++	guint8 resource_block_start_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_block_start, 1, ENC_BIG_ENDIAN);
++	if (resource_block_start_value > 100)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource block start value [0..100]");
++	}
++
++	// Cyclic Shift 2 for DMRS
++	guint8 cyclic_shift_2_for_drms_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cyclic_shift_2_for_drms, 1, ENC_BIG_ENDIAN);
++	if (cyclic_shift_2_for_drms_value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cyclic shift 2 for drms value [0..7]");
++	}
++
++	// HI value
++	guint8 hi_value_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_hi_value, 1, ENC_BIG_ENDIAN);
++	if (hi_value_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid hi value [0..1]");
++	}
++
++	// I_PHICH
++	guint8 i_pich_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_i_phich, 1, ENC_BIG_ENDIAN);
++	if (i_pich_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid i phich value [0..1]");
++	}
++
++	// Transmission power
++	guint16 transmission_power_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_power, 2, ENC_BIG_ENDIAN);
++	if (transmission_power_value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power value [0..10000]");
++	}
++
++}
++static void dissect_hi_dci0_hi_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Flag TB2
++	guint8 flag_tb2_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_flag_tb2, 1, ENC_BIG_ENDIAN);
++	if (flag_tb2_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid flag tb2 value [0..1]");
++	}
++
++	// HI Value 2
++	guint8 hi2_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_hi_value_2, 1, ENC_BIG_ENDIAN);
++	if (hi2_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid hi2 value [0..1]");
++	}
++
++}
++static void dissect_hi_dci0_dci_ul_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// DCI format
++	guint8 dci_format_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ul_dci_format, 1, ENC_BIG_ENDIAN);
++	if (dci_format_value > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dci format value [0..4]");
++	}
++
++	// CCE index
++	guint8 cce_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cce_idx, 1, ENC_BIG_ENDIAN);
++	if (cce_index_value > 88)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cce index value [0..88]");
++	}
++
++	// Aggregation level
++	guint8 aggregation_level_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_aggregation_level, 1, ENC_BIG_ENDIAN);
++	if (!(aggregation_level_value == 1 || aggregation_level_value == 2 || aggregation_level_value == 4 ||
++		  aggregation_level_value == 8))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid aggregation level value [1, 2, 4, 8]");
++	}
++
++	// RNTI
++	guint16 rnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	if (rnti_value < 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti value [1..65535]");
++	}
++
++	// Resource block start
++	guint8 resource_block_start_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_block_start, 1, ENC_BIG_ENDIAN);
++	if (resource_block_start_value > 100)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource block start value [0..100]");
++	}
++
++	// Number of resource blocks
++	guint8 number_of_resource_blocks_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_resource_blocks, 1, ENC_BIG_ENDIAN);
++	if (number_of_resource_blocks_value > 100)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of resource blocks value [0..100]");
++	}
++
++	// MCS_1
++	guint8 mcs_1_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mcs_1, 1, ENC_BIG_ENDIAN);
++	if (mcs_1_value > 31)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mcs 1 value [0..31]");
++	}
++
++	// Cyclic Shift 2 for DMRS
++	guint8 cyclic_shift_2_for_drms_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cyclic_shift_2_for_drms, 1, ENC_BIG_ENDIAN);
++	if (cyclic_shift_2_for_drms_value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cyclic shift 2 for drms value [0..7]");
++	}
++
++	// Frequency hopping enabled flag
++	guint8 frequency_hopping_enabled_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_frequency_hopping_enabled_flag, 1, ENC_BIG_ENDIAN);
++	if (frequency_hopping_enabled_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid frequency hopping enabled flag value [0..1]");
++	}
++
++	// Frequency hopping bits
++	guint8 frequency_hopping_bit_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_frequency_hopping_bits, 1, ENC_BIG_ENDIAN);
++	if (frequency_hopping_bit_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid frequency hopping bits value [0..3]");
++	}
++
++	// New Data indication_1
++	guint8 new_data_indication_1_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_new_data_indication, 1, ENC_BIG_ENDIAN);
++	if (new_data_indication_1_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid new data indication value [0..1]");
++	}
++
++	// UE TX antenna selection
++	guint8 ue_tx_antenna_selection_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ue_tx_antenna_selection, 1, ENC_BIG_ENDIAN);
++	if (ue_tx_antenna_selection_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ue tx antenna selection value [0..2]");
++	}
++
++	// TPC
++	guint8 tpc_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tpc, 1, ENC_BIG_ENDIAN);
++	if (tpc_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tpc value value [0..3]");
++	}
++
++	// CQI/CSI request
++	guint8 cqi_csi_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cqi_csi_request, 1, ENC_BIG_ENDIAN);
++	if (cqi_csi_value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cqi csi value [0..7]");
++	}
++
++	// UL index
++	guint8 ul_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ul_index, 1, ENC_BIG_ENDIAN);
++	if (ul_index_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ul index value [0..3]");
++	}
++
++	// DL assignment index
++	guint8 dl_assignment_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_dl_assignment_index, 1, ENC_BIG_ENDIAN);
++	if (!(dl_assignment_index_value >= 1 && dl_assignment_index_value <= 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dl assignment index value [1..4]");
++	}
++
++	// TPC bitmap
++	ptvcursor_add(ptvc, hf_nfapi_tpc_bitmap, 4, ENC_BIG_ENDIAN);
++
++	// Transmission power
++	guint16 transmission_power_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_power, 2, ENC_BIG_ENDIAN);
++	if (transmission_power_value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power value [0..10000]");
++	}
++}
++static void dissect_hi_dci0_dci_ul_rel10_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Cross carrier scheduling flag
++	guint8 cross_carrier_scheduling_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_cross_carrier_scheduling_flag, 1, ENC_BIG_ENDIAN);
++	if (cross_carrier_scheduling_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cross carrier scheduling flag value [0..1]");
++	}
++
++	// Carrier indicator
++	guint8 carrier_indicator_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_carrier_indicator, 1, ENC_BIG_ENDIAN);
++	if (carrier_indicator_value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid carrier indicator value [0..7]");
++	}
++
++	// Size of CQI/CSI field
++	guint8 size_of_cqi_csi_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_size_of_cqi_csi_feild, 1, ENC_BIG_ENDIAN);
++	if (size_of_cqi_csi_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid size of cqi/csi field value [0..2]");
++	}
++
++	// SRS flag
++	guint8 srs_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_srs_flag, 1, ENC_BIG_ENDIAN);
++	if (srs_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs field value [0..1]");
++	}
++
++	// SRS request
++	//guint8 srs_request_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	//item = ptvcursor_add(ptvc, hf_nfapi_srs_request, 1, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_srs_request, 1, ENC_BIG_ENDIAN);
++
++	// Resource allocation flag
++	guint8 resource_allocation_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_allocation_flag, 1, ENC_BIG_ENDIAN);
++	if (resource_allocation_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource allocation flag value [0..1]");
++	}
++
++	// Resource allocation type
++	guint8 resource_alloction_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_allocation_type, 1, ENC_BIG_ENDIAN);
++	if (resource_alloction_type_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource allocation type value [0..1]");
++	}
++
++	// Resource block coding
++	ptvcursor_add(ptvc, hf_nfapi_resource_block_coding, 4, ENC_BIG_ENDIAN);
++
++	// MCS_2
++	guint8 mcs_2_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mcs_2, 1, ENC_BIG_ENDIAN);
++	if (mcs_2_value > 31)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mcs 2 value [0..31]");
++	}
++
++	// New data indication_2
++	guint8 new_data_indication_2_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_new_data_indication_two, 1, ENC_BIG_ENDIAN);
++	if (new_data_indication_2_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid new data indication 2 value [0..1]");
++	}
++
++	// Number of antenna ports
++	guint8 number_of_antenna_ports_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_antenna_ports, 1, ENC_BIG_ENDIAN);
++	if (number_of_antenna_ports_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of antenna ports value [0..2]");
++	}
++
++	// TPMI
++	guint8 tpmi_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tpmi, 1, ENC_BIG_ENDIAN);
++	if (number_of_antenna_ports_value == 2)
++	{
++		if (tpmi_value > 7)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tpmi value [0..7]");
++		}
++	}
++	else if (number_of_antenna_ports_value == 4)
++	{
++		if (tpmi_value > 63)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tpmi value [0..63]");
++		}
++	}
++
++	// Total DCI length including padding
++	ptvcursor_add(ptvc, hf_nfapi_total_dci_length_including_padding, 1, ENC_BIG_ENDIAN);
++
++	// N_UL_RB
++	guint8 n_ul_rb_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_n_ul_rb, 1, ENC_BIG_ENDIAN);
++	if (!(n_ul_rb_value == 6 || n_ul_rb_value == 15 || n_ul_rb_value == 25 || n_ul_rb_value == 50 ||
++		n_ul_rb_value == 75 || n_ul_rb_value == 100))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid n ul rb value [6, 15, 25, 50, 75, 100]");
++	}
++}
++static void dissect_hi_dci0_dci_ul_rel12_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// PSCCH Resource
++	guint8 pscch_resource_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pscch_resource, 1, ENC_BIG_ENDIAN);
++	if (pscch_resource_value > 0x3F)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pscch resource value [0..0x3F]");
++	}
++
++	// Time resource pattern
++	guint8 time_resource_pattern_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_time_resource_pattern, 1, ENC_BIG_ENDIAN);
++	if (time_resource_pattern_value > 0x7F)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid time resource pattern value [0..0x7F]");
++	}
++
++}
++static void dissect_hi_dci0_mdpcch_dci_ul_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// MPDCCH Narrowband
++	guint8 mpdcch_narrowband_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mpdcch_narrowband, 1, ENC_BIG_ENDIAN);
++	if (mpdcch_narrowband_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mpdcch narrowband value [0..15]");
++	}
++
++	// Number of PRB pairs
++	guint8 number_of_prb_pairs_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_prb_pairs, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_prb_pairs_value == 2 || number_of_prb_pairs_value == 4 || number_of_prb_pairs_value == 6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of prb pairs value [2, 4, 6]");
++	}
++
++	// Resource Block Assignment
++	guint8 resource_block_assignment_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_block_assignment, 1, ENC_BIG_ENDIAN);
++	if (resource_block_assignment_value > 14)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource block assignment value [0..14]");
++	}
++
++	// MPDCCH transmission type
++	guint8 mpdcch_transmission_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mpdcch_transmission_type, 1, ENC_BIG_ENDIAN);
++	if (mpdcch_transmission_type_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mpdcch transmission type value [0..1]");
++	}
++
++	// Start symbol
++	guint8 start_symbol_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_start_symbol, 1, ENC_BIG_ENDIAN);
++	if (!(start_symbol_value >= 1 && start_symbol_value <=4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid start symbol value [0..1]");
++	}
++
++	// ECCE index
++	guint8 ecce_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ecce_index, 1, ENC_BIG_ENDIAN);
++	if (ecce_index_value > 22)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ecce index value [0..22]");
++	}
++
++	// Aggregation level
++	guint8 aggregation_level_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_aggregation_level, 1, ENC_BIG_ENDIAN);
++	if (!(aggregation_level_value == 2 || aggregation_level_value == 4 || aggregation_level_value == 8 ||
++		aggregation_level_value == 16 || aggregation_level_value == 24))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid aggregation level value [2, 4, 8, 16, 24]");
++	}
++
++	// RNTI type
++	guint8 rnti_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mpdcch_rnti_type, 1, ENC_BIG_ENDIAN);
++	if (!(rnti_type_value == 0 || rnti_type_value == 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti type value [0, 4]");
++	}
++
++	// RNTI
++	guint16 rnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	if (rnti_value < 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti value [1..65535]");
++	}
++
++	// CEMode
++	guint8 cemode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ce_mode, 1, ENC_BIG_ENDIAN);
++	if (!(cemode_value == 1 || cemode_value == 2))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid cemode value [1,2]");
++	}
++
++	// DMRS scrambling init
++	guint16 drms_scrambling_init_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_drms_scrambling_init, 2, ENC_BIG_ENDIAN);
++	if (drms_scrambling_init_value < 503)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid drms scrambling init value [0..503]");
++	}
++
++	// Initial transmission SF (io)
++	guint16 initial_transmission_sf_io_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_initial_transmission_sf, 2, ENC_BIG_ENDIAN);
++	if (!(initial_transmission_sf_io_value <= 10239 || initial_transmission_sf_io_value == 0xFFFF))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid initial transmission sf io value [0..10239, 0xFFFF]");
++	}
++
++	// Transmission power
++	guint16 transmission_power_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_transmission_power, 2, ENC_BIG_ENDIAN);
++	if (transmission_power_value > 10000)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid transmission power value [0..10000]");
++	}
++
++	// DCI format
++	guint8 dci_format_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mpdcch_ul_dci_format, 1, ENC_BIG_ENDIAN);
++	if (!(dci_format_value == 1 || dci_format_value == 2 || dci_format_value == 4 || dci_format_value == 5))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dci format value [1, 2, 4, 5]");
++	}
++
++	// Resource block start
++	guint8 resource_block_start_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_resource_block_start, 1, ENC_BIG_ENDIAN);
++	if (resource_block_start_value > 99)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid resource block start value [0..99]");
++	}
++
++	// Number of resource blocks
++	guint8 number_of_resource_blocks_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_resource_blocks, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_resource_blocks_value >= 1 && number_of_resource_blocks_value <= 6))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of resource blocks value [1..6]");
++	}
++
++	// MCS
++	guint8 mcs_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_mcs, 1, ENC_BIG_ENDIAN);
++	if (mcs_value > 15)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mcs value [0..15]");
++	}
++
++	// PUSCH repetition levels
++	guint8 pusch_repetition_levels_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_pusch_repetition_levels, 1, ENC_BIG_ENDIAN);
++	if (dci_format_value == 4)
++	{
++		if (!(pusch_repetition_levels_value >= 1 && pusch_repetition_levels_value <= 4))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pusch repetition levels value [1..4]");
++		}
++	}
++	else if (dci_format_value == 5)
++	{
++		if (!(pusch_repetition_levels_value >= 1 && pusch_repetition_levels_value <= 8))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pusch repetition levels value [1..8]");
++		}
++	}
++
++	// Frequency hopping flag
++	guint8 frequency_hopping_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_frequency_hopping_flag, 1, ENC_BIG_ENDIAN);
++	if (frequency_hopping_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid frequency hopping flag value [0..1]");
++	}
++
++	// New Data indication
++	guint8 new_data_indication_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_new_data_indication, 1, ENC_BIG_ENDIAN);
++	if (new_data_indication_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid new data indication value [0..1]");
++	}
++
++	// HARQ process
++	guint8 harq_process_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_process, 1, ENC_BIG_ENDIAN);
++	if (harq_process_value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq process value [0..7]");
++	}
++
++	// Redundancy version
++	guint8 redundancy_version_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_redundancy_version, 1, ENC_BIG_ENDIAN);
++	if (redundancy_version_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid redundancy version value [0..3]");
++	}
++
++	// TPC
++	guint8 tpc_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tpc, 1, ENC_BIG_ENDIAN);
++	if (tpc_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid tpc value [0..3]");
++	}
++
++	// CSI request
++	guint8 csi_request_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_csi_request, 1, ENC_BIG_ENDIAN);
++	if (csi_request_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid csi request value [0..1]");
++	}
++
++	// UL index
++	guint8 ul_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ul_index, 1, ENC_BIG_ENDIAN);
++	if (ul_index_value > 3)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ul index value [0..3]");
++	}
++
++	// DAI presence flag
++	guint8 dai_presence_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_dai_presence_flag, 1, ENC_BIG_ENDIAN);
++	if (dai_presence_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dai presence value [0..1]");
++	}
++
++	// DL assignment index
++	guint8 dl_assignment_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_dl_assignment_index, 1, ENC_BIG_ENDIAN);
++	if (!(dl_assignment_value >=1 && dl_assignment_value <= 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dl assignment value [1, 2, 3, 4]");
++	}
++
++	// SRS request
++	guint8 srs_request_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_srs_request, 1, ENC_BIG_ENDIAN);
++	if (srs_request_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid srs request value [0..1]");
++	}
++
++	// DCI subframe repetition number
++	guint8 dci_subframe_repetition_number_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_dci_subframe_repetition_number, 1, ENC_BIG_ENDIAN);
++	if (!(dci_subframe_repetition_number_value >= 1 && dci_subframe_repetition_number_value <= 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid dci subframe repetition number value [1..4]");
++	}
++
++	//TPC bitmap
++	ptvcursor_add(ptvc, hf_nfapi_tpc_bitmap, 4, ENC_BIG_ENDIAN);
++
++	// Total DCI length including padding
++	ptvcursor_add(ptvc, hf_nfapi_total_dci_length_include_padding, 1, ENC_BIG_ENDIAN);
++
++	// Number of TX Antenna ports
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_tx_antenna_ports, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "TX Antenna Ports", ett_nfapi_tx_antenna_ports, count, dissect_precoding_value);
++}
++static void dissect_rx_ue_info_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Handle
++	ptvcursor_add(ptvc, hf_nfapi_handle, 4, ENC_BIG_ENDIAN);
++
++	// RNTI
++	guint16 rnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	if (rnti_value < 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti value [1..65535]");
++	}
++}
++static void dissect_rx_indication_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Length
++	ptvcursor_add(ptvc, hf_nfapi_length, 2, ENC_BIG_ENDIAN);
++
++	// Data offset
++	ptvcursor_add(ptvc, hf_nfapi_data_offset, 2, ENC_BIG_ENDIAN);
++
++	// UL_CQI
++	ptvcursor_add(ptvc, hf_nfapi_ul_cqi, 1, ENC_BIG_ENDIAN);
++
++	// Timing advance
++	guint16 timing_advance_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_timing_advance, 2, ENC_BIG_ENDIAN);
++	if (timing_advance_value > 63)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing advance value [0..63]");
++	}
++}
++static void dissect_rx_indication_rel9_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Timing advance R9
++	guint16 timing_advance_r9_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_timing_advance_r9, 2, ENC_BIG_ENDIAN);
++	if (timing_advance_r9_value > 7690)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing advance r9 value [0..7690]");
++	}
++
++}
++static void dissect_harq_indication_data_bundling_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	guint8 value_0 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_0, 1, ENC_BIG_ENDIAN);
++	if (!(value_0 >= 1 && value_0 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 0 [1..7]");
++	}
++
++	guint8 value_1 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_1, 1, ENC_BIG_ENDIAN);
++	if (!(value_1 >= 1 && value_1 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 1 [1..7]");
++	}
++}
++static void dissect_harq_indication_data_format_1a_1b_bundling_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value_0 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_0, 1, ENC_BIG_ENDIAN);
++	if (!(value_0 >= 1 && value_0 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 0 [1..7]");
++	}
++}
++static void dissect_harq_indication_data_multplexing_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	guint8 value_0 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_0, 1, ENC_BIG_ENDIAN);
++	if (!(value_0 >= 1 && value_0 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 0 [1..7]");
++	}
++
++	guint8 value_1 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_1, 1, ENC_BIG_ENDIAN);
++	if (!(value_1 >= 1 && value_1 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 1 [1..7]");
++	}
++
++	guint8 value_2 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_2, 1, ENC_BIG_ENDIAN);
++	if (!(value_2 >= 1 && value_2 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 2 [1..7]");
++	}
++
++	guint8 value_3 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_3, 1, ENC_BIG_ENDIAN);
++	if (!(value_3 >= 1 && value_3 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 3 [1..7]");
++	}
++
++}
++static void dissect_harq_indication_data_format_1a_1b_multplexing_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value_0 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_0, 1, ENC_BIG_ENDIAN);
++	if (!(value_0 >= 1 && value_0 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 0 [1..7]");
++	}
++}
++static void dissect_harq_indication_data_special_bundling_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value_0 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_0_special, 1, ENC_BIG_ENDIAN);
++	if (value_0 > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 0 [0..4]");
++	}
++}
++static void dissect_harq_indication_data_format_1a_1b_special_bundling_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value_0 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_0_special, 1, ENC_BIG_ENDIAN);
++	if (value_0 > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 0 [0..4]");
++	}
++}
++static void dissect_harq_indication_data_channel_selection_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value_0 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_0, 1, ENC_BIG_ENDIAN);
++	if (!(value_0 >= 1 && value_0 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 0 [1..7]");
++	}
++}
++static void dissect_harq_indication_data_format_3_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value_0 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_0, 1, ENC_BIG_ENDIAN);
++	if (!(value_0 >= 1 && value_0 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 0 [1..7]");
++	}
++}
++static void dissect_harq_indication_data_format_4_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value_0 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_0, 1, ENC_BIG_ENDIAN);
++	if (!(value_0 >= 1 && value_0 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 0 [1..7]");
++	}
++}
++static void dissect_harq_indication_data_format_5_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 value_0 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_harq_data_value_0, 1, ENC_BIG_ENDIAN);
++	if (!(value_0 >= 1 && value_0 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid value 0 [1..7]");
++	}
++}
++static void dissect_harq_indication_rel8_tdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	guint8 mode = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tdd_harq_mode, 1, ENC_BIG_ENDIAN);
++	if (mode > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mode value [0..4]");
++	}
++
++	guint8 number_of_ack_nack_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_ack_nack, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_ack_nack_value >= 1 && number_of_ack_nack_value <= 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack nack value [1..4]");
++	}
++
++	switch (mode)
++	{
++		case 0:
++		{
++			dissect_harq_indication_data_bundling_value(ptvc, pinfo);
++			break;
++		}
++		case 1:
++		{
++			dissect_harq_indication_data_multplexing_value(ptvc, pinfo);
++			break;
++		}
++		case 2:
++		{
++			dissect_harq_indication_data_special_bundling_value(ptvc, pinfo);
++			break;
++		}
++	};
++}
++static void dissect_harq_indication_rel9_later_tdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 i;
++	proto_item* item;
++
++	guint8 mode = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tdd_harq_mode, 1, ENC_BIG_ENDIAN);
++	if (mode > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mode value [0..4]");
++	}
++
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_ack_nack, 1, ENC_BIG_ENDIAN);
++	if (mode == 0 || mode == 1)
++	{
++		if (!(count >= 1 && count <= 4))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack nack value [1..4]");
++		}
++	}
++	else if (mode == 3)
++	{
++		if (!(count >= 1 && count <= 8))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack nack value [1..8]");
++		}
++	}
++	else if (mode == 4)
++	{
++		if (!(count >= 1 && count <= 21))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack nack value [1..21]");
++		}
++	}
++
++
++	ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_harq_ack_nack_data, "ACK/NACK Data");
++
++	for (i = 0; i < count; ++i)
++	{
++		ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_harq_ack_nack_data, "[%d]", i);
++
++		switch (mode)
++		{
++			case 0:
++			{
++				dissect_harq_indication_data_format_1a_1b_bundling_value(ptvc, pinfo);
++				break;
++			}
++			case 1:
++			{
++				dissect_harq_indication_data_format_1a_1b_multplexing_value(ptvc, pinfo);
++				break;
++			}
++			case 2:
++			{
++				dissect_harq_indication_data_format_1a_1b_special_bundling_value(ptvc, pinfo);
++				break;
++			}
++			case 3:
++			{
++				dissect_harq_indication_data_channel_selection_value(ptvc, pinfo);
++				break;
++			}
++			case 4:
++			{
++				dissect_harq_indication_data_format_3_value(ptvc, pinfo);
++				break;
++			}
++		};
++
++		ptvcursor_pop_subtree(ptvc);
++	}
++
++	ptvcursor_pop_subtree(ptvc);
++}
++static void dissect_harq_indication_rel13_later_tdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 i = 0;
++	proto_item* item;
++
++	guint8 mode = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_tdd_harq_mode, 1, ENC_BIG_ENDIAN);
++	if (mode > 6)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid mode value [0..6]");
++	}
++
++
++	guint16 count = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_ack_nack, 2, ENC_BIG_ENDIAN);
++	if (mode == 0 || mode == 1)
++	{
++		if (!(count >= 1 && count <= 4))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack nack value [1..4]");
++		}
++	}
++	else if (mode == 3)
++	{
++		if (!(count >= 1 && count <= 8))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack nack value [1..8]");
++		}
++	}
++	else if (mode == 4)
++	{
++		if (!(count >= 1 && count <= 21))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack nack value [1..21]");
++		}
++	}
++	else if (mode == 5 || mode == 6)
++	{
++		if (count < 22)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack nack value [>= 22]");
++		}
++
++	}
++
++	ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_harq_ack_nack_data, "ACK/NACK Data");
++
++	for (i = 0; i < count; ++i)
++	{
++		ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_harq_ack_nack_data, "[%d]", i);
++
++		switch (mode)
++		{
++			case 0:
++			{
++				dissect_harq_indication_data_format_1a_1b_bundling_value(ptvc, pinfo);
++				break;
++			}
++			case 1:
++			{
++				dissect_harq_indication_data_format_1a_1b_multplexing_value(ptvc, pinfo);
++				break;
++			}
++			case 2:
++			{
++				dissect_harq_indication_data_special_bundling_value(ptvc, pinfo);
++				break;
++			}
++			case 3:
++			{
++				dissect_harq_indication_data_channel_selection_value(ptvc, pinfo);
++				break;
++			}
++			case 4:
++			{
++				dissect_harq_indication_data_format_3_value(ptvc, pinfo);
++				break;
++			}
++			case 5:
++			{
++				dissect_harq_indication_data_format_4_value(ptvc, pinfo);
++				break;
++			}
++			case 6:
++			{
++				dissect_harq_indication_data_format_5_value(ptvc, pinfo);
++				break;
++			}
++		};
++
++		ptvcursor_pop_subtree(ptvc);
++	}
++
++	ptvcursor_pop_subtree(ptvc);
++}
++static void dissect_harq_indication_rel8_fdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	guint8 harq_tb_1 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_tb_1, 1, ENC_BIG_ENDIAN);
++	if (!(harq_tb_1 >= 1 && harq_tb_1 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq tb 1 [1..7]");
++	}
++
++	guint8 harq_tb_2 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_harq_tb_2, 1, ENC_BIG_ENDIAN);
++	if (!(harq_tb_2 >= 1 && harq_tb_2 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq tb 2 [1..7]");
++	}
++
++}
++static void dissect_harq_tb_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint8 harq_tb_1 = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_harq_tb_n, 1, ENC_BIG_ENDIAN);
++	if (!(harq_tb_1 >= 1 && harq_tb_1 <= 7))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq tb n [1..7]");
++	}
++}
++static void dissect_harq_indication_rel9_later_fdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Mode
++	guint8 harq_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_fdd_harq_mode, 1, ENC_BIG_ENDIAN);
++	if (harq_mode_value > 2)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq mode value [0..2]");
++	}
++
++	// Number of ACK/NACK
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_ack_nack, 1, ENC_BIG_ENDIAN);
++
++	if (harq_mode_value == 0)
++	{
++		if (!(count >=1 && count <= 2))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack/nack value [1..2]");
++		}
++	}
++	else if (harq_mode_value == 1)
++	{
++		if (!(count >= 1 && count <= 4))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack/nack value [1..4]");
++		}
++
++	}
++	else if (harq_mode_value == 2)
++	{
++		if (!(count >= 1 && count <= 10))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack/nack value [1..10]");
++		}
++
++	}
++
++	dissect_array_value(ptvc, pinfo, "HARQ TB List", ett_nfapi_harq_data, count, dissect_harq_tb_value);
++}
++static void dissect_harq_indication_rel13_later_fdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Mode
++	guint8 harq_mode_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_fdd_harq_mode, 1, ENC_BIG_ENDIAN);
++	if (harq_mode_value > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid harq mode value [0..4]");
++	}
++
++	// Number of ACK/NACK
++	guint16 count = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_ack_nack, 2, ENC_BIG_ENDIAN);
++
++	if (harq_mode_value == 0)
++	{
++		if (!(count >= 1 && count <= 2))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack/nack value [1..2]");
++		}
++	}
++	else if (harq_mode_value == 1)
++	{
++		if (!(count >= 1 && count <= 4))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack/nack value [1..4]");
++		}
++
++	}
++	else if (harq_mode_value == 2)
++	{
++		if (!(count >= 1 && count <= 10))
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack/nack value [1..10]");
++		}
++	}
++	else if (harq_mode_value == 3 || harq_mode_value == 4)
++	{
++		if (count < 22)
++		{
++			expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of ack/nack value [>= 22]");
++		}
++	}
++
++	dissect_array_value(ptvc, pinfo, "HARQ TB List", ett_nfapi_harq_data, count, dissect_harq_tb_value);
++}
++static void dissect_ul_cqi_information_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// UL_CQI
++	ptvcursor_add(ptvc, hf_nfapi_ul_cqi, 1, ENC_BIG_ENDIAN);
++
++	// Channel
++	guint8 channel_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_channel, 1, ENC_BIG_ENDIAN);
++	if (channel_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid channel value [0..1]");
++	}
++}
++static void dissect_crc_indication_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// CRC Flag
++	guint8 crc_flag_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_crc_flag, 1, ENC_BIG_ENDIAN);
++	if (crc_flag_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid crc flag value [0..1]");
++	}
++}
++static void dissect_rx_cqi_indication_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	//Length
++	ptvcursor_add(ptvc, hf_nfapi_length, 2, ENC_BIG_ENDIAN);
++
++	// Data Offset
++	ptvcursor_add(ptvc, hf_nfapi_data_offset, 2, ENC_BIG_ENDIAN);
++
++	// UL_CQI
++	ptvcursor_add(ptvc, hf_nfapi_ul_cqi, 1, ENC_BIG_ENDIAN);
++
++	// RI
++	guint8 ri_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_ri, 1, ENC_BIG_ENDIAN);
++	if (ri_value > 8)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ri value [0..8]");
++	}
++
++	// Timing Advance
++	guint16 timing_advance_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_timing_advance, 2, ENC_BIG_ENDIAN);
++	if (timing_advance_value > 8)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing advance value [0..63]");
++	}
++}
++static void dissect_ri_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// RI
++	guint8 ri_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_ri, 1, ENC_BIG_ENDIAN);
++	if (ri_value > 8)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ri value [0..8]");
++	}
++}
++static void dissect_rx_cqi_indication_rel9_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Length
++	ptvcursor_add(ptvc, hf_nfapi_length, 2, ENC_BIG_ENDIAN);
++
++	// Data Offset
++	ptvcursor_add(ptvc, hf_nfapi_data_offset, 2, ENC_BIG_ENDIAN);
++
++	// UL_CQI
++	ptvcursor_add(ptvc, hf_nfapi_ul_cqi, 1, ENC_BIG_ENDIAN);
++
++	// Number of CC reported
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_cc_reported, 1, ENC_BIG_ENDIAN);
++	if (!(count >= 1 && count <= 5))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of CC reported value [1..5]");
++	}
++
++	dissect_array_value(ptvc, pinfo, "CC List", ett_nfapi_cc, count, dissect_ri_value);
++
++	// Timing Advance
++	guint16 timing_advance_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_timing_advance, 2, ENC_BIG_ENDIAN);
++	if (timing_advance_value > 63)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing advance value [0..63]");
++	}
++
++	// Timing Advance R9
++	guint16 timing_advance_r9_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_timing_advance_r9, 2, ENC_BIG_ENDIAN);
++	if (timing_advance_r9_value > 7690)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing advance value [0..7690]");
++	}
++}
++static void dissect_rach_indication_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// RNTI
++	guint16 rnti_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_rnti, 2, ENC_BIG_ENDIAN);
++	if (rnti_value < 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rnti value [1..65535]");
++	}
++
++	// Preamble
++	guint8 preamble_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_preamble, 1, ENC_BIG_ENDIAN);
++	if (preamble_value > 63)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid preamble value [0..63]");
++	}
++
++	// Timing Advance
++	guint16 timing_advance_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_timing_advance, 2, ENC_BIG_ENDIAN);
++	if (timing_advance_value > 1282)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing advance value [0..1282]");
++	}
++
++}
++static void dissect_rach_indication_rel9_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Timing Advance R9
++	guint16 timing_advance_r9_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_timing_advance_r9, 2, ENC_BIG_ENDIAN);
++	if (timing_advance_r9_value > 7690)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing advance value [0..7690]");
++	}
++}
++static void dissect_rach_indication_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// RACH resource type
++	guint8 rach_resource_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_rach_resource_type, 1, ENC_BIG_ENDIAN);
++	if (rach_resource_type_value > 4)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid rach resource type value [0..4]");
++	}
++}
++static void dissect_snr_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// SNR
++	ptvcursor_add(ptvc, hf_nfapi_snr, 1, ENC_BIG_ENDIAN);
++}
++static void dissect_srs_indication_rel8_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Doppler estimation
++	ptvcursor_add(ptvc, hf_nfapi_doppler_estimation, 2, ENC_BIG_ENDIAN);
++
++	// Timing Advance
++	guint16 timing_advance_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_timing_advance, 2, ENC_BIG_ENDIAN);
++	if (timing_advance_value > 1282)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing advance value [0..1282]");
++	}
++
++	// Number of resource blocks
++	guint8 count = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_resource_blocks, 1, ENC_BIG_ENDIAN);
++
++	// RB start
++	ptvcursor_add(ptvc, hf_nfapi_rb_start, 1, ENC_BIG_ENDIAN);
++
++
++	dissect_array_value(ptvc, pinfo, "RB List", ett_nfapi_rbs, count, dissect_snr_value);
++}
++static void dissect_srs_indication_rel9_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Timing Advance R9
++	guint16 timing_advance_r9_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_timing_advance_r9, 2, ENC_BIG_ENDIAN);
++	if (timing_advance_r9_value > 7690)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid timing advance value [0..7690]");
++	}
++}
++static void dissect_srs_indication_rel10_tdd_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// UpPTS Symbol
++	guint8 uppts_symbol_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_up_pts_symbol, 1, ENC_BIG_ENDIAN);
++	if (uppts_symbol_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid up pts symbol value [0..1]");
++	}
++
++}
++static void dissect_tdd_channel_measurement_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint16 i = 0;
++	guint16 j = 0;
++
++	// numPRBperSubband
++	ptvcursor_add(ptvc, hf_nfapi_number_prb_per_subband, 1, ENC_BIG_ENDIAN);
++
++	// Number of subbands
++	guint8 num_subbands = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_subbands, 1, ENC_BIG_ENDIAN);
++
++	// numAntennas
++	guint8 num_phy_ant = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_antennas, 1, ENC_BIG_ENDIAN);
++
++	ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_subbands, "Subbands");
++
++	for (i = 0; i < num_subbands; ++i)
++	{
++		ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_subbands, "[%d]", i);
++
++		// subbandIndex
++		ptvcursor_add(ptvc, hf_nfapi_subband_index, 1, ENC_BIG_ENDIAN);
++
++		ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_antennas, "Physical Antennas");
++
++		for (j = 0; j < num_phy_ant; ++j)
++		{
++			ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_antennas, "[%d]", j);
++
++			// Channel
++			ptvcursor_add(ptvc, hf_nfapi_channel_coefficient, 2, ENC_BIG_ENDIAN);
++
++			ptvcursor_pop_subtree(ptvc);
++		}
++
++		ptvcursor_pop_subtree(ptvc);
++
++		ptvcursor_pop_subtree(ptvc);
++	}
++
++	ptvcursor_pop_subtree(ptvc);
++}
++static void dissect_srs_indication_rel11_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	//UL_RTOA
++	guint16 ul_rtoa_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_ul_rtoa, 2, ENC_BIG_ENDIAN);
++	if (ul_rtoa_value > 4800)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid ul rtoa value [0..4800]");
++	}
++}
++static void dissect_lbt_dl_config_request_pdsch_req_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Handle
++	ptvcursor_add(ptvc, hf_nfapi_handle, 4, ENC_BIG_ENDIAN);
++
++	// nCCA
++	ptvcursor_add(ptvc, hf_nfapi_mp_cca, 4, ENC_BIG_ENDIAN);
++
++	// NCCA
++	ptvcursor_add(ptvc, hf_nfapi_n_cca, 4, ENC_BIG_ENDIAN);
++
++	// Offset
++	guint32 ul_rtoa_value = tvb_get_guint32(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc), ENC_BIG_ENDIAN);
++	item = ptvcursor_add(ptvc, hf_nfapi_offset, 4, ENC_BIG_ENDIAN);
++	if (ul_rtoa_value > 999)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid offset value [0..999]");
++	}
++
++	// LTE TXOP SF
++	ptvcursor_add(ptvc, hf_nfapi_lte_txop_sf, 4, ENC_BIG_ENDIAN);
++
++	// TXOP SFN/SF End
++	ptvcursor_add(ptvc, hf_nfapi_txop_sfn_sf_end, 2, ENC_BIG_ENDIAN);
++
++	// LBT mode
++	guint32 lbt_mode = tvb_get_guint32(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc), ENC_BIG_ENDIAN);
++	item = ptvcursor_add(ptvc, hf_nfapi_lbt_mode, 4, ENC_BIG_ENDIAN);
++	if (lbt_mode > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid offset value [0..1]");
++	}
++}
++static void dissect_lbt_dl_config_request_drs_req_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Handle
++	ptvcursor_add(ptvc, hf_nfapi_handle, 4, ENC_BIG_ENDIAN);
++
++	// Offset
++	guint32 ul_rtoa_value = tvb_get_guint32(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc), ENC_BIG_ENDIAN);
++	item = ptvcursor_add(ptvc, hf_nfapi_offset, 4, ENC_BIG_ENDIAN);
++	if (ul_rtoa_value > 999)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid offset value [0..999]");
++	}
++
++	// SFN/SF End
++	ptvcursor_add(ptvc, hf_nfapi_sfn_sf_end, 2, ENC_BIG_ENDIAN);
++
++	// LBT mode
++	guint32 lbt_mode = tvb_get_guint32(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc), ENC_BIG_ENDIAN);
++	item = ptvcursor_add(ptvc, hf_nfapi_lbt_mode, 4, ENC_BIG_ENDIAN);
++	if (lbt_mode > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid offset value [0..1]");
++	}
++}
++static void dissect_lbt_dl_config_request_pdsch_resp_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Handle
++	ptvcursor_add(ptvc, hf_nfapi_handle, 4, ENC_BIG_ENDIAN);
++
++	// result
++	guint32 result_value = tvb_get_guint32(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc), ENC_BIG_ENDIAN);
++	item = ptvcursor_add(ptvc, hf_nfapi_result, 4, ENC_BIG_ENDIAN);
++	if (result_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid result value [0..1]");
++	}
++
++	// LTE TXOP symbols
++	ptvcursor_add(ptvc, hf_nfapi_txop_symbols, 4, ENC_BIG_ENDIAN);
++
++	// Initial Partial SF
++	guint32 initial_partial_sf_value = tvb_get_guint32(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc), ENC_BIG_ENDIAN);
++	item = ptvcursor_add(ptvc, hf_nfapi_initial_partial_sf, 4, ENC_BIG_ENDIAN);
++	if (initial_partial_sf_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid initial partial sf value [0..1]");
++	}
++}
++static void dissect_lbt_dl_config_request_drs_resp_rel13_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// Handle
++	ptvcursor_add(ptvc, hf_nfapi_handle, 4, ENC_BIG_ENDIAN);
++
++	// result
++	guint32 result_value = tvb_get_guint32(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc), ENC_BIG_ENDIAN);
++	item = ptvcursor_add(ptvc, hf_nfapi_result, 4, ENC_BIG_ENDIAN);
++	if (result_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid result value [0..1]");
++	}
++}
++static void dissect_tx_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// PDU length
++	guint16 len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pdu_length, 2, ENC_BIG_ENDIAN);
++
++	// PDU index
++	ptvcursor_add(ptvc, hf_nfapi_pdu_index, 2, ENC_BIG_ENDIAN);
++
++	// PDU#N
++	ptvcursor_add(ptvc, hf_nfapi_pdu, len, ENC_NA);
++}
++static void dissect_tx_request_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of PDUs
++	guint16 num_pdu = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_pdus, 2, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "TX PDU List", ett_nfapi_tx_request_pdu_list, num_pdu, dissect_tx_pdu);
++}
++static void dissect_harq_indication_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Instance Length
++	guint16 instance_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_instance_length, 2, ENC_BIG_ENDIAN);
++
++	guint instance_end = (ptvcursor_current_offset(ptvc) + instance_len - 2);
++	dissect_tlv_list(ptvc, pinfo, instance_end);
++}
++static void dissect_harq_indication_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of HARQs
++	guint16 num_pdu = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_harqs, 2, ENC_BIG_ENDIAN);
++
++
++	dissect_array_value(ptvc, pinfo, "HARQ PDU List", ett_nfapi_harq_indication_pdu_list, num_pdu, dissect_harq_indication_pdu);
++}
++static void dissect_crc_indication_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Instance Length
++	guint16 instance_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_instance_length, 2, ENC_BIG_ENDIAN);
++
++	guint instance_end = (ptvcursor_current_offset(ptvc) + instance_len - 2);
++	dissect_tlv_list(ptvc, pinfo, instance_end);
++}
++static void dissect_crc_indication_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of CRCs
++	guint16 num_pdu = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_crcs, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "CRC PDU List", ett_nfapi_crc_indication_pdu_list, num_pdu, dissect_crc_indication_pdu);
++}
++static void dissect_sr_indication_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Instance Length
++	guint16 instance_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_instance_length, 2, ENC_BIG_ENDIAN);
++
++	guint instance_end = (ptvcursor_current_offset(ptvc) + instance_len - 2);
++	dissect_tlv_list(ptvc, pinfo, instance_end);
++}
++static void dissect_rx_sr_indication_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of SRs
++	guint16 num_pdu = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_srs, 2, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "SR PDU List", ett_nfapi_sr_indication_pdu_list, num_pdu, dissect_sr_indication_pdu);
++}
++static void dissect_cqi_indication_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Instance Length
++	guint16 instance_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_instance_length, 2, ENC_BIG_ENDIAN);
++
++	guint instance_end = (ptvcursor_current_offset(ptvc) + instance_len - 2);
++	dissect_tlv_list(ptvc, pinfo, instance_end);
++}
++static void dissect_rx_cqi_indication_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of PDUs
++	guint16 num_pdu = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_cqi, 2, ENC_BIG_ENDIAN);
++
++	guint16* lengths = (guint16*)wmem_alloc0(wmem_packet_scope(), num_pdu * 2);
++	memset(lengths, 0, num_pdu * 2);
++
++	tvbuff_t* tvb = ptvcursor_tvbuff(ptvc);
++	guint8 tmp_offset = ptvcursor_current_offset(ptvc);
++
++	int i = 0;
++	for (i = 0; i < num_pdu; ++i)
++	{
++		guint16 instance_len = tvb_get_ntohs(tvb, tmp_offset);
++		tmp_offset += 2;
++		guint8 pdu_end = tmp_offset + instance_len;
++
++		while (tmp_offset < pdu_end)
++		{
++			guint16 tlv_id = tvb_get_ntohs(tvb, tmp_offset);
++			tmp_offset += 2;
++			guint16 tlv_len = tvb_get_ntohs(tvb, tmp_offset);
++			tmp_offset += 2;
++
++			if (tlv_id == 0x202F)
++			{
++				lengths[i] = tvb_get_ntohs(tvb, tmp_offset);
++			}
++			else if (tlv_id == 0x2030)
++			{
++				lengths[i] = tvb_get_ntohs(tvb, tmp_offset);
++			}
++
++			tmp_offset += tlv_len;
++		}
++	}
++
++	dissect_array_value(ptvc, pinfo, "CQI PDU List", ett_nfapi_cqi_indication_pdu_list, num_pdu, dissect_cqi_indication_pdu);
++
++	for (i = 0; i < num_pdu; ++i)
++	{
++		ptvcursor_add(ptvc, hf_nfapi_pdu, lengths[i], ENC_NA);
++	}
++}
++static void dissect_preamble_indication_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Instance Length
++	guint16 instance_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_instance_length, 2, ENC_BIG_ENDIAN);
++
++	guint instance_end = (ptvcursor_current_offset(ptvc) + instance_len - 2);
++	dissect_tlv_list(ptvc, pinfo, instance_end);
++}
++static void dissect_rach_indication_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of Preambles
++	guint16 num_pdu = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_preambles, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "Preamble PDU List", ett_nfapi_preamble_indication_pdu_list, num_pdu, dissect_preamble_indication_pdu);
++}
++static void dissect_srs_indication_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Instance Length
++	guint16 instance_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_instance_length, 2, ENC_BIG_ENDIAN);
++	guint instance_end = (ptvcursor_current_offset(ptvc) + instance_len - 2);
++	dissect_tlv_list(ptvc, pinfo, instance_end);
++}
++static void dissect_srs_indication_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of UEs
++	guint8 num_pdu = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_srss, 1, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "SRS PDU List", ett_nfapi_srs_indication_pdu_list, num_pdu, dissect_srs_indication_pdu);
++}
++static void dissect_lbt_dl_config_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// PDU Type
++	guint8 pdu_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_lbt_dl_req_pdu_type, 1, ENC_BIG_ENDIAN);
++	if (pdu_type_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pdu type value [0..1]");
++	}
++
++	guint8 size = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pdu_size, 1, ENC_BIG_ENDIAN);
++	guint pdu_end = (ptvcursor_current_offset(ptvc) + size - 2);
++
++	dissect_tlv_list(ptvc, pinfo, pdu_end);
++}
++static void dissect_lbt_dl_config_request_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of  PDUs
++	guint16 num_pdu = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_number_pdus, 2, ENC_BIG_ENDIAN);
++	if (!(num_pdu >= 1 && num_pdu <= 2))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of pdus value [1..2]");
++	}
++
++	dissect_array_value(ptvc, pinfo, "LBT DL PDU List", ett_nfapi_lbt_dl_config_pdu_list, num_pdu, dissect_lbt_dl_config_pdu);
++}
++static void dissect_lbt_dl_indication_pdu(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// PDU Type
++	guint8 pdu_type_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_lbt_dl_ind_pdu_type, 1, ENC_BIG_ENDIAN);
++	if (pdu_type_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid pdu type value [0..1]");
++	}
++
++	// PDU Size
++	guint8 size = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pdu_size, 1, ENC_BIG_ENDIAN);
++	guint pdu_end = (ptvcursor_current_offset(ptvc) + size - 2);
++	dissect_tlv_list(ptvc, pinfo, pdu_end);
++}
++static void dissect_lbt_indication_message_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of  PDUs
++	guint16 num_pdu = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_number_pdus, 2, ENC_BIG_ENDIAN);
++	if (!(num_pdu >= 1 && num_pdu <= 2))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of pdus value [1..2]");
++	}
++
++	dissect_array_value(ptvc, pinfo, "LBT DL PDU List", ett_nfapi_lbt_dl_indication_pdu_list, num_pdu, dissect_lbt_dl_indication_pdu);
++}
++static void dissect_lte_rssi_request_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Frequency Band Indicator
++	ptvcursor_add(ptvc, hf_nfapi_frequency_band_indicator, 1, ENC_BIG_ENDIAN);
++
++	// Measurement Period
++	ptvcursor_add(ptvc, hf_nfapi_measurement_period, 2, ENC_BIG_ENDIAN);
++
++	// Bandwidth
++	guint8 bandwidth_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_bandwidth, 1, ENC_BIG_ENDIAN);
++	if (!(bandwidth_value == 6 || bandwidth_value == 15 || bandwidth_value == 25 ||
++		bandwidth_value == 50 || bandwidth_value == 75 || bandwidth_value == 100))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid bandwidth value [6, 15, 25, 50, 75, 100]");
++	}
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++
++	// Number of EARFCNs
++	guint8 num_earfcns = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_earfcns, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "EARFCNs", ett_nfapi_earfcn_list, num_earfcns, dissect_earfcn_value);
++}
++static void dissect_uarfcn_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// UARFCN
++	ptvcursor_add(ptvc, hf_nfapi_uarfcn, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_utran_rssi_request_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Frequency Band Indicator
++	ptvcursor_add(ptvc, hf_nfapi_frequency_band_indicator, 1, ENC_BIG_ENDIAN);
++
++	// Measurement Period
++	ptvcursor_add(ptvc, hf_nfapi_measurement_period, 2, ENC_BIG_ENDIAN);
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++
++	// Number of UARFCNs
++	guint8 num_uarfcns = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_uarfcns, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "UARFCNs", ett_nfapi_uarfcn_list, num_uarfcns, dissect_uarfcn_value);
++}
++static void dissect_arfcn_dir_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// ARFCN
++	ptvcursor_add(ptvc, hf_nfapi_arfcn, 2, ENC_BIG_ENDIAN);
++
++	// Direction
++	guint8 direction_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_arfcn_direction, 1, ENC_BIG_ENDIAN);
++	if (direction_value > 1)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid direction value [0..1]");
++	}
++
++}
++static void dissect_geran_rssi_request_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Frequency Band Indicator
++	ptvcursor_add(ptvc, hf_nfapi_frequency_band_indicator, 1, ENC_BIG_ENDIAN);
++
++	// Measurement Period
++	ptvcursor_add(ptvc, hf_nfapi_measurement_period, 2, ENC_BIG_ENDIAN);
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++
++	// Number of ARFCNs
++	guint8 num_arfcns = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_arfcns, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "ARFCNs", ett_nfapi_arfcn_list, num_arfcns, dissect_arfcn_dir_value);
++}
++static void dissect_rssi_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// RSSI
++	ptvcursor_add(ptvc, hf_nfapi_rssi, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_rssi_indication_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of RSSI
++	guint16 num_rssi = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_rssi, 2, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "ARFCNs", ett_nfapi_rssi_list, num_rssi, dissect_rssi_value);
++}
++static void dissect_pci_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// PCI
++	ptvcursor_add(ptvc, hf_nfapi_pci, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_lte_cell_search_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// EARFCN
++	ptvcursor_add(ptvc, hf_nfapi_earfcn, 2, ENC_BIG_ENDIAN);
++
++	// Measurement Bandwidth
++	ptvcursor_add(ptvc, hf_nfapi_measurement_bandwidth, 1, ENC_BIG_ENDIAN);
++
++	// Exhaustive Search
++	ptvcursor_add(ptvc, hf_nfapi_exhaustive_search, 1, ENC_BIG_ENDIAN);
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++
++	// Number of PCI
++	guint8 num_pci = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_pci, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "PCIs", ett_nfapi_pci_list, num_pci, dissect_pci_value);
++}
++static void dissect_psc_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// PSC
++	ptvcursor_add(ptvc, hf_nfapi_psc, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_utran_cell_search_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// UARFCN
++	ptvcursor_add(ptvc, hf_nfapi_uarfcn, 2, ENC_BIG_ENDIAN);
++
++	// Exhaustive Search
++	ptvcursor_add(ptvc, hf_nfapi_exhaustive_search, 1, ENC_BIG_ENDIAN);
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++
++	// Number of PSC
++	guint8 num_psc = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_psc, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "PSCs", ett_nfapi_psc_list, num_psc, dissect_psc_value);
++}
++static void dissect_arfcn_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// ARFCN
++	ptvcursor_add(ptvc, hf_nfapi_arfcn, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_geran_cell_search_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++
++	// Number of ARFCN
++	guint8 num_arfcn = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_arfcns, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "ARFCNs", ett_nfapi_arfcn_list, num_arfcn, dissect_arfcn_value);
++}
++
++static void dissect_lte_cell_found_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// PCI
++	ptvcursor_add(ptvc, hf_nfapi_pci, 2, ENC_BIG_ENDIAN);
++
++	// RSRP
++	ptvcursor_add(ptvc, hf_nfapi_rsrp, 1, ENC_BIG_ENDIAN);
++
++	// RSRQ
++	ptvcursor_add(ptvc, hf_nfapi_rsrq, 1, ENC_BIG_ENDIAN);
++
++	// Frequency Offset
++	ptvcursor_add(ptvc, hf_nfapi_frequency_offset, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_lte_cell_search_indication_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of LTE Cells Found
++	guint16 num_lte_cells = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_lte_cells_found, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "LTE Cells Found", ett_nfapi_lte_cells_found_list, num_lte_cells, dissect_lte_cell_found_value);
++}
++static void dissect_utran_cell_found_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// PSC
++	ptvcursor_add(ptvc, hf_nfapi_psc, 2, ENC_BIG_ENDIAN);
++
++	// RSCP
++	ptvcursor_add(ptvc, hf_nfapi_rscp, 1, ENC_BIG_ENDIAN);
++
++	// EcN0
++	ptvcursor_add(ptvc, hf_nfapi_enco, 1, ENC_BIG_ENDIAN);
++
++	// Frequency Offset
++	ptvcursor_add(ptvc, hf_nfapi_frequency_offset, 2, ENC_BIG_ENDIAN);
++}
++static void dissect_utran_cell_search_indication_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of UTRAN Cells Found
++	guint16 num_utran_cells = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_utran_cells_found, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "UTRAN Cells Found", ett_nfapi_utran_cells_found_list, num_utran_cells, dissect_utran_cell_found_value);
++}
++static void dissect_geran_cell_found_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// ARFCN
++	ptvcursor_add(ptvc, hf_nfapi_arfcn, 2, ENC_BIG_ENDIAN);
++
++	// BSIC
++	ptvcursor_add(ptvc, hf_nfapi_bsic, 1, ENC_BIG_ENDIAN);
++
++	// RxLev
++	ptvcursor_add(ptvc, hf_nfapi_rxlev, 1, ENC_BIG_ENDIAN);
++
++	// RxQual
++	ptvcursor_add(ptvc, hf_nfapi_rxqual, 1, ENC_BIG_ENDIAN);
++
++	// Frequency Offset
++	ptvcursor_add(ptvc, hf_nfapi_frequency_offset, 2, ENC_BIG_ENDIAN);
++
++	// SFN Offset
++	ptvcursor_add(ptvc, hf_nfapi_sfn_offset, 4, ENC_BIG_ENDIAN);
++}
++static void dissect_geran_cell_search_indication_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of GSM Cells Found
++	guint16 num_geran_cells = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_geran_cells_found, 2, ENC_BIG_ENDIAN);
++	dissect_array_value(ptvc, pinfo, "GERAN Cells Found", ett_nfapi_geran_cells_found_list, num_geran_cells, dissect_geran_cell_found_value);
++}
++static void dissect_pnf_cell_search_state_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint len = tvb_reported_length_remaining(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pnf_search_state, len, ENC_NA);
++}
++static void dissect_pnf_cell_broadcast_state_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint len = tvb_reported_length_remaining(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_pnf_broadcast_state, len, ENC_NA);
++}
++static void dissect_lte_broadcast_detect_request_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// EARFCN
++	ptvcursor_add(ptvc, hf_nfapi_earfcn, 2, ENC_BIG_ENDIAN);
++
++	// PCI
++	ptvcursor_add(ptvc, hf_nfapi_pci, 2, ENC_BIG_ENDIAN);
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++}
++static void dissect_utran_broadcast_detect_request_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// UARFCN
++	ptvcursor_add(ptvc, hf_nfapi_uarfcn, 2, ENC_BIG_ENDIAN);
++
++	// PSC
++	ptvcursor_add(ptvc, hf_nfapi_psc, 2, ENC_BIG_ENDIAN);
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++}
++static void dissect_lte_broadcast_detect_indication_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// Number of Tx Antenna
++	guint8 number_of_tx_antenna_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_number_of_tx_antenna, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_tx_antenna_value == 1 || number_of_tx_antenna_value == 2 || number_of_tx_antenna_value == 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of tx antenna value [1, 2, 4]");
++	}
++
++
++	// MIB Length
++	guint16 mib_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_mib_length, 2, ENC_BIG_ENDIAN);
++
++	// MIB[MIB Length]
++	ptvcursor_add(ptvc, hf_nfapi_mib, mib_len, ENC_NA);
++
++	// SFN Offset
++	ptvcursor_add(ptvc, hf_nfapi_sfn_offset, 4, ENC_BIG_ENDIAN);
++}
++static void dissect_utran_broadcast_detect_indication_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// MIB Length
++	guint16 mib_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_mib_length, 2, ENC_BIG_ENDIAN);
++
++	// MIB[MIB Length]
++	ptvcursor_add(ptvc, hf_nfapi_mib, mib_len, ENC_NA);
++
++	// SFN Offset
++	ptvcursor_add(ptvc, hf_nfapi_sfn_offset, 4, ENC_BIG_ENDIAN);
++}
++static void dissect_lte_system_information_schedule_request_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// EARFCN
++	ptvcursor_add(ptvc, hf_nfapi_earfcn, 2, ENC_BIG_ENDIAN);
++
++	// PCI
++	ptvcursor_add(ptvc, hf_nfapi_pci, 2, ENC_BIG_ENDIAN);
++
++	// Bandwidth
++	guint16 bandwidth_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_bandwidth, 2, ENC_BIG_ENDIAN);
++	if (!(bandwidth_value == 6 || bandwidth_value == 15 || bandwidth_value == 25 ||
++		bandwidth_value == 50 || bandwidth_value == 75 || bandwidth_value == 100))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid bandwidth value [6, 15, 25, 50, 75, 100]");
++	}
++
++	// PHICH Configuration
++	// todo : phich bit decode
++	ptvcursor_add(ptvc, hf_nfapi_phich_configuration, 1, ENC_BIG_ENDIAN);
++
++	// Number of Tx Antenna
++	guint8 number_of_tx_antenna_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_tx_antenna, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_tx_antenna_value == 1 || number_of_tx_antenna_value == 2 || number_of_tx_antenna_value == 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of tx antenna value [1, 2, 4]");
++	}
++
++	// retryCount
++	ptvcursor_add(ptvc, hf_nfapi_retry_count, 1, ENC_BIG_ENDIAN);
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++}
++static void dissect_lte_system_information_schedule_indication_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// this needs to be SIB 1
++	guint len = tvb_reported_length_remaining(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_sib1, len, ENC_NA);
++}
++static void dissect_si_periodicity_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	proto_item* item;
++
++	// SI Periodicity
++	guint8 si_periodicity_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_si_periodicity, 1, ENC_BIG_ENDIAN);
++	if (si_periodicity_value > 7)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid si periodicity value [0..7]");
++	}
++
++	// SI Index
++	guint8 si_index_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_si_index, 1, ENC_BIG_ENDIAN);
++	if (si_index_value > 32)
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid si index value [0..32]");
++	}
++}
++
++static void dissect_lte_system_information_request_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// EARFCN
++	ptvcursor_add(ptvc, hf_nfapi_earfcn, 2, ENC_BIG_ENDIAN);
++
++	// PCI
++	ptvcursor_add(ptvc, hf_nfapi_pci, 2, ENC_BIG_ENDIAN);
++
++	// Downlink channel bandwidth
++	guint16 bandwidth_value = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_downlink_channel_bandwidth, 2, ENC_BIG_ENDIAN);
++	if (!(bandwidth_value == 6 || bandwidth_value == 15 || bandwidth_value == 25 ||
++		bandwidth_value == 50 || bandwidth_value == 75 || bandwidth_value == 100))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid bandwidth value [6, 15, 25, 50, 75, 100]");
++	}
++
++	// PHICH Configuration
++	ptvcursor_add(ptvc, hf_nfapi_phich_configuration, 1, ENC_BIG_ENDIAN);
++
++	// Number of Tx Antenna
++	guint8 number_of_tx_antenna_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_number_of_tx_antenna, 1, ENC_BIG_ENDIAN);
++	if (!(number_of_tx_antenna_value == 1 || number_of_tx_antenna_value == 2 || number_of_tx_antenna_value == 4))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid number of tx antenna value [1, 2, 4]");
++	}
++
++	// Number of SI Periodicity
++	guint8 si_priodicity = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_of_si_periodicity, 1, ENC_BIG_ENDIAN);
++
++	dissect_array_value(ptvc, pinfo, "Number SI Periodicity", ett_nfapi_si_periodicity_list, si_priodicity, dissect_si_periodicity_value);
++
++	// SI Window Length
++	guint8 si_window_length_value = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	item = ptvcursor_add(ptvc, hf_nfapi_si_window_length, 1, ENC_BIG_ENDIAN);
++	if (!(si_window_length_value == 1 || si_window_length_value == 2 || si_window_length_value == 5 || si_window_length_value == 10 ||
++		  si_window_length_value == 15 || si_window_length_value == 20 || si_window_length_value == 40))
++	{
++		expert_add_info_format(pinfo, item, &ei_invalid_range, "Invalid si window length value [1, 2, 5, 10, 15, 20, 40]");
++	}
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++}
++static void dissect_utran_system_information_request_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// UARFCN
++	ptvcursor_add(ptvc, hf_nfapi_uarfcn, 2, ENC_BIG_ENDIAN);
++
++	// PSC
++	ptvcursor_add(ptvc, hf_nfapi_psc, 2, ENC_BIG_ENDIAN);
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++}
++static void dissect_geran_system_information_request_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// ARFCN
++	ptvcursor_add(ptvc, hf_nfapi_arfcn, 2, ENC_BIG_ENDIAN);
++
++	// BSIC
++	ptvcursor_add(ptvc, hf_nfapi_bsic, 1, ENC_BIG_ENDIAN);
++
++	// Timeout
++	ptvcursor_add(ptvc, hf_nfapi_timeout, 4, ENC_BIG_ENDIAN);
++}
++static void dissect_lte_system_information_indication_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// SIB Type
++	ptvcursor_add(ptvc, hf_nfapi_sib_type, 1, ENC_BIG_ENDIAN);
++
++	// SIB Length
++	guint16 sib_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_sib_len, 2, ENC_BIG_ENDIAN);
++
++	// SIB[SIB Length]
++	ptvcursor_add(ptvc, hf_nfapi_sib, sib_len, ENC_NA);
++}
++static void dissect_utran_system_information_indication_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// SIB Length
++	guint16 sib_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_sib_len, 2, ENC_BIG_ENDIAN);
++
++	// SIB[SIB Length]
++	ptvcursor_add(ptvc, hf_nfapi_sib, sib_len, ENC_NA);
++}
++static void dissect_geran_system_information_indication_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	// SI Length
++	guint16 si_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_si_len, 2, ENC_BIG_ENDIAN);
++
++	// SI[SI Length]
++	ptvcursor_add(ptvc, hf_nfapi_si, si_len, ENC_NA);
++}
++
++static void dissect_rx_indication_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_);
++
++// Important the tags must be in numerical order so that they can be indexed correctly
++const tlv_t nfapi_tags[] =
++{
++	{ 0x1000, "PNF Param General", dissect_pnf_param_general_value },
++	{ 0x1001, "PNF PHY", dissect_pnf_phy_value },
++	{ 0x1002, "PNF RF", dissect_pnf_rf_value },
++	{ 0x1003, "PNF PHY RF Config", dissect_pnf_phy_rf_config_value },
++	{ 0x1004, "DL RS Tx power", dissect_dl_rs_tx_power_value },
++	{ 0x1005, "Received interference power", dissect_received_interference_power_value },
++	{ 0x1006, "Thermal noise power", dissect_thermal_noise_power_value },
++	{ 0x1007, "DL RS TX Power measurement", dissect_dl_rs_tx_power_measurement_value },
++	{ 0x1008, "Received Interference power measurement", dissect_received_interference_power_measurement_value },
++	{ 0x1009, "Thermal noise power measurement", dissect_thermal_noise_power_measurement_value },
++	{ 0x100A, "PNF PHY Rel 10", dissect_pnf_phy_rel10_value },
++	{ 0x100B, "PNF PHY Rel 11", dissect_pnf_phy_rel11_value },
++	{ 0x100C, "PNF PHY Rel 12", dissect_pnf_phy_rel12_value },
++	{ 0x100D, "PNF PHY Rel 13", dissect_pnf_phy_rel13_value },
++};
++
++const tlv_t configuration_tags[] =
++{
++	{ 0x0000, NULL, NULL },
++	{ 0x0001, "Subframe config - Duplex Mode", dissect_duplex_mode_value },
++	{ 0x0002, "Subframe config - PCFICH power offset TLV", dissect_pcfich_power_offset_value },
++	{ 0x0003, "Subframe config - P-B", dissect_pb_value },
++	{ 0x0004, "Subframe config - DL cyclic prefix type", dissect_dl_cyclic_prefix_value },
++	{ 0x0005, "Subframe config - UL cyclic prefix type", dissect_ul_cyclic_prefix_value },
++	{ 0x0006, NULL, NULL },
++	{ 0x0007, NULL, NULL },
++	{ 0x0008, NULL, NULL },
++	{ 0x0009, NULL, NULL },
++	{ 0x000A, "RF config - Downlink channel bandwidth", dissect_dl_channel_bandwidth_value },
++	{ 0x000B, "RF config - Uplink channel bandwidth", dissect_ul_channel_bandwidth_value },
++	{ 0x000C, "RF config - Reference signal power", dissect_reference_signal_power_value },
++	{ 0x000D, "RF config - Tx antenna ports", dissect_tx_antenna_ports_value },
++	{ 0x000E, "RF config - Rx Antenna ports", dissect_rx_antenna_ports_value },
++	{ 0x000F, NULL, NULL },
++	{ 0x0010, NULL, NULL },
++	{ 0x0011, NULL, NULL },
++	{ 0x0012, NULL, NULL },
++	{ 0x0013, NULL, NULL },
++	{ 0x0014, "PHICH config - PHICH resource", dissect_phich_resource_value },
++	{ 0x0015, "PHICH config - PHICH duration", dissect_phich_duration_value },
++	{ 0x0016, "PHICH config - PHICH power offset", dissect_phich_power_offset_value },
++	{ 0x0017, NULL, NULL },
++	{ 0x0018, NULL, NULL },
++	{ 0x0019, NULL, NULL },
++	{ 0x001A, NULL, NULL },
++	{ 0x001B, NULL, NULL },
++	{ 0x001C, NULL, NULL },
++	{ 0x001D, NULL, NULL },
++	{ 0x001E, "SCH config - Primary synchronization signal EPRE/EPRERS", dissect_psch_synch_signal_epre_eprers_value },
++	{ 0x001F, "SCH config - Secondary synchronization signal EPRE/EPRERS", dissect_ssch_synch_signal_epre_eprers_value },
++	{ 0x0020, "SCH config - Physical Cell Id", dissect_physical_cell_id_value },
++	{ 0x0021, NULL, NULL },
++	{ 0x0022, NULL, NULL },
++	{ 0x0023, NULL, NULL },
++	{ 0x0024, NULL, NULL },
++	{ 0x0025, NULL, NULL },
++	{ 0x0026, NULL, NULL },
++	{ 0x0027, NULL, NULL },
++	{ 0x0028, "PRACH config - Configuration index", dissect_prach_configuration_index_value },
++	{ 0x0029, "PRACH config - Root sequence index", dissect_prach_root_sequence_index_value },
++	{ 0x002A, "PRACH config - Zero correlation zone configuration", dissect_prach_zero_correlation_zone_configuration_value },
++	{ 0x002B, "PRACH config - High speed flag", dissect_prach_high_speed_flag_value },
++	{ 0x002C, "PRACH config - Frequency offset", dissect_prach_frequency_offset_value },
++	{ 0x002D, NULL, NULL },
++	{ 0x002E, NULL, NULL },
++	{ 0x002F, NULL, NULL },
++	{ 0x0030, NULL, NULL },
++	{ 0x0031, NULL, NULL },
++	{ 0x0032, "PUSCH config - Hopping mode", dissect_pusch_hopping_mode_value },
++	{ 0x0033, "PUSCH config - Hopping offset", dissect_pusch_hopping_offset_value },
++	{ 0x0034, "PUSCH config - Number of sub-bands", dissect_pusch_number_of_subbands_value },
++	{ 0x0035, NULL, NULL },
++	{ 0x0036, NULL, NULL },
++	{ 0x0037, NULL, NULL },
++	{ 0x0038, NULL, NULL },
++	{ 0x0039, NULL, NULL },
++	{ 0x003A, NULL, NULL },
++	{ 0x003B, NULL, NULL },
++	{ 0x003C, "PUCCH config - Delta PUCCH Shift", dissect_pucch_delta_pucch_shift_value },
++	{ 0x003D, "PUCCH config - N_CQI RB", dissect_pucch_n_cqi_rb_value },
++	{ 0x003E, "PUCCH config - N_AN CS", dissect_pucch_n_an_cs_value },
++	{ 0x003F, "PUCCH config - N1Pucch-AN", dissect_pucch_n1_pucch_an_value },
++	{ 0x0040, NULL, NULL },
++	{ 0x0041, NULL, NULL },
++	{ 0x0042, NULL, NULL },
++	{ 0x0043, NULL, NULL },
++	{ 0x0044, NULL, NULL },
++	{ 0x0045, NULL, NULL },
++	{ 0x0046, "SRS config - Bandwidth configuration", dissect_srs_bandwidth_configuration_value },
++	{ 0x0047, "SRS config - MaxUpPTS", dissect_srs_max_uppts_value },
++	{ 0x0048, "SRS config - SRS subframe configuration", dissect_srs_subframe_configuration_value },
++	{ 0x0049, "SRS config - SRS AckNack SRS simultaneous transmission", dissect_srs_acknack_srs_sim_tx_value },
++	{ 0x004A, NULL, NULL },
++	{ 0x004B, NULL, NULL },
++	{ 0x004C, NULL, NULL },
++	{ 0x004D, NULL, NULL },
++	{ 0x004E, NULL, NULL },
++	{ 0x004F, NULL, NULL },
++	{ 0x0050, "Uplink reference signal config - Uplink RS hopping", dissect_uplink_rs_hopping_value },
++	{ 0x0051, "Uplink reference signal config - Group assignment (delta sequence-shift pattern)", dissect_group_assignment_value },
++	{ 0x0052, "Uplink reference signal config - Cyclic Shift 1 for DMRS", dissect_cyclic_shift_1_for_drms_value },
++	{ 0x0053, NULL, NULL },
++	{ 0x0054, NULL, NULL },
++	{ 0x0055, NULL, NULL },
++	{ 0x0056, NULL, NULL },
++	{ 0x0057, NULL, NULL },
++	{ 0x0058, NULL, NULL },
++	{ 0x0059, NULL, NULL },
++	{ 0x005A, "TDD frame structure config - Subframe assignment", dissect_tdd_subframe_assignement_value },
++	{ 0x005B, "TDD frame structure config - Special sub-frame patterns", dissect_tdd_subframe_patterns_value },
++	{ 0x005C, NULL, NULL },
++	{ 0x005D, NULL, NULL },
++	{ 0x005E, NULL, NULL },
++	{ 0x005F, NULL, NULL },
++	{ 0x0060, NULL, NULL },
++	{ 0x0061, NULL, NULL },
++	{ 0x0062, NULL, NULL },
++	{ 0x0063, NULL, NULL },
++	{ 0x0064, "LAA config - ED Threshold for LBT for PDSCH", dissect_laa_ed_threashold_for_lbt_for_pdsch_value },
++	{ 0x0065, "LAA config - ED Threshold for LBT for DRS", dissect_laa_ed_threashold_for_lbt_for_drs_value },
++	{ 0x0066, "LAA config - PD Threshold", dissect_laa_pd_threshold_value },
++	{ 0x0067, "LAA config - Multi carrier type", dissect_laa_multi_carrier_type_value },
++	{ 0x0068, "LAA config - Multi carrier TX", dissect_laa_multi_carrier_tx_value },
++	{ 0x0069, "LAA config - Multi carrier freeze", dissect_laa_multi_carrier_freeze_value },
++	{ 0x006A, "LAA config - Tx antenna ports for DRS", dissect_laa_tx_antenna_port_for_drs_value },
++	{ 0x006B, "LAA config - Transmission power for DRS", dissect_laa_transmission_power_for_drs_value },
++	{ 0x006C, NULL, NULL },
++	{ 0x006D, NULL, NULL },
++	{ 0x006E, NULL, NULL },
++	{ 0x006F, NULL, NULL },
++	{ 0x0070, NULL, NULL },
++	{ 0x0071, NULL, NULL },
++	{ 0x0072, NULL, NULL },
++	{ 0x0073, NULL, NULL },
++	{ 0x0074, NULL, NULL },
++	{ 0x0075, NULL, NULL },
++	{ 0x0076, NULL, NULL },
++	{ 0x0077, NULL, NULL },
++	{ 0x0078, "eMTC config - PBCH Repetitions enable R13", dissect_emtc_pbch_repeitions_enabled_r13_value },
++	{ 0x0079, "eMTC config - PRACH CAT-M Root sequence index", dissect_emtc_prach_cat_m_root_sequence_index_value },
++	{ 0x007A, "eMTC config - PRACH CAT-M Zero correlation zone configuration", dissect_emtc_prach_cat_m_zero_correlation_zone_configuration_value },
++	{ 0x007B, "eMTC config - PRACH CAT-M High speed flag", dissect_emtc_prach_cat_m_high_speed_flag_value },
++	{ 0x007C, "eMTC config - PRACH CE level #0 Enable", dissect_emtc_prach_ce_level_0_enabled_value },
++	{ 0x007D, "eMTC config - PRACH CE level #0 Configuration index", dissect_emtc_prach_ce_level_0_configuration_offset_value },
++	{ 0x007E, "eMTC config - PRACH CE level #0 Frequency offset", dissect_emtc_prach_ce_level_0_frequency_offset_value },
++	{ 0x007F, "eMTC config - PRACH CE level #0 Number of repetitions per attempt", dissect_emtc_preach_ce_level_0_num_of_repeitions_per_attempt_value },
++	{ 0x0080, "eMTC config - CE level #0 Starting subframe periodicity", dissect_emtc_ce_level_0_starting_subframe_periodicity_value },
++	{ 0x0081, "eMTC config - PRACH CE level #0 Hopping Enable", dissect_emtc_preach_ce_level_0_hopping_enabled_value },
++	{ 0x0082, "eMTC config - PRACH CE level #0 Hopping Offset", dissect_emtc_preach_ce_level_0_hopping_offset_value },
++	{ 0x0083, "eMTC config - PRACH CE level #1 Enable", dissect_emtc_prach_ce_level_1_enabled_value },
++	{ 0x0084, "eMTC config - PRACH CE level #1 Configuration index", dissect_emtc_prach_ce_level_1_configuration_offset_value },
++	{ 0x0085, "eMTC config - PRACH CE level #1 Frequency offset", dissect_emtc_prach_ce_level_1_frequency_offset_value },
++	{ 0x0086, "eMTC config - PRACH CE level #1 Number of repetitions per attempt", dissect_emtc_preach_ce_level_1_num_of_repeitions_per_attempt_value },
++	{ 0x0087, "eMTC config - CE level #1 Starting subframe periodicity", dissect_emtc_ce_level_1_starting_subframe_periodicity_value },
++	{ 0x0088, "eMTC config - PRACH CE level #1 Hopping Enable", dissect_emtc_preach_ce_level_1_hopping_enabled_value },
++	{ 0x0089, "eMTC config - PRACH CE level #1 Hopping Offset", dissect_emtc_preach_ce_level_1_hopping_offset_value },
++	{ 0x008A, "eMTC config - PRACH CE level #2 Enable", dissect_emtc_prach_ce_level_2_enabled_value },
++	{ 0x008B, "eMTC config - PRACH CE level #2 Configuration index", dissect_emtc_prach_ce_level_2_configuration_offset_value },
++	{ 0x008C, "eMTC config - PRACH CE level #2 Frequency offset", dissect_emtc_prach_ce_level_2_frequency_offset_value },
++	{ 0x008D, "eMTC config - PRACH CE level #2 Number of repetitions per attempt", dissect_emtc_preach_ce_level_2_num_of_repeitions_per_attempt_value },
++	{ 0x008E, "eMTC config - CE level #2 Starting subframe periodicity", dissect_emtc_ce_level_2_starting_subframe_periodicity_value },
++	{ 0x008F, "eMTC config - PRACH CE level #2 Hopping Enable", dissect_emtc_preach_ce_level_2_hopping_enabled_value },
++	{ 0x0090, "eMTC config - PRACH CE level #2 Hopping Offset", dissect_emtc_preach_ce_level_2_hopping_offset_value },
++	{ 0x0091, "eMTC config - PRACH CE level #3 Enable", dissect_emtc_prach_ce_level_3_enabled_value },
++	{ 0x0092, "eMTC config - PRACH CE level #3 Configuration index", dissect_emtc_prach_ce_level_3_configuration_offset_value },
++	{ 0x0093, "eMTC config - PRACH CE level #3 Frequency offset", dissect_emtc_prach_ce_level_3_frequency_offset_value },
++	{ 0x0094, "eMTC config - PRACH CE level #3 Number of repetitions per attempt", dissect_emtc_preach_ce_level_3_num_of_repeitions_per_attempt_value },
++	{ 0x0095, "eMTC config - CE level #3 Starting subframe periodicity", dissect_emtc_ce_level_3_starting_subframe_periodicity_value },
++	{ 0x0096, "eMTC config - PRACH CE level #3 Hopping Enable", dissect_emtc_preach_ce_level_3_hopping_enabled_value },
++	{ 0x0097, "eMTC config - PRACH CE level #3 Hopping Offset", dissect_emtc_preach_ce_level_3_hopping_offset_value },
++	{ 0x0098, "eMTC config - PUCCH Interval - ULHoppingConfigCommonModeA", dissect_emtc_pucch_interval_ul_hopping_config_common_mode_a_value },
++	{ 0x0099, "eMTC config - PUCCH Interval - ULHoppingConfigCommonModeB", dissect_emtc_pucch_interval_ul_hopping_config_common_mode_b_value },
++	{ 0x009A, NULL, NULL },
++	{ 0x009B, NULL, NULL },
++	{ 0x009C, NULL, NULL },
++	{ 0x009D, NULL, NULL },
++	{ 0x009E, NULL, NULL },
++	{ 0x009F, NULL, NULL },
++	{ 0x00A0, NULL, NULL },
++	{ 0x00A1, NULL, NULL },
++	{ 0x00A2, NULL, NULL },
++	{ 0x00A3, NULL, NULL },
++	{ 0x00A4, NULL, NULL },
++	{ 0x00A5, NULL, NULL },
++	{ 0x00A6, NULL, NULL },
++	{ 0x00A7, NULL, NULL },
++	{ 0x00A8, NULL, NULL },
++	{ 0x00A9, NULL, NULL },
++	{ 0x00AA, NULL, NULL },
++	{ 0x00AB, NULL, NULL },
++	{ 0x00AC, NULL, NULL },
++	{ 0x00AD, NULL, NULL },
++	{ 0x00AE, NULL, NULL },
++	{ 0x00AF, NULL, NULL },
++	{ 0x00B0, NULL, NULL },
++	{ 0x00B1, NULL, NULL },
++	{ 0x00B2, NULL, NULL },
++	{ 0x00B3, NULL, NULL },
++	{ 0x00B4, NULL, NULL },
++	{ 0x00B5, NULL, NULL },
++	{ 0x00B6, NULL, NULL },
++	{ 0x00B7, NULL, NULL },
++	{ 0x00B8, NULL, NULL },
++	{ 0x00B9, NULL, NULL },
++	{ 0x00BA, NULL, NULL },
++	{ 0x00BB, NULL, NULL },
++	{ 0x00BC, NULL, NULL },
++	{ 0x00BD, NULL, NULL },
++	{ 0x00BE, NULL, NULL },
++	{ 0x00BF, NULL, NULL },
++	{ 0x00C0, NULL, NULL },
++	{ 0x00C1, NULL, NULL },
++	{ 0x00C2, NULL, NULL },
++	{ 0x00C3, NULL, NULL },
++	{ 0x00C4, NULL, NULL },
++	{ 0x00C5, NULL, NULL },
++	{ 0x00C6, NULL, NULL },
++	{ 0x00C7, NULL, NULL },
++	{ 0x00C8, "Layer 2/3 - Downlink Bandwidth Support", dissect_dl_bandwidth_support_value },
++	{ 0x00C9, "Layer 2/3 - Uplink Bandwidth Support", dissect_ul_bandwidth_support_value },
++	{ 0x00CA, "Layer 2/3 - Downlink modulation support", dissect_dl_modulation_value },
++	{ 0x00CB, "Layer 2/3 - Uplink modulation support", dissect_ul_modulation_value },
++	{ 0x00CC, "Layer 2/3 - PHY antenna capability", dissect_phy_antenna_capability_value },
++	{ 0x00CD, "Layer 2/3 - Release capability", dissect_release_capability_value },
++	{ 0x00CE, "Layer 2/3 - MBSFN capability", dissect_mbsfn_value },
++	{ 0x00CF, NULL, NULL },
++	{ 0x00D0, NULL, NULL },
++	{ 0x00D1, "LAA Capability - LAA support", dissect_laa_support_value },
++	{ 0x00D2, "LAA Capability - PD sensing LBT support", dissect_laa_pd_sensing_lbt_support_value },
++	{ 0x00D3, "LAA Capability - Multi carrier LBT support", dissect_laa_multi_carrier_lbt_support_value },
++	{ 0x00D4, "LAA Capability - Partial SF support", dissect_laa_partial_sf_support_value },
++	{ 0x00D5, NULL, NULL },
++	{ 0x00D6, NULL, NULL },
++	{ 0x00D7, NULL, NULL },
++	{ 0x00D8, NULL, NULL },
++	{ 0x00D9, NULL, NULL },
++	{ 0x00DA, NULL, NULL },
++	{ 0x00DB, NULL, NULL },
++	{ 0x00DC, NULL, NULL },
++	{ 0x00DD, NULL, NULL },
++	{ 0x00DE, NULL, NULL },
++	{ 0x00DF, NULL, NULL },
++	{ 0x00E0, NULL, NULL },
++	{ 0x00E1, NULL, NULL },
++	{ 0x00E2, NULL, NULL },
++	{ 0x00E3, NULL, NULL },
++	{ 0x00E4, NULL, NULL },
++	{ 0x00E5, NULL, NULL },
++	{ 0x00E6, NULL, NULL },
++	{ 0x00E7, NULL, NULL },
++	{ 0x00E8, NULL, NULL },
++	{ 0x00E9, NULL, NULL },
++	{ 0x00EA, NULL, NULL },
++	{ 0x00EB, NULL, NULL },
++	{ 0x00EC, NULL, NULL },
++	{ 0x00ED, NULL, NULL },
++	{ 0x00EE, NULL, NULL },
++	{ 0x00EF, NULL, NULL },
++	{ 0x00F0, "Layer 2/3 - Data report mode", dissect_data_report_mode_value },
++	{ 0x00F1, "Layer 2/3 - SFN/SF", dissect_sfn_sf_value },
++	{ 0x00F2, NULL, NULL },
++	{ 0x00F3, NULL, NULL },
++	{ 0x00F4, NULL, NULL },
++	{ 0x00F5, NULL, NULL },
++	{ 0x00F6, NULL, NULL },
++	{ 0x00F7, NULL, NULL },
++	{ 0x00F8, NULL, NULL },
++	{ 0x00F9, NULL, NULL },
++	{ 0x00FA, "Layer 1 - PHY state", dissect_phy_state_value },
++	{ 0x00FB, NULL, NULL },
++	{ 0x00FC, NULL, NULL },
++	{ 0x00FD, NULL, NULL },
++	{ 0x00FE, NULL, NULL },
++	{ 0x00FF, NULL, NULL },
++	{ 0x0100, "NFAPI - P7 VNF Address IPv4", dissect_p7_vnf_address_ipv4_value },
++	{ 0x0101, "NFAPI - P7 VNF Address IPv4", dissect_p7_vnf_address_ipv6_value },
++	{ 0x0102, "NFAPI - P7 Port", dissect_p7_vnf_port_value },
++	{ 0x0103, "NFAPI - P7 PNF Address IPv4", dissect_p7_pnf_address_ipv4_value },
++	{ 0x0104, "NFAPI - P7 PNF Address IPv4", dissect_p7_pnf_address_ipv6_value },
++	{ 0x0105, "NFAPI - P7 Port", dissect_p7_pnf_port_value },
++	{ 0x0106, NULL, NULL },
++	{ 0x0107, NULL, NULL },
++	{ 0x0108, NULL, NULL },
++	{ 0x0109, NULL, NULL },
++	{ 0x010A, "NFAPI - Downlink UEs per Subframe", dissect_downlink_ues_per_subframe_value },
++	{ 0x010B, "NFAPI - Uplink UEs per Subframe", dissect_uplink_ues_per_subframe_value },
++	{ 0x010C, NULL, NULL },
++	{ 0x010D, NULL, NULL },
++	{ 0x010E, NULL, NULL },
++	{ 0x010F, NULL, NULL },
++	{ 0x0110, NULL, NULL },
++	{ 0x0111, NULL, NULL },
++	{ 0x0112, NULL, NULL },
++	{ 0x0113, NULL, NULL },
++	{ 0x0114, "NFAPI - nFAPI RF Bands", dissect_rf_bands_value },
++	{ 0x0115, NULL, NULL },
++	{ 0x0116, NULL, NULL },
++	{ 0x0117, NULL, NULL },
++	{ 0x0118, NULL, NULL },
++	{ 0x0119, NULL, NULL },
++	{ 0x011A, NULL, NULL },
++	{ 0x011B, NULL, NULL },
++	{ 0x011C, NULL, NULL },
++	{ 0x011D, NULL, NULL },
++	{ 0x011E, "NFAPI - Timing window", dissect_timing_window_value },
++	{ 0x011F, "NFAPI - Timing info mode", dissect_timing_info_mode_value },
++	{ 0x0120, "NFAPI - Timing info period", dissect_timing_info_period_value },
++	{ 0x0121, NULL, NULL },
++	{ 0x0122, NULL, NULL },
++	{ 0x0123, NULL, NULL },
++	{ 0x0124, NULL, NULL },
++	{ 0x0125, NULL, NULL },
++	{ 0x0126, NULL, NULL },
++	{ 0x0127, NULL, NULL },
++	{ 0x0128, "NFAPI - Maximum Transmit Power", dissect_maximum_transmit_power_value },
++	{ 0x0129, "NFAPI - EARFCN", dissect_earfcn_value },
++	{ 0x012A, NULL, NULL },
++	{ 0x012B, NULL, NULL },
++	{ 0x012C, NULL, NULL },
++	{ 0x012D, NULL, NULL },
++	{ 0x012E, NULL, NULL },
++	{ 0x012F, NULL, NULL },
++	{ 0x0130, "NFAPI - NMM GSM Frequency Bands", dissect_nmm_gsm_frequency_bands_value },
++	{ 0x0131, "NFAPI - NMM UMTS Frequency Bands", dissect_nmm_umts_frequency_bands_value },
++	{ 0x0132, "NFAPI - NMM LTE Frequency Bands", dissect_nmm_lte_frequency_bands_value },
++	{ 0x0133, "NFAPI - NMM Uplink RSSI supported", dissect_nmm_uplink_rssi_supported_value },
++};
++
++const tlv_t p7_tags[] =
++{
++	{ 0x2000, "DL Config Request Body", dissect_dl_config_request_body_value },
++	{ 0x2001, "DL DCI PDU Release 8", dissect_dl_config_request_dl_dci_pdu_rel8_value },
++	{ 0x2002, "DL DCI PDU Release 9", dissect_dl_config_request_dl_dci_pdu_rel9_value },
++	{ 0x2003, "DL DCI PDU Release 10", dissect_dl_config_request_dl_dci_pdu_rel10_value },
++	{ 0x2004, "BCH PDU Release 8", dissect_dl_config_request_bch_pdu_rel8_value },
++	{ 0x2005, "MCH PDU Release 8", dissect_dl_config_request_mch_pdu_rel8_value },
++	{ 0x2006, "DLSCH PDU Release 8", dissect_dl_config_request_dlsch_pdu_rel8_value },
++	{ 0x2007, "DLSCH PDU Release 9", dissect_dl_config_request_dlsch_pdu_rel9_value },
++	{ 0x2008, "DLSCH PDU Release 10", dissect_dl_config_request_dlsch_pdu_rel10_value },
++	{ 0x2009, "PCH PDU Release 8", dissect_dl_config_request_pch_pdu_rel8_value },
++	{ 0x200A, "PRS PDU Release 9", dissect_dl_config_request_prs_pdu_rel9_value },
++	{ 0x200B, "CSI-RS PDU Release 10", dissect_dl_config_request_csi_rs_pdu_rel10_value },
++	{ 0x200C, "UL Config Request Body", dissect_ul_config_request_body_value },
++	{ 0x200D, "ULSCH PDU Release 8", dissect_ul_config_ulsch_pdu_rel8_value },
++	{ 0x200E, "ULSCH PDU Release 10", dissect_ul_config_ulsch_pdu_rel10_value },
++	{ 0x200F, "Initial Transmission Parameters Release 8", dissect_ul_config_init_tx_params_rel8_value },
++	{ 0x2010, "CQI RI Information Release 8", dissect_ul_config_cqi_ri_info_rel8_value },
++	{ 0x2011, "CQI RI Information Release 9 or later", dissect_ul_config_cqi_ri_info_rel9_later_value },
++	{ 0x2012, "HARQ Information (ULSCH) Release 10", dissect_ul_config_harq_info_ulsch_rel10_value },
++	{ 0x2013, "UE Information Release 8", dissect_ul_config_ue_info_rel8_value },
++	{ 0x2014, "CQI Information Release 8", dissect_ul_config_cqi_info_rel8_value },
++	{ 0x2015, "CQI Information Release 10", dissect_ul_config_cqi_info_rel10_value },
++	{ 0x2016, "SR Information Release 8", dissect_ul_config_sr_info_rel8_value },
++	{ 0x2017, "SR Information Release 10", dissect_ul_config_sr_info_rel10_value },
++	{ 0x2018, "HARQ Information (UCI) Release 10 TDD", dissect_ul_config_harq_info_uci_rel10_tdd_value },
++	{ 0x2019, "HARQ Information (UCI) Release 8 FDD", dissect_ul_config_harq_info_uci_rel8_fdd_value },
++	{ 0x201A, "HARQ Information (UCI) Release 9 or later FDD", dissect_ul_config_harq_info_uci_rel9_later_fdd_value },
++	{ 0x201B, "SRS Information Release 8", dissect_ul_config_srs_info_rel8_value },
++	{ 0x201C, "SRS Information Release 10", dissect_ul_config_srs_info_rel10_value },
++	{ 0x201D, "HI DCI0 Request Body", dissect_hi_dci0_request_body_value },
++	{ 0x201E, "HI PDU Release 8", dissect_hi_dci0_hi_rel8_value },
++	{ 0x201F, "HI PDU Release 10", dissect_hi_dci0_hi_rel10_value },
++	{ 0x2020, "DCI UL PDU Release 8", dissect_hi_dci0_dci_ul_rel8_value },
++	{ 0x2021, "DCI UL PDU Release 10", dissect_hi_dci0_dci_ul_rel10_value },
++	{ 0x2022, "Tx Request Body", dissect_tx_request_body_value },
++	{ 0x2023, "RX Indication Body", dissect_rx_indication_body_value },
++	{ 0x2024, "RX PDU Release 8", dissect_rx_indication_rel8_value },
++	{ 0x2025, "RX PDU Release 9", dissect_rx_indication_rel9_value },
++	{ 0x2026, "HARQ Indication Body", dissect_harq_indication_body_value },
++	{ 0x2027, "HARQ PDU Release 8 TDD", dissect_harq_indication_rel8_tdd_value },
++	{ 0x2028, "HARQ PDU Release 9 or later TDD", dissect_harq_indication_rel9_later_tdd_value },
++	{ 0x2029, "HARQ PDU Release 8 FDD", dissect_harq_indication_rel8_fdd_value },
++	{ 0x202A, "HARQ PDU Release 9 or later FDD", dissect_harq_indication_rel9_later_fdd_value },
++	{ 0x202B, "CRC Indication Body", dissect_crc_indication_body_value },
++	{ 0x202C, "CRC PDU Release 8", dissect_crc_indication_rel8_value },
++	{ 0x202D, "RX SR Indication Body", dissect_rx_sr_indication_body_value },
++	{ 0x202E, "RX CQI Indication Body", dissect_rx_cqi_indication_body_value },
++	{ 0x202F, "CQI PDU Release 8", dissect_rx_cqi_indication_rel8_value },
++	{ 0x2030, "CQI PDU Release 9", dissect_rx_cqi_indication_rel9_value },
++	{ 0x2031, "RACH Indication Body", dissect_rach_indication_body_value },
++	{ 0x2032, "Preamable PDU Release 8", dissect_rach_indication_rel8_value },
++	{ 0x2033, "Preamable PDU Release 9", dissect_rach_indication_rel9_value },
++	{ 0x2034, "SRS Indication Body", dissect_srs_indication_body_value },
++	{ 0x2035, "SRS PDU Release 8", dissect_srs_indication_rel8_value },
++	{ 0x2036, "SRS PDU Release 9", dissect_srs_indication_rel9_value },
++	{ 0x2037, "SRS PDU Release 10 TDD", dissect_srs_indication_rel10_tdd_value },
++	{ 0x2038, "RX UE Information", dissect_rx_ue_info_value },
++	{ 0x2039, "DL DCI PDU Release 11", dissect_dl_config_request_dl_dci_pdu_rel11_value },
++	{ 0x203A, "DL DCI PDU Release 12", dissect_dl_config_request_dl_dci_pdu_rel12_value },
++	{ 0x203B, "DL DCI PDU Release 13", dissect_dl_config_request_dl_dci_pdu_rel13_value },
++	{ 0x203C, "DLSCH PDU Release 11", dissect_dl_config_request_dlsch_pdu_rel11_value },
++	{ 0x203D, "DLSCH PDU Release 12", dissect_dl_config_request_dlsch_pdu_rel12_value },
++	{ 0x203E, "DLSCH PDU Release 13", dissect_dl_config_request_dlsch_pdu_rel13_value },
++	{ 0x203F, "PCH PDU Release 13", dissect_dl_config_request_pch_pdu_rel13_value },
++	{ 0x2040, "CSI-RS PDU Release 13", dissect_dl_config_request_csi_rs_pdu_rel13_value },
++	{ 0x2041, "EDPCCH PDU Release 11 Parameters", dissect_dl_config_request_edpcch_params_rel11_value },
++	{ 0x2042, "EDPCCH PDU Release 13 Parameters", dissect_dl_config_request_edpcch_params_rel13_value },
++	{ 0x2043, "ULSCH PDU Release 11", dissect_ul_config_ulsch_pdu_rel11_value },
++	{ 0x2044, "ULSCH PDU Release 13", dissect_ul_config_ulsch_pdu_rel13_value },
++	{ 0x2045, "CQI RI Information Release 13", dissect_ul_config_cqi_ri_info_rel13_value },
++	{ 0x2046, "HARQ Information (ULSCH) Release 13", dissect_ul_config_harq_info_ulsch_rel13_value },
++	{ 0x2047, "UE Information Release 11", dissect_ul_config_ue_info_rel11_value },
++	{ 0x2048, "UE Information Release 13", dissect_ul_config_ue_info_rel13_value },
++	{ 0x2049, "CQI Information Release 13", dissect_ul_config_cqi_info_rel13_value },
++	{ 0x204A, "HARQ Information (UCI) Release 11 FDD/TDD", dissect_ul_config_harq_info_uci_rel11_fdd_tdd_value },
++	{ 0x204B, "HARQ Information (UCI) Release 13 FDD/TDD", dissect_ul_config_harq_info_uci_rel13_fdd_tdd_value },
++	{ 0x204C, "SRS Information Release 13", dissect_ul_config_srs_info_rel13_value },
++	{ 0x204D, "DCI UL PDU Release 12", dissect_hi_dci0_dci_ul_rel12_value },
++	{ 0x204E, "MDPCCH DCI UL PDU Release 13", dissect_hi_dci0_mdpcch_dci_ul_rel13_value },
++	{ 0x204F, "HARQ PDU Release 13 or later TDD", dissect_harq_indication_rel13_later_tdd_value },
++	{ 0x2050, "HARQ PDU Release 13 or later FDD", dissect_harq_indication_rel13_later_fdd_value },
++	{ 0x2051, "Preamable PDU Release 13", dissect_rach_indication_rel13_value },
++	{ 0x2052, "UL CQI Information", dissect_ul_cqi_information_value },
++	{ 0x2053, "SRS PDU Release 11", dissect_srs_indication_rel11_value },
++	{ 0x2054, "TDD Channel Measurement", dissect_tdd_channel_measurement_value },
++	{ 0x2055, "LBT DL Config Request Body", dissect_lbt_dl_config_request_body_value },
++	{ 0x2056, "LBT PDSCH Req PDU Release 13", dissect_lbt_dl_config_request_pdsch_req_rel13_value },
++	{ 0x2057, "LBT DRS req PDU Release 13", dissect_lbt_dl_config_request_drs_req_rel13_value },
++	{ 0x2058, "LBT DL Indication Message Body", dissect_lbt_indication_message_body_value },
++	{ 0x2059, "LBT PDSCH Resp PDU Release 13", dissect_lbt_dl_config_request_pdsch_resp_rel13_value },
++	{ 0x205A, "LBT DRS Resp PDU Release 13", dissect_lbt_dl_config_request_drs_resp_rel13_value },
++	{ 0x205B, "MPDCCH PDU Release 13", dissect_dl_config_request_mpdpcch_pdu_rel13_value },
++};
++
++const tlv_t p4_tags[] =
++{
++	{ 0x3000, "LTE RSSI Request", dissect_lte_rssi_request_value },
++	{ 0x3001, "UTRAN RSSI Request", dissect_utran_rssi_request_value },
++	{ 0x3002, "GERAN RSSI Request", dissect_geran_rssi_request_value },
++	{ 0x3003, "RSSI Indication", dissect_rssi_indication_value },
++	{ 0x3004, "LTE CELL SEARCH Request", dissect_lte_cell_search_value },
++	{ 0x3005, "UTRAN CELL SEARCH Request", dissect_utran_cell_search_value },
++	{ 0x3006, "GERAN CELL SEARCH Request", dissect_geran_cell_search_value },
++	{ 0x3007, "LTE CELL SEARCH Indication", dissect_lte_cell_search_indication_value },
++	{ 0x3008, "UTRAN CELL SEARCH Indication", dissect_utran_cell_search_indication_value },
++	{ 0x3009, "GERAN CELL SEARCH Indication", dissect_geran_cell_search_indication_value },
++	{ 0x300A, "PNF CELL SEARCH STATE", dissect_pnf_cell_search_state_value },
++	{ 0x300B, "LTE BROADCAST DETECT Request", dissect_lte_broadcast_detect_request_value },
++	{ 0x300C, "UTRAN BROADCAST DETECT Request", dissect_utran_broadcast_detect_request_value },
++	{ 0x300D, "PNF CELL SEARCH STATE", dissect_pnf_cell_search_state_value },
++	{ 0x300E, "LTE BROADCAST DETECT Indication", dissect_lte_broadcast_detect_indication_value },
++	{ 0x300F, "UTRAN BROADCAST DETECT Indication", dissect_utran_broadcast_detect_indication_value },
++	{ 0x3010, "PNF CELL BROADCAST STATE", dissect_pnf_cell_broadcast_state_value },
++	{ 0x3011, "LTE SYSTEM INFORMATION SCHEDULE Request", dissect_lte_system_information_schedule_request_value },
++	{ 0x3012, "PNF CELL BROADCAST STATE", dissect_pnf_cell_broadcast_state_value },
++	{ 0x3013, "LTE SYSTEM INFORMATION SCHEDULE Indication", dissect_lte_system_information_schedule_indication_value },
++	{ 0x3014, "LTE SYSTEM INFORMATION Request", dissect_lte_system_information_request_value },
++	{ 0x3015, "UTRAN SYSTEM INFORMATION Request", dissect_utran_system_information_request_value },
++	{ 0x3016, "GERAN SYSTEM INFORMATION Request", dissect_geran_system_information_request_value },
++	{ 0x3017, "PNF CELL BROADCAST STATE", dissect_pnf_cell_broadcast_state_value },
++	{ 0x3018, "LTE SYSTEM INFORMATION Indication", dissect_lte_system_information_indication_value },
++	{ 0x3019, "UTRAN SYSTEM INFORMATION Indication", dissect_utran_system_information_indication_value },
++	{ 0x301A, "GERAN SYSTEM INFORMATION Indication", dissect_geran_system_information_indication_value },
++};
++
++
++static const tlv_t* look_up_tlv(int tag_id)
++{
++	const tlv_t* tlv = NULL;
++
++	static const gint num_configuration_tags = sizeof(configuration_tags) / sizeof(tlv_t);
++	static const gint num_nfapi_tags = sizeof(nfapi_tags) / sizeof(tlv_t);
++	static const gint num_p7_tags = sizeof(p7_tags) / sizeof(tlv_t);
++	static const gint num_p4_tags = sizeof(p4_tags) / sizeof(tlv_t);
++
++	if (tag_id >= 0x0000 && tag_id <= (0x0000 + num_configuration_tags - 1)) // 0x0133)
++	{
++		tlv = &configuration_tags[tag_id];
++	}
++	else if (tag_id >= 0x1000 && tag_id <= (0x1000 + num_nfapi_tags - 1)) // 0x100D)
++	{
++		tlv = &nfapi_tags[tag_id - 0x1000];
++	}
++	else if (tag_id >= 0x2000 && tag_id <= (0x2000 + num_p7_tags - 1)) //0x205B)
++	{
++		tlv = &p7_tags[tag_id - 0x2000];
++	}
++	else if (tag_id >= 0x3000 && tag_id <= (0x3000 + num_p4_tags - 1)) // 0x301A)
++	{
++		tlv = &p4_tags[tag_id - 0x3000];
++	}
++	return tlv;
++}
++
++
++static proto_item* dissect_tl_header(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_tl, "TL");
++	ptvcursor_add(ptvc, hf_nfapi_tl_tag, 2, ENC_BIG_ENDIAN);
++	proto_item* item = ptvcursor_add(ptvc, hf_nfapi_tl_length, 2, ENC_BIG_ENDIAN);
++	ptvcursor_pop_subtree(ptvc);
++
++	return item;
++}
++
++static void dissect_tlv_list(ptvcursor_t* ptvc, packet_info* pinfo, gint len)
++{
++	while (ptvcursor_current_offset(ptvc) < len)
++	{
++		guint16 tlv_id = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++		guint16 tlv_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc) + 2);
++
++		const tlv_t* tlv = look_up_tlv(tlv_id);
++
++		if (tlv != NULL && tlv->name != NULL && tlv->tag_id == tlv_id)
++		{
++			ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_tlv_tree, "%s", tlv->name);
++			proto_item* tlv_length_item = dissect_tl_header(ptvc, pinfo);
++
++			// There are rare cases where the len of the tlv is 0.
++			if (tlv_len > 0)
++			{
++
++				if (tlv->decode != NULL)
++				{
++					// Create a sub buff with the correct length, so we can detect reading off the end
++					tvbuff_t* sub_tvbuff = tvb_new_subset_length(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc), tlv_len);
++					ptvcursor_t* sub_ptvc = ptvcursor_new(ptvcursor_tree(ptvc), sub_tvbuff, 0);
++
++					tlv->decode(sub_ptvc, pinfo);
++
++					if (ptvcursor_current_offset(sub_ptvc) != tlv_len)
++					{
++						// error in the tlv length
++						expert_add_info_format(pinfo, tlv_length_item, &ei_invalid_tlv_length, "TLV length does not match decoded length");
++					}
++
++					ptvcursor_free(sub_ptvc);
++				}
++
++				ptvcursor_advance(ptvc, tlv_len);
++			}
++
++			ptvcursor_pop_subtree(ptvc);
++		}
++		else
++		{
++			if (tlv_id >= 0xF000 /* && tlv_id <= 0xFFFF*/)
++			{
++				ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_tlv_tree, "Unknown Vendor Extension Tag");
++			}
++			else
++			{
++				ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_tlv_tree, "Unknown");
++			}
++
++			dissect_tl_header(ptvc, pinfo);
++			ptvcursor_advance(ptvc, tlv_len);
++			ptvcursor_pop_subtree(ptvc);
++		}
++	}
++}
++
++
++static void dissect_rx_indication_body_value(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	guint number_of_pdu_addr = ptvcursor_current_offset(ptvc); // *offset;
++	guint16 count = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_number_pdus, 2, ENC_BIG_ENDIAN);
++
++	guint16* lengths = (guint16*)wmem_alloc0(wmem_packet_scope(), count * 2);
++	memset(lengths, 0, count * 2);
++
++	guint16 i = 0;
++
++	if (count > 0)
++	{
++		ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_rx_indication_pdu_list, "RX PDU List");
++		gint pdu_end = tvb_reported_length_remaining(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc)) + ptvcursor_current_offset(ptvc);
++
++		while (tvb_reported_length_remaining(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc)) > 0 &&
++			   ptvcursor_current_offset(ptvc) < pdu_end )
++		{
++			guint16 tlv_id = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++			//guint16 tlv_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc) + 2);
++
++			if (tlv_id == 0x2038)
++			{
++				if (i != 0)
++					ptvcursor_pop_subtree(ptvc);
++
++				ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_rx_indication_pdu_list, "[%d]", i);
++
++				i++;
++			}
++
++			char* tlv_name = "Unknown";
++			const tlv_t* tlv = look_up_tlv(tlv_id);
++
++			if (tlv != NULL && tlv->name != NULL && tlv->tag_id == tlv_id)
++			{
++				tlv_name = tlv->name;
++			}
++
++			ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_rx_indication_pdu_list, "%s", tlv_name);
++
++			dissect_tl_header(ptvc, pinfo);
++
++
++			if (tlv_id == 0x2038)
++			{
++				dissect_rx_ue_info_value(ptvc, pinfo);
++			}
++			else if (tlv_id == 0x2024)
++			{
++				lengths[i - 1] = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++				ptvcursor_add(ptvc, hf_nfapi_length, 2, ENC_BIG_ENDIAN);
++				int data_offset = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++				ptvcursor_add(ptvc, hf_nfapi_data_offset, 2, ENC_BIG_ENDIAN);
++				ptvcursor_add(ptvc, hf_nfapi_ul_cqi, 1, ENC_BIG_ENDIAN);
++				ptvcursor_add(ptvc, hf_nfapi_timing_advance, 2, ENC_BIG_ENDIAN);
++
++				if ((data_offset > 0) && (pdu_end == (tvb_reported_length_remaining(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc)) + ptvcursor_current_offset(ptvc))))
++				{
++					pdu_end = number_of_pdu_addr + data_offset;
++				}
++
++			}
++			else if (tlv_id == 0x2025)
++			{
++				dissect_rx_indication_rel9_value(ptvc, pinfo);
++			}
++
++			ptvcursor_pop_subtree(ptvc);
++
++		}
++
++		// pop the last pdu index.
++		ptvcursor_pop_subtree(ptvc);
++
++		ptvcursor_pop_subtree(ptvc);
++	}
++
++	for (i = 0; i < count; ++i)
++	{
++		ptvcursor_add(ptvc, hf_nfapi_pdu, lengths[i], ENC_NA);
++	}
++}
++
++
++// ----------------------------------------------------------------------------|
++
++static void dissect_p45_header(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_p4_p5_message_header, "P4 P5 Header");
++	ptvcursor_add(ptvc, hf_nfapi_p4_p5_message_header_phy_id, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p4_p5_message_header_message_id, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p4_p5_message_header_message_length, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p4_p5_message_header_spare, 2, ENC_BIG_ENDIAN);
++	ptvcursor_pop_subtree(ptvc);
++
++}
++
++static void dissect_p7_header_new(ptvcursor_t* ptvc, guint8* m, guint8* seg, guint8* seq)
++{
++	ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_p7_message_header, "P7 Header");
++
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_phy_id, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_message_id, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_message_length, 2, ENC_BIG_ENDIAN);
++
++	guint8 m_seg = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	*m = (m_seg & 0x80) >> 7;
++	*seg = m_seg & 0x7F;
++
++	proto_tree_add_bits_item(ptvcursor_tree(ptvc), hf_nfapi_p7_message_header_m, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8, 1, ENC_NA);
++	proto_tree_add_bits_item(ptvcursor_tree(ptvc), hf_nfapi_p7_message_header_segment, ptvcursor_tvbuff(ptvc), ((ptvcursor_current_offset(ptvc)) * 8) + 1, 7, ENC_NA);
++	ptvcursor_advance(ptvc, 1);
++
++
++	*seq = tvb_get_guint8(ptvcursor_tvbuff(ptvc), ptvcursor_current_offset(ptvc));
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_sequence_number, 1, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_checksum, 4, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_transmit_timestamp, 4, ENC_BIG_ENDIAN);
++
++	ptvcursor_pop_subtree(ptvc);
++}
++
++
++static void dissect_p7_header(ptvcursor_t * ptvc, packet_info* pinfo _U_)
++{
++	ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_p7_message_header, "P7 Header");
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_phy_id, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_message_id, 2, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_message_length, 2, ENC_BIG_ENDIAN);
++
++	proto_tree_add_bits_item(ptvcursor_tree(ptvc), hf_nfapi_p7_message_header_m, ptvcursor_tvbuff(ptvc), (ptvcursor_current_offset(ptvc)) * 8, 1, ENC_NA);
++	proto_tree_add_bits_item(ptvcursor_tree(ptvc), hf_nfapi_p7_message_header_segment, ptvcursor_tvbuff(ptvc), ((ptvcursor_current_offset(ptvc)) * 8) + 1, 7, ENC_NA);
++	ptvcursor_advance(ptvc, 1);
++
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_sequence_number, 1, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_checksum, 4, ENC_BIG_ENDIAN);
++	ptvcursor_add(ptvc, hf_nfapi_p7_message_header_transmit_timestamp, 4, ENC_BIG_ENDIAN);
++
++	ptvcursor_pop_subtree(ptvc);
++}
++
++static reassembly_table ul_p7_reassemble_table;
++static reassembly_table dl_p7_reassemble_table;
++
++static int hf_msg_fragments = -1;
++static int hf_msg_fragment = -1;
++static int hf_msg_fragment_overlap = -1;
++static int hf_msg_fragment_overlap_conflicts = -1;
++static int hf_msg_fragment_multiple_tails = -1;
++static int hf_msg_fragment_too_long_fragment = -1;
++static int hf_msg_fragment_error = -1;
++static int hf_msg_fragment_count = -1;
++static int hf_msg_reassembled_in = -1;
++static int hf_msg_reassembled_length = -1;
++static gint ett_msg_fragment = -1;
++static gint ett_msg_fragments = -1;
++
++static const fragment_items msg_frag_items = {
++	/* Fragment subtrees */
++	&ett_msg_fragment,
++	&ett_msg_fragments,
++	/* Fragment fields */
++	&hf_msg_fragments,
++	&hf_msg_fragment,
++	&hf_msg_fragment_overlap,
++	&hf_msg_fragment_overlap_conflicts,
++	&hf_msg_fragment_multiple_tails,
++	&hf_msg_fragment_too_long_fragment,
++	&hf_msg_fragment_error,
++	&hf_msg_fragment_count,
++	/* Reassembled in field */
++	&hf_msg_reassembled_in,
++	/* Reassembled length field */
++	&hf_msg_reassembled_length,
++	NULL,
++	/* Tag */
++	"Message fragments"
++};
++
++static void dissect_nfapi_ul_p7(ptvcursor_t *ptvc, packet_info *pinfo)
++{
++	guint8 m;
++	guint8 seg;
++	guint8 seq;
++
++	guint8 save_fragmented;
++	ptvcursor_t* sub_ptvc = 0;
++
++	guint16 msg_id = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), 2);
++	guint16 msg_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), 4);
++
++	dissect_p7_header_new(ptvc, &m, &seg, &seq);
++	save_fragmented = pinfo->fragmented;
++
++	if (m == 1 || (m == 0 && seg > 0))
++	{
++		tvbuff_t* tvbuff = ptvcursor_tvbuff(ptvc);
++		guint offset = ptvcursor_current_offset(ptvc);
++		proto_tree* tree = ptvcursor_tree(ptvc);
++
++		pinfo->fragmented = TRUE;
++
++		fragment_head *fd_head = fragment_add_seq_check(&ul_p7_reassemble_table, tvbuff, offset, pinfo, seq, NULL, seg, msg_len - offset, (m == 1));
++
++		if (fd_head)
++		{
++			tvbuff_t * new_tvb = process_reassembled_data(tvbuff, offset, pinfo, "Reassembled UL P7", fd_head, &msg_frag_items, NULL, tree);
++			if (new_tvb)
++			{
++				sub_ptvc = ptvcursor_new(tree, new_tvb, 0);
++
++				col_append_fstr(pinfo->cinfo, COL_INFO, "[NFAPI P7 Reassembled %d]", seg);
++			}
++			else
++			{
++				col_append_fstr(pinfo->cinfo, COL_INFO, "[NFAPI P7 Segment %d]", seg);
++				return;
++			}
++		}
++		else
++		{
++			return;
++		}
++	}
++
++	pinfo->fragmented = save_fragmented;
++
++	{
++		switch (msg_id)
++		{
++			case NFAPI_HARQ_INDICATION_MSG_ID:
++			{
++				ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++				dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++			}
++			break;
++			case NFAPI_CRC_INDICATION_MSG_ID:
++			{
++				ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++				dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++			}
++			break;
++			case NFAPI_RX_ULSCH_INDICATION_MSG_ID:
++			{
++				ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++				dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++			}
++			break;
++			case NFAPI_RACH_INDICATION_MSG_ID:
++			{
++				ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++				dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++			}
++			break;
++			case NFAPI_SRS_INDICATION_MSG_ID:
++			{
++				ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++				dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++			}
++			break;
++			case NFAPI_RX_SR_INDICATION_MSG_ID:
++			{
++				ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++				dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++			}
++			break;
++			case NFAPI_RX_CQI_INDICATION_MSG_ID:
++			{
++				ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++				dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++			}
++			break;
++
++		};
++	}
++
++	if (sub_ptvc)
++		ptvcursor_free(sub_ptvc);
++}
++
++static void dissect_nfapi_dl_p7(ptvcursor_t *ptvc, packet_info *pinfo)
++{
++	guint8 m;
++	guint8 seg;
++	guint8 seq;
++
++	guint8 save_fragmented;
++	ptvcursor_t* sub_ptvc = 0;
++
++	guint16 msg_id = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), 2);
++	guint16 msg_len = tvb_get_ntohs(ptvcursor_tvbuff(ptvc), 4);
++
++	dissect_p7_header_new(ptvc, &m, &seg, &seq);
++	save_fragmented = pinfo->fragmented;
++
++	if (m == 1 || (m == 0 && seg > 0))
++	{
++		tvbuff_t* tvbuff = ptvcursor_tvbuff(ptvc);
++		guint offset = ptvcursor_current_offset(ptvc);
++		proto_tree* tree = ptvcursor_tree(ptvc);
++
++		pinfo->fragmented = TRUE;
++
++		fragment_head *fd_head = fragment_add_seq_check(&dl_p7_reassemble_table, tvbuff, offset, pinfo, seq, NULL, seg, msg_len - offset, (m == 1));
++
++		if (fd_head)
++		{
++			tvbuff_t * new_tvb = process_reassembled_data(tvbuff, offset, pinfo, "Reassembled DL P7", fd_head, &msg_frag_items, NULL, tree);
++			if (new_tvb)
++			{
++				sub_ptvc = ptvcursor_new(tree, new_tvb, 0);
++				col_append_fstr(pinfo->cinfo, COL_INFO, "[NFAPI P7 Reassembled %d]", seg);
++			}
++			else
++			{
++				col_append_fstr(pinfo->cinfo, COL_INFO, "[NFAPI P7 Segment %d]", seg);
++				return;
++			}
++		}
++		else
++		{
++			return;
++		}
++	}
++
++	pinfo->fragmented = save_fragmented;
++
++	switch (msg_id)
++	{
++		case NFAPI_DL_CONFIG_REQUEST_MSG_ID:
++		{
++			ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++			dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++			break;
++		}
++		case NFAPI_UL_CONFIG_REQUEST_MSG_ID:
++		{
++			ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++			dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++		}
++		break;
++		case NFAPI_HI_DCI0_REQUEST_MSG_ID:
++		{
++			ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++			dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++		}
++		break;
++		case NFAPI_TX_REQUEST_MSG_ID:
++		{
++			ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++			dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++		}
++		break;
++		case NFAPI_LBT_DL_CONFIG_REQUEST_MSG_ID:
++		{
++			ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++			dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++		}
++		break;
++		case NFAPI_LBT_DL_INDICATION_MSG_ID:
++		{
++			ptvcursor_add(sub_ptvc ? sub_ptvc : ptvc, hf_nfapi_sfn_sf, 2, ENC_BIG_ENDIAN);
++			dissect_tlv_list(sub_ptvc ? sub_ptvc : ptvc, pinfo, msg_len);
++			break;
++		}
++	}
++
++	if (sub_ptvc)
++		ptvcursor_free(sub_ptvc);
++}
++
++
++static int dissect_nfapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
++{
++	col_set_str(pinfo->cinfo, COL_PROTOCOL, "NFAPI");
++
++	ptvcursor_t* ptvc = ptvcursor_new(tree, tvb, 0);
++
++	guint16 msg_id = tvb_get_ntohs(tvb, 2);
++
++	// Get the name of the message
++	const gchar* message_str = val_to_str_const(msg_id, message_id_vals, "Unknown");
++
++	// Append to the Info string the nFAPI messages
++	col_clear(pinfo->cinfo, COL_INFO);
++	col_append_fstr(pinfo->cinfo, COL_INFO, " %s ", message_str);
++
++	// Flag if this is a vendor extention message, could do it for P4, 5, 7
++	if (msg_id >= 0x0300 && msg_id <= 0x03FF)
++	{
++		col_append_fstr(pinfo->cinfo, COL_INFO, " Vendor Extension");
++	}
++
++	// Create the top level tree
++	ptvcursor_add_text_with_subtree(ptvc, SUBTREE_UNDEFINED_LENGTH, ett_nfapi_message_tree, "%s", message_str);
++
++	switch (msg_id)
++	{
++		case NFAPI_HARQ_INDICATION_MSG_ID:
++		case NFAPI_CRC_INDICATION_MSG_ID:
++		case NFAPI_RX_ULSCH_INDICATION_MSG_ID:
++		case NFAPI_RACH_INDICATION_MSG_ID:
++		case NFAPI_SRS_INDICATION_MSG_ID:
++		case NFAPI_RX_SR_INDICATION_MSG_ID:
++		case NFAPI_RX_CQI_INDICATION_MSG_ID:
++		{
++			dissect_nfapi_ul_p7(ptvc, pinfo);
++		}
+ 		break;
+-		// LBT_DL.indication
+-		case 0x8D:
+-		{
+-			dissect_p7_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint16_with_conversion(msg_tree, hf_nfapi_sfn_sf, tvb, &offset, sfn_sf_conversion);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
+-		}
+-		// PNF_PARAM.request
+-		case 0x100:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
+-		}
+-		// PNF_PARAM.response
+-		case 0x101:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_error_code, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
+-		}
+-		// PNF_CONFIG.request
+-		case 0x102:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
+-		}
+-		// PNF_CONFIG.response
+-		case 0x103:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_error_code, tvb, &offset, 0);
+-			break;
+-		}
+-		// PNF_START.request
+-		case 0x104:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			break;
+-		}
+-		// PNF_START.response
+-		case 0x105:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_error_code, tvb, &offset, 0);
+-			break;
+-		}
+-		// PNF_STOP.response
+-		case 0x106:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			break;
+-		}
+-		// PNF_STOP.request
+-		case 0x107:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_error_code, tvb, &offset, 0);
+-			break;
+-		}
+-		// PARAM.request
+-		case 0x108:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			break;
+-		}
+-		// PARAM.response
+-		case 0x109:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_error_code, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
+-		}
+-		// CONFIG.request
+-		case 0x10A:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint8(msg_tree, hf_nfapi_num_tlv, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
+-		}
+-		// CONFIG.response
+-		case 0x10B:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_error_code, tvb, &offset, 0);
+-			break;
+-		}
+-		// START.request
+-		case 0x10C:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			break;
+-		}
+-		// START.response
+-		case 0x10D:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_error_code, tvb, &offset, 0);
+-			break;
+-		}
+-		// STOP.request
+-		case 0x10E:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			break;
+-		}
+-		// STOP.response
+-		case 0x10F:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_error_code, tvb, &offset, 0);
+-			break;
+-		}
+-		// MEASUREMENT.request
+-		case 0x110:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++
++		case NFAPI_DL_CONFIG_REQUEST_MSG_ID:
++		case NFAPI_UL_CONFIG_REQUEST_MSG_ID:
++		case NFAPI_HI_DCI0_REQUEST_MSG_ID:
++		case NFAPI_TX_REQUEST_MSG_ID:
++		case NFAPI_LBT_DL_CONFIG_REQUEST_MSG_ID:
++		case NFAPI_LBT_DL_INDICATION_MSG_ID:
++		{
++			dissect_nfapi_dl_p7(ptvc, pinfo);
++			break;
++		}
++
++		case NFAPI_PNF_PARAM_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
++		}
++		case NFAPI_PNF_PARAM_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_error_code, 4, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++
++			break;
++		}
++		case NFAPI_PNF_CONFIG_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
++		}
++		case NFAPI_PNF_CONFIG_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_error_code, 4, ENC_BIG_ENDIAN);
++			break;
++		}
++		case NFAPI_PNF_START_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			break;
++		}
++		case NFAPI_PNF_START_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_error_code, 4, ENC_BIG_ENDIAN);
++			break;
++		}
++		case NFAPI_PNF_STOP_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			break;
++		}
++		case NFAPI_PNF_STOP_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_error_code, 4, ENC_BIG_ENDIAN);
++			break;
++		}
++		case NFAPI_PARAM_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			break;
++		}
++		case NFAPI_PARAM_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_error_code, 1, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_num_tlv, 1, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
++		}
++		case NFAPI_CONFIG_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_error_code, 1, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
++		}
++		case NFAPI_CONFIG_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_error_code, 4, ENC_BIG_ENDIAN);
++			break;
++		}
++		case NFAPI_START_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			break;
++		}
++		case NFAPI_START_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_error_code, 4, ENC_BIG_ENDIAN);
++			break;
++		}
++		case NFAPI_STOP_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			break;
++		}
++		case NFAPI_STOP_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_error_code, 4, ENC_BIG_ENDIAN);
++			break;
++		}
++		case NFAPI_MEASUREMENT_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
++		}
++		case NFAPI_MEASUREMENT_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_error_code, 4, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
++		}
++
++		// P4
++		case NFAPI_RSSI_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_rat_type, 1, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
++		}
++		case NFAPI_RSSI_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			break;
++		}
++		case NFAPI_RSSI_INDICATION_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
++		}
++		case NFAPI_CELL_SEARCH_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_rat_type, 1, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
+ 		}
+-		// MEASUREMENT.response
+-		case 0x111:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_error_code, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
+-		}
+-
+-		// P4
+-		// RSSI.request
+-		case 0x200:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint8(msg_tree, hf_nfapi_rat_type, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++		case NFAPI_CELL_SEARCH_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			break;
+ 		}
+-		// RSSI.response
+-		case 0x201:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			break;
++		case NFAPI_CELL_SEARCH_INDICATION_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
+ 		}
+-		// RSSI.indication
+-		case 0x202:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++		case NFAPI_BROADCAST_DETECT_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_rat_type, 1, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
+ 		}
+-		// CELL_SEARCH.request
+-		case 0x203:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint8(msg_tree, hf_nfapi_rat_type, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++		case NFAPI_BROADCAST_DETECT_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			break;
+ 		}
+-		// CELL_SEARCH.response
+-		case 0x204:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			break;
++		case NFAPI_BROADCAST_DETECT_INDICATION_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
+ 		}
+-		// CELL_SEARCH.indication
+-		case 0x205:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_rat_type, 1, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
+ 		}
+-		// BROADCAST_DETECT.request
+-		case 0x206:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint8(msg_tree, hf_nfapi_rat_type, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			break;
+ 		}
+-		// BROADCAST_DETECT.response
+-		case 0x207:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			break;
++		case NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
+ 		}
+-		// BROADCAST_DETECT.indication
+-		case 0x208:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++		case NFAPI_SYSTEM_INFORMATION_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_rat_type, 1, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
+ 		}
+-		// SYSTEM_INFORMATION_SCHEDULE.request
+-		case 0x209:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint8(msg_tree, hf_nfapi_rat_type, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++		case NFAPI_SYSTEM_INFORMATION_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			break;
+ 		}
+-		// SYSTEM_INFORMATOIN_SCHEDULE.response
+-		case 0x20A:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			break;
++		case NFAPI_SYSTEM_INFORMATION_INDICATION_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			dissect_tlv_list(ptvc, pinfo, tvb_reported_length(tvb));
++			break;
+ 		}
+-		// SYSTEM_INFORMATION_SCHEDULE.indication
+-		case 0x20B:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++		case NFAPI_NMM_STOP_REQUEST_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			break;
+ 		}
+-		// SYSTEM_INFORMATION.request
+-		case 0x20C:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint8(msg_tree, hf_nfapi_rat_type, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++		case NFAPI_NMM_STOP_RESPONSE_MSG_ID:
++		{
++			dissect_p45_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_p4_error_code, 4, ENC_BIG_ENDIAN);
++			break;
+ 		}
+-		// SYSTEM_INFORMATION.response
+-		case 0x20D:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			break;
++		case NFAPI_DL_NODE_SYNC_MSG_ID:
++		{
++			dissect_p7_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_ul_node_sync_t1, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_ul_node_sync_t2, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_ul_node_sync_t3, 4, ENC_BIG_ENDIAN);
++			break;
+ 		}
+-		// SYSTEM_INFORMATION.indication
+-		case 0x20E:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			dissect_tlv_list(tvb, pinfo, msg_tree, data, &offset, tvb_reported_length(tvb));
+-			break;
++		case NFAPI_UL_NODE_SYNC_MSG_ID:
++		{
++			dissect_p7_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_dl_node_sync_t1, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_dl_node_sync_delta_sfn_sf, 4, ENC_BIG_ENDIAN);
++			break;
+ 		}
+-		// NMM_STOP.request
+-		case 0x20F:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			break;
++		case NFAPI_TIMING_INFO_MSG_ID:
++		{
++			dissect_p7_header(ptvc, pinfo);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_last_sfn_sf, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_time_since_last_timing_info, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_dl_config_jitter, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_tx_request_jitter, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_ul_config_jitter, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_hi_dci0_jitter, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_dl_config_latest_delay, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_tx_request_latest_delay, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_ul_config_latest_delay, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_hi_dci0_latest_delay, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_dl_config_earliest_arrival, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_tx_request_earliest_arrival, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_ul_config_earliest_arrival, 4, ENC_BIG_ENDIAN);
++			ptvcursor_add(ptvc, hf_nfapi_timing_info_hi_dci0_earliest_arrival, 4, ENC_BIG_ENDIAN);
++			break;
+ 		}
+-		// NMM_STOP_response
+-		case 0x210:
+-		{
+-			dissect_p45_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_p4_error_code, tvb, &offset, 0);
+-			break;
+-		}
+-
+-		// DL_NODE.sync
+-		case 0x0180:
+-		{
+-			dissect_p7_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_ul_node_sync_t1, tvb, &offset, "microseconds");
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_ul_node_sync_t2, tvb, &offset, "microseconds");
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_ul_node_sync_t3, tvb, &offset, "microseconds");
+-			break;
+-		}
+-		// UL_NODE.sync
+-		case 0x0181:
+-		{
+-			dissect_p7_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_dl_node_sync_t1, tvb, &offset, "microseconds");
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_dl_node_sync_delta_sfn_sf, tvb, &offset, 0);
+-			break;
+-		}
+-		// TIMING_INFO
+-		case 0x0182:
+-		{
+-			dissect_p7_header(tvb, pinfo, msg_tree, data, &offset);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_last_sfn_sf, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_time_since_last_timing_info, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_dl_config_jitter, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_tx_request_jitter, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_ul_config_jitter, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_hi_dci0_jitter, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_dl_config_latest_delay, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_tx_request_latest_delay, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_ul_config_latest_delay, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_hi_dci0_latest_delay, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_dl_config_earliest_arrival, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_tx_request_earliest_arrival, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_ul_config_earliest_arrival, tvb, &offset, 0);
+-			proto_tree_add_uint32(msg_tree, hf_nfapi_timing_info_hi_dci0_earliest_arrival, tvb, &offset, 0);
+-			break;
+-		}
+-		default:
+-		{
+-			// todo : is this vendor extention?
+-			break;
+-		}
+-	};
+-
+-	return tvb_captured_length(tvb);
+-}
+-
+-static void nfapi_tag_vals_fn(gchar* s, guint32 v)
+-{
+-	int index = look_up_tlv(v);
+-	if (v >= 0)
+-	{
+-		g_snprintf(s, ITEM_LABEL_LENGTH, "%s (0x%x)", tags[index].name, v);
+-	}
+-	else
+-	{
+-		g_snprintf(s, ITEM_LABEL_LENGTH, "%s (0x%x)", "Unknown", v);
+-	}
+-}
+-
+-// ----------------------------------------------------------------------------|
+-
+-void proto_register_nfapi(void)
+-{
+-
+-	static hf_register_info hf[] =
+-	{
+-		{ &hf_msg_fragments, { "Message fragments", "afs.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_msg_fragment, { "Message fragment", "afs.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_msg_fragment_overlap, { "Message fragment overlap", "afs.fragment.overlap", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_msg_fragment_overlap_conflicts, { "Message fragment overlapping with conflicting data", "afs.fragment.overlap.conflicts", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_msg_fragment_multiple_tails, { "Message has multiple tail fragments", "afs.fragment.multiple_tails", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_msg_fragment_too_long_fragment, { "Message fragment too long", "afs.fragment.too_long_fragment", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_msg_fragment_error, { "Message defragmentation error", "afs.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_msg_fragment_count, { "Message fragment count", "afs.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_msg_reassembled_in, { "Reassembled in", "afs.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_msg_reassembled_length, { "Reassembled length", "afs.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_msg_reassembled_data, { "Reassembled data", "afs.reassembled.data", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } },
+-		{ &hf_nfapi_message_tree, { "Message tree", "nfapi.message_tree", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p4_p5_message_header, { "P4 P5 Header", "nfapi.p4_p5_message_header",	FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p4_p5_message_header_phy_id, { "PHY ID", "nfapi.p4_p5_message_header.phy_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p4_p5_message_header_message_id, { "Message ID", "nfapi.p4_p5_message_header.message_id", FT_UINT16, BASE_HEX_DEC, VALS(message_id_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p4_p5_message_header_message_length, { "Message Length", "nfapi.p4_p5_message_header.message_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p4_p5_message_header_spare,	{ "Spare", "nfapi.p4_p5_message_header.spare", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p7_message_header, { "P7 Header", "nfapi.p7_message_header", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p7_message_header_phy_id, { "Phy ID", "nfapi.p7_message_header.phy_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p7_message_header_message_id, { "Message ID", "nfapi.p7.message_header.message_id", FT_UINT16, BASE_HEX_DEC, VALS(message_id_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p7_message_header_message_length, { "Message Length", "nfapi.p7_message_header.message_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p7_message_header_m, { "M", "nfapi.p7_message_header.m_segment_sequence", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p7_message_header_segment, { "Segment Number", "nfapi.p7_message_header.m_segment_sequence", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p7_message_header_sequence_number, { "Sequence Number", "nfapi.p7_message_header.m_segment_sequence", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p7_message_header_checksum, { "Checksum", "nfapi.p7_message_header.checksum", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p7_message_header_transmit_timestamp, { "Transmit Timestamp", "nfapi.p7_message_header.timestamp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tlv_tree, { "TAG", "nfapi.tlv.tree", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tl, { "TL", "nfapi.tl", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tl_tag, { "TL Tag", "nfapi.tl_tag", FT_UINT16, BASE_CUSTOM, CF_FUNC(nfapi_tag_vals_fn), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tl_length, { "TL Length", "nfapi.tl_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tag_uint8_value, { "Value", "nfapi.tag.uint8.value", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tag_uint16_value, { "Value", "nfapi.tag.uint16.value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_param_response, { "Param Request", "nfapi.param.request", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_error_code, { "Error Code", "nfapi.error.code", FT_UINT8, BASE_DEC, VALS(nfapi_error_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_p4_error_code, { "Error Code", "nfapi.p4_error.code", FT_UINT8, BASE_DEC, VALS(nfapi_p4_error_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rat_type, { "RAT Type", "nfapi.rat_type", FT_UINT8, BASE_DEC, VALS(nfapi_rat_type_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_num_tlv, { "Number of TLV", "nfapi.param.response.num_tlv", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_phy_state, { "Phy state value", "nfapi.phy.state", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_modulation_support,	{ "Modulation value", "nfapi.modulation.support", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_ue_per_sf, { "Downlink UEs per Subframe", "nfapi.dl.ue.per.sf", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_ue_per_sf, { "Uplink UEs per Subframe", "nfapi.ul.ue.per.sf", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_duplex_mode, { "Duplex Mode", "nfapi.duplex.mode", FT_UINT16, BASE_DEC, VALS(nfapi_duplex_mode_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_bandwidth_support, { "Downlink bandwidth support", "nfapi.dl.bandwidth.support", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_bandwidth_support, { "Uplink bandwidth support", "nfapi.ul.bandwidth.support", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_modulation_support, { "Downlink modulation support", "nfapi.dl.modulation.support", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_modulation_support, { "Uplink modulation support", "nfapi.ul.modulation.support", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_phy_antenna_capability, { "Phy Antenna capability", "nfapi.phy.antenna.capability", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_release_capability, { "Release capability", "nfapi.release.capability", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mbsfn_capability, { "MBSFN capability", "nfapi.mbsfn.capability", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_laa_capability, { "LAA Support", "nfapi.laa.support", FT_BOOLEAN, 8, TFS(&support_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pd_sensing_lbt_support, { "PD sensing LBT support", "nfapi.pd.sensing.lbt.support", FT_BOOLEAN, 8, TFS(&support_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_multi_carrier_lbt_support, { "Multi carrier LBT support", "nfapi.multi.carrier.lbt.support", FT_UINT16, BASE_DEC, VALS(nfapi_mutli_carrier_lbt_support_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_partial_sf_support, { "Partial SF support", "nfapi.partial.sf.support", FT_BOOLEAN, 8, TFS(&partial_sf_support_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_reference_signal_power, { "Reference signal power", "nfapi.ref_sig_power", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_primary_synchronization_signal_epre_eprers, { "Primary synchronization signal EPRE/EPRERS", "nfapi.primary.sync.signal", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_secondary_synchronization_signal_epre_eprers, { "Secondary synchronization signal EPRE/EPRERS", "nfapi.secondary.sync.signal", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_physical_cell_id, { "Physical Cell ID", "nfapi.physical.cell.id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_phich_resource, { "PHICH Resource", "nfapi.phich.resource", FT_UINT16, BASE_DEC, VALS(nfapi_phich_resource_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_phich_duration, { "PHICH Duration", "nfapi.phich.duration", FT_BOOLEAN, 8, TFS(&phich_duration_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_phich_power_offset, { "PHICH Power Offset", "nfapi.phich.power.offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_configuration_index, { "Configuration Index", "nfapi.configuration.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_root_sequence_index, { "Root sequence Index", "nfapi.root.sequence.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_zero_correlation_zone_configuration, { "Zero correlation zone configuration", "nfapi.zero.correlation.zone.configuration", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_high_speed_flag, { "High Speed Flag", "nfapi.high.speed.flag", FT_BOOLEAN, 8, TFS(&high_speed_flag_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_frequency_offset, { "Frequency offset", "nfapi.frequency.offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_hopping_mode, { "Hopping Mode", "nfapi.hopping.mode", FT_BOOLEAN, 8, TFS(&hopping_mode_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_hopping_offset, { "Hopping offset", "nfapi.hopping.offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_delta_pucch_shift, { "Delta PUCCH Shift", "nfapi.delta.pucch.shift", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_cqi_rb, { "N CQI RB", "nfapi.n.cqi.rb", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_an_cs, { "N AN CS", "nfapi.n.an.cs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n1_pucch_an, { "N1 PUCCH AN", "nfapi.n1.pucch.an", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_bandwidth_configuration, { "Bandwidth configuration", "nfapi.bw.configuration", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_srs_subframe_configuration, { "SRS subframe configuration", "nfapi.srs.subframe.configuration", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_uplink_rs_hopping, { "Uplink RS hopping", "nfapi.uplink.rs.hopping", FT_UINT16, BASE_DEC, VALS(nfapi_uplink_rs_hopping_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_group_assignment, { "Group assigment", "nfapi.group.assignment", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_cyclic_shift_1_for_drms, { "Cyclic Shift 1 for DRMS", "nfapi.cyclic.shift.1.for.drms", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_subframe_assignment, { "Subframe_assignment", "nfapi.subframe.assignment", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_special_subframe_patterns, { "Special Subframe patterns", "nfapi.special.subframe.patterns", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ed_threshold_for_lbt_for_pdsch, { "ED Threshold for LBT for PDSCH", "nfapi.subframe.assignment", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ed_threshold_for_lbt_for_drs, { "ED Threshold for LBT for DRS", "nfapi.subframe.assignment", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pd_threshold, { "PD Threshold", "nfapi.subframe.assignment", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_multi_carrier_type, { "Multi carrier type", "nfapi.subframe.assignment", FT_UINT16, BASE_DEC, VALS(nfapi_laa_carrier_type_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_multi_carrier_tx, { "Multi carrier TX", "nfapi.subframe.assignment", FT_BOOLEAN, 8, TFS(&nfapi_multi_carrier_tx_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_multi_carrier_freeze, { "Multi carrier freeze ", "nfapi.subframe.assignment", FT_BOOLEAN, 8, TFS(&nfapi_multi_carrier_freeze_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tx_antenna_ports_for_drs, { "Tx antenna ports for DRS", "nfapi.subframe.assignment", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_transmission_power_for_drs, { "Transmission power for DRS", "nfapi.subframe.assignment", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pbch_repetitions_enabled_r13, { "PBCH Repetitions enable R13", "nfapi.pbch.repetitions.enabled_r13", FT_BOOLEAN, 8, TFS(&enabled_disabled_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_cat_m_root_sequence_index, { "PRACH CAT-M Root sequence index", "nfapi.prach.cat_m.root.squence.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_cat_m_zero_correlation_zone_configuration, { "PRACH CAT-M Zero correlation zone configuration", "nfapi.prach.cat_m.zero.correlation.zone.configuration", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_cat_m_high_speed_flag, { "PRACH CAT-M High speed flag", "nfapi.prach.cat_m.high.speed.flag", FT_BOOLEAN, 8, TFS(&high_speed_flag_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_0_enable, { "PRACH CE level #0 Enable", "nfapi.prach.ce.level.0.enable", FT_BOOLEAN, 8, TFS(&enabled_disabled_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_0_configuration_index, { "PRACH CE level #0 Configuration index", "nfapi.prach.ce.level.0.configuration.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_0_frequency_offset, { "PRACH CE level #0 Frequency offset", "nfapi.prach.ce.level.0.frequency_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_0_number_of_repetitions_per_attempt, { "PRACH CE level #0 Number of repetitions per attempt", "nfapi.prach.ce.level.0.number.of.repetitions.per_attempt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_0_starting_subframe_periodicity, { "CE level #0 Starting subframe periodicity", "nfapi.prach.ce.level.0.starting.subframe_periodicity", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_0_hopping_enabled, { "PRACH CE level #0 Hopping Enable", "nfapi.prach.ce.level.0.hopping_enable", FT_BOOLEAN, 8, TFS(&enabled_disabled_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_0_hopping_offset, { "PRACH CE level #0 Hopping Offset", "nfapi.prach.ce.level.0.hopping.offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_1_enable, { "PRACH CE level #1 Enable", "nfapi.prach.ce.level.0.enable", FT_BOOLEAN, 8, TFS(&enabled_disabled_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_1_configuration_index, { "PRACH CE level #1 Configuration index", "nfapi.prach.ce.level.0.configuration.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_1_frequency_offset, { "PRACH CE level #1 Frequency offset", "nfapi.prach.ce.level.0.frequency_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_1_number_of_repetitions_per_attempt, { "PRACH CE level #1 Number of repetitions per attempt", "nfapi.prach.ce.level.0.number.of.repetitions.per_attempt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_1_starting_subframe_periodicity, { "CE level #1 Starting subframe periodicity", "nfapi.prach.ce.level.0.starting.subframe_periodicity", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_1_hopping_enabled, { "PRACH CE level #1 Hopping Enable", "nfapi.prach.ce.level.0.hopping_enable", FT_BOOLEAN, 8, TFS(&enabled_disabled_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_1_hopping_offset, { "PRACH CE level #1 Hopping Offset", "nfapi.prach.ce.level.0.hopping.offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_2_enable, { "PRACH CE level #2 Enable", "nfapi.prach.ce.level.0.enable", FT_BOOLEAN, 8, TFS(&enabled_disabled_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_2_configuration_index, { "PRACH CE level #2 Configuration index", "nfapi.prach.ce.level.0.configuration.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_2_frequency_offset, { "PRACH CE level #2 Frequency offset", "nfapi.prach.ce.level.0.frequency_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_2_number_of_repetitions_per_attempt, { "PRACH CE level #2 Number of repetitions per attempt", "nfapi.prach.ce.level.0.number.of.repetitions.per_attempt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_2_starting_subframe_periodicity, { "CE level #2 Starting subframe periodicity", "nfapi.prach.ce.level.0.starting.subframe_periodicity", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_2_hopping_enabled, { "PRACH CE level #2 Hopping Enable", "nfapi.prach.ce.level.0.hopping_enable", FT_BOOLEAN, 8, TFS(&enabled_disabled_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_2_hopping_offset, { "PRACH CE level #2 Hopping Offset", "nfapi.prach.ce.level.0.hopping.offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_3_enable, { "PRACH CE level #3 Enable", "nfapi.prach.ce.level.0.enable", FT_BOOLEAN, 8, TFS(&enabled_disabled_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_3_configuration_index, { "PRACH CE level #3 Configuration index", "nfapi.prach.ce.level.0.configuration.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_3_frequency_offset, { "PRACH CE level #3 Frequency offset", "nfapi.prach.ce.level.0.frequency_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_3_number_of_repetitions_per_attempt, { "PRACH CE level #3 Number of repetitions per attempt", "nfapi.prach.ce.level.0.number.of.repetitions.per_attempt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_3_starting_subframe_periodicity, { "CE level #3 Starting subframe periodicity", "nfapi.prach.ce.level.0.starting.subframe_periodicity", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_3_hopping_enabled, { "PRACH CE level #3 Hopping Enable", "nfapi.prach.ce.level.0.hopping_enable", FT_BOOLEAN, 8, TFS(&enabled_disabled_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_ce_level_3_hopping_offset, { "PRACH CE level #3 Hopping Offset", "nfapi.prach.ce.level.0.hopping.offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pucch_internal_ul_hopping_config_common_mode_a, { "PUCCH Interval-ULHoppingConfigCommonModeA", "nfapi.pucch.interval.ulhopping.config.common.mode.a", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pucch_internal_ul_hopping_config_common_mode_b, { "PUCCH Interval-ULHoppingConfigCommonModeB", "nfapi.pucch.interval.ulhopping.config.common.mode.b", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_data_report_mode, { "Data Report Mode", "nfapi.data.report.mode", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_sfnsf, { "SFN/SF", "nfapi.sfn.sf", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_max_up_pts, { "Max UpPTS frames", "nfapi.max.uppts.frame", FT_BOOLEAN, 8, TFS(&enabled_disabled_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_srs_acknack_srs_simultaneous_transmission, { "SRS AckNack Simultaneous transmission", "nfapi.srs.acknack.simult.tx", FT_BOOLEAN, 8, TFS(&srs_simult_tx_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_address, { "PNF address", "nfapi.p7.pnf.address", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_address_ipv4, { "PNF IPV4", "nfapi.pnf.address.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_address_ipv6, { "PNF IPV6", "nfapi.pnf.address.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_vnf_address, { "VNF address", "nfapi.vnf.address", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_vnf_address_ipv4, { "VNF IPV4 Address", "nfapi.vnf.address.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_vnf_address_ipv6, { "VNF IPV6 Address", "nfapi.vnf.address.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_port, { "PNF PORT value", "nfapi.config.pnf.port.value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_vnf_port, { "VNF PORT value", "nfapi.config.vnf.port.value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rf_bands, { "RF Bands", "nfapi.rf.bands", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rf_bands_count,	{ "Number of RF Bands", "nfapi.rf.bands.count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rf_bands_value, { "Band value", "nfapi.rf.bands.value",	FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_param_request, { "PNF Param Request", "nfapi.pnf.param.request", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_param_response, { "PNF Param Response", "nfapi.pnf.param.response",	FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_config_request,	{ "PNF Config Request", "nfapi.pnf.config.request",	FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_config_response, { "PNF Config Response", "nfapi.pnf.config.response", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_start_request, { "PNF Start Request", "nfapi.pnf.start.request", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_start_response, { "PNF Start Response", "nfapi.pnf.start.response", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_start_request, { "PNF Start Request", "nfapi.start.request", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_start_response, { "PNF Start Response", "nfapi.start.response", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_param_general, { "PNF Param General ", "nfapi.pnf.param.general", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_sync_mode, { "Sync Mode", "nfapi.sync.mode", FT_UINT8, BASE_DEC, VALS(nfapi_sync_mode_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_location_mode, { "Location Mode", "nfapi.location.mode", FT_UINT8, BASE_DEC, VALS(location_mode_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_location_coordinates_length, { "Location Coordinates Length", "nfapi.location.coordinates.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_location_coordinates, { "Location Coordinates", "nfapi.location.coordinates", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdu, { "PDU", "nfapi.pdu", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_timing, { "DL config Timing", "nfapi.dl.config.timing", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tx_timing, { "Tx Timing", "nfapi.general.tx.timing", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_timing, { "UL Config Timing", "nfapi.ul.config.timing", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_hi_dci0_timing, { "HI DCi0 Timing", "nfapi.hi.dci0.timing", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_maximum_number_phys, { "Maximum number of Phys", "nfapi.maximum.number.phys", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_maximum_total_bandwidth, { "Maximum Total Bandwidth", "nfapi.maximum.total.bandwidth", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_maximum_total_number_dl_layers,	{ "Maximum Total Number DL Layers", "nfapi.maximum.total.number.dl.layers", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_maximum_total_number_ul_layers,	{ "Maximum Total Number UL Layers", "nfapi.maximum.total.number.ul.layers",	FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_shared_bands, { "Shared bands", "nfapi.shared.bands", FT_BOOLEAN, 8, TFS(&true_false_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_shared_pa, { "Shared pa", "nfapi.shared.pa", FT_BOOLEAN, 8, TFS(&true_false_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_maximum_total_power, { "Maximum total power", "nfapi.maximum.total.power", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_oui, { "OUI", "nfapi.oui", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_phy, { "PNF Phy", "nfapi.pnf.phy", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_phy_number_phy, { "PNF Phy Number of Phy", "nfapi.pnf.phy.number.phy", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_phy_config_index, { "PNF Phy Config Index", "nfapi.pnf.phy.config.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_rf,	{ "PNF Phy RF", "nfapi.pnf.rf",	FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_rfs, { "Number of RFs", "nfapi.pnf.rf.number.rf",	FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_phy_rf_config_info,	{ "Phy RF Config Info", "nfapi.phy.rf.config.info",	FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_phy_rf_config_info_phy_id, { "Phy ID", "nfapi.pnf.phy.rf.config.phy.id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_phy_rf_config_info_band, { "RF Band", "nfapi.pnf.phy.rf.config.phy.id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_phy_rf_config, { "PNF Phy RF Config", "nfapi.pnf.phy.rf.config", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_phy_rf_config_number_phy_rf_config_info, { "Number of RF Config Info(s)", "nfapi.pnf.phy.rf.config.number.phy.rf.config.info", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_phy_rf_config_array_phy_rf_config_info,	{ "PNF Phy RF Config array phy rf config info ", "nfapi.pnf.phy.rf.config.array.phy.rf.config.info", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rf_config_index, { "RF Config Index", "nfapi.rf_config_index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_rf_exclusions, { "Number of RF exclusions", "nfapi.hf_nfapi_number_of_rf_exclusions",	FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_maximum_3gpp_release_supported,	{ "Maximum 3gpp Release Supported", "nfapi.maximum_3gpp_release_supported",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_downlink_channel_bandwidth_supported, { "Maximum Channel Downlink Bandwidth Supported", "nfapi.downlink_channel_bandwidth_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_uplink_channel_bandwidth_supported, { "Maximum Channel Uplink Bandwidth Supported", "nfapi.uplink_channel_bandwidth_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_dl_layers_supported, { "Number of DL Layers Supported", "nfapi.number_of_dl_layer_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_ul_layers_supported, { "Number of UL Layers Supported", "nfapi.number_of_ul_layer_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_nmm_modes_supported, { "NMM modes supported", "nfapi.nmm_modes_supported", FT_UINT8, BASE_DEC, VALS(nmm_modes_supported_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_band, { "Band", "nfapi.band", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_maximum_transmit_power, { "Maximum transmit power", "nfapi.maximum_transmit_power", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_earfcn, { "EARFCN", "nfapi.earfcn", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_rf_bands, { "Number of RF Bands", "nfapi.num.rf_bands", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_nmm_uplink_rssi_supported, { "NMM Uplink RSSI supported", "nfapi.nmm.uplink.rssi.supported", FT_UINT16, BASE_DEC, VALS(ul_rssi_supported_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_minimum_transmit_power, { "Minimum transmit power", "nfapi.minimum_transmit_power", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_antennas_suppported, { "Number of Supported Antennas", "nfapi.number_of_antennas_suppported", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_minimum_downlink_frequency, { "Minimum downlink frequency", "nfapi.minimum_downlink_frequency", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_maximum_downlink_frequency, { "Maximum downlink frequency", "nfapi.maximum_downlink_frequency", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_minimum_uplink_frequency, { "Minimum uplink frequency", "nfapi.minimum_downlink_frequency", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_maximum_uplink_frequency, { "Maximum uplink frequency", "nfapi.maximum_downlink_frequency", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_transmission_mode7_supported, { "Transmission Mode 7 Supported", "nfapi.pnf.phy_rel10.tx_mode7_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_transmission_mode8_supported, { "Transmission Mode 8 Supported", "nfapi.pnf.phy_rel10.tx_mode8_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_two_antennas_ports_for_pucch, { "Two antennas ports for PUCCH", "nfapi.pnf.phy_rel10.two_antennas_ports_for_pucch", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_transmission_mode_9_supported, { "Transmission Mode 9 Supported", "nfapi.pnf.phy_rel10.tx_mode9_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_simultaneous_pucch_pusch, { "Simultaneous PUCCH PUSCH", "nfapi.pnf.simultaneous_pucch_pusch", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_for_layer_tx_with_tm3_and_tm4, { "Four layer Tx with TM3 and TM4", "nfapi.pnf.phy_rel10.layer_tx_with_tm3_and_tm4", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_epdcch_supported, { "ePDCCH supported", "nfapi.pnf.phy_rel11.epdcch_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_multi_ack_csi_reporting, { "Multi ACK CSI reporting", "nfapi.pnf.phy_rel11.mutli_ack_csi_reporting", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_pucch_tx_diversity_with_channel_selection, { "PUCCH Tx diversity with channel selection", "nfapi.pnf.phy_rel11.tx_div_with_channel_selection", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_ul_comp_supported, { "UL CoMP supported", "nfapi.pnf.phy_rel11.ul_comp_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_transmission_mode_5_supported, { "Transmission mode 5 supported", "nfapi.pnf.phy_rel11.tx_mode5_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_subframe_set, { "CSI subframe set", "nfapi.pnf.phy_rel12.csi_subframe_set", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_enhanced_4tx_codebook, { "Enhanced 4TX codebook", "nfapi.pnf.phy_rel12.exhanced_t4x_codebook", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_drs_supported, { "DRS supported", "nfapi.pnf.phy_rel12.drs_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_ul_64qam_supported, { "UL 64QAM supported", "nfapi.pnf.phy_rel12.ul_64qam_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_transmission_mode_10_supported, { "Transmission mode 10 supported", "nfapi.pnf.phy_rel12.tx_mode10_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hi_nfapi_alternative_tbs_indices, { "Alternative TBS indices", "nfapi.pnf.phy_rel12.alternative_tbs_indices", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pucch_format_4_supported, { "PUCCH format 4 supported", "nfapi.pnf.phy_rel13.pucch_format4_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pucch_format_5_supported, { "PUCCH format 5 supported", "nfapi.pnf.phy_rel13.pucch_format5_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_more_than_5_ca_supported, { "More than 5 CA support", "nfapi.pnf.phy_rel13.mode_than_5_ca_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_laa_supported, { "LAA supported", "nfapi.pnf.phy_rel13.laa_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_laa_ending_in_dwpts_supported, { "LAA ending in DwPTS supported", "nfapi.pnf.phy_rel13.laa_ending_in_dwpts_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_laa_starting_in_second_slot_supported, { "LAA starting in second slot Supported", "nfapi.pnf.phy_rel13.laa_starting_in_second_slot_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_beamforming_supported, { "Beamforming Supported", "nfapi.pnf.phy_rel13.beamingforming_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_enhancements_supported, { "CSI-RS enhancements supported", "nfapi.pnf.phy_rel13.csi_rs_enchancements_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_drms_enhancements_supported, { "DMRS enhancements supported", "nfapi.pnf.phy_rel13.drms_enhancements_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_srs_enhancements_supported, { "SRS enhancements supported", "nfapi.pnf.phy_rel13.srs_enhancements_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_sfn_sf, { "SFN_SF", "nfapi.sfn_sf", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_request_body, { "DL Config Request body", "nfapi.dl.config.request.body", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_pdcch_ofdm_symbols, { "Number of PDCCH OFDM Symbols", "nfapi.number_pdcch_ofdm_symbols", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_dci, { "Number of DCI", "nfapi.number_dci", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_pdus, { "Number of PDUs", "nfapi.number_pdu", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_harqs, { "Number of HARQs", "nfapi.number_harqs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_crcs, { "Number of CRCs", "nfapi.number_crcs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_srs, { "Number of SRs", "nfapi.number_srs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_cqi, { "Number of CQIs", "nfapi.number_cqi", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_preambles, { "Number of Preambles", "nfapi.number_preambles", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_srss, { "Number of SRSs", "nfapi.number_srss", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_lbt_dl_req_pdu_type, { "LBT DL Request PDU Type", "nfapi.number_srss", FT_UINT16, BASE_DEC, VALS(nfapi_lbt_dl_req_pdu_type), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_lbt_dl_ind_pdu_type, { "LBT DL Indication PDU Type", "nfapi.number_srss", FT_UINT16, BASE_DEC, VALS(nfapi_lbt_dl_ind_pdu_type), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_pdsch_rnti, { "Number of PDSCH RNTI", "nfapi.number_pdsch_rnti", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_transmission_power_pcfich, { "Transmission Power PCFICH", "nfapi.transmission_power_pcfich", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_request_pdu_list,	{ "DL Config Request body", "nfapi.dl.config.request.pdu_list",	FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_request_pdu_list,	{ "UL Config Request body", "nfapi.ul.config.request.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_hi_dci0_request_pdu_list, { "HI DCI0 Request body", "nfapi.hi.dci0.config.request.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tx_request_pdu_list, { "Tx Request body", "nfapi.tx.request.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rx_indication_pdu_list, { "Rx Indication body", "nfapi.rx.indication.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_indication_pdu_list, { "Harq Indication body", "nfapi.harq.indication.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_crc_indication_pdu_list, { "CRC Indication body", "nfapi.crc.indication.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_sr_indication_pdu_list, { "SR Indication body", "nfapi.sr.indication.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_cqi_indication_pdu_list, { "CQI Indication body", "nfapi.cqi.indication.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_preamble_indication_pdu_list, { "Preamble Indication body", "nfapi.preamble.indication.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_srs_indication_pdu_list, { "SRS Indication body", "nfapi.srs.indication.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_lbt_dl_config_pdu_list, { "LBT DL Config Request body", "nfapi.lbt.dl.request.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_lbt_dl_indication_pdu_list, { "LBT DL Indicatoin body", "nfapi.lbt.dl.indication.pdu_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_pdu_type, { "PDU Type", "nfapi.pdu.type",	FT_UINT8, BASE_DEC, VALS(nfapi_dl_config_pdu_type_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdu_size, { "PDU size", "nfapi.pdu.size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_instance_length, { "Instance length", "nfapi.instance.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_dlsch_pdu_rel8, { "DL CONFIG DLSCH PDU REL8", "nfapi.dl.config.dlsch.pdu.rel8", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_length, { "PDU length", "nfapi.pdu.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdu_index, { "PDU Index", "nfapi.pdu.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rnti, { "RNTI", "nfapi.rnti", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_resource_allocation_type, { "Resource Allocation Type", "nfapi.resource.allocation.type", FT_UINT8, BASE_DEC, VALS(resource_allocation_type_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_virtual_resource_block_assignment_flag, { "Virtual resource block assignment flag", "nfapi.resource.block.assignment.flag", FT_UINT8, BASE_DEC, VALS(local_distributed_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_resource_block_coding, { "Resource block coding", "nfapi.resource.block.coding", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_modulation, { "Modulation", "nfapi.modulation", FT_UINT8, BASE_DEC, VALS(modulation_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_redundancy_version, { "Redundancy version", "nfapi.redundancy.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_transport_blocks, { "Transport blocks", "nfapi.transport.blocks", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_transport_block_to_codeword_swap_flag, { "Transport block to codeword swap flag", "nfapi.transport.block.to.codeword.swap.flag", FT_UINT8, BASE_DEC, VALS(transport_block_to_codeword_swap_flag_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_transmission_scheme, { "Transmission scheme", "nfapi.transmission.scheme", FT_UINT8, BASE_DEC, VALS(transmission_scheme_vals), 0x0, "The MIMO mode used in the PDU", HFILL } },
+-		{ &hf_nfapi_ul_transmission_scheme, { "Transmission scheme", "nfapi.transmission.scheme", FT_UINT8, BASE_DEC, VALS(ul_transmission_scheme_vals), 0x0, "The MIMO mode used in the PDU", HFILL } },
+-		{ &hf_nfapi_number_of_layers, { "Number of layers", "nfapi.number.of.layers", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_subbands, { "Number of subbands", "nfapi.number.of.subbands", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_codebook_index, { "Codebook index", "nfapi.number.of.codebook.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ue_category_capacity, { "UE category capacity", "nfapi.ue.category.capacity", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pa, { "P-A", "nfapi.pa", FT_UINT8, BASE_DEC, VALS(pa_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_delta_power_offset_index, { "Delta Power offset index", "nfapi.delta.power.offset.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_nprb, { "Nprb", "nfapi.nprb", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_transmission_mode, { "Transmission Mode", "nfapi.transmission_nprb", FT_UINT8, BASE_DEC, VALS(transmission_mode_vals), 0x0, "Transmission mode associated with the UE", HFILL } },
+-		{ &hf_nfapi_prnti, { "P-RNTI", "nfapi.prnti", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mcs, { "MCS", "nfapi.mcs", FT_UINT8, BASE_DEC, VALS(pch_modulation_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_transport_blocks, { "Number of transport blocks", "nfapi.number_of_transport_blocks", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ue_mode, { "UE Mode", "nfapi.ue.mode", FT_UINT8, BASE_DEC, VALS(ue_mode_vals), 0x0, NULL, HFILL } },
+-		{ &hf_prs_bandwidth, { "PRS bandwidth", "nfapi.prs.bandwidth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_prs_cyclic_prefix_type, { "PRS cyclic prefix type", "nfapi.prs.cyclic.prefix.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_prs_muting, { "PRS muting", "nfapi.prs.muting", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_num_bf_prb_per_subband, { "Num of BF PRB per Subband", "nfapi.num.bf.prb.per.subband", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_num_bf_vector, { "Num of BF Vector", "nfapi.num.bf.vector", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_resource_config, { "CSI-RS resource config", "nfapi.csi.rs.resource.config", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_bf_vector_subband_index, { "BF Subband Index", "nfapi.num.bf.vector.subband.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_bf_vector_num_antennas, { "BF Num of Antennas", "nfapi.num.bf.vector.bf.value", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_bf_vector_bf_value, { "BF Value per Antenna", "nfapi.num.bf.vector.bf.value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_dlsch_pdu_rel9, { "DL CONFIG DLSCH PDU REL9", "nfapi.dl.config.dlsch.pdu.rel9", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_nscid, { "NSC id", "nfapi.nscid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_dlsch_pdu_rel10, { "DL CONFIG DLSCH PDU REL10", "nfapi.dl.config.dlsch.pdu.rel10", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_flag, { "CSI RS Flag", "nfapi.csi.rs.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_subbands, { "Subbands", "nfapi.subbands", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_bf_vectors, { "BF Vectors", "nfapi.bf.vectors", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_bf_vector_antennas, { "Antennas", "nfapi.antennas", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_resource_config_r10, { "CSI RS resource config R10", "nfapi.csi.rs.resource_config_r10", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_zero_tx_power_resource_config_bitmap_r10, { "CSI-RS Number of NZP configuration", "nfapi.csi.rs.num.of.nzp.configurations",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_number_if_nzp_configurations, { "CSI RS zero Tx Power Resource config bitmap R10", "nfapi.csi.rs.zero.tx.power.resource.config.bitmap.r10", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_resource_configs, { "CSR/RS Resource Configs", "nfapi.csi.rs.resource.configs", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdsch_start, { "PDSCH_start", "nfapi.pdsch.start", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_drms_config_flag, { "DMRS Config flag", "nfapi.drms.config.flag", FT_UINT8, BASE_DEC, VALS(not_used_enabled_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_drms_scrambling, { "DMRS Scrambling", "nfapi.drms.scrambling", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_config_flag, { "CSI Config flag", "nfapi.csi.config.flag", FT_UINT8, BASE_DEC, VALS(not_used_enabled_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_scrambling, { "CSI Scrambling", "nfapi.csi.scrambling", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdsch_re_mapping_flag, { "PDSCH RE mapping flag", "nfapi.pdsch.remapping.flag", FT_UINT8, BASE_DEC, VALS(not_used_enabled_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdsch_re_mapping_antenna_ports, { "PDSCH RE mapping antenna ports", "nfapi.pdsch.remapping.antenna.ports", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdsch_re_mapping_freq_shift, { "PDSCH RE mapping freq shift", "nfapi.pdsch.remapping.freq.shift", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_alt_cqi_table_r12, { "altCQI-Table-r12", "nfapi.alt.cqi.table.r12", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_max_layers, { "MaxLayers", "nfapi.max.layers", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_dl_harq, { "N_DL_HARQ", "nfapi.n.dl.harq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dwpts_symbols, { "DwPTS Symbols", "nfapi.dwpts.symbols", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_initial_lbt_sf, { "Initial LBT SF", "nfapi.initial.lbt.sf", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ue_type, { "UE Type", "nfapi.ue.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdsch_payload_type, { "PDSCH Payload Type", "nfapi.pdsch.payload.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_initial_transmission_sf, { "Initial transmission SF (io) ", "nfapi.init.tx.sf.io", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_req13_drms_table_flag, { "Rel-13-DMRS-tabe flag", "nfapi.r13.drms.table.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_resource_index, { "CSI-RS resource index", "nfapi.csi.rs.resource.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_class, { "Class", "nfapi.csi.rs.class", FT_UINT8, BASE_DEC, VALS(csi_rs_class_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_cdm_type, { "CDM Type", "nfapi.cdm.type", FT_UINT8, BASE_DEC, VALS(csi_rs_cdm_type_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_bf_vector, { "BF Vector", "nfapi.bf.vector", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_edpcch_prb_index, { "EPDCCH PRB index", "nfapi.edpcch.prb.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_epdcch_resource_assignment_flag, { "EPDCCH Resource assignment flag", "nfapi.epdcch.resource.assignment.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_epdcch_id, { "EPDCCH ID", "nfapi.epdcch.id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_epdcch_start_symbol, { "EPDCCH Start Symbol", "nfapi.epdcch.start.symbol", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_epdcch_num_prb, { "EPDCCH NumPRB", "nfapi.epdcch.num.prb", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_epdcch_prbs, { "EPDCCH PRBs", "nfapi.epdcch.prbs", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_precoding_value, { "Precoding value", "nfapi.precoding.value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mpdcch_narrowband, { "MPDCCH Narrowband", "nfapi.mpdcch.narrowband", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_prb_pairs, { "Number of PRB pairs", "nfapi.number.prb.pairs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_resource_block_assignment, { "Resource Block Assignment", "nfapi.resource.block.assignement", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_start_symbol, { "Start symbol", "nfapi.start.symbol", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ecce_index, { "ECCE index", "nfapi.ecce.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ce_mode, { "Rel-13-DMRS-tabe flag", "nfapi.r13.drms.table.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_drms_scrabmling_init, { "DMRS scrambling init", "nfapi.drms.scrambling.init", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdsch_reception_levels, { "PDSCH repetition levels", "nfapi.pdsch.repetition.levels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_new_data_indicator, { "New data indicator", "nfapi.new.data.indicator", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tpmi_length, { "TPMI length", "nfapi.tpmi.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pmi_flag, { "PMI flag", "nfapi.pmi.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_resource_offset, { "HARQ resource offset", "nfapi.harq.resource.offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dci_subframe_repetition_number, { "DCI subframe repetition number", "nfapi.dci.subframe.repetition.number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_downlink_assignment_index_length, { "Downlink assignment index Length", "nfapi.dl.assignement.index.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_starting_ce_level, { "Starting CE Level", "nfapi.starting.ce.level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_antenna_ports_and_scrambling_identity_flag, { "Antenna ports and scrambling identity flag", "nfapi.antenna.ports.and.scrambling.identity.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_antenna_ports_and_scrambling_identity, { "Antenna ports and scrambling identity", "nfapi.antenna.ports.and.scrambling.identit", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_paging_direct_indication_differentiation_flag, { "Paging/Direct indication differentiation flag", "nfapi.paging.direct.indictation.differentiation.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_direct_indication, { "Direct indication", "nfapi.direct.indication", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_tx_antenna_ports, { "Number of TX Antenna ports", "nfapi.num.of.tx.antenna.ports.", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_precoding, { "Precoding", "nfapi.precodiing", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_bch_pdu_rel8, { "DL CONFIG BCH PDU Rel8", "nfapi.dl.config.bch.pdu.rel8", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_value_float, { "Value", "nfapi.value.float", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_transmission_power, { "Transmission Power", "nfapi.transmission_power", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_mch_pdu_rel8, { "DL CONFIG MCH PDU Rel8", "nfapi.dl.config.mch.pdu.rel8", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mbsfn_area_id, { "MBSFN Area id", "nfapi.mbsfn.area.id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_pch_pdu_rel8, { "DL CONFIG MCH PDU Rel8", "nfapi.dl.config.mch.pdu.rel8", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_dci_dl_pdu_rel8, { "DL CONFIG DCI DL PDU Rel8", "nfapi.dl.config.mch.pdu.rel8", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dci_format, { "DCI format", "nfapi.dci.format", FT_UINT8, BASE_DEC, VALS(dci_format_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_cce_idx, { "CCE index", "nfapi.cce.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_aggregation_level, { "Aggregation level", "nfapi.aggregation.level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mcs_1, { "MCS_1", "nfapi.mcs_1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mcs_2, { "MCS_2", "nfapi.mcs_2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_redundancy_version_1, { "Redundancy version_1", "nfapi.redundancy.version.1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_redundancy_version_2, { "Redundancy version_2", "nfapi.redundancy.version.2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_new_data_indicator_1, { "New data indicator_1", "nfapi.new.data.indicator.1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_new_data_indicator_2 ,{ "New data indicator_2", "nfapi.new.data.indicator.2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_process, { "HARQ process", "nfapi.harq.process", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tpmi, { "TPMI", "nfapi.tpmi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pmi, { "PMI", "nfapi.pmi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_precoding_information, { "Precoding information", "nfapi.precoding.information", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tpc, { "TPC", "nfapi.tpc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_downlink_assignment_index, { "Downlink assignment index", "nfapi.downlink.assignment.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ngap, { "Ngap", "nfapi.ngap", FT_UINT8, BASE_DEC, VALS(ngap_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_transport_block_size_index, { "Transport block size index", "nfapi.transport.block.size.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_downlink_power_offset, { "Downlink power offset", "nfapi.downlink.power.offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_allocate_prach_flag, { "Allocation PRACH flag", "nfapi.allocation.prach.flag", FT_UINT8, BASE_DEC, VALS(true_false_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_preamble_index, { "Preamble index", "nfapi.preamable.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prach_mask_index, { "PRACH mask index", "nfapi.prach.mask.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rnti_type, { "RNTI type", "nfapi.rnti.type", FT_UINT8, BASE_DEC, VALS(rnti_type_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_dci_dl_pdu_rel9, { "DL CONFIG DCI DL PDU Rel9", "nfapi.dl.config.mch.pdu.rel9", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mcch_flag, { "MCCH flag", "nfapi.mcch.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mcch_change_notification, { "MCCH change notification", "nfapi.mcch.change.notification", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_scrambling_identity, { "Scrambling identity", "nfapi.scrambling.identity", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_dci_dl_pdu_rel10, { "DL CONFIG DCI DL PDU Rel10", "nfapi.dl.config.mch.pdu.rel10", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_cross_carrier_scheduling_flag, { "Cross Carrier scheduling flag", "nfapi.cross.carrier.scheduling.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_carrier_indicator, { "Carrier Indicator", "nfapi.carrier.indicator", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_srs_flag, { "SRS flag", "nfapi.srs.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_srs_request, { "SRS request", "nfapi.srs.request", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_antenna_ports_scrambling_and_layers, { "Antenna ports scrambling and layers", "nfapi.antenna.ports.scrambling.and.layers", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_total_dci_length_including_padding, { "Total DCI length including padding", "nfapi.total.dci.length.including.padding", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_dl_rb, { "N_DL_RB", "nfapi.n.dl.rb", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_ul_rb, { "N_UL_RB", "nfapi.n.dl.rb", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_ack_resource_offset, { "HARQ-ACK resource offset", "nfapi.harq.ack.resource.offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdsch_re_mapping_and_quasi_co_location_indicator, { "PDSCH RE Mapping and Quasi-Co-Location Indicator", "nfapi.pdsch.re.mapping", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_primary_cell_type, { "Primary cell type", "nfapi.primary.cell.type", FT_UINT8, BASE_DEC, VALS(primary_cells_type_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_dl_configuration_flag, { "UL/DL configuration flag", "nfapi.ul.dl.configuration.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_ul_dl_configurations, { "Number of UL/DL configurations", "nfapi.number.ul.dl.configurations", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_dl_configuration_index, { "UL/DL configuration indication", "nfapi.ul.dl.configuration.indication", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_laa_end_partial_sf_flag, { "LAA end partial SF flag", "nfapi.laa.end.partial.sf.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_laa_end_partial_sf_configuration, { "LAA end partial SF configuration", "nfapi.laa.end.partial.sf.configuration", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_codebooksize_determination_r13, { "Codebook Size Determination R13", "nfapi.codebook.size.determination.r13", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rel13_drms_table_flag, { "Rel-13-DMRS-tabe flag", "nfapi.drms.table.flag.r13", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pscch_resource, { "PSCCH Resource", "nfapi.pscch.resource", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_time_resource_pattern, { "Time resource pattern", "nfapi.time.resource.pattern", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mpdcch_transmission_type, { "MPDCCH transmission type", "nfapi.mpdcch.transmission.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_drms_scrambling_init, { "DMRS scrambling init", "nfapi.drms.scrambling.init", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pusch_repetition_levels, { "PUSCH repetition levels", "nfapi.pusch.repetition.levels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_frequency_hopping_flag, { "Frequency hopping flag", "nfapi.frequency.hopping.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_request, { "CSI request", "nfapi.csi.request", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dai_presence_flag, { "DAI presence flag", "nfapi.dia.presence.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_total_dci_length_include_padding, { "Total DCI length including padding", "nfapi.total.dci.length.including.padding", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_prs_pdu_rel9, { "DL CONFIG PRS PDU Rel9", "nfapi.dl.config.prs.pdu.rel9", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prs_bandwidth, { "PRS Bandwidth", "nfapi.prs.bandwidth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_prs_cyclic_prefix_type, { "PRS cyclic prefix type", "nfapi.prs.cyclic.prefix.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_config_csi_rs_pdu_rel10, { "DL CONFIG CSI RS PDU Rel10", "nfapi.dl.config.csi.rs.pdu.rel10", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_rs_antenna_port_count_r10, { "Antenna port count r10", "nfapi.csi.rs.antenna.port.count.r10", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_request_body, { "UL Config Request body", "nfapi.ul.config.request.body", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_pdu_type,	{ "UL Config PDU Type", "nfapi.ul.config.pdu.type", FT_UINT8, BASE_DEC, VALS(nfapi_ul_config_pdu_type_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rach_prach_frequency_resources,	{ "RACH PRACH Frequency resources", "nfapi.rach.prach.frequency.resources",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_srs_present, { "SRS present", "nfapi.srs.present", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_harq_buffer_pdu, { "HARQ Buffer PDU", "nfapi.ul.config.harq.buffer.pdu", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_ue_information_rel8, { "UE Information Rel 8", "nfapi.ul.config.ue.information.pdu.rel8", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_handle,	{ "Handle", "nfapi.handle",	FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_sr_information_pdu_rel8, { "SR Information Rel 8", "nfapi.ul.config.sr.information.pdu.rel8",	FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pucch_index, { "PUCCH Index", "nfapi.pucch.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_size, { "Size", "nfapi.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_resource_block_start, { "Resource block start", "nfapi.resource.block.start", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_resource_blocks, { "Number of resource blocks", "nfapi.resource.blocks", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_cyclic_shift_2_for_drms, { "Cyclic Shift 2 for DRMS", "nfapi.cyclic.shift.2.for.drms", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_frequency_hopping_enabled_flag, { "Frequency hopping enabled flag", "nfapi.frequency.hopping.enabled.flag", FT_UINT8, BASE_DEC, VALS(hopping_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_frequency_hopping_bits, { "Frequency hopping bits", "nfapi.frequency.hopping.bits", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_new_data_indication, { "New Data inidication", "nfapi.new.data.indication", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_process_number, { "HARQ Process number", "nfapi.harq.process.number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_tx_mode, { "UL Tx Mode", "nfapi.ul.tx.mode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_current_tx_nb, { "Current Tx nb", "nfapi.current.tx.nb", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_srs, { "N SRS", "nfapi.n.srs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_disable_sequence_hopping_flag, { "Disable seqeunce hopping flag", "nfapi.disable.sequence.hopping.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_virtual_cell_id_enabled_flag, { "Virtual cell ID enabled flag", "nfapi.virtual.cell.id.enabled.flag", FT_UINT8, BASE_DEC, VALS(not_used_enabled_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_npusch_identity, { "nPUSCH Identity", "nfapi.npusch.identity", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ndrms_csh_identity, { "nDMRS-CSH Identity", "nfapi.ndrms.csh.identity", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_total_number_of_repetitions, { "Total Number of repetitions", "nfapi.total.number.of.repetitions", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_repetition_number, { "Repetition Number", "nfapi.repetition.number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_initial_sf_io, { "Initial transmission SF (io) ", "nfapi.initial.sf.io", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_empty_symbols_due_to_retunning, { "Empy symbols due to re-tunning", "nfapi.empty.symbols.due.to.retunning", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_cqi_ri_pmi_size_2, { "DL CQI/PMI/RI size 2", "nfapi.dl.cqi.ri.pmi.size.2", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_size_2, { "HARQ Size 2", "nfapi.harq.size2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_delta_offset_harq_2, { "Delta Offset HARQ 2", "nfapi.delta.offset.harq.2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_starting_prb, { "Starting PRB", "nfapi.starting.prb", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_antenna_port, { "Antenna Port", "nfapi.antenna.port", FT_UINT8, BASE_DEC, VALS(antenna_ports_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_combs, { "Number of Combs", "nfapi.num.of.combs", FT_UINT8, BASE_DEC, VALS(combs_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_npucch_identity, { "nPUCCH Identity", "nfapi.npucch.identity", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_empty_symbols, { "Empty symbols", "nfapi.empty.symbols", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_csi_mode, { "CSI_mode", "nfapi.csi.mode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_cqi_pmi_size_2, { "DL CQI/PMI Size 2", "nfapi.dl.cqi.pmi.size.2", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_statring_prb, { "Starting PRB", "nfapi.starting.prb", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_cdm_index, { "cdm_Index", "nfapi.cdm.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_nsrs, { "N srs", "nfapi.n.srs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_num_ant_ports, { "Num_ant_ports", "nfapi.num.ant.port", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_pucch_2_0, { "n_PUCCH_2_0", "nfapi.n.pucch.2.0", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_pucch_2_1, { "n_PUCCH_2_1", "nfapi.n.pucch.2.1", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_pucch_2_2, { "n_PUCCH_2_2", "nfapi.n.pucch.2.2", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_pucch_2_3, { "n_PUCCH_2_3", "nfapi.n.pucch.2.3", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_cqi_pmi_size_rank_1, { "DL CQI PMI size rank 1", "nfapi.dl.cqi.pmi.size.rank.1",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_cqi_pmi_size_rank_greater_1,	{ "DL CQI PMI size rank greater 1", "nfapi.dl.cqi.pmi.size.rank.1",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ri_size, { "RI size", "nfapi.ri.size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_delta_offset_cqi, { "Delta offset cqi", "nfapi.delta.offset.cqi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_delta_offset_ri, { "Delta offset ri", "nfapi.delta.offset.ri", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_size, { "HARQ size", "nfapi.harq_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_delta_offset_harq, { "Delta offset HARQ", "nfapi.delta.offset.harq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ack_nack_mode, { "ACK NACK mode", "nfapi.ack.nack.mode", FT_UINT8, BASE_DEC, VALS(nfapi_ack_nack_mode_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_srs_initial, { "N srs initial", "nfapi.n.srs.initial", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_initial_number_of_resource_blocks, { "Initial number of resource blocks", "nfapi.initial.number.of.resource.blocks", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_cqi_pmi_size, { "DL cqi pmi size", "nfapi.dl.cqi.pmi.size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_report_type, { "Report type", "nfapi.report.type", FT_BOOLEAN, 8, TFS(&nfapi_csi_report_type_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_cqi_ri_pmi_size,	{ "DL CQI RI PMI size", "nfapi.dl.cqi.ri.pmi.size",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_control_type, { "Control type", "nfapi.control.type", FT_BOOLEAN, 8, TFS(&nfapi_control_type_string_name), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_cc, { "Number of cc", "nfapi.number.of.cc",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_pucch_resource, { "Number of PUCCH Resource", "nfapi.number.of.pucch.resource", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pucch_index_p1, { "PUCCH Index P1", "nfapi.pucch.index.p1", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_pucch_1_0, { "N PUCCH 1 0", "nfapi.n.pucch.1.0", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_pucch_1_1, { "N PUCCH 1 1", "nfapi.n.pucch.1.1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_pucch_1_2, { "N PUCCH 1 2", "nfapi.n.pucch.1.2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_n_pucch_1_3, { "N PUCCH 1 3", "nfapi.n.pucch.1.3", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_srs_bandwidth, { "SRS Bandwidth", "nfapi.srs.bandwidth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_frequency_domain_position, { "Frequency Domain position", "nfapi.frequency.domain.position", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_srs_hopping_bandwidth, { "SRS hopping bandwidth", "nfapi.srs.hopping.bandwidth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_transmission_comb, { "Transmission comb", "nfapi.transmission.comb", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_i_srs, { "I SRS", "nfapi.i.srs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_sounding_reference_cyclic_shift, { "Sounding reference cyclic shift", "nfapi.sounding.reference.cyclic.shift", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_antenna_ports, { "Antenna port(s)", "nfapi.antenna.port", FT_UINT8, BASE_DEC, VALS(nfapi_antenna_port_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_srs_pdu_rel10, { "SRS PDU Rel 10", "nfapi.srs.pdu.rel.10", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_srs_pdu_rel8, { "SRS PDU Rel 8", "nfapi.srs.pdu.rel.8", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_harq_information_rel9_fdd, { "HARQ information Rel 9 FDD", "nfapi.harq.information.rel.9.fdd", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_harq_information_rel8_fdd, { "HARQ information Rel 8 FDD", "nfapi.harq.information.rel.8.fdd", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_harq_information_rel10_tdd, { "HARQ information Rel 10 TDD", "nfapi.harq.information.rel.10.tdd", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_sr_information_rel10, { "SR information Rel 10", "nfapi.sr.information.rel.10", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_sr_information_rel8, { "SR information Rel 8", "nfapi.sr.information.rel.8", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_cqi_information_rel10, { "CQI information Rel 10", "nfapi.cqi.information.rel.10", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_cqi_information_rel8, { "CQI information Rel 8", "nfapi.cqi.information.rel.8", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_initial_transmission_parameters_rel8, { "Initial transmission parameters Rel 8", "nfapi.initial.transmission.parameters.rel.8", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_config_ulsch_harq_information_rel10, { "HARQ Information Rel 10", "nfapi.harq.information.rel.10", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdu_length, { "PDU length", "nfapi.pdu.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_num_segments, { "Num segments", "nfapi.num.segments", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_segment_length, { "Segment length", "nfapi.segment.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_segment_data, { "Segment data", "nfapi.segment.data", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_crc_indication_body, { "CRC Indication Body", "nfapi.crc_indication_body", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_crc_flag, { "CRC flag", "nfapi.crc.flag", FT_BOOLEAN, 8, TFS(&crc_flag_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_hi_pdus, { "Number of HI Pdu's", "nfapi.number_of_hi_pdus", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_dci_pdus, { "Number of DCI Pdu's", "nfapi.number_of_dci_pdus", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pdu_type, { "PDU Type", "nfapi.pdu_type",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_hi_value, { "HI Value", "nfapi.hi_value", FT_BOOLEAN, 8, TFS(&hi_value_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_i_phich, { "i phich", "nfapi.i_phich", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_flag_tb2, { "Flag TB2", "nfapi.flag_tb2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_hi_value_2, { "HI Value 2", "nfapi.hi_value_2", FT_BOOLEAN, BASE_NONE, TFS(&hi_value_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ue_tx_antenna_selection, { "UE Tx Antenna selection", "nfapi.ue_tx_antenna_selection", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_cqi_csi_request, { "cqi csi request", "nfapi.cqi_csi_request", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_index, { "UL index", "nfapi.ul_index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_assignment_index, { "DL Assignment index", "nfapi.dl_assignment_index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tpc_bitmap, { "TPC bitmap", "nfapi.tpc_bitmap", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_antenna_ports, { "Number of antenna ports", "nfapi.number.of.antenna.ports", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_size_of_cqi_csi_feild, { "Size of cqi csi feild", "nfapi.size.of.cqi.csi.feild", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_new_data_indication_two, { "New data indicatipon 2", "nfapi.new.data.indication.two", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_resource_allocation_flag, { "Resource allocation flag", "nfapi.resource.allocation.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_node_sync, { "DL Node Sync", "nfapi.dl.node.sync", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_node_sync_t1, { "DL Node Sync t1", "nfapi.dl.node.sync.t1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_node_sync_delta_sfn_sf, { "DL Node Sync Delta SFN SF", "nfapi.dl.node.sync.delta_sfn_sf", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_dl_cyclic_prefix_type, { "DL Cyclic Prefix type", "nfapi.dl.cyclic.prefix.type", FT_BOOLEAN, 8, TFS(&cyclic_prefix_type_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_cyclic_prefix_type, { "UL Cyclic Prefix type", "nfapi.ul.cyclic.prefix.type", FT_BOOLEAN, 8, TFS(&cyclic_prefix_type_strname), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_downlink_channel_bandwidth, { "Downlink Channel Bandwidth", "nfapi.dl.channel.bandwidth", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_uplink_channel_bandwidth, { "Uplink Channel Bandwidth", "nfapi.ul.channel_bandwidth", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_tx_antenna_ports, { "Tx Antenna Ports", "nfapi.tx.antenna.ports", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rx_antenna_ports, { "Tx Antenna Ports", "nfapi.rx.antenna.ports", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_node_sync, { "UL Node Sync", "nfapi.ul.node.sync", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_node_sync_t1, { "UL Node Sync t1", "nfapi.ul.node.sync.t1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_node_sync_t2, { "UL Node Sync t2", "nfapi.ul.node.sync.t2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_node_sync_t3, { "UL Node Sync t3", "nfapi.ul.node.sync.t3", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pb, { "P-B", "nfapi.pb.allocation", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_last_sfn_sf, { "Last SFN/SF", "nfapi.timing.info.last.sfn.sf", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_time_since_last_timing_info, { "Time since last Timing Info", "nfapi.timing.info.time.since.last.timing.info", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_dl_config_jitter, { "DL Config Jitter", "nfapi.timing.info.dl.config.jitter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_tx_request_jitter, { "Tx Request Jitter", "nfapi.timing.info.tx.req.jitter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_ul_config_jitter, { "UL Config Jitter", "nfapi.timing.info.ul.config.jitter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_hi_dci0_jitter, { "HI_DCI0 Jitter", "nfapi.timing.info.hi.dci0.jitter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_dl_config_latest_delay, { "DL Config Latest Delay", "nfapi.timing.info.dl.config.latest.delay", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_tx_request_latest_delay, { "Tx Request Latest Delay", "nfapi.timing.info.tx.request.latest.delay", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_ul_config_latest_delay, { "UL Config Latest Delay", "nfapi.timing.info.ul.config.latest.delay", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_hi_dci0_latest_delay, { "HI_DCI0 Latest Delay", "nfapi.timing.info.hi.dci0.latest.delay", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_dl_config_earliest_arrival, { "DL Config Earliest Arrival", "nfapi.timing.info.dl.config.earliest.arrival", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_tx_request_earliest_arrival, { "Tx Request Earliest Arrival", "nfapi.timing.info.tx.request.earliest.arrival", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_ul_config_earliest_arrival, { "UL Config Earliest Arrival", "nfapi.timing.info.ul.config.earliest.arrival", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_hi_dci0_earliest_arrival, { "HI_DCI0 Earliest Arrival", "nfapi.timing.info.hi.dci0.earliest.arrival", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pcfich_power_offset, { "PCFICH Power Offset", "nfapi.pcfich.power.offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_window, { "NFAPI Timing window", "nfapi.timing.window", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_mode, { "Timing Info mode", "nfapi.timing.info.mode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_info_period, { "Timing info period", "nfapi.timing.info.period", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_max_transmit_power, { "Max transmit power", "nfapi.max.transmit.power", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_uint8_tag, { "uint8 tag", "nfapi.uint8.tag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_uint16_tag, { "uint16 tag", "nfapi.uint16.tag", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_mode, { "Mode", "nfapi.harq.mode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_ack_nack,	{ "Number of ACK/NACK", "nfapi.uint16.tag",	FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_data_value_0,	{ "Value 0", "nfapi.harq.value.0",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_data_value_1,	{ "Value 1", "nfapi.harq.value.1",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_data_value_2,	{ "Value 2", "nfapi.harq.value.2",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_data_value_3,	{ "Value 3", "nfapi.harq.value.3",	FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_tb_1, { "HARQ TB1", "nfapi.harq.tb.", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_tb_2, { "HARQ TB2", "nfapi.harq.tb.2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_tb_n, { "HARQ TB_N", "nfapi.harq.tb.n", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_cqi, { "UL_CQI", "nfapi.ul.cqi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_channel, { "Channel", "nfapi.channel", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_data_offset, { "Data Offset", "nfapi.data.offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },		
+-		{ &hf_nfapi_ri, { "RI", "nfapi.ri", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_ack_nack_data, { "HARQ Ack/Nack Data", "nfapi.harq.ack.nack.data", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_harq_data, { "HARQ TB Data", "nfapi.harq.tb.data", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_cc, { "CC", "nfapi.cc", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rbs, { "RBs", "nfapi.rbs", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_antennas, { "Physical Antennas", "nfapi.physical.antennas", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_advance, { "Timing Advance", "nfapi.timing.advance", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timing_advance_r9, { "Timing Advance R9", "nfapi.timing.advance.r9", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_cc_reported, { "Number of CC reported", "nfapi.number.of.cc.reported", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_preamble, { "Preamble", "nfapi.preamble", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rach_resource_type, { "RACH resource type", "nfapi.rach.resource.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_doppler_estimation, { "Doppler estimation", "nfapi.doppler.estimation", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rb_start, { "RB Start", "nfapi.rb.start", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_snr, { "SNR", "nfapi.snr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_up_pts_symbol, { "UpPTS Symbol", "nfapi.uppts.symbol", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_prb_per_subband, { "numPRBperSubband", "nfapi.num.prb.per.subband", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_antennas, { "numAntennas", "nfapi.num.antennas", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_subband_index, { "subbandIndex", "nfapi.subband.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_channel_coefficient, { "Channel", "nfapi.channel.coefficient", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_ul_rtoa, { "UL_RTOA", "nfapi.ul.rtoa", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_frequency_band_indicator, { "Frequency Band Indicator", "nfapi.frequency.band.indicator", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_measurement_period, { "Measurement Period", "nfapi.measurement.period", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_bandwidth, { "Bandwidth", "nfapi.bandwidth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_timeout, { "Timeout", "nfapi.timeout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_earfcns, { "Number of EARFCNs", "nfapi.number.of.earfcns", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_earfcn_list, { "EARFCN List", "nfapi.earfcn.list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_uarfcn, { "UARFCN", "nfapi.uarfcn", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_uarfcns, { "Number of UARFCNs", "nfapi.number.of.uarfcn", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_uarfcn_list, { "UARFCN List", "nfapi.uarfcn.list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_arfcn, { "ARFCN", "nfapi.arfcn", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_arfcn_direction, { "Direction", "nfapi.arfcn.direction", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_arfcns, { "Number of ARFCNs", "nfapi.number.of.arfcn", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_arfcn_list, { "ARFCN List", "nfapi.arfcn.list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rssi, { "RSSI", "nfapi.rssi", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_rssi, { "Number of RSSI", "nfapi.number.of.rssi", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rssi_list, { "RSSI List", "nfapi.rssi.list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pci, { "PCI", "nfapi.pci", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_measurement_bandwidth, { "Measurement Bandwidth", "nfapi.measurement.bandwidth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_exhaustive_search, { "Exhaustive Search", "nfapi.exhaustive.search", FT_UINT8, BASE_DEC, VALS(exhustive_search_vals), 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_pci, { "Number of PCI", "nfapi.number.of.pci", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pci_list, { "PCI List", "nfapi.pci.list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_psc, { "PSC", "nfapi.psc", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_psc, { "Number of PSC", "nfapi.number.of.psc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_psc_list, { "PCS List", "nfapi.psc.list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rsrp, { "RSRP", "nfapi.rsrp", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rsrq, { "RSRQ", "nfapi.rsrq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_lte_cells_found, { "Number of LTE Cells Found", "nfapi.number.of.lte.cells.found", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_lte_cells_found_list, { "LTE Cells Found List", "nfapi.lte.cells.found.list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rscp, { "RSCP", "nfapi.rscp", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_enco, { "EcNo", "nfapi.ecno", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_utran_cells_found, { "Number of UTRAN Cells Found", "nfapi.number.of.utran.cells.found", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_utran_cells_found_list, { "UTRAN Cells Found List", "nfapi.utran.cells.found.list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_bsic, { "BSIC", "nfapi.bsic", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rxlev, { "RxLev", "nfapi.rxlev", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_rxqual, { "RxQual", "nfapi.rxqual", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_sfn_offset, { "SFN Offset", "nfapi.sfn.offset", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_geran_cells_found, { "Number of GSM Cells Found", "nfapi.number.of.geran.cells.found", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_geran_cells_found_list, { "GERAN Cells Found List", "nfapi.geran.cells.found.list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_tx_antenna, { "Number of Tx Antenna", "nfapi.number.of.tx.antenna", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mib_length, { "MIB Length", "nfapi.mib.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_mib, { "MIB", "nfapi.mib", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_phich_configuration, { "PHICH Configuration", "nfapi.phich.configuration", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_retry_count, { "retryCount", "nfapi.retry.count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_sib1, { "SIB1", "nfapi.sib1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_si_periodicity, { "SI Periodicity", "nfapi.si.periodicity", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_si_index, { "SI Index", "nfapi.si.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_number_of_si_periodicity, { "Number of SI Periodicity", "nfapi.number.of.si.periodicity", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_si_periodicity_list, { "SI Periodicity List", "nfapi.si.periodicity.list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_si_window_length, { "SI Window Length", "nfapi.si.window.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_sib_type, { "SIB Type", "nfapi.sib.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_sib_len, { "SIB Length", "nfapi.sib.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_sib, { "SIB", "nfapi.sib", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_si_len, { "SI Length", "nfapi.si.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_si, { "SI", "nfapi.si", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_search_state, { "State", "nfapi.state", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-		{ &hf_nfapi_pnf_broadcast_state, { "State", "nfapi.state", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+-
+-	};
+-
+-    /* Setup protocol subtree array */
+-    static gint *ett[] = {
+-        &ett_nfapi_message_tree,
+-		&ett_nfapi_p4_p5_message_header,
+-		&ett_nfapi_p7_message_header,
+-		&ett_nfapi_tlv_tree,
+-		&ett_nfapi_tl,
+-		&ett_nfapi_pnf_param_response,
+-		&ett_nfapi_pnf_phy_rf_config,
+-		&ett_nfapi_pnf_phy_rf_config_instance,
+-		&ett_nfapi_pnf_phy,
+-		&ett_nfapi_pnf_phy_rel10,
+-		&ett_nfapi_pnf_phy_rel11,
+-		&ett_nfapi_pnf_phy_rel12,
+-		&ett_nfapi_pnf_phy_rel13,
+-		&ett_nfapi_pnf_rf,
+-		&ett_nfapi_phy_state,
+-		&ett_nfapi_rf_bands,
+-		&ett_nfapi_bf_vectors,
+-		&ett_nfapi_csi_rs_bf_vector,
+-		&ett_nfapi_csi_rs_resource_configs,
+-		&ett_nfapi_tx_antenna_ports,
+-		&ett_nfapi_harq_ack_nack_data,
+-		&ett_nfapi_harq_data,
+-		&ett_nfapi_cc,
+-		&ett_nfapi_rbs,
+-		&ett_nfapi_antennas,
+-		&ett_nfapi_epdcch_prbs,
+-		&ett_nfapi_dl_config_request_body,
+-		&ett_nfapi_dl_config_request_pdu_list,
+-		&ett_nfapi_ul_config_request_pdu_list,
+-		&ett_nfapi_hi_dci0_request_pdu_list,
+-		&ett_nfapi_tx_request_pdu_list,
+-		&ett_nfapi_rx_indication_pdu_list,
+-		&ett_nfapi_harq_indication_pdu_list,
+-		&ett_nfapi_crc_indication_pdu_list,
+-		&ett_nfapi_sr_indication_pdu_list,
+-		&ett_nfapi_cqi_indication_pdu_list,
+-		&ett_nfapi_preamble_indication_pdu_list,
+-		&ett_nfapi_srs_indication_pdu_list,
+-		&ett_nfapi_lbt_dl_config_pdu_list,
+-		&ett_nfapi_lbt_dl_indication_pdu_list,
+-		&ett_nfapi_dl_config_request_dlsch_pdu_rel8,
+-		&ett_nfapi_dl_config_request_dlsch_pdu_rel9,
+-		&ett_nfapi_dl_config_request_dlsch_pdu_rel10,
+-		&ett_nfapi_dl_config_bch_pdu_rel8,
+-		&ett_nfapi_dl_config_mch_pdu_rel8,
+-		&ett_nfapi_dl_config_pch_pdu_rel8,
+-		&ett_nfapi_dl_config_dci_dl_pdu_rel8,
+-		&ett_nfapi_dl_config_dci_dl_pdu_rel9,
+-		&ett_nfapi_dl_config_dci_dl_pdu_rel10,
+-		&ett_nfapi_dl_config_prs_pdu_rel9,
+-		&ett_nfapi_dl_config_csi_rs_pdu_rel10,
+-		&ett_nfapi_subbands,
+-		&ett_nfapi_precoding,
+-		&ett_nfapi_bf_vector_antennas,
+-		&ett_nfapi_ul_config_request_body,
+-		&ett_nfapi_ul_config_harq_buffer_pdu,
+-		&ett_nfapi_ul_config_ue_information_rel8,
+-		&ett_nfapi_ul_config_sr_information_pdu_rel8,
+-		&ett_nfapi_ul_config_ulsch_pdu_rel8,
+-		&ett_nfapi_ul_config_ulsch_pdu_rel10,
+-		&ett_nfapi_ul_config_cqi_ri_information_rel8,
+-		&ett_nfapi_ul_config_cqi_ri_information_rel9,
+-		&ett_nfapi_ul_config_ulsch_harq_information_rel10,
+-		&ett_nfapi_ul_config_initial_transmission_parameters_rel8,
+-		&ett_nfapi_ul_config_cqi_information_rel8,
+-		&ett_nfapi_ul_config_cqi_information_rel10,
+-		&ett_nfapi_ul_config_sr_information_rel8,
+-		&ett_nfapi_ul_config_sr_information_rel10,
+-		&ett_nfapi_ul_config_harq_information_rel10_tdd,
+-		&ett_nfapi_ul_config_harq_information_rel8_fdd,
+-		&ett_nfapi_ul_config_harq_information_rel9_fdd,
+-		&ett_nfapi_ul_config_srs_pdu_rel8,
+-		&ett_nfapi_ul_config_srs_pdu_rel10,
+-		&ett_nfapi_crc_indication_body,
+-
+-		&ett_nfapi_earfcn_list,
+-		&ett_nfapi_uarfcn_list,
+-		&ett_nfapi_arfcn_list,
+-		&ett_nfapi_rssi_list,
+-		&ett_nfapi_pci_list,
+-		&ett_nfapi_psc_list,
+-		&ett_nfapi_lte_cells_found_list,
+-		&ett_nfapi_utran_cells_found_list,
+-		&ett_nfapi_geran_cells_found_list,
+-		&ett_nfapi_si_periodicity_list,
+-
+-		/* for fragmentation support*/
+-		&ett_msg_fragment,
+-		&ett_msg_fragments
+-    };
+-
+-    static ei_register_info ei[] = 
+-	{
+-		{ &ei_power_invalid, { "nfapi.power.invalid", PI_PROTOCOL, PI_ERROR, "Tx Power range invalid [0 - 10000]", EXPFILL } },
+-		{ &ei_ref_sig_power_invalid, { "nfapi.ref_sig_power.invalid", PI_PROTOCOL, PI_ERROR, "Ref Sig Power range invalid [0 - 255]", EXPFILL }},
+-		{ &ei_invalid_range, { "nfapi.invalid.range", PI_PROTOCOL, PI_ERROR, "Out of valid range. Todo create more specific error", EXPFILL } },
+-    };
+-	
+-
+-
+-    expert_module_t* expert_nfapi;
+-
+-	/* Register protocol */
+-	proto_nfapi = proto_register_protocol("Nfapi", "NFAPI", "nfapi");
+-
+-    expert_nfapi = expert_register_protocol(proto_nfapi);
+-
+-    expert_register_field_array(expert_nfapi, ei, array_length(ei));
+-
+-    proto_register_field_array(proto_nfapi, hf, array_length(hf));
+-    proto_register_subtree_array(ett, array_length(ett));
+-	
+-	reassembly_table_register(&ul_p7_reassemble_table, &addresses_ports_reassembly_table_functions);
+-	reassembly_table_register(&dl_p7_reassemble_table, &addresses_ports_reassembly_table_functions);
+-
+-	register_dissector("nfapi", dissect_nfapi, proto_nfapi);
+-
+-}
+-
+-// ----------------------------------------------------------------------------|
+-
+-void proto_reg_handoff_nfapi(void)
+-{
+-	static dissector_handle_t nfapi_handle;
+-
+-	nfapi_handle = create_dissector_handle(dissect_nfapi, proto_nfapi);
+-
+-	dissector_add_for_decode_as("sctp.port", nfapi_handle);
+-
+-	dissector_add_uint("udp.port", 41700, nfapi_handle);
+-
+-}
++
++		default:
++		{
++			if (msg_id >= 0x112 && msg_id <= 0x017f)
++			{
++				// reserved P5 message
++			}
++			else if (msg_id >= 0x183 && msg_id <= 0x01ff)
++			{
++				// reserved P7 message
++			}
++			else if (msg_id >= 0x0200 && msg_id <= 0x02ff)
++			{
++				// reserved P4 message
++			}
++			else if (msg_id >= 0x0300 && msg_id <= 0x03ff)
++			{
++				// reserved vendor extentions
++			}
++
++			break;
++		}
++	};
++
++	ptvcursor_pop_subtree(ptvc);
++	ptvcursor_free(ptvc);
++
++	return tvb_captured_length(tvb);
++}
++
++static void nfapi_tag_vals_fn(gchar* s, guint32 v)
++{
++	const tlv_t* tlv = look_up_tlv(v);
++	if (tlv != 0)
++	{
++		g_snprintf(s, ITEM_LABEL_LENGTH, "%s (0x%x)", tlv->name, v);
++	}
++	else
++	{
++		g_snprintf(s, ITEM_LABEL_LENGTH, "%s (0x%x)", "Unknown", v);
++	}
++}
++static void neg_pow_conversion_fn(gchar* s, guint8 v)
++{
++	g_snprintf(s, ITEM_LABEL_LENGTH, "%d dB (%d)", ((gint16)v * (-1)), v);
++}
++static void power_offset_conversion_fn(gchar* s, guint16 v)
++{
++	g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (((float)v * 0.001) - 6.0), v);
++}
++static void reference_signal_power_conversion_fn(gchar* s, guint16 v)
++{
++	g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (((float)v * 0.25) - 63.75), v);
++}
++static void laa_threshold_conversion_fn(gchar* s, guint16 v)
++{
++	g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (float)(v * -100.00), v);
++}
++static void max_transmit_power_2_conversion_fn(gchar* s, guint16 v)
++{
++	g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1) - 10.0, v);
++}
++static void max_transmit_power_conversion_fn(gchar* s, guint16 v)
++{
++	g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1), v);
++}
++static void sfn_sf_conversion_fn(gchar* s, guint16 v)
++{
++	g_snprintf(s, ITEM_LABEL_LENGTH, "%d/%d (%d)", v >> 0x4, v & 0x000F, v);
++}
++static void rssi_conversion_fn(gchar* s, guint16 v)
++{
++	g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1), v);
++}
++static void dl_rs_tx_pow_measment_conversion_fn(gchar* s, guint16 v)
++{
++	g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1), v);
++}
++
++static void ul_cqi_conversion_fn(gchar* s, guint16 v)
++{
++	g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (((float)v / 2 ) - 64.0), v);
++}
++
++// ----------------------------------------------------------------------------|
++
++void proto_register_nfapi(void)
++{
++	static hf_register_info hf[] =
++	{
++		{ &hf_msg_fragments,
++			{ "Message fragments", "nfapi.fragments",
++			FT_NONE, BASE_NONE, NULL, 0x00,
++			NULL, HFILL }
++		},
++		{ &hf_msg_fragment,
++			{ "Message fragment", "nfapi.fragment",
++			FT_FRAMENUM, BASE_NONE, NULL, 0x00,
++			NULL, HFILL }
++		},
++		{ &hf_msg_fragment_overlap,
++			{ "Message fragment overlap", "nfapi.fragment.overlap",
++			FT_BOOLEAN, 0, NULL, 0x00,
++			NULL, HFILL }
++		},
++		{ &hf_msg_fragment_overlap_conflicts,
++			{ "Message fragment overlapping with conflicting data", "nfapi.fragment.overlap.conflicts",
++			FT_BOOLEAN, 0, NULL, 0x00,
++			NULL, HFILL }
++		},
++		{ &hf_msg_fragment_multiple_tails,
++			{ "Message has multiple tail fragments", "nfapi.fragment.multiple_tails",
++			FT_BOOLEAN, 0, NULL, 0x00,
++			NULL, HFILL }
++		},
++		{ &hf_msg_fragment_too_long_fragment,
++			{ "Message fragment too long", "nfapi.fragment.too_long_fragment",
++			FT_BOOLEAN, 0, NULL, 0x00,
++			NULL, HFILL }
++		},
++		{ &hf_msg_fragment_error,
++			{ "Message defragmentation error", "nfapi.fragment.error",
++			FT_FRAMENUM, BASE_NONE, NULL, 0x00,
++			NULL, HFILL }
++		},
++		{ &hf_msg_fragment_count,
++			{ "Message fragment count", "nfapi.fragment.count",
++			FT_UINT32, BASE_DEC, NULL, 0x00,
++			NULL, HFILL }
++		},
++		{ &hf_msg_reassembled_in,
++			{ "Reassembled in", "nfapi.reassembled.in",
++			FT_FRAMENUM, BASE_NONE, NULL, 0x00,
++			NULL, HFILL }
++		},
++		{ &hf_msg_reassembled_length,
++			{ "Reassembled length", "nfapi.reassembled.length",
++			FT_UINT32, BASE_DEC, NULL, 0x00,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_p4_p5_message_header_phy_id,
++			{ "PHY ID", "nfapi.p4_p5_message_header.phy_id",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Within the PNF Device, the unique identity of the PHY instance as assigned through the PNF_CONFIG.request", HFILL }
++		},
++		{ &hf_nfapi_p4_p5_message_header_message_id,
++			{ "Message ID", "nfapi.p4_p5_message_header.message_id",
++			FT_UINT16, BASE_HEX_DEC, VALS(message_id_vals), 0x0,
++			"The nFAPI message identity", HFILL }
++		},
++		{ &hf_nfapi_p4_p5_message_header_message_length,
++			{ "Message Length", "nfapi.p4_p5_message_header.message_length",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The length in bytes of the message including the header", HFILL }
++		},
++		{ &hf_nfapi_p4_p5_message_header_spare,
++			{ "Spare", "nfapi.p4_p5_message_header.spare",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Reserved field to be populated with zeros on transmission and ignored on reception", HFILL }
++		},
++		{ &hf_nfapi_p7_message_header_phy_id,
++			{ "Phy ID", "nfapi.p7_message_header.phy_id",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Within the PNF Device, the unique identity of the PHY instance as assigned through the PNF_CONFIG.request", HFILL }
++		},
++		{ &hf_nfapi_p7_message_header_message_id,
++			{ "Message ID", "nfapi.p7.message_header.message_id",
++			FT_UINT16, BASE_HEX_DEC, VALS(message_id_vals), 0x0,
++			"The nFAPI message identity", HFILL }
++		},
++		{ &hf_nfapi_p7_message_header_message_length,
++			{ "Message Length", "nfapi.p7_message_header.message_length",
++			FT_UINT16, BASE_DEC | BASE_UNIT_STRING, &units_byte_bytes, 0x0,
++			"The length in bytes of the message segment including the header", HFILL }
++		},
++		{ &hf_nfapi_p7_message_header_m,
++			{ "M", "nfapi.p7_message_header.m_segment_sequence",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"A More flag indicating there are more segments to follow to complete the entire message", HFILL }
++		},
++		{ &hf_nfapi_p7_message_header_segment,
++			{ "Segment Number", "nfapi.p7_message_header.m_segment_sequence",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The segment number starting at zero and incrementing by one between each segment", HFILL }
++		},
++		{ &hf_nfapi_p7_message_header_sequence_number,
++			{ "Sequence Number", "nfapi.p7_message_header.m_segment_sequence",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The incrementing sequence number for all complete messages over the P7 nFAPI interface per PHY instance", HFILL }
++		},
++		{ &hf_nfapi_p7_message_header_checksum,
++			{ "Checksum", "nfapi.p7_message_header.checksum",
++			FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
++			"The checksum of the whole message segment (including header) as calculated using "
++			"the CRC32c algorithm following the same method as the SCTP protocol defined in IETF RFC 4960 "
++			"The Checksum is optional to populate and must be filled with zero's when not used", HFILL }
++		},
++		{ &hf_nfapi_p7_message_header_transmit_timestamp,
++			{ "Transmit Timestamp", "nfapi.p7_message_header.timestamp",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"The offset from VNF SFN/SF 0/0 time reference of the message transmission at the transport layer, in microseconds, with a range of 0 to 10239999", HFILL }
++		},
++		{ &hf_nfapi_tl_tag,
++			{ "TLV Tag", "nfapi.tl_tag",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(nfapi_tag_vals_fn), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_tl_length,
++			{ "TLV Length", "nfapi.tl_length",
++			FT_UINT16, BASE_DEC | BASE_UNIT_STRING, &units_byte_bytes, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_error_code,
++			{ "Error Code", "nfapi.error.code",
++			FT_UINT8, BASE_DEC, VALS(nfapi_error_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_p4_error_code,
++			{ "Error Code", "nfapi.p4_error.code",
++			FT_UINT8, BASE_DEC, VALS(nfapi_p4_error_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_rat_type,
++			{ "RAT Type", "nfapi.rat_type",
++			FT_UINT8, BASE_DEC, VALS(nfapi_rat_type_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_num_tlv,
++			{ "Number of TLV", "nfapi.param.response.num_tlv",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_phy_state,
++			{ "Phy state value", "nfapi.phy.state",
++			FT_UINT16, BASE_DEC, VALS(nfapi_phy_state_vals), 0x0,
++			"Indicates the current operational state of the PHY", HFILL }
++		},
++		{ &hf_nfapi_dl_ue_per_sf,
++			{ "Downlink UEs per Subframe", "nfapi.dl.ue.per.sf",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The maximum number of downlink UEs per subframe supported."
++			"This is the maximum number of downlink UEs that can be scheduled per "
++			"subframe, non-inclusive of broadcast, paging and common channels.", HFILL }
++		},
++		{ &hf_nfapi_ul_ue_per_sf,
++			{ "Uplink UEs per Subframe", "nfapi.ul.ue.per.sf",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The maximum number of uplink UEs per subframe supported."
++			"This is the maximum number of uplink UEs that can be scheduled per "
++			"subframe, non-inclusive of common channels.", HFILL }
++		},
++		{ &hf_nfapi_duplex_mode,
++			{ "Duplex Mode", "nfapi.duplex.mode",
++			FT_UINT16, BASE_DEC, VALS(nfapi_duplex_mode_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_bandwidth_support,
++			{ "Downlink bandwidth support", "nfapi.dl.bandwidth.support",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The PHY downlink channel bandwidth capability (in resource blocks)", HFILL }
++		},
++		{ &hf_nfapi_dl_bandwidth_support_6,
++			{ "6Mhz", "nfapi.dl.bandwidth.support.6",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_bandwidth_support_15,
++			{ "15Mhz", "nfapi.dl.bandwidth.support.15",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_bandwidth_support_25,
++			{ "25Mhz", "nfapi.dl.bandwidth.support.25",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_bandwidth_support_50,
++			{ "50Mhz", "nfapi.dl.bandwidth.support.50",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_bandwidth_support_75,
++			{ "75Mhz", "nfapi.dl.bandwidth.support.75",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_bandwidth_support_100,
++			{ "100Mhz", "nfapi.dl.bandwidth.support.100",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_bandwidth_support,
++			{ "Uplink bandwidth support", "nfapi.ul.bandwidth.support",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The PHY uplink channel bandwidth capability (in resource blocks)", HFILL }
++		},
++		{ &hf_nfapi_ul_bandwidth_support_6,
++			{ "6Mhz", "nfapi.ul.bandwidth.support.6",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_bandwidth_support_15,
++			{ "15Mhz", "nfapi.ul.bandwidth.support.15",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_bandwidth_support_25,
++			{ "25Mhz", "nfapi.ul.bandwidth.support.25",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_bandwidth_support_50,
++			{ "50Mhz", "nfapi.ul.bandwidth.support.50",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_bandwidth_support_75,
++			{ "75Mhz", "nfapi.ul.bandwidth.support.75",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_bandwidth_support_100,
++			{ "100Mhz", "nfapi.ul.bandwidth.support.100",
++			FT_BOOLEAN, 1, TFS(&tfs_supported_not_supported), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_modulation_support,
++			{ "Downlink modulation support", "nfapi.dl.modulation.support",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The PHY downlink modulation capability", HFILL }
++		},
++		{ &hf_nfapi_dl_modulation_support_qpsk,
++			{ "QPSK", "nfapi.dl.modulation.support.qpsk",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_modulation_support_16qam,
++			{ "16QAM", "nfapi.dl.modulation.support.16qam",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_modulation_support_64qam,
++			{ "64QAM", "nfapi.dl.modulation.support.64qam",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_modulation_support_256qam,
++			{ "256QAM", "nfapi.dl.modulation.support.256qam",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_modulation_support,
++			{ "Uplink modulation support", "nfapi.ul.modulation.support",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The PHY uplink modulation capability", HFILL }
++		},
++		{ &hf_nfapi_ul_modulation_support_qpsk,
++			{ "QPSK", "nfapi.ul.modulation.support.qpsk",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_modulation_support_16qam,
++			{ "16QAM", "nfapi.ul.modulation.support.16qam",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_modulation_support_64qam,
++			{ "64QAM", "nfapi.ul.modulation.support.64qam",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_phy_antenna_capability,
++			{ "Phy Antenna capability", "nfapi.phy.antenna.capability",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of antennas supported", HFILL }
++		},
++		{ &hf_nfapi_release_capability,
++			{ "Release capability", "nfapi.release.capability",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates which release the PHY supports", HFILL }
++		},
++		{ &hf_nfapi_mbsfn_capability,
++			{ "MBSFN capability", "nfapi.mbsfn.capability",
++			FT_BOOLEAN, 8, TFS(&support_strname), 0x0,
++			"Indicates support for MBSFN features", HFILL }
++		},
++		{ &hf_nfapi_laa_capability,
++			{ "LAA Support", "nfapi.laa.support",
++			FT_BOOLEAN, 8, TFS(&support_strname), 0x0,
++			"Indicates support for LAA features", HFILL }
++		},
++		{ &hf_nfapi_pd_sensing_lbt_support,
++			{ "PD sensing LBT support", "nfapi.pd.sensing.lbt.support",
++			FT_BOOLEAN, 8, TFS(&support_strname), 0x0,
++			"Indicates support for PD sensing in L1", HFILL }
++		},
++		{ &hf_nfapi_multi_carrier_lbt_support,
++			{ "Multi carrier LBT support", "nfapi.multi.carrier.lbt.support",
++			FT_UINT16, BASE_DEC, VALS(nfapi_mutli_carrier_lbt_support_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_partial_sf_support,
++			{ "Partial SF support", "nfapi.partial.sf.support",
++			FT_BOOLEAN, 8, TFS(&partial_sf_support_strname), 0x0,
++			"Indicates support for Partial SF in L1", HFILL }
++		},
++		{ &hf_nfapi_reference_signal_power,
++			{ "Reference signal power", "nfapi.ref_sig_power",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(reference_signal_power_conversion_fn), 0x0,
++			"Normalized value levels (relative) to accommodate different absolute Tx Power used by eNb", HFILL }
++		},
++		{ &hf_nfapi_primary_synchronization_signal_epre_eprers,
++			{ "Primary synchronization signal EPRE/EPRERS", "nfapi.primary.sync.signal",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(power_offset_conversion_fn), 0x0,
++			"The power of synchronization signal with respect to the reference signal, (PSS for LTE cell, NPSS for NB-IOT cell)", HFILL }
++		},
++		{ &hf_nfapi_secondary_synchronization_signal_epre_eprers,
++			{ "Secondary synchronization signal EPRE/EPRERS", "nfapi.secondary.sync.signal",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(power_offset_conversion_fn), 0x0,
++			"The power of synchronization signal with respect to the reference signal, (SSS for LTE cell, NSSS for NB-IOT cell)", HFILL }
++		},
++		{ &hf_nfapi_physical_cell_id,
++			{ "Physical Cell ID", "nfapi.physical.cell.id",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The Cell ID sent with the synchronization signal", HFILL }
++		},
++		{ &hf_nfapi_phich_resource,
++			{ "PHICH Resource", "nfapi.phich.resource",
++			FT_UINT16, BASE_DEC, VALS(nfapi_phich_resource_vals), 0x0,
++			"The number of resource element groups used for PHICH", HFILL }
++		},
++		{ &hf_nfapi_phich_duration,
++			{ "PHICH Duration", "nfapi.phich.duration",
++			FT_BOOLEAN, 8, TFS(&phich_duration_strname), 0x0,
++			"The PHICH duration for MBSFN and non-MBSFN sub-frames", HFILL }
++		},
++		{ &hf_nfapi_phich_power_offset,
++			{ "PHICH Power Offset", "nfapi.phich.power.offset",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(power_offset_conversion_fn), 0x0,
++			"The power per antenna of the PHICH with respect to the reference signal", HFILL }
++		},
++		{ &hf_nfapi_configuration_index,
++			{ "Configuration Index", "nfapi.configuration.index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Provides information about the location and format of the PRACH.", HFILL }
++		},
++		{ &hf_nfapi_root_sequence_index,
++			{ "Root sequence Index", "nfapi.root.sequence.index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"PRACH Root sequence index", HFILL }
++		},
++		{ &hf_nfapi_zero_correlation_zone_configuration,
++			{ "Zero correlation zone configuration", "nfapi.zero.correlation.zone.configuration",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Equivalent to Ncs", HFILL }
++		},
++		{ &hf_nfapi_high_speed_flag,
++			{ "High Speed Flag", "nfapi.high.speed.flag",
++			FT_BOOLEAN, 8, TFS(&high_speed_flag_strname), 0x0,
++			"Indicates if unrestricted, or restricted, set of preambles is used", HFILL }
++		},
++		{ &hf_nfapi_frequency_offset,
++			{ "Frequency offset", "nfapi.frequency.offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The first physical resource block available for PRACH", HFILL }
++		},
++		{ &hf_nfapi_hopping_mode,
++			{ "Hopping Mode", "nfapi.hopping.mode",
++			FT_BOOLEAN, 8, TFS(&hopping_mode_strname), 0x0,
++			"If hopping is enabled indicates the type of hopping used", HFILL }
++		},
++		{ &hf_nfapi_hopping_offset,
++			{ "Hopping offset", "nfapi.hopping.offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The offset used if hopping is enabled", HFILL }
++		},
++		{ &hf_nfapi_delta_pucch_shift,
++			{ "Delta PUCCH Shift", "nfapi.delta.pucch.shift",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The cyclic shift difference", HFILL }
++		},
++		{ &hf_nfapi_n_cqi_rb,
++			{ "N CQI RB", "nfapi.n.cqi.rb",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The bandwidth, in units of resource blocks, that is available for use by PUCCH formats 2/2a/2b transmission in each slot", HFILL }
++		},
++		{ &hf_nfapi_n_an_cs,
++			{ "N AN CS", "nfapi.n.an.cs",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of cyclic shifts used for PUCCH formats 1/1a/1b in a resource block with a mix of formats 1/a/1/ab and 2/2a/2b.", HFILL }
++		},
++		{ &hf_nfapi_n1_pucch_an,
++			{ "N1 PUCCH AN", "nfapi.n1.pucch.an",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"N1 PUCCH", HFILL }
++		},
++		{ &hf_nfapi_bandwidth_configuration,
++			{ "Bandwidth configuration", "nfapi.bw.configuration",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The available SRS bandwidth of the cell", HFILL }
++		},
++		{ &hf_nfapi_srs_subframe_configuration,
++			{ "SRS subframe configuration", "nfapi.srs.subframe.configuration",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The subframe configuration. Needed if semi-static configuration is held in PHY", HFILL }
++		},
++		{ &hf_nfapi_uplink_rs_hopping,
++			{ "Uplink RS hopping", "nfapi.uplink.rs.hopping",
++			FT_UINT16, BASE_DEC, VALS(nfapi_uplink_rs_hopping_vals), 0x0,
++			"Indicates the type of hopping to use", HFILL }
++		},
++		{ &hf_nfapi_group_assignment,
++			{ "Group assignment", "nfapi.group.assignment",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The sequence shift pattern used if group hopping is enabled", HFILL }
++		},
++		{ &hf_nfapi_cyclic_shift_1_for_drms,
++			{ "Cyclic Shift 1 for DRMS", "nfapi.cyclic.shift.1.for.drms",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Specifies the cyclic shift for the reference signal used in the cell.", HFILL }
++		},
++		{ &hf_nfapi_subframe_assignment,
++			{ "Subframe_assignment", "nfapi.subframe.assignment",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"For TDD mode only, indicates the DL/UL subframe structure", HFILL }
++		},
++		{ &hf_nfapi_special_subframe_patterns,
++			{ "Special Subframe patterns", "nfapi.special.subframe.patterns",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"For TDD mode only. Length of fields DwPTS, GP and UpPTS", HFILL }
++		},
++		{ &hf_nfapi_ed_threshold_for_lbt_for_pdsch,
++			{ "ED Threshold for LBT for PDSCH", "nfapi.ed.threshold.for.lbt.pdsch",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(laa_threshold_conversion_fn), 0x0,
++			"Indicates the energy detection threshold in dBm for LBT for PDSCH", HFILL }
++		},
++		{ &hf_nfapi_ed_threshold_for_lbt_for_drs,
++			{ "ED Threshold for LBT for DRS", "nfapi.ed.threshold.for.lbt.for.drs",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(laa_threshold_conversion_fn), 0x0,
++			"Indicates the energy detection threshold in dBm for LBT for DRS", HFILL }
++		},
++		{ &hf_nfapi_pd_threshold,
++			{ "PD Threshold", "nfapi.pd.threshold",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(laa_threshold_conversion_fn), 0x0,
++			"Indicates the preamble detection threshold in dBm, if the L1 capabilities support PD", HFILL }
++		},
++		{ &hf_nfapi_multi_carrier_type,
++			{ "Multi carrier type", "nfapi.multi.carrier.type",
++			FT_UINT16, BASE_DEC, VALS(nfapi_laa_carrier_type_vals), 0x0,
++			"Indicates multi carrier type configuration of L1 (according to L1 capabilities and L2 scheduler requirements", HFILL }
++		},
++		{ &hf_nfapi_multi_carrier_tx,
++			{ "Multi carrier TX", "nfapi.multi.carrier.tx",
++			FT_BOOLEAN, 8, TFS(&nfapi_multi_carrier_tx_strname), 0x0,
++			"Indicates multi carrier transmission configuration of L1 (according to type if supporting multi carrier)", HFILL }
++		},
++		{ &hf_nfapi_multi_carrier_freeze,
++			{ "Multi carrier freeze", "nfapi.multi.carrier.freeze",
++			FT_BOOLEAN, 8, TFS(&nfapi_multi_carrier_freeze_strname), 0x0,
++			"Indicates multi carrier freeze, configuration of L1 (applicable only to type A type if supporting multi carrier)", HFILL }
++		},
++		{ &hf_nfapi_tx_antenna_ports_for_drs,
++			{ "Tx antenna ports for DRS", "nfapi.tx.antenna.ports.for.drs",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of cell specific transmit antenna ports within the DRS occasions", HFILL }
++		},
++		{ &hf_nfapi_transmission_power_for_drs,
++			{ "Transmission power for DRS", "nfapi.transmission.power.for.drs.",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(power_offset_conversion_fn), 0x0,
++			"Offset of cell specific Reference signals power within DRS occasions to the reference signal power", HFILL }
++		},
++		{ &hf_nfapi_pbch_repetitions_enabled_r13,
++			{ "PBCH Repetitions enable R13", "nfapi.pbch.repetitions.enabled_r13",
++			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0,
++			"Enable / Disable PBCH repetitions", HFILL }
++		},
++		{ &hf_nfapi_prach_cat_m_root_sequence_index,
++			{ "PRACH CAT-M Root sequence index", "nfapi.prach.cat_m.root.squence.index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"PRACH Root sequence index", HFILL }
++		},
++		{ &hf_nfapi_prach_cat_m_zero_correlation_zone_configuration,
++			{ "PRACH CAT-M Zero correlation zone configuration", "nfapi.prach.cat_m.zero.correlation.zone.configuration",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Equivalent to Ncs", HFILL }
++		},
++		{ &hf_nfapi_prach_cat_m_high_speed_flag,
++			{ "PRACH CAT-M High speed flag", "nfapi.prach.cat_m.high.speed.flag",
++			FT_BOOLEAN, 8, TFS(&high_speed_flag_strname), 0x0,
++			"Indicates if unrestricted, or restricted, set of preambles is used", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_0_enable,
++			{ "PRACH CE level #0 Enable", "nfapi.prach.ce.level.0.enable",
++			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0,
++			"Enable \\ Disable CE level #0.", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_0_configuration_index,
++			{ "PRACH CE level #0 Configuration index", "nfapi.prach.ce.level.0.configuration.index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Provides information about the location and format of the PRACH", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_0_frequency_offset,
++			{ "PRACH CE level #0 Frequency offset", "nfapi.prach.ce.level.0.frequency_offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The first physical resource block available for PRACH for each CE", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_0_number_of_repetitions_per_attempt,
++			{ "PRACH CE level #0 Number of repetitions per attempt", "nfapi.prach.ce.level.0.number.of.repetitions.per_attempt",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of PRACH repetitions per attempt for each CE level", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_0_starting_subframe_periodicity,
++			{ "CE level #0 Starting subframe periodicity", "nfapi.prach.ce.level.0.starting.subframe_periodicity",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Optional. PRACH starting subframe periodicity, expressed in number of slots available for preamble transmission(PRACH opportunities)", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_0_hopping_enabled,
++			{ "PRACH CE level #0 Hopping Enable", "nfapi.prach.ce.level.0.hopping_enable",
++			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0,
++			"Enable \\ Disable PRACH frequency hopping for each CE level", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_0_hopping_offset,
++			{ "PRACH CE level #0 Hopping Offset", "nfapi.prach.ce.level.0.hopping.offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Valid in case 'PRACH Hopping Enable' is enabled", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_1_enable,
++			{ "PRACH CE level #1 Enable", "nfapi.prach.ce.level.0.enable",
++			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0,
++			"Enable \\ Disable CE level #1", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_1_configuration_index,
++			{ "PRACH CE level #1 Configuration index", "nfapi.prach.ce.level.1.configuration.index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Provides information about the location and format of the PRACH", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_1_frequency_offset,
++			{ "PRACH CE level #1 Frequency offset", "nfapi.prach.ce.level.1.frequency_offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The first physical resource block available for PRACH for each CE", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_1_number_of_repetitions_per_attempt,
++			{ "PRACH CE level #1 Number of repetitions per attempt", "nfapi.prach.ce.level.1.number.of.repetitions.per_attempt",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of PRACH repetitions per attempt for each CE level", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_1_starting_subframe_periodicity,
++			{ "CE level #1 Starting subframe periodicity", "nfapi.prach.ce.level.1.starting.subframe_periodicity",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Optional.PRACH starting subframe periodicity, expressed in number of slots available for preamble transmission(PRACH opportunities),", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_1_hopping_enabled,
++			{ "PRACH CE level #1 Hopping Enable", "nfapi.prach.ce.level.1.hopping_enable",
++			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0,
++			"Enable \\ Disable PRACH frequency hopping for each CE level.", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_1_hopping_offset,
++			{ "PRACH CE level #1 Hopping Offset", "nfapi.prach.ce.level.1.hopping.offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Valid in case 'PRACH Hopping Enable' is enabled.", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_2_enable,
++			{ "PRACH CE level #2 Enable", "nfapi.prach.ce.level.2.enable",
++			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0,
++			"Enable \\ Disable CE level #2", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_2_configuration_index,
++			{ "PRACH CE level #2 Configuration index", "nfapi.prach.ce.level.2.configuration.index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Provides information about the location and format of the PRACH", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_2_frequency_offset,
++			{ "PRACH CE level #2 Frequency offset", "nfapi.prach.ce.level.2.frequency_offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The first physical resource block available for PRACH for each CE", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_2_number_of_repetitions_per_attempt,
++			{ "PRACH CE level #2 Number of repetitions per attempt", "nfapi.prach.ce.level.2.number.of.repetitions.per_attempt",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of PRACH repetitions per attempt for each CE level", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_2_starting_subframe_periodicity,
++			{ "CE level #2 Starting subframe periodicity", "nfapi.prach.ce.level.2.starting.subframe_periodicity",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Optional. PRACH starting subframe periodicity, expressed in number of slots available for preamble transmission(PRACH opportunities)", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_2_hopping_enabled,
++			{ "PRACH CE level #2 Hopping Enable", "nfapi.prach.ce.level.2.hopping_enable",
++			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0,
++			"Enable \\ Disable PRACH frequency hopping for each CE level", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_2_hopping_offset,
++			{ "PRACH CE level #2 Hopping Offset", "nfapi.prach.ce.level.2.hopping.offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Valid in case 'PRACH Hopping Enable' is enabled.", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_3_enable,
++			{ "PRACH CE level #3 Enable", "nfapi.prach.ce.level.3.enable",
++			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0,
++			"Enable \\ Disable CE level #3.", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_3_configuration_index,
++			{ "PRACH CE level #3 Configuration index", "nfapi.prach.ce.level.3.configuration.index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Provides information about the location and format of the PRACH.", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_3_frequency_offset,
++			{ "PRACH CE level #3 Frequency offset", "nfapi.prach.ce.level.3.frequency_offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The first physical resource block available for PRACH for each CE", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_3_number_of_repetitions_per_attempt,
++			{ "PRACH CE level #3 Number of repetitions per attempt", "nfapi.prach.ce.level.3.number.of.repetitions.per_attempt",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of PRACH repetitions per attempt for each CE level", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_3_starting_subframe_periodicity,
++			{ "CE level #3 Starting subframe periodicity", "nfapi.prach.ce.level.3.starting.subframe_periodicity",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Optional. PRACH starting subframe periodicity, expressed in number of slots available for preamble transmission(PRACH opportunities)", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_3_hopping_enabled,
++			{ "PRACH CE level #3 Hopping Enable", "nfapi.prach.ce.level.3.hopping_enable",
++			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0,
++			"Enable \\ Disable PRACH frequency hopping for each CE level.", HFILL }
++		},
++		{ &hf_nfapi_prach_ce_level_3_hopping_offset,
++			{ "PRACH CE level #3 Hopping Offset", "nfapi.prach.ce.level.3.hopping.offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Valid in case 'PRACH Hopping Enable' is enabled.", HFILL }
++		},
++		{ &hf_nfapi_pucch_internal_ul_hopping_config_common_mode_a,
++			{ "PUCCH Interval-ULHoppingConfigCommonModeA", "nfapi.pucch.interval.ulhopping.config.common.mode.a",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"NthULNB for UEModeA", HFILL }
++		},
++		{ &hf_nfapi_pucch_internal_ul_hopping_config_common_mode_b,
++			{ "PUCCH Interval-ULHoppingConfigCommonModeB", "nfapi.pucch.interval.ulhopping.config.common.mode.b",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"NthULNB for UEModeB", HFILL }
++		},
++		{ &hf_nfapi_data_report_mode,
++			{ "Data Report Mode", "nfapi.data.report.mode",
++			FT_BOOLEAN, 8, TFS(&data_report_mode_vals), 0x0,
++			"The data report mode for the uplink data", HFILL }
++		},
++		{ &hf_nfapi_sfnsf,
++			{ "SFN/SF", "nfapi.sfn.sf",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(sfn_sf_conversion_fn), 0x0,
++			"The future SFN/SF subframe where the TLVs included in the message should be applied", HFILL }
++		},
++		{ &hf_nfapi_max_up_pts,
++			{ "Max UpPTS frames", "nfapi.max.uppts.frame",
++			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0,
++			"Used for TDD only and indicates how SRS operates in UpPTS subframes", HFILL }
++		},
++		{ &hf_nfapi_srs_acknack_srs_simultaneous_transmission,
++			{ "SRS AckNack Simultaneous transmission", "nfapi.srs.acknack.simult.tx",
++			FT_BOOLEAN, 8, TFS(&srs_simult_tx_strname), 0x0,
++			"Indicates if SRS and ACK/NACK can be received in the same subframe. Needed if semi-static configuration is held in PHY.", HFILL }
++		},
++		{ &hf_nfapi_pnf_address_ipv4,
++			{ "PNF IPV4", "nfapi.pnf.address.ipv4",
++			FT_IPv4, BASE_NONE, NULL, 0x0,
++			"The IPv4 address of the PNF PHY instance to be used by the VNF for this PNF PHY instance", HFILL }
++		},
++		{ &hf_nfapi_pnf_address_ipv6,
++			{ "PNF IPV6", "nfapi.pnf.address.ipv6",
++			FT_IPv6, BASE_NONE, NULL, 0x0,
++			"The IPv6 address of the PNF PHY instance to be used by the VNF for this PNF PHY instance", HFILL }
++		},
++		{ &hf_nfapi_vnf_address_ipv4,
++			{ "VNF IPV4 Address", "nfapi.vnf.address.ipv4",
++			FT_IPv4, BASE_NONE, NULL, 0x0,
++			"The IPv4 address of the VNF to be used by the PNF for this P7 PHY instance", HFILL }
++		},
++		{ &hf_nfapi_vnf_address_ipv6,
++			{ "VNF IPV6 Address", "nfapi.vnf.address.ipv6",
++			FT_IPv6, BASE_NONE, NULL, 0x0,
++			"The IPv6 address of the VNF to be used by the PNF for this P7 PHY instance", HFILL }
++		},
++		{ &hf_nfapi_pnf_port,
++			{ "PNF PORT value", "nfapi.config.pnf.port.value",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The port of the PNF PHY instance to be used by the VNF for this PNF PHY instance", HFILL }
++		},
++		{ &hf_nfapi_vnf_port,
++			{ "VNF PORT value", "nfapi.config.vnf.port.value",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The port of the VNF to be used by the PNF for this P7 PHY instance", HFILL } },
++		{ &hf_nfapi_sync_mode,
++			{ "Sync Mode", "nfapi.sync.mode",
++			FT_UINT8, BASE_DEC, VALS(nfapi_sync_mode_vals), 0x0,
++			"The method of nFAPI Synchronization supported by the PNF", HFILL }
++		},
++		{ &hf_nfapi_location_mode,
++			{ "Location Mode", "nfapi.location.mode",
++			FT_UINT8, BASE_DEC, VALS(location_mode_vals), 0x0,
++			"The method of location derivation supported by the PNF", HFILL }
++		},
++		{ &hf_nfapi_location_coordinates_length,
++			{ "Location Coordinates Length", "nfapi.location.coordinates.length",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Length in bytes of the Location Coordinates Array field", HFILL }
++		},
++		{ &hf_nfapi_location_coordinates,
++			{ "Location Coordinates", "nfapi.location.coordinates",
++			FT_BYTES, BASE_NONE, NULL, 0x0,
++			"The Location of the PNF. The value is formatted as the LocationCoordinates IE using BASIC-PER encoding as defined in "
++			"TS36.355 section 6.4.2. The first bit of the LocationCoordinates IE is in the LSB of the first byte of the array."
++			"The MSBs of the last element of the array may be padded with zeros if the ASN.1 element is not an integer number of bytes", HFILL }
++		},
++		{ &hf_nfapi_pdu,
++			{ "PDU", "nfapi.pdu",
++			FT_BYTES, BASE_NONE, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_config_timing,
++			{ "DL config Timing", "nfapi.dl.config.timing",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"The timing offset before the air interface subframe start that the DL_Config.request must be received at the PNF.", HFILL }
++		},
++		{ &hf_nfapi_tx_timing,
++			{ "Tx Timing", "nfapi.general.tx.timing",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"The timing offset before the air interface subframe start that the TX.request must be received at the PNF.", HFILL }
++		},
++		{ &hf_nfapi_ul_config_timing,
++			{ "UL Config Timing", "nfapi.ul.config.timing",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"The timing offset before the air interface subframe start that the UL_CONFIG.request must be received at the PNF.", HFILL }
++		},
++		{ &hf_nfapi_hi_dci0_timing,
++			{ "HI DCi0 Timing", "nfapi.hi.dci0.timing",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"The timing offset before the air interface subframe start that the HI_DCI0.request must be received at the PNF.", HFILL }
++		},
++		{ &hf_nfapi_maximum_number_phys,
++			{ "Maximum number of Phys", "nfapi.maximum.number.phys",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The maximum number of operational PHYs supported by the PNF device.", HFILL }
++		},
++		{ &hf_nfapi_maximum_total_bandwidth,
++			{ "Maximum Total Bandwidth", "nfapi.maximum.total.bandwidth",
++			FT_UINT16, BASE_DEC | BASE_UNIT_STRING, &khz_100_units_db, 0x0,
++			"The total maximum bandwidth (in units of 100kHz) supported by the PNF device.", HFILL }
++		},
++		{ &hf_nfapi_maximum_total_number_dl_layers,
++			{ "Maximum Total Number DL Layers", "nfapi.maximum.total.number.dl.layers",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The maximum total number of downlink layers supported.", HFILL }
++		},
++		{ &hf_nfapi_maximum_total_number_ul_layers,
++			{ "Maximum Total Number UL Layers", "nfapi.maximum.total.number.ul.layers",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The maximum total number of uplink layers supported across all available PHYs.", HFILL }
++		},
++		{ &hf_nfapi_shared_bands,
++			{ "Shared bands", "nfapi.shared.bands",
++			FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x0,
++			"Indication that the PNF device shares the list of RF band options available across all available PHYs, so each may only be used with a single PHY.", HFILL }
++		},
++		{ &hf_nfapi_shared_pa,
++			{ "Shared pa", "nfapi.shared.pa",
++			FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x0,
++			"Indication that the PNF device shares a single RF PA across all available PHYs, so that the maximum Total Power is shared across all available PHYs.", HFILL }
++		},
++		{ &hf_nfapi_maximum_total_power,
++			{ "Maximum total power", "nfapi.maximum.total.power",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(dl_rs_tx_pow_measment_conversion_fn), 0x0,
++			"The maximum transmit power of the PNF device summed across all PHYs.", HFILL }
++		},
++		{ &hf_nfapi_oui,
++			{ "OUI", "nfapi.oui",
++			FT_STRING, BASE_NONE, NULL, 0x0,
++			"The PNF OUI in the format as specified by IEEE", HFILL }
++		},
++		{ &hf_nfapi_pnf_phy_number_phy,
++			{ "PNF Phy Number of Phy", "nfapi.pnf.phy.number.phy",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of PHY instances", HFILL }
++		},
++		{ &hf_nfapi_pnf_phy_config_index,
++			{ "PNF Phy Config Index", "nfapi.pnf.phy.config.index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The unique index number of the PHY to permit the PNF to identify the PHY in the PNF_CONFIG.Request", HFILL }
++		},
++		{ &hf_nfapi_number_of_rfs,
++			{ "Number of RFs", "nfapi.pnf.rf.number.rf",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of RF configurations", HFILL }
++		},
++		{ &hf_nfapi_phy_rf_config_info_phy_id,
++			{ "Phy ID", "nfapi.pnf.phy.rf.config.phy.id",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_rf_config_index,
++			{ "RF Config Index", "nfapi.rf_config_index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The index number defined in the PNF RF struct that the PHY can support",
++			HFILL }
++		},
++		{ &hf_nfapi_number_of_rf_exclusions,
++			{ "Number of RF exclusions", "nfapi.hf_nfapi_number_of_rf_exclusions",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of RF configurations excluded from use by this PHY", HFILL }
++		},
++		{ &hf_nfapi_maximum_3gpp_release_supported,
++			{ "Maximum 3gpp Release Supported", "nfapi.maximum_3gpp_release_supported",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The major 3GPP releases supported", HFILL }
++		},
++		{ &hf_nfapi_maximum_3gpp_release_supported_rel8,
++			{ "Release 8", "nfapi.maximum_3gpp_release_supported.rel8",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_maximum_3gpp_release_supported_rel9,
++			{ "Release 9", "nfapi.maximum_3gpp_release_supported.rel9",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_maximum_3gpp_release_supported_rel10,
++			{ "Release 10", "nfapi.maximum_3gpp_release_supported.rel10",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_maximum_3gpp_release_supported_rel11,
++			{ "Release 11", "nfapi.maximum_3gpp_release_supported.rel11",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_maximum_3gpp_release_supported_rel12,
++			{ "Release 12", "nfapi.maximum_3gpp_release_supported.rel12",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_maximum_3gpp_release_supported_rel13,
++			{ "Release 13", "nfapi.maximum_3gpp_release_supported.rel13",
++			FT_BOOLEAN, 1, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_downlink_channel_bandwidth_supported,
++			{ "Maximum Channel Downlink Bandwidth Supported", "nfapi.downlink_channel_bandwidth_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The downlink channel bandwidth supported in resource blocks as specified in 3GPP TS 36.104", HFILL }
++		},
++		{ &hf_nfapi_uplink_channel_bandwidth_supported,
++			{ "Maximum Channel Uplink Bandwidth Supported", "nfapi.uplink_channel_bandwidth_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The uplink channel bandwidth supported in resource blocks as specified in 3GPP TS 36.104.", HFILL }
++		},
++		{ &hf_nfapi_number_of_dl_layers_supported,
++			{ "Number of DL Layers Supported", "nfapi.number_of_dl_layer_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The maximum number of downlink layers supported", HFILL }
++		},
++		{ &hf_nfapi_number_of_ul_layers_supported,
++			{ "Number of UL Layers Supported", "nfapi.number_of_ul_layer_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The maximum number of uplink layers supported", HFILL }
++		},
++		{ &hf_nfapi_nmm_modes_supported,
++			{ "NMM modes supported", "nfapi.nmm_modes_supported",
++			FT_UINT8, BASE_DEC, VALS(nmm_modes_supported_vals), 0x0,
++			"Network Monitor Modes Supported.", HFILL }
++		},
++		{ &hf_nfapi_band,
++			{ "Band", "nfapi.band",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Band number as specified in 3GPP TS36.101", HFILL }
++		},
++		{ &hf_nfapi_maximum_transmit_power_2,
++			{ "Maximum transmit power", "nfapi.maximum_transmit_power",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(max_transmit_power_2_conversion_fn), 0x0,
++			"The maximum transmit power for the PHY and RF operating at the configured bandwidth as defined in 3GPP TS 36.104.", HFILL }
++		},
++		{ &hf_nfapi_maximum_transmit_power,
++			{ "Maximum transmit power", "nfapi.maximum_transmit_power",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(max_transmit_power_conversion_fn), 0x0,
++			"The maximum transmit power for the RF chain operating at the maximum supported bandwidth as defined in 3GPP TS 36.104.", HFILL }
++		},
++		{ &hf_nfapi_earfcn,
++			{ "EARFCN", "nfapi.earfcn",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The EARFCN to be measured.", HFILL }
++		},
++		{ &hf_nfapi_number_of_rf_bands,
++			{ "Number of RF Bands", "nfapi.num.rf_bands",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of RF Band instances", HFILL }
++		},
++		{ &hf_nfapi_nmm_uplink_rssi_supported,
++			{ "NMM Uplink RSSI supported", "nfapi.nmm.uplink.rssi.supported",
++			FT_UINT8, BASE_DEC, VALS(ul_rssi_supported_vals), 0x0,
++			"Indicates if the uplink RSSI meausremnts are supported by NMM.", HFILL }
++		},
++		{ &hf_nfapi_minimum_transmit_power,
++			{ "Minimum transmit power", "nfapi.minimum_transmit_power",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(max_transmit_power_conversion_fn), 0x0,
++			"The minimum transmit power for the RF chain operating at the maximum supported bandwidth as defined in 3GPP TS 36.104.", HFILL }
++		},
++		{ &hf_nfapi_number_of_antennas_suppported,
++			{ "Number of Supported Antennas", "nfapi.number_of_antennas_suppported",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The maximum number of antennas supported.", HFILL }
++		},
++		{ &hf_nfapi_minimum_downlink_frequency,
++			{ "Minimum downlink frequency", "nfapi.minimum_downlink_frequency",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &khz_100_units_db, 0x0,
++			"The minimum supported downlink frequency in 100kHz units", HFILL }
++		},
++		{ &hf_nfapi_maximum_downlink_frequency,
++			{ "Maximum downlink frequency", "nfapi.maximum_downlink_frequency",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &khz_100_units_db, 0x0,
++			"The maximum supported downlink frequency in 100kHz units", HFILL }
++		},
++		{ &hf_nfapi_minimum_uplink_frequency,
++			{ "Minimum uplink frequency", "nfapi.minimum_downlink_frequency",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &khz_100_units_db, 0x0,
++			"The minimum supported uplink frequency in 100kHz units", HFILL }
++		},
++		{ &hf_nfapi_maximum_uplink_frequency,
++			{ "Maximum uplink frequency", "nfapi.maximum_downlink_frequency",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &khz_100_units_db, 0x0,
++			"The maximum supported uplink frequency in 100kHz units", HFILL }
++		},
++		{ &hf_nfapi_transmission_mode7_supported,
++			{ "Transmission Mode 7 Supported", "nfapi.pnf.phy_rel10.tx_mode7_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports TM7 for PDSCH", HFILL }
++		},
++		{ &hi_nfapi_transmission_mode8_supported,
++			{ "Transmission Mode 8 Supported", "nfapi.pnf.phy_rel10.tx_mode8_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports TM8 for PDSCH", HFILL }
++		},
++		{ &hi_nfapi_two_antennas_ports_for_pucch,
++			{ "Two antennas ports for PUCCH", "nfapi.pnf.phy_rel10.two_antennas_ports_for_pucch",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports PUCCH transmit diversity introduced in Release 10. Equivalent to two-AntennaPortsForPUCCH-r10 in TS36.306", HFILL }
++		},
++		{ &hi_nfapi_transmission_mode_9_supported,
++			{ "Transmission Mode 9 Supported", "nfapi.pnf.phy_rel10.tx_mode9_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports TM9 for PDSCH with 8 antennas and 8 CSI. Equivalent to tm9-With-8Tx-FDD-r10 in TS36.306", HFILL }
++		},
++		{ &hi_nfapi_simultaneous_pucch_pusch,
++			{ "Simultaneous PUCCH PUSCH", "nfapi.pnf.simultaneous_pucch_pusch",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports UE sending simultaneous PUCCH and PUSCH introduced in Release 10. Equivalent to simultaneousPUCCH-PUSCH-r10 in TS36.306", HFILL }
++		},
++		{ &hi_nfapi_four_layer_tx_with_tm3_and_tm4,
++			{ "Four layer Tx with TM3 and TM4", "nfapi.pnf.phy_rel10.layer_tx_with_tm3_and_tm4",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports four layer transmission for TM3 and TM4. Equivalent to fourLayerTM3-TM4-r10 in TS36.306", HFILL }
++		},
++		{ &hf_nfapi_epdcch_supported,
++			{ "ePDCCH supported", "nfapi.pnf.phy_rel11.epdcch_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports Enhanced PDCCH", HFILL }
++		},
++		{ &hi_nfapi_multi_ack_csi_reporting,
++			{ "Multi ACK CSI reporting", "nfapi.pnf.phy_rel11.mutli_ack_csi_reporting",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports the multi ACK and CSI reporting required with CA and mixed FDD/TDD carriers. Equivalent to multiACK-CSI-Reporting-r11 in TS36.306", HFILL }
++		},
++		{ &hi_nfapi_pucch_tx_diversity_with_channel_selection,
++			{ "PUCCH Tx diversity with channel selection", "nfapi.pnf.phy_rel11.tx_div_with_channel_selection",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports transmit diversity for PUCCH format 1b with channel selection. Equivalent to txDiv-PUCCH1b-ChSelect in TS36.306", HFILL }
++		},
++		{ &hi_nfapi_ul_comp_supported,
++			{ "UL CoMP supported", "nfapi.pnf.phy_rel11.ul_comp_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports UL CoMP", HFILL }
++		},
++		{ &hi_nfapi_transmission_mode_5_supported,
++			{ "Transmission mode 5 supported", "nfapi.pnf.phy_rel11.tx_mode5_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports TM5 for PDSCH", HFILL }
++		},
++		{ &hf_nfapi_csi_subframe_set,
++			{ "CSI subframe set", "nfapi.pnf.phy_rel12.csi_subframe_set",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Equivalent to csi-SubframeSet-r12 in TS36.306", HFILL }
++		},
++		{ &hi_nfapi_enhanced_4tx_codebook,
++			{ "Enhanced 4TX codebook", "nfapi.pnf.phy_rel12.exhanced_t4x_codebook",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports the enhanced 4TX codebook. Equivalent to enhanced-4TxCodebook-r12 in TS36.306", HFILL }
++		},
++		{ &hi_nfapi_drs_supported,
++			{ "DRS supported", "nfapi.pnf.phy_rel12.drs_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports the Discovery Reference Signal", HFILL }
++		},
++		{ &hi_nfapi_ul_64qam_supported,
++			{ "UL 64QAM supported", "nfapi.pnf.phy_rel12.ul_64qam_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY support 64 QAM in the uplink", HFILL }
++		},
++		{ &hi_nfapi_transmission_mode_10_supported,
++			{ "Transmission mode 10 supported", "nfapi.pnf.phy_rel12.tx_mode10_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports TM10 for PDSCH (DL CoMP)", HFILL }
++		},
++		{ &hi_nfapi_alternative_tbs_indices,
++			{ "Alternative TBS indices", "nfapi.pnf.phy_rel12.alternative_tbs_indices",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports the alternate TBS indices (256 QAM).  Equivalent to alternativeTBS-Indices-r12 in TS36.306", HFILL }
++		},
++		{ &hf_nfapi_pucch_format_4_supported,
++			{ "PUCCH format 4 supported", "nfapi.pnf.phy_rel13.pucch_format4_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports PUCCH format 4", HFILL }
++		},
++		{ &hf_nfapi_pucch_format_5_supported,
++			{ "PUCCH format 5 supported", "nfapi.pnf.phy_rel13.pucch_format5_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports PUCCH format 5", HFILL }
++		},
++		{ &hf_nfapi_more_than_5_ca_supported,
++			{ "More than 5 CA support", "nfapi.pnf.phy_rel13.mode_than_5_ca_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports features required for more than 5 CA support on PUSCH. Equivalent to uci-PUSCH-Ext-r13 in TS36.306", HFILL }
++		},
++		{ &hf_nfapi_laa_supported,
++			{ "LAA supported", "nfapi.pnf.phy_rel13.laa_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports DL LAA (subframe format 3)", HFILL }
++		},
++		{ &hf_nfapi_laa_ending_in_dwpts_supported,
++			{ "LAA ending in DwPTS supported", "nfapi.pnf.phy_rel13.laa_ending_in_dwpts_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports DL LAA ending in a DwPTS subframe. Equivalent to endingDwPTS-r13i n TS36.306", HFILL }
++		},
++		{ &hf_nfapi_laa_starting_in_second_slot_supported,
++			{ "LAA starting in second slot Supported", "nfapi.pnf.phy_rel13.laa_starting_in_second_slot_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports DL LAA starting in the second slot in a subframe. Equivalent to secondSlotStartingPosition-r13 in TS36.306", HFILL }
++		},
++		{ &hf_nfapi_beamforming_supported,
++			{ "Beamforming Supported", "nfapi.pnf.phy_rel13.beamingforming_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports beamforming (FD-MIMO Class B). Equivalent to beamformed-r13 in TS36.306", HFILL }
++		},
++		{ &hf_nfapi_csi_rs_enhancements_supported,
++			{ "CSI-RS enhancements supported", "nfapi.pnf.phy_rel13.csi_rs_enchancements_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports CSI-RS enhancements (FD-MIMO Class A). Equivalent to csi-RS-EnhancementsTDD-r13 in TS36.306", HFILL }
++		},
++		{ &hf_nfapi_drms_enhancements_supported,
++			{ "DMRS enhancements supported", "nfapi.pnf.phy_rel13.drms_enhancements_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports DMRS enhancements added in Release 13. Equivalent to dmrs-Enhancements-r13 in TS36.306", HFILL }
++		},
++		{ &hf_nfapi_srs_enhancements_supported,
++			{ "SRS enhancements supported", "nfapi.pnf.phy_rel13.srs_enhancements_supported",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates if PHY supports SRS enhancements added in Release 13. Equivalent to srs-Enhancements-r13in TS36.306", HFILL }
++		},
++		{ &hf_nfapi_sfn_sf,
++			{ "SFN_SF", "nfapi.sfn_sf",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(sfn_sf_conversion_fn), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_number_pdcch_ofdm_symbols,
++			{ "Number of PDCCH OFDM Symbols", "nfapi.number_pdcch_ofdm_symbols",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of OFDM symbols for the PDCCH", HFILL }
++		},
++		{ &hf_nfapi_number_dci,
++			{ "Number of DCI", "nfapi.number_dci",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of DCI PDUs included in this message", HFILL }
++		},
++		{ &hf_nfapi_number_pdus,
++			{ "Number of PDUs", "nfapi.number_pdu",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of PDUs that are included in this message", HFILL }
++		},
++		{ &hf_nfapi_number_of_harqs,
++			{ "Number of HARQs", "nfapi.number_harqs",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of HARQs included in this message", HFILL }
++		},
++		{ &hf_nfapi_number_of_crcs,
++			{ "Number of CRCs", "nfapi.number_crcs",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of CRCs included in this message", HFILL }
++		},
++		{ &hf_nfapi_number_of_srs,
++			{ "Number of SRs", "nfapi.number_srs",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of SRs included in this message", HFILL }
++		},
++		{ &hf_nfapi_number_of_cqi,
++			{ "Number of CQIs", "nfapi.number_cqi",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of CQIs included in this message", HFILL }
++		},
++		{ &hf_nfapi_number_of_preambles,
++			{ "Number of Preambles", "nfapi.number_preambles",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of RACH preambles", HFILL }
++		},
++		{ &hf_nfapi_number_of_srss,
++			{ "Number of SRSs", "nfapi.number_srss",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Number of UEs contributing to the uplink SRS", HFILL }
++		},
++		{ &hf_nfapi_lbt_dl_req_pdu_type,
++			{ "LBT DL Request PDU Type", "nfapi.number_srss",
++			FT_UINT16, BASE_DEC, VALS(nfapi_lbt_dl_req_pdu_type), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_lbt_dl_ind_pdu_type,
++			{ "LBT DL Indication PDU Type", "nfapi.number_srss",
++			FT_UINT16, BASE_DEC, VALS(nfapi_lbt_dl_ind_pdu_type), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_number_pdsch_rnti,
++			{ "Number of PDSCH RNTI", "nfapi.number_pdsch_rnti",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of unique RNTIs sent on the PDSCH", HFILL }
++		},
++		{ &hf_nfapi_transmission_power_pcfich,
++			{ "Transmission Power PCFICH", "nfapi.transmission_power_pcfich",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(power_offset_conversion_fn), 0x0,
++			"Offset to the reference signal power.", HFILL }
++		},
++		{ &hf_nfapi_dl_config_pdu_type,
++			{ "PDU Type", "nfapi.pdu.type",
++			FT_UINT8, BASE_DEC, VALS(nfapi_dl_config_pdu_type_vals), 0x0,
++			"DL_CONFIG.request PDU Type", HFILL }
++		},
++		{ &hf_nfapi_pdu_size,
++			{ "PDU size", "nfapi.pdu.size",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Size of the PDU control information (in bytes). This length value includes the 2 bytes required for the PDU type and PDU size parameters", HFILL }
++		},
++		{ &hf_nfapi_instance_length,
++			{ "Instance length", "nfapi.instance.length",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The Length in bytes of all TLVs within this instance", HFILL }
++		},
++		{ &hf_nfapi_length,
++			{ "PDU length", "nfapi.pdu.length",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Length of PDU in bytes.", HFILL }
++		},
++		{ &hf_nfapi_pdu_index,
++			{ "PDU Index", "nfapi.pdu.index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The PDU index parameter specified for each PDU", HFILL }
++		},
++		{ &hf_nfapi_rnti,
++			{ "RNTI", "nfapi.rnti",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The RNTI used for identifying the UE when receiving the PDU", HFILL }
++		},
++		{ &hf_nfapi_resource_allocation_type,
++			{ "Resource Allocation Type", "nfapi.resource.allocation.type",
++			FT_UINT8, BASE_DEC, VALS(resource_allocation_type_vals), 0x0,
++			"Resource allocation type/header Valid for DCI formats : 1, 2, 2A, 2B, 2C, 2D", HFILL }
++		},
++		{ &hf_nfapi_virtual_resource_block_assignment_flag,
++			{ "Virtual resource block assignment flag", "nfapi.resource.block.assignment.flag",
++			FT_UINT8, BASE_DEC, VALS(local_distributed_vals), 0x0,
++			"Type of virtual resource block used Valid for DCI formats : 1A, 1B, 1D", HFILL }
++		},
++		{ &hf_nfapi_resource_block_coding,
++			{ "Resource block coding", "nfapi.resource.block.coding",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"The encoding for the resource blocks. The coding is dependent on whether resource allocation type 0, 1, 2 is in use", HFILL }
++		},
++		{ &hf_nfapi_modulation,
++			{ "Modulation", "nfapi.modulation",
++			FT_UINT8, BASE_DEC, VALS(modulation_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_redundancy_version,
++			{ "Redundancy version", "nfapi.redundancy.version",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"HARQ redundancy version", HFILL }
++		},
++		{ &hf_nfapi_transport_blocks,
++			{ "Transport blocks", "nfapi.transport.blocks",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The transport block transmitted to this RNTI", HFILL }
++		},
++		{ &hf_nfapi_transport_block_to_codeword_swap_flag,
++			{ "Transport block to codeword swap flag", "nfapi.transport.block.to.codeword.swap.flag",
++			FT_UINT8, BASE_DEC, VALS(transport_block_to_codeword_swap_flag_vals), 0x0,
++			"Indicates the mapping of transport block to codewords.", HFILL }
++		},
++		{ &hf_nfapi_transmission_scheme,
++			{ "Transmission scheme", "nfapi.transmission.scheme",
++			FT_UINT8, BASE_DEC, VALS(transmission_scheme_vals), 0x0,
++			"The MIMO mode used in the PDU", HFILL }
++		},
++		{ &hf_nfapi_ul_transmission_scheme,
++			{ "Transmission scheme", "nfapi.transmission.scheme",
++			FT_UINT8, BASE_DEC, VALS(ul_transmission_scheme_vals), 0x0,
++			"The MIMO mode used in the PDU", HFILL }
++		},
++		{ &hf_nfapi_number_of_layers,
++			{ "Number of layers", "nfapi.number.of.layers",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of layers used in transmission", HFILL }
++		},
++		{ &hf_nfapi_number_of_subbands,
++			{ "Number of subbands", "nfapi.number.of.subbands",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Only valid when transmission scheme = 3, 4, 5. Defines the number of subbands and "
++			"codebooks used for PMI.If value = 1 then a single PMI value is supplied which should be used over all RB", HFILL }
++		},
++		{ &hf_nfapi_codebook_index,
++			{ "Codebook index", "nfapi.number.of.codebook.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Only valid when transmission scheme = 3, 4, 5. Defines the codebook used.", HFILL }
++		},
++		{ &hf_nfapi_ue_category_capacity,
++			{ "UE category capacity", "nfapi.ue.category.capacity",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The UE capabilities category", HFILL }
++		},
++		{ &hf_nfapi_pa,
++			{ "P-A", "nfapi.pa",
++			FT_UINT8, BASE_DEC, VALS(pa_vals), 0x0,
++			"The ratio of PDSCH EPRE to cell-specific RS EPRE among PDSCH REs in all the OFDM symbols not containing cell-specific RS in dB.", HFILL }
++		},
++		{ &hf_nfapi_delta_power_offset_index,
++			{ "Delta Power offset index", "nfapi.delta.power.offset.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Delta power offset, value: 0..1", HFILL }
++		},
++		{ &hf_nfapi_nprb,
++			{ "Nprb", "nfapi.nprb",
++			FT_UINT8, BASE_DEC, VALS(nprb_vals), 0x0,
++			"Used with DCI format 1A and RNTI=SI-RNTI or RA-RNTI. This should match the value sent in the TPC field of the DCI 1A PDU which allocated this grant.", HFILL }
++		},
++		{ &hf_nfapi_transmission_mode,
++			{ "Transmission Mode", "nfapi.transmission_nprb",
++			FT_UINT8, BASE_DEC, VALS(transmission_mode_vals), 0x0,
++			"Transmission mode associated with the UE", HFILL }
++		},
++		{ &hf_nfapi_prnti,
++			{ "P-RNTI", "nfapi.prnti",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The P-RNTI associated with the paging", HFILL }
++		},
++		{ &hf_nfapi_mcs,
++			{ "MCS", "nfapi.mcs",
++			FT_UINT8, BASE_DEC, VALS(pch_modulation_vals), 0x0,
++			"The modulation and coding scheme for the transport block", HFILL }
++		},
++		{ &hf_nfapi_number_of_transport_blocks,
++			{ "Number of transport blocks", "nfapi.number_of_transport_blocks",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of transport blocks transmitted to this RNTI", HFILL }
++		},
++		{ &hf_nfapi_ue_mode,
++			{ "UE Mode", "nfapi.ue.mode",
++			FT_UINT8, BASE_DEC, VALS(ue_mode_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_prs_bandwidth,
++			{ "PRS bandwidth", "nfapi.prs.bandwidth",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"PRS bandwidth in resource blocks.", HFILL }
++		},
++		{ &hf_prs_cyclic_prefix_type,
++			{ "PRS cyclic prefix type", "nfapi.prs.cyclic.prefix.type",
++			FT_BOOLEAN, 8, TFS(&prs_cyclic_prefix_type_strname), 0x0,
++			"The cyclic prefix used for PRS transmission", HFILL }
++		},
++		{ &hf_prs_muting,
++			{ "PRS muting", "nfapi.prs.muting",
++			FT_BOOLEAN, 8, TFS(&prs_muting_strname), 0x0,
++			"PRS muting dictates if PRS REs are vacant (prsMutingInfo-r9 indicates the SF occasions)", HFILL }
++		},
++		{ &hf_nfapi_num_bf_prb_per_subband,
++			{ "Num of BF PRB per Subband", "nfapi.num.bf.prb.per.subband",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of PRBs that are treated as one subband", HFILL }
++		},
++		{ &hf_nfapi_num_bf_vector,
++			{ "Num of BF Vector", "nfapi.num.bf.vector",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of beam forming vectors. One beam forming vector is specified for each subband", HFILL }
++		},
++		{ &hf_nfapi_csi_rs_resource_config,
++			{ "CSI-RS resource config", "nfapi.csi.rs.resource.config",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates reference signal configuration for CSI-RS", HFILL }
++		},
++		{ &hf_nfapi_bf_vector_subband_index,
++			{ "BF Subband Index", "nfapi.num.bf.vector.subband.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Index of subband for which the following beam forming vector is applied", HFILL }
++		},
++		{ &hf_nfapi_bf_vector_num_antennas,
++			{ "BF Num of Antennas", "nfapi.num.bf.vector.bf.value",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of physical antennas", HFILL }
++		},
++		{ &hf_nfapi_bf_vector_bf_value,
++			{ "BF Value per Antenna", "nfapi.num.bf.vector.bf.value",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Beam forming vector element for physical antenna #i real 8 bits followed by imaginary 8 bits", HFILL }
++		},
++		{ &hf_nfapi_nscid,
++			{ "NSC id", "nfapi.nscid",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Used with DCI format 2B and 2C.", HFILL }
++		},
++		{ &hf_nfapi_csi_rs_flag,
++			{ "CSI RS Flag", "nfapi.csi.rs.flag",
++			FT_BOOLEAN, 8, TFS(&csi_rs_flags_strname), 0x0,
++			"Indicates if parameters related to CSI-RS are valid or not.", HFILL }
++		},
++		{ &hf_nfapi_csi_rs_resource_config_r10,
++			{ "CSI RS resource config R10", "nfapi.csi.rs.resource_config_r10",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"This value is deprecated", HFILL }
++		},
++		{ &hf_nfapi_csi_rs_zero_tx_power_resource_config_bitmap_r10,
++			{ "CSI-RS Number of NZP configuration", "nfapi.csi.rs.num.of.nzp.configurations",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Bitmap of 16 bits. Encoding format of bitmap follows section 6.10.5.2 of 36.211", HFILL }
++		},
++		{ &hf_nfapi_csi_rs_number_of_nzp_configurations,
++			{ "CSI RS zero Tx Power Resource config bitmap R10", "nfapi.csi.rs.zero.tx.power.resource.config.bitmap.r10",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates the number of Non-Zero power CSI-RS configurations.", HFILL }
++		},
++		{ &hf_nfapi_pdsch_start,
++			{ "PDSCH_start", "nfapi.pdsch.start",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Per UE starting OFDM symbol for the PDSCH, impacts the mapping of PDSCH to REs", HFILL }
++		},
++		{ &hf_nfapi_drms_config_flag,
++			{ "DMRS Config flag", "nfapi.drms.config.flag",
++			FT_UINT8, BASE_DEC, VALS(not_used_enabled_vals), 0x0,
++			"Indicates if the DMRS Config parameter is valid", HFILL }
++		},
++		{ &hf_nfapi_drms_scrambling,
++			{ "DMRS Scrambling", "nfapi.drms.scrambling",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The scrambling identity for UE specific reference signals.", HFILL }
++		},
++		{ &hf_nfapi_csi_config_flag,
++			{ "CSI Config flag", "nfapi.csi.config.flag",
++			FT_UINT8, BASE_DEC, VALS(not_used_enabled_vals), 0x0,
++			"Indicates if the CSI Config parameter is valid", HFILL }
++		},
++		{ &hf_nfapi_csi_scrambling,
++			{ "CSI Scrambling", "nfapi.csi.scrambling",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The scrambling identity for CSI.", HFILL }
++		},
++		{ &hf_nfapi_pdsch_re_mapping_flag,
++			{ "PDSCH RE mapping flag", "nfapi.pdsch.remapping.flag",
++			FT_UINT8, BASE_DEC, VALS(not_used_enabled_vals), 0x0,
++			"Indicates if the PDSCH RE parameters are valid.", HFILL }
++		},
++		{ &hf_nfapi_pdsch_re_mapping_antenna_ports,
++			{ "PDSCH RE mapping antenna ports", "nfapi.pdsch.remapping.antenna.ports",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates number of antennas used for PDSCH RE mapping", HFILL }
++		},
++		{ &hf_nfapi_pdsch_re_mapping_freq_shift,
++			{ "PDSCH RE mapping freq shift", "nfapi.pdsch.remapping.freq.shift",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates the frequency shift used for PDSCH RE mapping.", HFILL }
++		},
++		{ &hf_nfapi_alt_cqi_table_r12,
++			{ "altCQI-Table-r12", "nfapi.alt.cqi.table.r12",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"altCQI-Table-r12 is indicative of using an alternative MCS table for UEs supporting 256QAM."
++			"This is taken into account  for calculation of soft buffer size for the transport block", HFILL }
++		},
++		{ &hf_nfapi_max_layers,
++			{ "MaxLayers", "nfapi.max.layers",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Maximal number of negotiated / configured layers for a UE, used for the calculation of soft buffer size for the transport block", HFILL }
++		},
++		{ &hf_nfapi_n_dl_harq,
++			{ "N_DL_HARQ", "nfapi.n.dl.harq",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dwpts_symbols,
++			{ "DwPTS Symbols", "nfapi.dwpts.symbols",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Valid if DCI format 1C is being used to signal LAA end partial SF. Indicates the number of starting symbols according to 36.213 Table  13-A-1", HFILL }
++		},
++		{ &hf_nfapi_initial_lbt_sf,
++			{ "Initial LBT SF", "nfapi.initial.lbt.sf",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates if the DCI PDU is prepared for full SF (regular) or for initial partial SF (2nd slot) according to [11] section 6.2.4 (if PDCCH) or 6.2.4A (if ePDCCH)", HFILL }
++		},
++		{ &hf_nfapi_ue_type,
++			{ "UE Type", "nfapi.ue.type",
++			FT_UINT8, BASE_DEC, VALS(dlsch_re13_ue_type_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_pdsch_payload_type,
++			{ "PDSCH Payload Type", "nfapi.pdsch.payload.type",
++			FT_UINT8, BASE_DEC, VALS(dlsch_re13_pdsch_payload_type_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_initial_transmission_sf,
++			{ "Initial transmission SF (io)", "nfapi.init.tx.sf.io",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Absolute Sub-Frame  of the initial transmission", HFILL }
++		},
++		{ &hf_nfapi_req13_drms_table_flag,
++			{ "Rel-13-DMRS-tabe flag", "nfapi.r13.drms.table.flag",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates if Release 13 DMRS table is used.", HFILL }
++		},
++		{ &hf_nfapi_csi_rs_resource_index,
++			{ "CSI-RS resource index", "nfapi.csi.rs.resource.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Index of the CSI-RS resource. This is included to link bfValues to CSI-RS resources included in Release 10 parameters.", HFILL }
++		},
++		{ &hf_nfapi_csi_rs_class,
++			{ "Class", "nfapi.csi.rs.class",
++			FT_UINT8, BASE_DEC, VALS(csi_rs_class_vals), 0x0,
++			"Indicates CSI-RS class", HFILL }
++		},
++		{ &hf_nfapi_cdm_type,
++			{ "CDM Type", "nfapi.cdm.type",
++			FT_UINT8, BASE_DEC, VALS(csi_rs_cdm_type_vals), 0x0,
++			"Indicates CDM type for CSI-RS. See [36.211] section 6.10.5.2. Valid for Class A", HFILL }
++		},
++		{ &hf_nfapi_edpcch_prb_index,
++			{ "EPDCCH PRB index", "nfapi.edpcch.prb.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"PRB index", HFILL }
++		},
++		{ &hf_nfapi_epdcch_resource_assignment_flag,
++			{ "EPDCCH Resource assignment flag", "nfapi.epdcch.resource.assignment.flag",
++			FT_UINT8, BASE_DEC, VALS(local_distributed_vals), 0x0,
++			"Type of virtual resource block used", HFILL }
++		},
++		{ &hf_nfapi_epdcch_id,
++			{ "EPDCCH ID", "nfapi.epdcch.id",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"EPDCCH index- used for the scrambler initiation The DMRS scrambling sequence initialization parameter defined in[11] section 6.10.3A.1", HFILL }
++		},
++		{ &hf_nfapi_epdcch_start_symbol,
++			{ "EPDCCH Start Symbol", "nfapi.epdcch.start.symbol",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates the OFDM starting symbol for any EPDCCH and PDSCH", HFILL }
++		},
++		{ &hf_nfapi_epdcch_num_prb,
++			{ "EPDCCH NumPRB", "nfapi.epdcch.num.prb",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of PRBs allocated for EPDCCH", HFILL }
++		},
++		{ &hf_nfapi_precoding_value,
++			{ "Precoding value", "nfapi.precoding.value",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Precoding element for physical antenna #i real 8 bits followed by imaginary 8 bits", HFILL }
++		},
++		{ &hf_nfapi_mpdcch_narrowband,
++			{ "MPDCCH Narrowband", "nfapi.mpdcch.narrowband",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Narrowband for MPDCCH", HFILL }
++		},
++		{ &hf_nfapi_number_of_prb_pairs,
++			{ "Number of PRB pairs", "nfapi.number.prb.pairs",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of PRB-pairs constituting the MPDCCH-PRB-pair set", HFILL }
++		},
++		{ &hf_nfapi_resource_block_assignment,
++			{ "Resource Block Assignment", "nfapi.resource.block.assignement",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Combinational index r", HFILL }
++		},
++		{ &hf_nfapi_start_symbol,
++			{ "Start symbol", "nfapi.start.symbol",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ecce_index,
++			{ "ECCE index", "nfapi.ecce.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"CCE index used to send the DCI", HFILL }
++		},
++		{ &hf_nfapi_ce_mode,
++			{ "CE Mode", "nfapi.ce.mode",
++			FT_UINT8, BASE_DEC, VALS(ce_mode_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_drms_scrabmling_init,
++			{ "DMRS scrambling init", "nfapi.drms.scrambling.init",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The DMRS scrambling sequence initialization parameter defined in [11] section 6.10.3A.1", HFILL }
++		},
++		{ &hf_nfapi_pdsch_reception_levels,
++			{ "PDSCH repetition levels", "nfapi.pdsch.repetition.levels",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Valid for DCI formats: 6-0A, 6-0B", HFILL }
++		},
++		{ &hf_nfapi_new_data_indicator,
++			{ "New data indicator", "nfapi.new.data.indicator",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The new data indicator for the transport block", HFILL }
++		},
++		{ &hf_nfapi_tpmi_length,
++			{ "TPMI length", "nfapi.tpmi.length",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Length of 'TPMI' field in units of bits", HFILL }
++		},
++		{ &hf_nfapi_pmi_flag,
++			{ "PMI flag", "nfapi.pmi.flag",
++			FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x0,
++			"Indicates if 'PMI' field is present", HFILL }
++		},
++		{ &hf_nfapi_harq_resource_offset,
++			{ "HARQ resource offset", "nfapi.harq.resource.offset",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"HARQ-ACK resource offset used", HFILL }
++		},
++		{ &hf_nfapi_dci_subframe_repetition_number,
++			{ "DCI subframe repetition number", "nfapi.dci.subframe.repetition.number",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates the number of MPDCCH repetitions", HFILL }
++		},
++		{ &hf_nfapi_downlink_assignment_index_length,
++			{ "Downlink assignment index Length", "nfapi.dl.assignement.index.length",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Length of Downlink assignment index field in units of bits.", HFILL }
++		},
++		{ &hf_nfapi_starting_ce_level,
++			{ "Starting CE Level", "nfapi.starting.ce.level",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"2 bits provide the PRACH starting CE level", HFILL }
++		},
++		{ &hf_nfapi_antenna_ports_and_scrambling_identity_flag,
++			{ "Antenna ports and scrambling identity flag", "nfapi.antenna.ports.and.scrambling.identity.flag",
++			FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x0,
++			"Indicates if 'Antenna ports and scrambling identity' field is present.", HFILL }
++		},
++		{ &hf_nfapi_antenna_ports_and_scrambling_identity,
++			{ "Antenna ports and scrambling identity", "nfapi.antenna.ports.and.scrambling.identit",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates the Antenna port and, scrambling identity value", HFILL }
++		},
++		{ &hf_nfapi_paging_direct_indication_differentiation_flag,
++			{ "Paging/Direct indication differentiation flag", "nfapi.paging.direct.indictation.differentiation.flag",
++			FT_UINT8, BASE_DEC, VALS(paging_direct_indication_differtiation_flag_vals), 0x0,
++			"Valid for DCI format 6-2", HFILL }
++		},
++		{ &hf_nfapi_direct_indication,
++			{ "Direct indication", "nfapi.direct.indication",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Valid for DCI format 6-2", HFILL }
++		},
++		{ &hf_nfapi_number_of_tx_antenna_ports,
++			{ "Number of TX Antenna ports", "nfapi.num.of.tx.antenna.ports.",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of TX physical antenna ports", HFILL }
++		},
++		{ &hf_nfapi_transmission_power,
++			{ "Transmission Power", "nfapi.transmission_power",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(power_offset_conversion_fn), 0x0,
++			"Offset to the reference signal power.", HFILL }
++		},
++		{ &hf_nfapi_mbsfn_area_id,
++			{ "MBSFN Area id", "nfapi.mbsfn.area.id",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates MBSFN area ID", HFILL }
++		},
++		{ &hf_nfapi_dl_dci_format,
++			{ "DL DCI format", "nfapi.dl.dci.format",
++			FT_UINT8, BASE_DEC, VALS(dl_dci_format_vals), 0x0,
++			"Format of the DL DCI", HFILL }
++		},
++		{ &hf_nfapi_ul_dci_format,
++			{ "UL DCI format", "nfapi.ul_dci.format",
++			FT_UINT8, BASE_DEC, VALS(ul_dci_format_vals), 0x0,
++			"Format of the UL DCI", HFILL }
++		},
++		{ &hf_nfapi_mpdcch_ul_dci_format,
++			{ "UL DCI format", "nfapi.mpdcch.ul_dci.format",
++			FT_UINT8, BASE_DEC, VALS(mpdcch_ul_dci_format_vals), 0x0,
++			"Format of the UL DCI", HFILL }
++		},
++		{ &hf_nfapi_cce_idx,
++			{ "CCE index", "nfapi.cce.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"CCE index used to send the DCI", HFILL }
++		},
++		{ &hf_nfapi_aggregation_level,
++			{ "Aggregation level", "nfapi.aggregation.level",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The aggregation level used", HFILL }
++		},
++		{ &hf_nfapi_mcs_1,
++			{ "MCS_1", "nfapi.mcs_1",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The modulation and coding scheme for 1st transport block", HFILL }
++		},
++		{ &hf_nfapi_mcs_2,
++			{ "MCS_2", "nfapi.mcs_2",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The modulation and coding scheme for 2nd transport block", HFILL }
++		},
++		{ &hf_nfapi_redundancy_version_1,
++			{ "Redundancy version_1", "nfapi.redundancy.version.1",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The redundancy version for 1st transport block.", HFILL }
++		},
++		{ &hf_nfapi_redundancy_version_2,
++			{ "Redundancy version_2", "nfapi.redundancy.version.2",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The redundancy version for 2nd transport block", HFILL }
++		},
++		{ &hf_nfapi_new_data_indicator_1,
++			{ "New data indicator_1", "nfapi.new.data.indicator.1",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The new data indicator for 1st transport block.", HFILL }
++		},
++		{ &hf_nfapi_new_data_indicator_2,
++			{ "New data indicator_2", "nfapi.new.data.indicator.2",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The new data indicator for 2nd transport block.", HFILL }
++		},
++		{ &hf_nfapi_harq_process,
++			{ "HARQ process", "nfapi.harq.process",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"HARQ process number", HFILL }
++		},
++		{ &hf_nfapi_tpmi,
++			{ "TPMI", "nfapi.tpmi",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The codebook index to be used for precoding", HFILL }
++		},
++		{ &hf_nfapi_pmi,
++			{ "PMI", "nfapi.pmi",
++			FT_UINT8, BASE_DEC, VALS(pmi_vals), 0x0,
++			"Confirmation for precoding", HFILL }
++		},
++		{ &hf_nfapi_precoding_information,
++			{ "Precoding information", "nfapi.precoding.information",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_tpc,
++			{ "TPC", "nfapi.tpc",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Tx power control command for PUCCH", HFILL }
++		},
++		{ &hf_nfapi_downlink_assignment_index,
++			{ "Downlink assignment index", "nfapi.downlink.assignment.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The downlink assignment index. In release 8-11 this is only used in TDD mode, "
++			"value ignored for FDD. In release 12 or later a field indicating the structure "
++			"type of the primary cell is used to determine if this is valid with size 2 bits."
++			"In release 13 or later a field indicating codebooksizeDetermination - r13 = 0 is "
++			"used to determine is this field is valid with size 4 bits", HFILL }
++		},
++		{ &hf_nfapi_ngap,
++			{ "Ngap", "nfapi.ngap",
++			FT_UINT8, BASE_DEC, VALS(ngap_vals), 0x0,
++			"Used in virtual resource block distribution", HFILL }
++		},
++		{ &hf_nfapi_transport_block_size_index,
++			{ "Transport block size index", "nfapi.transport.block.size.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The transport block size", HFILL }
++		},
++		{ &hf_nfapi_downlink_power_offset,
++			{ "Downlink power offset", "nfapi.downlink.power.offset",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates the DL power offset type for multi-user MIMO transmission", HFILL }
++		},
++		{ &hf_nfapi_allocate_prach_flag,
++			{ "Allocation PRACH flag", "nfapi.allocation.prach.flag",
++			FT_UINT8, BASE_DEC, VALS(true_false_vals), 0x0,
++			"Indicates that PRACH procedure is initiated", HFILL }
++		},
++		{ &hf_nfapi_preamble_index,
++			{ "Preamble index", "nfapi.preamable.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The preamble index to be used on the PRACH", HFILL }
++		},
++		{ &hf_nfapi_prach_mask_index,
++			{ "PRACH mask index", "nfapi.prach.mask.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The mask index to be used on the PRACH", HFILL }
++		},
++		{ &hf_nfapi_rnti_type,
++			{ "RNTI type", "nfapi.rnti.type",
++			FT_UINT8, BASE_DEC, VALS(rnti_type_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_mpdcch_rnti_type,
++			{ "RNTI type", "nfapi.mpdcch.rnti.type",
++			FT_UINT8, BASE_DEC, VALS(mpdcch_rnti_type_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_mcch_flag,
++			{ "MCCH flag", "nfapi.mcch.flag",
++			FT_BOOLEAN, BASE_NONE, TFS(&mcch_flag_string_name), 0x0,
++			"Indicates if format 1C is being used to signal a MCCH or SC-MCCH change notification", HFILL }
++		},
++		{ &hf_nfapi_mcch_change_notification,
++			{ "MCCH change notification", "nfapi.mcch.change.notification",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"MCCH or SC-MCCH Change Notification", HFILL }
++		},
++		{ &hf_nfapi_scrambling_identity,
++			{ "Scrambling identity", "nfapi.scrambling.identity",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates the scrambling identity value NSCID", HFILL }
++		},
++		{ &hf_nfapi_cross_carrier_scheduling_flag,
++			{ "Cross Carrier scheduling flag", "nfapi.cross.carrier.scheduling.flag",
++			FT_BOOLEAN, 8, TFS(&cross_carrier_scheduling_flag_strname), 0x0,
++			"Indicates if cross carrier scheduling has been enabled for the UE receiving this DCI", HFILL }
++		},
++		{ &hf_nfapi_carrier_indicator,
++			{ "Carrier Indicator", "nfapi.carrier.indicator",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Serving Cell Index", HFILL }
++		},
++		{ &hf_nfapi_srs_flag,
++			{ "SRS flag", "nfapi.srs.flag",
++			FT_BOOLEAN, 8, TFS(&srs_flag_strname), 0x0,
++			"Indicates if the SRS request parameter is valid", HFILL }
++		},
++		{ &hf_nfapi_srs_request,
++			{ "SRS request", "nfapi.srs.request",
++			FT_BOOLEAN, 8, TFS(&srs_request_strname), 0x0,
++			"SRS request flag", HFILL }
++		},
++		{ &hf_nfapi_antenna_ports_scrambling_and_layers,
++			{ "Antenna ports scrambling and layers", "nfapi.antenna.ports.scrambling.and.layers",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates the Antenna port, scrambling identity value NSCID and number of layers", HFILL }
++		},
++		{ &hf_nfapi_total_dci_length_including_padding,
++			{ "Total DCI length including padding", "nfapi.total.dci.length.including.padding",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The total DCI length including padding bits", HFILL }
++		},
++		{ &hf_nfapi_n_ul_rb,
++			{ "N_UL_RB", "nfapi.n.dl.rb",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"BW of serving cell for which the DCI was scheduled for.  This is valid for "
++			"the case of cross carrier scheduling, for the case of a self - "
++			"scheduling(cross carrier scheduling is not valid or Carrier indicator has value '0', "
++			"the BW is the 'DL BW support' as configured in configuration phase(params) "
++			"Uplink channel bandwidth in resource blocks", HFILL }
++		},
++		{ &hf_nfapi_harq_ack_resource_offset,
++			{ "HARQ-ACK resource offset", "nfapi.harq.ack.resource.offset",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"HARQ-ACK resource offset field is present only when this format is carried by EPDCCH.", HFILL }
++		},
++		{ &hf_nfapi_pdsch_re_mapping_and_quasi_co_location_indicator,
++			{ "PDSCH RE Mapping and Quasi-Co-Location Indicator", "nfapi.pdsch.re.mapping",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates the parameter set configured by the higher layers which the UE should use.", HFILL }
++		},
++		{ &hf_nfapi_primary_cell_type,
++			{ "Primary cell type", "nfapi.primary.cell.type",
++			FT_UINT8, BASE_DEC, VALS(primary_cells_type_vals), 0x0,
++			"Indicates the type of the primary cell.", HFILL }
++		},
++		{ &hf_nfapi_ul_dl_configuration_flag,
++			{ "UL/DL configuration flag", "nfapi.ul.dl.configuration.flag",
++			FT_BOOLEAN, 8, TFS(&ul_dl_configuration_flag_strname), 0x0,
++			"Indicates if format 1C is being used to signal UL/DL configuration", HFILL }
++		},
++		{ &hf_nfapi_number_of_ul_dl_configurations,
++			{ "Number of UL/DL configurations", "nfapi.number.ul.dl.configurations",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_dl_configuration_index,
++			{ "UL/DL configuration indication", "nfapi.ul.dl.configuration.indication",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"UL/DL configuration index", HFILL }
++		},
++		{ &hf_nfapi_laa_end_partial_sf_flag,
++			{ "LAA end partial SF flag", "nfapi.laa.end.partial.sf.flag",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates if DCI format 1C is being used to signal LAA end partial SF (valid if end partial SF support configuraton is set)", HFILL }
++		},
++		{ &hf_nfapi_laa_end_partial_sf_configuration,
++			{ "LAA end partial SF configuration", "nfapi.laa.end.partial.sf.configuration",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"If DCI format 1C scrambled by CC - RNTI is used to signal end partial SF, this field "
++			"contains LAA common information (4 bits used in [9] Table 13A-1 for configuration of "
++			"occupied OFDM symbols for current and next SF)", HFILL }
++		},
++		{ &hf_nfapi_codebooksize_determination_r13,
++			{ "Codebook Size Determination R13", "nfapi.codebook.size.determination.r13",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates if the downlink assignment index parameter (DAI) is 4 bits", HFILL }
++		},
++		{ &hf_nfapi_rel13_drms_table_flag,
++			{ "Rel-13-DMRS-tabe flag", "nfapi.drms.table.flag.r13",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates if Release 13 DMRS table for be used", HFILL }
++		},
++		{ &hf_nfapi_pscch_resource,
++			{ "PSCCH Resource", "nfapi.pscch.resource",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"6-bits describing the resource blocks for transmitting PSCCH", HFILL }
++		},
++		{ &hf_nfapi_time_resource_pattern,
++			{ "Time resource pattern", "nfapi.time.resource.pattern",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"7-bits describing the time resource pattern index", HFILL }
++		},
++		{ &hf_nfapi_mpdcch_transmission_type,
++			{ "MPDCCH transmission type", "nfapi.mpdcch.transmission.type",
++			FT_UINT8, BASE_DEC, VALS(local_distributed_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_drms_scrambling_init,
++			{ "DMRS scrambling init", "nfapi.drms.scrambling.init",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The DMRS scrambling sequence initialization", HFILL }
++		},
++		{ &hf_nfapi_pusch_repetition_levels,
++			{ "PUSCH repetition levels", "nfapi.pusch.repetition.levels",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Valid for DCI formats: 6-0A, 6-0B", HFILL }
++		},
++		{ &hf_nfapi_frequency_hopping_flag,
++			{ "Frequency hopping flag", "nfapi.frequency.hopping.flag",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates if hopping is being used.", HFILL }
++		},
++		{ &hf_nfapi_csi_request,
++			{ "CSI request", "nfapi.csi.request",
++			FT_UINT8, BASE_DEC, VALS(csi_request_vals), 0x0,
++			"Aperiodic CSI request flag", HFILL }
++		},
++		{ &hf_nfapi_dai_presence_flag,
++			{ "DAI presence flag", "nfapi.dia.presence.flag",
++			FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x0,
++			"Indicates if DL assignment index field is present in the DCI", HFILL }
++		},
++		{ &hf_nfapi_total_dci_length_include_padding,
++			{ "Total DCI length including padding", "nfapi.total.dci.length.including.padding",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The total DCI length including padding bits", HFILL }
++		},
++		{ &hf_nfapi_csi_rs_antenna_port_count_r10,
++			{ "CSI-RS antenna port count r10", "nfapi.csi.rs.antenna.port.count.r10",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates number of antennas used for transmission of CSI reference signal.", HFILL }
++		},
++		{ &hf_nfapi_ul_config_pdu_type,
++			{ "UL Config PDU Type", "nfapi.ul.config.pdu.type",
++			FT_UINT8, BASE_DEC, VALS(nfapi_ul_config_pdu_type_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_rach_prach_frequency_resources,
++			{ "RACH PRACH Frequency resources", "nfapi.rach.prach.frequency.resources",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"If semi-static information is held in the MAC", HFILL }
++		},
++		{ &hf_nfapi_srs_present,
++			{ "SRS present", "nfapi.srs.present",
++			FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x0,
++			"If semi-static information is held in the MAC", HFILL }
++		},
++		{ &hf_nfapi_handle,
++			{ "Handle", "nfapi.handle",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"An opaque handle", HFILL }
++		},
++		{ &hf_nfapi_pucch_index,
++			{ "PUCCH Index", "nfapi.pucch.index",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The PUCCH index value", HFILL }
++		},
++		{ &hf_nfapi_size,
++			{ "Size", "nfapi.size",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The size of the ULSCH PDU in bytes as defined by the relevant UL grant", HFILL }
++		},
++		{ &hf_nfapi_resource_block_start,
++			{ "Resource block start", "nfapi.resource.block.start",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The starting resource block for this ULSCH allocation", HFILL }
++		},
++		{ &hf_nfapi_number_of_resource_blocks,
++			{ "Number of resource blocks", "nfapi.resource.blocks",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of resource blocks allocated to this ULSCH grant", HFILL }
++		},
++		{ &hf_nfapi_cyclic_shift_2_for_drms,
++			{ "Cyclic Shift 2 for DRMS", "nfapi.cyclic.shift.2.for.drms",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The 2nd cyclic shift for DMRS assigned to the UE in the ULSCH grant", HFILL }
++		},
++		{ &hf_nfapi_frequency_hopping_enabled_flag,
++			{ "Frequency hopping enabled flag", "nfapi.frequency.hopping.enabled.flag",
++			FT_UINT8, BASE_DEC, VALS(hopping_vals), 0x0,
++			"Indicates if hopping is being used", HFILL }
++		},
++		{ &hf_nfapi_frequency_hopping_bits,
++			{ "Frequency hopping bits", "nfapi.frequency.hopping.bits",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_new_data_indication,
++			{ "New Data inidication", "nfapi.new.data.indication",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Specify whether this received transport block is a new transmission from UE", HFILL }
++		},
++		{ &hf_nfapi_harq_process_number,
++			{ "HARQ Process number", "nfapi.harq.process.number",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_ul_tx_mode,
++			{ "UL Tx Mode", "nfapi.ul.tx.mode",
++			FT_UINT8, BASE_DEC, VALS(ul_tx_mode_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_current_tx_nb,
++			{ "Current Tx nb", "nfapi.current.tx.nb",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The current HARQ transmission count of this transport block. Valid if frequency hopping enabled.", HFILL }
++		},
++		{ &hf_nfapi_n_srs,
++			{ "N SRS", "nfapi.n.srs",
++			FT_UINT8, BASE_DEC, VALS(n_srs_vals), 0x0,
++			"Indicates if the resource blocks allocated for this grant overlap with the SRS configuration.", HFILL }
++		},
++		{ &hf_nfapi_disable_sequence_hopping_flag,
++			{ "Disable seqeunce hopping flag", "nfapi.disable.sequence.hopping.flag",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates if any configured group hopping should be disabled for this UE.", HFILL }
++		},
++		{ &hf_nfapi_virtual_cell_id_enabled_flag,
++			{ "Virtual cell ID enabled flag", "nfapi.virtual.cell.id.enabled.flag",
++			FT_UINT8, BASE_DEC, VALS(not_used_enabled_vals), 0x0,
++			"Indicates if virtual cell is being used and nPUSCH identity is valid.", HFILL }
++		},
++		{ &hf_nfapi_npusch_identity,
++			{ "nPUSCH Identity", "nfapi.npusch.identity",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Virtual cell ID for initialization of group hopping, sequence hopping and sequence shift pattern of PUSCH DMRS.", HFILL }
++		},
++		{ &hf_nfapi_ndrms_csh_identity,
++			{ "nDMRS-CSH Identity", "nfapi.ndrms.csh.identity",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Virtual cell ID for initialization of cyclic shift hopping of PUSCH DMRS.", HFILL }
++		},
++		{ &hf_nfapi_total_number_of_repetitions,
++			{ "Total Number of repetitions", "nfapi.total.number.of.repetitions",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_repetition_number,
++			{ "Repetition Number", "nfapi.repetition.number",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Current transmission number", HFILL }
++		},
++		{ &hf_nfapi_initial_sf_io,
++			{ "Initial transmission SF (io)", "nfapi.initial.sf.io",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Absolute Sub-Frame  of the initial transmission", HFILL }
++		},
++		{ &hf_nfapi_empty_symbols_due_to_retunning,
++			{ "Empy symbols due to re-tunning", "nfapi.empty.symbols.due.to.retunning",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates the symbols that are left empty due to eMTC retuning.", HFILL }
++		},
++		{ &hf_nfapi_dl_cqi_ri_pmi_size_2,
++			{ "DL CQI/PMI/RI size 2", "nfapi.dl.cqi.ri.pmi.size.2",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The size of the DL CQI/PMI/RI in bits. If the CQI/PMI/RI size exceeds 255 (8-bits) then the Release 9 size value = 0, and this field is used instead.", HFILL }
++		},
++		{ &hf_nfapi_harq_size_2,
++			{ "HARQ Size 2", "nfapi.harq.size2",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The size of the ACK/NACK in bits.", HFILL }
++		},
++		{ &hf_nfapi_delta_offset_harq_2,
++			{ "Delta Offset HARQ 2", "nfapi.delta.offset.harq.2",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Delta offset 2 for HARQ. This value is fixed for a UE, allocated in RRC connection setup and used for ACK_NACK mode = 4 or 5", HFILL }
++		},
++		{ &hf_nfapi_starting_prb,
++			{ "Starting PRB", "nfapi.starting.prb",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The starting PRB for the PUCCH", HFILL }
++		},
++		{ &hf_nfapi_antenna_port,
++			{ "Antenna Port", "nfapi.antenna.port",
++			FT_UINT8, BASE_DEC, VALS(antenna_ports_vals), 0x0,
++			"Defines the number of antenna ports used by the UE for the SRS. This value is fixed for a UE and allocated in RRC connection setup.", HFILL }
++		},
++		{ &hf_nfapi_number_of_combs,
++			{ "Number of Combs", "nfapi.num.of.combs",
++			FT_UINT8, BASE_DEC, VALS(combs_vals), 0x0,
++			"Defines the maximum number of transmission combs (TC).", HFILL }
++		},
++		{ &hf_nfapi_npucch_identity,
++			{ "nPUCCH Identity", "nfapi.npucch.identity",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Virtual cell ID for initialization of base sequence and cyclic shift hopping of PUCCH.", HFILL }
++		},
++		{ &hf_nfapi_empty_symbols,
++			{ "Empty symbols", "nfapi.empty.symbols",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates the symbols that are left empty due to eMTC retuning.", HFILL }
++		},
++		{ &hf_nfapi_csi_mode,
++			{ "CSI_mode", "nfapi.csi.mode",
++			FT_UINT8, BASE_DEC, VALS(csi_mode_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_dl_cqi_pmi_size_2,
++			{ "DL CQI/PMI Size 2", "nfapi.dl.cqi.pmi.size.2",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The size of the DL CQI/PMI in bits", HFILL }
++		},
++		{ &hf_nfapi_statring_prb,
++			{ "Starting PRB", "nfapi.starting.prb",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The starting PRB for the PUCCH", HFILL }
++		},
++		{ &hf_nfapi_cdm_index,
++			{ "cdm_Index", "nfapi.cdm.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Selected CDM option", HFILL }
++		},
++		{ &hf_nfapi_nsrs,
++			{ "N srs", "nfapi.n.srs",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates if the resource blocks allocated for this grant overlap with the SRS configuration.", HFILL }
++		},
++		{ &hf_nfapi_num_ant_ports,
++			{ "Num_ant_ports", "nfapi.num.ant.port",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of antenna ports used by the UE transmit", HFILL }
++		},
++		{ &hf_nfapi_n_pucch_2_0,
++			{ "n_PUCCH_2_0", "nfapi.n.pucch.2.0",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The PUCCH Index value for ACK/NACK HARQ resource 4 on antenna port", HFILL }
++		},
++		{ &hf_nfapi_n_pucch_2_1,
++			{ "n_PUCCH_2_1", "nfapi.n.pucch.2.1",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"HARQ resource 5", HFILL }
++		},
++		{ &hf_nfapi_n_pucch_2_2,
++			{ "n_PUCCH_2_2", "nfapi.n.pucch.2.2",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"HARQ resource 6", HFILL }
++		},
++		{ &hf_nfapi_n_pucch_2_3,
++			{ "n_PUCCH_2_3", "nfapi.n.pucch.2.3",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"HARQ resource 7", HFILL }
++		},
++		{ &hf_nfapi_dl_cqi_pmi_size_rank_1,
++			{ "DL CQI PMI size rank 1", "nfapi.dl.cqi.pmi.size.rank.1",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The size of the DL CQI/PMI in bits in case of rank 1 report.", HFILL }
++		},
++		{ &hf_nfapi_dl_cqi_pmi_size_rank_greater_1,
++			{ "DL CQI PMI size rank greater 1", "nfapi.dl.cqi.pmi.size.rank.1",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The size of the DL CQI/PMI in bits in case of rank>1 report.", HFILL }
++		},
++		{ &hf_nfapi_ri_size,
++			{ "RI size", "nfapi.ri.size",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The size of RI in bits", HFILL }
++		},
++		{ &hf_nfapi_delta_offset_cqi,
++			{ "Delta offset cqi", "nfapi.delta.offset.cqi",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Delta offset for CQI. This value is fixed for a UE and allocated in RRC connection setup.", HFILL }
++		},
++		{ &hf_nfapi_delta_offset_ri,
++			{ "Delta offset ri", "nfapi.delta.offset.ri",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Delta offset for RI. This value is fixed for a UE and allocated in RRC connection setup.", HFILL }
++		},
++		{ &hf_nfapi_harq_size,
++			{ "HARQ size", "nfapi.harq_size",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The size of the ACK/NACK in bits", HFILL }
++		},
++		{ &hf_nfapi_delta_offset_harq,
++			{ "Delta offset HARQ", "nfapi.delta.offset.harq",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Delta offset for HARQ. This value is fixed for a UE and allocated in RRC connection setup.", HFILL }
++		},
++		{ &hf_nfapi_tdd_ack_nack_mode,
++			{ "ACK NACK mode", "nfapi.tdd.ack.nack.mode",
++			FT_UINT8, BASE_DEC, VALS(nfapi_tdd_ack_nack_mode_vals), 0x0,
++			"The format of the ACK/NACK response expected. For TDD only.", HFILL }
++		},
++		{ &hf_nfapi_fdd_ack_nack_mode,
++			{ "ACK NACK mode", "nfapi.fdd.ack.nack.mode",
++			FT_UINT8, BASE_DEC, VALS(nfapi_fdd_ack_nack_mode_vals), 0x0,
++			"The format of the ACK/NACK response expected. For TDD only.", HFILL }
++		},
++		{ &hf_nfapi_n_srs_initial,
++			{ "N srs initial", "nfapi.n.srs.initial",
++			FT_UINT8, BASE_DEC, VALS(n_srs_initial_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_initial_number_of_resource_blocks,
++			{ "Initial number of resource blocks", "nfapi.initial.number.of.resource.blocks",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of resource blocks used in the initial transmission of this transport block.", HFILL }
++		},
++		{ &hf_nfapi_dl_cqi_pmi_size,
++			{ "DL cqi pmi size", "nfapi.dl.cqi.pmi.size",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The size of the DL CQI/PMI in bits in case of this RI value. The size of the DL CQI / PMI / RI in bits in case of this CRI value", HFILL }
++		},
++		{ &hf_nfapi_report_type,
++			{ "Report type", "nfapi.report.type",
++			FT_BOOLEAN, 8, TFS(&nfapi_csi_report_type_strname), 0x0,
++			"Type of CSI report", HFILL }
++		},
++		{ &hf_nfapi_dl_cqi_ri_pmi_size,
++			{ "DL CQI/PMI/RI size", "nfapi.dl.cqi.ri.pmi.size",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The size of the DL CQI/PMI/RI/CRI in bits", HFILL }
++		},
++		{ &hf_nfapi_control_type,
++			{ "Control type", "nfapi.control.type",
++			FT_BOOLEAN, 8, TFS(&nfapi_control_type_string_name), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_number_of_cc,
++			{ "Number of cc", "nfapi.number.of.cc",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of CC in the aperiodic report", HFILL }
++		},
++		{ &hf_nfapi_number_of_pucch_resource,
++			{ "Number of PUCCH Resource", "nfapi.number.of.pucch.resource",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"A value of 2 indicates that the UE is configured to transmit on two antenna ports", HFILL }
++		},
++		{ &hf_nfapi_pucch_index_p1,
++			{ "PUCCH Index P1", "nfapi.pucch.index.p1",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The PUCCH index value   for antenna port P1", HFILL }
++		},
++		{ &hf_nfapi_n_pucch_1_0,
++			{ "N PUCCH 1 0", "nfapi.n.pucch.1.0",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"HARQ resource 0", HFILL }
++		},
++		{ &hf_nfapi_n_pucch_1_1,
++			{ "N PUCCH 1 1", "nfapi.n.pucch.1.1",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"HARQ resource 1", HFILL }
++		},
++		{ &hf_nfapi_n_pucch_1_2,
++			{ "N PUCCH 1 2", "nfapi.n.pucch.1.2",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"HARQ resource 2", HFILL }
++		},
++		{ &hf_nfapi_n_pucch_1_3,
++			{ "N PUCCH 1 3", "nfapi.n.pucch.1.3",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"HARQ resource 3", HFILL }
++		},
++		{ &hf_nfapi_srs_bandwidth,
++			{ "SRS Bandwidth", "nfapi.srs.bandwidth",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"SRS Bandwidth. This value is fixed for a UE and allocated in RRC connection setup.", HFILL }
++		},
++		{ &hf_nfapi_frequency_domain_position,
++			{ "Frequency Domain position", "nfapi.frequency.domain.position",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Frequency-domain position, NRRC This value is fixed for a UE and allocated in RRC connection setup.", HFILL }
++		},
++		{ &hf_nfapi_srs_hopping_bandwidth,
++			{ "SRS hopping bandwidth", "nfapi.srs.hopping.bandwidth",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Configures the frequency hopping on the SRS. This value is fixed for a UE and allocated in RRC connection setup.", HFILL }
++		},
++		{ &hf_nfapi_transmission_comb,
++			{ "Transmission comb", "nfapi.transmission.comb",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Configures the frequency location of the SRS. This value is fixed for a UE and allocated in RRC connection setup.", HFILL }
++		},
++		{ &hf_nfapi_i_srs,
++			{ "I SRS", "nfapi.i.srs",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Defines the periodicity and subframe location of the SRS. SRS Configuration Index. This value is fixed for a UE and allocated in RRC connection setup.", HFILL }
++		},
++		{ &hf_nfapi_sounding_reference_cyclic_shift,
++			{ "Sounding reference cyclic shift", "nfapi.sounding.reference.cyclic.shift",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Configures the SRS sequence generation. This value is fixed for a UE and allocated in RRC connection setup.", HFILL }
++		},
++		{ &hf_nfapi_pdu_length,
++			{ "PDU length", "nfapi.pdu.length",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The total length (in bytes) of the PDU description and PDU data, without the padding bytes", HFILL }
++		},
++		{ &hf_nfapi_crc_flag,
++			{ "CRC flag", "nfapi.crc.flag",
++			FT_BOOLEAN, 8, TFS(&crc_flag_strname), 0x0,
++			"A flag indicating if a CRC error was detected", HFILL }
++		},
++		{ &hf_nfapi_number_of_hi_pdus,
++			{ "Number of HI Pdu's", "nfapi.number_of_hi_pdus",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of HI PDUs included in this message", HFILL }
++		},
++		{ &hf_nfapi_number_of_dci_pdus,
++			{ "Number of DCI Pdu's", "nfapi.number_of_dci_pdus",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of DCI PDUs included in this message", HFILL }
++		},
++		{ &hf_nfapi_hi_dci0_pdu_type,
++			{ "PDU Type", "nfapi.pdu_type",
++			FT_UINT8, BASE_DEC, VALS(hi_dci0_pdu_type_vals), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_hi_value,
++			{ "HI Value", "nfapi.hi_value",
++			FT_BOOLEAN, 8, TFS(&hi_value_strname), 0x0,
++			"The PHICH value which is sent on the resource", HFILL }
++		},
++		{ &hf_nfapi_i_phich,
++			{ "i phich", "nfapi.i_phich",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Is used in the calculation of the PHICH location. For TDD only", HFILL }
++		},
++		{ &hf_nfapi_flag_tb2,
++			{ "Flag TB2", "nfapi.flag_tb2",
++			FT_BOOLEAN, BASE_NONE, TFS(&flag_tb2_strname), 0x0,
++			"Indicates is HI is present for a second transport block", HFILL }
++		},
++		{ &hf_nfapi_hi_value_2,
++			{ "HI Value 2", "nfapi.hi_value_2",
++			FT_BOOLEAN, BASE_NONE, TFS(&hi_value_strname), 0x0,
++			"The PHICH value for a second transport block.", HFILL }
++		},
++		{ &hf_nfapi_ue_tx_antenna_selection,
++			{ "UE Tx Antenna selection", "nfapi.ue_tx_antenna_selection",
++			FT_UINT8, BASE_DEC, VALS(ue_tx_antenna_selection_vals), 0x0,
++			"Indicates how the CRC is calculated on the PDCCH.", HFILL }
++		},
++		{ &hf_nfapi_cqi_csi_request,
++			{ "cqi csi request", "nfapi.cqi_csi_request",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Aperiodic CQI request flag", HFILL }
++		},
++		{ &hf_nfapi_ul_index,
++			{ "UL index", "nfapi.ul_index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Valid for TDD mode only", HFILL }
++		},
++		{ &hf_nfapi_dl_assignment_index,
++			{ "DL Assignment index", "nfapi.dl_assignment_index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Valid for TDD mode only.", HFILL }
++		},
++		{ &hf_nfapi_tpc_bitmap,
++			{ "TPC bitmap", "nfapi.tpc_bitmap",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"TPC commands for PUCCH and PUSCH", HFILL }
++		},
++		{ &hf_nfapi_number_of_antenna_ports,
++			{ "Number of antenna ports", "nfapi.number.of.antenna.ports",
++			FT_UINT8, BASE_DEC, VALS(number_of_antenna_port_vals), 0x0,
++			"Defines number of antenna ports for this ULSCH allocation", HFILL }
++		},
++		{ &hf_nfapi_size_of_cqi_csi_feild,
++			{ "Size of cqi csi feild", "nfapi.size.of.cqi.csi.feild",
++			FT_UINT8, BASE_DEC, VALS(size_of_cqi_csi_feild_vals), 0x0,
++			"Indicates the size of the CQI/CSI request field", HFILL }
++		},
++		{ &hf_nfapi_new_data_indication_two,
++			{ "New data indication 2", "nfapi.new.data.indication.two",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The new data indicator for the second transport block", HFILL }
++		},
++		{ &hf_nfapi_resource_allocation_flag,
++			{ "Resource allocation flag", "nfapi.resource.allocation.flag",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Indicates if the Resource Allocation Type parameter is valid.", HFILL }
++		},
++		{ &hf_nfapi_dl_node_sync_t1,
++			{ "DL Node Sync t1", "nfapi.dl.node.sync.t1",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"Offset from VNF SFN/SF 0/0 time reference of the DL Node Sync message transmission at the transport layer, in microseconds.", HFILL }
++		},
++		{ &hf_nfapi_dl_node_sync_delta_sfn_sf,
++			{ "DL Node Sync Delta SFN SF", "nfapi.dl.node.sync.delta_sfn_sf",
++			FT_INT32, BASE_DEC, NULL, 0x0,
++			"The delta shift in subframes that the PNF PHY instance must update to on the next subframe boundary", HFILL }
++		},
++		{ &hf_nfapi_dl_cyclic_prefix_type,
++			{ "DL Cyclic Prefix type", "nfapi.dl.cyclic.prefix.type",
++			FT_BOOLEAN, 8, TFS(&cyclic_prefix_type_strname), 0x0,
++			"Cyclic prefix type, used for DL", HFILL }
++		},
++		{ &hf_nfapi_ul_cyclic_prefix_type,
++			{ "UL Cyclic Prefix type", "nfapi.ul.cyclic.prefix.type",
++			FT_BOOLEAN, 8, TFS(&cyclic_prefix_type_strname), 0x0,
++			"Cyclic prefix type, used for UL", HFILL }
++		},
++		{ &hf_nfapi_downlink_channel_bandwidth,
++			{ "Downlink Channel Bandwidth", "nfapi.dl.channel.bandwidth",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Downlink channel bandwidth in resource blocks.", HFILL }
++		},
++		{ &hf_nfapi_uplink_channel_bandwidth,
++			{ "Uplink Channel Bandwidth", "nfapi.ul.channel_bandwidth",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Uplink channel bandwidth in resource blocks.", HFILL }
++		},
++		{ &hf_nfapi_tx_antenna_ports,
++			{ "Tx Antenna Ports", "nfapi.tx.antenna.ports",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of cell specific or NB transmit antenna ports.", HFILL }
++		},
++		{ &hf_nfapi_rx_antenna_ports,
++			{ "Tx Antenna Ports", "nfapi.rx.antenna.ports",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of cell specific or NB receive antenna ports.", HFILL }
++		},
++		{ &hf_nfapi_ul_node_sync_t1,
++			{ "UL Node Sync t1", "nfapi.ul.node.sync.t1",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"The supplied t1 field in the DL Node Sync", HFILL }
++		},
++		{ &hf_nfapi_ul_node_sync_t2,
++			{ "UL Node Sync t2", "nfapi.ul.node.sync.t2",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"Offset from PNF SFN/SF 0/0 time reference of the DL Node Sync message reception at the transport layer, in microseconds.", HFILL }
++		},
++		{ &hf_nfapi_ul_node_sync_t3,
++			{ "UL Node Sync t3", "nfapi.ul.node.sync.t3",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"Offset from PNF SFN/SF 0/0 time reference of the UL Node Sync message transmission at the transport layer, in microseconds.", HFILL }
++		},
++		{ &hf_nfapi_pb,
++			{ "P-B", "nfapi.pb.allocation",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Refers to downlink power allocation. Value is an index into the referenced table.", HFILL }
++		},
++		{ &hf_nfapi_timing_info_last_sfn_sf,
++			{ "Last SFN/SF", "nfapi.timing.info.last.sfn.sf",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"The completed SFN/SF at the PNF PHY instance that triggered the Timing Info message", HFILL }
++		},
++		{ &hf_nfapi_timing_info_time_since_last_timing_info,
++			{ "Time since last Timing Info", "nfapi.timing.info.time.since.last.timing.info",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"The number of ms since the last Timing Info was sent from this PNF PHY instance.", HFILL }
++		},
++		{ &hf_nfapi_timing_info_dl_config_jitter,
++			{ "DL Config Jitter", "nfapi.timing.info.dl.config.jitter",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"The inter message jitter of the DL Config message reception in microseconds", HFILL }
++		},
++		{ &hf_nfapi_timing_info_tx_request_jitter,
++			{ "Tx Request Jitter", "nfapi.timing.info.tx.req.jitter",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"The inter message jitter of the Tx Request message reception in microseconds", HFILL }
++		},
++		{ &hf_nfapi_timing_info_ul_config_jitter,
++			{ "UL Config Jitter", "nfapi.timing.info.ul.config.jitter",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"The inter message jitter of the UL Config message reception in microseconds", HFILL }
++		},
++		{ &hf_nfapi_timing_info_hi_dci0_jitter,
++			{ "HI_DCI0 Jitter", "nfapi.timing.info.hi.dci0.jitter",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"The inter message jitter of the HI_DCI0 message reception in microseconds", HFILL }
++		},
++		{ &hf_nfapi_timing_info_dl_config_latest_delay,
++			{ "DL Config Latest Delay", "nfapi.timing.info.dl.config.latest.delay",
++			FT_INT32, BASE_DEC, NULL, 0x0,
++			"The latest delay offset in microseconds from the latest acceptable time for the DL Config as defined in the DL Config Timing in the PNF_PARAM.Response since the last transmission of the Timing Info Message.", HFILL }
++		},
++		{ &hf_nfapi_timing_info_tx_request_latest_delay,
++			{ "Tx Request Latest Delay", "nfapi.timing.info.tx.request.latest.delay",
++			FT_INT32, BASE_DEC, NULL, 0x0,
++			"The latest delay offset in microseconds from the latest acceptable time for the Tx Request as defined in the Tx Config Timing in the PNF_PARAM.Response since the last transmission of the Timing Info Message.", HFILL }
++		},
++		{ &hf_nfapi_timing_info_ul_config_latest_delay,
++			{ "UL Config Latest Delay", "nfapi.timing.info.ul.config.latest.delay",
++			FT_INT32, BASE_DEC, NULL, 0x0,
++			"The latest delay offset in microseconds from the latest acceptable time for the UL Config as defined in the UL Config Timing in the PNF_PARAM.Response since the last transmission of the Timing Info Message.", HFILL }
++		},
++		{ &hf_nfapi_timing_info_hi_dci0_latest_delay,
++			{ "HI_DCI0 Latest Delay", "nfapi.timing.info.hi.dci0.latest.delay",
++			FT_INT32, BASE_DEC, NULL, 0x0,
++			"The latest delay offset in microseconds from the latest acceptable time for the HI_DCI0 as defined in the HI_DCI0 Timing in the PNF_PARAM.Response since the last transmission of the Timing Info Message.", HFILL }
++		},
++		{ &hf_nfapi_timing_info_dl_config_earliest_arrival,
++			{ "DL Config Earliest Arrival", "nfapi.timing.info.dl.config.earliest.arrival",
++			FT_INT32, BASE_DEC, NULL, 0x0,
++			"The earlierst arrival offset in microseconds from the latest time acceptable for the DL Config as defined in the Timing Window in the PARAM.Response since the last transmission of the Timing Info Message.", HFILL }
++		},
++		{ &hf_nfapi_timing_info_tx_request_earliest_arrival,
++			{ "Tx Request Earliest Arrival", "nfapi.timing.info.tx.request.earliest.arrival",
++			FT_INT32, BASE_DEC, NULL, 0x0,
++			"The earlierst arrival offset in microseconds from the latest time acceptable for the Tx Request as defined in the Timing Window in the PARAM.Response since the last transmission of the Timing Info Message.", HFILL }
++		},
++		{ &hf_nfapi_timing_info_ul_config_earliest_arrival,
++			{ "UL Config Earliest Arrival", "nfapi.timing.info.ul.config.earliest.arrival",
++			FT_INT32, BASE_DEC, NULL, 0x0,
++			"The earlierst arrival offset in microseconds from the latest time acceptable for the UL Config as defined in the Timing Window in the PARAM.Response since the last transmission of the Timing Info Message.", HFILL }
++		},
++		{ &hf_nfapi_timing_info_hi_dci0_earliest_arrival,
++			{ "HI_DCI0 Earliest Arrival", "nfapi.timing.info.hi.dci0.earliest.arrival",
++			FT_INT32, BASE_DEC, NULL, 0x0,
++			"The earlierst arrival offset in microseconds from the latest time acceptable for the HI_DCI0 as defined in the Timing Window in the PARAM.Response since the last transmission of the Timing Info Message.", HFILL }
++		},
++		{ &hf_nfapi_pcfich_power_offset,
++			{ "PCFICH Power Offset", "nfapi.pcfich.power.offset",
++			FT_UINT16, BASE_CUSTOM, CF_FUNC(power_offset_conversion_fn), 0x0,
++			"The power per antenna of the PCFICH with respect to the reference signal.", HFILL }
++		},
++		{ &hf_nfapi_timing_window,
++			{ "NFAPI Timing window", "nfapi.timing.window",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The window in milliseconds that the PHY must receive and queue the P7 messages.", HFILL }
++		},
++		{ &hf_nfapi_timing_info_mode,
++			{ "Timing Info mode", "nfapi.timing.info.mode",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The configured mode of operation for the timing info message to be sent to the VNF from the PHY", HFILL }
++		},
++		{ &hf_nfapi_timing_info_period,
++			{ "Timing info period", "nfapi.timing.info.period",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"If Periodic timing mode is enabled, this defines the periodicity in subframes. This field is ignored if periodic timing mode is disabled.", HFILL }
++		},
++		{ &hf_nfapi_tdd_harq_mode,
++			{ "Mode", "nfapi.tdd.harq.mode",
++			FT_UINT8, BASE_DEC, VALS(tdd_harq_mode_vals), 0x0,
++			"The format of the ACK/NACK response expected", HFILL }
++		},
++		{ &hf_nfapi_fdd_harq_mode,
++			{ "Mode", "nfapi.fdd.harq.mode",
++			FT_UINT8, BASE_DEC, VALS(fdd_harq_mode_vals), 0x0,
++			"The format of the ACK/NACK response expected", HFILL }
++		},
++		{ &hf_nfapi_number_of_ack_nack,
++			{ "Number of ACK/NACK", "nfapi.uint16.tag",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of ACK/NACK results reported for this UE", HFILL }
++		},
++		{ &hf_nfapi_harq_data_value_0,
++			{ "Value 0", "nfapi.harq.value.0",
++			FT_UINT8, BASE_DEC, VALS(harq_value_vals), 0x0,
++			"Indicates HARQ results", HFILL }
++		},
++		{ &hf_nfapi_harq_data_value_0_special,
++			{ "Value 0", "nfapi.harq.value.0.special",
++			FT_UINT8, BASE_DEC, VALS(harq_special_value_vals), 0x0,
++			"Indicates HARQ results", HFILL }
++		},
++		{ &hf_nfapi_harq_data_value_1,
++			{ "Value 1", "nfapi.harq.value.1",
++			FT_UINT8, BASE_DEC, VALS(harq_value_vals), 0x0,
++			"Indicates HARQ results", HFILL }
++		},
++		{ &hf_nfapi_harq_data_value_2,
++			{ "Value 2", "nfapi.harq.value.2",
++			FT_UINT8, BASE_DEC, VALS(harq_value_vals), 0x0,
++			"Indicates HARQ results", HFILL }
++		},
++		{ &hf_nfapi_harq_data_value_3,
++			{ "Value 3", "nfapi.harq.value.3",
++			FT_UINT8, BASE_DEC, VALS(harq_value_vals), 0x0,
++			"Indicates HARQ results", HFILL }
++		},
++		{ &hf_nfapi_harq_tb_1,
++			{ "HARQ TB1", "nfapi.harq.tb.",
++			FT_UINT8, BASE_DEC, VALS(harq_value_vals), 0x0,
++			"HARQ feedback of 1st TB.", HFILL }
++		},
++		{ &hf_nfapi_harq_tb_2,
++			{ "HARQ TB2", "nfapi.harq.tb.2",
++			FT_UINT8, BASE_DEC, VALS(harq_value_vals), 0x0,
++			"HARQ feedback of 2nd TB.", HFILL }
++		},
++		{ &hf_nfapi_harq_tb_n,
++			{ "HARQ TB_N", "nfapi.harq.tb.n",
++			FT_UINT8, BASE_DEC, VALS(harq_value_vals), 0x0,
++			"HARQ feedback of Nth TB.", HFILL }
++		},
++		{ &hf_nfapi_ul_cqi,
++			{ "UL_CQI", "nfapi.ul.cqi",
++			FT_UINT8, BASE_CUSTOM, CF_FUNC(ul_cqi_conversion_fn), 0x0,
++			"SNR", HFILL }
++		},
++		{ &hf_nfapi_channel,
++			{ "Channel", "nfapi.channel",
++			FT_UINT8, BASE_DEC, VALS(channel_vals), 0x0,
++			"The channel to which this measurement refers", HFILL }
++		},
++		{ &hf_nfapi_data_offset,
++			{ "Data Offset", "nfapi.data.offset",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Gives the PDU#i data address offset from the beginning of the 'Number of PDUs' field. An offset of 0 indicates a CRC or decoding error", HFILL }
++		},
++		{ &hf_nfapi_ri,
++			{ "RI", "nfapi.ri",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The rank indication reported by the UE on PUSCH for aperiodic CSI.", HFILL }
++		},
++		{ &hf_nfapi_timing_advance,
++			{ "Timing Advance", "nfapi.timing.advance",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The timing advance measured for this PDU and UE.", HFILL }
++		},
++		{ &hf_nfapi_timing_advance_r9,
++			{ "Timing Advance R9", "nfapi.timing.advance.r9",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Timing advance used for positioning", HFILL }
++		},
++		{ &hf_nfapi_number_of_cc_reported,
++			{ "Number of CC reported", "nfapi.number.of.cc.reported",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_preamble,
++			{ "Preamble", "nfapi.preamble",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The detected preamble", HFILL }
++		},
++		{ &hf_nfapi_rach_resource_type,
++			{ "RACH resource type", "nfapi.rach.resource.type",
++			FT_UINT8, BASE_DEC, VALS(rach_resource_type_vals), 0x0,
++			"Indicates if this indication is related to Cat-M UE and in which CE level", HFILL }
++		},
++		{ &hf_nfapi_doppler_estimation,
++			{ "Doppler estimation", "nfapi.doppler.estimation",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"FFS", HFILL }
++		},
++		{ &hf_nfapi_rb_start,
++			{ "RB Start", "nfapi.rb.start",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The starting point of the RBs to be reported", HFILL }
++		},
++		{ &hf_nfapi_snr,
++			{ "SNR", "nfapi.snr",
++			FT_UINT8, BASE_CUSTOM, CF_FUNC(ul_cqi_conversion_fn), 0x0,
++			"Field size dependent on configured bandwidth SNR for RBs, each RBs report one SNR.", HFILL }
++		},
++		{ &hf_nfapi_up_pts_symbol,
++			{ "UpPTS Symbol", "nfapi.uppts.symbol",
++			FT_UINT8, BASE_DEC, VALS(up_pts_symbol_vals), 0x0,
++			"Indicates symbol where SRS was received. Only valid if the SRS was received in subframe 1 or 6.", HFILL }
++		},
++		{ &hf_nfapi_number_prb_per_subband,
++			{ "numPRBperSubband", "nfapi.num.prb.per.subband",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of PRBs that are treated as one subband", HFILL }
++		},
++		{ &hf_nfapi_number_antennas,
++			{ "numAntennas", "nfapi.num.antennas",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Number of physical antennas", HFILL }
++		},
++		{ &hf_nfapi_subband_index,
++			{ "subbandIndex", "nfapi.subband.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"Index of subband for which the following channel coefficient is applied", HFILL }
++		},
++		{ &hf_nfapi_channel_coefficient,
++			{ "Channel", "nfapi.channel.coefficient",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Averaged channel coefficient in a subband for physical antenna #i, real 8 bits followed by imaginary 8 bits", HFILL }
++		},
++		{ &hf_nfapi_ul_rtoa,
++			{ "UL_RTOA", "nfapi.ul.rtoa",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"UL relative time of arrival used for network based positioning", HFILL }
++		},
++		{ &hf_nfapi_frequency_band_indicator,
++			{ "Frequency Band Indicator", "nfapi.frequency.band.indicator",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The E-UTRA band for which the carrierList applies.", HFILL }
++		},
++		{ &hf_nfapi_measurement_period,
++			{ "Measurement Period", "nfapi.measurement.period",
++			FT_UINT16, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"The length of time to measure RSSI over, in units of 1ms.", HFILL }
++		},
++		{ &hf_nfapi_bandwidth,
++			{ "Bandwidth", "nfapi.bandwidth",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The bandwidth (in resource blocks) over which the RSSI is measured.", HFILL }
++		},
++		{ &hf_nfapi_timeout,
++			{ "Timeout", "nfapi.timeout",
++			FT_UINT32, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"The timeout value after which the PNF should abort the procedure in units of 1ms. The value of 0 indicates that the PNF should attempt to complete the procedure without any VNF-imposed timeout.", HFILL }
++		},
++		{ &hf_nfapi_number_of_earfcns,
++			{ "Number of EARFCNs", "nfapi.number.of.earfcns",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of EARFCNs which should be measured. In the case that no EARFCN (value 0) is specified, all valid EARFCNs for the specified bandwidth in the band shall be measured, in order of ascending EARCFN.", HFILL }
++		},
++		{ &hf_nfapi_uarfcn,
++			{ "UARFCN", "nfapi.uarfcn",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"UARFCN to be measured.", HFILL }
++		},
++		{ &hf_nfapi_number_of_uarfcns,
++			{ "Number of UARFCNs", "nfapi.number.of.uarfcn",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of UARFCNs which should be measured. In the case that no UARFCN (value 0) is specified, all UARFCNs in the band shall be measured, in order of ascending UARCFN.", HFILL }
++		},
++		{ &hf_nfapi_arfcn,
++			{ "ARFCN", "nfapi.arfcn",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The ARFCN to be measured", HFILL }
++		},
++		{ &hf_nfapi_arfcn_direction,
++			{ "Direction", "nfapi.arfcn.direction",
++			FT_UINT8, BASE_DEC, VALS(arfcn_direction_vals), 0x0,
++			"The link direction to be measured", HFILL }
++		},
++		{ &hf_nfapi_number_of_arfcns,
++			{ "Number of ARFCNs", "nfapi.number.of.arfcn",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of ARFCNs which should be measured. In the case that no ARFCN (value 0) is specified, all ARFCNs in the band shall be measured, in order of ascending ARCFN.", HFILL }
++		},
++		{ &hf_nfapi_rssi,
++			{ "RSSI", "nfapi.rssi",
++			FT_INT16, BASE_CUSTOM, CF_FUNC(rssi_conversion_fn), 0x0,
++			"The list of RSSI values of the carriers measured, in the order of the list of the original request.", HFILL }
++		},
++		{ &hf_nfapi_number_of_rssi,
++			{ "Number of RSSI", "nfapi.number.of.rssi",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of RSSI results returned in the following array.", HFILL }
++		},
++		{ &hf_nfapi_pci,
++			{ "PCI", "nfapi.pci",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The PCI for cell which should be searched", HFILL }
++		},
++		{ &hf_nfapi_measurement_bandwidth,
++			{ "Measurement Bandwidth", "nfapi.measurement.bandwidth",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of resource blocks which should be used for measuring RSRP", HFILL }
++		},
++		{ &hf_nfapi_exhaustive_search,
++			{ "Exhaustive Search", "nfapi.exhaustive.search",
++			FT_UINT8, BASE_DEC, VALS(exhustive_search_vals), 0x0,
++			"NMM should try to find all cells on the carrier", HFILL }
++		},
++		{ &hf_nfapi_number_of_pci,
++			{ "Number of PCI", "nfapi.number.of.pci",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of cells in the PCI list. If 0 all cells on the carrier should be found. Otherwise, depending on exhaustiveSearch flag, only the given pciList is searched or the pciList is used for indicating a priority list. Range: 0 to MAX_PCI_LIST.", HFILL }
++		},
++		{ &hf_nfapi_psc,
++			{ "PSC", "nfapi.psc",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The PSC for cells which should be searched.", HFILL }
++		},
++		{ &hf_nfapi_number_of_psc,
++			{ "Number of PSC", "nfapi.number.of.psc",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of cells in the PSC list. If 0 all cells on the carrier should be found. Otherwise, depending on Exhaustive Search flag, only the given PSC list is searched or the PSC list is used for indicating a priority list. Range: 0 to MAX_PSC_LIST.", HFILL }
++		},
++		{ &hf_nfapi_rsrp,
++			{ "RSRP", "nfapi.rsrp",
++			FT_UINT8, BASE_CUSTOM, CF_FUNC(neg_pow_conversion_fn), 0x0,
++			"The measured RSRP value in units of -1dB", HFILL }
++		},
++		{ &hf_nfapi_rsrq,
++			{ "RSRQ", "nfapi.rsrq",
++			FT_UINT8, BASE_CUSTOM, CF_FUNC(neg_pow_conversion_fn), 0x0,
++			"The measured RSRQ value in units of -1dB", HFILL }
++		},
++		{ &hf_nfapi_number_of_lte_cells_found,
++			{ "Number of LTE Cells Found", "nfapi.number.of.lte.cells.found",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of LTE cells indicated in this message.", HFILL }
++		},
++		{ &hf_nfapi_rscp,
++			{ "RSCP", "nfapi.rscp",
++			FT_UINT8, BASE_CUSTOM, CF_FUNC(neg_pow_conversion_fn), 0x0,
++			"The measured RSCP value in units of -1dB", HFILL }
++		},
++		{ &hf_nfapi_enco,
++			{ "EcNo", "nfapi.ecno",
++			FT_UINT8, BASE_CUSTOM, CF_FUNC(neg_pow_conversion_fn), 0x0,
++			"The measured RSCP value in units of -1dB", HFILL }
++		},
++		{ &hf_nfapi_number_of_utran_cells_found,
++			{ "Number of UTRAN Cells Found", "nfapi.number.of.utran.cells.found",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of LTE cells indicated in this message", HFILL }
++		},
++		{ &hf_nfapi_bsic,
++			{ "BSIC", "nfapi.bsic",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The BSIC of the cell which the NMM synchronized to", HFILL }
++		},
++		{ &hf_nfapi_rxlev,
++			{ "RxLev", "nfapi.rxlev",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The measured RxLev value", HFILL }
++		},
++		{ &hf_nfapi_rxqual,
++			{ "RxQual", "nfapi.rxqual",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The measured RxQual value", HFILL }
++		},
++		{ &hf_nfapi_sfn_offset,
++			{ "SFN Offset", "nfapi.sfn.offset",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"The offset in us of the start of the current GSM Radio HyperFrame (i.e. FN=0) from the start of the preceding LTE Radio Frame of the PNF for SFN=0", HFILL }
++		},
++		{ &hf_nfapi_number_of_geran_cells_found,
++			{ "Number of GSM Cells Found", "nfapi.number.of.geran.cells.found",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The number of GSM cells indicated in this message", HFILL }
++		},
++		{ &hf_nfapi_number_of_tx_antenna,
++			{ "Number of Tx Antenna", "nfapi.number.of.tx.antenna",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of Tx Antenna detected for the cell", HFILL }
++		},
++		{ &hf_nfapi_mib_length,
++			{ "MIB Length", "nfapi.mib.length",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Length in bytes of the following MIB array", HFILL }
++		},
++		{ &hf_nfapi_mib,
++			{ "MIB", "nfapi.mib",
++			FT_BYTES, BASE_NONE, NULL, 0x0,
++			"The MIB read from the specified cell.", HFILL }
++		},
++		{ &hf_nfapi_phich_configuration,
++			{ "PHICH Configuration", "nfapi.phich.configuration",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The PHICH-Config of the cell", HFILL }
++		},
++		{ &hf_nfapi_retry_count,
++			{ "retryCount", "nfapi.retry.count",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of SIB1 repetition periods for which decoding of SIB1 should be retried.", HFILL }
++		},
++		{ &hf_nfapi_sib1,
++			{ "SIB1", "nfapi.sib1",
++			FT_BYTES, BASE_NONE, NULL, 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_si_periodicity,
++			{ "SI Periodicity", "nfapi.si.periodicity",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The SI Periodicity of the requested SIBs, with the first element being for SIB2, the next for SIB3, etc, encoded as follows", HFILL }
++		},
++		{ &hf_nfapi_si_index,
++			{ "SI Index", "nfapi.si.index",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The index of this SIB in the SIB1 SchedulingInfoList:", HFILL }
++		},
++		{ &hf_nfapi_number_of_si_periodicity,
++			{ "Number of SI Periodicity", "nfapi.number.of.si.periodicity",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The number of System Information periodicity values in the following array", HFILL }
++		},
++		{ &hf_nfapi_si_window_length,
++			{ "SI Window Length", "nfapi.si.window.length",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The SI window in units of 1ms", HFILL }
++		},
++		{ &hf_nfapi_sib_type,
++			{ "SIB Type", "nfapi.sib.type",
++			FT_UINT8, BASE_DEC, NULL, 0x0,
++			"The SIB type", HFILL }
++		},
++		{ &hf_nfapi_sib_len,
++			{ "SIB Length", "nfapi.sib.length",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The length in bytes of the following SIB array", HFILL }
++		},
++		{ &hf_nfapi_sib,
++			{ "SIB", "nfapi.sib",
++			FT_BYTES, BASE_NONE, NULL, 0x0,
++			"The SIB element read from the specified cell.", HFILL }
++		},
++		{ &hf_nfapi_si_len,
++			{ "SI Length", "nfapi.si.length",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The length in bytes of the following SI array", HFILL }
++		},
++		{ &hf_nfapi_si,
++			{ "SI", "nfapi.si",
++			FT_BYTES, BASE_NONE, NULL, 0x0,
++			"The SI element read from the specified cell.", HFILL }
++		},
++		{ &hf_nfapi_pnf_search_state,
++			{ "State", "nfapi.state",
++			FT_BYTES, BASE_NONE, NULL, 0x0,
++			"A structure of opaque data optionally sent by the PNF to the VNF", HFILL }
++		},
++		{ &hf_nfapi_pnf_broadcast_state,
++			{ "State", "nfapi.state",
++			FT_BYTES, BASE_NONE, NULL, 0x0,
++			"A structure of opaque data optionally sent by the PNF to the VNF", HFILL }
++		},
++		{ &hf_nfapi_dl_rs_tx_power,
++			{ "DL RS Tx power", "nfapi.dl.rs.tx.power",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"The DL RS Tx power measurement", HFILL }
++		},
++		{ &hf_nfapi_received_interference_power,
++			{ "Received interference power", "nfapi.received.interference.power",
++			FT_UINT16, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"The Received interference power measurement", HFILL }
++		},
++		{ &hf_nfapi_thermal_noise_power,
++			{ "Thermal noise power", "nfapi.thermal.noise.power",
++			FT_UINT16, BASE_DEC | BASE_UNIT_STRING, &units_milliseconds, 0x0,
++			"The Thermal noise power measurement", HFILL }
++		},
++		{ &hf_nfapi_dl_rs_tx_power_measurement,
++			{ "DL RS TX Power measurement", "nfapi.dl.rs.tx.power.measurement",
++			FT_INT16, BASE_CUSTOM, CF_FUNC(dl_rs_tx_pow_measment_conversion_fn), 0x0,
++			"The DL RS Tx power measurement defined", HFILL }
++		},
++		{ &hf_nfapi_received_interference_power_measurement,
++			{ "Received interference power measurement", "nfapi.received.interference.power.measurement",
++			FT_INT16, BASE_CUSTOM, CF_FUNC(dl_rs_tx_pow_measment_conversion_fn), 0x0,
++			NULL, HFILL }
++		},
++		{ &hf_nfapi_thermal_noise_power_measurement,
++			{ "Thermal noise power measurement", "nfapi.thermal.noise.power.measurement",
++			FT_INT16, BASE_CUSTOM, CF_FUNC(dl_rs_tx_pow_measment_conversion_fn), 0x0,
++			"The Thermal noise power measurement", HFILL }
++		},
++		{ &hf_nfapi_initial_partial_sf,
++			{ "Initial Partial SF", "nfapi.initial.partial.sf",
++			FT_BOOLEAN, 32, TFS(&initial_partial_sf_strname), 0x0,
++			"Indicates whether the initial SF in the LBT process is full or partial", HFILL }
++		},
++		{ &hf_nfapi_lbt_mode,
++			{ "LBT Mode", "nfapi.lbt.mode",
++			FT_BOOLEAN, 32, TFS(&lbt_mode_strname), 0x0,
++			"Part of multi-carrier support. Indicates whether full LBT process is carried or partial LBT process is carried (multi carrier mode B according to [9] section 15.1.5.2)", HFILL }
++		},
++		{ &hf_nfapi_lte_txop_sf,
++			{ "LTE TXOP SF", "nfapi.txop.sf",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"Indicates the LTE TXOP (TMCOT,P in [9] section 15.1.1) duration in subframes.", HFILL }
++		},
++		{ &hf_nfapi_mp_cca,
++			{ "mp cca", "nfapi.mp.cca",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"Indicates the value of the defer factor", HFILL }
++		},
++		{ &hf_nfapi_n_cca,
++			{ "n cca", "nfapi.n.cca",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"Indicates the value of LBT backoff counter", HFILL }
++		},
++		{ &hf_nfapi_offset,
++			{ "offset", "nfapi.offset",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"Indicates the LBT start time in microseconds from the beginning of the subframe scheduled by this message.", HFILL }
++		},
++		{ &hf_nfapi_result,
++			{ "result", "nfapi.result",
++			FT_BOOLEAN, 32, TFS(&tfs_fail_success), 0x0,
++			"Indicates the LBT procedure result of SFN/SF:", HFILL }
++		},
++		{ &hf_nfapi_sfn_sf_end,
++			{ "SFN/SF End", "nfapi.sfn.sf.end",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates the SFN/SF by which the DRS window (Discovery signal occasion as described in [9] section 6.11A) must end. In worst case, this would be the last TXOP subframe.", HFILL }
++		},
++		{ &hf_nfapi_txop_sfn_sf_end,
++			{ "TXOP SFN/SF End", "nfapi.txop.sfn.sf.end",
++			FT_UINT16, BASE_DEC, NULL, 0x0,
++			"Indicates the SFN/SF by which the TXOP must end. In worst case, this would be the last TXOP subframe.", HFILL }
++		},
++		{ &hf_nfapi_txop_symbols,
++			{ "LTE TXOP symbols", "nfapi.lte.txop.symbols",
++			FT_UINT32, BASE_DEC, NULL, 0x0,
++			"Actual LTE TXOP in symbols", HFILL }
++		},
++	};
++
++	/* Setup protocol subtree array */
++	static gint *ett[] =
++	{
++		&ett_nfapi_message_tree,
++		&ett_nfapi_p4_p5_message_header,
++		&ett_nfapi_p7_message_header,
++		&ett_nfapi_tlv_tree,
++		&ett_nfapi_tl,
++		&ett_nfapi_pnf_phy_rf_config,
++		&ett_nfapi_pnf_phy,
++		&ett_nfapi_pnf_phy_rel10,
++		&ett_nfapi_pnf_phy_rel11,
++		&ett_nfapi_pnf_phy_rel12,
++		&ett_nfapi_pnf_phy_rel13,
++		&ett_nfapi_rf_bands,
++		&ett_nfapi_bf_vectors,
++		&ett_nfapi_csi_rs_bf_vector,
++		&ett_nfapi_csi_rs_resource_configs,
++		&ett_nfapi_tx_antenna_ports,
++		&ett_nfapi_harq_ack_nack_data,
++		&ett_nfapi_harq_data,
++		&ett_nfapi_cqi_pmi_size,
++		&ett_nfapi_cc,
++		&ett_nfapi_rbs,
++		&ett_nfapi_antennas,
++		&ett_nfapi_epdcch_prbs,
++		&ett_nfapi_dl_config_request_pdu_list,
++		&ett_nfapi_ul_config_request_pdu_list,
++		&ett_nfapi_hi_dci0_request_pdu_list,
++		&ett_nfapi_tx_request_pdu_list,
++		&ett_nfapi_rx_indication_pdu_list,
++		&ett_nfapi_harq_indication_pdu_list,
++		&ett_nfapi_crc_indication_pdu_list,
++		&ett_nfapi_sr_indication_pdu_list,
++		&ett_nfapi_cqi_indication_pdu_list,
++		&ett_nfapi_preamble_indication_pdu_list,
++		&ett_nfapi_srs_indication_pdu_list,
++		&ett_nfapi_lbt_dl_config_pdu_list,
++		&ett_nfapi_lbt_dl_indication_pdu_list,
++		&ett_nfapi_subbands,
++		&ett_nfapi_precoding,
++		&ett_nfapi_bf_vector_antennas,
++		&ett_nfapi_received_interference_power_mesurement_results,
++		&ett_nfapi_downlink_bandwidth_support,
++		&ett_nfapi_uplink_bandwidth_support,
++		&ett_nfapi_release_support,
++		&ett_nfapi_downlink_modulation_support,
++		&ett_nfapi_uplink_modulation_support,
++
++		&ett_nfapi_earfcn_list,
++		&ett_nfapi_uarfcn_list,
++		&ett_nfapi_arfcn_list,
++		&ett_nfapi_rssi_list,
++		&ett_nfapi_pci_list,
++		&ett_nfapi_psc_list,
++		&ett_nfapi_lte_cells_found_list,
++		&ett_nfapi_utran_cells_found_list,
++		&ett_nfapi_geran_cells_found_list,
++		&ett_nfapi_si_periodicity_list,
++
++		/* for fragmentation support*/
++		&ett_msg_fragment,
++		&ett_msg_fragments
++	};
++
++	static ei_register_info ei[] =
++	{
++		{ &ei_invalid_range, { "nfapi.invalid.range", PI_PROTOCOL, PI_WARN, NULL, EXPFILL } },
++		{ &ei_invalid_tlv_length, { "nfapi.invalid.tlv.length", PI_PROTOCOL, PI_ERROR, NULL, EXPFILL } },
++	};
++
++	expert_module_t* expert_nfapi;
++	/* Register protocol */
++	proto_nfapi = proto_register_protocol("Nfapi", "NFAPI", "nfapi");
++
++	expert_nfapi = expert_register_protocol(proto_nfapi);
++	expert_register_field_array(expert_nfapi, ei, array_length(ei));
++
++
++	proto_register_field_array(proto_nfapi, hf, array_length(hf));
++	proto_register_subtree_array(ett, array_length(ett));
++
++	reassembly_table_register(&ul_p7_reassemble_table, &addresses_ports_reassembly_table_functions);
++	reassembly_table_register(&dl_p7_reassemble_table, &addresses_ports_reassembly_table_functions);
++
++	register_dissector("nfapi", dissect_nfapi, proto_nfapi);
++
++}
++
++// ----------------------------------------------------------------------------|
++
++void proto_reg_handoff_nfapi(void)
++{
++	static dissector_handle_t nfapi_handle;
++
++	nfapi_handle = create_dissector_handle(dissect_nfapi, proto_nfapi);
++
++	dissector_add_for_decode_as("sctp.port", nfapi_handle);
++
++	dissector_add_uint("udp.port", 41700, nfapi_handle);
++
++}
++
++
++/*
++* Editor modelines  -  http://www.wireshark.org/tools/modelines.html
++*
++* Local variables:
++* c-basic-offset: 8
++* tab-width: 8
++* indent-tabs-mode: t
++* End:
++*
++* vi: set shiftwidth=8 tabstop=8 noexpandtab:
++* :indentSize=8:tabSize=8:noTabs=false:
++*/
+diff --git a/xml/pnf_phy_1_A.xml b/xml/pnf_phy_1_A.xml
+index da6cc26..45f8f46 100644
+--- a/xml/pnf_phy_1_A.xml
++++ b/xml/pnf_phy_1_A.xml
+@@ -26,7 +26,7 @@
+ 		<phy>
+ 			<index>88</index>
+ 			<port>2500</port>
+-			<address>127.0.0.1</address>
++			<address>192.168.1.74</address>
+ 
+ 			<duplex_mode>1</duplex_mode>
+ 
+@@ -54,9 +54,9 @@
+ 
+ 			<data>
+ 				<udp>
+-					<rx_port>7722</rx_port>
+-					<tx_addr>127.0.0.1</tx_addr>
+-					<tx_port>7733</tx_port>
++					<rx_port>5201</rx_port>
++					<tx_addr>192.168.1.28</tx_addr>
++					<tx_port>5200</tx_port>
+ 				</udp>
+ 			</data>
+ 		</phy>
+diff --git a/xml/vnf_A.xml b/xml/vnf_A.xml
+index e609c93..3791239 100644
+--- a/xml/vnf_A.xml
++++ b/xml/vnf_A.xml
+@@ -2,8 +2,8 @@
+ <vnf>
+ 	<vnf_p7_list>
+ 		<vnf_p7>
+-			<port>5200</port>
+-			<address>127.0.0.1</address>
++			<port>5201</port>
++			<address>192.168.1.28</address>
+ 			<timing_window>10</timing_window>
+ 			<periodic_timing_enabled>0</periodic_timing_enabled>
+ 			<periodic_timing_window>0</periodic_timing_window>
+@@ -12,7 +12,7 @@
+ 			<data>
+ 				<udp>
+ 					<rx_port>8891</rx_port>
+-					<tx_addr>127.0.0.1</tx_addr>
++					<tx_addr>192.168.1.28</tx_addr>
+ 					<tx_port>8892</tx_port>
+ 				</udp>
+ 			</data>
diff --git a/open-nfapi.oai.patch b/open-nfapi.oai.patch
deleted file mode 100644
index 95aeb2e64a40eb403a1f4df3c4b60cbcc056596c..0000000000000000000000000000000000000000
--- a/open-nfapi.oai.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-diff --git a/nfapi/public_inc/nfapi_interface.h b/nfapi/public_inc/nfapi_interface.h
-index 2d58c2a..45af99a 100644
---- a/nfapi/public_inc/nfapi_interface.h
-+++ b/nfapi/public_inc/nfapi_interface.h
-@@ -34,7 +34,7 @@
- #define NFAPI_MAX_NUM_ANTENNAS 8
- #define NFAPI_MAX_NUM_SUBBANDS 13
- #define NFAPI_MAX_BF_VECTORS 8
--#define NFAPI_MAX_CC 1
-+#define NFAPI_MAX_CC 2
- #define NFAPI_MAX_NUM_PHYSICAL_ANTENNAS 8
- #define NFAPI_MAX_RSSI 8
- #define NFAPI_MAX_PSC_LIST 32
-@@ -1689,7 +1689,7 @@ typedef struct {
- 	uint16_t number_pdu;
- 	uint8_t number_pdsch_rnti;
- 	uint16_t transmission_power_pcfich;
--	nfapi_dl_config_request_pdu_t* dl_config_pdu_list;
-+        nfapi_dl_config_request_pdu_t* dl_config_pdu_list;
- } nfapi_dl_config_request_body_t;
- #define NFAPI_DL_CONFIG_REQUEST_BODY_TAG 0x2000
- 
-@@ -1772,7 +1772,7 @@ typedef struct {
- 	uint8_t number_of_cc;
- 	struct {
- 		uint8_t ri_size;
--		uint8_t dl_cqi_pmi_size;
-+		uint8_t dl_cqi_pmi_size[8];
- 	} cc[NFAPI_MAX_CC];
- } nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t;
- 
-@@ -1962,7 +1962,7 @@ typedef struct {
- } nfapi_ul_config_harq_information_rel8_fdd_t;
- #define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG 0x2019
- 
--typedef struct { 
-+typedef struct {  
- 	nfapi_tl_t tl;
- 	uint8_t harq_size;
- 	uint8_t ack_nack_mode;
diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
index 283667134da8b0f134af7971e835079dcba2931e..93ea87e4c05f9439cc61e813609d82dd100de8df 100644
--- a/openair1/PHY/INIT/lte_init.c
+++ b/openair1/PHY/INIT/lte_init.c
@@ -32,6 +32,9 @@
 #include "assertions.h"
 #include <math.h>
 
+extern uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn);
+extern int32_t get_uldl_offset(int eutra_bandP);
+
 extern uint16_t prach_root_sequence_map0_3[838];
 extern uint16_t prach_root_sequence_map4[138];
 uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10};
@@ -42,24 +45,41 @@ int N_RB_DL_array[6] = {6,15,25,50,75,100};
 int l1_north_init_eNB() {
 
   int i,j;
-  AssertFatal(RC.nb_L1_inst>0,"nb_L1_inst=%d\n",RC.nb_L1_inst);
-  AssertFatal(RC.nb_L1_CC!=NULL,"nb_L1_CC is null\n");
-  AssertFatal(RC.eNB!=NULL,"RC.eNB is null\n");
-  for (i=0;i<RC.nb_L1_inst;i++) {
-    AssertFatal(RC.eNB[i]!=NULL,"RC.eNB[%d] is null\n",i);
-    AssertFatal(RC.nb_L1_CC[i]>0,"RC.nb_L1_CC[%d]=%d\n",i,RC.nb_L1_CC[i]);
-    for (j=0;j<RC.nb_L1_CC[i];j++) {
-      AssertFatal(RC.eNB[i][j]!=NULL,"RC.eNB[%d][%d] is null\n",i,j);
-      if ((RC.eNB[i][j]->if_inst =  IF_Module_init(i))<0) return(-1); 
-      RC.eNB[i][j]->if_inst->PHY_config_req = phy_config_request;
-      RC.eNB[i][j]->if_inst->schedule_response = schedule_response;
+
+  if (RC.nb_L1_inst > 0 && RC.nb_L1_CC != NULL && RC.eNB != NULL)
+  {
+    AssertFatal(RC.nb_L1_inst>0,"nb_L1_inst=%d\n",RC.nb_L1_inst);
+    AssertFatal(RC.nb_L1_CC!=NULL,"nb_L1_CC is null\n");
+    AssertFatal(RC.eNB!=NULL,"RC.eNB is null\n");
+
+    LOG_I(PHY,"%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst);
+
+    for (i=0;i<RC.nb_L1_inst;i++) {
+      AssertFatal(RC.eNB[i]!=NULL,"RC.eNB[%d] is null\n",i);
+      AssertFatal(RC.nb_L1_CC[i]>0,"RC.nb_L1_CC[%d]=%d\n",i,RC.nb_L1_CC[i]);
+
+      LOG_I(PHY,"%s() RC.nb_L1_CC[%d]:%d\n", __FUNCTION__, i,  RC.nb_L1_CC[i]);
+
+      for (j=0;j<RC.nb_L1_CC[i];j++) {
+        AssertFatal(RC.eNB[i][j]!=NULL,"RC.eNB[%d][%d] is null\n",i,j);
+
+        if ((RC.eNB[i][j]->if_inst =  IF_Module_init(i))<0) return(-1); 
+
+        LOG_I(PHY,"%s() RC.eNB[%d][%d] installing callbacks\n", __FUNCTION__, i,  j);
+
+        RC.eNB[i][j]->if_inst->PHY_config_req = phy_config_request;
+        RC.eNB[i][j]->if_inst->schedule_response = schedule_response;
+      }
     }
   }
+  else
+  {
+    LOG_I(PHY,"%s() Not installing PHY callbacks - RC.nb_L1_inst:%d RC.nb_L1_CC:%p RC.eNB:%p\n", __FUNCTION__, RC.nb_L1_inst, RC.nb_L1_CC, RC.eNB);
+  }
   return(0);
 }
 
 
-
 void phy_config_request(PHY_Config_t *phy_config) {
 
   uint8_t Mod_id              = phy_config->Mod_id;
@@ -71,13 +91,14 @@ void phy_config_request(PHY_Config_t *phy_config) {
   PHICH_RESOURCE_t phich_resource_table[4]={oneSixth,half,one,two};
   int                 eutra_band     = cfg->nfapi_config.rf_bands.rf_band[0];  
   int                 dl_Bandwidth   = cfg->rf_config.dl_channel_bandwidth.value;
+  int                 ul_Bandwidth   = cfg->rf_config.ul_channel_bandwidth.value;
   int                 Nid_cell       = cfg->sch_config.physical_cell_id.value;
   int                 Ncp            = cfg->subframe_config.dl_cyclic_prefix_type.value;
   int                 p_eNB          = cfg->rf_config.tx_antenna_ports.value;
   uint32_t            dl_CarrierFreq = cfg->nfapi_config.earfcn.value;
 
-  LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d,Nid_cell %d,p %d,Ncp %d,DL freq %u,phich_config.resource %d, phich_config.duration %d)\n",
-	Mod_id, CC_id, eutra_band, N_RB_DL_array[dl_Bandwidth], Nid_cell, p_eNB,Ncp,dl_CarrierFreq,
+  LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d, N_RB_UL %d, Nid_cell %d,eNB_tx_antenna_ports %d,Ncp %d,DL freq %u,phich_config.resource %d, phich_config.duration %d)\n",
+	Mod_id, CC_id, eutra_band, dl_Bandwidth, ul_Bandwidth, Nid_cell, p_eNB,Ncp,dl_CarrierFreq,
 	cfg->phich_config.phich_resource.value,
 	cfg->phich_config.phich_duration.value);
 
@@ -86,13 +107,18 @@ void phy_config_request(PHY_Config_t *phy_config) {
   AssertFatal(RC.eNB[Mod_id][CC_id] != NULL, "PHY instance %d, CCid %d doesn't exist\n",Mod_id,CC_id);
 
 
+  if (RC.eNB[Mod_id][CC_id]->configured == 1)
+  {
+    LOG_E(PHY,"Already eNB already configured, do nothing\n");
+    return;
+  }
 
   RC.eNB[Mod_id][CC_id]->mac_enabled     = 1;
 
   fp = &RC.eNB[Mod_id][CC_id]->frame_parms;
 
-  fp->N_RB_DL                            = N_RB_DL_array[dl_Bandwidth];
-  fp->N_RB_UL                            = N_RB_DL_array[dl_Bandwidth];
+  fp->N_RB_DL                            = dl_Bandwidth;
+  fp->N_RB_UL                            = ul_Bandwidth;
   fp->Nid_cell                           = Nid_cell;
   fp->nushift                            = fp->Nid_cell%6;
   fp->eutra_band                         = eutra_band;
@@ -154,93 +180,95 @@ void phy_config_request(PHY_Config_t *phy_config) {
                     RC.eNB[Mod_id][CC_id]->X_u);
 
 #ifdef Rel14
-  if (cfg->emtc_config.prach_ce_level_0_enable.value == 1) {
-    fp->prach_emtc_config_common.prach_Config_enabled=1;
-
-    fp->prach_emtc_config_common.rootSequenceIndex                                         = cfg->emtc_config.prach_catm_root_sequence_index.value;
-
-    fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag                            = cfg->emtc_config.prach_catm_high_speed_flag.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig                = cfg->emtc_config.prach_catm_zero_correlation_zone_configuration.value;
-
-    // CE Level 3 parameters
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3]                  = cfg->emtc_config.prach_ce_level_3_enable.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3]   = cfg->emtc_config.prach_ce_level_3_starting_subframe_periodicity.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3] = cfg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.value;
-    AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3],
-		"prach_starting_subframe_periodicity[3] < prach_numPetitionPerPreambleAttempt[3]\n");
-
-
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3]                     = cfg->emtc_config.prach_ce_level_3_configuration_index.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[3]                      = cfg->emtc_config.prach_ce_level_3_frequency_offset.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[3]                  = cfg->emtc_config.prach_ce_level_3_hopping_enable.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[3]                  = cfg->emtc_config.prach_ce_level_3_hopping_offset.value;
-    if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] == 1)
-      compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
-			fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
-			fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
-			fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
-			fp->frame_type,
-			RC.eNB[Mod_id][CC_id]->X_u_br[3]);
-
-    // CE Level 2 parameters
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2]                  = cfg->emtc_config.prach_ce_level_2_enable.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2]   = cfg->emtc_config.prach_ce_level_2_starting_subframe_periodicity.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2] = cfg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.value;
-    AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2],
-		"prach_starting_subframe_periodicity[2] < prach_numPetitionPerPreambleAttempt[2]\n");
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[2]                     = cfg->emtc_config.prach_ce_level_2_configuration_index.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[2]                      = cfg->emtc_config.prach_ce_level_2_frequency_offset.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[2]                  = cfg->emtc_config.prach_ce_level_2_hopping_enable.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[2]                  = cfg->emtc_config.prach_ce_level_2_hopping_offset.value;
-    if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] == 1)
-      compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
-			fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
-			fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
-			fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
-			fp->frame_type,
-			RC.eNB[Mod_id][CC_id]->X_u_br[2]);
-
-    // CE Level 1 parameters
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1]                  = cfg->emtc_config.prach_ce_level_1_enable.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1]   = cfg->emtc_config.prach_ce_level_1_starting_subframe_periodicity.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1] = cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.value;
-    AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1],
-		"prach_starting_subframe_periodicity[1] < prach_numPetitionPerPreambleAttempt[1]\n");
-
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[1]                     = cfg->emtc_config.prach_ce_level_1_configuration_index.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[1]                      = cfg->emtc_config.prach_ce_level_1_frequency_offset.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[1]                  = cfg->emtc_config.prach_ce_level_1_hopping_enable.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[1]                  = cfg->emtc_config.prach_ce_level_1_hopping_offset.value;
-    if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] == 1)
-      compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
-			fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
-			fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
-			fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
-			fp->frame_type,
-			RC.eNB[Mod_id][CC_id]->X_u_br[1]);
+  fp->prach_emtc_config_common.prach_Config_enabled=1;
+
+  fp->prach_emtc_config_common.rootSequenceIndex                                         = cfg->emtc_config.prach_catm_root_sequence_index.value;
+
+  fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag                            = cfg->emtc_config.prach_catm_high_speed_flag.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig                = cfg->emtc_config.prach_catm_zero_correlation_zone_configuration.value;
+
+  // CE Level 3 parameters
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3]                  = cfg->emtc_config.prach_ce_level_3_enable.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3]   = cfg->emtc_config.prach_ce_level_3_starting_subframe_periodicity.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3] = cfg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.value;
+  AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3],
+	      "prach_starting_subframe_periodicity[3] < prach_numPetitionPerPreambleAttempt[3]\n");
+
+
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3]                     = cfg->emtc_config.prach_ce_level_3_configuration_index.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[3]                      = cfg->emtc_config.prach_ce_level_3_frequency_offset.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[3]                  = cfg->emtc_config.prach_ce_level_3_hopping_enable.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[3]                  = cfg->emtc_config.prach_ce_level_3_hopping_offset.value;
+  if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] == 1)
+    compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
+		      fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
+		      fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
+		      fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
+		      fp->frame_type,
+		      RC.eNB[Mod_id][CC_id]->X_u_br[3]);
+
+  // CE Level 2 parameters
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2]                  = cfg->emtc_config.prach_ce_level_2_enable.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2]   = cfg->emtc_config.prach_ce_level_2_starting_subframe_periodicity.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2] = cfg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.value;
+  AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2],
+	      "prach_starting_subframe_periodicity[2] < prach_numPetitionPerPreambleAttempt[2]\n");
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[2]                     = cfg->emtc_config.prach_ce_level_2_configuration_index.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[2]                      = cfg->emtc_config.prach_ce_level_2_frequency_offset.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[2]                  = cfg->emtc_config.prach_ce_level_2_hopping_enable.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[2]                  = cfg->emtc_config.prach_ce_level_2_hopping_offset.value;
+  if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] == 1)
+    compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
+		      fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
+		      fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
+		      fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
+		      fp->frame_type,
+		      RC.eNB[Mod_id][CC_id]->X_u_br[2]);
+
+  // CE Level 1 parameters
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1]                  = cfg->emtc_config.prach_ce_level_1_enable.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1]   = cfg->emtc_config.prach_ce_level_1_starting_subframe_periodicity.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1] = cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.value;
+  AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1],
+	      "prach_starting_subframe_periodicity[1] < prach_numPetitionPerPreambleAttempt[1]\n");
+
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[1]                     = cfg->emtc_config.prach_ce_level_1_configuration_index.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[1]                      = cfg->emtc_config.prach_ce_level_1_frequency_offset.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[1]                  = cfg->emtc_config.prach_ce_level_1_hopping_enable.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[1]                  = cfg->emtc_config.prach_ce_level_1_hopping_offset.value;
+  if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] == 1)
+    compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
+		      fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
+		      fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
+		      fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
+		      fp->frame_type,
+		      RC.eNB[Mod_id][CC_id]->X_u_br[1]);
   
-    // CE Level 0 parameters
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0]                  = cfg->emtc_config.prach_ce_level_0_enable.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0]   = cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value;
-    AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0],
-		"prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n",
-		fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0],
-		fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]);
-    AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0,
-		"prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n");
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0]                     = cfg->emtc_config.prach_ce_level_0_configuration_index.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0]                      = cfg->emtc_config.prach_ce_level_0_frequency_offset.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0]                = cfg->emtc_config.prach_ce_level_0_hopping_enable.value;
-    fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[0]                = cfg->emtc_config.prach_ce_level_0_hopping_offset.value;
-    if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1)
-      compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
-			fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
-			fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
-			fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
-			fp->frame_type,
-			RC.eNB[Mod_id][CC_id]->X_u_br[0]);
-  }
+  // CE Level 0 parameters
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0]                  = cfg->emtc_config.prach_ce_level_0_enable.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0]   = cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value;
+  AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0],
+	      "prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n",
+	      fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0],
+	      fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]);
+#if 0
+  AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0,
+	      "prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n");
+#else
+  LOG_E(PHY,"***DJP*** removed assert on preamble fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]:%d expecting >0 %s:%d\n\n\n", fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], __FILE__, __LINE__);
+#endif
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0]                     = cfg->emtc_config.prach_ce_level_0_configuration_index.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0]                      = cfg->emtc_config.prach_ce_level_0_frequency_offset.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0]                = cfg->emtc_config.prach_ce_level_0_hopping_enable.value;
+  fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[0]                = cfg->emtc_config.prach_ce_level_0_hopping_offset.value;
+  if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1)
+    compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
+		      fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
+		      fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
+		      fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
+		      fp->frame_type,
+		      RC.eNB[Mod_id][CC_id]->X_u_br[0]);
 #endif
 
 
@@ -267,9 +295,9 @@ void phy_config_request(PHY_Config_t *phy_config) {
   fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled     = 0;
   fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled  = 0;
   if (cfg->uplink_reference_signal_config.uplink_rs_hopping.value == 1) 
-    fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 1;
+      fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 1;
   if (cfg->uplink_reference_signal_config.uplink_rs_hopping.value == 2) 
-    fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 1;
+      fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 1;
   LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled);
   fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH   =  cfg->uplink_reference_signal_config.group_assignment.value;
   LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH);
@@ -316,14 +344,14 @@ void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
 }
 
 /*
-  void phy_config_sib2_eNB(uint8_t Mod_id,
-  int CC_id,
-  RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
-  ARFCN_ValueEUTRA_t *ul_CArrierFreq,
-  long *ul_Bandwidth,
-  AdditionalSpectrumEmission_t *additionalSpectrumEmission,
-  struct MBSFN_SubframeConfigList  *mbsfn_SubframeConfigList)
-  {
+void phy_config_sib2_eNB(uint8_t Mod_id,
+                         int CC_id,
+                         RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
+                         ARFCN_ValueEUTRA_t *ul_CArrierFreq,
+                         long *ul_Bandwidth,
+                         AdditionalSpectrumEmission_t *additionalSpectrumEmission,
+                         struct MBSFN_SubframeConfigList  *mbsfn_SubframeConfigList)
+{
 
   LTE_DL_FRAME_PARMS *fp = &RC.eNB[Mod_id][CC_id]->frame_parms;
   //LTE_eNB_UE_stats *eNB_UE_stats      = RC.eNB[Mod_id][CC_id].eNB_UE_stats;
@@ -350,7 +378,7 @@ void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
 
   init_prach_tables(839);
   compute_prach_seq(&fp->prach_config_common,fp->frame_type,
-  RC.eNB[Mod_id][CC_id]->X_u);
+                    RC.eNB[Mod_id][CC_id]->X_u);
 
   fp->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
   fp->pucch_config_common.nRB_CQI          = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI;
@@ -392,15 +420,15 @@ void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
   fp->soundingrs_ul_config_common.enabled_flag                        = 0;
 
   if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.present==SoundingRS_UL_ConfigCommon_PR_setup) {
-  fp->soundingrs_ul_config_common.enabled_flag                        = 1;
-  fp->soundingrs_ul_config_common.srs_BandwidthConfig                 = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
-  fp->soundingrs_ul_config_common.srs_SubframeConfig                  = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
-  fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
+    fp->soundingrs_ul_config_common.enabled_flag                        = 1;
+    fp->soundingrs_ul_config_common.srs_BandwidthConfig                 = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
+    fp->soundingrs_ul_config_common.srs_SubframeConfig                  = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
+    fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
 
-  if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts)
-  fp->soundingrs_ul_config_common.srs_MaxUpPts                      = 1;
-  else
-  fp->soundingrs_ul_config_common.srs_MaxUpPts                      = 0;
+    if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts)
+      fp->soundingrs_ul_config_common.srs_MaxUpPts                      = 1;
+    else
+      fp->soundingrs_ul_config_common.srs_MaxUpPts                      = 0;
   }
 
 
@@ -428,34 +456,34 @@ void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
 
   // MBSFN
   if (mbsfn_SubframeConfigList != NULL) {
-  fp->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
-
-  for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
-  fp->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
-  fp->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
-
-  if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
-  fp->MBSFN_config[i].fourFrames_flag = 0;
-  fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
-  LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is  %d\n", i,
-  fp->MBSFN_config[i].mbsfn_SubframeConfig);
-  } else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
-  fp->MBSFN_config[i].fourFrames_flag = 1;
-  fp->MBSFN_config[i].mbsfn_SubframeConfig =
-  mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]|
-  (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
-  (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
-
-  LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is  %d\n", i,
-  fp->MBSFN_config[i].mbsfn_SubframeConfig);
-  }
-  }
+    fp->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
+
+    for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
+      fp->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
+      fp->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
+
+      if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
+        fp->MBSFN_config[i].fourFrames_flag = 0;
+        fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
+        LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is  %d\n", i,
+              fp->MBSFN_config[i].mbsfn_SubframeConfig);
+      } else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
+        fp->MBSFN_config[i].fourFrames_flag = 1;
+        fp->MBSFN_config[i].mbsfn_SubframeConfig =
+          mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]|
+          (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
+          (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
+
+        LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is  %d\n", i,
+              fp->MBSFN_config[i].mbsfn_SubframeConfig);
+      }
+    }
 
   } else
-  fp->num_MBSFN_config = 0;
+    fp->num_MBSFN_config = 0;
 
   //
-  }
+}
 */
 
 void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
@@ -667,9 +695,9 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
         eNB->pusch_config_dedicated[UE_id].betaOffset_RI_Index = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index;
         eNB->pusch_config_dedicated[UE_id].betaOffset_CQI_Index = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index;
 
-        LOG_D(PHY,"pusch_config_dedicated.betaOffset_ACK_Index %d\n",eNB->pusch_config_dedicated[UE_id].betaOffset_ACK_Index);
-        LOG_D(PHY,"pusch_config_dedicated.betaOffset_RI_Index %d\n",eNB->pusch_config_dedicated[UE_id].betaOffset_RI_Index);
-        LOG_D(PHY,"pusch_config_dedicated.betaOffset_CQI_Index %d\n",eNB->pusch_config_dedicated[UE_id].betaOffset_CQI_Index);
+        LOG_E(PHY,"pusch_config_dedicated.betaOffset_ACK_Index %d\n",eNB->pusch_config_dedicated[UE_id].betaOffset_ACK_Index);
+        LOG_E(PHY,"pusch_config_dedicated.betaOffset_RI_Index %d\n",eNB->pusch_config_dedicated[UE_id].betaOffset_RI_Index);
+        LOG_E(PHY,"pusch_config_dedicated.betaOffset_CQI_Index %d\n",eNB->pusch_config_dedicated[UE_id].betaOffset_CQI_Index);
         LOG_D(PHY,"\n");
 
 
@@ -855,7 +883,7 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
     PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0]|(mobilityControlInfo->newUE_Identity.buf[1]<<8);
 
     LOG_I(PHY,"SET C-RNTI %x %x\n",PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[0][eNB_id]->crnti,
-	  PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti);
+                                   PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti);
   }
 
   if(ho_failed) {
@@ -884,67 +912,67 @@ void phy_config_meas_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n
 }
 
 /*
-  void phy_config_dedicated_eNB(uint8_t Mod_id,
-  int CC_id,
-  uint16_t rnti,
-  struct PhysicalConfigDedicated *physicalConfigDedicated)
-  {
+void phy_config_dedicated_eNB(uint8_t Mod_id,
+                              int CC_id,
+                              uint16_t rnti,
+                              struct PhysicalConfigDedicated *physicalConfigDedicated)
+{
 
   PHY_VARS_eNB *eNB = RC.eNB[Mod_id][CC_id];
   int8_t UE_id = find_ue(rnti,eNB);
   int i;
 
   if (UE_id == -1) {
-  LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n", Mod_id);
-  return;
+    LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n", Mod_id);
+    return;
   }
 
 
   if (physicalConfigDedicated) {
-  eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated;
-  LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated);
-
-  if (physicalConfigDedicated->antennaInfo) {
-  switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) {
-  case AntennaInfoDedicated__transmissionMode_tm1:
-  eNB->transmission_mode[UE_id] = 1;
-  break;
-  case AntennaInfoDedicated__transmissionMode_tm2:
-  eNB->transmission_mode[UE_id] = 2;
-  break;
-  case AntennaInfoDedicated__transmissionMode_tm3:
-  eNB->transmission_mode[UE_id] = 3;
-  break;
-  case AntennaInfoDedicated__transmissionMode_tm4:
-  eNB->transmission_mode[UE_id] = 4;
-  break;
-  case AntennaInfoDedicated__transmissionMode_tm5:
-  eNB->transmission_mode[UE_id] = 5;
-  break;
-  case AntennaInfoDedicated__transmissionMode_tm6:
-  eNB->transmission_mode[UE_id] = 6;
-  break;
-  case AntennaInfoDedicated__transmissionMode_tm7:
-  lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],eNB->frame_parms.Nid_cell,rnti);
-
-  for (i=0;i<eNB->num_RU;i++) eNB->RU_list[i]->do_precoding=1;
-  eNB->transmission_mode[UE_id] = 7;
-  break;
-  default:
-  LOG_E(PHY,"Unknown transmission mode!\n");
-  break;
-  }
-  LOG_I(PHY,"Transmission Mode (phy_config_dedicated_eNB) %d\n",eNB->transmission_mode[UE_id]);
+    eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated;
+    LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated);
 
+    if (physicalConfigDedicated->antennaInfo) {
+      switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) {
+      case AntennaInfoDedicated__transmissionMode_tm1:
+        eNB->transmission_mode[UE_id] = 1;
+        break;
+      case AntennaInfoDedicated__transmissionMode_tm2:
+        eNB->transmission_mode[UE_id] = 2;
+        break;
+      case AntennaInfoDedicated__transmissionMode_tm3:
+        eNB->transmission_mode[UE_id] = 3;
+        break;
+      case AntennaInfoDedicated__transmissionMode_tm4:
+        eNB->transmission_mode[UE_id] = 4;
+        break;
+      case AntennaInfoDedicated__transmissionMode_tm5:
+        eNB->transmission_mode[UE_id] = 5;
+        break;
+      case AntennaInfoDedicated__transmissionMode_tm6:
+        eNB->transmission_mode[UE_id] = 6;
+        break;
+      case AntennaInfoDedicated__transmissionMode_tm7:
+        lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],eNB->frame_parms.Nid_cell,rnti);
+
+	for (i=0;i<eNB->num_RU;i++) eNB->RU_list[i]->do_precoding=1;
+	eNB->transmission_mode[UE_id] = 7;
+	break;
+      default:
+        LOG_E(PHY,"Unknown transmission mode!\n");
+        break;
+      }
+      LOG_I(PHY,"Transmission Mode (phy_config_dedicated_eNB) %d\n",eNB->transmission_mode[UE_id]);
+
+    } else {
+      LOG_D(PHY,"[eNB %d] : Received NULL radioResourceConfigDedicated->antennaInfo from eNB %d\n",Mod_id,UE_id);
+    }
   } else {
-  LOG_D(PHY,"[eNB %d] : Received NULL radioResourceConfigDedicated->antennaInfo from eNB %d\n",Mod_id,UE_id);
-  }
-  } else {
-  LOG_E(PHY,"[eNB %d] Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, UE_id);
-  return;
+    LOG_E(PHY,"[eNB %d] Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, UE_id);
+    return;
   }
 
-  }
+}
 */
 
 #if defined(Rel10) || defined(Rel14)
@@ -956,11 +984,11 @@ void phy_config_dedicated_scell_ue(uint8_t Mod_id,
 
 }
 /*
-  void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
-  uint16_t rnti,
-  SCellToAddMod_r10_t *sCellToAddMod_r10,
-  int CC_id)
-  {
+void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
+                                    uint16_t rnti,
+                                    SCellToAddMod_r10_t *sCellToAddMod_r10,
+                                    int CC_id)
+{
 
 
   uint8_t UE_id = find_ue(rnti,RC.eNB[Mod_id][0]);
@@ -971,37 +999,37 @@ void phy_config_dedicated_scell_ue(uint8_t Mod_id,
   uint32_t carrier_freq_local;
 
   if ((dl_CarrierFreq_r10>=36000) && (dl_CarrierFreq_r10<=36199)) {
-  carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1
-  LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,
-  //eNB->frame
-  0,
-  CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
+    carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1
+    LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,
+	  //eNB->frame
+	  0,
+	  CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
   } else if ((dl_CarrierFreq_r10>=6150) && (dl_CarrierFreq_r10<=6449)) {
-  carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1
-  // this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band
-  LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,
-  //eNB->frame
-  0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
+    carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1
+    // this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band
+    LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,
+          //eNB->frame
+          0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
   } else {
-  LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %ld of SCell %d for UE %d not supported\n",Mod_id,
-  //eNB->frame
-  0,dl_CarrierFreq_r10,CC_id,UE_id);
+    LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %ld of SCell %d for UE %d not supported\n",Mod_id,
+	  //eNB->frame
+	  0,dl_CarrierFreq_r10,CC_id,UE_id);
   }
 
   if (physicalConfigDedicatedSCell_r10) {
-  //#warning " eNB->physicalConfigDedicatedSCell_r10 does not exist in eNB"
-  //  eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10;
-  LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,
-  //eNB->frame
-  0,CC_id,UE_id);
+//#warning " eNB->physicalConfigDedicatedSCell_r10 does not exist in eNB"
+    //  eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10;
+    LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,
+	  //eNB->frame
+          0,CC_id,UE_id);
   } else {
-  LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated (CC_id %d, UE %d)\n",Mod_id, 
-  //eNB->frame
-  0,CC_id,UE_id);
-  return;
+    LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated (CC_id %d, UE %d)\n",Mod_id, 
+	  //eNB->frame
+	  0,CC_id,UE_id);
+    return;
   }
 
-  }
+}
 */
 
 #endif
@@ -1178,7 +1206,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
       }
       if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) {
         if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_setup) {
-	  // configure PUCCH CQI reporting
+        // configure PUCCH CQI reporting
           phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PUCCH_ResourceIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
           phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex     = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex;
           if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
@@ -1221,12 +1249,12 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
   }
   //phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
   if(phy_vars_ue->pdcch_vars[0][eNB_id]->crnti == 0x1234)
-    phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti;
+      phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti;
   else
-    phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
+      phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
 
   LOG_I(PHY,"C-RNTI %x %x \n", phy_vars_ue->pdcch_vars[0][eNB_id]->crnti,
-	phy_vars_ue->pdcch_vars[1][eNB_id]->crnti);
+                               phy_vars_ue->pdcch_vars[1][eNB_id]->crnti);
 
 }
 
@@ -1690,7 +1718,7 @@ int phy_init_RU(RU_t *ru) {
       ru->common.txdata[i]  = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
 
       LOG_I(PHY,"[INIT] common.txdata[%d] = %p (%lu bytes)\n",i,ru->common.txdata[i],
-	    fp->samples_per_tti*10*sizeof(int32_t));
+	     fp->samples_per_tti*10*sizeof(int32_t));
 
     }
     for (i=0;i<ru->nb_rx;i++) {
@@ -1748,9 +1776,13 @@ int phy_init_RU(RU_t *ru) {
     AssertFatal(RC.nb_L1_inst <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n",
 		RC.nb_L1_inst,NUMBER_OF_eNB_MAX);
 
+    LOG_E(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst);
+
     for (i=0; i<RC.nb_L1_inst; i++) {
       for (p=0;p<15;p++) {
+        LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB);
 	if (p<ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB || p==5) {
+          LOG_D(PHY,"[INIT] %s() DO BEAM WEIGHTS nb_antenna_ports_eNB:%d nb_tx:%d\n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB, ru->nb_tx);
 	  ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
 	  for (j=0; j<ru->nb_tx; j++) {
 	    ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
@@ -1759,15 +1791,20 @@ int phy_init_RU(RU_t *ru) {
 	    // antenna ports 5-14 are mapped on all antennas 
 	    if (((p<4) && (p==j)) || ((p==4) && (j==0))) {
 	      for (re=0; re<fp->ofdm_symbol_size; re++) 
+              {
 		ru->beam_weights[i][p][j][re] = 0x00007fff; 
+
+                //LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d][%d][%d] = %d\n", i,p,j,re,ru->beam_weights[i][p][j][re]);
+              }
 	    }
 	    else if (p>4) {
 	      for (re=0; re<fp->ofdm_symbol_size; re++) 
+              {
 		ru->beam_weights[i][p][j][re] = 0x00007fff/ru->nb_tx; 
+                //LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d][%d][%d] = %d\n", i,p,j,re,ru->beam_weights[i][p][j][re]);
+              }
 	    }  
-	    LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d] = %p (%lu bytes)\n",
-		  i,j,ru->beam_weights[i][p][j],
-		  fp->ofdm_symbol_size*sizeof(int32_t)); 
+	    //LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d] = %p (%lu bytes)\n", i,j,ru->beam_weights[i][p][j], fp->ofdm_symbol_size*sizeof(int32_t)); 
 	  }
 	}
       }
@@ -1794,6 +1831,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
 #endif
   int i, UE_id; 
 
+  LOG_I(PHY,"[eNB %d] %s() About to wait for eNB to be configured", eNB->Mod_id, __FUNCTION__);
 
   eNB->total_dlsch_bitrate = 0;
   eNB->total_transmitted_bits = 0;
@@ -1802,10 +1840,18 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
  
   while(eNB->configured == 0) usleep(10000);
 
-  LOG_I(PHY,"[eNB %"PRIu8"] Initializing DL_FRAME_PARMS : N_RB_DL %"PRIu8", PHICH Resource %d, PHICH Duration %d\n",
+  LOG_I(PHY,"[eNB %"PRIu8"] Initializing DL_FRAME_PARMS : N_RB_DL %"PRIu8", PHICH Resource %d, PHICH Duration %d nb_antennas_tx:%u nb_antennas_rx:%u nb_antenna_ports_eNB:%u PRACH[rootSequenceIndex:%u prach_Config_enabled:%u configIndex:%u highSpeed:%u zeroCorrelationZoneConfig:%u freqOffset:%u]\n",
         eNB->Mod_id,
         fp->N_RB_DL,fp->phich_config_common.phich_resource,
-        fp->phich_config_common.phich_duration);
+        fp->phich_config_common.phich_duration,
+        fp->nb_antennas_tx, fp->nb_antennas_rx, fp->nb_antenna_ports_eNB,
+        fp->prach_config_common.rootSequenceIndex,
+        fp->prach_config_common.prach_Config_enabled,
+        fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
+        fp->prach_config_common.prach_ConfigInfo.highSpeedFlag,
+        fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
+        fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset
+        );
   LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02"PRIu8"][]\n", eNB->Mod_id);
 
 
@@ -1832,6 +1878,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
   common_vars->txdataF = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*));
   common_vars->rxdataF = (int32_t **)malloc16(64*sizeof(int32_t*));
   
+  LOG_D(PHY,"[INIT] NB_ANTENNA_PORTS_ENB:%d fp->nb_antenna_ports_eNB:%d\n", NB_ANTENNA_PORTS_ENB, fp->nb_antenna_ports_eNB);
+
   for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
     if (i<fp->nb_antenna_ports_eNB || i==5) {
       common_vars->txdataF[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
@@ -1886,12 +1934,12 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
 #endif
   
   /* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) 
-     AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]),
-     "nb_antennas_rx too large");
-     for (i=0; i<fp->nb_antennas_rx; i++) {
-     prach_vars->rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) );
-     LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]);
-     }*/
+  AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]),
+              "nb_antennas_rx too large");
+  for (i=0; i<fp->nb_antennas_rx; i++) {
+    prach_vars->rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) );
+    LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]);
+    }*/
   
   for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
     
@@ -1919,7 +1967,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
       pusch_vars[UE_id]->rxdataF_comp[i]     = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
       pusch_vars[UE_id]->ul_ch_mag[i]  = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
       pusch_vars[UE_id]->ul_ch_magb[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
-    }
+      }
     
     pusch_vars[UE_id]->llr = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
   } //UE_id
@@ -1934,3 +1982,9 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
   return (0);
 
 }
+
+void install_schedule_handlers(IF_Module_t *if_inst)
+{
+  if_inst->PHY_config_req = phy_config_request;
+  if_inst->schedule_response = schedule_response;
+}
diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c
index fae107776327cc45e4960db941ac274225003aeb..39e61c601d16bcbcf38c8b611d76c562ee58fd6a 100755
--- a/openair1/PHY/LTE_TRANSPORT/dci.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci.c
@@ -41,6 +41,7 @@
 #include "assertions.h" 
 #include "T.h"
 #include "UTIL/LOG/log.h"
+#include "UTIL/LOG/vcd_signal_dumper.h"
 
 //#define DEBUG_DCI_ENCODING 1
 //#define DEBUG_DCI_DECODING 1
@@ -2063,6 +2064,8 @@ void pdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
   uint8_t reset;
   uint32_t x1, x2, s=0;
 
+  //LOG_D(PHY, "%s(fp, subframe:%d, e, length:%d)\n", __FUNCTION__, subframe, length);
+
   reset = 1;
   // x1 is set in lte_gold_generic
 
@@ -2245,11 +2248,13 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
   }
 
 
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PCFICH,1);
   generate_pcfich(num_pdcch_symbols,
                   amp,
                   frame_parms,
                   txdataF,
                   subframe);
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PCFICH,0);
   wbar[0] = &wbar0[0];
   wbar[1] = &wbar1[0];
   y[0] = &yseq0[0];
@@ -2270,6 +2275,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
 
   e_ptr = e;
 
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DCI0,1);
 
   // generate DCIs in order of decreasing aggregation level, then common/ue spec
   // MAC is assumed to have ordered the UE spec DCI according to the RNTI-based randomization
@@ -2296,18 +2302,26 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
       }
     }
   }
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DCI0,0);
 
   // Scrambling
-  //  printf("pdcch scrambling\n");
+#ifdef DEBUG_DCI_ENCODING
+  printf("pdcch scrambling\n");
+#endif
+  //LOG_D(PHY, "num_pdcch_symbols:%d mi:%d nquad:%d\n", num_pdcch_symbols, mi, get_nquad(num_pdcch_symbols, frame_parms, mi));
+
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,1);
   pdcch_scrambling(frame_parms,
                    subframe,
                    e,
                    8*get_nquad(num_pdcch_symbols, frame_parms, mi));
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,0);
   //72*get_nCCE(num_pdcch_symbols,frame_parms,mi));
 
 
 
 
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_MODULATION,1);
   // Now do modulation
   if (frame_parms->nb_antenna_ports_eNB==1)
     gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15)>>15);
@@ -2320,6 +2334,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
   printf(" PDCCH Modulation, Msymb %d, Msymb2 %d,gain_lin_QPSK %d\n",Msymb,Msymb2,gain_lin_QPSK);
 #endif
 
+  //LOG_D(PHY,"%s() Msymb2:%d\n", __FUNCTION__, Msymb2);
 
   if (frame_parms->nb_antenna_ports_eNB==1) { //SISO
 
@@ -2366,22 +2381,38 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
 
     }
   }
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_MODULATION,0);
 
 
 #ifdef DEBUG_DCI_ENCODING
   printf(" PDCCH Interleaving\n");
 #endif
 
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_INTERLEAVING,1);
   //  printf("y %p (%p,%p), wbar %p (%p,%p)\n",y,y[0],y[1],wbar,wbar[0],wbar[1]);
   // This is the interleaving procedure defined in 36-211, first part of Section 6.8.5
   pdcch_interleaving(frame_parms,&y[0],&wbar[0],num_pdcch_symbols,mi);
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_INTERLEAVING,0);
 
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,1);
   mprime=0;
   nsymb = (frame_parms->Ncp==0) ? 14:12;
   re_offset = frame_parms->first_carrier_offset;
 
   // This is the REG allocation algorithm from 36-211, second part of Section 6.8.5
   //  printf("DCI (SF %d) : txdataF %p (0 %p)\n",subframe,&txdataF[0][512*14*subframe],&txdataF[0][0]);
+#ifdef DEBUG_DCI_ENCODING
+  printf("kprime loop - N_RB_DL:%d lprime:num_pdcch_symbols:%d Ncp:%d pcfich:%02x,%02x,%02x,%02x ofdm_symbol_size:%d first_carrier_offset:%d nb_antenna_ports_eNB:%d\n",
+  frame_parms->N_RB_DL, num_pdcch_symbols,frame_parms->Ncp,
+  frame_parms->pcfich_reg[0],
+  frame_parms->pcfich_reg[1],
+  frame_parms->pcfich_reg[2],
+  frame_parms->pcfich_reg[3],
+  frame_parms->ofdm_symbol_size,
+  frame_parms->first_carrier_offset,
+  frame_parms->nb_antenna_ports_eNB
+  );
+#endif
   for (kprime=0; kprime<frame_parms->N_RB_DL*12; kprime++) {
     for (lprime=0; lprime<num_pdcch_symbols; lprime++) {
 
@@ -2498,6 +2529,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
     if (re_offset == (frame_parms->ofdm_symbol_size))
       re_offset = 1;
   } // kprime loop
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,0);
 
   return(num_pdcch_symbols);
 }
diff --git a/openair1/PHY/LTE_TRANSPORT/dci.h b/openair1/PHY/LTE_TRANSPORT/dci.h
index 0e74324b2c8673b86e3ccb32225ac5ee7f483e2d..9381dd63fdd1a3d49b50e6ce4b27793c1a1074c1 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci.h
+++ b/openair1/PHY/LTE_TRANSPORT/dci.h
@@ -482,8 +482,8 @@ typedef struct DCI1A_20MHz_FDD DCI1A_20MHz_FDD_t;
 
 /// DCI Format Type 1 (1.5 MHz, TDD, 23 bits)
 struct DCI1_1_5MHz_TDD {
-  /// Dummy bits to align to 32-bits
-  uint32_t dummy:9;
+  /// padding bits to align to 32-bits
+  uint32_t padding:9;
   /// DAI (TDD)
   uint32_t dai:2;
   /// Power Control
@@ -507,8 +507,8 @@ typedef struct DCI1_1_5MHz_TDD DCI1_1_5MHz_TDD_t;
 
 /// DCI Format Type 1 (5 MHz, TDD, 30 bits)
 struct DCI1_5MHz_TDD {
-  /// Dummy bits to align to 32-bits
-  uint32_t dummy:2;
+  /// padding bits to align to 32-bits
+  uint32_t padding:2;
   /// DAI (TDD)
   uint32_t dai:2;
   /// Power Control
@@ -532,8 +532,8 @@ typedef struct DCI1_5MHz_TDD DCI1_5MHz_TDD_t;
 
 /// DCI Format Type 1 (10 MHz, TDD, 34 bits)
 struct DCI1_10MHz_TDD {
-  /// Dummy bits to align to 64-bits
-  uint64_t dummy:30;
+  /// padding bits to align to 64-bits
+  uint64_t padding:30;
   /// DAI (TDD)
   uint64_t dai:2;
   /// Power Control
@@ -557,8 +557,8 @@ typedef struct DCI1_10MHz_TDD DCI1_10MHz_TDD_t;
 
 /// DCI Format Type 1 (20 MHz, TDD, 42 bits)
 struct DCI1_20MHz_TDD {
-  /// Dummy bits to align to 64-bits
-  uint64_t dummy:22;
+  /// padding bits to align to 64-bits
+  uint64_t padding:22;
   /// DAI (TDD)
   uint64_t dai:2;
   /// Power Control
@@ -582,8 +582,8 @@ typedef struct DCI1_20MHz_TDD DCI1_20MHz_TDD_t;
 
 /// DCI Format Type 1 (1.5 MHz, FDD, 21 bits)
 struct DCI1_1_5MHz_FDD {
-  /// Dummy bits to align to 32-bits
-  uint32_t dummy:11;
+  /// padding bits to align to 32-bits
+  uint32_t padding:11;
   /// Power Control
   uint32_t TPC:2;
   /// Redundancy version
@@ -605,8 +605,8 @@ typedef struct DCI1_1_5MHz_FDD DCI1_1_5MHz_FDD_t;
 
 /// DCI Format Type 1 (5 MHz, FDD, 27 bits)
 struct DCI1_5MHz_FDD {
-  /// dummy bits (not transmitted)
-  uint32_t dummy:5;
+  /// padding its (not transmitted)
+  uint32_t padding:5;
   /// Power Control
   uint32_t TPC:2;
   /// Redundancy version
@@ -628,8 +628,8 @@ typedef struct DCI1_5MHz_FDD DCI1_5MHz_FDD_t;
 
 /// DCI Format Type 1 (10 MHz, FDD, 31 bits)
 struct DCI1_10MHz_FDD {
-  /// dummy bits (not transmitted)
-  uint32_t dummy:1;
+  /// padding bits (not transmitted)
+  uint32_t padding:1;
   /// Power Control
   uint32_t TPC:2;
   /// Redundancy version
@@ -651,8 +651,8 @@ typedef struct DCI1_10MHz_FDD DCI1_10MHz_FDD_t;
 
 /// DCI Format Type 1 (20 MHz, FDD, 39 bits)
 struct DCI1_20MHz_FDD {
-  /// dummy bits (not transmitted)
-  uint64_t dummy:25;
+  /// padding bits (not transmitted)
+  uint64_t padding:25;
   /// Power Control
   uint64_t TPC:2;
   /// Redundancy version
@@ -674,10 +674,8 @@ typedef struct DCI1_20MHz_FDD DCI1_20MHz_FDD_t;
 
 /// DCI Format Type 1A (5 MHz, TDD, frame 1-6, 27 bits)
 struct DCI1A_RA_5MHz_TDD_1_6 {
-  /// Dummy bits to align to 32-bits
-  uint32_t dummy:5;
-  /// Padding
-  uint32_t padding:6;
+  /// padding bits to align to 32-bits
+  uint32_t padding:11;
   /// PRACH mask index
   uint32_t prach_mask_index:4;
   /// Preamble Index
@@ -822,7 +820,7 @@ typedef struct DCI1B_5MHz_4A_TDD DCI1B_5MHz_4A_TDD_t;
 struct DCI1C_1_5MHz
 {
   /// padding to 32bits
-  uint32_t padding32:24;
+  uint32_t padding:24;
   uint32_t mcs:5;
   uint32_t rballoc:3;  // N_RB_step = 2, Ngap=Ngap1=3, NDLVRBGap = 6, ceil(log2((3*4)/2)) = 3
 } __attribute__ ((__packed__));
@@ -836,7 +834,7 @@ typedef struct DCI1C_1_5MHz DCI1C_1_5MHz_t;
 struct DCI1C_5MHz
 {
   /// padding to 32bits
-  uint32_t padding32:20;
+  uint32_t padding:20;
   uint32_t mcs:5;
   uint32_t rballoc:7;   // N_RB_step = 2, Ngap1=Ngap2=12, NDLVRBGap = 24, ceil(log2((12*13)/2)) = 7
 } __attribute__ ((__packed__));
@@ -848,7 +846,7 @@ typedef struct DCI1C_5MHz DCI1C_5MHz_t;
 struct DCI1C_10MHz
 {
   /// padding to 32bits
-  uint32_t padding32:19;
+  uint32_t padding:19;
   uint32_t mcs:5;
   uint32_t rballoc:7;  // N_RB_step = 4, Ngap1=27, NDLVRBGap = 46, ceil(log2(((11*12)/2)) = 7
   uint32_t Ngap:1;
@@ -861,7 +859,7 @@ typedef struct DCI1C_10MHz DCI1C_10MHz_t;
 struct DCI1C_15MHz
 {
   /// padding to 32bits
-  uint32_t padding32:18;
+  uint32_t padding:18;
   uint32_t mcs:5;
   uint32_t rballoc:8; // N_RB_step = 4, Ngap1=64, ceil(log2((16*17)/2)) = 8
   uint32_t Ngap:1;
@@ -874,7 +872,7 @@ typedef struct DCI1C_15MHz DCI1C_15MHz_t;
 struct DCI1C_20MHz
 {
   /// padding to 32bits
-  uint32_t padding32:17;
+  uint32_t padding:17;
   uint32_t mcs:5;
   uint32_t rballoc:9; // N_RB_step = 4, Ngap1=48, ceil(log2((24*25)/2)) = 9
   uint32_t Ngap:1;
@@ -1006,7 +1004,7 @@ typedef struct DCI1D_5MHz_4A_TDD DCI1D_5MHz_4A_TDD_t;
 /// DCI Format Type 1E (5 MHz, TDD, 2 Antenna Ports, more than 10 PRBs, 34 bits)
 struct DCI1E_5MHz_2A_M10PRB_TDD {
   /// padding to 64bits
-  uint64_t padding64:30;
+  uint64_t padding:30;
   /// Redundancy version 2
   ///uint64_t rv2:2;
   /// New Data Indicator 2
@@ -1045,7 +1043,7 @@ typedef struct DCI1E_5MHz_2A_M10PRB_TDD DCI1E_5MHz_2A_M10PRB_TDD_t;
 /// DCI Format Type 2 (1.5 MHz, TDD, 2 Antenna Ports, 34 bits)
 struct DCI2_1_5MHz_2A_TDD {
   /// padding to 64bits
-  uint64_t padding64:30;
+  uint64_t padding:30;
   /// TPMI information for precoding
   uint64_t tpmi:3;
   /// Redundancy version 2
@@ -1078,7 +1076,7 @@ typedef struct DCI2_1_5MHz_2A_TDD DCI2_1_5MHz_2A_TDD_t;
 /// DCI Format Type 2 (1.5 MHz, TDD, 4 Antenna Ports, 37 bits)
 struct DCI2_1_5MHz_4A_TDD {
   /// padding for 64-bit
-  uint64_t padding64:27;
+  uint64_t padding:27;
   /// TPMI information for precoding
   uint64_t tpmi:6;
   /// Redundancy version 2
@@ -1111,7 +1109,7 @@ typedef struct DCI2_1_5MHz_4A_TDD DCI2_1_5MHz_4A_TDD_t;
 /// DCI Format Type 2 (5 MHz, TDD, 2 Antenna Ports, 42 bits)
 struct DCI2_5MHz_2A_TDD {
   /// padding to 64bits
-  uint64_t padding64:22;
+  uint64_t padding:22;
   /// TPMI information for precoding
   uint64_t tpmi:3;
   /// Redundancy version 2
@@ -1146,7 +1144,7 @@ typedef struct DCI2_5MHz_2A_TDD DCI2_5MHz_2A_TDD_t;
 /// DCI Format Type 2 (5 MHz, TDD, 4 Antenna Ports, 45 bits)
 struct DCI2_5MHz_4A_TDD {
   /// padding for 64-bit
-  uint64_t padding64:19;
+  uint64_t padding:19;
   /// TPMI information for precoding
   uint64_t tpmi:6;
   /// Redundancy version 2
@@ -1181,7 +1179,7 @@ typedef struct DCI2_5MHz_4A_TDD DCI2_5MHz_4A_TDD_t;
 /// DCI Format Type 2 (10 MHz, TDD, 2 Antenna Ports, 46 bits)
 struct DCI2_10MHz_2A_TDD {
   /// padding to 64bits
-  uint64_t padding64:18;
+  uint64_t padding:18;
   /// TPMI information for precoding
   uint64_t tpmi:3;
   /// Redundancy version 2
@@ -1216,7 +1214,7 @@ typedef struct DCI2_10MHz_2A_TDD DCI2_10MHz_2A_TDD_t;
 /// DCI Format Type 2 (10 MHz, TDD, 4 Antenna Ports, 49 bits)
 struct DCI2_10MHz_4A_TDD {
   /// padding for 64-bit
-  uint64_t padding64:15;
+  uint64_t padding:15;
   /// TPMI information for precoding
   uint64_t tpmi:6;
   /// Redundancy version 2
@@ -1251,7 +1249,7 @@ typedef struct DCI2_10MHz_4A_TDD DCI2_10MHz_4A_TDD_t;
 /// DCI Format Type 2 (20 MHz, TDD, 2 Antenna Ports, 54 bits)
 struct DCI2_20MHz_2A_TDD {
   /// padding to 64bits
-  uint64_t padding64:10;
+  uint64_t padding:10;
   /// TPMI information for precoding
   uint64_t tpmi:3;
   /// Redundancy version 2
@@ -1286,7 +1284,7 @@ typedef struct DCI2_20MHz_2A_TDD DCI2_20MHz_2A_TDD_t;
 /// DCI Format Type 2 (20 MHz, TDD, 4 Antenna Ports, 57 bits)
 struct DCI2_20MHz_4A_TDD {
   /// padding for 64-bit
-  uint64_t padding64:7;
+  uint64_t padding:7;
   /// TPMI information for precoding
   uint64_t tpmi:6;
   /// Redundancy version 2
@@ -1321,7 +1319,7 @@ typedef struct DCI2_20MHz_4A_TDD DCI2_20MHz_4A_TDD_t;
 /// DCI Format Type 2 (1.5 MHz, FDD, 2 Antenna Ports, 31 bits)
 struct DCI2_1_5MHz_2A_FDD {
   //padding for 32 bits
-  uint32_t padding32:1;
+  uint32_t padding:1;
   /// precoding bits
   uint32_t tpmi:3;
   /// Redundancy version 2
@@ -1352,7 +1350,7 @@ typedef struct DCI2_1_5MHz_2A_FDD DCI2_1_5MHz_2A_FDD_t;
 /// DCI Format Type 2 (1.5 MHz, FDD, 4 Antenna Ports, 34 bits)
 struct DCI2_1_5MHz_4A_FDD {
   /// padding for 32 bits
-  uint64_t padding64:30;
+  uint64_t padding:30;
   /// precoding bits
   uint64_t tpmi:6;
   /// Redundancy version 2
@@ -1383,7 +1381,7 @@ typedef struct DCI2_1_5MHz_4A_FDD DCI2_1_5MHz_4A_FDD_t;
 /// DCI Format Type 2 (5 MHz, FDD, 2 Antenna Ports, 39 bits)
 struct DCI2_5MHz_2A_FDD {
   /// padding for 64-bit
-  uint64_t padding64:25;
+  uint64_t padding:25;
   /// TPMI information for precoding
   uint64_t tpmi:3;
   /// Redundancy version 2
@@ -1416,7 +1414,7 @@ typedef struct DCI2_5MHz_2A_FDD DCI2_5MHz_2A_FDD_t;
 /// DCI Format Type 2 (5 MHz, TDD, 4 Antenna Ports, 42 bits)
 struct DCI2_5MHz_4A_FDD {
   /// padding for 64-bit
-  uint64_t padding64:21;
+  uint64_t padding:21;
   /// TPMI information for precoding
   uint64_t tpmi:6;
   /// Redundancy version 2
@@ -1448,7 +1446,7 @@ typedef struct DCI2_5MHz_4A_FDD DCI2_5MHz_4A_FDD_t;
 /// DCI Format Type 2 (10 MHz, FDD, 2 Antenna Ports, 43 bits)
 struct DCI2_10MHz_2A_FDD {
   /// padding for 64-bit
-  uint64_t padding64:21;
+  uint64_t padding:21;
   /// TPMI information for precoding
   uint64_t tpmi:3;
   /// Redundancy version 2
@@ -1481,7 +1479,7 @@ typedef struct DCI2_10MHz_2A_FDD DCI2_10MHz_2A_FDD_t;
 /// DCI Format Type 2 (5 MHz, TDD, 4 Antenna Ports, 46 bits)
 struct DCI2_10MHz_4A_FDD {
   /// padding for 64-bit
-  uint64_t padding64:18;
+  uint64_t padding:18;
   /// TPMI information for precoding
   uint64_t tpmi:6;
   /// Redundancy version 2
@@ -1513,7 +1511,7 @@ typedef struct DCI2_10MHz_4A_FDD DCI2_10MHz_4A_FDD_t;
 /// DCI Format Type 2 (20 MHz, FDD, 2 Antenna Ports, 51 bits)
 struct DCI2_20MHz_2A_FDD {
   /// padding for 64-bit
-  uint64_t padding64:13;
+  uint64_t padding:13;
   /// TPMI information for precoding
   uint64_t tpmi:3;
   /// Redundancy version 2
@@ -1546,7 +1544,7 @@ typedef struct DCI2_20MHz_2A_FDD DCI2_20MHz_2A_FDD_t;
 /// DCI Format Type 2 (20 MHz, FDD, 4 Antenna Ports, 54 bits)
 struct DCI2_20MHz_4A_FDD {
   /// padding for 64-bit
-  uint64_t padding64:10;
+  uint64_t padding:10;
   /// TPMI information for precoding
   uint64_t tpmi:6;
   /// Redundancy version 2
@@ -2083,7 +2081,7 @@ typedef struct DCI2A_20MHz_4A_FDD DCI2A_20MHz_4A_FDD_t;
 // *******************************************************************
 /// DCI Format Type 2B (1.5 MHz, TDD,  33 bits)
 struct DCI2B_1_5MHz_TDD {
-  uint64_t padding64:31;
+  uint64_t padding:31;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2109,7 +2107,7 @@ struct DCI2B_1_5MHz_TDD {
   /// RB Assignment (ceil(log2(N_RB_DL/P)) bits)
   uint64_t rballoc:6;
   /// Padding for ambiguity
-  uint64_t padding:1;
+  uint64_t padding0:1;
 } __attribute__ ((__packed__));
 
 typedef struct DCI2B_1_5MHz_TDD DCI2B_1_5MHz_TDD_t;
@@ -2118,7 +2116,7 @@ typedef struct DCI2B_1_5MHz_TDD DCI2B_1_5MHz_TDD_t;
 /// DCI Format Type 2B (5 MHz, TDD,  39 bits)
 struct DCI2B_5MHz_TDD {
   /// padding to 64bits
-  uint64_t padding64:25;
+  uint64_t padding:25;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2153,7 +2151,7 @@ typedef struct DCI2B_5MHz_TDD DCI2B_5MHz_TDD_t;
 /// DCI Format Type 2B (10 MHz, TDD,  43 bits)
 struct DCI2B_10MHz_TDD {
   /// padding to 64bits
-  uint64_t padding64:21;
+  uint64_t padding:21;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2188,7 +2186,7 @@ typedef struct DCI2B_10MHz_TDD DCI2B_10MHz_TDD_t;
 /// DCI Format Type 2B (20 MHz, TDD,  51 bits)
 struct DCI2B_20MHz_TDD {
   /// padding to 64bits
-  uint64_t padding64:13;
+  uint64_t padding:13;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2223,7 +2221,7 @@ typedef struct DCI2B_20MHz_TDD DCI2B_20MHz_TDD_t;
 /// DCI Format Type 2B (1.5 MHz, FDD,  28 bits)
 struct DCI2B_1_5MHz_FDD {
   //padding for 32 bits
-  uint32_t padding32:4;
+  uint32_t padding:4;
   /// Redundancy version 2
   uint32_t rv2:2;
   /// New Data Indicator 2
@@ -2252,7 +2250,7 @@ typedef struct DCI2B_1_5MHz_FDD DCI2B_1_5MHz_FDD_t;
 /// DCI Format Type 2B (5 MHz, FDD,  36 bits)
 struct DCI2B_5MHz_FDD {
   /// padding for 64-bit
-  uint64_t padding64:28;
+  uint64_t padding:28;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2283,7 +2281,7 @@ typedef struct DCI2B_5MHz_FDD DCI2B_5MHz_FDD_t;
 /// DCI Format Type 2B (10 MHz, FDD,  41 bits)
 struct DCI2B_10MHz_FDD {
   /// padding for 64-bit
-  uint64_t padding64:23;
+  uint64_t padding:23;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2307,7 +2305,7 @@ struct DCI2B_10MHz_FDD {
   /// Resource Allocation Header
   uint64_t rah:1;
   /// Padding for ambiguity
-  uint64_t padding:1;
+  uint64_t padding0:1;
 } __attribute__ ((__packed__));
 
 #define sizeof_DCI2B_10MHz_FDD_t 41
@@ -2316,7 +2314,7 @@ typedef struct DCI2B_10MHz_FDD DCI2B_10MHz_FDD_t;
 /// DCI Format Type 2B (20 MHz, FDD,  48 bits)
 struct DCI2B_20MHz_FDD {
   /// padding for 64-bit
-  uint64_t padding64:16;
+  uint64_t padding:16;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2350,7 +2348,7 @@ typedef struct DCI2B_20MHz_FDD DCI2B_20MHz_FDD_t;
 
 /// DCI Format Type 2C (1.5 MHz, TDD,  34 bits)
 struct DCI2C_1_5MHz_TDD {
-  uint64_t padding64:30;
+  uint64_t padding:30;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2383,7 +2381,7 @@ typedef struct DCI2C_1_5MHz_TDD DCI2C_1_5MHz_TDD_t;
 /// DCI Format Type 2C (5 MHz, TDD,  41 bits)
 struct DCI2C_5MHz_TDD {
   /// padding to 64bits
-  uint64_t padding64:23;
+  uint64_t padding:23;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2418,7 +2416,7 @@ typedef struct DCI2C_5MHz_TDD DCI2C_5MHz_TDD_t;
 /// DCI Format Type 2C (10 MHz, TDD,  45 bits)
 struct DCI2C_10MHz_TDD {
   /// padding to 64bits
-  uint64_t padding64:19;
+  uint64_t padding:19;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2453,7 +2451,7 @@ typedef struct DCI2C_10MHz_TDD DCI2C_10MHz_TDD_t;
 /// DCI Format Type 2C (20 MHz, TDD,  53 bits)
 struct DCI2C_20MHz_TDD {
   /// padding to 64bits
-  uint64_t padding64:11;
+  uint64_t padding:11;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2488,7 +2486,7 @@ typedef struct DCI2C_20MHz_TDD DCI2C_20MHz_TDD_t;
 /// DCI Format Type 2C (1.5 MHz, FDD,  30 bits)
 struct DCI2C_1_5MHz_FDD {
   //padding for 32 bits
-  uint32_t padding32:2;
+  uint32_t padding:2;
   /// Redundancy version 2
   uint32_t rv2:2;
   /// New Data Indicator 2
@@ -2517,7 +2515,7 @@ typedef struct DCI2C_1_5MHz_FDD DCI2C_1_5MHz_FDD_t;
 /// DCI Format Type 2C (5 MHz, FDD,  38 bits)
 struct DCI2C_5MHz_FDD {
   /// padding for 64-bit
-  uint64_t padding64:26;
+  uint64_t padding:26;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2548,7 +2546,7 @@ typedef struct DCI2C_5MHz_FDD DCI2C_5MHz_FDD_t;
 /// DCI Format Type 2C (10 MHz, FDD,  42 bits)
 struct DCI2C_10MHz_FDD {
   /// padding for 64-bit
-  uint64_t padding64:22;
+  uint64_t padding:22;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2579,7 +2577,7 @@ typedef struct DCI2C_10MHz_FDD DCI2C_10MHz_FDD_t;
 /// DCI Format Type 2C (20 MHz, FDD,  50 bits)
 struct DCI2C_20MHz_FDD {
   /// padding for 64-bit
-  uint64_t padding64:14;
+  uint64_t padding:14;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
@@ -2613,7 +2611,7 @@ typedef struct DCI2C_20MHz_FDD DCI2C_20MHz_FDD_t;
 
 /// DCI Format Type 2D (1.5 MHz, TDD,  36 bits)
 struct DCI2D_1_5MHz_TDD {
-  uint64_t padding64:28;
+  uint64_t padding:28;
   /// PDSCH REsource Mapping and Quasi-Co-Location Indicator
   uint64_t REMQCL:2;
   /// Redundancy version 2
@@ -2648,7 +2646,7 @@ typedef struct DCI2D_1_5MHz_TDD DCI2D_1_5MHz_TDD_t;
 /// DCI Format Type 2D (5 MHz, TDD,  43 bits)
 struct DCI2D_5MHz_TDD {
   /// padding to 64bits
-  uint64_t padding64:21;
+  uint64_t padding:21;
   /// PDSCH REsource Mapping and Quasi-Co-Location Indicator
   uint64_t REMQCL:2;
   /// Redundancy version 2
@@ -2685,7 +2683,7 @@ typedef struct DCI2D_5MHz_TDD DCI2D_5MHz_TDD_t;
 /// DCI Format Type 2D (10 MHz, TDD,  47 bits)
 struct DCI2D_10MHz_TDD {
   /// padding to 64bits
-  uint64_t padding64:17;
+  uint64_t padding:17;
   /// PDSCH REsource Mapping and Quasi-Co-Location Indicator
   uint64_t REMQCL:2;
   /// Redundancy version 2
@@ -2722,7 +2720,7 @@ typedef struct DCI2D_10MHz_TDD DCI2D_10MHz_TDD_t;
 /// DCI Format Type 2D (20 MHz, TDD,  55 bits)
 struct DCI2D_20MHz_TDD {
   /// padding to 64bits
-  uint64_t padding64:9;
+  uint64_t padding:9;
   /// PDSCH REsource Mapping and Quasi-Co-Location Indicator
   uint64_t REMQCL:2;
   /// Redundancy version 2
@@ -2759,7 +2757,7 @@ typedef struct DCI2D_20MHz_TDD DCI2D_20MHz_TDD_t;
 /// DCI Format Type 2D (1.5 MHz, FDD,  33 bits)
 struct DCI2D_1_5MHz_FDD {
   //padding for 33 bits
-  uint64_t padding64:31;
+  uint64_t padding:31;
   /// PDSCH REsource Mapping and Quasi-Co-Location Indicator
   uint64_t REMQCL:2;
   /// Redundancy version 2
@@ -2783,7 +2781,7 @@ struct DCI2D_1_5MHz_FDD {
   /// RB Assignment (ceil(log2(N_RB_DL/P)) bits)
   uint64_t rballoc:6;
   /// padding for ambiguity
-  uint64_t padding;
+  uint64_t padding0;
 } __attribute__ ((__packed__));
 
 typedef struct DCI2D_1_5MHz_FDD DCI2D_1_5MHz_FDD_t;
@@ -2792,7 +2790,7 @@ typedef struct DCI2D_1_5MHz_FDD DCI2D_1_5MHz_FDD_t;
 /// DCI Format Type 2D (5 MHz, FDD,  41 bits)
 struct DCI2D_5MHz_FDD {
   /// padding for 64-bit
-  uint64_t padding64:23;
+  uint64_t padding:23;
   /// PDSCH REsource Mapping and Quasi-Co-Location Indicator
   uint64_t REMQCL:2;
   /// Redundancy version 2
@@ -2818,7 +2816,7 @@ struct DCI2D_5MHz_FDD {
   /// Resource Allocation Header
   uint64_t rah:1;
   /// padding for ambiguity
-  uint64_t padding:1;
+  uint64_t padding0:1;
 } __attribute__ ((__packed__));
 
 #define sizeof_DCI2D_5MHz_FDD_t 41
@@ -2827,7 +2825,7 @@ typedef struct DCI2D_5MHz_FDD DCI2D_5MHz_FDD_t;
 /// DCI Format Type 2D (10 MHz, FDD,  45 bits)
 struct DCI2D_10MHz_FDD {
   /// padding for 64-bit
-  uint64_t padding64:19;
+  uint64_t padding:19;
   /// PDSCH REsource Mapping and Quasi-Co-Location Indicator
   uint64_t REMQCL:2;
   /// Redundancy version 2
@@ -2853,7 +2851,7 @@ struct DCI2D_10MHz_FDD {
   /// Resource Allocation Header
   uint64_t rah:1;
   /// padding for ambiguity
-  uint64_t padding:1;
+  uint64_t padding0:1;
 } __attribute__ ((__packed__));
 
 #define sizeof_DCI2D_10MHz_FDD_t 45
@@ -2862,7 +2860,7 @@ typedef struct DCI2D_10MHz_FDD DCI2D_10MHz_FDD_t;
 /// DCI Format Type 2D (20 MHz, FDD,  52 bits)
 struct DCI2D_20MHz_FDD {
   /// padding for 64-bit
-  uint64_t padding64:12;
+  uint64_t padding:12;
   /// Redundancy version 2
   uint64_t rv2:2;
   /// New Data Indicator 2
diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c
index 97a9709df5842102d8e2834d78893a0ffb49db2b..36dae6431c6e69edd57661c824653cb6b22f1363 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c
@@ -810,8 +810,7 @@ int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
   for (i=0; i<NUMBER_OF_UE_MAX; i++) {
     AssertFatal(eNB->dlsch[i]!=NULL,"eNB->dlsch[%d] is null\n",i);
     AssertFatal(eNB->dlsch[i]!=NULL,"eNB->dlsch[%d][0] is null\n",i);
-    LOG_D(PHY,"searching for rnti %x : UE index %d=> harq_mask %x, rnti %x, first_free_index %d\n",
-          rnti,i,eNB->dlsch[i][0]->harq_mask,eNB->dlsch[i][0]->rnti,first_free_index);
+    LOG_D(PHY,"searching for rnti %x : UE index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,eNB->dlsch[i][0]->harq_mask,eNB->dlsch[i][0]->rnti,first_free_index);
     if ((eNB->dlsch[i][0]->harq_mask >0) &&
         (eNB->dlsch[i][0]->rnti==rnti))       return i;
     else if ((eNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
@@ -890,6 +889,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
       ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->TPC      = rel8->tpc;
       ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process;
       ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;
+      ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->padding  = 0;
     } else {
       dci_alloc->dci_length                         = sizeof_DCI1A_1_5MHz_FDD_t;
       ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->type         = 1;
@@ -900,6 +900,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
       ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->rv           = rel8->redundancy_version_1;
       ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->TPC          = rel8->tpc;
       ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->harq_pid     = rel8->harq_process;
+      ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->padding      = 0;
       //      printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
     }
     break;
@@ -914,7 +915,8 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
       ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->rv         = rel8->redundancy_version_1;
       ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->TPC        = rel8->tpc;
       ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid   = rel8->harq_process;
-      ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;
+      ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->dai        = rel8->downlink_assignment_index;
+      ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->padding    = 0;
        //        printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
     } else {
       dci_alloc->dci_length                         = sizeof_DCI1A_5MHz_FDD_t;
@@ -926,6 +928,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
       ((DCI1A_5MHz_FDD_t *)dci_pdu)->rv             = rel8->redundancy_version_1;
       ((DCI1A_5MHz_FDD_t *)dci_pdu)->TPC            = rel8->tpc;
       ((DCI1A_5MHz_FDD_t *)dci_pdu)->harq_pid       = rel8->harq_process;
+      ((DCI1A_5MHz_FDD_t *)dci_pdu)->padding        = 0;
       //      printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
     }
     break;
@@ -941,6 +944,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
       ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->TPC       = rel8->tpc;
       ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->harq_pid  = rel8->harq_process;
       ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;
+      ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->padding   = 0;
       //        printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
     } else {
       dci_alloc->dci_length                         = sizeof_DCI1A_10MHz_FDD_t;
@@ -952,6 +956,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
       ((DCI1A_10MHz_FDD_t *)dci_pdu)->rv            = rel8->redundancy_version_1;
       ((DCI1A_10MHz_FDD_t *)dci_pdu)->TPC           = rel8->tpc;
       ((DCI1A_10MHz_FDD_t *)dci_pdu)->harq_pid      = rel8->harq_process;
+      ((DCI1A_10MHz_FDD_t *)dci_pdu)->padding       = 0;
       //      printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
     }
     break;
@@ -967,6 +972,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
       ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->TPC       = rel8->tpc;
       ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->harq_pid  = rel8->harq_process;
       ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;
+      ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->padding   = 0;
       //        printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
     } else {
       dci_alloc->dci_length                         = sizeof_DCI1A_20MHz_FDD_t;
@@ -978,6 +984,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
       ((DCI1A_20MHz_FDD_t *)dci_pdu)->rv            = rel8->redundancy_version_1;
       ((DCI1A_20MHz_FDD_t *)dci_pdu)->TPC           = rel8->tpc;
       ((DCI1A_20MHz_FDD_t *)dci_pdu)->harq_pid      = rel8->harq_process;
+      ((DCI1A_20MHz_FDD_t *)dci_pdu)->padding       = 0;
       //      printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
     }
     break;
@@ -987,7 +994,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
         proc->frame_tx, proc->subframe_tx, rel8->rnti);
 }
 
-void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,nfapi_dl_config_dci_dl_pdu *pdu)
+void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,nfapi_dl_config_dci_dl_pdu *pdu)
 {
   LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
   uint8_t *dci_pdu = &dci_alloc->dci_pdu[0];
@@ -1011,7 +1018,6 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
   LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL;
   int beamforming_mode = 0;
   int UE_id=-1;
-  int subframe = proc->subframe_tx;
   int NPRB;
   int TB0_active;
   int TB1_active;
@@ -1024,8 +1030,8 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
   dci_alloc->harq_pid = rel8->harq_process;
   dci_alloc->ra_flag  = 0;
 
-  LOG_D(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n",
-	rel8->dci_format,rel8->cce_idx,rel8->aggregation_level,rel8->rnti,rel8->harq_process);
+  LOG_D(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[SFN/SF:%04d%d] DCI format %d, nCCE %d, L %d, rnti %x, harq_pid %d\n",
+	frame,subframe,proc->frame_tx,proc->subframe_tx,rel8->dci_format,rel8->cce_idx,rel8->aggregation_level,rel8->rnti,rel8->harq_process);
   if ((rel8->rnti_type == 2 ) && (rel8->rnti != SI_RNTI) && (rel8->rnti != P_RNTI)) dci_alloc->ra_flag = 1;
 
   UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
@@ -1041,6 +1047,14 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
   dlsch1_harq                               = dlsch1->harq_processes[rel8->harq_process];
   dlsch1_harq->codeword                     = 1;
   dlsch0->subframe_tx[subframe]             = 1;
+
+  LOG_D(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:SFN/SF:%04d%d dlsch0[rnti:%x harq_mask:%04x] dci_pdu[rnti:%x rnti_type:%d harq_process:%d ndi1:%d] dlsch0_harq[round:%d harq_mask:%x ndi:%d]\n", 
+      frame,subframe,
+      proc->frame_tx,proc->subframe_tx,
+      dlsch0->rnti,dlsch0->harq_mask,
+      rel8->rnti, rel8->rnti_type, rel8->harq_process, rel8->new_data_indicator_1,
+      dlsch0_harq->round, dlsch0->harq_mask, dlsch0_harq->ndi);
+
   if (dlsch0->rnti != rel8->rnti) { // if rnti of dlsch is not the same as in the config, this is a new entry
     dlsch0_harq->round=0;
     dlsch0->harq_mask=0;
@@ -1057,15 +1071,19 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
   dlsch0->active        = 1;
   if (rel8->rnti_type == 2)
       dlsch0_harq->round    = 0;
-LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round,
-	dlsch0_harq->ndi,rel8->new_data_indicator_1, rel8->rnti_type);
+
+  LOG_D(PHY,"NFAPI: rel8[rnti %x dci_format %d harq_process %d ndi1 %d rnti type %d] dlsch0[rnti %x harq_mask %x] dlsch0_harq[round %d ndi %d]\n",
+      rel8->rnti,rel8->dci_format,rel8->harq_process, rel8->new_data_indicator_1, rel8->rnti_type,
+      dlsch0->rnti,dlsch0->harq_mask,
+      dlsch0_harq->round,dlsch0_harq->ndi
+      );
 
   switch (rel8->dci_format) {
 
   case NFAPI_DL_DCI_FORMAT_1A:
 
-      AssertFatal(rel8->resource_block_coding < 8192, "Frame %d, Subframe %d: rel8->resource_block_coding (%p) %u >= 8192 (rnti %x, rnti_type %d, format %d, harq_id %d\n",
-                proc->frame_tx,subframe,
+      AssertFatal(rel8->resource_block_coding < 8192, "SFN/SF:%04d%d proc:TX:SFN/SF:%04d%d: rel8->resource_block_coding (%p) %u >= 8192 (rnti %x, rnti_type %d, format %d, harq_id %d\n",
+                frame,subframe,proc->frame_tx,subframe,
                 &rel8->resource_block_coding,rel8->resource_block_coding,rel8->rnti,rel8->rnti_type,rel8->dci_format,rel8->harq_process);
   
 
@@ -1084,6 +1102,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->TPC      = rel8->tpc;
         ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process;
         ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;
+        ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->padding  = 0;
 	
       } else {
 	dci_alloc->dci_length                         = sizeof_DCI1A_1_5MHz_FDD_t; 
@@ -1095,6 +1114,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->rv           = rel8->redundancy_version_1;
         ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->TPC          = rel8->tpc;
         ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->harq_pid     = rel8->harq_process;
+        ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->padding      = 0;
         //      printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
       AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n");
@@ -1113,7 +1133,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->rv         = rel8->redundancy_version_1;
         ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->TPC        = rel8->tpc;
         ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid   = rel8->harq_process;
-        ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->dai      = rel8->downlink_assignment_index; 	
+        ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->dai        = rel8->downlink_assignment_index;
+        ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->padding    = 0;
          //        printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                         = sizeof_DCI1A_5MHz_FDD_t; 
@@ -1125,6 +1146,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1A_5MHz_FDD_t *)dci_pdu)->rv             = rel8->redundancy_version_1;
         ((DCI1A_5MHz_FDD_t *)dci_pdu)->TPC            = rel8->tpc;
         ((DCI1A_5MHz_FDD_t *)dci_pdu)->harq_pid       = rel8->harq_process;
+        ((DCI1A_5MHz_FDD_t *)dci_pdu)->padding        = 0;
         //      printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
       AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n");
@@ -1143,7 +1165,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->rv        = rel8->redundancy_version_1;
         ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->TPC       = rel8->tpc;
         ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->harq_pid  = rel8->harq_process;
-        ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;	
+        ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;
+        ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->padding   = 0;
         //        printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                         = sizeof_DCI1A_10MHz_FDD_t; 
@@ -1155,6 +1178,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1A_10MHz_FDD_t *)dci_pdu)->rv            = rel8->redundancy_version_1;
         ((DCI1A_10MHz_FDD_t *)dci_pdu)->TPC           = rel8->tpc;
         ((DCI1A_10MHz_FDD_t *)dci_pdu)->harq_pid      = rel8->harq_process;
+        ((DCI1A_10MHz_FDD_t *)dci_pdu)->padding       = 0;
 	//      printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
       AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n");
@@ -1174,7 +1198,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->rv        = rel8->redundancy_version_1;
         ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->TPC       = rel8->tpc;
         ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->harq_pid  = rel8->harq_process;
-        ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;	
+        ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;
+        ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->padding   = 0;
         //        printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                         = sizeof_DCI1A_20MHz_FDD_t; 
@@ -1186,6 +1211,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1A_20MHz_FDD_t *)dci_pdu)->rv            = rel8->redundancy_version_1;
         ((DCI1A_20MHz_FDD_t *)dci_pdu)->TPC           = rel8->tpc;
         ((DCI1A_20MHz_FDD_t *)dci_pdu)->harq_pid      = rel8->harq_process;
+        ((DCI1A_20MHz_FDD_t *)dci_pdu)->padding       = 0;
 	//      printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
       AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n");
@@ -1208,7 +1234,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
       NPRB      = dlsch0_harq->nb_rb;
       I_mcs     = get_I_TBS(rel8->mcs_1);
     }
-    AssertFatal(NPRB>0,"DCI 1A: NPRB = 0 (rnti %x, rnti type %d, tpc %d, round %d, resource_block_coding %d)\n",rel8->rnti,rel8->rnti_type,rel8->tpc,dlsch0_harq->round,rel8->resource_block_coding);
+    AssertFatal(NPRB>0,"DCI 1A: NPRB = 0 (rnti %x, rnti type %d, tpc %d, round %d, resource_block_coding %d, harq process %d)\n",rel8->rnti,rel8->rnti_type,rel8->tpc,dlsch0_harq->round,rel8->resource_block_coding,rel8->harq_process);
     dlsch0_harq->rvidx         = rel8->redundancy_version_1;
     dlsch0_harq->Nl            = 1;
     dlsch0_harq->mimo_mode     = (fp->nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI;
@@ -1228,7 +1254,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
 
     dlsch0->harq_mask            |= (1<<rel8->harq_process);
 
-    if (rel8->rnti_type == 1) LOG_I(PHY,"DCI 1A: round %d, mcs %d, rballoc %x,rv %d, rnti %x\n",dlsch0_harq->round,rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti);
+    if (rel8->rnti_type == 1) LOG_I(PHY,"DCI 1A: round %d, mcs %d, rballoc %x, rv %d, rnti %x, harq process %d\n",dlsch0_harq->round,rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti,rel8->harq_process);
 
     break;
   case NFAPI_DL_DCI_FORMAT_1:
@@ -1236,7 +1262,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
     dci_alloc->format           = format1;
     dlsch0->active              = 1;
 
-    LOG_D(PHY,"Frame %d, Subframe %d: Programming DLSCH for Format 1 DCI, harq_pid %d\n",proc->frame_tx,subframe,rel8->harq_process);
+    LOG_D(PHY,"SFN/SF:%04d%d proc:TX:SFN/SF:%04d%d: Programming DLSCH for Format 1 DCI, harq_pid %d\n",frame,subframe,proc->frame_tx,subframe,rel8->harq_process);
 
     switch (fp->N_RB_DL) {
     case 6:
@@ -1249,7 +1275,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rv        = rel8->redundancy_version_1;
         ((DCI1_1_5MHz_TDD_t *)dci_pdu)->TPC       = rel8->tpc;
         ((DCI1_1_5MHz_TDD_t *)dci_pdu)->harq_pid  = rel8->harq_process;
-        ((DCI1_1_5MHz_TDD_t *)dci_pdu)->dai       = rel8->downlink_assignment_index; 	
+        ((DCI1_1_5MHz_TDD_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;
+        ((DCI1_1_5MHz_TDD_t *)dci_pdu)->padding   = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                         = sizeof_DCI1_1_5MHz_FDD_t; 
@@ -1260,6 +1287,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rv            = rel8->redundancy_version_1;
         ((DCI1_1_5MHz_FDD_t *)dci_pdu)->TPC           = rel8->tpc;
         ((DCI1_1_5MHz_FDD_t *)dci_pdu)->harq_pid      = rel8->harq_process;
+        ((DCI1_1_5MHz_FDD_t *)dci_pdu)->padding       = 0;
         //      printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
       break;
@@ -1273,7 +1301,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1_5MHz_TDD_t *)dci_pdu)->rv       = rel8->redundancy_version_1;
         ((DCI1_5MHz_TDD_t *)dci_pdu)->TPC      = rel8->tpc;
         ((DCI1_5MHz_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
-        ((DCI1_5MHz_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;	
+        ((DCI1_5MHz_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;
+        ((DCI1_5MHz_TDD_t *)dci_pdu)->padding  = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                  = sizeof_DCI1_5MHz_FDD_t; 
@@ -1284,6 +1313,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1_5MHz_FDD_t *)dci_pdu)->rv       = rel8->redundancy_version_1;
         ((DCI1_5MHz_FDD_t *)dci_pdu)->TPC      = rel8->tpc;
         ((DCI1_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
+        ((DCI1_5MHz_FDD_t *)dci_pdu)->padding  = 0;
         //      printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
       break;
@@ -1297,7 +1327,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1_10MHz_TDD_t *)dci_pdu)->rv       = rel8->redundancy_version_1;
         ((DCI1_10MHz_TDD_t *)dci_pdu)->TPC      = rel8->tpc;
         ((DCI1_10MHz_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
-        ((DCI1_10MHz_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;	
+        ((DCI1_10MHz_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;
+        ((DCI1_10MHz_TDD_t *)dci_pdu)->padding  = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                   = sizeof_DCI1_10MHz_FDD_t; 
@@ -1308,6 +1339,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1_10MHz_FDD_t *)dci_pdu)->rv       = rel8->redundancy_version_1;
         ((DCI1_10MHz_FDD_t *)dci_pdu)->TPC      = rel8->tpc;
         ((DCI1_10MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
+        ((DCI1_10MHz_FDD_t *)dci_pdu)->padding  = 0;
       }
       break;
     case 100:
@@ -1320,7 +1352,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1_20MHz_TDD_t *)dci_pdu)->rv       = rel8->redundancy_version_1;
         ((DCI1_20MHz_TDD_t *)dci_pdu)->TPC      = rel8->tpc;
         ((DCI1_20MHz_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
-        ((DCI1_20MHz_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;	
+        ((DCI1_20MHz_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;
+        ((DCI1_20MHz_TDD_t *)dci_pdu)->padding  = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                   = sizeof_DCI1_20MHz_FDD_t; 
@@ -1331,6 +1364,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI1_20MHz_FDD_t *)dci_pdu)->rv       = rel8->redundancy_version_1;
         ((DCI1_20MHz_FDD_t *)dci_pdu)->TPC      = rel8->tpc;
         ((DCI1_20MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
+        ((DCI1_20MHz_FDD_t *)dci_pdu)->padding  = 0;
       }
       break;
     }
@@ -1415,6 +1449,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
 	((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap  = rel8->transport_block_to_codeword_swap_flag;
         ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;
+        /* there is no padding in this structure, it is exactly 32 bits */
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                         = sizeof_DCI2A_1_5MHz_2A_FDD_t; 
@@ -1429,6 +1464,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->TPC          = rel8->tpc;
         ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid     = rel8->harq_process;
 	((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap      = rel8->transport_block_to_codeword_swap_flag;
+	((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->padding      = 0;
         //      printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
       break;
@@ -1445,8 +1481,9 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->rv2       = rel8->redundancy_version_2;
         ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->TPC       = rel8->tpc;
         ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->harq_pid  = rel8->harq_process;
-	((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;	
-        ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;	
+	((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;
+        ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;
+        ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->padding   = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                           = sizeof_DCI2A_5MHz_2A_FDD_t; 
@@ -1461,6 +1498,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->TPC           = rel8->tpc;
         ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->harq_pid      = rel8->harq_process;
 	((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->tb_swap       = rel8->transport_block_to_codeword_swap_flag;	
+	((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->padding       = 0;
         //      printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
       break;
@@ -1477,8 +1515,9 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->rv2      = rel8->redundancy_version_2;
         ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->TPC      = rel8->tpc;
         ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process;
-	((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->tb_swap  = rel8->transport_block_to_codeword_swap_flag;	
-        ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;	
+	((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->tb_swap  = rel8->transport_block_to_codeword_swap_flag;
+        ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;
+        ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->padding  = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                        = sizeof_DCI2A_10MHz_2A_FDD_t; 
@@ -1492,7 +1531,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->rv2       = rel8->redundancy_version_2;
         ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->TPC       = rel8->tpc;
         ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->harq_pid  = rel8->harq_process;
-	((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;	
+	((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;
+	((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->padding   = 0;
       }
       break;
     case 100:
@@ -1508,8 +1548,9 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->rv2       = rel8->redundancy_version_2;
         ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->TPC       = rel8->tpc;
         ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->harq_pid  = rel8->harq_process;
-	((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;		
-        ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;	
+	((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;
+        ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;
+        ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->padding   = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                           = sizeof_DCI2A_20MHz_2A_FDD_t; 
@@ -1523,7 +1564,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->rv2          = rel8->redundancy_version_2;
         ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->TPC          = rel8->tpc;
         ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->harq_pid     = rel8->harq_process;
-	((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->tb_swap      = rel8->transport_block_to_codeword_swap_flag;	
+	((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->tb_swap      = rel8->transport_block_to_codeword_swap_flag;
+	((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->padding      = 0;
       }
       break;
 
@@ -1726,6 +1768,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
 	((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap  = rel8->transport_block_to_codeword_swap_flag;
         ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;
         ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tpmi     = rel8->precoding_information;
+        ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->padding  = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                         = sizeof_DCI2_1_5MHz_2A_FDD_t; 
@@ -1740,6 +1783,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid     = rel8->harq_process;
 	((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap      = rel8->transport_block_to_codeword_swap_flag;
         ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tpmi         = rel8->precoding_information;
+        ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->padding      = 0;
         //      printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
       break;
@@ -1759,6 +1803,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
 	((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;	
         ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;	
         ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tpmi      = rel8->precoding_information;
+        ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->padding   = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                           = sizeof_DCI2_5MHz_2A_FDD_t; 
@@ -1773,7 +1818,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->TPC           = rel8->tpc;
         ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->harq_pid      = rel8->harq_process;
 	((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tb_swap       = rel8->transport_block_to_codeword_swap_flag;
-        ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tpmi     = rel8->precoding_information;	
+        ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tpmi          = rel8->precoding_information;
+        ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->padding       = 0;
         //      printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
       break;
@@ -1793,6 +1839,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
 	((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tb_swap  = rel8->transport_block_to_codeword_swap_flag;	
         ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->dai      = rel8->downlink_assignment_index;	
         ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tpmi     = rel8->precoding_information;
+        ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->padding  = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
 	dci_alloc->dci_length                        = sizeof_DCI2_10MHz_2A_FDD_t; 
@@ -1806,13 +1853,14 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv2       = rel8->redundancy_version_2;
         ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->TPC       = rel8->tpc;
         ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->harq_pid  = rel8->harq_process;
-	((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;	
+	((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;
         ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tpmi      = rel8->precoding_information;
+        ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->padding   = 0;
       }
       break;
     case 100:
       if (fp->frame_type == TDD) {
-	dci_alloc->dci_length                        = sizeof_DCI2_20MHz_2A_TDD_t; 
+	dci_alloc->dci_length                        = sizeof_DCI2_20MHz_2A_TDD_t;
         ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rah       = rel8->resource_allocation_type;
         ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs1      = rel8->mcs_1;
         ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs2      = rel8->mcs_2;
@@ -1823,12 +1871,13 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv2       = rel8->redundancy_version_2;
         ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->TPC       = rel8->tpc;
         ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->harq_pid  = rel8->harq_process;
-	((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;		
-        ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;	
+	((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tb_swap   = rel8->transport_block_to_codeword_swap_flag;
+        ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->dai       = rel8->downlink_assignment_index;
         ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tpmi      = rel8->precoding_information;
+        ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->padding   = 0;
         //        printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       } else {
-	dci_alloc->dci_length                           = sizeof_DCI2_20MHz_2A_FDD_t; 
+	dci_alloc->dci_length                           = sizeof_DCI2_20MHz_2A_FDD_t;
         ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rah          = rel8->resource_allocation_type;
         ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs1         = rel8->mcs_1;
         ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs2         = rel8->mcs_2;
@@ -1839,8 +1888,9 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
         ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv2          = rel8->redundancy_version_2;
         ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->TPC          = rel8->tpc;
         ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->harq_pid     = rel8->harq_process;
-	((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tb_swap      = rel8->transport_block_to_codeword_swap_flag;	
+	((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tb_swap      = rel8->transport_block_to_codeword_swap_flag;
         ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tpmi         = rel8->precoding_information;
+        ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->padding      = 0;
       }
       break;
 
@@ -2093,11 +2143,11 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
   }
 
   if (dlsch0_harq) {
-    dlsch0_harq->frame    = proc->frame_tx;
+    dlsch0_harq->frame    = frame;
     dlsch0_harq->subframe = subframe;
   }
   if (dlsch1_harq) {
-    dlsch1_harq->frame    = proc->frame_tx;
+    dlsch1_harq->frame    = frame;
     dlsch1_harq->subframe = subframe;
   }
 
@@ -2135,7 +2185,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n"
     
 #if T_TRACER
   if (dlsch0->active)
-    T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(proc->frame_tx), T_INT(proc->subframe_tx),
+    T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(frame), T_INT(subframe),
       T_INT(rel8->rnti), T_INT(rel8->dci_format), T_INT(rel8->harq_process),
       T_INT(rel8->mcs_1), T_INT(dlsch0_harq->TBS));
 #endif
@@ -2201,6 +2251,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
       ((DCI6_1A_5MHz_t *)dci_pdu)->srs_req      = rel13->srs_request;
       ((DCI6_1A_5MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset;
       ((DCI6_1A_5MHz_t *)dci_pdu)->dci_rep      = rel13->dci_subframe_repetition_number-1;
+      ((DCI6_1A_5MHz_t *)dci_pdu)->padding      = 0;
     
       break;
     case 50:
@@ -2217,6 +2268,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
       ((DCI6_1A_10MHz_t *)dci_pdu)->srs_req      = rel13->srs_request;
       ((DCI6_1A_10MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset;
       ((DCI6_1A_10MHz_t *)dci_pdu)->dci_rep      = rel13->dci_subframe_repetition_number-1;
+      ((DCI6_1A_10MHz_t *)dci_pdu)->padding      = 0;
       break;
     case 100:
       dci_alloc->dci_length                     = sizeof_DCI6_1A_20MHz_t; 
@@ -2232,6 +2284,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
       ((DCI6_1A_20MHz_t *)dci_pdu)->srs_req      = rel13->srs_request;
       ((DCI6_1A_20MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset;
       ((DCI6_1A_20MHz_t *)dci_pdu)->dci_rep      = rel13->dci_subframe_repetition_number-1;
+      ((DCI6_1A_20MHz_t *)dci_pdu)->padding      = 0;
       break;
     }
     break;
@@ -2250,6 +2303,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
       ((DCI6_1B_5MHz_t *)dci_pdu)->ndi          = rel13->new_data_indicator;
       ((DCI6_1B_5MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset;
       ((DCI6_1B_5MHz_t *)dci_pdu)->dci_rep      = rel13->dci_subframe_repetition_number-1;
+      ((DCI6_1B_5MHz_t *)dci_pdu)->padding      = 0;
   
       break;
     case 50:
@@ -2262,6 +2316,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
       ((DCI6_1B_10MHz_t *)dci_pdu)->ndi          = rel13->new_data_indicator;
       ((DCI6_1B_10MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset;
       ((DCI6_1B_10MHz_t *)dci_pdu)->dci_rep      = rel13->dci_subframe_repetition_number-1;
+      ((DCI6_1B_10MHz_t *)dci_pdu)->padding      = 0;
       break;
     case 100:
       dci_alloc->dci_length                      = sizeof_DCI6_1B_20MHz_t; 
@@ -2273,6 +2328,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
       ((DCI6_1B_20MHz_t *)dci_pdu)->ndi          = rel13->new_data_indicator;
       ((DCI6_1B_20MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset;
       ((DCI6_1B_20MHz_t *)dci_pdu)->dci_rep      = rel13->dci_subframe_repetition_number-1;
+      ((DCI6_1B_20MHz_t *)dci_pdu)->padding      = 0;
       break;
     }
   case 12: // Format 6-2
@@ -2284,6 +2340,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
       if (rel13->paging_direct_indication_differentiation_flag==0) {
 	((DCI6_2_di_5MHz_t *)dci_pdu)->type    = 0;
 	((DCI6_2_di_5MHz_t *)dci_pdu)->di_info = rel13->direct_indication;
+	((DCI6_2_di_5MHz_t *)dci_pdu)->padding = 0;
       }
       else {
 	((DCI6_2_paging_5MHz_t *)dci_pdu)->type    = 1;
@@ -2291,6 +2348,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
 	((DCI6_2_paging_5MHz_t *)dci_pdu)->mcs     = rel13->mcs;
 	((DCI6_2_paging_5MHz_t *)dci_pdu)->rep     = (rel13->pdsch_reptition_levels-1);
 	((DCI6_2_paging_5MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1;
+	((DCI6_2_paging_5MHz_t *)dci_pdu)->padding = 0;
       }
 
     break;
@@ -2299,6 +2357,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
       if (rel13->paging_direct_indication_differentiation_flag==0) {
 	((DCI6_2_di_10MHz_t *)dci_pdu)->type    = 0;
 	((DCI6_2_di_10MHz_t *)dci_pdu)->di_info = rel13->direct_indication;
+	((DCI6_2_di_10MHz_t *)dci_pdu)->padding = 0;
       }
       else {
 	((DCI6_2_paging_10MHz_t *)dci_pdu)->type    = 1;
@@ -2306,6 +2365,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
 	((DCI6_2_paging_10MHz_t *)dci_pdu)->mcs     = rel13->mcs;
 	((DCI6_2_paging_10MHz_t *)dci_pdu)->rep     = (rel13->pdsch_reptition_levels-1);
 	((DCI6_2_paging_10MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1;
+	((DCI6_2_paging_10MHz_t *)dci_pdu)->padding = 0;
       }
 
     break;
@@ -2314,6 +2374,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
       if (rel13->paging_direct_indication_differentiation_flag==0) {
 	((DCI6_2_di_20MHz_t *)dci_pdu)->type    = 0;
 	((DCI6_2_di_20MHz_t *)dci_pdu)->di_info = rel13->direct_indication;
+	((DCI6_2_di_20MHz_t *)dci_pdu)->padding = 0;
       }
       else {
 	((DCI6_2_paging_20MHz_t *)dci_pdu)->type    = 1;
@@ -2321,6 +2382,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
 	((DCI6_2_paging_20MHz_t *)dci_pdu)->mcs     = rel13->mcs;
 	((DCI6_2_paging_20MHz_t *)dci_pdu)->rep     = (rel13->pdsch_reptition_levels-1);
 	((DCI6_2_paging_20MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1;
+	((DCI6_2_paging_20MHz_t *)dci_pdu)->padding = 0;
       }
 
       break;
@@ -2382,8 +2444,8 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
 
 }
 
-void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
-               nfapi_hi_dci0_dci_pdu *pdu)
+void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
+    DCI_ALLOC_t *dci_alloc,nfapi_hi_dci0_dci_pdu *pdu)
 {
   LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
 
@@ -2400,8 +2462,8 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
   uint32_t ndi     = pdu->dci_pdu_rel8.new_data_indication_1;
 
 #ifdef T_TRACER
-  T(T_ENB_PHY_ULSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx),
-    T_INT(pdu->dci_pdu_rel8.rnti), T_INT(((proc->frame_tx*10+proc->subframe_tx+4) % 8) /* TODO: correct harq pid */),
+  T(T_ENB_PHY_ULSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe),
+    T_INT(pdu->dci_pdu_rel8.rnti), T_INT(((frame*10+subframe+4) % 8) /* TODO: correct harq pid */),
     T_INT(mcs), T_INT(-1 /* TODO: remove round? */),
     T_INT(pdu->dci_pdu_rel8.resource_block_start),
     T_INT(pdu->dci_pdu_rel8.number_of_resource_block),
@@ -2412,9 +2474,11 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
 
   void *dci_pdu = (void*)dci_alloc->dci_pdu;
 
-  LOG_D(PHY,"Filling DCI0 with cqi %d, mcs %d, hopping %d, rballoc %x (%d,%d) ndi %d TPC %d cshift %d\n",cqi_req,
-	mcs,hopping,rballoc,pdu->dci_pdu_rel8.resource_block_start,pdu->dci_pdu_rel8.number_of_resource_block,
-	ndi,TPC,cshift);
+  LOG_D(PHY,"SFN/SF:%04d%d DCI0[rnti %x cqi %d mcs %d hopping %d rballoc %x (%d,%d) ndi %d TPC %d cshift %d]\n",
+        frame,subframe,
+        pdu->dci_pdu_rel8.rnti,cqi_req, mcs,hopping,rballoc,
+        pdu->dci_pdu_rel8.resource_block_start,
+        pdu->dci_pdu_rel8.number_of_resource_block, ndi,TPC,cshift);
 
   dci_alloc->format   = format0;
   dci_alloc->firstCCE = pdu->dci_pdu_rel8.cce_index;
@@ -2574,10 +2638,10 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
   ulsch->harq_processes[harq_pid]->dci_alloc                             = 1;
   ulsch->harq_processes[harq_pid]->rar_alloc                             = 0;
   ulsch->harq_processes[harq_pid]->n_DMRS                                = ulsch_pdu->ulsch_pdu_rel8.cyclic_shift_2_for_drms;
-
+  
   ulsch->harq_processes[harq_pid]->Nsymb_pusch                           = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1);
   ulsch->harq_processes[harq_pid]->srs_active                            = use_srs;
-
+  
   //Mapping of cyclic shift field in DCI format0 to n_DMRS2 (3GPP 36.211, Table 5.5.2.1.1-1)
   if(ulsch->harq_processes[harq_pid]->n_DMRS == 0)
     ulsch->harq_processes[harq_pid]->n_DMRS2 = 0;
@@ -2595,23 +2659,25 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
     ulsch->harq_processes[harq_pid]->n_DMRS2 = 10;
   else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7)
     ulsch->harq_processes[harq_pid]->n_DMRS2 = 9;
-
-  LOG_D(PHY,"[eNB %d][PUSCH %d] Programming PUSCH with n_DMRS2 %d (cshift %d) for Frame %d, Subframe %d\n",
-	eNB->Mod_id,harq_pid,ulsch->harq_processes[harq_pid]->n_DMRS2,ulsch->harq_processes[harq_pid]->n_DMRS,
-	frame,subframe);
-
+  
+  LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d\n",
+	eNB->Mod_id,harq_pid,frame,subframe,
+        ulsch->harq_processes[harq_pid]->n_DMRS2,
+        ulsch->harq_processes[harq_pid]->n_DMRS,
+	ulsch->harq_processes[harq_pid]->ndi, ulsch_pdu->ulsch_pdu_rel8.new_data_indication, new_ulsch, ulsch->harq_processes[harq_pid]->status);
+  
   ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version;
   ulsch->harq_processes[harq_pid]->Qm    = ulsch_pdu->ulsch_pdu_rel8.modulation_type;
-  // Set O_ACK to 0 by default, will be set of DLSCH is scheduled and needs to be
+  // Set O_ACK to 0 by default, will be set of DLSCH is scheduled and needs to be 
   ulsch->harq_processes[harq_pid]->O_ACK         = 0;
 
   if ((ulsch->harq_processes[harq_pid]->status == SCH_IDLE) ||
       (ulsch->harq_processes[harq_pid]->ndi    != ulsch_pdu->ulsch_pdu_rel8.new_data_indication) ||
 	  (new_ulsch == TRUE)){
     ulsch->harq_processes[harq_pid]->status        = ACTIVE;
-
+    
     ulsch->harq_processes[harq_pid]->TBS           = ulsch_pdu->ulsch_pdu_rel8.size<<3;
-
+    
     ulsch->harq_processes[harq_pid]->Msc_initial   = 12*ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks;
     ulsch->harq_processes[harq_pid]->Nsymb_initial = ulsch->harq_processes[harq_pid]->Nsymb_pusch;
     ulsch->harq_processes[harq_pid]->round         = 0;
@@ -2621,23 +2687,25 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
     // will be set if MAC has activated ULSCH_CQI_RI_PDU or ULSCH_CQI_HARQ_RI_PDU
     ulsch->harq_processes[harq_pid]->Or1           = 0;
     ulsch->harq_processes[harq_pid]->Or2           = 0;
-  }
+  } 
   else  ulsch->harq_processes[harq_pid]->round++;
 
   ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti;
-  LOG_D(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n",
+  LOG_D(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, status %d, handled %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n",
 	ulsch->rnti,
         UE_id,
         new_ulsch,
 	frame,
 	subframe,
 	harq_pid,
+	ulsch->harq_processes[harq_pid]->status,
+	ulsch->harq_processes[harq_pid]->handled,
 	ulsch->harq_processes[harq_pid]->first_rb,
 	ulsch->harq_processes[harq_pid]->nb_rb,
 	ulsch->harq_processes[harq_pid]->rvidx,
 	ulsch->harq_processes[harq_pid]->Qm,
 	ulsch->harq_processes[harq_pid]->TBS,
-	ulsch->harq_processes[harq_pid]->round);
+	ulsch->harq_processes[harq_pid]->round);  
 }
 
 int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
@@ -6401,7 +6469,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t
   uint8_t ret = 255;
 
   if (frame_parms->frame_type == FDD) {
-    ret = (((frame<<1)+subframe)&7);
+    ret = (((frame*10)+subframe)&7);
   } else {
 
     switch (frame_parms->tdd_config) {
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
index 90450b7c1c32d0039dd8c4691e7baffa641d02bc..49b41615f4cd91d43ed5b0f59ae6f2a1a90d3fca 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
@@ -38,7 +38,7 @@
 #include "defs.h"
 #include "UTIL/LOG/vcd_signal_dumper.h"
 
-//#define DEBUG_DLSCH_MODULATION
+//#define DEBUG_DLSCH_MODULATION 1
 
 //#define is_not_pilot(pilots,re,nushift,use2ndpilots) ((pilots==0) || ((re!=nushift) && (re!=nushift+6)&&((re!=nushift+3)||(use2ndpilots==1))&&((re!=nushift+9)||(use2ndpilots==1)))?1:0)
 
@@ -78,7 +78,7 @@ uint8_t is_not_UEspecRS(int8_t lprime, uint8_t re, uint8_t nushift, uint8_t Ncp,
         if ((re!=nushift+offset) && (re!=((nushift+4+offset)%12)) &&  (re!=((nushift+8+offset)%12)))
           return(1);
         /*else{
-          printf("(is_no_UEspec_RS):lprime=%d, re=%d, nushift=%d, offset=%d\n",lprime, re,nushift,offset);
+          LOG_I(PHY,"(is_no_UEspec_RS):lprime=%d, re=%d, nushift=%d, offset=%d\n",lprime, re,nushift,offset);
         }*/
       } else {
         if ((re!=nushift+offset) && (re!=((nushift+3+offset)%12)) && (re!=((nushift+6+offset)%12)) && (re!=((nushift+9+offset)%12)))
@@ -270,7 +270,7 @@ int allocate_REs_in_RB_pilots_16QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
 
 
   if (skip_dc == 0) {
-    //    printf("pilots: P1_SHIFT[0] %d\n",P1_SHIFT[0]);
+    //    LOG_I(PHY,"pilots: P1_SHIFT[0] %d\n",P1_SHIFT[0]);
     for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+P1_SHIFT[0],re=P1_SHIFT[0];
          re<12;
          x0p+=4) {
@@ -281,7 +281,7 @@ int allocate_REs_in_RB_pilots_16QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
       qam16_table_offset_im+=x0p[3];
       ((int16_t *)&txdataF[0][tti_offset])[0]=qam_table_s0[qam16_table_offset_re];
       ((int16_t *)&txdataF[0][tti_offset])[1]=qam_table_s0[qam16_table_offset_im];
-      //      printf("pilots: re %d, tti_offset %d, P1_SHIFT %d\n",re,tti_offset,P1_SHIFT[re+1]);
+      //      LOG_I(PHY,"pilots: re %d, tti_offset %d, P1_SHIFT %d\n",re,tti_offset,P1_SHIFT[re+1]);
       tti_offset+=P1_SHIFT[re+1];
       re+=P1_SHIFT[re+1];
     }
@@ -497,7 +497,7 @@ int allocate_REs_in_RB_pilots_64QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
 
 
   if (skip_dc == 0) {
-    //    printf("pilots: P1_SHIFT[0] %d\n",P1_SHIFT[0]);
+    //    LOG_I(PHY,"pilots: P1_SHIFT[0] %d\n",P1_SHIFT[0]);
     for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+P1_SHIFT[0],re=P1_SHIFT[0];
          re<12;
          x0p+=6) {
@@ -510,7 +510,7 @@ int allocate_REs_in_RB_pilots_64QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
       qam64_table_offset_im+=x0p[5];
       ((int16_t *)&txdataF[0][tti_offset])[0]=qam_table_s0[qam64_table_offset_re];
       ((int16_t *)&txdataF[0][tti_offset])[1]=qam_table_s0[qam64_table_offset_im];
-      //      printf("pilots: re %d, tti_offset %d, P1_SHIFT %d\n",re,tti_offset,P1_SHIFT[re+1]);
+      //      LOG_I(PHY,"pilots: re %d, tti_offset %d, P1_SHIFT %d\n",re,tti_offset,P1_SHIFT[re+1]);
       tti_offset+=P1_SHIFT[re+1];
       re+=P1_SHIFT[re+1];
     }
@@ -667,11 +667,11 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
 
   if (dlsch0_harq != NULL){
     #ifdef DEBUG_DLSCH_MODULATION
-      printf("allocate_re (mod %d): symbol_offset %d re_offset %d (%d,%d), jj %d -> %d,%d\n",mod_order0,symbol_offset,re_offset,skip_dc,skip_half,*jj, x0[*jj], x0[1+*jj]);
+      LOG_I(PHY,"allocate_re (mod %d): symbol_offset %d re_offset %d (%d,%d), jj %d -> %d,%d\n",mod_order0,symbol_offset,re_offset,skip_dc,skip_half,*jj, x0[*jj], x0[1+*jj]);
     #endif
   } else{
     #ifdef DEBUG_DLSCH_MODULATION
-      printf("allocate_re (mod %d): symbol_offset %d re_offset %d (%d,%d), jj %d -> %d,%d\n",mod_order0,symbol_offset,re_offset,skip_dc,skip_half,*jj, x0[*jj], x0[1+*jj]);
+      LOG_I(PHY,"allocate_re (mod %d): symbol_offset %d re_offset %d (%d,%d), jj %d -> %d,%d\n",mod_order0,symbol_offset,re_offset,skip_dc,skip_half,*jj, x0[*jj], x0[1+*jj]);
     #endif
   }
 
@@ -685,7 +685,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
 
 
   for (re=first_re; re<last_re; re++) {
-  // printf("element %d precoder_index for allocation %d\n",re, precoder_index );
+  // LOG_I(PHY,"element %d precoder_index for allocation %d\n",re, precoder_index );
 
     if ((skip_dc == 1) && (re==6))
       re_off=re_off - frame_parms->ofdm_symbol_size+1;
@@ -695,7 +695,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
       //check that RE is not from Cell-specific RS
 
     if (is_not_pilot(pilots,re,frame_parms->nushift,use2ndpilots)==1) {
-      //printf("re %d (jj %d)\n",re,*jj);
+      //LOG_I(PHY,"re %d (jj %d)\n",re,*jj);
 
 
       if (mimo_mode == SISO) {  //SISO mapping
@@ -705,7 +705,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
         case 2:  //QPSK
 
 
-          //printf("re %d %d(%d) : %d,%d => ",re,tti_offset,*jj,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+          //LOG_I(PHY,"re %d %d(%d) : %d,%d => ",re,tti_offset,*jj,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
           ((int16_t*)&txdataF[0][tti_offset])[0] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
 
           *jj = *jj + 1;
@@ -971,12 +971,12 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
             break;
 
           case 2:  //QPSK
-            //printf("%d(%d) : %d,%d => ",tti_offset,*jj,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+            //LOG_I(PHY,"%d(%d) : %d,%d => ",tti_offset,*jj,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
             xx0_re = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
             *jj = *jj + 1;
             xx0_im = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
             *jj = *jj + 1;
-            //printf("%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+            //LOG_I(PHY,"%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
             break;
 
           case 4:  //16QAM
@@ -1042,12 +1042,12 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
             break;
 
           case 2:  //QPSK
-            //printf("%d(%d) : %d,%d => ",tti_offset,*jj,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+            //LOG_I(PHY,"%d(%d) : %d,%d => ",tti_offset,*jj,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
             xx1_re = (x1[*jj2]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
             *jj2 = *jj2 + 1;
             xx1_im = (x1[*jj2]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
             *jj2 = *jj2 + 1;
-            //printf("%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+            //LOG_I(PHY,"%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
             break;
 
           case 4:  //16QAM
@@ -1114,7 +1114,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
           ((int16_t *)&txdataF[0][tti_offset])[1]+=((xx0_im+xx1_im)>>1);
           ((int16_t *)&txdataF[1][tti_offset])[1]+=(s*((xx0_im-xx1_im)>>1));
           /*
-          printf("CDD: xx0 (%d,%d), xx1(%d,%d), s(%d), txF[0] (%d,%d), txF[1] (%d,%d)\n",
+          LOG_I(PHY,"CDD: xx0 (%d,%d), xx1(%d,%d), s(%d), txF[0] (%d,%d), txF[1] (%d,%d)\n",
            xx0_re,xx0_im,xx1_re,xx1_im, s, ((int16_t *)&txdataF[0][tti_offset])[0],((int16_t *)&txdataF[0][tti_offset])[1],
            ((int16_t *)&txdataF[1][tti_offset])[0],((int16_t *)&txdataF[1][tti_offset])[1]);
           */
@@ -1244,7 +1244,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
           precoder_index1 = 3; //[1 -j]
         }
         else {
-         printf("problem with precoder in TM4\n");
+         LOG_I(PHY,"problem with precoder in TM4\n");
           return(-1);
         }
 
@@ -1263,7 +1263,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
           ((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15)>>15);
           ((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15)>>15);
 
-          //printf("%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+          //LOG_I(PHY,"%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
 
           if (frame_parms->nb_antenna_ports_eNB == 2) {
             layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index0);
@@ -1466,7 +1466,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
               ((int16_t*)&txdataF[5][tti_offset])[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
               *jj = *jj + 1;
 
-              //printf("%d(%d) : %d,%d =>
+              //LOG_I(PHY,"%d(%d) : %d,%d =>
               //",tti_offset,*jj,((int16_t*)&tmp_sample1)[0],((int16_t*)&tmp_sample1)[1]);
               break;
 
@@ -1545,7 +1545,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
           }
         } else {
           //precoding UE spec RS
-          //printf("precoding UE spec RS\n");
+          //LOG_I(PHY,"precoding UE spec RS\n");
 
           ind = 3*lprime*dlsch0_harq->nb_rb+mprime2;
           ind_dword = ind>>4;
@@ -1563,7 +1563,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
           switch (mod_order0) {
           case 2:  //QPSK
 
-            //    printf("%d : %d,%d => ",tti_offset,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+            //    LOG_I(PHY,"%d : %d,%d => ",tti_offset,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
             for (int layer=first_layer0; layer<=(first_layer0+Nlayers0); layer++) {
               ((int16_t*)&txdataF[layer][tti_offset])[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
               *jj = *jj + 1;
@@ -1651,7 +1651,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
           }
         }
       } else if (mimo_mode>=TM9_10) {
-        printf("allocate_REs_in_RB() [dlsch.c] : ERROR, unknown mimo_mode %d\n",mimo_mode);
+        LOG_I(PHY,"allocate_REs_in_RB() [dlsch.c] : ERROR, unknown mimo_mode %d\n",mimo_mode);
         return(-1);
       }
     }
@@ -1686,7 +1686,7 @@ int allocate_REs_in_RB_MCH(int32_t **txdataF,
   uint8_t first_re,last_re;
   int inc;
 #ifdef DEBUG_DLSCH_MODULATION
-  printf("allocate_re_MCH (mod %d): symbol_offset %d re_offset %d (%d), jj %d -> %d,%d, gain_lin_QPSK %d,txdataF %p\n",mod_order,symbol_offset,re_offset,skip_dc,*jj, x0[*jj], x0[1+*jj],gain_lin_QPSK,&txdataF[0][symbol_offset]);
+  LOG_I(PHY,"allocate_re_MCH (mod %d): symbol_offset %d re_offset %d (%d), jj %d -> %d,%d, gain_lin_QPSK %d,txdataF %p\n",mod_order,symbol_offset,re_offset,skip_dc,*jj, x0[*jj], x0[1+*jj],gain_lin_QPSK,&txdataF[0][symbol_offset]);
 #endif
 
   last_re=12;
@@ -1707,7 +1707,7 @@ int allocate_REs_in_RB_MCH(int32_t **txdataF,
 
     tti_offset = symbol_offset + re_off + re;
 
-    //printf("re %d (jj %d)\n",re,*jj);
+    //LOG_I(PHY,"re %d (jj %d)\n",re,*jj);
     *re_allocated = *re_allocated + 1;
 
 
@@ -1715,7 +1715,7 @@ int allocate_REs_in_RB_MCH(int32_t **txdataF,
 
       case 2:  //QPSK
 
-      //            printf("%d : %d,%d => ",tti_offset,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+      //            LOG_I(PHY,"%d : %d,%d => ",tti_offset,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
       ((int16_t*)&txdataF[4][tti_offset])[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
 
       *jj = *jj + 1;
@@ -1724,7 +1724,7 @@ int allocate_REs_in_RB_MCH(int32_t **txdataF,
 
       *jj = *jj + 1;
 
-      //printf("%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+      //LOG_I(PHY,"%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
       break;
 
 
@@ -1931,7 +1931,7 @@ inline int check_skip(int rb,int subframe_offset,LTE_DL_FRAME_PARMS *frame_parms
 inline int check_skiphalf(int rb,int subframe_offset,LTE_DL_FRAME_PARMS *frame_parms,int l,int nsymb) __attribute__((always_inline));
 inline int check_skiphalf(int rb,int subframe_offset,LTE_DL_FRAME_PARMS *frame_parms,int l,int nsymb) {
 
-  //  printf("check_skiphalf : rb %d, subframe_offset %d,l %d, nsymb %d\n",rb,subframe_offset,l,nsymb);
+  //  LOG_I(PHY,"check_skiphalf : rb %d, subframe_offset %d,l %d, nsymb %d\n",rb,subframe_offset,l,nsymb);
 
   if ((frame_parms->N_RB_DL&1) == 1) { // ODD N_RB_DL
 
@@ -2154,19 +2154,19 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
   re_allocated=0;
 
 
-  //  printf("num_pdcch_symbols %d, nsymb %d\n",num_pdcch_symbols,nsymb);
+  //  LOG_I(PHY,"num_pdcch_symbols %d, nsymb %d\n",num_pdcch_symbols,nsymb);
   for (l=num_pdcch_symbols; l<nsymb; l++) {
 
   if (dlsch0 != NULL ) {
 #ifdef DEBUG_DLSCH_MODULATION
-    printf("Generating DLSCH (harq_pid %d,mimo %d, pmi_alloc0 %lx, mod0 %d, mod1 %d, rb_alloc[0] %d) in %d\n",
+    LOG_I(PHY,"Generating DLSCH (harq_pid %d,mimo %d, pmi_alloc0 %lx, mod0 %d, mod1 %d, rb_alloc[0] %d)\n",
             harq_pid,
             dlsch0_harq->mimo_mode,
             pmi2hex_2Ar2(dlsch0_harq->pmi_alloc),
             mod_order0,
             mod_order1,
-            rb_alloc[0],
-            len);
+            rb_alloc[0]
+            );
 #endif
   }
 
@@ -2216,6 +2216,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
 	for (eNB_id=0;eNB_id<ru->num_eNB;eNB_id++){
 	  if (phy_vars_eNB == ru->eNB_list[eNB_id]) {
 	    for (aa=0;aa<ru->nb_tx;aa++){
+              LOG_I(PHY,"ru_id:%d eNB_id:%d aa:%d memcpy(ru->beam_weights, dlsch0->ue_spec_bf_weights[ru_id][0],)\n", ru_id, eNB_id, aa);
 	      memcpy(ru->beam_weights[eNB_id][5][aa],
 		     dlsch0->ue_spec_bf_weights[ru_id][0],
 		     frame_parms->ofdm_symbol_size*sizeof(int32_t));
@@ -2233,7 +2234,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
 
     if (pilots>0) {  // compute pilot arrays, could be done statically if performance suffers
       if (frame_parms->nb_antenna_ports_eNB == 1) {
-	//	printf("l %d, nushift %d, offset %d\n",l,frame_parms->nushift,offset);
+	//	LOG_I(PHY,"l %d, nushift %d, offset %d\n",l,frame_parms->nushift,offset);
 	for (i=0,i2=0;i<12;i++) {
 	  if ((i!=(frame_parms->nushift+offset)) && (i!=((frame_parms->nushift+6+offset)%12)))
 	    P1_SHIFT[i2++]=1;
@@ -2340,7 +2341,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
 
     //for (aa=0;aa<frame_parms->nb_antennas_tx;aa++)
     //memset(&txdataF[aa][symbol_offset],0,frame_parms->ofdm_symbol_size<<2);
-    //printf("symbol_offset %d,subframe offset %d : pilots %d\n",symbol_offset,subframe_offset,pilots);
+    //LOG_I(PHY,"symbol_offset %d,subframe offset %d : pilots %d\n",symbol_offset,subframe_offset,pilots);
     for (rb=0; rb<frame_parms->N_RB_DL; rb++) {
 
       if (rb < 32)
@@ -2371,7 +2372,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
 
       if (dlsch1) {
         if (dlsch1_harq->Nlayers>1) {
-          printf("Nlayers %d: re_offset %d, symbol %d offset %d\n",dlsch0_harq->Nlayers,re_offset,l,symbol_offset);
+          LOG_I(PHY,"Nlayers %d: re_offset %d, symbol %d offset %d\n",dlsch0_harq->Nlayers,re_offset,l,symbol_offset);
           return(-1);
         }
       }
@@ -2379,7 +2380,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
 
 
       if (rb_alloc_ind > 0) {
-        //    printf("Allocated rb %d/symbol %d, skip_half %d, subframe_offset %d, symbol_offset %d, re_offset %d, jj %d\n",rb,l,skip_half,subframe_offset,symbol_offset,re_offset,jj);
+        //    LOG_I(PHY,"Allocated rb %d/symbol %d, skip_half %d, subframe_offset %d, symbol_offset %d, re_offset %d, jj %d\n",rb,l,skip_half,subframe_offset,symbol_offset,re_offset,jj);
 
       if (dlsch0 != NULL) {
         get_pmi_temp = get_pmi(frame_parms->N_RB_DL,
@@ -2419,7 +2420,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
             mprime +=3+frame_parms->Ncp;
       }
       else {
-        //      printf("Unallocated rb %d/symbol %d, re_offset %d, jj %d\n",rb,l,re_offset,jj);
+        //      LOG_I(PHY,"Unallocated rb %d/symbol %d, re_offset %d, jj %d\n",rb,l,re_offset,jj);
       }
       re_offset+=12; // go to next RB
 
@@ -2436,9 +2437,9 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
 
 #ifdef DEBUG_DLSCH_MODULATION
   if (dlsch0 != NULL){
-    printf("generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch0_harq->nb_rb,dlsch0_harq->rb_alloc,mod_order0,Nl0,2,0,subframe_offset));
+    LOG_I(PHY,"generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch0_harq->nb_rb,dlsch0_harq->rb_alloc,mod_order0,Nl0,2,0,subframe_offset,1));
   }else{
-    printf("generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch1_harq->nb_rb,dlsch1_harq->rb_alloc,mod_order1,Nl1,2,0,subframe_offset));
+    LOG_I(PHY,"generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch1_harq->nb_rb,dlsch1_harq->rb_alloc,mod_order1,Nl1,2,0,subframe_offset,1));
   }
 #endif
 
@@ -2493,7 +2494,7 @@ int dlsch_modulation_SIC(int32_t **sic_buffer,
 
       jj = jj + 1;
 
-      //printf("recon %d,%d\n",((int16_t*)&sic_buffer[0][i])[0],((int16_t*)&sic_buffer[0][i])[1]);
+      //LOG_I(PHY,"recon %d,%d\n",((int16_t*)&sic_buffer[0][i])[0],((int16_t*)&sic_buffer[0][i])[1]);
       i++;
 
       break;
@@ -2580,7 +2581,7 @@ int dlsch_modulation_SIC(int32_t **sic_buffer,
 
 
 #ifdef DEBUG_DLSCH_MODULATION
-  printf("generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch0_harq->nb_rb,dlsch0_harq->rb_alloc,mod_order0,Nl0,2,0,subframe_offset,1/*transmission mode*/));
+  LOG_I(PHY,"generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch0_harq->nb_rb,dlsch0_harq->rb_alloc,mod_order0,Nl0,2,0,subframe_offset,1/*transmission mode*/));
 #endif
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_FUNCTION_OUT);
@@ -2618,11 +2619,11 @@ int mch_modulation(int32_t **txdataF,
   jj=0;
   re_allocated=0;
 
-  //  printf("num_pdcch_symbols %d, nsymb %d\n",num_pdcch_symbols,nsymb);
+  //  LOG_I(PHY,"num_pdcch_symbols %d, nsymb %d\n",num_pdcch_symbols,nsymb);
   for (l=2; l<nsymb_pmch; l++) {
 
 #ifdef DEBUG_DLSCH_MODULATION
-    printf("Generating MCH (mod %d) in subframe %d for symbol %d\n",mod_order, subframe_offset,l);
+    LOG_I(PHY,"Generating MCH (mod %d) in subframe %d for symbol %d\n",mod_order, subframe_offset,l);
 #endif
 
     re_offset = frame_parms->first_carrier_offset;
@@ -2647,7 +2648,7 @@ int mch_modulation(int32_t **txdataF,
       else
         qam_table_s = NULL;
 
-      //printf("Allocated rb %d, subframe_offset %d,amp %d\n",rb,subframe_offset,amp);
+      //LOG_I(PHY,"Allocated rb %d, subframe_offset %d,amp %d\n",rb,subframe_offset,amp);
       allocate_REs_in_RB_MCH(txdataF,
                              &jj,
                              re_offset,
@@ -2674,7 +2675,7 @@ int mch_modulation(int32_t **txdataF,
   }
 
 #ifdef DEBUG_DLSCH_MODULATION
-  printf("generate_dlsch(MCH) : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch->harq_processes[0]->nb_rb,dlsch->harq_processes[0]->rb_alloc,mod_order,1,2,0,subframe_offset,1/*transmission mode*/));
+  LOG_I(PHY,"generate_dlsch(MCH) : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch->harq_processes[0]->nb_rb,dlsch->harq_processes[0]->rb_alloc,mod_order,1,2,0,subframe_offset,1/*transmission mode*/));
 #endif
 
   return (re_allocated);
diff --git a/openair1/PHY/LTE_TRANSPORT/pbch.c b/openair1/PHY/LTE_TRANSPORT/pbch.c
index d2632f5b3b4bfa4ca82affccd1b95573de10672b..9e5b6757fc84e9411c32e28fecd2465b575aac0b 100644
--- a/openair1/PHY/LTE_TRANSPORT/pbch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pbch.c
@@ -169,6 +169,8 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
   pbch_E  = (frame_parms->Ncp==NORMAL) ? 1920 : 1728; //RE/RB * #RB * bits/RB (QPSK)
   //  pbch_E_bytes = pbch_coded_bits>>3;
 
+  LOG_D(PHY,"%s(eNB_pbch:%p txdataF:%p amp:%d frame_parms:%p pbch_pdu:%p frame_mod4:%d)\n", __FUNCTION__, eNB_pbch, txdataF, amp, frame_parms, pbch_pdu, frame_mod4==0);
+
   if (frame_mod4==0) {
     bzero(pbch_a,PBCH_A>>3);
     bzero(eNB_pbch->pbch_e,pbch_E);
diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c
index 13d7c44f2ff26ae5692d44a6d4d60f444c7b6059..2bd7140c32ccc96524b58d9e489280bae5cf7754 100644
--- a/openair1/PHY/LTE_TRANSPORT/phich.c
+++ b/openair1/PHY/LTE_TRANSPORT/phich.c
@@ -158,7 +158,7 @@ int phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms, int frame, int sub
     pusch_frame = (frame);
   }
 
-  LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, subframe, pusch_frame);
+  //LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, subframe, pusch_frame);
   return pusch_frame % 1024;
 }
 
diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c
index 56d9ce6d00ef4826780307c4e31277a45db98c3c..a332670a5992dd05cafd76779e90d5f6c942cfa1 100644
--- a/openair1/PHY/LTE_TRANSPORT/prach.c
+++ b/openair1/PHY/LTE_TRANSPORT/prach.c
@@ -39,6 +39,7 @@
 #include "UTIL/LOG/vcd_signal_dumper.h"
 
 //#define PRACH_DEBUG 1
+//#define PRACH_WRITE_OUTPUT_DEBUG 1
 
 uint16_t NCS_unrestricted[16] = {0,13,15,18,22,26,32,38,46,59,76,93,119,167,279,419};
 uint16_t NCS_restricted[15]   = {15,18,22,26,32,38,46,55,68,82,100,128,158,202,237}; // high-speed case
@@ -560,7 +561,7 @@ int is_prach_subframe0(LTE_DL_FRAME_PARMS *frame_parms,uint8_t prach_ConfigIndex
     t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
     t2_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t2_ra;
 #ifdef PRACH_DEBUG
-    LOG_D(PHY,"[PRACH] Checking for PRACH format (ConfigIndex %d) in TDD subframe %d (%d,%d,%d)\n",
+    LOG_I(PHY,"[PRACH] Checking for PRACH format (ConfigIndex %d) in TDD subframe %d (%d,%d,%d)\n",
           prach_ConfigIndex,
           subframe,
           t0_ra,t1_ra,t2_ra);
@@ -653,7 +654,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
 
 #else //normal case (simulation)
   prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset;
-  LOG_D(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
+  LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
     prach_start,
     ue->rx_offset,
     ue->hw_timing_advance,
@@ -721,7 +722,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
   } else { // This is the high-speed case
 
 #ifdef PRACH_DEBUG
-    LOG_D(PHY,"[UE %d] High-speed mode, NCS_config %d\n",ue->Mod_id,Ncs_config);
+    LOG_I(PHY,"[UE %d] High-speed mode, NCS_config %d\n",ue->Mod_id,Ncs_config);
 #endif
 
     not_found = 1;
@@ -782,7 +783,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
 #ifdef PRACH_DEBUG
 
   if (NCS>0)
-    LOG_D(PHY,"Generate PRACH for RootSeqIndex %d, Preamble Index %d, NCS %d (NCS_config %d, N_ZC/NCS %d) n_ra_prb %d: Preamble_offset %d, Preamble_shift %d\n",
+    LOG_I(PHY,"Generate PRACH for RootSeqIndex %d, Preamble Index %d, NCS %d (NCS_config %d, N_ZC/NCS %d) n_ra_prb %d: Preamble_offset %d, Preamble_shift %d\n",
           rootSequenceIndex,preamble_index,NCS,Ncs_config,N_ZC/NCS,n_ra_prb,
           preamble_offset,preamble_shift);
 
@@ -1037,14 +1038,14 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
     break;
   }
 
-  //LOG_D(PHY,"prach_len=%d\n",prach_len);
+  //LOG_I(PHY,"prach_len=%d\n",prach_len);
 
   AssertFatal(prach_fmt<4,
 	      "prach_fmt4 not fully implemented" );
 #if defined(EXMIMO) || defined(OAI_USRP)
   int j;
   int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti;
-  LOG_D( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow );
+  LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow );
   
   for (i=prach_start,j=0; i<min(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) {
     ((int16_t*)ue->common_vars.txdata[0])[2*i] = prach[2*j]<<4;
@@ -1077,7 +1078,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
   
 
   
-#if 0
+#if defined(PRACH_WRITE_OUTPUT_DEBUG)
   write_output("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1);
   write_output("prach_tx0.m","prachtx0",prach+(Ncp<<1),prach_len-Ncp,1,1);
   write_output("txsig.m","txs",(int16_t*)(&ue->common_vars.txdata[0][0]),2*ue->frame_parms.samples_per_tti,1,1);
@@ -1112,7 +1113,9 @@ void rx_prach0(PHY_VARS_eNB *eNB,
   uint8_t            restricted_set;      
   uint8_t            n_ra_prb;
 
+#ifdef PRACH_DEBUG
   int                frame;
+#endif
   int                subframe;
   int16_t            *prachF=NULL;
   int16_t            **rxsigF=NULL;
@@ -1129,7 +1132,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
   uint16_t numshift=0;
   uint16_t *prach_root_sequence_map;
   uint8_t not_found;
-  int k;
+  int k=0;
   uint16_t u;
   int16_t *Xu;
   uint16_t offset;
@@ -1150,8 +1153,6 @@ void rx_prach0(PHY_VARS_eNB *eNB,
   int en0=0;
 #endif
 
-  (void)frame; /* avoid gcc warnings */
-
   if (ru) { 
     fp    = &ru->frame_parms;
     nb_rx = ru->nb_rx;
@@ -1202,7 +1203,9 @@ void rx_prach0(PHY_VARS_eNB *eNB,
 #ifdef Rel14
     if (br_flag == 1) {
       prach_ifftp         = eNB->prach_vars_br.prach_ifft[ce_level];
+#ifdef PRACH_DEBUG
       frame               = eNB->proc.frame_prach_br;
+#endif
       subframe            = eNB->proc.subframe_prach_br;
       prachF              = eNB->prach_vars_br.prachF;
       rxsigF              = eNB->prach_vars_br.rxsigF[ce_level];
@@ -1219,19 +1222,23 @@ void rx_prach0(PHY_VARS_eNB *eNB,
 #endif
       {
         prach_ifftp       = eNB->prach_vars.prach_ifft[0];
+#ifdef PRACH_DEBUG
         frame             = eNB->proc.frame_prach;
+#endif
         subframe          = eNB->proc.subframe_prach;
         prachF            = eNB->prach_vars.prachF;
         rxsigF            = eNB->prach_vars.rxsigF[0];
 #ifdef PRACH_DEBUG
-        if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n",
-				     subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
+        //if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
 #endif
       }
   }
   else {
 #ifdef Rel14
     if (br_flag == 1) {
+#ifdef PRACH_DEBUG
+        frame             = ru->proc.frame_prach_br;
+#endif
         subframe          = ru->proc.subframe_prach_br;
         rxsigF            = ru->prach_rxsigF_br[ce_level];
 #ifdef PRACH_DEBUG
@@ -1242,6 +1249,9 @@ void rx_prach0(PHY_VARS_eNB *eNB,
     else
 #endif
       {
+#ifdef PRACH_DEBUG
+        frame             = ru->proc.frame_prach;
+#endif
         subframe          = ru->proc.subframe_prach;
         rxsigF            = ru->prach_rxsigF;
 #ifdef PRACH_DEBUG
@@ -1256,9 +1266,32 @@ void rx_prach0(PHY_VARS_eNB *eNB,
 
   for (aa=0; aa<nb_rx; aa++) {
     if (ru->if_south == LOCAL_RF) { // set the time-domain signal if we have to use it in this node
+      // DJP - indexing below in subframe zero takes us off the beginning of the array???
       prach[aa] = (int16_t*)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset];
 #ifdef PRACH_DEBUG
-	if ((frame&1023) < 20) LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d, : prach %p (energy %d)\n",ru->idx,br_flag,ce_level,frame,subframe,prach[aa],dB_fixed(en0=signal_energy(prach[aa],fp->samples_per_tti))); 
+      int32_t en0=signal_energy((int32_t*)prach[aa],fp->samples_per_tti);
+      int8_t dbEn0 = dB_fixed(en0);
+      int8_t rach_dBm = dbEn0 - eNB->rx_total_gain_dB;
+
+#ifdef PRACH_WRITE_OUTPUT_DEBUG
+        if (dbEn0>32 && prach[0]!= NULL)
+        {
+          static int counter=0;
+
+          char buffer[80];
+          //counter++;
+          sprintf(buffer, "%s%d", "/tmp/prach_rx",counter);
+          write_output(buffer,"prach_rx",prach[0],fp->samples_per_tti,1,13);
+        }
+#endif
+
+      if (dbEn0>32)
+      {
+#ifdef PRACH_WRITE_OUTPUT_DEBUG
+        if (prach[0]!= NULL) write_output("prach_rx","prach_rx",prach[0],fp->samples_per_tti,1,1);
+#endif
+        LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d per_tti:%d prach:%p (energy %d) TA:%d rach_dBm:%d rxdata:%p index:%d\n",ru->idx,br_flag,ce_level,frame,subframe,fp->samples_per_tti,prach[aa],dbEn0,ru->N_TA_offset,rach_dBm,ru->common.rxdata[aa], (subframe*fp->samples_per_tti)-ru->N_TA_offset);
+        }
 #endif
     }
   }
@@ -1341,7 +1374,9 @@ void rx_prach0(PHY_VARS_eNB *eNB,
   if (((eNB!=NULL) && (ru->function != NGFI_RAU_IF4p5))||
       ((eNB==NULL) && (ru->function == NGFI_RRU_IF4p5))) { // compute the DFTs of the PRACH temporal resources
     // Do forward transform
-    LOG_D(PHY,"rx_prach: Doing FFT for N_RB_UL %d\n",fp->N_RB_UL);
+#ifdef PRACH_DEBUG
+    LOG_D(PHY,"rx_prach: Doing FFT for N_RB_UL %d nb_rx:%d Ncp:%d\n",fp->N_RB_UL, nb_rx, Ncp);
+#endif
     for (aa=0; aa<nb_rx; aa++) {
       AssertFatal(prach[aa]!=NULL,"prach[%d] is null\n",aa);
       prach2 = prach[aa] + (Ncp<<1);
@@ -1446,7 +1481,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
       k+=13; 
       k*=2;
       int dftsize_x2 = fp->ofdm_symbol_size*24;
-      LOG_D(PHY,"Shifting prach_rxF from %d to 0\n",k);
+      //LOG_D(PHY,"Shifting prach_rxF from %d to 0\n",k);
 
       if ((k+(839*2)) > dftsize_x2) { // PRACH signal is split around DC 
 	memmove((void*)&rxsigF[aa][dftsize_x2-k],(void*)&rxsigF[aa][0],(k+(839*2)-dftsize_x2)*2);	
@@ -1476,7 +1511,6 @@ void rx_prach0(PHY_VARS_eNB *eNB,
     int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
     if ((en > 60)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,eNB->proc.frame_rx,eNB->proc.subframe_rx,en);
 #endif
-
   }
   
   // in case of RAU and prach received rx_thread wakes up prach
@@ -1621,7 +1655,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
 	}
 
       memset(prachF, 0, sizeof(int16_t)*2*1024 );
-#ifdef PRACH_DEBUG
+#if defined(PRACH_WRITE_OUTPUT_DEBUG)
       if (prach[0]!= NULL) write_output("prach_rx0.m","prach_rx0",prach[0],6144+792,1,1);
 #endif
       // write_output("prach_rx1.m","prach_rx1",prach[1],6144+792,1,1);
@@ -1655,7 +1689,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
 	    prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[(i<<1)] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>10;
 	}
 	
-#ifdef PRACH_DEBUG
+#if defined(PRACH_WRITE_OUTPUT_DEBUG)
 	if (aa==0) write_output("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
 #endif
       // if (aa=1) write_output("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
@@ -1704,19 +1738,22 @@ void rx_prach0(PHY_VARS_eNB *eNB,
     k*=2;
     
     if (br_flag == 0) {
-      /*
+#if defined(PRACH_WRITE_OUTPUT_DEBUG)
 	write_output("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
 	write_output("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
 	write_output("Xu.m","xu",Xu,N_ZC,1,1);
-	write_output("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);*/
+	write_output("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);
+#endif
     }
     else {
+#if defined(PRACH_WRITE_OUTPUT_DEBUG)
       printf("Dumping prach (br_flag %d), k = %d (n_ra_prb %d)\n",br_flag,k,n_ra_prb);
       write_output("rxsigF_br.m","prach_rxF_br",&rxsigF[0][0],12288,1,1);
       write_output("prach_rxF_comp0_br.m","prach_rxF_comp0_br",prachF,1024,1,1);
       write_output("Xu_br.m","xu_br",Xu,N_ZC,1,1);
       write_output("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1);
       exit(-1);      
+#endif
     }
 
   }
diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h
index 748d25fcbb12f4fe9fc7f109de4ec5161e28c7ec..8afb7b14a30841cff7d1883eb82dce8c56d91879 100644
--- a/openair1/PHY/LTE_TRANSPORT/proto.h
+++ b/openair1/PHY/LTE_TRANSPORT/proto.h
@@ -1716,13 +1716,15 @@ int generate_ue_dlsch_params_from_dci(int frame,
                                       uint16_t tc_rnti);
 
 void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,
+                        int frame,
+                        int subframe,
 			eNB_rxtx_proc_t *proc,
 			DCI_ALLOC_t *dci_alloc,
 			nfapi_dl_config_dci_dl_pdu *pdu);
 
 void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu);
 
-void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
+void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
 	      nfapi_hi_dci0_dci_pdu *pdu);
 
 void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe);
diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c
index c8da27bcb8cf3d60caf22f54e6c38f68750a3ffd..9a19b0ddaf3dee79997ca3af075bd9448b74d43b 100644
--- a/openair1/PHY/LTE_TRANSPORT/pucch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pucch.c
@@ -2455,9 +2455,9 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
         *(1+payload) = (stat_im<0) ? 1 : 2;
     } else { // insufficient energy on PUCCH so NAK
 #if defined(USRP_REC_PLAY)
-      LOG_I(PHY,"PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
+      LOG_D(PHY,"PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
 #else
-      LOG_I(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
+      LOG_D(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
 #endif      
       *payload = 4;  // DTX
       ((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re);
diff --git a/openair1/PHY/LTE_TRANSPORT/rar_tools.c b/openair1/PHY/LTE_TRANSPORT/rar_tools.c
index f10b79ed65645931e4f988a2a2f87fb20e93b46f..9934b71d78b0165c32d9b4df855e97779c43ee33 100644
--- a/openair1/PHY/LTE_TRANSPORT/rar_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/rar_tools.c
@@ -173,7 +173,9 @@ int generate_eNB_ulsch_params_from_rar(PHY_VARS_eNB *eNB,
 		 &ulsch_harq->frame,
 		 &ulsch_harq->subframe);
 
-  LOG_I(PHY,"Programming msg3 reception in (%d,%d)\n",ulsch_harq->frame,ulsch_harq->subframe);
+  LOG_I(PHY,"Programming msg3 reception in (%d,%d) mcs:%d TBS:%d Qm:%d Mcs_intial:%d Nsymb_intial:%d round:%d\n",
+      ulsch_harq->frame,ulsch_harq->subframe,
+      mcs, ulsch_harq->TBS, ulsch_harq->Qm, ulsch_harq->Msc_initial, ulsch_harq->Nsymb_initial, ulsch_harq->round);
   use_srs = is_srs_occasion_common(frame_parms,ulsch_harq->frame,ulsch_harq->subframe);
   ulsch_harq->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1);
   ulsch_harq->srs_active                            = use_srs;
@@ -185,7 +187,7 @@ int generate_eNB_ulsch_params_from_rar(PHY_VARS_eNB *eNB,
   LOG_D(PHY,"ulsch ra (eNB): harq_pid %d\n",harq_pid);
   LOG_D(PHY,"ulsch ra (eNB): round    %d\n",ulsch_harq->round);
   LOG_D(PHY,"ulsch ra (eNB): TBS      %d\n",ulsch_harq->TBS);
-  LOG_D(PHY,"ulsch ra (eNB): mcs      %d\n",ulsch_harq->mcs);
+  LOG_D(PHY,"ulsch ra (eNB): mcs      %d\n",ulsch_harq->Msc_initial);
   LOG_D(PHY,"ulsch ra (eNB): Or1      %d\n",ulsch_harq->Or1);
   LOG_D(PHY,"ulsch ra (eNB): ORI      %d\n",ulsch_harq->O_RI);
 #endif
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
index bf7d2603f711ce2261c8cebbb8d67a99739c0549..4bf442c730a85acb3719c888acb79716010fbbd6 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
@@ -869,12 +869,13 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
   int16_t cseq[6*14*1200] __attribute__((aligned(32)));
   int off;
 
+  int frame = proc->frame_rx;
   int subframe = proc->subframe_rx;
   LTE_UL_eNB_HARQ_t *ulsch_harq;
 
 
 
-  harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
+  harq_pid = subframe2harq_pid(frame_parms,frame,subframe);
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1);
 
@@ -899,7 +900,8 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
 
 
   //#ifdef DEBUG_ULSCH_DECODING
-  LOG_D(PHY,"Frame %d, Subframe %d: ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): A %d, round %d, RV %d, O_r1 %d, O_RI %d, O_ACK %d, G %d\n",
+  LOG_D(PHY,"[PUSCH %d] Frame %d, Subframe %d: ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): A %d, round %d, RV %d, O_r1 %d, O_RI %d, O_ACK %d, G %d, Q_m %d Nsymb_pusch %d nb_rb %d\n",
+      harq_pid,
 	proc->frame_rx,subframe,
 	frame_parms->Nid_cell,ulsch->rnti,x2,
 	A,
@@ -908,7 +910,10 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
 	ulsch_harq->Or1,
 	ulsch_harq->O_RI,
 	ulsch_harq->O_ACK,
-	G);
+	G,
+        ulsch_harq->Qm,
+        ulsch_harq->Nsymb_pusch,
+        nb_rb);
 	
   //#endif
 
@@ -1255,7 +1260,7 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
   }
 
   if (ulsch_harq->O_ACK > 2) {
-    LOG_E(PHY,"ulsch_decoding: FATAL, ACK cannot be more than 2 bits yet\n");
+    LOG_E(PHY,"ulsch_decoding: FATAL, ACK cannot be more than 2 bits yet O_ACK:%d SFN/SF:%04d%d UE_id:%d rnti:%x\n",ulsch_harq->O_ACK,proc->frame_rx,proc->subframe_rx,UE_id,ulsch->rnti);
     return(-1);
   }
 
@@ -1567,6 +1572,7 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
 #endif
   }
 
+  LOG_D(PHY,"frame %d subframe %d O_ACK:%d o_ACK[]=%d:%d:%d:%d\n",frame,subframe,ulsch_harq->O_ACK,ulsch_harq->o_ACK[0],ulsch_harq->o_ACK[1],ulsch_harq->o_ACK[2],ulsch_harq->o_ACK[3]);
 
   // Do ULSCH Decoding for data portion
 
diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h
index 2ff778907de8fbce6cdd95fe72272a3b7990b2ec..ac54be36fb426c104d2811d40643f4f42676c431 100644
--- a/openair1/PHY/impl_defs_lte.h
+++ b/openair1/PHY/impl_defs_lte.h
@@ -819,7 +819,7 @@ typedef struct {
   uint8_t narrowband;
   /// number of PRB pairs for MPDCCH
   uint8_t number_of_prb_pairs;
-  /// mpdcch resource assignement (combinatorial index r)
+  /// mpdcch resource assignment (combinatorial index r)
   uint8_t resource_block_assignment;
   /// transmission type (0=localized,1=distributed) 
   uint8_t transmission_type;
diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c
index 70c4ea03fc58dab3c96caf0e349872a52c6518f8..7c6ded9ba9a8352ed68d52d4aff396eee3b76ea2 100644
--- a/openair1/SCHED/fapi_l1.c
+++ b/openair1/SCHED/fapi_l1.c
@@ -37,18 +37,29 @@
 #include "nfapi_interface.h"
 #include "fapi_l1.h"
 
+int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req);
+int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req);
+int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
+int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req);
+
+extern uint8_t nfapi_mode;
+
+
 void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,
+                             int frame, int subframe,
                              eNB_rxtx_proc_t *proc,
                              nfapi_dl_config_request_pdu_t *dl_config_pdu)
 {
-  int idx                         = proc->subframe_tx&1;
+  int idx                         = subframe&1;
   LTE_eNB_PDCCH *pdcch_vars       = &eNB->pdcch_vars[idx];
   nfapi_dl_config_dci_dl_pdu *pdu = &dl_config_pdu->dci_dl_pdu;
 
-  LOG_D(PHY,"Frame %d, Subframe %d: DCI processing\n",proc->frame_tx,proc->subframe_tx);
+  LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populating pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",frame,subframe, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci);
 
   // copy dci configuration into eNB structure
-  fill_dci_and_dlsch(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],pdu);
+  fill_dci_and_dlsch(eNB,frame,subframe,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],pdu);
+
+  LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populated pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",proc->frame_tx,proc->subframe_tx, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci);
 }
 
 #ifdef Rel14
@@ -67,26 +78,30 @@ void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,
 }
 #endif
 
-void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
+void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
                                   nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu)
 {
-  int idx                         = proc->subframe_tx&1;
+  int idx                         = subframe&1;
   LTE_eNB_PDCCH *pdcch_vars       = &eNB->pdcch_vars[idx];
+
+  //LOG_D(PHY,"%s() SFN/SF:%04d%d Before num_dci:%d\n", __FUNCTION__,frame,subframe,pdcch_vars->num_dci);
+
   // copy dci configuration in to eNB structure
-  fill_dci0(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->dci_pdu);
+  fill_dci0(eNB,frame,subframe,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->dci_pdu);
 }
 
-void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
+void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
                                  nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu)
 {
-  LTE_eNB_PHICH *phich           = &eNB->phich_vars[proc->subframe_tx&1];
+  LTE_eNB_PHICH *phich = &eNB->phich_vars[subframe&1];
 
   // copy dci configuration in to eNB structure
-  LOG_D(PHY,"Received HI PDU which value %d (rbstart %d,cshift %d)\n",
+  LOG_D(PHY,"Received HI PDU with value %d (rbstart %d,cshift %d)\n",
         hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value,
         hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start,
         hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms);
 
+  // DJP - TODO FIXME - transmission power ignored
   phich->config[phich->num_hi].hi       = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value;
   phich->config[phich->num_hi].first_rb = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start;
   phich->config[phich->num_hi].n_DMRS   = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms;
@@ -102,7 +117,7 @@ void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
 
   AssertFatal(rel8->length == 3, "BCH PDU has length %d != 3\n",rel8->length);
 
-  LOG_D(PHY,"bch_pdu: %x,%x,%x\n",sdu[0],sdu[1],sdu[2]);
+  //LOG_D(PHY,"bch_pdu: %x,%x,%x\n",sdu[0],sdu[1],sdu[2]);
   eNB->pbch_pdu[0] = sdu[2];
   eNB->pbch_pdu[1] = sdu[1];
   eNB->pbch_pdu[2] = sdu[0];
@@ -121,7 +136,7 @@ extern uint32_t localRIV2alloc_LUT100_2[6000];
 extern uint32_t localRIV2alloc_LUT100_3[6000];
 #endif
 
-void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
+void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
                             nfapi_dl_config_request_pdu_t *dl_config_pdu,
                             uint8_t codeword_index,
                             uint8_t *sdu)
@@ -146,11 +161,25 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
   dlsch1 = eNB->dlsch[UE_id][1];
 
 #ifdef Rel14
-  if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[proc->subframe_tx] = 0;
+  if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[subframe] = 0;
 #endif
 
-  harq_pid        = dlsch0->harq_ids[proc->subframe_tx];
-  AssertFatal((harq_pid>=0) && (harq_pid<8),"harq_pid %d not in 0...7\n",harq_pid);
+  harq_pid        = dlsch0->harq_ids[subframe];
+  AssertFatal((harq_pid>=0) && (harq_pid<8),"harq_pid %d not in 0...7 frame:%d subframe:%d subframe(TX):%d rnti:%x UE_id:%d dlsch0[harq_ids:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d]\n",
+      harq_pid,
+      frame,subframe,
+      proc->subframe_tx,rel8->rnti,UE_id,
+      dlsch0->harq_ids[0],
+      dlsch0->harq_ids[1],
+      dlsch0->harq_ids[2],
+      dlsch0->harq_ids[3],
+      dlsch0->harq_ids[4],
+      dlsch0->harq_ids[5],
+      dlsch0->harq_ids[6],
+      dlsch0->harq_ids[7],
+      dlsch0->harq_ids[8],
+      dlsch0->harq_ids[9]
+      );
   dlsch0_harq     = dlsch0->harq_processes[harq_pid];
   dlsch1_harq     = dlsch1->harq_processes[harq_pid];
   AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n");
@@ -167,20 +196,21 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
     computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off);
   }
 
-  dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols;
+  dlsch0_harq->pdsch_start = eNB->pdcch_vars[subframe & 1].num_pdcch_symbols;
 
   if (dlsch0_harq->round==0) {  //get pointer to SDU if this a new SDU
-    AssertFatal(sdu!=NULL,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d\n",
+    AssertFatal(sdu!=NULL,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d dlsch0_harq[round:%d SFN/SF:%d%d pdu:%p mcs:%d ndi:%d pdschstart:%d]\n",
+                frame,subframe,
                 proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid,
-                dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index);
-    if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n",
-                                    proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid);
+                dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe,dlsch0_harq->pdu,dlsch0_harq->mcs,dlsch0_harq->ndi,dlsch0_harq->pdsch_start);
+    if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d, subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n",
+                                    frame,subframe,proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid);
     if (codeword_index == 0) dlsch0_harq->pdu                    = sdu;
     else                     dlsch1_harq->pdu                    = sdu;
   }
   else {
-    if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n",
-                                    proc->frame_tx,proc->subframe_tx,dlsch0_harq->round,
+    if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d, subframe %d]: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n",
+                                    frame,subframe,proc->frame_tx,proc->subframe_tx,dlsch0_harq->round,
                                     rel8->rnti,UE_id,harq_pid);
   }
 
@@ -192,8 +222,6 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
     dlsch0->Kmimo            = 1;
     dlsch0->Mdlharq          = 4;
     dlsch0->Nsoft            = 25344;
-    dlsch0->i0               = rel13->initial_transmission_sf_io;
-    dlsch0_harq->pdsch_start = rel10->pdsch_start;
 
     if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1;
 
@@ -235,11 +263,16 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
     dlsch0_harq->TBS                = rel8->length<<3;
     dlsch0_harq->Qm                 = rel8->modulation;
     dlsch0_harq->codeword           = 0;
-  }
-  else {
-    dlsch0->i0               = 0xFFFF;
+    dlsch0_harq->pdsch_start        = rel10->pdsch_start;
   }
 #endif
+  dlsch0->i0               = rel13->initial_transmission_sf_io;
+
+  LOG_D(PHY,"dlsch->i0:%04x dlsch0_harq[pdsch_start:%d nb_rb:%d vrb_type:%d rvidx:%d Nl:%d mimo_mode:%d dl_power_off:%d round:%d status:%d TBS:%d Qm:%d codeword:%d rb_alloc:%d] rel8[length:%d]\n", 
+      dlsch0->i0, 
+      dlsch0_harq->pdsch_start, dlsch0_harq->nb_rb, dlsch0_harq->vrb_type, dlsch0_harq->rvidx, dlsch0_harq->Nl, dlsch0_harq->mimo_mode, dlsch0_harq->dl_power_off, dlsch0_harq->round, dlsch0_harq->status, dlsch0_harq->TBS, dlsch0_harq->Qm, dlsch0_harq->codeword, dlsch0_harq->rb_alloc[0],
+      rel8->length
+      );
 }
 
 uint16_t to_beta_offset_harqack[16]={16,20,25,32,40,50,64,80,101,127,160,248,400,640,1008,8};
@@ -495,8 +528,7 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
   if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) {
     AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
                 "No existing UE ULSCH for rnti %x\n",rel8->rnti);
-    LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d\n",
-          UE_id,rel8->rnti,frame,subframe);
+    //LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d\n", UE_id,rel8->rnti,frame,subframe);
 
     fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe);
 
@@ -588,8 +620,11 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
   ul_subframe = pdcch_alloc2ul_subframe(fp,subframe);
   ul_frame    = pdcch_alloc2ul_frame(fp,frame,subframe);
 
-  AssertFatal(proc->subframe_tx == subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe);
-  AssertFatal(proc->frame_tx == frame, "Current frame %d != NFAPI frame %d\n",proc->frame_tx,frame);
+  // DJP - subframe assert will fail - not sure why yet
+  // DJP - AssertFatal(proc->subframe_tx == subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe);
+  // DJP - AssertFatal(proc->subframe_tx == subframe, "Current frame %d != NFAPI frame %d\n",proc->frame_tx,frame);
+
+  uint8_t number_pdcch_ofdm_symbols = DL_req->dl_config_request_body.number_pdcch_ofdm_symbols;
 
   uint8_t number_dl_pdu             = DL_req->dl_config_request_body.number_pdu;
   uint8_t number_hi_dci0_pdu        = HI_DCI0_req->hi_dci0_request_body.number_of_dci+HI_DCI0_req->hi_dci0_request_body.number_of_hi;
@@ -601,15 +636,21 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
 
   int i;
 
-  eNB->pdcch_vars[subframe&1].num_pdcch_symbols = DL_req->dl_config_request_body.number_pdcch_ofdm_symbols;
+  eNB->pdcch_vars[subframe&1].num_pdcch_symbols = number_pdcch_ofdm_symbols;
   eNB->pdcch_vars[subframe&1].num_dci           = 0;
   eNB->phich_vars[subframe&1].num_hi            = 0;
 
-
-  LOG_D(PHY,"NFAPI: Frame %d, Subframe %d (ul_subframe %d): received %d dl_pdu, %d tx_req, %d hi_dci0_config_req, %d UL_config \n",
-        frame,subframe,ul_subframe,number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu);
-
-
+  LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d hi_dci0:SFN/SF:%04d%d:pdus:%d ul_cfg:SFN/SF:%04d%d:pdus:%d num_pdcch_symbols:%d\n",
+        frame,subframe,
+        NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),number_dl_pdu,
+        NFAPI_SFNSF2SFN(TX_req->sfn_sf),NFAPI_SFNSF2SF(TX_req->sfn_sf),TX_req->tx_request_body.number_of_pdus,
+        NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),number_hi_dci0_pdu,
+        NFAPI_SFNSF2SFN(UL_req->sfn_sf),NFAPI_SFNSF2SF(UL_req->sfn_sf),number_ul_pdu, 
+        eNB->pdcch_vars[subframe&1].num_pdcch_symbols);
+
+  int do_oai =0;
+  int dont_send =0;
+  
   if (ul_subframe<10) { // This means that there is an ul_subframe that can be configured here
     LOG_D(PHY,"NFAPI: Clearing dci allocations for potential UL\n");
     harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe);
@@ -626,11 +667,13 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
   }
   for (i=0;i<number_dl_pdu;i++) {
     dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i];
-    LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
+    //LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
     switch (dl_config_pdu->pdu_type) {
     case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
-      handle_nfapi_dci_dl_pdu(eNB,proc,dl_config_pdu);
-      eNB->pdcch_vars[subframe&1].num_dci++;
+      handle_nfapi_dci_dl_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu);
+      eNB->pdcch_vars[NFAPI_SFNSF2SF(DL_req->sfn_sf)&1].num_dci++;
+      //LOG_E(PHY,"Incremented num_dci:%d but already set??? dl_config:num_dci:%d\n", eNB->pdcch_vars[subframe&1].num_dci, number_dci);
+      do_oai=1;
       break;
     case NFAPI_DL_CONFIG_BCH_PDU_TYPE:
       AssertFatal(dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus,
@@ -638,6 +681,11 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
                   dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index,
                   TX_req->tx_request_body.number_of_pdus);
       eNB->pbch_configured=1;
+      do_oai=1;
+      //LOG_D(PHY,"%s() NFAPI_DL_CONFIG_BCH_PDU_TYPE TX:%d/%d RX:%d/%d TXREQ:%d/%d\n", 
+          //__FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx, NFAPI_SFNSF2SFN(TX_req->sfn_sf), NFAPI_SFNSF2SF(TX_req->sfn_sf));
+
+
       handle_nfapi_bch_pdu(eNB,proc,dl_config_pdu,
                            TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index].segments[0].segment_data);
       break;
@@ -645,22 +693,48 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
       //      handle_nfapi_mch_dl_pdu(eNB,dl_config_pdu);
       break;
     case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE:
+      {
+        nfapi_dl_config_dlsch_pdu_rel8_t *dlsch_pdu_rel8 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8;
+        uint16_t pdu_index = dlsch_pdu_rel8->pdu_index;
+        uint16_t tx_pdus = TX_req->tx_request_body.number_of_pdus;
+        uint16_t invalid_pdu = pdu_index == -1;
+        uint8_t *sdu = invalid_pdu ? NULL : pdu_index >= tx_pdus ? NULL : TX_req->tx_request_body.tx_pdu_list[pdu_index].segments[0].segment_data;
+
+        LOG_D(PHY,"%s() [PDU:%d] NFAPI_DL_CONFIG_DLSCH_PDU_TYPE SFN/SF:%04d%d TX:%d/%d RX:%d/%d transport_blocks:%d pdu_index:%d sdu:%p\n", 
+            __FUNCTION__, i, 
+            NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),
+            proc->frame_tx, proc->subframe_tx, 
+            proc->frame_rx, proc->subframe_rx, 
+            dlsch_pdu_rel8->transport_blocks, pdu_index, sdu);
+
       /*
       AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus,
                   "dlsch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n",
                   dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index,
                   TX_req->tx_request_body.number_of_pdus);
       */
-      AssertFatal((dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks<3) &&
-                  (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks>0),
-                  "dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = %d not in [1,2]\n",
-                  dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks);
-      handle_nfapi_dlsch_pdu(eNB,proc,dl_config_pdu,
-                             dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1,
-                             dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index == -1 ? NULL
-                               : TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data);
+      AssertFatal((dlsch_pdu_rel8->transport_blocks<3) &&
+                  (dlsch_pdu_rel8->transport_blocks>0),
+                  "dlsch_pdu_rel8->transport_blocks = %d not in [1,2]\n",
+                  dlsch_pdu_rel8->transport_blocks);
+      if (1)//sdu != NULL)
+      {
+        handle_nfapi_dlsch_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu, dlsch_pdu_rel8->transport_blocks-1, sdu);
+      }
+      else
+      {
+        dont_send=1;
+
+        LOG_E(MAC,"%s() NFAPI_DL_CONFIG_DLSCH_PDU_TYPE sdu is NULL DL_CFG:SFN/SF:%d:pdu_index:%d TX_REQ:SFN/SF:%d:pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(DL_req->sfn_sf), pdu_index, NFAPI_SFNSF2DEC(TX_req->sfn_sf), tx_pdus);
+      }
+
+      // Send the data first so that the DL_CONFIG can just pluck it out of the buffer
+      // DJP - OAI was here - moved to bottom
+      do_oai=1;
+
       /*
       if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu
+
         LOG_D(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n",frame,subframe);
         generate_eNB_ulsch_params_from_rar(eNB,
                                            TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,
@@ -668,6 +742,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
                                            subframe);
 
                                            }        */
+      }
       break;
     case NFAPI_DL_CONFIG_PCH_PDU_TYPE:
       //      handle_nfapi_pch_pdu(eNB,dl_config_pdu);
@@ -689,6 +764,18 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
 #endif    
     }
   }
+  
+  if (nfapi_mode && do_oai && !dont_send) {
+    oai_nfapi_tx_req(Sched_INFO->TX_req);
+
+    oai_nfapi_dl_config_req(Sched_INFO->DL_req); // DJP - .dl_config_request_body.dl_config_pdu_list[0]); // DJP - FIXME TODO - yuk - only copes with 1 pdu
+  }
+
+  if (nfapi_mode && number_hi_dci0_pdu!=0) {
+    oai_nfapi_hi_dci0_req(HI_DCI0_req);
+    eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_dci=0;
+    eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_pdcch_symbols=0;
+  }
 
   for (i=0;i<number_hi_dci0_pdu;i++) {
 
@@ -698,31 +785,42 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
 
     switch (hi_dci0_req_pdu->pdu_type) {
 
+      case NFAPI_HI_DCI0_DCI_PDU_TYPE:
 
-    case NFAPI_HI_DCI0_DCI_PDU_TYPE:
-      handle_nfapi_hi_dci0_dci_pdu(eNB,proc,hi_dci0_req_pdu);
-      eNB->pdcch_vars[subframe&1].num_dci++;
-      break;
+        handle_nfapi_hi_dci0_dci_pdu(eNB,NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),proc,hi_dci0_req_pdu);
 
-    case NFAPI_HI_DCI0_HI_PDU_TYPE:
-      handle_nfapi_hi_dci0_hi_pdu(eNB,proc,hi_dci0_req_pdu);
+        eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_dci++;
+        break;
 
-      break;
+      case NFAPI_HI_DCI0_HI_PDU_TYPE:
+        handle_nfapi_hi_dci0_hi_pdu(eNB,NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),proc,hi_dci0_req_pdu);
+        break;
     }
   }
 
-  for (i=0;i<number_ul_pdu;i++) {
-    ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i];
-    LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type);
-    AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
-                ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE ||
-                ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE ||
-                ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE ||
-                ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE ||
-                ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE ||
-                ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE
-                ,
-                "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type);
-    handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu,UL_req->sfn_sf>>4,UL_req->sfn_sf&0xf,UL_req->ul_config_request_body.srs_present);
+  if (nfapi_mode) {
+    if (number_ul_pdu>0)
+    {
+      //LOG_D(PHY, "UL_CONFIG to send to PNF\n");
+      oai_nfapi_ul_config_req(UL_req);
+      UL_req->ul_config_request_body.number_of_pdus=0;
+      number_ul_pdu=0;
+    }
+  }
+  else {
+    for (i=0;i<number_ul_pdu;i++) {
+      ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i];
+      LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type);
+      AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
+          ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE ||
+          ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE ||
+          ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE ||
+          ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE ||
+          ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE ||
+          ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE
+          ,
+          "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type);
+      handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu,UL_req->sfn_sf>>4,UL_req->sfn_sf&0xf,UL_req->ul_config_request_body.srs_present);
+    }
   }
 }
diff --git a/openair1/SCHED/fapi_l1.h b/openair1/SCHED/fapi_l1.h
index 3f4267c7f2139061ecb7bde4f05774b49b503a10..725bb31c455fdf6e11c4b917ac0801bfb9d1faa1 100644
--- a/openair1/SCHED/fapi_l1.h
+++ b/openair1/SCHED/fapi_l1.h
@@ -42,13 +42,13 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe
 void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat);
 void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe);
 void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag);
-void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu);
+void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu);
 void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu);
-void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
+void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
 				  nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu);
-void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
+void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
 				 nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu);
-void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,  
+void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
 			    nfapi_dl_config_request_pdu_t *dl_config_pdu,
 			    uint8_t codeword_index,
 			    uint8_t *sdu);
diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c
index c8675dd814c0a65d6effb31211b721caeadf98f3..01c44d6078f6df559cfaf0b99643d14d388eb736 100644
--- a/openair1/SCHED/phy_procedures_lte_common.c
+++ b/openair1/SCHED/phy_procedures_lte_common.c
@@ -918,7 +918,7 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf
   if(frame_parms->soundingrs_ul_config_common.enabled_flag)
   {
 
-    LOG_D(PHY," SRS SUBFRAMECONFIG: %d\n", frame_parms->soundingrs_ul_config_common.srs_SubframeConfig);
+    //LOG_D(PHY," SRS SUBFRAMECONFIG: %d\n", frame_parms->soundingrs_ul_config_common.srs_SubframeConfig);
 
       uint8_t  TSFC;
       uint16_t deltaTSFC; // bitmap
@@ -951,7 +951,7 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf
       }
       LOG_D(PHY," ISTDD: %d, TSFC: %d, deltaTSFC: %d, AbsSubframeTX: %d.%d\n", frame_parms->frame_type, TSFC, deltaTSFC, frame_tx, subframe_tx);
   }
-  LOG_D(PHY," isSubframeSRS %d\n", isSubframeSRS);
+  //LOG_D(PHY," isSubframeSRS %d\n", isSubframeSRS);
   return(isSubframeSRS);
 }
 
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index 179f37507aae94e4ca8d128f8d584c6c2cb69396..e813b8f619998fa69234e3adabe8635509a27623 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -50,6 +50,8 @@
 #   include "intertask_interface.h"
 #endif
 
+extern uint8_t nfapi_mode;
+int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
 
 
 
@@ -137,15 +139,13 @@ void pmch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,PHY_VARS_RN *rn,rel
 #endif
 }
 
-void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
+void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe) {
 
   LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
   int **txdataF = eNB->common_vars.txdataF;
   uint8_t *pbch_pdu=&eNB->pbch_pdu[0];
-  int subframe = proc->subframe_tx;
-  int frame = proc->frame_tx;
 
-  LOG_D(PHY,"common_signal_procedures: frame %d, subframe %d\n",frame,subframe); 
+  //LOG_D(PHY,"common_signal_procedures: frame %d, subframe %d fdd:%s dir:%s\n",frame,subframe,fp->frame_type == FDD?"FDD":"TDD", subframe_select(fp,subframe) == SF_DL?"DL":"UL?"); 
 
   // generate Cell-Specific Reference Signals for both slots
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,1);
@@ -196,7 +196,8 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
 
     /// generate PBCH
     if ((frame&3)==0) {
-      AssertFatal(eNB->pbch_configured==1,"PBCH was not configured by MAC\n");
+      //AssertFatal(eNB->pbch_configured==1,"PBCH was not configured by MAC\n");
+      if (eNB->pbch_configured!=1) return;
       eNB->pbch_configured=0;
     }
     generate_pbch(&eNB->pbch,
@@ -272,7 +273,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
 
   if (dlsch->rnti == 0x02) {//frame < 200) {
 
-    LOG_I(PHY,
+    LOG_D(PHY,
 	  "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n",
 	  eNB->Mod_id, dlsch->rnti,harq_pid,
 	  frame, subframe, input_buffer_length, dlsch_harq->pdsch_start,
@@ -332,42 +333,50 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
   }
 
 
-  LOG_D(PHY,"Generating DLSCH/PDSCH %d\n",ra_flag);
+  LOG_D(PHY,"Generating DLSCH/PDSCH pdu:%p pdsch_start:%d frame:%d subframe:%d nb_rb:%d rb_alloc:%d Qm:%d Nl:%d round:%d\n",
+      dlsch_harq->pdu,dlsch_harq->pdsch_start,frame,subframe,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0],dlsch_harq->Qm,dlsch_harq->Nl,dlsch_harq->round);
   // 36-212 
-  start_meas(&eNB->dlsch_encoding_stats);
-  AssertFatal(dlsch_harq->pdu!=NULL,"dlsch_harq->pdu == NULL (rnti %x)\n",dlsch->rnti);
-  eNB->te(eNB,
-	  dlsch_harq->pdu,
-	  dlsch_harq->pdsch_start,
-	  dlsch,
-	  frame,subframe,
-	  &eNB->dlsch_rate_matching_stats,
-	  &eNB->dlsch_turbo_encoding_stats,
-	  &eNB->dlsch_interleaving_stats);
-  stop_meas(&eNB->dlsch_encoding_stats);
+  if (nfapi_mode == 0 || nfapi_mode == 1) { // monolthic OR PNF - do not need turbo encoding on VNF
+
+    if (dlsch_harq->pdu==NULL){
+        LOG_E(PHY,"dlsch_harq->pdu == NULL SFN/SF:%04d%d dlsch[rnti:%x] dlsch_harq[pdu:%p pdsch_start:%d Qm:%d Nl:%d round:%d nb_rb:%d rb_alloc[0]:%d]\n", frame,subframe,dlsch->rnti, dlsch_harq->pdu,dlsch_harq->pdsch_start,dlsch_harq->Qm,dlsch_harq->Nl,dlsch_harq->round,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0]);
+      return;
+    }
+
+    start_meas(&eNB->dlsch_encoding_stats);
+
+    eNB->te(eNB,
+        dlsch_harq->pdu,
+        dlsch_harq->pdsch_start,
+        dlsch,
+        frame,subframe,
+        &eNB->dlsch_rate_matching_stats,
+        &eNB->dlsch_turbo_encoding_stats,
+        &eNB->dlsch_interleaving_stats);
+    stop_meas(&eNB->dlsch_encoding_stats);
   // 36-211
-  start_meas(&eNB->dlsch_scrambling_stats);
-  dlsch_scrambling(fp,
-		   0,
-		   dlsch,
-		   harq_pid,
-		   get_G(fp,
-			 dlsch_harq->nb_rb,
-			 dlsch_harq->rb_alloc,
-			 dlsch_harq->Qm,
-			 dlsch_harq->Nl,
-			 dlsch_harq->pdsch_start,
-			 frame,subframe,
-			 0),
-		   0,
-		   frame,
-		   subframe<<1);
-  stop_meas(&eNB->dlsch_scrambling_stats);
-  
-  start_meas(&eNB->dlsch_modulation_stats);
-  
+    start_meas(&eNB->dlsch_scrambling_stats);
+    dlsch_scrambling(fp,
+        0,
+        dlsch,
+        harq_pid,
+        get_G(fp,
+          dlsch_harq->nb_rb,
+          dlsch_harq->rb_alloc,
+          dlsch_harq->Qm,
+          dlsch_harq->Nl,
+          dlsch_harq->pdsch_start,
+          frame,subframe,
+          0),
+        0,
+        frame,
+        subframe<<1);
+    stop_meas(&eNB->dlsch_scrambling_stats);
+
+    start_meas(&eNB->dlsch_modulation_stats);
+
   
-  dlsch_modulation(eNB,
+    dlsch_modulation(eNB,
 		   eNB->common_vars.txdataF,
 		   AMP,
 		   subframe,
@@ -375,10 +384,13 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
 		   dlsch,
 		   dlsch1);
   
-  stop_meas(&eNB->dlsch_modulation_stats);
+    stop_meas(&eNB->dlsch_modulation_stats);
+  }
 
   dlsch->active = 0;
   dlsch_harq->round++;
+
+  LOG_D(PHY,"Generating DLSCH/PDSCH dlsch_harq[round:%d]\n",dlsch_harq->round);
 }
 
 
@@ -416,12 +428,14 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
   }
   
 
-  if (is_pmch_subframe(frame,subframe,fp)) {
-    pmch_procedures(eNB,proc,rn,r_type);
-  }
-  else {
-    // this is not a pmch subframe, so generate PSS/SSS/PBCH
-    common_signal_procedures(eNB,proc);
+  if (nfapi_mode == 0 || nfapi_mode == 1) {
+    if (is_pmch_subframe(frame,subframe,fp)) {
+      pmch_procedures(eNB,proc,rn,r_type);
+    }
+    else {
+      // this is not a pmch subframe, so generate PSS/SSS/PBCH
+      common_signal_procedures(eNB,proc->frame_tx, proc->subframe_tx);
+    }
   }
 
   // clear existing ulsch dci allocations before applying info from MAC  (this is table
@@ -475,30 +489,34 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
   num_dci           = eNB->pdcch_vars[subframe&1].num_dci;
   //  LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(dci common %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,
   //        DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
-  LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(number dci %"PRIu8"\n",num_pdcch_symbols,
-	num_dci);
+  LOG_D(PHY,"num_pdcch_symbols %"PRIu8",number dci %"PRIu8"\n",num_pdcch_symbols, num_dci);
   VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,num_pdcch_symbols);
 
 
   VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,(frame*10)+subframe);
 
   if (num_dci > 0)
-    LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8")\n",eNB->Mod_id,frame, subframe,
-	  num_dci);
+    LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8") num_pdcch_symbols:%d\n",eNB->Mod_id,frame, subframe, num_dci, num_pdcch_symbols);
+
+  //LOG_D(PHY,"Before generate_dci_top num_pdcch_symbols:%d num_dci:%d dci_alloc:dci_length:%d\n", num_pdcch_symbols, num_dci, eNB->pdcch_vars[subframe&1].dci_alloc[0].dci_length);
+
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1);
+
+  if (nfapi_mode == 0 || nfapi_mode == 1) {
+    generate_dci_top(num_pdcch_symbols,
+        num_dci,
+        &eNB->pdcch_vars[subframe&1].dci_alloc[0],
+        0,
+        AMP,
+        fp,
+        eNB->common_vars.txdataF,
+        subframe);
+  }
 
-    
-  generate_dci_top(num_pdcch_symbols,
-		   num_dci,
-		   &eNB->pdcch_vars[subframe&1].dci_alloc[0],
-		   0,
-		   AMP,
-		   fp,
-		   eNB->common_vars.txdataF,
-		   subframe);
-  
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0);
 
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1);
   // Now scan UE specific DLSCH
   LTE_eNB_DLSCH_t *dlsch0,*dlsch1;
   for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++)
@@ -513,33 +531,44 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
 	// get harq_pid
 	harq_pid = dlsch0->harq_ids[subframe];
 	AssertFatal(harq_pid>=0,"harq_pid is negative\n");
-	// generate pdsch
-	pdsch_procedures(eNB,
-			 proc,
-			 harq_pid,
-			 dlsch0,
-			 dlsch1,
-			 &eNB->UE_stats[(uint32_t)UE_id],
-			 0);
+
+        if (harq_pid>=8)
+        {
+          LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 UE_id:%d frame:%d subframe:%d rnti:%x\n", harq_pid,UE_id,frame,subframe,dlsch0->rnti);
+        }
+        else
+        {
+          // generate pdsch
+          pdsch_procedures(eNB,
+              proc,
+              harq_pid,
+              dlsch0,
+              dlsch1,
+              &eNB->UE_stats[(uint32_t)UE_id],
+              0);
+        }
 
 
       }
 
 
       else if ((dlsch0)&&
-	       (dlsch0->rnti>0)&&
-	       (dlsch0->active == 0)) {
+          (dlsch0->rnti>0)&&
+          (dlsch0->active == 0)) {
 
-	// clear subframe TX flag since UE is not scheduled for PDSCH in this subframe (so that we don't look for PUCCH later)
-	dlsch0->subframe_tx[subframe]=0;
+        // clear subframe TX flag since UE is not scheduled for PDSCH in this subframe (so that we don't look for PUCCH later)
+        dlsch0->subframe_tx[subframe]=0;
       }
     }
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,0);
 
 
 
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PHICH,1);
   generate_phich_top(eNB,
 		     proc,
 		     AMP);
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PHICH,0);
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,0);
   if (do_meas==1) stop_meas(&eNB->phy_proc_tx);
@@ -562,14 +591,14 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
     subframe = eNB->proc.subframe_prach_br;
     frame = eNB->proc.frame_prach_br;
     pthread_mutex_lock(&eNB->UL_INFO_mutex);
-    eNB->UL_INFO.rach_ind_br.number_of_preambles=0;
+    eNB->UL_INFO.rach_ind_br.rach_indication_body.number_of_preambles=0;
     pthread_mutex_unlock(&eNB->UL_INFO_mutex);
   }
   else
 #endif
     {
       pthread_mutex_lock(&eNB->UL_INFO_mutex);
-      eNB->UL_INFO.rach_ind.number_of_preambles=0;
+      eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles=0;
       pthread_mutex_unlock(&eNB->UL_INFO_mutex);
       subframe = eNB->proc.subframe_prach;
       frame = eNB->proc.frame_prach;
@@ -611,18 +640,19 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
   //#ifdef DEBUG_PHY_PROC
   LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n",
         frame,subframe,
-	max_preamble[0],
+        max_preamble[0],
         max_preamble_energy[0]/10,
         max_preamble_delay[0]);
   //q#endif
 
 #ifdef Rel14
   if (br_flag==1) {
+
     int prach_mask;
       
     prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br);
     
-    eNB->UL_INFO.rach_ind_br.preamble_list                              = eNB->preamble_list_br;
+    eNB->UL_INFO.rach_ind_br.rach_indication_body.preamble_list                              = eNB->preamble_list_br;
     int ind=0;
     int ce_level=0;
     /* Save for later, it doesn't work    
@@ -636,7 +666,7 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
     if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0]==1){ 
       if ((eNB->prach_energy_counter == 100) && 
           (max_preamble_energy[0] > eNB->measurements.prach_I0 + 100)) {
-	eNB->UL_INFO.rach_ind_br.number_of_preambles++;
+	eNB->UL_INFO.rach_ind_br.rach_indication_body.number_of_preambles++;
 	
 	eNB->preamble_list_br[ind].preamble_rel8.timing_advance        = max_preamble_delay[ind];//
 	eNB->preamble_list_br[ind].preamble_rel8.preamble              = max_preamble[ind];
@@ -681,20 +711,33 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
 	    
 	    pthread_mutex_lock(&eNB->UL_INFO_mutex);
 	    
-	    eNB->UL_INFO.rach_ind.number_of_preambles                 = 1;
-	    eNB->UL_INFO.rach_ind.preamble_list                       = eNB->preamble_list;
+	    eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles  = 1;
+	    eNB->UL_INFO.rach_ind.rach_indication_body.preamble_list        = &eNB->preamble_list[0];
+	    eNB->UL_INFO.rach_ind.rach_indication_body.tl.tag               = NFAPI_RACH_INDICATION_BODY_TAG;
+            eNB->UL_INFO.rach_ind.header.message_id                         = NFAPI_RACH_INDICATION;
+            eNB->UL_INFO.rach_ind.sfn_sf                                    = frame<<4 | subframe;
 	    
+	    eNB->preamble_list[0].preamble_rel8.tl.tag                = NFAPI_PREAMBLE_REL8_TAG;
 	    eNB->preamble_list[0].preamble_rel8.timing_advance        = max_preamble_delay[0];
 	    eNB->preamble_list[0].preamble_rel8.preamble              = max_preamble[0];
 	    eNB->preamble_list[0].preamble_rel8.rnti                  = 1+subframe;  // note: fid is implicitly 0 here
 	    eNB->preamble_list[0].preamble_rel13.rach_resource_type   = 0;
 	    eNB->preamble_list[0].instance_length                     = 0; //don't know exactly what this is
 	    
-	    LOG_D(PHY,"Filling NFAPI indication for RACH : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n",
-		  eNB->preamble_list[0].preamble_rel8.timing_advance,
-		  eNB->preamble_list[0].preamble_rel8.preamble,
-		  eNB->preamble_list[0].preamble_rel8.rnti,
-		  eNB->preamble_list[0].preamble_rel13.rach_resource_type);	    
+            if (nfapi_mode == 1) {  // If NFAPI PNF then we need to send the message to the VNF
+
+              LOG_D(PHY,"Filling NFAPI indication for RACH : SFN_SF:%d TA %d, Preamble %d, rnti %x, rach_resource_type %d\n",
+                  NFAPI_SFNSF2DEC(eNB->UL_INFO.rach_ind.sfn_sf),
+                  eNB->preamble_list[0].preamble_rel8.timing_advance,
+                  eNB->preamble_list[0].preamble_rel8.preamble,
+                  eNB->preamble_list[0].preamble_rel8.rnti,
+                  eNB->preamble_list[0].preamble_rel13.rach_resource_type);	    
+
+              oai_nfapi_rach_ind(&eNB->UL_INFO.rach_ind);
+
+              eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles = 0;
+            }
+
 	    pthread_mutex_unlock(&eNB->UL_INFO_mutex);
       
       } // max_preamble_energy > prach_I0 + 100 
@@ -743,21 +786,31 @@ void srs_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
 void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat) {
   
   pthread_mutex_lock(&eNB->UL_INFO_mutex);
-  nfapi_sr_indication_pdu_t *pdu =   &eNB->UL_INFO.sr_ind.sr_pdu_list[eNB->UL_INFO.sr_ind.number_of_srs];
+  nfapi_sr_indication_t       *sr_ind =         &eNB->UL_INFO.sr_ind;
+  nfapi_sr_indication_body_t  *sr_ind_body =    &sr_ind->sr_indication_body;
+  nfapi_sr_indication_pdu_t *pdu =   &sr_ind_body->sr_pdu_list[sr_ind_body->number_of_srs];
+
+  sr_ind->sfn_sf = frame<<4|subframe;
+  sr_ind->header.message_id = NFAPI_RX_SR_INDICATION;
+
+  sr_ind_body->tl.tag = NFAPI_SR_INDICATION_BODY_TAG;
 
   pdu->instance_length                                = 0; // don't know what to do with this
   //  pdu->rx_ue_information.handle                       = handle;
+  pdu->rx_ue_information.tl.tag                       = NFAPI_RX_UE_INFORMATION_TAG;
   pdu->rx_ue_information.rnti                         = rnti;
 
   int SNRtimes10 = dB_fixed_times10(stat) - 200;//(10*eNB->measurements.n0_power_dB[0]);
 
 
+  pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
+
   if      (SNRtimes10 < -640) pdu->ul_cqi_information.ul_cqi=0;
   else if (SNRtimes10 >  635) pdu->ul_cqi_information.ul_cqi=255;
   else                        pdu->ul_cqi_information.ul_cqi=(640+SNRtimes10)/5;
   pdu->ul_cqi_information.channel = 0;
 
-  eNB->UL_INFO.sr_ind.number_of_srs++;
+  sr_ind_body->number_of_srs++;
   pthread_mutex_unlock(&eNB->UL_INFO_mutex);
 }
 
@@ -1083,7 +1136,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
 		}
 	      }
             uci->stat = max_metric;
-            fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
+	    fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
 	    }
 	  } //else if ((uci->tdd_bundling == 0) && (res==3)) 
 	  else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==4)){ // multiplexing + no SR, implement Table 10.1.3-7 (Rel14) for multiplexing with M=4
@@ -1271,78 +1324,74 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
 
   const int subframe = proc->subframe_rx;
   const int frame    = proc->frame_rx;
-
+  
   if (fp->frame_type == FDD) harq_pid = ((10*frame) + subframe)&7;
   else                       harq_pid = subframe%10;
 
   for (i=0; i<NUMBER_OF_UE_MAX; i++) {
     ulsch = eNB->ulsch[i];
     ulsch_harq = ulsch->harq_processes[harq_pid];
-    if (ulsch->rnti>0) LOG_D(PHY,"Frame %d, subframe %d: PUSCH procedures, harq_pid %d, UE %d/%x\n",
-                             frame,subframe,harq_pid,i,ulsch->rnti);
-
+    if (ulsch->rnti>0) LOG_D(PHY,"eNB->ulsch[%d]->harq_processes[harq_pid:%d] SFN/SF:%04d%d: PUSCH procedures, UE %d/%x ulsch_harq[status:%d SFN/SF:%04d%d handled:%d]\n",
+			     i, harq_pid, frame,subframe,i,ulsch->rnti,
+                             ulsch_harq->status, ulsch_harq->frame, ulsch_harq->subframe, ulsch_harq->handled);
+    
     if ((ulsch) &&
         (ulsch->rnti>0) &&
         (ulsch_harq->status == ACTIVE) &&
-            (ulsch_harq->frame == frame) &&
-            (ulsch_harq->subframe == subframe) &&
+	    (ulsch_harq->frame == frame) &&
+	    (ulsch_harq->subframe == subframe) &&
         (ulsch_harq->handled == 0)) {
-
+      
       // UE has ULSCH scheduling
       for (int rb=0;
            rb<=ulsch_harq->nb_rb;
-           rb++) {
-        int rb2 = rb+ulsch_harq->first_rb;
-        eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
+	   rb++) {
+	int rb2 = rb+ulsch_harq->first_rb;
+	eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
       }
 
-      LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n",
-            eNB->Mod_id,
-            frame,
-            subframe,
-            i);
+      LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n", eNB->Mod_id, frame, subframe, i);
 
       nPRS = fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1];
 
       ulsch->cyclicShift = (ulsch_harq->n_DMRS2 +
-                            fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
-                            nPRS)%12;
+          fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
+          nPRS)%12;
 
       LOG_D(PHY,
-            "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d, beta_cqi %d \n",
-            eNB->Mod_id,harq_pid,frame,subframe,
-            ulsch_harq->dci_alloc,
-            ulsch_harq->rar_alloc,
-            ulsch_harq->round,
-            ulsch_harq->first_rb,
-            ulsch_harq->nb_rb,
-            ulsch_harq->Qm,
-            ulsch_harq->TBS,
-            ulsch_harq->rvidx,
-            ulsch->cyclicShift,
-            ulsch_harq->n_DMRS2,
-            fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift,
-            nPRS,
-            ulsch_harq->O_ACK,
-            ulsch->beta_offset_cqi_times8);
-
-      start_meas(&eNB->ulsch_demodulation_stats);
+          "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, ), O_ACK %d, beta_cqi %d \n",
+          eNB->Mod_id,harq_pid,frame,subframe,
+          ulsch_harq->dci_alloc,
+          ulsch_harq->rar_alloc,
+          ulsch_harq->round,
+          ulsch_harq->first_rb,
+          ulsch_harq->nb_rb,
+          ulsch_harq->Qm,
+          ulsch_harq->TBS,
+          ulsch_harq->rvidx,
+          ulsch->cyclicShift,
+          ulsch_harq->n_DMRS2,
+          fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift,
+          ulsch_harq->O_ACK,
+          ulsch->beta_offset_cqi_times8);
+
+        start_meas(&eNB->ulsch_demodulation_stats);
 
       rx_ulsch(eNB,proc, i);
 
-      stop_meas(&eNB->ulsch_demodulation_stats);
+        stop_meas(&eNB->ulsch_demodulation_stats);
 
-      start_meas(&eNB->ulsch_decoding_stats);
+        start_meas(&eNB->ulsch_decoding_stats);
 
-      ret = ulsch_decoding(eNB,proc,
-                           i,
-                           0, // control_only_flag
-                           ulsch_harq->V_UL_DAI,
-                           ulsch_harq->nb_rb>20 ? 1 : 0);
+        ret = ulsch_decoding(eNB,proc,
+            i,
+            0, // control_only_flag
+            ulsch_harq->V_UL_DAI,
+            ulsch_harq->nb_rb>20 ? 1 : 0);
 
-      stop_meas(&eNB->ulsch_decoding_stats);
+        stop_meas(&eNB->ulsch_decoding_stats);
 
-      LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n",
+        LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d ulsch_harq->cqi_crc_status:%d ackBits:%d ulsch_decoding_stats[t:%lld max:%lld]\n",
             eNB->Mod_id,harq_pid,
             frame,subframe,
             ulsch->rnti,
@@ -1352,51 +1401,54 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
             20,//eNB->measurements.n0_power_dB[1],
             ulsch_harq->o_ACK[0],
             ulsch_harq->o_ACK[1],
-            ret);
+            ret,
+            ulsch_harq->cqi_crc_status,
+            ulsch_harq->O_ACK,
+            eNB->ulsch_decoding_stats.diff_now, eNB->ulsch_decoding_stats.max);
 
-      //compute the expected ULSCH RX power (for the stats)
-      ulsch_harq->delta_TF = get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
+        //compute the expected ULSCH RX power (for the stats)
+        ulsch_harq->delta_TF = get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
 
-      if (ulsch_harq->cqi_crc_status == 1) {
+        if (ulsch_harq->cqi_crc_status == 1) {
 #ifdef DEBUG_PHY_PROC
-        //if (((frame%10) == 0) || (frame < 50))
-        print_CQI(ulsch_harq->o,ulsch_harq->uci_format,0,fp->N_RB_DL);
+          //if (((frame%10) == 0) || (frame < 50))
+          print_CQI(ulsch_harq->o,ulsch_harq->uci_format,0,fp->N_RB_DL);
 #endif
 
-        fill_ulsch_cqi_indication(eNB,frame,subframe,
-                                  ulsch_harq,
-                                  ulsch->rnti);
+	fill_ulsch_cqi_indication(eNB,frame,subframe,
+				  ulsch_harq,
+				  ulsch->rnti);
       }
-
+      
       if (ret == (1+MAX_TURBO_ITERATIONS)) {
         T(T_ENB_PHY_ULSCH_UE_NACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(ulsch->rnti),
           T_INT(harq_pid));
 
-        fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC
-        fill_rx_indication(eNB,i,frame,subframe);  // indicate SDU to MAC
+	fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC
+	fill_rx_indication(eNB,i,frame,subframe);  // indicate SDU to MAC
 
-        LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
-              eNB->Mod_id,harq_pid,
-              frame,subframe, i,
-              ulsch_harq->round-1,
-              ulsch->Mlimit,
-              ulsch_harq->o_ACK[0],
-              ulsch_harq->o_ACK[1]);
+	LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
+	      eNB->Mod_id,harq_pid,
+	      frame,subframe, i,
+	      ulsch_harq->round-1,
+	      ulsch->Mlimit,
+	      ulsch_harq->o_ACK[0],
+	      ulsch_harq->o_ACK[1]);
         if (ulsch_harq->round >= 3)  {
            ulsch_harq->status  = SCH_IDLE;
            ulsch_harq->handled = 0;
            ulsch->harq_mask   &= ~(1 << harq_pid);
            ulsch_harq->round   = 0;
-        } 
+	  }
 #if defined(MESSAGE_CHART_GENERATOR_PHY)
         MSC_LOG_RX_DISCARDED_MESSAGE(
-                                     MSC_PHY_ENB,MSC_PHY_UE,
-                                     NULL,0,
-                                     "%05u:%02u ULSCH received rnti %x harq id %u round %d",
-                                     frame,subframe,
-                                     ulsch->rnti,harq_pid,
-                                     ulsch_harq->round-1
-                                     );
+            MSC_PHY_ENB,MSC_PHY_UE,
+            NULL,0,
+            "%05u:%02u ULSCH received rnti %x harq id %u round %d",
+            frame,subframe,
+            ulsch->rnti,harq_pid,
+            ulsch_harq->round-1
+            );
 #endif
 
         /* Mark the HARQ process to release it later if max transmission reached
@@ -1407,8 +1459,8 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
         ulsch_harq->handled = 1;
       }  // ulsch in error
       else {
-        fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC
-        fill_rx_indication(eNB,i,frame,subframe);  // indicate SDU to MAC
+	fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC
+	fill_rx_indication(eNB,i,frame,subframe);  // indicate SDU to MAC
 
         ulsch_harq->status = SCH_IDLE;
         ulsch->harq_mask   &= ~(1 << harq_pid);
@@ -1417,27 +1469,27 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
           T_INT(harq_pid));
 
 #if defined(MESSAGE_CHART_GENERATOR_PHY)
-        MSC_LOG_RX_MESSAGE(
-                           MSC_PHY_ENB,MSC_PHY_UE,
-                           NULL,0,
-                           "%05u:%02u ULSCH received rnti %x harq id %u",
-                           frame,subframe,
-                           ulsch->rnti,harq_pid
-                           );
+          MSC_LOG_RX_MESSAGE(
+              MSC_PHY_ENB,MSC_PHY_UE,
+              NULL,0,
+              "%05u:%02u ULSCH received rnti %x harq id %u",
+              frame,subframe,
+              ulsch->rnti,harq_pid
+              );
 #endif
 
 #ifdef DEBUG_PHY_PROC
 #ifdef DEBUG_ULSCH
-        LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe,
-                harq_pid,ulsch_harq->TBS>>3);
+          LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe,
+              harq_pid,ulsch_harq->TBS>>3);
 
-        for (j=0; j<ulsch_harq->TBS>>3; j++)
-          LOG_T(PHY,"%x.",ulsch->harq_processes[harq_pid]->b[j]);
+          for (j=0; j<ulsch_harq->TBS>>3; j++)
+            LOG_T(PHY,"%x.",ulsch->harq_processes[harq_pid]->b[j]);
 
-        LOG_T(PHY,"\n");
+          LOG_T(PHY,"\n");
 #endif
 #endif
-      }  // ulsch not in error
+        }  // ulsch not in error
 
       if (ulsch_harq->O_ACK>0) fill_ulsch_harq_indication(eNB,ulsch_harq,ulsch->rnti,frame,subframe,ulsch->bundling);
 
@@ -1460,14 +1512,14 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
              (ulsch_harq->frame == frame) &&
              (ulsch_harq->subframe == subframe) &&
              (ulsch_harq->handled == 1)) {
-      // this harq process is stale, kill it, this 1024 frames later (10s), consider reducing that
-      ulsch_harq->status = SCH_IDLE;
+          // this harq process is stale, kill it, this 1024 frames later (10s), consider reducing that
+           ulsch_harq->status = SCH_IDLE;
       ulsch_harq->handled = 0;
       ulsch->harq_mask   &= ~(1 << harq_pid);
       LOG_W(PHY,"Removing stale ULSCH config for UE %x harq_pid %d (harq_mask is now 0x%2.2x)\n",
             ulsch->rnti, harq_pid, ulsch->harq_mask);
     }
-  }   //   for (i=0; i<NUMBER_OF_UE_MAX; i++) {
+  }   //   for (i=0; i<NUMBER_OF_UE_MAX; i++)
 }
 
 extern int oai_exit;
@@ -1513,16 +1565,22 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe)
   int sync_pos;
 
   uint32_t harq_pid = subframe2harq_pid(&eNB->frame_parms,
-                                        frame,subframe);
+					frame,subframe);
 
   pthread_mutex_lock(&eNB->UL_INFO_mutex);
-  pdu                                    = &eNB->UL_INFO.rx_ind.rx_pdu_list[eNB->UL_INFO.rx_ind.number_of_pdus];
+
+  eNB->UL_INFO.rx_ind.sfn_sf                    = frame<<4| subframe;
+  eNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
+
+  pdu                                    = &eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
 
   //  pdu->rx_ue_information.handle          = eNB->ulsch[UE_id]->handle;
+  pdu->rx_ue_information.tl.tag          = NFAPI_RX_UE_INFORMATION_TAG;
   pdu->rx_ue_information.rnti            = eNB->ulsch[UE_id]->rnti;
+  pdu->rx_indication_rel8.tl.tag         = NFAPI_RX_INDICATION_REL8_TAG;
   pdu->rx_indication_rel8.length         = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3;
-  pdu->rx_indication_rel8.offset         = 0;  // filled in at the end of the UL_INFO formation
-  pdu->data                              = eNB->ulsch[UE_id]->harq_processes[harq_pid]->b;
+  pdu->rx_indication_rel8.offset         = 1;   // DJP - I dont understand - but broken unless 1 ????  0;  // filled in at the end of the UL_INFO formation
+  pdu->data                              = eNB->ulsch[UE_id]->harq_processes[harq_pid]->b;  
   // estimate timing advance for MAC
   sync_pos                               = lte_est_timing_advance_pusch(eNB,UE_id);
   timing_advance_update                  = sync_pos; // - eNB->frame_parms.nb_prefix_samples/4; //to check
@@ -1551,11 +1609,12 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe)
   else if (SNRtimes10 >  635) pdu->rx_indication_rel8.ul_cqi=255;
   else                        pdu->rx_indication_rel8.ul_cqi=(640+SNRtimes10)/5;
 
-  LOG_D(PHY,"[PUSCH %d] Filling RX_indication with SNR %d (%d), timing_advance %d (update %d)\n",
-        harq_pid,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance,
-        timing_advance_update);
+  LOG_D(PHY,"[PUSCH %d] Frame %d Subframe %d Filling RX_indication with SNR %d (%d), timing_advance %d (update %d)\n",
+	harq_pid,frame,subframe,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance,
+	timing_advance_update);
 
-  eNB->UL_INFO.rx_ind.number_of_pdus++;
+  eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
+  eNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | subframe;
   pthread_mutex_unlock(&eNB->UL_INFO_mutex);
 }
 
@@ -1650,11 +1709,13 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe
   nfapi_cqi_indication_pdu_t *pdu         = &eNB->UL_INFO.cqi_ind.cqi_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis];
   nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis];
 
+  pdu->rx_ue_information.tl.tag          = NFAPI_RX_UE_INFORMATION_TAG;
   pdu->rx_ue_information.rnti = rnti;
   if (ulsch_harq->cqi_crc_status != 1) pdu->cqi_indication_rel9.data_offset = 0;
   else               pdu->cqi_indication_rel9.data_offset = 1; // fill in after all cqi_indications have been generated when non-zero
 
   // by default set O to rank 1 value
+  pdu->cqi_indication_rel9.tl.tag = NFAPI_CQI_INDICATION_REL9_TAG;
   pdu->cqi_indication_rel9.length = (ulsch_harq->Or1>>3) + ((ulsch_harq->Or1&7) > 0 ? 1 : 0);
   pdu->cqi_indication_rel9.ri[0]  = 0;
 
@@ -1669,6 +1730,8 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe
   pdu->ul_cqi_information.channel = 1; // PUSCH
   memcpy((void*)raw_pdu->pdu,ulsch_harq->o,pdu->cqi_indication_rel9.length);
   eNB->UL_INFO.cqi_ind.number_of_cqis++;
+  LOG_D(PHY,"eNB->UL_INFO.cqi_ind.number_of_cqis:%d\n", eNB->UL_INFO.cqi_ind.number_of_cqis);
+
   pthread_mutex_unlock(&eNB->UL_INFO_mutex);
 
 }
@@ -1676,18 +1739,33 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe
 void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling)
 {
   int UE_id = find_dlsch(rnti,eNB,SEARCH_EXIST);
-  AssertFatal(UE_id>=0,"UE_id doesn't exist\n");
+  //AssertFatal(UE_id>=0,"UE_id doesn't exist\n");
+
+  if (UE_id < 0)
+  {
+    LOG_E(PHY,"%s(eNB, ulsch_harq, rnti:%04x, frame:%d, subframe:%d, bundling:%d) harq_pdus:%d - Could not find rnti - abort fill of ulsch harq ind\n", __FUNCTION__, rnti, frame, subframe, bundling,eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs);
+    return;
+  }
+
+  LOG_D(PHY,"%s(eNB, ulsch_harq, rnti:%04x, frame:%d, subframe:%d, bundling:%d) harq_pdus:%d O_ACK:%d\n", __FUNCTION__, rnti, frame, subframe, bundling,eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs,ulsch_harq->O_ACK);
 
   pthread_mutex_lock(&eNB->UL_INFO_mutex);
-  nfapi_harq_indication_pdu_t *pdu =   &eNB->UL_INFO.harq_ind.harq_pdu_list[eNB->UL_INFO.harq_ind.number_of_harqs];
+  nfapi_harq_indication_pdu_t *pdu =   &eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs];
   int M;
   int i;
 
+  eNB->UL_INFO.harq_ind.header.message_id = NFAPI_HARQ_INDICATION;
+  eNB->UL_INFO.harq_ind.sfn_sf = frame<<4|subframe;
+
+  eNB->UL_INFO.harq_ind.harq_indication_body.tl.tag = NFAPI_HARQ_INDICATION_BODY_TAG;
+
   pdu->instance_length                                = 0; // don't know what to do with this
   //  pdu->rx_ue_information.handle                       = handle;
+  pdu->rx_ue_information.tl.tag                       = NFAPI_RX_UE_INFORMATION_TAG;
   pdu->rx_ue_information.rnti                         = rnti;
 
   if (eNB->frame_parms.frame_type == FDD) {
+    pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
     pdu->harq_indication_fdd_rel13.mode = 0;
     pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
 
@@ -1713,8 +1791,9 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,
     M=ul_ACK_subframe2_M(&eNB->frame_parms,
 			 subframe);
 
-    pdu->harq_indication_fdd_rel13.mode = 1-bundling;
-    pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
+    pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
+    pdu->harq_indication_tdd_rel13.mode = 1-bundling;
+    pdu->harq_indication_tdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
 
     for (i=0;i<ulsch_harq->O_ACK;i++) {
       AssertFatal(ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n",i,ulsch_harq->o_ACK[i]);
@@ -1732,7 +1811,9 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,
     }	
   }
 
-  eNB->UL_INFO.harq_ind.number_of_harqs++;
+  //LOG_E(PHY,"eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs);
+  eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++;
+
   pthread_mutex_unlock(&eNB->UL_INFO_mutex);
 }
 
@@ -1745,17 +1826,30 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
 			      uint16_t tdd_multiplexing_mask) {
 
   int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST);
-  AssertFatal(UE_id>=0,"UE_id doesn't exist\n");
-
+  //AssertFatal(UE_id>=0,"UE_id doesn't exist rnti:%x\n", uci->rnti);
+  if (UE_id < 0) {
+    LOG_E(PHY,"SFN/SF:%04d%d Unable to find rnti:%x do not send HARQ\n", frame, subframe, uci->rnti);
+    return;
+  }
 
   pthread_mutex_lock(&eNB->UL_INFO_mutex);
-  nfapi_harq_indication_pdu_t *pdu =   &eNB->UL_INFO.harq_ind.harq_pdu_list[eNB->UL_INFO.harq_ind.number_of_harqs];
 
+  nfapi_harq_indication_t *ind       = &eNB->UL_INFO.harq_ind;
+  nfapi_harq_indication_body_t *body = &ind->harq_indication_body;
+  nfapi_harq_indication_pdu_t *pdu   = &body->harq_pdu_list[eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs];
+
+  ind->sfn_sf = frame<<4|subframe;
+  ind->header.message_id = NFAPI_HARQ_INDICATION;
+
+  body->tl.tag = NFAPI_HARQ_INDICATION_BODY_TAG;
+ 
   pdu->instance_length                                = 0; // don't know what to do with this
   //  pdu->rx_ue_information.handle                       = handle;
+  pdu->rx_ue_information.tl.tag                       = NFAPI_RX_UE_INFORMATION_TAG;
   pdu->rx_ue_information.rnti                         = uci->rnti;
 
   // estimate UL_CQI for MAC (from antenna port 0 only)
+  pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
   int SNRtimes10 = dB_fixed_times10(uci->stat) - 200;//(10*eNB->measurements.n0_power_dB[0]);
 
   if (SNRtimes10 < -100) LOG_I(PHY,"uci->stat %d \n",uci->stat);
@@ -1767,6 +1861,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
 
   if (eNB->frame_parms.frame_type == FDD) {
     if (uci->pucch_fmt == pucch_format1a) {
+      pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
       pdu->harq_indication_fdd_rel13.mode = 0;  
       pdu->harq_indication_fdd_rel13.number_of_ack_nack = 1;
       
@@ -1785,6 +1880,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
 #endif
     }
     else if (uci->pucch_fmt == pucch_format1b) {
+      pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
       pdu->harq_indication_fdd_rel13.mode = 0;  
       pdu->harq_indication_fdd_rel13.number_of_ack_nack = 2;
       AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]);
@@ -1802,12 +1898,14 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
     AssertFatal(tdd_mapping_mode==0 || tdd_mapping_mode==1 || tdd_mapping_mode==2,
 		"Illegal tdd_mapping_mode %d\n",tdd_mapping_mode);
 
+    pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
     pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode;  
 
     switch (tdd_mapping_mode) {
     case 0: // bundling
 
       if (uci->pucch_fmt == pucch_format1a) {
+        pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
 	pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1;	
 	AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
 	pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0];
@@ -1818,6 +1916,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
 	pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2;
 	AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]);
 	AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]);
+        pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
 	pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0];
 	pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1]; 
 	// release all DLSCH if needed
@@ -1829,6 +1928,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
       AssertFatal(uci->pucch_fmt == pucch_format1b,"uci->pucch_format %d is not format1b\n",uci->pucch_fmt);
       
       if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) {
+        pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
 	pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1;	
 	AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
 	pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0];
@@ -1836,6 +1936,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
 	if (harq_ack[0] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff);
       }
       else if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1b) {
+        pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
 	pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2;
 	AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]);
 	AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]);
@@ -1846,6 +1947,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
 	if (harq_ack[1] == 1) release_harq(eNB,UE_id,1,frame,subframe,0xffff);
       }
       else { // num_pucch_resources (M) > 1
+        pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
 	pdu->harq_indication_tdd_rel13.number_of_ack_nack = uci->num_pucch_resources;
 
 	pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0];
@@ -1858,6 +1960,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
       }
       break;
     case 2: // special bundling (SR collision)
+      pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
       pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1;
       int tdd_config5_sf2scheds=0;
       if (eNB->frame_parms.tdd_config==5) tdd_config5_sf2scheds = getM(eNB,frame,subframe);
@@ -1893,7 +1996,8 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
   } //TDD
 
 
-  eNB->UL_INFO.harq_ind.number_of_harqs++;
+  eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++;
+  LOG_D(PHY,"Incremented eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs);
   pthread_mutex_unlock(&eNB->UL_INFO_mutex);  
 
 }
@@ -1902,14 +2006,23 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
 void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag) {
 
   pthread_mutex_lock(&eNB->UL_INFO_mutex);
-  nfapi_crc_indication_pdu_t *pdu =   &eNB->UL_INFO.crc_ind.crc_pdu_list[eNB->UL_INFO.crc_ind.number_of_crcs];
+  nfapi_crc_indication_pdu_t *pdu =   &eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
+
+  eNB->UL_INFO.crc_ind.sfn_sf                         = frame<<4 | subframe;
+  eNB->UL_INFO.crc_ind.header.message_id              = NFAPI_CRC_INDICATION;
+  eNB->UL_INFO.crc_ind.crc_indication_body.tl.tag     = NFAPI_CRC_INDICATION_BODY_TAG;
 
   pdu->instance_length                                = 0; // don't know what to do with this
   //  pdu->rx_ue_information.handle                       = handle;
+  pdu->rx_ue_information.tl.tag                       = NFAPI_RX_UE_INFORMATION_TAG;
   pdu->rx_ue_information.rnti                         = eNB->ulsch[UE_id]->rnti;
+  pdu->crc_indication_rel8.tl.tag                     = NFAPI_CRC_INDICATION_REL8_TAG;
   pdu->crc_indication_rel8.crc_flag                   = crc_flag;
 
-  eNB->UL_INFO.crc_ind.number_of_crcs++;
+  eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs++;
+
+  //LOG_D(PHY, "%s() rnti:%04x crcs:%d crc_flag:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, crc_flag);
+
   pthread_mutex_unlock(&eNB->UL_INFO_mutex);
 }
 
@@ -1940,8 +2053,8 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
   eNB->rb_mask_ul[3]=0;
 
   // Fix me here, these should be locked
-  eNB->UL_INFO.rx_ind.number_of_pdus  = 0;
-  eNB->UL_INFO.crc_ind.number_of_crcs = 0;
+  eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus  = 0;
+  eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs = 0;
 
   // Call SRS first since all others depend on presence of SRS or lack thereof
   srs_procedures(eNB,proc);
@@ -1950,7 +2063,9 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
 
   uci_procedures(eNB,proc);
 
-  pusch_procedures(eNB,proc);
+  if (nfapi_mode == 0 || nfapi_mode == 1) { // If PNF or monolithic
+    pusch_procedures(eNB,proc);
+  }
 
   lte_eNB_I0_measurements(eNB,
                           subframe,
@@ -1968,13 +2083,8 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
     LOG_I(PHY,"max_I0 %d, min_I0 %d\n",max_I0,min_I0);
   }
 
-  
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 0 );
 
   stop_meas(&eNB->phy_proc_rx);
 
 }
-
-
-
-
diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c
index 0e978b12cebcca7b51e5da3122c7003b02b367eb..f57e6c1806bfc100dab0d7f6b8f2b65a63d4e63b 100644
--- a/openair1/SCHED/phy_procedures_lte_ue.c
+++ b/openair1/SCHED/phy_procedures_lte_ue.c
@@ -73,7 +73,8 @@
 
 extern double cpuf;
 
-
+void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
+void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
 
 #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
 extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c
index 47a420d1d74d7fdc34f4e36142a4ae9993ca7c44..dcab55d66f6686eea679b871150bbeb4c1d942a8 100644
--- a/openair1/SCHED/ru_procedures.c
+++ b/openair1/SCHED/ru_procedures.c
@@ -70,9 +70,12 @@ void feptx0(RU_t *ru,int slot) {
                    ((fp->Ncp==1) ? 6 : 7);
   int subframe = ru->proc.subframe_tx;
 
+
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+slot , 1 );
+
   slot_offset = subframe*fp->samples_per_tti + (slot*(fp->samples_per_tti>>1));
 
-  //    LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot);
+  //LOG_D(PHY,"SFN/SF:RU:TX:%d/%d Generating slot %d\n",ru->proc.frame_tx, ru->proc.subframe_tx,slot);
 
   for (aa=0; aa<ru->nb_tx; aa++) {
     if (fp->Ncp == EXTENDED) PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot*slot_sizeF],
@@ -128,6 +131,7 @@ void feptx0(RU_t *ru,int slot) {
       }
     }
   }
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+slot , 0);
 }
 
 static void *feptx_thread(void *param) {
@@ -298,11 +302,11 @@ void feptx_ofdm(RU_t *ru) {
 	}
 	txdata = (int16_t*)&ru->common.txdata[aa][0];
 	for (j=0; i<(len<<1); i++,j++) {
-	  txdata[j++] = ((int16_t*)dummy_tx_b)[i];
+          txdata[j++] = ((int16_t*)dummy_tx_b)[i];
 	}
       }
       else {
-	LOG_D(PHY,"feptx_ofdm: Writing to position %d\n",slot_offset);
+	//LOG_D(PHY,"feptx_ofdm: Writing to position %d\n",slot_offset);
 	tx_offset = (int)slot_offset;
 	txdata = (int16_t*)&ru->common.txdata[aa][tx_offset];
 
@@ -321,9 +325,9 @@ void feptx_ofdm(RU_t *ru) {
       */
      if ((fp->frame_type == TDD) && 
          ((fp->tdd_config==0) ||
-	      (fp->tdd_config==1) ||
-	      (fp->tdd_config==2) ||
-	      (fp->tdd_config==6)) && 
+	   (fp->tdd_config==1) ||
+	   (fp->tdd_config==2) ||
+	   (fp->tdd_config==6)) && 
 	     ((subframe==0) || (subframe==5))) {
        // turn on tx switch N_TA_offset before
        //LOG_D(HW,"subframe %d, time to switch to tx (N_TA_offset %d, slot_offset %d) \n",subframe,ru->N_TA_offset,slot_offset);
@@ -359,10 +363,14 @@ void feptx_prec(RU_t *ru) {
     eNB = eNB_list[0];
     fp  = &eNB->frame_parms;
     
+    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 1);
+
     for (aa=0;aa<ru->nb_tx;aa++)
       memcpy((void*)ru->common.txdataF_BF[aa],
 	     (void*)&eNB->common_vars.txdataF[aa][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
 	     fp->symbols_per_tti*fp->ofdm_symbol_size*sizeof(int32_t));
+
+    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
   }
   else {
     for (i=0;i<ru->num_eNB;i++) {
@@ -381,9 +389,11 @@ void feptx_prec(RU_t *ru) {
 			 aa);
 	}
       }
+#if 0
       LOG_D(PHY,"feptx_prec: frame %d, subframe %d: txp (freq) %d dB\n",
 	    ru->proc.frame_tx,subframe,
 	    dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[0],2*fp->symbols_per_tti*fp->ofdm_symbol_size)));
+#endif
     }
   }
 }
@@ -396,6 +406,8 @@ void fep0(RU_t *ru,int slot) {
 
   //  printf("fep0: slot %d\n",slot);
 
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+slot, 1);
+
   remove_7_5_kHz(ru,(slot&1)+(proc->subframe_rx<<1));
   for (l=0; l<fp->symbols_per_tti/2; l++) {
     slot_fep_ul(ru,
@@ -404,6 +416,7 @@ void fep0(RU_t *ru,int slot) {
 		0
 		);
   }
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+slot, 0);
 }
 
 
@@ -584,4 +597,3 @@ void do_prach_ru(RU_t *ru) {
   }
 
 }
-
diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c
index 504dd6b8f44643ca5f034c4eb386ccace468f351..ca404ddc23cb8ef2b6eba5aee687b9d4258cdbed 100644
--- a/openair2/ENB_APP/enb_app.c
+++ b/openair2/ENB_APP/enb_app.c
@@ -297,10 +297,14 @@ void *eNB_app_task(void *args_p)
 
   itti_mark_task_ready (TASK_ENB_APP);
 
+  LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__);
+
   RCconfig_L1();
 
   RCconfig_macrlc();
 
+  LOG_I(PHY, "%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst);
+
   if (RC.nb_L1_inst>0) AssertFatal(l1_north_init_eNB()==0,"could not initialize L1 north interface\n");
 
   AssertFatal (enb_nb <= RC.nb_inst,
@@ -310,9 +314,11 @@ void *eNB_app_task(void *args_p)
   LOG_I(ENB_APP,"Allocating eNB_RRC_INST for %d instances\n",RC.nb_inst);
 
   RC.rrc = (eNB_RRC_INST **)malloc(RC.nb_inst*sizeof(eNB_RRC_INST *));
+  LOG_I(PHY, "%s() RC.nb_inst:%d RC.rrc:%p\n", __FUNCTION__, RC.nb_inst, RC.rrc);
 
   for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
     RC.rrc[enb_id] = (eNB_RRC_INST*)malloc(sizeof(eNB_RRC_INST));
+    LOG_I(PHY, "%s() Creating RRC instance RC.rrc[%d]:%p (%d of %d)\n", __FUNCTION__, enb_id, RC.rrc[enb_id], enb_id+1, enb_id_end);
     memset((void *)RC.rrc[enb_id],0,sizeof(eNB_RRC_INST));
     configure_rrc(enb_id);
   }
diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index 610ee4a78790632d6302f14beafc62a50aa35125..eb01c3bd05646d1b6c5be0e026794d120552638a 100644
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -46,15 +46,16 @@
 #include "sctp_default_values.h"
 #include "SystemInformationBlockType2.h"
 #include "LAYER2/MAC/extern.h"
+#include "LAYER2/MAC/proto.h"
 #include "PHY/extern.h"
 #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
+#include "nfapi_vnf.h"
+#include "nfapi_pnf.h"
+
 #include "enb_paramdef.h"
 #include "common/config/config_userapi.h"
 
-
-int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc);
-int RCconfig_S1(MessageDef *msg_p, uint32_t i);
-
+extern uint16_t sf_ahead;
 
 static int enb_check_band_frequencies(char* lib_config_file_name_pP,
                                       int ind,
@@ -98,11 +99,6 @@ static int enb_check_band_frequencies(char* lib_config_file_name_pP,
 }
 
 
-
-
-
-
-
 /* --------------------------------------------------------*/
 /* from here function to use configuration module          */
 void RCconfig_RU(void) {
@@ -120,7 +116,6 @@ void RCconfig_RU(void) {
   
   if ( RUParamList.numelt > 0) {
 
-
     RC.ru = (RU_t**)malloc(RC.nb_RU*sizeof(RU_t*));
    
 
@@ -135,6 +130,8 @@ void RCconfig_RU(void) {
       memset((void*)RC.ru[j],0,sizeof(RU_t));
       RC.ru[j]->idx                                 = j;
 
+      printf("Creating RC.ru[%d]:%p\n", j, RC.ru[j]);
+
       RC.ru[j]->if_timing                           = synch_to_ext_device;
       if (RC.nb_L1_inst >0)
         RC.ru[j]->num_eNB                           = RUParamList.paramarray[j][RU_ENB_LIST_IDX].numelt;
@@ -233,48 +230,47 @@ void RCconfig_RU(void) {
   
 }
 
-void RCconfig_L1() {
+void RCconfig_L1(void) {
   int               i,j;
   paramdef_t L1_Params[] = L1PARAMS_DESC;
   paramlist_def_t L1_ParamList = {CONFIG_STRING_L1_LIST,NULL,0};
 
 
-  config_getlist( &L1_ParamList,L1_Params,sizeof(L1_Params)/sizeof(paramdef_t), NULL);    
-  if (L1_ParamList.numelt > 0) {
+  if (RC.eNB == NULL) {
+    RC.eNB                       = (PHY_VARS_eNB ***)malloc((1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB**));
+    LOG_I(PHY,"RC.eNB = %p\n",RC.eNB);
+    memset(RC.eNB,0,(1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB**));
+    RC.nb_L1_CC = malloc((1+RC.nb_L1_inst)*sizeof(int));
+  }
 
-    if (RC.eNB == NULL) {
-      RC.eNB                               = (PHY_VARS_eNB ***)malloc((1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***));
-      LOG_I(PHY,"RC.eNB = %p\n",RC.eNB);
-      memset(RC.eNB,0,(1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***));
-      RC.nb_L1_CC = malloc((1+RC.nb_L1_inst)*sizeof(int));
-    }
+  config_getlist( &L1_ParamList,L1_Params,sizeof(L1_Params)/sizeof(paramdef_t), NULL);
+  if (L1_ParamList.numelt > 0) {
 
     for (j = 0; j < RC.nb_L1_inst; j++) {
       RC.nb_L1_CC[j] = *(L1_ParamList.paramarray[j][L1_CC_IDX].uptr);
 
-
       if (RC.eNB[j] == NULL) {
-	RC.eNB[j]                       = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB**));
+	RC.eNB[j]                       = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB*));
 	LOG_I(PHY,"RC.eNB[%d] = %p\n",j,RC.eNB[j]);
-	memset(RC.eNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB***));
+	memset(RC.eNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB*));
       }
 
-
       for (i=0;i<RC.nb_L1_CC[j];i++) {
-	if (RC.eNB[j][i] == NULL) {
-	  RC.eNB[j][i] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB));
-	  memset((void*)RC.eNB[j][i],0,sizeof(PHY_VARS_eNB));
-	  LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.eNB[j][i]);
-	  RC.eNB[j][i]->Mod_id  = j;
-	  RC.eNB[j][i]->CC_id   = i;
-	}
+        if (RC.eNB[j][i] == NULL) {
+          RC.eNB[j][i] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB));
+          memset((void*)RC.eNB[j][i],0,sizeof(PHY_VARS_eNB));
+          LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.eNB[j][i]);
+          RC.eNB[j][i]->Mod_id  = j;
+          RC.eNB[j][i]->CC_id   = i;
+        }
       }
 
       if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) {
 
+        sf_ahead = 4; // Need 4 subframe gap between RX and TX
       }
       else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) {
-	RC.eNB[j][0]->eth_params_n.local_if_name            = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_IF_NAME_IDX].strptr));
+        RC.eNB[j][0]->eth_params_n.local_if_name            = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_IF_NAME_IDX].strptr));
 	RC.eNB[j][0]->eth_params_n.my_addr                  = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_ADDRESS_IDX].strptr));
 	RC.eNB[j][0]->eth_params_n.remote_addr              = strdup(*(L1_ParamList.paramarray[j][L1_REMOTE_N_ADDRESS_IDX].strptr));
 	RC.eNB[j][0]->eth_params_n.my_portc                 = *(L1_ParamList.paramarray[j][L1_LOCAL_N_PORTC_IDX].iptr);
@@ -282,8 +278,25 @@ void RCconfig_L1() {
 	RC.eNB[j][0]->eth_params_n.my_portd                 = *(L1_ParamList.paramarray[j][L1_LOCAL_N_PORTD_IDX].iptr);
 	RC.eNB[j][0]->eth_params_n.remote_portd             = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr);
 	RC.eNB[j][0]->eth_params_n.transp_preference        = ETH_UDP_MODE;
+
+        sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2
+
+        RC.nb_macrlc_inst = 1;  // This is used by mac_top_init_eNB()
+
+        // This is used by init_eNB_afterRU()
+        RC.nb_CC = (int *)malloc((1+RC.nb_inst)*sizeof(int));
+        RC.nb_CC[0]=1;
+
+        RC.nb_inst =1; // DJP - feptx_prec uses num_eNB but phy_init_RU uses nb_inst
+
+        LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_inst=1 this is because phy_init_RU() uses that to index and not RC.num_eNB - why the 2 similar variables?\n", __FUNCTION__);
+        LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_CC[0]=%d for init_eNB_afterRU()\n", __FUNCTION__, RC.nb_CC[0]);
+        LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_macrlc_inst:%d because used by mac_top_init_eNB()\n", __FUNCTION__, RC.nb_macrlc_inst);
+
+        mac_top_init_eNB();
+
+        configure_nfapi_pnf(RC.eNB[j][0]->eth_params_n.remote_addr, RC.eNB[j][0]->eth_params_n.remote_portc, RC.eNB[j][0]->eth_params_n.my_addr, RC.eNB[j][0]->eth_params_n.my_portd, RC.eNB[j][0]->eth_params_n     .remote_portd);
       }
-      
       else { // other midhaul
       }	
     }// j=0..num_inst
@@ -291,6 +304,30 @@ void RCconfig_L1() {
     l1_north_init_eNB();
   } else {
     LOG_I(PHY,"No " CONFIG_STRING_L1_LIST " configuration found");    
+
+    // DJP need to create some structures for VNF
+
+    j = 0;
+
+    RC.nb_L1_CC = malloc((1+RC.nb_L1_inst)*sizeof(int)); // DJP - 1 lot then???
+
+    RC.nb_L1_CC[j]=1; // DJP - hmmm
+
+    if (RC.eNB[j] == NULL) {
+      RC.eNB[j]                       = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB**));
+      LOG_I(PHY,"RC.eNB[%d] = %p\n",j,RC.eNB[j]);
+      memset(RC.eNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB***));
+    }
+
+    for (i=0;i<RC.nb_L1_CC[j];i++) {
+      if (RC.eNB[j][i] == NULL) {
+        RC.eNB[j][i] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB));
+        memset((void*)RC.eNB[j][i],0,sizeof(PHY_VARS_eNB));
+        LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.eNB[j][i]);
+        RC.eNB[j][i]->Mod_id  = j;
+        RC.eNB[j][i]->CC_id   = i;
+      }
+    }
   }
 }
 
@@ -303,7 +340,6 @@ void RCconfig_macrlc() {
 
   config_getlist( &MacRLC_ParamList,MacRLC_Params,sizeof(MacRLC_Params)/sizeof(paramdef_t), NULL);    
   
-
   if ( MacRLC_ParamList.numelt > 0) {
 
     RC.nb_macrlc_inst=MacRLC_ParamList.numelt; 
@@ -338,6 +374,12 @@ void RCconfig_macrlc() {
 	RC.mac[j]->eth_params_s.my_portd                 = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTD_IDX].iptr);
 	RC.mac[j]->eth_params_s.remote_portd             = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTD_IDX].iptr);
 	RC.mac[j]->eth_params_s.transp_preference        = ETH_UDP_MODE;
+
+        sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2
+
+        printf("**************** vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc);
+        configure_nfapi_vnf(RC.mac[j]->eth_params_s.my_addr, RC.mac[j]->eth_params_s.my_portc);
+        printf("**************** RETURNED FROM configure_nfapi_vnf() vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc);
       } else { // other midhaul
 	AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr));
       }	
@@ -420,7 +462,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
   int32_t     rach_powerRampingStep         = 0;
   int32_t     rach_preambleInitialReceivedTargetPower    = 0;
   int32_t     rach_preambleTransMax         = 0;
-  int32_t     rach_raResponseWindowSize     = 0;
+  int32_t     rach_raResponseWindowSize     = 10;
   int32_t     rach_macContentionResolutionTimer = 0;
   int32_t     rach_maxHARQ_Msg3Tx           = 0;
   int32_t     pcch_defaultPagingCycle       = 0;
diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c
index 764c762f6a7da8bc2ca5f47521063a72040a6dfd..1aa3a8563686bf90ebbda590bbc29d356ea2af48 100644
--- a/openair2/LAYER2/MAC/config.c
+++ b/openair2/LAYER2/MAC/config.c
@@ -58,6 +58,12 @@
 #endif
 
 extern RAN_CONTEXT_t RC;
+extern int l2_init_eNB(void);
+extern void mac_top_init_eNB(void);
+extern void mac_init_cell_params(int Mod_idP,int CC_idP);
+extern void phy_reset_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
+
+extern uint8_t nfapi_mode;
 
 /* sec 5.9, 36.321: MAC Reset Procedure */
 void ue_mac_reset(module_id_t module_idP, uint8_t eNB_index)
@@ -212,51 +218,115 @@ int32_t get_uldl_offset(int eutra_bandP)
     return (eutra_bandtable[i].dl_min - eutra_bandtable[i].ul_min);
 }
 
-uint32_t bw_table[6] =
-    { 6 * 180, 15 * 180, 25 * 180, 50 * 180, 75 * 180, 100 * 180 };
-
-void
-config_mib(int Mod_idP,
-	   int CC_idP,
-	   int eutra_bandP,
-	   int dl_BandwidthP,
-	   PHICH_Config_t * phich_configP,
-	   int Nid_cellP,
-	   int NcpP,
-	   int p_eNBP,
-	   uint32_t dl_CarrierFreqP,
-	   uint32_t ul_CarrierFreqP, uint32_t pbch_repetitionP)
-{
-
-    nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP];
-
-    cfg->subframe_config.pcfich_power_offset.value = 6000;	// 0dB
-    cfg->subframe_config.dl_cyclic_prefix_type.value = NcpP;
-    cfg->subframe_config.ul_cyclic_prefix_type.value = NcpP;
-
-    LOG_I(MAC, "Ncp %d,p_eNB %d\n", NcpP, p_eNBP);
-
-    cfg->rf_config.dl_channel_bandwidth.value = dl_BandwidthP;
-    cfg->rf_config.ul_channel_bandwidth.value = dl_BandwidthP;
-    cfg->rf_config.tx_antenna_ports.value = p_eNBP;
-    cfg->rf_config.rx_antenna_ports.value = 2;
-
-    cfg->nfapi_config.earfcn.value =
-	to_earfcn(eutra_bandP, dl_CarrierFreqP,
-		  bw_table[dl_BandwidthP] / 100);
-    cfg->nfapi_config.rf_bands.number_rf_bands = 1;
-    cfg->nfapi_config.rf_bands.rf_band[0] = eutra_bandP;
-    cfg->phich_config.phich_resource.value = phich_configP->phich_Resource;
-    cfg->phich_config.phich_duration.value = phich_configP->phich_Duration;
-    cfg->phich_config.phich_power_offset.value = 6000;	// 0dB
+uint32_t bw_table[6] = {6*180,15*180,25*180,50*180,75*180,100*180};
+
+void config_mib(int                 Mod_idP,
+		int                 CC_idP,
+		int                 eutra_bandP,  
+		int                 dl_BandwidthP,
+		PHICH_Config_t      *phich_configP,
+		int                 Nid_cellP,
+		int                 NcpP,
+		int                 p_eNBP,
+		uint32_t            dl_CarrierFreqP,
+		uint32_t            ul_CarrierFreqP,
+		uint32_t            pbch_repetitionP) {
+
+  nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP];
+
+  cfg->num_tlv=0;
+		
+  cfg->subframe_config.pcfich_power_offset.value   = 6000;  // 0dB
+  cfg->subframe_config.pcfich_power_offset.tl.tag = NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG;
+  cfg->num_tlv++;
+
+  cfg->subframe_config.dl_cyclic_prefix_type.value = NcpP;
+  cfg->subframe_config.dl_cyclic_prefix_type.tl.tag = NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG;
+  cfg->num_tlv++;
+
+  cfg->subframe_config.ul_cyclic_prefix_type.value = NcpP;
+  cfg->subframe_config.ul_cyclic_prefix_type.tl.tag = NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG;
+  cfg->num_tlv++;
+ 
+  cfg->rf_config.dl_channel_bandwidth.value        = to_prb(dl_BandwidthP);
+  cfg->rf_config.dl_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG;
+  cfg->num_tlv++;
+LOG_E(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP);
+
+  cfg->rf_config.ul_channel_bandwidth.value        = to_prb(dl_BandwidthP);
+  cfg->rf_config.ul_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG;
+  cfg->num_tlv++;
+
+  cfg->rf_config.tx_antenna_ports.value            = p_eNBP;
+  cfg->rf_config.tx_antenna_ports.tl.tag = NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG;
+  cfg->num_tlv++;
+
+  cfg->rf_config.rx_antenna_ports.value            = 2;
+  cfg->rf_config.rx_antenna_ports.tl.tag = NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG;
+  cfg->num_tlv++;
+
+  cfg->nfapi_config.earfcn.value                   = to_earfcn(eutra_bandP,dl_CarrierFreqP,bw_table[dl_BandwidthP]/100);
+  cfg->nfapi_config.earfcn.tl.tag = NFAPI_NFAPI_EARFCN_TAG;
+  cfg->num_tlv++;
+
+  cfg->nfapi_config.rf_bands.number_rf_bands       = 1;
+  cfg->nfapi_config.rf_bands.rf_band[0]            = eutra_bandP;  
+  cfg->nfapi_config.rf_bands.tl.tag = NFAPI_PHY_RF_BANDS_TAG;
+  cfg->num_tlv++;
+
+  cfg->phich_config.phich_resource.value           = phich_configP->phich_Resource;
+  cfg->phich_config.phich_resource.tl.tag = NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG;
+  cfg->num_tlv++;
+
+  cfg->phich_config.phich_duration.value           = phich_configP->phich_Duration;
+  cfg->phich_config.phich_duration.tl.tag = NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG;
+  cfg->num_tlv++;
+
+  cfg->phich_config.phich_power_offset.value       = 6000;  // 0dB
+  cfg->phich_config.phich_power_offset.tl.tag = NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG;
+  cfg->num_tlv++;
+
+  cfg->sch_config.primary_synchronization_signal_epre_eprers.value   = 6000; // 0dB
+  cfg->sch_config.primary_synchronization_signal_epre_eprers.tl.tag = NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG;
+  cfg->num_tlv++;
+
+  cfg->sch_config.secondary_synchronization_signal_epre_eprers.value = 6000; // 0dB
+  cfg->sch_config.secondary_synchronization_signal_epre_eprers.tl.tag = NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG;
+  cfg->num_tlv++;
+
+  cfg->sch_config.physical_cell_id.value                             = Nid_cellP;
+  cfg->sch_config.physical_cell_id.tl.tag = NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG;
+  cfg->num_tlv++;
 
-    cfg->sch_config.primary_synchronization_signal_epre_eprers.value = 6000;	// 0dB
-    cfg->sch_config.secondary_synchronization_signal_epre_eprers.value = 6000;	// 0dB
-    cfg->sch_config.physical_cell_id.value = Nid_cellP;
+#ifdef Rel14
+  cfg->emtc_config.pbch_repetitions_enable_r13.value                 = pbch_repetitionP;
+  cfg->emtc_config.pbch_repetitions_enable_r13.tl.tag = NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG;
+  cfg->num_tlv++;
+#endif  
 
+  LOG_I(MAC,
+      "%s() NFAPI_CONFIG_REQUEST(num_tlv:%u) DL_BW:%u UL_BW:%u Ncp %d,p_eNB %d,earfcn %d,band %d,phich_resource %u phich_duration %u phich_power_offset %u PSS %d SSS %d PCI %d"
 #ifdef Rel14
-    cfg->emtc_config.pbch_repetitions_enable_r13.value = pbch_repetitionP;
-#endif
+      " PBCH repetition %d"
+#endif  
+      "\n"
+      ,__FUNCTION__
+      ,cfg->num_tlv
+      ,cfg->rf_config.dl_channel_bandwidth.value
+      ,cfg->rf_config.ul_channel_bandwidth.value
+      ,NcpP,p_eNBP
+      ,cfg->nfapi_config.earfcn.value
+      ,cfg->nfapi_config.rf_bands.rf_band[0]
+      ,cfg->phich_config.phich_resource.value
+      ,cfg->phich_config.phich_duration.value
+      ,cfg->phich_config.phich_power_offset.value
+      ,cfg->sch_config.primary_synchronization_signal_epre_eprers.value
+      ,cfg->sch_config.secondary_synchronization_signal_epre_eprers.value
+      ,cfg->sch_config.physical_cell_id.value
+#ifdef Rel14
+      ,cfg->emtc_config.pbch_repetitions_enable_r13.value
+#endif  
+      );
 }
 
 void config_sib1(int Mod_idP, int CC_idP, TDD_Config_t * tdd_ConfigP)
@@ -264,18 +334,25 @@ void config_sib1(int Mod_idP, int CC_idP, TDD_Config_t * tdd_ConfigP)
 
     nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP];
 
-    if (tdd_ConfigP) {		//TDD
-	cfg->subframe_config.duplex_mode.value = 0;
-	cfg->tdd_frame_structure_config.subframe_assignment.value =
-	    tdd_ConfigP->subframeAssignment;
-	cfg->tdd_frame_structure_config.special_subframe_patterns.value =
-	    tdd_ConfigP->specialSubframePatterns;
-    } else {			// FDD
-	cfg->subframe_config.duplex_mode.value = 1;
-	// Note no half-duplex here
-    }
-
-
+  if (tdd_ConfigP)   { //TDD
+    cfg->subframe_config.duplex_mode.value                          = 0;
+    cfg->subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG;
+    cfg->num_tlv++;
+
+    cfg->tdd_frame_structure_config.subframe_assignment.value       = tdd_ConfigP->subframeAssignment;
+    cfg->tdd_frame_structure_config.subframe_assignment.tl.tag = NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG;
+    cfg->num_tlv++;
+
+    cfg->tdd_frame_structure_config.special_subframe_patterns.value = tdd_ConfigP->specialSubframePatterns;
+    cfg->tdd_frame_structure_config.special_subframe_patterns.tl.tag = NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG;
+    cfg->num_tlv++;
+  }
+  else { // FDD
+    cfg->subframe_config.duplex_mode.value                          = 1;
+    cfg->subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG;
+    cfg->num_tlv++;
+    // Note no half-duplex here
+  }
 }
 
 int power_off_dB[6] = { 78, 118, 140, 170, 188, 200 };
@@ -287,248 +364,326 @@ config_sib2(int Mod_idP,
 #ifdef Rel14
 	    RadioResourceConfigCommonSIB_t * radioResourceConfigCommon_BRP,
 #endif
-	    ARFCN_ValueEUTRA_t * ul_CArrierFreqP,
-	    long *ul_BandwidthP,
-	    AdditionalSpectrumEmission_t *
-	    additionalSpectrumEmissionP,
-	    struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigListP)
-{
+            ARFCN_ValueEUTRA_t *ul_CArrierFreqP,
+            long *ul_BandwidthP,
+            AdditionalSpectrumEmission_t *additionalSpectrumEmissionP,
+            struct MBSFN_SubframeConfigList  *mbsfn_SubframeConfigListP) {
+
+  nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP];
+
+  cfg->subframe_config.pb.value               = radioResourceConfigCommonP->pdsch_ConfigCommon.p_b;
+  cfg->subframe_config.pb.tl.tag = NFAPI_SUBFRAME_CONFIG_PB_TAG;
+  cfg->num_tlv++;
+
+  cfg->rf_config.reference_signal_power.value = radioResourceConfigCommonP->pdsch_ConfigCommon.referenceSignalPower;
+  cfg->rf_config.reference_signal_power.tl.tag = NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG;
+  cfg->num_tlv++;
+
+  cfg->nfapi_config.max_transmit_power.value  = cfg->rf_config.reference_signal_power.value + power_off_dB[cfg->rf_config.dl_channel_bandwidth.value];
+  cfg->nfapi_config.max_transmit_power.tl.tag = NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG;
+  cfg->num_tlv++;
+
+  cfg->prach_config.configuration_index.value                 = radioResourceConfigCommonP->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
+  cfg->prach_config.configuration_index.tl.tag = NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG;
+  cfg->num_tlv++;
+
+  cfg->prach_config.root_sequence_index.value                 = radioResourceConfigCommonP->prach_Config.rootSequenceIndex;
+  cfg->prach_config.root_sequence_index.tl.tag = NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG;
+  cfg->num_tlv++;
+
+  cfg->prach_config.zero_correlation_zone_configuration.value = radioResourceConfigCommonP->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
+  cfg->prach_config.zero_correlation_zone_configuration.tl.tag = NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG;
+  cfg->num_tlv++;
+
+  cfg->prach_config.high_speed_flag.value                     = radioResourceConfigCommonP->prach_Config.prach_ConfigInfo.highSpeedFlag;
+  cfg->prach_config.high_speed_flag.tl.tag = NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG;
+  cfg->num_tlv++;
+
+  cfg->prach_config.frequency_offset.value                    = radioResourceConfigCommonP->prach_Config.prach_ConfigInfo.prach_FreqOffset;
+  cfg->prach_config.frequency_offset.tl.tag = NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG;
+  cfg->num_tlv++;
+
+
+  cfg->pusch_config.hopping_mode.value                        = radioResourceConfigCommonP->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
+  cfg->pusch_config.hopping_mode.tl.tag = NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG;
+  cfg->num_tlv++;
+
+  cfg->pusch_config.number_of_subbands.value                  = radioResourceConfigCommonP->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
+  cfg->pusch_config.number_of_subbands.tl.tag = NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG;
+  cfg->num_tlv++;
+
+  cfg->pusch_config.hopping_offset.value                      = radioResourceConfigCommonP->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
+  cfg->pusch_config.hopping_offset.tl.tag = NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG;
+  cfg->num_tlv++;
+
+  cfg->pucch_config.delta_pucch_shift.value                         = radioResourceConfigCommonP->pucch_ConfigCommon.deltaPUCCH_Shift;
+  cfg->pucch_config.delta_pucch_shift.tl.tag = NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG;
+  cfg->num_tlv++;
+
+  cfg->pucch_config.n_cqi_rb.value                                  = radioResourceConfigCommonP->pucch_ConfigCommon.nRB_CQI;
+  cfg->pucch_config.n_cqi_rb.tl.tag = NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG;
+  cfg->num_tlv++;
+
+  cfg->pucch_config.n_an_cs.value                                   = radioResourceConfigCommonP->pucch_ConfigCommon.nCS_AN;
+  cfg->pucch_config.n_an_cs.tl.tag = NFAPI_PUCCH_CONFIG_N_AN_CS_TAG;
+  cfg->num_tlv++;
+
+  cfg->pucch_config.n1_pucch_an.value                               = radioResourceConfigCommonP->pucch_ConfigCommon.n1PUCCH_AN;
+  cfg->pucch_config.n1_pucch_an.tl.tag = NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG;
+  cfg->num_tlv++;
+
+  if (radioResourceConfigCommonP->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled == true)
+  {
+    cfg->uplink_reference_signal_config.uplink_rs_hopping.value     = 1;
+  }
+  else if (radioResourceConfigCommonP->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled == true)
+  {
+    cfg->uplink_reference_signal_config.uplink_rs_hopping.value     = 2;
+  }
+  else // No hopping
+  {
+    cfg->uplink_reference_signal_config.uplink_rs_hopping.value     = 0;
+  }
+  cfg->uplink_reference_signal_config.uplink_rs_hopping.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG;
+  cfg->num_tlv++;
+
+  cfg->uplink_reference_signal_config.group_assignment.value        = radioResourceConfigCommonP->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
+  cfg->uplink_reference_signal_config.group_assignment.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG;
+  cfg->num_tlv++;
+
+  cfg->uplink_reference_signal_config.cyclic_shift_1_for_drms.value = radioResourceConfigCommonP->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift;
+  cfg->uplink_reference_signal_config.cyclic_shift_1_for_drms.tl.tag = NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG;
+  cfg->num_tlv++;
+
+
+  // how to enable/disable SRS?
+  if (radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.present==SoundingRS_UL_ConfigCommon_PR_setup) {
+    cfg->srs_config.bandwidth_configuration.value                       = radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
+    cfg->srs_config.bandwidth_configuration.tl.tag = NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG;
+    cfg->num_tlv++;
+
+    cfg->srs_config.srs_subframe_configuration.value                    = radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
+    cfg->srs_config.srs_subframe_configuration.tl.tag = NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG;
+    cfg->num_tlv++;
+
+    cfg->srs_config.srs_acknack_srs_simultaneous_transmission.value     = radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
+    cfg->srs_config.srs_acknack_srs_simultaneous_transmission.tl.tag = NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG;
+    cfg->num_tlv++;
 
-    nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP];
 
-    cfg->subframe_config.pb.value =
-	radioResourceConfigCommonP->pdsch_ConfigCommon.p_b;
-    cfg->rf_config.reference_signal_power.value =
-	radioResourceConfigCommonP->pdsch_ConfigCommon.
-	referenceSignalPower;
-    cfg->nfapi_config.max_transmit_power.value =
-	cfg->rf_config.reference_signal_power.value +
-	power_off_dB[cfg->rf_config.dl_channel_bandwidth.value];
-
-    cfg->prach_config.configuration_index.value =
-	radioResourceConfigCommonP->prach_Config.
-	prach_ConfigInfo.prach_ConfigIndex;
-    cfg->prach_config.root_sequence_index.value =
-	radioResourceConfigCommonP->prach_Config.rootSequenceIndex;
-    cfg->prach_config.zero_correlation_zone_configuration.value =
-	radioResourceConfigCommonP->prach_Config.
-	prach_ConfigInfo.zeroCorrelationZoneConfig;
-    cfg->prach_config.high_speed_flag.value =
-	radioResourceConfigCommonP->prach_Config.prach_ConfigInfo.
-	highSpeedFlag;
-    cfg->prach_config.frequency_offset.value =
-	radioResourceConfigCommonP->prach_Config.
-	prach_ConfigInfo.prach_FreqOffset;
-
-    cfg->pusch_config.hopping_mode.value =
-	radioResourceConfigCommonP->pusch_ConfigCommon.
-	pusch_ConfigBasic.hoppingMode;
-    cfg->pusch_config.number_of_subbands.value =
-	radioResourceConfigCommonP->pusch_ConfigCommon.pusch_ConfigBasic.
-	n_SB;
-    cfg->pusch_config.hopping_offset.value =
-	radioResourceConfigCommonP->pusch_ConfigCommon.
-	pusch_ConfigBasic.pusch_HoppingOffset;
-
-
-
-    cfg->pucch_config.delta_pucch_shift.value =
-	radioResourceConfigCommonP->pucch_ConfigCommon.deltaPUCCH_Shift;
-    cfg->pucch_config.n_cqi_rb.value =
-	radioResourceConfigCommonP->pucch_ConfigCommon.nRB_CQI;
-    cfg->pucch_config.n_an_cs.value =
-	radioResourceConfigCommonP->pucch_ConfigCommon.nCS_AN;
-    cfg->pucch_config.n1_pucch_an.value =
-	radioResourceConfigCommonP->pucch_ConfigCommon.n1PUCCH_AN;
-
-    if (radioResourceConfigCommonP->
-	pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled ==
-	true)
-	cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 1;
-    else if (radioResourceConfigCommonP->
-	     pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.
-	     sequenceHoppingEnabled == true)
-	cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 2;
-    else			// No hopping
-	cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 0;
-
-    cfg->uplink_reference_signal_config.group_assignment.value =
-	radioResourceConfigCommonP->
-	pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
-    cfg->uplink_reference_signal_config.cyclic_shift_1_for_drms.value =
-	radioResourceConfigCommonP->
-	pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift;
-
-    // how to enable/disable SRS?
-    if (radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.present ==
-	SoundingRS_UL_ConfigCommon_PR_setup) {
-	cfg->srs_config.bandwidth_configuration.value =
-	    radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.
-	    choice.setup.srs_BandwidthConfig;
-	cfg->srs_config.srs_subframe_configuration.value =
-	    radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.
-	    choice.setup.srs_SubframeConfig;
-	cfg->srs_config.srs_acknack_srs_simultaneous_transmission.value =
-	    radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.
-	    choice.setup.ackNackSRS_SimultaneousTransmission;
-
-	if (radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.
-	    choice.setup.srs_MaxUpPts)
-	    cfg->srs_config.max_up_pts.value = 1;
-	else
-	    cfg->srs_config.max_up_pts.value = 0;
+    if (radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts) {
+       cfg->srs_config.max_up_pts.value                                 = 1;
     }
+    else {
+       cfg->srs_config.max_up_pts.value                                 = 0;
+    }
+    cfg->srs_config.max_up_pts.tl.tag = NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG;
+    cfg->num_tlv++;
+  }
+
 #ifdef Rel14
-    if (RC.mac[Mod_idP]->common_channels[CC_idP].mib->
-	message.schedulingInfoSIB1_BR_r13 > 0) {
-	AssertFatal(radioResourceConfigCommon_BRP != NULL,
-		    "radioResource rou is missing\n");
-	AssertFatal(radioResourceConfigCommon_BRP->ext4 != NULL,
-		    "ext4 is missing\n");
-	cfg->emtc_config.prach_catm_root_sequence_index.value =
-	    radioResourceConfigCommon_BRP->prach_Config.rootSequenceIndex;
-	cfg->emtc_config.prach_catm_zero_correlation_zone_configuration.
-	    value =
-	    radioResourceConfigCommon_BRP->prach_Config.
-	    prach_ConfigInfo.zeroCorrelationZoneConfig;
-	cfg->emtc_config.prach_catm_high_speed_flag.value =
-	    radioResourceConfigCommon_BRP->prach_Config.
-	    prach_ConfigInfo.highSpeedFlag;
-
-	struct PRACH_ConfigSIB_v1310 *ext4_prach =
-	    radioResourceConfigCommon_BRP->ext4->prach_ConfigCommon_v1310;
-
-	PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13 =
-	    &ext4_prach->prach_ParametersListCE_r13;
-
-	PRACH_ParametersCE_r13_t *p;
-	cfg->emtc_config.prach_ce_level_0_enable.value = 0;
-	cfg->emtc_config.prach_ce_level_1_enable.value = 0;
-	cfg->emtc_config.prach_ce_level_2_enable.value = 0;
-	cfg->emtc_config.prach_ce_level_3_enable.value = 0;
-	switch (prach_ParametersListCE_r13->list.count) {
-	case 4:
-	    p = prach_ParametersListCE_r13->list.array[3];
-	    cfg->emtc_config.prach_ce_level_3_enable.value = 1;
-	    cfg->emtc_config.prach_ce_level_3_configuration_index.value =
-		p->prach_ConfigIndex_r13;
-	    cfg->emtc_config.prach_ce_level_3_frequency_offset.value =
-		p->prach_FreqOffset_r13;
-	    cfg->
-		emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.
-		value = p->numRepetitionPerPreambleAttempt_r13;
-	    if (p->prach_StartingSubframe_r13)
-		cfg->
-		    emtc_config.prach_ce_level_3_starting_subframe_periodicity.
-		    value = *p->prach_StartingSubframe_r13;
-	    cfg->emtc_config.prach_ce_level_3_hopping_enable.value =
-		p->prach_HoppingConfig_r13;
-	    cfg->emtc_config.prach_ce_level_3_hopping_offset.value =
-		cfg->rf_config.ul_channel_bandwidth.value - 6;
-	case 3:
-	    p = prach_ParametersListCE_r13->list.array[2];
-	    cfg->emtc_config.prach_ce_level_2_enable.value = 1;
-	    cfg->emtc_config.prach_ce_level_2_configuration_index.value =
-		p->prach_ConfigIndex_r13;
-	    cfg->emtc_config.prach_ce_level_2_frequency_offset.value =
-		p->prach_FreqOffset_r13;
-	    cfg->
-		emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.
-		value = p->numRepetitionPerPreambleAttempt_r13;
-	    if (p->prach_StartingSubframe_r13)
-		cfg->
-		    emtc_config.prach_ce_level_2_starting_subframe_periodicity.
-		    value = *p->prach_StartingSubframe_r13;
-	    cfg->emtc_config.prach_ce_level_2_hopping_enable.value =
-		p->prach_HoppingConfig_r13;
-	    cfg->emtc_config.prach_ce_level_2_hopping_offset.value =
-		cfg->rf_config.ul_channel_bandwidth.value - 6;
-	case 2:
-	    p = prach_ParametersListCE_r13->list.array[1];
-	    cfg->emtc_config.prach_ce_level_1_enable.value = 1;
-	    cfg->emtc_config.prach_ce_level_1_configuration_index.value =
-		p->prach_ConfigIndex_r13;
-	    cfg->emtc_config.prach_ce_level_1_frequency_offset.value =
-		p->prach_FreqOffset_r13;
-	    cfg->
-		emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.
-		value = p->numRepetitionPerPreambleAttempt_r13;
-	    if (p->prach_StartingSubframe_r13)
-		cfg->
-		    emtc_config.prach_ce_level_1_starting_subframe_periodicity.
-		    value = *p->prach_StartingSubframe_r13;
-	    cfg->emtc_config.prach_ce_level_1_hopping_enable.value =
-		p->prach_HoppingConfig_r13;
-	    cfg->emtc_config.prach_ce_level_1_hopping_offset.value =
-		cfg->rf_config.ul_channel_bandwidth.value - 6;
-	case 1:
-	    p = prach_ParametersListCE_r13->list.array[0];
-	    cfg->emtc_config.prach_ce_level_0_enable.value = 1;
-	    cfg->emtc_config.prach_ce_level_0_configuration_index.value =
-		p->prach_ConfigIndex_r13;
-	    cfg->emtc_config.prach_ce_level_0_frequency_offset.value =
-		p->prach_FreqOffset_r13;
-	    cfg->
-		emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.
-		value = p->numRepetitionPerPreambleAttempt_r13;
-	    if (p->prach_StartingSubframe_r13)
-		cfg->
-		    emtc_config.prach_ce_level_0_starting_subframe_periodicity.
-		    value = *p->prach_StartingSubframe_r13;
-	    cfg->emtc_config.prach_ce_level_0_hopping_enable.value =
-		p->prach_HoppingConfig_r13;
-	    cfg->emtc_config.prach_ce_level_0_hopping_offset.value =
-		cfg->rf_config.ul_channel_bandwidth.value - 6;
-	}
+  if (RC.mac[Mod_idP]->common_channels[CC_idP].mib->message.schedulingInfoSIB1_BR_r13>0) {
+    AssertFatal(radioResourceConfigCommon_BRP!=NULL,"radioResource rou is missing\n");
+    AssertFatal(radioResourceConfigCommon_BRP->ext4!=NULL,"ext4 is missing\n");
+    cfg->emtc_config.prach_catm_root_sequence_index.value                 = radioResourceConfigCommon_BRP->prach_Config.rootSequenceIndex;
+    cfg->emtc_config.prach_catm_root_sequence_index.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CATM_ROOT_SEQUENCE_INDEX_TAG;
+    cfg->num_tlv++;
+
+    cfg->emtc_config.prach_catm_zero_correlation_zone_configuration.value = radioResourceConfigCommon_BRP->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
+    cfg->emtc_config.prach_catm_zero_correlation_zone_configuration.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CATM_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG;
+    cfg->num_tlv++;
+
+    cfg->emtc_config.prach_catm_high_speed_flag.value                     = radioResourceConfigCommon_BRP->prach_Config.prach_ConfigInfo.highSpeedFlag;
+    cfg->emtc_config.prach_catm_high_speed_flag.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CATM_HIGH_SPEED_FLAG;
+    cfg->num_tlv++;
+ 
+    struct PRACH_ConfigSIB_v1310 *ext4_prach=radioResourceConfigCommon_BRP->ext4->prach_ConfigCommon_v1310; 
+
+    PRACH_ParametersListCE_r13_t	 *prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13;
+
+    PRACH_ParametersCE_r13_t *p;
+    cfg->emtc_config.prach_ce_level_0_enable.value=0;
+    cfg->emtc_config.prach_ce_level_0_enable.tl.tag=NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG;
+    cfg->num_tlv++;
+ 
+    cfg->emtc_config.prach_ce_level_1_enable.value=0;
+    cfg->emtc_config.prach_ce_level_1_enable.tl.tag=NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG;
+    cfg->num_tlv++;
+ 
+    cfg->emtc_config.prach_ce_level_2_enable.value=0;
+    cfg->emtc_config.prach_ce_level_2_enable.tl.tag=NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG;
+    cfg->num_tlv++;
+ 
+    cfg->emtc_config.prach_ce_level_3_enable.value=0;
+    cfg->emtc_config.prach_ce_level_3_enable.tl.tag=NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG;
+    cfg->num_tlv++;
+ 
+    switch (prach_ParametersListCE_r13->list.count) {
+    case 4:
+      p=prach_ParametersListCE_r13->list.array[3];
+      cfg->emtc_config.prach_ce_level_3_enable.value                            = 1;
+      cfg->emtc_config.prach_ce_level_3_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_3_configuration_index.value               = p->prach_ConfigIndex_r13;
+      cfg->emtc_config.prach_ce_level_3_configuration_index.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_3_frequency_offset.value                  = p->prach_FreqOffset_r13;
+      cfg->emtc_config.prach_ce_level_3_frequency_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.value = p->numRepetitionPerPreambleAttempt_r13;
+      cfg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+      cfg->num_tlv++;
+
+      if (p->prach_StartingSubframe_r13) {
+	cfg->emtc_config.prach_ce_level_3_starting_subframe_periodicity.value   = *p->prach_StartingSubframe_r13;
+	cfg->emtc_config.prach_ce_level_3_starting_subframe_periodicity.tl.tag  = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG;
+        cfg->num_tlv++;
+      }
+
+      cfg->emtc_config.prach_ce_level_3_hopping_enable.value                    = p->prach_HoppingConfig_r13;
+      cfg->emtc_config.prach_ce_level_3_hopping_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_3_hopping_offset.value                    = cfg->rf_config.ul_channel_bandwidth.value-6;
+      cfg->emtc_config.prach_ce_level_3_hopping_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG;
+      cfg->num_tlv++;
+
+    case 3:
+      p=prach_ParametersListCE_r13->list.array[2];
+      cfg->emtc_config.prach_ce_level_2_enable.value                            = 1;
+      cfg->emtc_config.prach_ce_level_2_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_2_configuration_index.value               = p->prach_ConfigIndex_r13;
+      cfg->emtc_config.prach_ce_level_2_configuration_index.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_2_frequency_offset.value                  = p->prach_FreqOffset_r13;
+      cfg->emtc_config.prach_ce_level_2_frequency_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.value = p->numRepetitionPerPreambleAttempt_r13;
+      cfg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+      cfg->num_tlv++;
+
+      if (p->prach_StartingSubframe_r13) {
+	cfg->emtc_config.prach_ce_level_2_starting_subframe_periodicity.value   = *p->prach_StartingSubframe_r13;
+	cfg->emtc_config.prach_ce_level_2_starting_subframe_periodicity.tl.tag  = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG;
+        cfg->num_tlv++;
+      }
+
+      cfg->emtc_config.prach_ce_level_2_hopping_enable.value                    = p->prach_HoppingConfig_r13;
+      cfg->emtc_config.prach_ce_level_2_hopping_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_2_hopping_offset.value                    = cfg->rf_config.ul_channel_bandwidth.value-6;
+      cfg->emtc_config.prach_ce_level_2_hopping_offset.tl.tag                   = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG;
+      cfg->num_tlv++;
+
+    case 2:
+      p=prach_ParametersListCE_r13->list.array[1];
+      cfg->emtc_config.prach_ce_level_1_enable.value                            = 1;
+      cfg->emtc_config.prach_ce_level_1_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_1_configuration_index.value               = p->prach_ConfigIndex_r13;
+      cfg->emtc_config.prach_ce_level_1_configuration_index.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_1_frequency_offset.value                  = p->prach_FreqOffset_r13;
+      cfg->emtc_config.prach_ce_level_1_frequency_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG;
+      cfg->num_tlv++;
+
+      cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.value = p->numRepetitionPerPreambleAttempt_r13;
+      cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+      cfg->num_tlv++;
+
+      if (p->prach_StartingSubframe_r13) {
+	cfg->emtc_config.prach_ce_level_1_starting_subframe_periodicity.value   = *p->prach_StartingSubframe_r13;
+	cfg->emtc_config.prach_ce_level_1_starting_subframe_periodicity.tl.tag  = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG;
+        cfg->num_tlv++;
+      }
+ 
+      cfg->emtc_config.prach_ce_level_1_hopping_enable.value                    = p->prach_HoppingConfig_r13;
+      cfg->emtc_config.prach_ce_level_1_hopping_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG;
+      cfg->num_tlv++;
+ 
+      cfg->emtc_config.prach_ce_level_1_hopping_offset.value                    = cfg->rf_config.ul_channel_bandwidth.value-6;
+      cfg->emtc_config.prach_ce_level_1_hopping_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG;
+      cfg->num_tlv++;
+ 
+    case 1:
+      p=prach_ParametersListCE_r13->list.array[0];
+      cfg->emtc_config.prach_ce_level_0_enable.value                            = 1;
+      cfg->emtc_config.prach_ce_level_0_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG;
+      cfg->num_tlv++;
+ 
+      cfg->emtc_config.prach_ce_level_0_configuration_index.value               = p->prach_ConfigIndex_r13;
+      cfg->emtc_config.prach_ce_level_0_configuration_index.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG;
+      cfg->num_tlv++;
+ 
+      cfg->emtc_config.prach_ce_level_0_frequency_offset.value                  = p->prach_FreqOffset_r13;
+      cfg->emtc_config.prach_ce_level_0_frequency_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG;
+      cfg->num_tlv++;
+ 
+      cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value = p->numRepetitionPerPreambleAttempt_r13;
+      cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG;
+      cfg->num_tlv++;
+ 
+      if (p->prach_StartingSubframe_r13) {
+	cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value   = *p->prach_StartingSubframe_r13;
+	cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.tl.tag  = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG;
+        cfg->num_tlv++;
+      }
+ 
+      cfg->emtc_config.prach_ce_level_0_hopping_enable.value                    = p->prach_HoppingConfig_r13;
+      cfg->emtc_config.prach_ce_level_0_hopping_enable.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG;
+      cfg->num_tlv++;
+ 
+      cfg->emtc_config.prach_ce_level_0_hopping_offset.value                    = cfg->rf_config.ul_channel_bandwidth.value-6;
+      cfg->emtc_config.prach_ce_level_0_hopping_offset.tl.tag = NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG;
+      cfg->num_tlv++;
+    }
 
-	struct FreqHoppingParameters_r13 *ext4_freqHoppingParameters =
-	    radioResourceConfigCommonP->ext4->freqHoppingParameters_r13;
-	if ((ext4_freqHoppingParameters)
-	    &&
-	    (ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeA_r13))
-	{
-	    switch
-		(ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeA_r13->
-		 present) {
-	    case FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeA_r13_PR_NOTHING:	/* No components present */
-		break;
-	    case FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeA_r13_PR_interval_FDD_r13:
-		cfg->emtc_config.
-		    pucch_interval_ulhoppingconfigcommonmodea.value =
-		    ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeA_r13->
-		    choice.interval_FDD_r13;
-		break;
-	    case FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeA_r13_PR_interval_TDD_r13:
-		cfg->emtc_config.
-		    pucch_interval_ulhoppingconfigcommonmodea.value =
-		    ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeA_r13->
-		    choice.interval_TDD_r13;
-		break;
-	    }
-	}
-	if ((ext4_freqHoppingParameters) &&
-	    (ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeB_r13))
-	{
-	    switch
-		(ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeB_r13->
-		 present) {
-	    case FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeB_r13_PR_NOTHING:	/* No components present */
-		break;
-	    case FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeB_r13_PR_interval_FDD_r13:
-		cfg->emtc_config.
-		    pucch_interval_ulhoppingconfigcommonmodeb.value =
-		    ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeB_r13->
-		    choice.interval_FDD_r13;
-		break;
-	    case FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeB_r13_PR_interval_TDD_r13:
-		cfg->emtc_config.
-		    pucch_interval_ulhoppingconfigcommonmodeb.value =
-		    ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeB_r13->
-		    choice.interval_TDD_r13;
-		break;
-	    }
-	}
+    struct FreqHoppingParameters_r13 *ext4_freqHoppingParameters = radioResourceConfigCommonP->ext4->freqHoppingParameters_r13;
+    if ((ext4_freqHoppingParameters) && 
+	(ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeA_r13)){
+      switch(ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeA_r13->present) {
+      case 	FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeA_r13_PR_NOTHING:	/* No components present */
+	break;
+      case FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeA_r13_PR_interval_FDD_r13:
+	cfg->emtc_config.pucch_interval_ulhoppingconfigcommonmodea.value = ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeA_r13->choice.interval_FDD_r13;
+	cfg->emtc_config.pucch_interval_ulhoppingconfigcommonmodea.tl.tag = NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG;
+        cfg->num_tlv++;
+	break;
+      case FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeA_r13_PR_interval_TDD_r13:
+	cfg->emtc_config.pucch_interval_ulhoppingconfigcommonmodea.value = ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeA_r13->choice.interval_TDD_r13;
+	cfg->emtc_config.pucch_interval_ulhoppingconfigcommonmodea.tl.tag = NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG;
+        cfg->num_tlv++;
+	break;
+      }
+    }
+    if ((ext4_freqHoppingParameters) && 
+	(ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeB_r13)){
+      switch(ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeB_r13->present) {
+      case 	FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeB_r13_PR_NOTHING:	/* No components present */
+	break;
+      case FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeB_r13_PR_interval_FDD_r13:
+	cfg->emtc_config.pucch_interval_ulhoppingconfigcommonmodeb.value = ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeB_r13->choice.interval_FDD_r13;
+	cfg->emtc_config.pucch_interval_ulhoppingconfigcommonmodeb.tl.tag = NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG;
+        cfg->num_tlv++;
+	break;
+      case FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeB_r13_PR_interval_TDD_r13:
+	cfg->emtc_config.pucch_interval_ulhoppingconfigcommonmodeb.value = ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeB_r13->choice.interval_TDD_r13;
+	cfg->emtc_config.pucch_interval_ulhoppingconfigcommonmodeb.tl.tag = NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG;
+        cfg->num_tlv++;
+	break;
+      }
     }
+  }
 #endif
 
 }
@@ -597,66 +752,67 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP,
 		       SystemInformationBlockType1_v1310_IEs_t *
 		       sib1_v13ext
 #endif
-    )
-{
-
-    int i;
-
-    int UE_id = -1;
-    eNB_MAC_INST *eNB = RC.mac[Mod_idP];
-    UE_list_t *UE_list = &eNB->UE_list;
-
-    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
-	(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
-
-
-    if (mib != NULL) {
-	if (RC.mac == NULL)
-	    l2_init_eNB();
-
-	mac_top_init_eNB();
-
-	RC.mac[Mod_idP]->common_channels[CC_idP].mib = mib;
-	RC.mac[Mod_idP]->common_channels[CC_idP].physCellId = physCellId;
-	RC.mac[Mod_idP]->common_channels[CC_idP].p_eNB = p_eNB;
-	RC.mac[Mod_idP]->common_channels[CC_idP].Ncp = Ncp;
-	RC.mac[Mod_idP]->common_channels[CC_idP].eutra_band = eutra_band;
-	RC.mac[Mod_idP]->common_channels[CC_idP].dl_CarrierFreq =
-	    dl_CarrierFreq;
-
-	LOG_I(MAC,
-	      "Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d,Nid_cell %d,p %d,DL freq %u,phich_config.resource %d, phich_config.duration %d)\n",
-	      Mod_idP,
-	      CC_idP,
-	      eutra_band,
-	      to_prb((int) mib->message.dl_Bandwidth),
-	      physCellId,
-	      p_eNB,
-	      dl_CarrierFreq,
-	      (int) mib->message.phich_Config.phich_Resource,
-	      (int) mib->message.phich_Config.phich_Duration);
-
-	config_mib(Mod_idP, CC_idP,
-		   eutra_band,
-		   mib->message.dl_Bandwidth,
-		   &mib->message.phich_Config,
-		   physCellId, Ncp, p_eNB, dl_CarrierFreq, ul_CarrierFreq
+                       ) {
+			   
+  int i;
+
+  int UE_id = -1;
+  eNB_MAC_INST *eNB = RC.mac[Mod_idP];
+  UE_list_t *UE_list= &eNB->UE_list;
+
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
+
+  LOG_E(MAC, "RC.mac:%p mib:%p\n", RC.mac, mib);
+
+  if (mib != NULL) {
+    if (RC.mac == NULL)
+      l2_init_eNB();
+
+    mac_top_init_eNB();
+
+    RC.mac[Mod_idP]->common_channels[CC_idP].mib = mib;
+    RC.mac[Mod_idP]->common_channels[CC_idP].physCellId = physCellId;
+    RC.mac[Mod_idP]->common_channels[CC_idP].p_eNB = p_eNB;
+    RC.mac[Mod_idP]->common_channels[CC_idP].Ncp = Ncp;
+    RC.mac[Mod_idP]->common_channels[CC_idP].eutra_band = eutra_band;
+    RC.mac[Mod_idP]->common_channels[CC_idP].dl_CarrierFreq = dl_CarrierFreq;
+
+    LOG_I(MAC,
+	  "Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d,Nid_cell %d,p %d,DL freq %u,phich_config.resource %d, phich_config.duration %d)\n",
+	  Mod_idP, 
+	  CC_idP, 
+	  eutra_band, 
+	  to_prb((int)mib->message.dl_Bandwidth), 
+	  physCellId, 
+	  p_eNB,
+	  dl_CarrierFreq,
+	  (int)mib->message.phich_Config.phich_Resource,
+	  (int)mib->message.phich_Config.phich_Duration);
+
+    config_mib(Mod_idP,CC_idP,
+	       eutra_band,
+	       mib->message.dl_Bandwidth,
+	       &mib->message.phich_Config,
+	       physCellId,
+	       Ncp,
+	       p_eNB,
+	       dl_CarrierFreq,
+	       ul_CarrierFreq
 #ifdef Rel14
 		   , pbch_repetition
 #endif
-	    );
+	       );
 
-	mac_init_cell_params(Mod_idP, CC_idP);
-    }
-    if (schedulingInfoList != NULL) {
-	RC.mac[Mod_idP]->common_channels[CC_idP].tdd_Config = tdd_Config;
-	RC.mac[Mod_idP]->common_channels[CC_idP].schedulingInfoList =
-	    schedulingInfoList;
-	config_sib1(Mod_idP, CC_idP, tdd_Config);
+    mac_init_cell_params(Mod_idP,CC_idP);
+
+    if (schedulingInfoList!=NULL)  {
+      RC.mac[Mod_idP]->common_channels[CC_idP].tdd_Config         = tdd_Config;    
+      RC.mac[Mod_idP]->common_channels[CC_idP].schedulingInfoList = schedulingInfoList;    
+      config_sib1(Mod_idP,CC_idP,tdd_Config);
     }
 #ifdef Rel14
     if (sib1_v13ext != NULL) {
-	RC.mac[Mod_idP]->common_channels[CC_idP].sib1_v13ext = sib1_v13ext;
+      RC.mac[Mod_idP]->common_channels[CC_idP].sib1_v13ext = sib1_v13ext;
     }
 #endif
     if (radioResourceConfigCommon != NULL) {
@@ -719,53 +875,52 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP,
 		    NULL, ul_Bandwidth, additionalSpectrumEmission,
 		    mbsfn_SubframeConfigList);
 
-
     }
-    // SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
-    if (logicalChannelConfig != NULL) {	// check for eMTC specific things
-	UE_id = find_UE_id(Mod_idP, rntiP);
-
-	if (UE_id == -1) {
-	    LOG_E(MAC, "%s:%d:%s: ERROR, UE_id == -1\n", __FILE__,
-		  __LINE__, __FUNCTION__);
-	} else {
-	    if (logicalChannelConfig)
-		UE_list->
-		    UE_template[CC_idP][UE_id].lcgidmap
-		    [logicalChannelIdentity] =
-		    *logicalChannelConfig->
-		    ul_SpecificParameters->logicalChannelGroup;
-	    else
-		UE_list->
-		    UE_template[CC_idP][UE_id].lcgidmap
-		    [logicalChannelIdentity] = 0;
-	}
+  } // mib != NULL
+
+  // SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
+  if (logicalChannelConfig != NULL) {	// check for eMTC specific things
+    UE_id = find_UE_id(Mod_idP, rntiP);
+
+    if (UE_id == -1) {
+      LOG_E(MAC, "%s:%d:%s: ERROR, UE_id == -1\n", __FILE__,
+          __LINE__, __FUNCTION__);
+    } else {
+      if (logicalChannelConfig)
+        UE_list->
+          UE_template[CC_idP][UE_id].lcgidmap
+          [logicalChannelIdentity] =
+          *logicalChannelConfig->
+            ul_SpecificParameters->logicalChannelGroup;
+      else
+        UE_list->
+          UE_template[CC_idP][UE_id].lcgidmap
+          [logicalChannelIdentity] = 0;
     }
+  }
 
 
-    if (physicalConfigDedicated != NULL) {
-	UE_id = find_UE_id(Mod_idP, rntiP);
+  if (physicalConfigDedicated != NULL) {
+    UE_id = find_UE_id(Mod_idP, rntiP);
 
-	if (UE_id == -1)
-	    LOG_E(MAC, "%s:%d:%s: ERROR, UE_id == -1\n", __FILE__,
-		  __LINE__, __FUNCTION__);
-	else
-	    UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated =
-		physicalConfigDedicated;
-    }
+    if (UE_id == -1)
+      LOG_E(MAC, "%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
+    else
+      UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated = physicalConfigDedicated;
+  }
 
 
 #if defined(Rel10) || defined(Rel14)
 
-    if (sCellToAddMod_r10 != NULL) {
-	UE_id = find_UE_id(Mod_idP, rntiP);
-	if (UE_id == -1)
-	    LOG_E(MAC, "%s:%d:%s: ERROR, UE_id == -1\n", __FILE__,
-		  __LINE__, __FUNCTION__);
-	else
+  if (sCellToAddMod_r10 != NULL) {
+    UE_id = find_UE_id(Mod_idP, rntiP);
+    if (UE_id == -1)
+      LOG_E(MAC, "%s:%d:%s: ERROR, UE_id == -1\n", __FILE__,
+          __LINE__, __FUNCTION__);
+    else
 	    config_dedicated_scell(Mod_idP, rntiP, sCellToAddMod_r10);
 
-    }
+  }
 #endif
 
 
@@ -795,25 +950,18 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP,
     }
 #if defined(Rel10) || defined(Rel14)
 
-    if (mbsfn_AreaInfoList != NULL) {
-	// One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time
-	LOG_I(MAC, "[eNB %d][CONFIG] Received %d MBSFN Area Info\n",
-	      Mod_idP, mbsfn_AreaInfoList->list.count);
-	RC.mac[Mod_idP]->common_channels[0].num_active_mbsfn_area =
-	    mbsfn_AreaInfoList->list.count;
-
-	for (i = 0; i < mbsfn_AreaInfoList->list.count; i++) {
-	    RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i] =
-		mbsfn_AreaInfoList->list.array[i];
-	    LOG_I(MAC,
-		  "[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",
-		  Mod_idP, i,
-		  RC.mac[Mod_idP]->common_channels[0].
-		  mbsfn_AreaInfo[i]->mcch_Config_r9.
-		  mcch_RepetitionPeriod_r9);
-	    //      config_sib13(Mod_idP,0,i,RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
-	}
+  if (mbsfn_AreaInfoList != NULL) {
+      // One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time
+    LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count);
+    RC.mac[Mod_idP]->common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
+    
+    for (i =0; i< mbsfn_AreaInfoList->list.count; i++) {
+      RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
+      LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_idP,i,
+	    RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
+      //      config_sib13(Mod_idP,0,i,RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
     }
+  } 
 
     if (pmch_InfoList != NULL) {
 
@@ -849,21 +997,32 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP,
     }
 #endif
 
+    LOG_E(MAC, "%s() %s:%d RC.mac[Mod_idP]->if_inst->PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.mac[Mod_idP]->if_inst->PHY_config_req);
+
+    // if in nFAPI mode 
+    if (
+        (nfapi_mode == 1 || nfapi_mode == 2) &&
+        (RC.mac[Mod_idP]->if_inst->PHY_config_req == NULL)
+       ) {
+      while(RC.mac[Mod_idP]->if_inst->PHY_config_req == NULL) {
+        // DJP AssertFatal(RC.mac[Mod_idP]->if_inst->PHY_config_req != NULL,"if_inst->phy_config_request is null\n");
+        usleep(100 * 1000);
+        printf("Waiting for PHY_config_req\n");
+      }
+    }
+
     if (radioResourceConfigCommon != NULL) {
-	AssertFatal(RC.mac[Mod_idP]->if_inst->PHY_config_req != NULL,
-		    "if_inst->phy_config_request is null\n");
-	PHY_Config_t phycfg;
-	phycfg.Mod_id = Mod_idP;
-	phycfg.CC_id = CC_idP;
-	phycfg.cfg = &RC.mac[Mod_idP]->config[CC_idP];
-
-	if (RC.mac[Mod_idP]->if_inst->PHY_config_req)
-	    RC.mac[Mod_idP]->if_inst->PHY_config_req(&phycfg);
+      PHY_Config_t phycfg;
+      phycfg.Mod_id = Mod_idP;
+      phycfg.CC_id  = CC_idP;
+      phycfg.cfg    = &RC.mac[Mod_idP]->config[CC_idP];
+
+      if (RC.mac[Mod_idP]->if_inst->PHY_config_req) RC.mac[Mod_idP]->if_inst->PHY_config_req(&phycfg); 
+
+      VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
     }
-    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
-	(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
 
-    return (0);
+    return(0);			   
 }
 
 int
diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c
index 2c3b88306a821b435d7d31da6364ee710395f6ee..f03a3961f67c5d10c6272dd61595cffefe2a7bec 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler.c
@@ -145,7 +145,7 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 			    if (((10 * frameP +
 				  subframeP) % srsPeriodicity) ==
 				srsOffset) {
-				// Prorgram SRS
+				// Program SRS
 				ul_req->srs_present = 1;
 				nfapi_ul_config_request_pdu_t
 				    * ul_config_pdu =
@@ -161,6 +161,7 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 				    2 + (uint8_t) (2 +
 						   sizeof
 						   (nfapi_ul_config_srs_pdu));
+                                ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag                          = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG;
 				ul_config_pdu->srs_pdu.srs_pdu_rel8.size =
 				    (uint8_t)
 				    sizeof(nfapi_ul_config_srs_pdu);;
@@ -196,6 +197,7 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 				//              ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs                = ;//
 				RC.mac[module_idP]->UL_req[CC_id].sfn_sf =
 				    (frameP << 4) + subframeP;
+                                RC.mac[module_idP]->UL_req[CC_id].header.message_id = NFAPI_UL_CONFIG_REQUEST;
 				ul_req->number_of_pdus++;
 			    }	// if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset)
 			}	// if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup)
@@ -269,9 +271,11 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 			    2 + (uint8_t) (2 +
 					   sizeof
 					   (nfapi_ul_config_uci_cqi_pdu));
+                        ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag             = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
 			ul_config_pdu->uci_cqi_pdu.
 			    ue_information.ue_information_rel8.rnti =
 			    UE_list->UE_template[CC_id][UE_id].rnti;
+                        ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag           = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
 			ul_config_pdu->uci_cqi_pdu.
 			    cqi_information.cqi_information_rel8.
 			    pucch_index =
@@ -285,6 +289,7 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 			     get_tmode(module_idP, CC_id, UE_id),
 			     cqi_ReportPeriodic);
 			ul_req->number_of_pdus++;
+                        ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
 
 #if defined(Rel10) || defined(Rel14)
 			// PUT rel10-13 UCI options here
@@ -305,9 +310,11 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 			    2 + (uint8_t) (2 +
 					   sizeof
 					   (nfapi_ul_config_uci_cqi_pdu));
+                        ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag             = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
 			ul_config_pdu->uci_cqi_pdu.
 			    ue_information.ue_information_rel8.rnti =
 			    UE_list->UE_template[CC_id][UE_id].rnti;
+                        ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag           = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
 			ul_config_pdu->uci_cqi_pdu.
 			    cqi_information.cqi_information_rel8.
 			    pucch_index =
@@ -319,6 +326,7 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 			RC.mac[module_idP]->UL_req[CC_id].sfn_sf =
 			    (frameP << 4) + subframeP;
 			ul_req->number_of_pdus++;
+                        ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
 		    }
 
 		}		// if ((cqi_ReportPeriodic = cqi_ReportConfig->cqi_ReportPeriodic)!=NULL) {
@@ -332,7 +340,8 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 {
     eNB_MAC_INST *eNB = RC.mac[module_idP];
     UE_list_t *UE_list = &eNB->UE_list;
-    nfapi_ul_config_request_body_t *ul_req;
+    nfapi_ul_config_request_t      *ul_req;
+    nfapi_ul_config_request_body_t *ul_req_body;
     int CC_id;
     int UE_id;
     SchedulingRequestConfig_t *SRconfig;
@@ -349,8 +358,8 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 	    if (RC.mac[module_idP]->UE_list.active[UE_id] != TRUE)
 		continue;
 
-	    ul_req =
-		&RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
+            ul_req        = &RC.mac[module_idP]->UL_req[CC_id];
+            ul_req_body   = &ul_req->ul_config_request_body;
 
 	    // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
 	    if (mac_eNB_get_rrc_status
@@ -397,28 +406,18 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 	    skip_ue = 0;
 	    is_harq = 0;
 	    // check that there is no existing UL grant for ULSCH which overrides the SR
-	    for (i = 0; i < ul_req->number_of_pdus; i++) {
-		if (((ul_req->ul_config_pdu_list[i].pdu_type ==
-		      NFAPI_UL_CONFIG_ULSCH_PDU_TYPE)
-		     || (ul_req->ul_config_pdu_list[i].pdu_type ==
-			 NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE)
-		     || (ul_req->ul_config_pdu_list[i].pdu_type ==
-			 NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)
-		     || (ul_req->ul_config_pdu_list[i].pdu_type ==
-			 NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE))
-		    && (ul_req->ul_config_pdu_list[i].
-			ulsch_pdu.ulsch_pdu_rel8.rnti ==
-			UE_list->UE_template[CC_id][UE_id].rnti)) {
+	    for (i = 0; i < ul_req_body->number_of_pdus; i++) {
+		if (((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) || 
+                      (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) || 
+                      (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) || 
+                      (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE)) && 
+                    (ul_req_body->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
 		    skip_ue = 1;
 		    break;
 		}
 		/* if there is already an HARQ pdu, convert to SR_HARQ */
-		else if ((ul_req->ul_config_pdu_list[i].pdu_type ==
-			  NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE)
-			 && (ul_req->ul_config_pdu_list[i].
-			     uci_harq_pdu.ue_information.
-			     ue_information_rel8.rnti ==
-			     UE_list->UE_template[CC_id][UE_id].rnti)) {
+		else if ((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) && 
+                    (ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
 		    is_harq = 1;
 		    break;
 		}
@@ -428,10 +427,7 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 	    if (skip_ue == 1)
 		continue;
 
-	    LOG_D(MAC,
-		  "Frame %d, Subframe %d : Scheduling SR for UE %d/%x\n",
-		  frameP, subframeP, UE_id,
-		  UE_list->UE_template[CC_id][UE_id].rnti);
+            LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x is_harq:%d\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti, is_harq);
 
 	    // check Rel10 or Rel8 SR
 #if defined(Rel10) || defined(Rel14)
@@ -443,49 +439,48 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 		&& (UE_list->
 		    UE_template[CC_id][UE_id].physicalConfigDedicated->
 		    ext2->schedulingRequestConfig_v1020)) {
+                sr.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG;
 		sr.sr_information_rel10.number_of_pucch_resources = 1;
 		sr.sr_information_rel10.pucch_index_p1 =
 		    *UE_list->
 		    UE_template[CC_id][UE_id].physicalConfigDedicated->
 		    ext2->
 		    schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10;
+                LOG_D(MAC,"REL10 PUCCH INDEX P1:%d\n", sr.sr_information_rel10.pucch_index_p1);
 	    } else
 #endif
 	    {
+                sr.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG;
 		sr.sr_information_rel8.pucch_index =
 		    UE_list->
 		    UE_template[CC_id][UE_id].physicalConfigDedicated->
 		    schedulingRequestConfig->choice.setup.
 		    sr_PUCCH_ResourceIndex;
+                LOG_D(MAC,"REL8 PUCCH INDEX:%d\n", sr.sr_information_rel8.pucch_index);
 	    }
 
 	    /* if there is already an HARQ pdu, convert to SR_HARQ */
 	    if (is_harq) {
-		nfapi_ul_config_harq_information h =
-		    ul_req->ul_config_pdu_list[i].uci_harq_pdu.
-		    harq_information;
-		ul_req->ul_config_pdu_list[i].pdu_type =
-		    NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE;
-		ul_req->ul_config_pdu_list[i].uci_sr_harq_pdu.
-		    sr_information = sr;
-		ul_req->ul_config_pdu_list[i].uci_sr_harq_pdu.
-		    harq_information = h;
+		nfapi_ul_config_harq_information h = ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.harq_information;
+		ul_req_body->ul_config_pdu_list[i].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE;
+		ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.sr_information = sr;
+		ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.harq_information = h;
 	    } else {
-		ul_req->ul_config_pdu_list[ul_req->number_of_pdus].
-		    pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE;
-		ul_req->ul_config_pdu_list[ul_req->
-					   number_of_pdus].uci_sr_pdu.
-		    ue_information.ue_information_rel8.rnti =
-		    UE_list->UE_template[CC_id][UE_id].rnti;
-		ul_req->ul_config_pdu_list[ul_req->
-					   number_of_pdus].uci_sr_pdu.
-		    sr_information = sr;
-		ul_req->number_of_pdus++;
+		ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE;
+                ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
+		ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
+                ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel11.tl.tag = 0;
+                ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel13.tl.tag = 0;
+                ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.sr_information                            = sr;
+		ul_req_body->number_of_pdus++;
 	    }			/* if (is_harq) */
+            ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
 	}			// for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id])
     }				// for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
 }
 
+extern uint8_t nfapi_mode;
+
 void
 check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
 		 frame_t frameP, sub_frame_t subframeP)
@@ -513,6 +508,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
 	    dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
 	    dl_config_pdu->pdu_size =
 		(uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
+            dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag                = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
 	    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format =
 		NFAPI_DL_DCI_FORMAT_1A;
 	    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level =
@@ -532,6 +528,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
 		pdcch_order_table[cc[CC_id].mib->message.dl_Bandwidth];
 	    DL_req[CC_id].dl_config_request_body.number_dci++;
 	    DL_req[CC_id].dl_config_request_body.number_pdu++;
+            DL_req[CC_id].dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
 	    LOG_I(MAC,
 		  "UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d), resource_block_coding %d \n",
 		  UE_id, rnti,
@@ -572,55 +569,59 @@ clear_nfapi_information(eNB_MAC_INST * eNB, int CC_idP,
     nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[0];
     nfapi_tx_request_t *TX_req = &eNB->TX_req[0];
 
-
     eNB->pdu_index[CC_idP] = 0;
-    DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols = 1;
-    DL_req[CC_idP].dl_config_request_body.number_dci = 0;
-    DL_req[CC_idP].dl_config_request_body.number_pdu = 0;
-    DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0;
-    DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich = 6000;
 
-    HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf =
-	subframeP + (frameP << 4);
-    HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0;
+    if (nfapi_mode==0 || nfapi_mode == 1) { // monolithic or PNF
 
+      DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols           = 1;
+      DL_req[CC_idP].dl_config_request_body.number_dci                          = 0;
+      DL_req[CC_idP].dl_config_request_body.number_pdu                          = 0;
+      DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti                   = 0;
+      DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich           = 6000;
 
-    UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0;
-    UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources = 0;	// ignored, handled by PHY for now
-    UL_req[CC_idP].ul_config_request_body.srs_present = 0;	// ignored, handled by PHY for now
+      HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf                            = subframeP + (frameP<<4);
+      HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci                    = 0;
 
 
-    TX_req[CC_idP].tx_request_body.number_of_pdus = 0;
+      UL_req[CC_idP].ul_config_request_body.number_of_pdus                      = 0;
+      UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources      = 0; // ignored, handled by PHY for now
+      UL_req[CC_idP].ul_config_request_body.srs_present                         = 0; // ignored, handled by PHY for now
 
+      TX_req[CC_idP].tx_request_body.number_of_pdus                 = 0;
 
+    }
 }
 
 void
 copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 {
     int CC_id;
-    eNB_MAC_INST *eNB;
-    nfapi_ul_config_request_body_t *ul_req_tmp;
-    nfapi_ul_config_request_body_t *ul_req;
-
-    eNB = RC.mac[module_idP];
+    eNB_MAC_INST *mac = RC.mac[module_idP];
 
     for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
 
-	ul_req_tmp =
-	    &eNB->UL_req_tmp[CC_id][subframeP].ul_config_request_body;
-	ul_req = &eNB->UL_req[CC_id].ul_config_request_body;
+      nfapi_ul_config_request_t *ul_req_tmp = &mac->UL_req_tmp[CC_id][subframeP];
+      nfapi_ul_config_request_t *ul_req     = &mac->UL_req[CC_id];
+      nfapi_ul_config_request_pdu_t *ul_req_pdu = ul_req->ul_config_request_body.ul_config_pdu_list;
 
-	eNB->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
-	ul_req->number_of_pdus = ul_req_tmp->number_of_pdus;
-	ul_req_tmp->number_of_pdus = 0;
+      *ul_req = *ul_req_tmp;
 
-	memcpy((void *) ul_req->ul_config_pdu_list,
-	       (void *) ul_req_tmp->ul_config_pdu_list,
-	       ul_req->number_of_pdus *
-	       sizeof(nfapi_ul_config_request_pdu_t));
+      // Restore the pointer
+      ul_req->ul_config_request_body.ul_config_pdu_list = ul_req_pdu;
 
-    }
+      ul_req->sfn_sf   = (frameP<<4) + subframeP;
+
+      ul_req_tmp->ul_config_request_body.number_of_pdus = 0;
+
+      if (ul_req->ul_config_request_body.number_of_pdus>0)
+      {
+        LOG_D(PHY, "%s() active NOW (frameP:%d subframeP:%d) pdus:%d\n", __FUNCTION__, frameP, subframeP, ul_req->ul_config_request_body.number_of_pdus);
+      }
+
+      memcpy((void*)ul_req->ul_config_request_body.ul_config_pdu_list,
+          (void*)ul_req_tmp->ul_config_request_body.ul_config_pdu_list,
+          ul_req->ul_config_request_body.number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t));
+  }
 }
 
 void
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
index 327f5faafe16182cceb24ed5736661b47b0f186b..7b45401b06aae382d2265fb772a444494c1fd64d 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
@@ -65,6 +65,37 @@
 
 #include "T.h"
 
+extern uint8_t nfapi_mode;
+extern int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
+
+void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset)
+{
+    *frameP    = (*frameP + ((*subframeP + offset) / 10)) % 1024;
+
+    *subframeP = ((*subframeP + offset) % 10);
+}
+
+uint16_t sfnsf_add_subframe(uint16_t frameP, uint16_t subframeP, int offset)
+{
+  add_subframe(&frameP, &subframeP, offset);
+  return frameP<<4|subframeP;
+}
+
+void subtract_subframe(uint16_t *frameP, uint16_t *subframeP, int offset)
+{
+  if (*subframeP < offset)
+  {
+    *frameP = (*frameP+1024-1)%1024;
+  }
+  *subframeP = (*subframeP+10-offset)%10;
+}
+
+uint16_t sfnsf_subtract_subframe(uint16_t frameP, uint16_t subframeP, int offset)
+{
+  subtract_subframe(&frameP, &subframeP, offset);
+  return frameP<<4|subframeP;
+}
+
 void
 add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
 	 sub_frame_t subframeP)
@@ -73,15 +104,15 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
     COMMON_channels_t *cc = &mac->common_channels[CC_id];
     uint8_t j;
     nfapi_ul_config_request_t *ul_req;
-    nfapi_ul_config_request_pdu_t *ul_config_pdu;
     nfapi_ul_config_request_body_t *ul_req_body;
-    nfapi_hi_dci0_request_body_t *hi_dci0_req;
-    nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
+    nfapi_ul_config_request_pdu_t *ul_config_pdu;
+    nfapi_hi_dci0_request_t        *hi_dci0_req = &mac->HI_DCI0_req[CC_id];
+    nfapi_hi_dci0_request_body_t   *hi_dci0_req_body = &hi_dci0_req->hi_dci0_request_body;
+    nfapi_hi_dci0_request_pdu_t    *hi_dci0_pdu;
 
     uint8_t rvseq[4] = { 0, 2, 3, 1 };
 
 
-    hi_dci0_req = &mac->HI_DCI0_req[CC_id].hi_dci0_request_body;
     ul_req = &mac->UL_req_tmp[CC_id][ra->Msg3_subframe];
     ul_req_body = &ul_req->ul_config_request_body;
     AssertFatal(ra->state != IDLE, "RA is not active for RA %X\n",
@@ -108,6 +139,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
 	ul_config_pdu->pdu_size =
 	    (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
 	ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = mac->ul_handle++;
+        ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
 	ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = ra->rnti;
 	ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start =
 	    narrowband_to_first_rb(cc,
@@ -132,6 +164,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
 	ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size =
 	    get_TBS_UL(ra->msg3_mcs, ra->msg3_nb_rb);
 	// Re13 fields
+        ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG;
 	ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type =
 	    ra->rach_resource_type > 2 ? 2 : 1;
 	ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.
@@ -141,6 +174,9 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
 	    initial_transmission_sf_io =
 	    (ra->Msg3_frame * 10) + ra->Msg3_subframe;
 	ul_req_body->number_of_pdus++;
+        ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
+        ul_req->sfn_sf = ra->Msg3_frame<<4|ra->Msg3_subframe;
+        ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
     }				//  if (ra->rach_resource_type>0) {  
     else
 #endif
@@ -163,6 +199,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
 	ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
 	ul_config_pdu->pdu_size =
 	    (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
+        ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
 	ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = mac->ul_handle++;
 	ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = ra->rnti;
 	ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start =
@@ -187,24 +224,41 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
 	ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size =
 	    get_TBS_UL(10, ra->msg3_nb_rb);
 	ul_req_body->number_of_pdus++;
+        ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
+        ul_req->sfn_sf = ra->Msg3_frame<<4|ra->Msg3_subframe;
+        ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
 	// save UL scheduling information for preprocessor
 	for (j = 0; j < ra->msg3_nb_rb; j++)
 	    cc->vrb_map_UL[ra->msg3_first_rb + j] = 1;
 
+        LOG_D(MAC, "MSG3: UL_CONFIG SFN/SF:%d number_of_pdus:%d ra->msg3_round:%d\n", NFAPI_SFNSF2DEC(ul_req->sfn_sf), ul_req_body->number_of_pdus, ra->msg3_round);
 
 	if (ra->msg3_round != 0) {	// program HI too
-	    hi_dci0_pdu =
-		&hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci +
-					       hi_dci0_req->number_of_hi];
+	    hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi];
 	    memset((void *) hi_dci0_pdu, 0,
 		   sizeof(nfapi_hi_dci0_request_pdu_t));
 	    hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE;
 	    hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_hi_pdu);
+            hi_dci0_pdu->hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG;
 	    hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start =
 		ra->msg3_first_rb;
 	    hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0;
 	    hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0;
-	    hi_dci0_req->number_of_hi++;
+	    hi_dci0_req_body->number_of_hi++;
+
+            hi_dci0_req_body->sfnsf = sfnsf_add_subframe(ra->Msg3_frame, ra->Msg3_subframe, 0);
+            hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
+
+            hi_dci0_req->sfn_sf = sfnsf_add_subframe(ra->Msg3_frame, ra->Msg3_subframe, 4);
+            hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST;
+
+            if (nfapi_mode) {
+              oai_nfapi_hi_dci0_req(hi_dci0_req);
+              hi_dci0_req_body->number_of_hi=0;
+            }
+
+            LOG_D(MAC, "MSG3: HI_DCI0 SFN/SF:%d number_of_dci:%d number_of_hi:%d\n", NFAPI_SFNSF2DEC(hi_dci0_req->sfn_sf), hi_dci0_req_body->number_of_dci, hi_dci0_req_body->number_of_hi);
+
 	    // save UL scheduling information for preprocessor
 	    for (j = 0; j < ra->msg3_nb_rb; j++)
 		cc->vrb_map_UL[ra->msg3_first_rb + j] = 1;
@@ -251,6 +305,8 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
     uint16_t absSF = (10 * frameP) + subframeP;
     uint16_t absSF_Msg2 = (10 * ra->Msg2_frame) + ra->Msg2_subframe;
 
+    LOG_D(MAC,"absSF:%d absSF_Msg2:%d ra->rach_resource_type:%d\n",absSF,absSF_Msg2,ra->rach_resource_type);
+
     if (absSF > absSF_Msg2)
 	return;			// we're not ready yet, need to be to start ==  
 
@@ -325,6 +381,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 	    dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE;
 	    dl_config_pdu->pdu_size =
 		(uint8_t) (2 + sizeof(nfapi_dl_config_mpdcch_pdu));
+            dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG;
 	    dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format =
 		(ra->rach_resource_type > 1) ? 11 : 10;
 	    dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band =
@@ -397,8 +454,11 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 		number_of_tx_antenna_ports = 1;
 	    ra->msg2_mpdcch_repetition_cnt++;
 	    dl_req->number_pdu++;
+            dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
 	    ra->Msg2_subframe = (ra->Msg2_subframe + 9) % 10;
 
+            mac->DL_req[CC_idP].sfn_sf = sfnsf_add_subframe(ra->Msg2_frame, ra->Msg2_subframe, 4);	// nFAPI is runnning at TX SFN/SF - ie 4 ahead
+            mac->DL_req[CC_idP].header.message_id = NFAPI_DL_CONFIG_REQUEST;
 	}			//repetition_count==0 && SF condition met
 	if (ra->msg2_mpdcch_repetition_cnt > 0) {	// we're in a stream of repetitions
 	    LOG_D(MAC,
@@ -427,6 +487,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 		      "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH\n",
 		      module_idP, frameP, subframeP);
 		ra->state = WAITMSG3;
+                LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG3\n", module_idP, frameP, subframeP);
 
 		dl_config_pdu =
 		    &dl_req->dl_config_pdu_list[dl_req->number_pdu];
@@ -435,6 +496,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 		dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
 		dl_config_pdu->pdu_size =
 		    (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
+                dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index =
 		    mac->pdu_index[CC_idP];
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->RA_rnti;
@@ -472,11 +534,13 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 		//      dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector                    = ; 
 
 		// Rel10 fields
+                dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start =
 		    cc[CC_idP].
 		    sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->
 		    startSymbolBR_r13;
 		// Rel13 fields
+                dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type =
 		    (ra->rach_resource_type < 3) ? 1 : 2;;
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2;	// not SI message
@@ -486,6 +550,11 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 		    0;
 		dl_req->number_pdu++;
 
+                mac->DL_req[CC_idP].sfn_sf = (frameP<<4)+subframeP;
+                mac->DL_req[CC_idP].header.message_id = NFAPI_DL_CONFIG_REQUEST;
+
+                LOG_D(MAC,"DL_CONFIG SFN/SF:%d/%d MESSAGE2\n", frameP, subframeP);
+
 		// Program UL processing for Msg3, same as regular LTE
 		get_Msg3alloc(&cc[CC_idP], subframeP, frameP,
 			      &ra->Msg3_frame, &ra->Msg3_subframe);
@@ -494,6 +563,8 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 			    cc[CC_idP].RAR_pdu.payload,
 			    ra->rach_resource_type - 1);
 		// DL request
+                mac->TX_req[CC_idP].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+                mac->TX_req[CC_idP].header.message_id = NFAPI_TX_REQUEST;
 		mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP;
 		TX_req =
 		    &mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac->
@@ -531,6 +602,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 	    dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
 	    dl_config_pdu->pdu_size =
 		(uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
+	    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
 	    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format =
 		NFAPI_DL_DCI_FORMAT_1A;
 	    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level =
@@ -570,6 +642,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 		dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
 		dl_config_pdu->pdu_size =
 		    (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
+                dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index =
 		    mac->pdu_index[CC_idP];
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->RA_rnti;
@@ -605,6 +678,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
 		//    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector                    = ; 
 		dl_req->number_pdu++;
+                mac->DL_req[CC_idP].sfn_sf = frameP<<4 | subframeP;
 
 		// Program UL processing for Msg3
 		get_Msg3alloc(&cc[CC_idP], subframeP, frameP,
@@ -619,6 +693,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 			 cc[CC_idP].RAR_pdu.payload, N_RB_DL, 7);
 		add_msg3(module_idP, CC_idP, ra, frameP, subframeP);
 		ra->state = WAITMSG3;
+                LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG3\n", module_idP, frameP, subframeP);
 
 		// DL request
 		mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP;
@@ -638,7 +713,6 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
 	}			// Msg2 frame/subframe condition
     }				// else BL/CE
 }
-
 void
 generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 	      sub_frame_t subframeP, RA_t * ra)
@@ -653,17 +727,19 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
     uint16_t msg4_post_padding;
     uint16_t msg4_header;
 
-    uint8_t *vrb_map;
-    int first_rb;
-    int N_RB_DL;
-    nfapi_dl_config_request_pdu_t *dl_config_pdu;
-    nfapi_ul_config_request_pdu_t *ul_config_pdu;
-    nfapi_tx_request_pdu_t *TX_req;
-    UE_list_t *UE_list = &mac->UE_list;
-    nfapi_dl_config_request_body_t *dl_req;
-    nfapi_ul_config_request_body_t *ul_req;
-    uint8_t lcid;
-    uint8_t offset;
+  uint8_t                         *vrb_map;
+  int                             first_rb;
+  int                             N_RB_DL;
+  nfapi_dl_config_request_pdu_t   *dl_config_pdu;
+  nfapi_ul_config_request_pdu_t   *ul_config_pdu;
+  nfapi_tx_request_pdu_t          *TX_req;
+  UE_list_t                       *UE_list=&mac->UE_list;
+  nfapi_dl_config_request_t      *dl_req;
+  nfapi_dl_config_request_body_t *dl_req_body;
+  nfapi_ul_config_request_body_t *ul_req_body;
+  nfapi_ul_config_request_t      *ul_req;
+  uint8_t                         lcid;
+  uint8_t                         offset;
 
 
 #ifdef Rel14
@@ -750,8 +826,9 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 
     vrb_map = cc[CC_idP].vrb_map;
 
-    dl_req = &mac->DL_req[CC_idP].dl_config_request_body;
-    dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
+    dl_req        = &mac->DL_req[CC_idP];
+    dl_req_body   = &dl_req->dl_config_request_body;
+    dl_config_pdu = &dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu];
     N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth);
 
     UE_id = find_UE_id(module_idP, ra->rnti);
@@ -764,7 +841,6 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
     else
 	ra->harq_pid = ((frameP * 10) + subframeP) & 7;
 
-
     // Get RRCConnectionSetup for Piggyback
     rrc_sdu_length = mac_rrc_data_req(module_idP, CC_idP, frameP, CCCH, 1,	// 1 transport block
 				      &cc[CC_idP].CCCH_pdu.payload[0], ENB_FLAG_YES, module_idP, 0);	// not used in this case
@@ -813,6 +889,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 	    dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE;
 	    dl_config_pdu->pdu_size =
 		(uint8_t) (2 + sizeof(nfapi_dl_config_mpdcch_pdu));
+            dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG;
 	    dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format =
 		(ra->rach_resource_type > 1) ? 11 : 10;
 	    dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band =
@@ -885,7 +962,11 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 	    dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.
 		number_of_tx_antenna_ports = 1;
 	    ra->msg4_mpdcch_repetition_cnt++;
-	    dl_req->number_pdu++;
+	    dl_req_body->number_pdu++;
+            dl_req_body->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
+
+            dl_req->sfn_sf = (ra->Msg4_frame<<4)+ra->Msg4_subframe;
+            dl_req->header.message_id = NFAPI_DL_CONFIG_REQUEST;
 
 	}			//repetition_count==0 && SF condition met
 	else if (ra->msg4_mpdcch_repetition_cnt > 0) {	// we're in a stream of repetitions
@@ -915,12 +996,13 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 		AssertFatal(1 == 0,
 			    "Msg4 generation not finished for BL/CE UE\n");
 		dl_config_pdu =
-		    &dl_req->dl_config_pdu_list[dl_req->number_pdu];
+		    &dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu];
 		memset((void *) dl_config_pdu, 0,
 		       sizeof(nfapi_dl_config_request_pdu_t));
 		dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
 		dl_config_pdu->pdu_size =
 		    (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
+                dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index =
 		    mac->pdu_index[CC_idP];
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->rnti;
@@ -955,11 +1037,13 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
 		//      dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector                    = ; 
 
+                dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start =
 		    cc[CC_idP].
 		    sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->
 		    startSymbolBR_r13;
 
+                dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type =
 		    (ra->rach_resource_type < 3) ? 1 : 2;
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2;	// not SI message
@@ -967,9 +1051,14 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 		    initial_transmission_sf_io = (10 * frameP) + subframeP;
 		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.drms_table_flag =
 		    0;
-		dl_req->number_pdu++;
+		dl_req_body->number_pdu++;
+                dl_req_body->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
 
+                mac->DL_req[CC_idP].sfn_sf = (frameP<<4)+subframeP;
+                mac->DL_req[CC_idP].header.message_id = NFAPI_DL_CONFIG_REQUEST;
+	
 		ra->state = WAITMSG4ACK;
+                LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG4ACK\n", module_idP, frameP, subframeP);
 
 		lcid = 0;
 
@@ -1012,6 +1101,9 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 
 		// DL request
 		mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP;
+                mac->TX_req[CC_idP].tx_request_body.tl.tag  = NFAPI_TX_REQUEST_BODY_TAG;
+                mac->TX_req[CC_idP].header.message_id 	    = NFAPI_TX_REQUEST;
+
 		TX_req =
 		    &mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac->
 								     TX_req
@@ -1032,19 +1124,19 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 		int ackNAK_absSF = absSF + reps + 4;
 		AssertFatal(reps > 2,
 			    "Have to handle programming of ACK when PDSCH repetitions is > 2\n");
-		ul_req =
-		    &mac->UL_req_tmp[CC_idP][ackNAK_absSF %
-					     10].ul_config_request_body;
-		ul_config_pdu =
-		    &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
+		ul_req = &mac->UL_req_tmp[CC_idP][ackNAK_absSF % 10];
+		ul_req_body = &ul_req->ul_config_request_body;
+		ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
 
 		ul_config_pdu->pdu_type =
 		    NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE;
 		ul_config_pdu->pdu_size =
 		    (uint8_t) (2 + sizeof(nfapi_ul_config_uci_harq_pdu));
+                ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
 		ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0;	// don't know how to use this
 		ul_config_pdu->uci_harq_pdu.
 		    ue_information.ue_information_rel8.rnti = ra->rnti;
+                ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG;
 		ul_config_pdu->uci_harq_pdu.
 		    ue_information.ue_information_rel13.ue_type =
 		    (ra->rach_resource_type < 3) ? 1 : 2;
@@ -1056,8 +1148,17 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 		ul_config_pdu->uci_harq_pdu.
 		    ue_information.ue_information_rel13.repetition_number =
 		    0;
+
+                ul_req_body->tl.tag                                                                         = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
+
+                ul_req->sfn_sf  									    = sfnsf_add_subframe(ra->Msg3_frame, ra->Msg3_subframe, 4);
+                ul_req->header.message_id  								    = NFAPI_UL_CONFIG_REQUEST;
+
+                LOG_D(MAC,"UL_req_tmp[CC_idP:%d][ackNAK_absSF mod 10:%d] ra->Msg3_frame:%d ra->Msg3_subframe:%d + 4 sfn_sf:%d\n", CC_idP, ackNAK_absSF%10, ra->Msg3_frame, ra->Msg3_subframe, NFAPI_SFNSF2DEC(ul_req->sfn_sf));
+
 		// Note need to keep sending this across reptitions!!!! Not really for PUCCH, to ask small-cell forum, we'll see for the other messages, maybe parameters change across repetitions and FAPI has to provide for that
 		if (cc[CC_idP].tdd_Config == NULL) {	// FDD case
+                  ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG;
 		    ul_config_pdu->uci_harq_pdu.
 			harq_information.harq_information_rel8_fdd.
 			n_pucch_1_0 =
@@ -1071,7 +1172,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 		    AssertFatal(1 == 0,
 				"PUCCH configuration for ACK/NAK not handled yet for TDD BL/CE case\n");
 		}
-		ul_req->number_of_pdus++;
+		ul_req_body->number_of_pdus++;
 		T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP),
 		  T_INT(CC_idP), T_INT(ra->rnti), T_INT(frameP),
 		  T_INT(subframeP), T_INT(0 /*harq_pid always 0? */ ),
@@ -1145,9 +1246,10 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 				 1,	// ndi
 				 0,	// rv
 				 0);	// vrb_flag
+
 	    LOG_D(MAC,
 		  "Frame %d, subframe %d: Msg4 DCI pdu_num %d (rnti %x,rnti_type %d,harq_pid %d, resource_block_coding (%p) %d\n",
-		  frameP, subframeP, dl_req->number_pdu,
+		  frameP, subframeP, dl_req_body->number_pdu,
 		  dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti,
 		  dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type,
 		  dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process,
@@ -1164,10 +1266,11 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 		(module_idP, CC_idP, 1, subframeP,
 		 dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.
 		 aggregation_level, ra->rnti)) {
-		dl_req->number_dci++;
-		dl_req->number_pdu++;
+		dl_req_body->number_dci++;
+		dl_req_body->number_pdu++;
 
 		ra->state = WAITMSG4ACK;
+                LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG4ACK\n", module_idP, frameP, subframeP);
 
 		// increment Absolute subframe by 8 for Msg4 retransmission
 		LOG_D(MAC,
@@ -1226,7 +1329,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 		       &cc[CC_idP].CCCH_pdu.payload[0], rrc_sdu_length);
 
 		// DLSCH Config
-		fill_nfapi_dlsch_config(mac, dl_req, ra->msg4_TBsize, mac->pdu_index[CC_idP], ra->rnti, 2,	// resource_allocation_type : format 1A/1B/1D
+		fill_nfapi_dlsch_config(mac, dl_req_body, ra->msg4_TBsize, mac->pdu_index[CC_idP], ra->rnti, 2,	// resource_allocation_type : format 1A/1B/1D
 					0,	// virtual_resource_block_assignment_flag : localized
 					getRIV(N_RB_DL, first_rb, 4),	// resource_block_coding : RIV, 4 PRB
 					2,	// modulation: QPSK
@@ -1247,9 +1350,9 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 					1);	// num_bf_vector
 		LOG_D(MAC,
 		      "Filled DLSCH config, pdu number %d, non-dci pdu_index %d\n",
-		      dl_req->number_pdu, mac->pdu_index[CC_idP]);
+		      dl_req_body->number_pdu, mac->pdu_index[CC_idP]);
 
-		// DL request
+		// Tx request
 		mac->TX_req[CC_idP].sfn_sf =
 		    fill_nfapi_tx_req(&mac->TX_req[CC_idP].tx_request_body,
 				      (frameP * 10) + subframeP,
@@ -1261,6 +1364,8 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
 				      [0]);
 		mac->pdu_index[CC_idP]++;
 
+                dl_req->sfn_sf = mac->TX_req[CC_idP].sfn_sf;
+
 		LOG_D(MAC, "Filling UCI ACK/NAK information, cce_idx %d\n",
 		      dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx);
 		// Program PUCCH1a for ACK/NAK
@@ -1312,7 +1417,8 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
     int N_RB_DL;
     nfapi_dl_config_request_pdu_t *dl_config_pdu;
     UE_list_t *UE_list = &mac->UE_list;
-    nfapi_dl_config_request_body_t *dl_req;
+    nfapi_dl_config_request_t *dl_req;
+    nfapi_dl_config_request_body_t *dl_req_body;
 
     int round;
     /*
@@ -1358,8 +1464,9 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
     round = UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid];
     vrb_map = cc[CC_idP].vrb_map;
 
-    dl_req = &mac->DL_req[CC_idP].dl_config_request_body;
-    dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
+    dl_req = &mac->DL_req[CC_idP];
+    dl_req_body = &dl_req->dl_config_request_body;
+    dl_config_pdu = &dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu];
     N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth);
 
     LOG_D(MAC,
@@ -1381,6 +1488,8 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
 		//ra->wait_ack_Msg4++;
 		// we have to schedule a retransmission
 
+                dl_req->sfn_sf = frameP<<4 | subframeP;
+
 		first_rb = 0;
 		vrb_map[first_rb] = 1;
 		vrb_map[first_rb + 1] = 1;
@@ -1402,14 +1511,16 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
 		    (module_idP, CC_idP, 1, subframeP,
 		     dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.
 		     aggregation_level, ra->rnti)) {
-		    dl_req->number_dci++;
-		    dl_req->number_pdu++;
+		    dl_req_body->number_dci++;
+		    dl_req_body->number_pdu++;
+                    dl_req_body->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
 
 		    LOG_D(MAC,
 			  "msg4 retransmission for rnti %x (round %d) fsf %d/%d\n",
 			  ra->rnti, round, frameP, subframeP);
 		    // DLSCH Config
-		    fill_nfapi_dlsch_config(mac, dl_req, ra->msg4_TBsize,
+                    //DJP - fix this pdu_index = -1
+		    fill_nfapi_dlsch_config(mac, dl_req_body, ra->msg4_TBsize,
 					    -1
 					    /* retransmission, no pdu_index */
 					    , ra->rnti, 2,	// resource_allocation_type : format 1A/1B/1D
@@ -1464,6 +1575,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
 	      "[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",
 	      module_idP, CC_idP, frameP, subframeP);
 	ra->state = IDLE;
+        LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:IDLE\n", module_idP, frameP, subframeP);
 	UE_id = find_UE_id(module_idP, ra->rnti);
 	DevAssert(UE_id != -1);
 	mac->UE_list.UE_template[UE_PCCID(module_idP, UE_id)][UE_id].
@@ -1494,6 +1606,8 @@ schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 
 	    ra = (RA_t *) & cc[CC_id].ra[i];
 
+            //LOG_D(MAC,"RA[state:%d]\n",ra->state);
+
 	    if (ra->state == MSG2)
 		generate_Msg2(module_idP, CC_id, frameP, subframeP, ra);
 	    else if (ra->state == MSG4)
@@ -1539,7 +1653,7 @@ initiate_ra_proc(module_id_t module_idP,
 	prach_ParametersListCE_r13 =
 	    &ext4_prach->prach_ParametersListCE_r13;
     }
-    LOG_I(MAC,
+    LOG_D(MAC,
 	  "[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d  Initiating RA procedure for preamble index %d\n",
 	  module_idP, CC_id, frameP, subframeP, preamble_index);
 #ifdef Rel14
@@ -1548,6 +1662,10 @@ initiate_ra_proc(module_id_t module_idP,
 	  module_idP, CC_id, frameP, subframeP, rach_resource_type);
 #endif
 
+    uint16_t msg2_frame = frameP;
+    uint16_t msg2_subframe = subframeP;
+    int offset;
+
     if (prach_ParametersListCE_r13 &&
 	prach_ParametersListCE_r13->list.count < rach_resource_type) {
 	LOG_E(MAC,
@@ -1575,9 +1693,22 @@ initiate_ra_proc(module_id_t module_idP,
 	    ra[i].msg2_mpdcch_repetition_cnt = 0;
 	    ra[i].msg4_mpdcch_repetition_cnt = 0;
 #endif
-	    ra[i].Msg2_frame = frameP + ((subframeP > 5) ? 1 : 0);
-	    ra[i].Msg2_subframe = (subframeP + 4) % 10;
-	    /* TODO: find better procedure to allocate RNTI */
+
+            // DJP - this is because VNF is 2 subframes ahead of PNF and TX needs 4 subframes
+            if (nfapi_mode)
+              offset = 7;
+            else
+              offset = 5;
+
+            add_subframe(&msg2_frame, &msg2_subframe, offset);
+
+            ra[i].Msg2_frame         = msg2_frame;
+            ra[i].Msg2_subframe      = msg2_subframe;
+
+            LOG_D(MAC,"%s() Msg2[%04d%d] SFN/SF:%04d%d offset:%d\n", __FUNCTION__,ra[i].Msg2_frame,ra[i].Msg2_subframe,frameP,subframeP,offset);
+
+            ra[i].Msg2_subframe = (subframeP + offset) % 10;
+            /* TODO: find better procedure to allocate RNTI */
 	    do {
 #if defined(USRP_REC_PLAY) // deterministic rnti in usrp record/playback mode
 	        static int drnti[NUMBER_OF_UE_MAX] = { 0xbda7, 0x71da, 0x9c40, 0xc350, 0x2710, 0x4e20, 0x7530, 0x1388, 0x3a98, 0x61a8, 0x88b8, 0xafc8, 0xd6d8, 0x1b58, 0x4268, 0x6978 };
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c
index 71be9f9b9d7aa970e9c45377bc159a1c8c37f269..5b0fc58bb70eb678c6f7a325cc7c1fd361f0f8a2 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c
@@ -100,6 +100,7 @@ schedule_SIB1_BR(module_id_t module_idP,
     int n_NB = 0;
     int TBS;
     int k = 0, rvidx;
+    uint16_t sfn_sf = frameP<<4|subframeP;
 
     for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
 
@@ -236,6 +237,7 @@ schedule_SIB1_BR(module_id_t module_idP,
 	dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
 	dl_config_pdu->pdu_size =
 	    (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
+        dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
 	dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = TBS;
 	dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index =
 	    eNB->pdu_index[CC_id];
@@ -265,14 +267,17 @@ schedule_SIB1_BR(module_id_t module_idP,
 	dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
 	dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
 	// Rel10 fields
+        dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
 	dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3;
 	// Rel13 fields
+        dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
 	dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1;	// CEModeA UE
 	dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 0;	// SIB1-BR
 	dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF;	// absolute SFx
 
 	//  dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector                    = ; 
 	dl_req->number_pdu++;
+        dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
 
 	// Program TX Request
 	TX_req =
@@ -284,9 +289,10 @@ schedule_SIB1_BR(module_id_t module_idP,
 	TX_req->num_segments = 1;
 	TX_req->segments[0].segment_length = bcch_sdu_length;
 	TX_req->segments[0].segment_data = cc->BCCH_BR_pdu[0].payload;
-	eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
-
-
+        eNB->TX_req[CC_id].sfn_sf = sfn_sf;
+        eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+        eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
+        eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
 
 	if (opt_enabled == 1) {
 	    trace_pdu(1,
@@ -306,10 +312,7 @@ schedule_SIB1_BR(module_id_t module_idP,
 		  "[eNB] Frame %d : Scheduling BCCH-BR 0->DLSCH (FDD) for CC_id %d SIB1-BR %d bytes\n",
 		  frameP, CC_id, bcch_sdu_length);
 	}
-
     }
-
-    return;
 }
 
 int si_WindowLength_BR_r13tab
@@ -324,7 +327,6 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP,
 	       sub_frame_t subframeP)
 //------------------------------------------------------------------------------
 {
-
     int8_t bcch_sdu_length;
     int CC_id;
     eNB_MAC_INST *eNB = RC.mac[module_idP];
@@ -338,6 +340,7 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP,
     int i;
     int rvidx;
     int absSF = (frameP * 10) + subframeP;
+    uint16_t sfn_sf = frameP << 4 | subframeP;
 
 
     for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
@@ -472,6 +475,7 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP,
 			dl_config_pdu->pdu_size =
 			    (uint8_t) (2 +
 				       sizeof(nfapi_dl_config_dlsch_pdu));
+                        dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
 			dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length =
 			    si_TBS_r13 >> 3;
 			dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index =
@@ -513,11 +517,13 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP,
 			dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.
 			    num_bf_vector = 1;
 			// Rel10 fields (for PDSCH starting symbol)
+                        dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
 			dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.
 			    pdsch_start =
 			    cc[CC_id].
 			    sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
 			// Rel13 fields
+                        dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
 			dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1;	// CEModeA UE
 			dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 1;	// SI-BR
 			dl_config_pdu->dlsch_pdu.
@@ -526,6 +532,7 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP,
 
 			//  dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector                    = ; 
 			dl_req->number_pdu++;
+                        dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
 
 			// Program TX Request
 			TX_req =
@@ -541,6 +548,9 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP,
 			    cc->BCCH_BR_pdu[i + 1].payload;
 			eNB->TX_req[CC_id].tx_request_body.
 			    number_of_pdus++;
+                        eNB->TX_req[CC_id].sfn_sf = sfn_sf;
+                        eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+                        eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
 
 			if (opt_enabled == 1) {
 			    trace_pdu(1,
@@ -583,26 +593,26 @@ schedule_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
     nfapi_tx_request_pdu_t *TX_req;
     int mib_sdu_length;
     int CC_id;
+    nfapi_dl_config_request_t *dl_config_request;
     nfapi_dl_config_request_body_t *dl_req;
+    uint16_t sfn_sf = frameP << 4 | subframeP;
 
     AssertFatal(subframeP == 0, "Subframe must be 0\n");
     AssertFatal((frameP & 3) == 0, "Frame must be a multiple of 4\n");
 
     for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
 
-	dl_req = &eNB->DL_req[CC_id].dl_config_request_body;
+	dl_config_request = &eNB->DL_req[CC_id];
+	dl_req = &dl_config_request->dl_config_request_body;
 	cc = &eNB->common_channels[CC_id];
 
 	mib_sdu_length = mac_rrc_data_req(module_idP, CC_id, frameP, MIBCH, 1, &cc->MIB_pdu.payload[0], 1, module_idP, 0);	// not used in this case
 
-	LOG_D(MAC, "Frame %d, subframe %d: BCH PDU length %d\n",
-	      frameP, subframeP, mib_sdu_length);
+	LOG_D(MAC, "Frame %d, subframe %d: BCH PDU length %d\n", frameP, subframeP, mib_sdu_length);
 
 	if (mib_sdu_length > 0) {
 
-	    LOG_D(MAC,
-		  "Frame %d, subframe %d: Adding BCH PDU in position %d (length %d)\n",
-		  frameP, subframeP, dl_req->number_pdu, mib_sdu_length);
+	    LOG_D(MAC, "Frame %d, subframe %d: Adding BCH PDU in position %d (length %d)\n", frameP, subframeP, dl_req->number_pdu, mib_sdu_length);
 
 	    if ((frameP & 1023) < 40)
 		LOG_D(MAC,
@@ -617,14 +627,18 @@ schedule_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 	    dl_config_pdu->pdu_type =
 		NFAPI_DL_CONFIG_BCH_PDU_TYPE, dl_config_pdu->pdu_size =
 		2 + sizeof(nfapi_dl_config_bch_pdu);
+            dl_config_pdu->bch_pdu.bch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG;
 	    dl_config_pdu->bch_pdu.bch_pdu_rel8.length = mib_sdu_length;
 	    dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index =
 		eNB->pdu_index[CC_id];
 	    dl_config_pdu->bch_pdu.bch_pdu_rel8.transmission_power = 6000;
+            dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
 	    dl_req->number_pdu++;
 
-	    LOG_D(MAC, "eNB->DL_req[0].number_pdu %d (%p)\n",
-		  dl_req->number_pdu, &dl_req->number_pdu);
+            dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST;
+            dl_config_request->sfn_sf = sfn_sf;
+
+	    LOG_D(MAC, "eNB->DL_req[0].number_pdu %d (%p)\n", dl_req->number_pdu, &dl_req->number_pdu);
 	    // DL request
 
 	    TX_req =
@@ -633,9 +647,12 @@ schedule_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 	    TX_req->pdu_length = 3;
 	    TX_req->pdu_index = eNB->pdu_index[CC_id]++;
 	    TX_req->num_segments = 1;
-	    TX_req->segments[0].segment_length = 0;
+	    TX_req->segments[0].segment_length = 3;
 	    TX_req->segments[0].segment_data = cc[CC_id].MIB_pdu.payload;
 	    eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
+            eNB->TX_req[CC_id].sfn_sf = sfn_sf;
+            eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+            eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
 	}
     }
 }
@@ -655,9 +672,11 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
     uint8_t *vrb_map;
     int first_rb = -1;
     int N_RB_DL;
-    nfapi_dl_config_request_pdu_t *dl_config_pdu;
+    nfapi_dl_config_request_t      *dl_config_request;
+    nfapi_dl_config_request_pdu_t  *dl_config_pdu;
     nfapi_tx_request_pdu_t *TX_req;
     nfapi_dl_config_request_body_t *dl_req;
+    uint16_t sfn_sf = frameP << 4 | subframeP;
 
     start_meas(&eNB->schedule_si);
 
@@ -669,15 +688,14 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 	    cc = &eNB->common_channels[CC_id];
 	    vrb_map = (void *) &cc->vrb_map;
 	    N_RB_DL = to_prb(cc->mib->message.dl_Bandwidth);
+            dl_config_request = &eNB->DL_req[CC_id];
 	    dl_req = &eNB->DL_req[CC_id].dl_config_request_body;
 
 
 	    bcch_sdu_length = mac_rrc_data_req(module_idP, CC_id, frameP, BCCH, 1, &cc->BCCH_pdu.payload[0], 1, module_idP, 0);	// not used in this case
 
 	    if (bcch_sdu_length > 0) {
-		LOG_D(MAC,
-		      "[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n",
-		      module_idP, frameP, CC_id, bcch_sdu_length);
+		LOG_D(MAC, "[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n", module_idP, frameP, CC_id, bcch_sdu_length);
 
 		// Allocate 4 PRBs in a random location
 		/*
@@ -742,6 +760,7 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 		dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
 		dl_config_pdu->pdu_size =
 		    (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
+                dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
 		dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format =
 		    NFAPI_DL_DCI_FORMAT_1A;
 		dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.
@@ -761,21 +780,13 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 		dl_config_pdu->dci_dl_pdu.
 		    dci_dl_pdu_rel8.resource_block_coding =
 		    getRIV(N_RB_DL, first_rb, 4);
-
-		// Rel10 fields
-		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3;
-		// Rel13 fields
-		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 0;	// regular UE
-		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2;	// not BR
-		dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF;	// absolute SF 
+                dl_config_request->sfn_sf = sfn_sf;
 
 		if (!CCE_allocation_infeasible
 		    (module_idP, CC_id, 0, subframeP,
 		     dl_config_pdu->dci_dl_pdu.
 		     dci_dl_pdu_rel8.aggregation_level, SI_RNTI)) {
-		    LOG_D(MAC,
-			  "Frame %d: Subframe %d : Adding common DCI for S_RNTI\n",
-			  frameP, subframeP);
+		    LOG_D(MAC, "Frame %d: Subframe %d : Adding common DCI for S_RNTI\n", frameP, subframeP);
 		    dl_req->number_dci++;
 		    dl_req->number_pdu++;
 		    dl_config_pdu =
@@ -788,6 +799,8 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 			(uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
 		    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index =
 			eNB->pdu_index[CC_id];
+                    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
+		    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = bcch_sdu_length;
 		    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF;
 		    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2;	// format 1A/1B/1D
 		    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0;	// localized
@@ -825,6 +838,18 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 		    //    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector                    = ; 
 		    dl_req->number_pdu++;
 
+                    // Rel10 fields
+                    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
+                    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3;
+                    // Rel13 fields
+                    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
+                    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 0;   // regular UE
+                    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2;        // not BR
+                    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF;   // absolute SF
+
+                    dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST;
+                    dl_config_request->sfn_sf = sfn_sf;
+
 		    // Program TX Request
 		    TX_req =
 			&eNB->TX_req[CC_id].
@@ -837,6 +862,9 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 		    TX_req->segments[0].segment_data =
 			cc->BCCH_pdu.payload;
 		    eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
+                    eNB->TX_req[CC_id].sfn_sf = sfn_sf;
+                    eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
+                    eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
 
 		} else {
 		    LOG_E(MAC,
@@ -860,9 +888,7 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
 			  "[eNB] Frame %d : Scheduling BCCH->DLSCH (TDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n",
 			  frameP, CC_id, bcch_sdu_length, mcs);
 		} else {
-		    LOG_D(MAC,
-			  "[eNB] Frame %d : Scheduling BCCH->DLSCH (FDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n",
-			  frameP, CC_id, bcch_sdu_length, mcs);
+		    LOG_D(MAC, "[eNB] Frame %d : Scheduling BCCH->DLSCH (FDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n", frameP, CC_id, bcch_sdu_length, mcs);
 		}
 
 
@@ -881,6 +907,5 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
     schedule_SI_BR(module_idP, frameP, subframeP);
 #endif
 
-    stop_meas(&eNB->schedule_si);
-    return;
+  stop_meas(&eNB->schedule_si);
 }
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
index 9dbbb39d0346c563e9acbf208ca114ad3bb49570..fe6c045fe71de4389240952c5dec3f9e3c8950d7 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
@@ -63,6 +63,7 @@
 //#define DEBUG_eNB_SCHEDULER 1
 
 extern RAN_CONTEXT_t RC;
+extern uint8_t nfapi_mode;
 
 //------------------------------------------------------------------------------
 void
@@ -71,6 +72,7 @@ add_ue_dlsch_info(module_id_t module_idP,
 		  int UE_id, sub_frame_t subframeP, UE_DLSCH_STATUS status)
 //------------------------------------------------------------------------------
 {
+  //LOG_D(MAC, "%s(module_idP:%d, CC_id:%d, UE_id:%d, subframeP:%d, status:%d) serving_num:%d rnti:%x\n", __FUNCTION__, module_idP, CC_id, UE_id, subframeP, status, eNB_dlsch_info[module_idP][CC_id][UE_id].serving_num, UE_RNTI(module_idP,UE_id));
 
     eNB_dlsch_info[module_idP][CC_id][UE_id].rnti =
 	UE_RNTI(module_idP, UE_id);
@@ -654,8 +656,12 @@ schedule_ue_spec(module_id_t module_idP,
 	       DevCheck(((eNB_UE_stats->dl_cqi < MIN_CQI_VALUE) || (eNB_UE_stats->dl_cqi > MAX_CQI_VALUE)),
 	       eNB_UE_stats->dl_cqi, MIN_CQI_VALUE, MAX_CQI_VALUE);
 	     */
-	    eNB_UE_stats->dlsch_mcs1 =
-		cqi_to_mcs[ue_sched_ctl->dl_cqi[CC_id]];
+            if (nfapi_mode) {
+              eNB_UE_stats->dlsch_mcs1 = 10;//cqi_to_mcs[ue_sched_ctl->dl_cqi[CC_id]];
+            }
+            else {
+              eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[ue_sched_ctl->dl_cqi[CC_id]];
+            }
 	    eNB_UE_stats->dlsch_mcs1 = eNB_UE_stats->dlsch_mcs1;	//cmin(eNB_UE_stats->dlsch_mcs1, openair_daq_vars.target_ue_dl_mcs);
 
 
@@ -755,6 +761,8 @@ schedule_ue_spec(module_id_t module_idP,
 		    case 2:
 		    case 7:
 		    default:
+                      LOG_D(MAC,"retransmission DL_REQ: rnti:%x\n",rnti);
+
 			dl_config_pdu =
 			    &dl_req->dl_config_pdu_list[dl_req->
 							number_pdu];
@@ -765,6 +773,7 @@ schedule_ue_spec(module_id_t module_idP,
 			dl_config_pdu->pdu_size =
 			    (uint8_t) (2 +
 				       sizeof(nfapi_dl_config_dci_dl_pdu));
+                        dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
 			dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.
 			    dci_format = NFAPI_DL_DCI_FORMAT_1;
 			dl_config_pdu->dci_dl_pdu.
@@ -820,6 +829,10 @@ schedule_ue_spec(module_id_t module_idP,
 			     dci_dl_pdu_rel8.aggregation_level, rnti)) {
 			    dl_req->number_dci++;
 			    dl_req->number_pdu++;
+                            dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
+
+                            eNB->DL_req[CC_id].sfn_sf = frameP<<4 | subframeP;
+                            eNB->DL_req[CC_id].header.message_id = NFAPI_DL_CONFIG_REQUEST;
 
 			    fill_nfapi_dlsch_config(eNB, dl_req, TBS, -1
 						    /* retransmission, no pdu_index */
@@ -1364,6 +1377,7 @@ schedule_ue_spec(module_id_t module_idP,
 			get_aggregation(get_bw_index(module_idP, CC_id),
 					ue_sched_ctl->dl_cqi[CC_id],
 					format1);
+                    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
 		    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti;
 		    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1;	// CRNTI : see Table 4-10 from SCF082 - nFAPI specifications
 		    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000;	// equal to RS power
@@ -1410,6 +1424,10 @@ schedule_ue_spec(module_id_t module_idP,
 			ue_sched_ctl->round[CC_id][harq_pid] = 0;
 			dl_req->number_dci++;
 			dl_req->number_pdu++;
+                        dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
+
+                        eNB->DL_req[CC_id].sfn_sf = frameP<<4 | subframeP;
+                        eNB->DL_req[CC_id].header.message_id = NFAPI_DL_CONFIG_REQUEST;
 
 			// Toggle NDI for next time
 			LOG_D(MAC,
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
index df84675dc1e3fc28dcc1f76061fa5b0e01cf862d..1bffb83d49efc74c5b6647049990bc1c85fdcaf3 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
@@ -1013,6 +1013,7 @@ get_rel8_dl_cqi_pmi_size(UE_sched_ctrl * sched_ctl, int CC_idP,
 	else
 	    return (7 + Ltab[cc->mib->message.dl_Bandwidth]);
     }
+
     AssertFatal(1 == 0,
 		"Shouldn't get here : cqi_ReportPeriodic->present %d\n",
 		cqi_ReportPeriodic->choice.
@@ -1035,6 +1036,8 @@ fill_nfapi_dl_dci_1A(nfapi_dl_config_request_pdu_t * dl_config_pdu,
     dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
     dl_config_pdu->pdu_size =
 	(uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
+    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag =
+      NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
     dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format =
 	NFAPI_DL_DCI_FORMAT_1A;
     dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level =
@@ -1129,6 +1132,7 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
 		    &ul_config_pdu->ulsch_harq_pdu.harq_information;
 		ul_config_pdu->pdu_type =
 		    NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE;
+                ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag=NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG;
 		ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0;	// last symbol not punctured
 		ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks;	// we don't change the number of resource blocks across retransmissions yet
 		LOG_D(MAC,
@@ -1159,6 +1163,7 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
 	     * Those two types are not compatible. 'initial_transmission_parameters' is not at the
 	     * place in both.
 	     */
+            ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag=NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG;
 	    ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0;	// last symbol not punctured
 	    ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks;	// we don't change the number of resource blocks across retransmissions yet
 	    break;
@@ -1358,6 +1363,7 @@ fill_nfapi_harq_information(module_id_t module_idP,
 		"physicalConfigDedicated for rnti %x is null\n", rntiP);
 #endif
 
+    harq_information->harq_information_rel11.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG;
     harq_information->harq_information_rel11.num_ant_ports = 1;
 
     switch (get_tmode(module_idP, CC_idP, UE_id)) {
@@ -1386,12 +1392,14 @@ fill_nfapi_harq_information(module_id_t module_idP,
 		harq_information->harq_information_rel10_tdd.harq_size = 1;	// 1-bit ACK/NAK
 		harq_information->harq_information_rel10_tdd.ack_nack_mode = 0;	// bundling
 	    }
+            harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG;
 	    harq_information->harq_information_rel10_tdd.n_pucch_1_0 =
 		cc->radioResourceConfigCommon->pucch_ConfigCommon.
 		n1PUCCH_AN + cce_idxP;
 	    harq_information->
 		harq_information_rel10_tdd.number_of_pucch_resources = 1;
 	} else {
+            harq_information->harq_information_rel9_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG;
 	    harq_information->
 		harq_information_rel9_fdd.number_of_pucch_resources = 1;
 	    harq_information->harq_information_rel9_fdd.harq_size = 1;	// 1-bit ACK/NAK
@@ -1419,6 +1427,7 @@ fill_nfapi_harq_information(module_id_t module_idP,
 	    } else {
 		harq_information->harq_information_rel10_tdd.ack_nack_mode = 0;	// bundling
 	    }
+            harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG;
 	    harq_information->harq_information_rel10_tdd.harq_size = 2;
 	    harq_information->harq_information_rel10_tdd.n_pucch_1_0 =
 		cc->radioResourceConfigCommon->pucch_ConfigCommon.
@@ -1426,6 +1435,7 @@ fill_nfapi_harq_information(module_id_t module_idP,
 	    harq_information->
 		harq_information_rel10_tdd.number_of_pucch_resources = 1;
 	} else {
+            harq_information->harq_information_rel9_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG;
 	    harq_information->
 		harq_information_rel9_fdd.number_of_pucch_resources = 1;
 	    harq_information->harq_information_rel9_fdd.ack_nack_mode = 0;	// 1a/b
@@ -1447,16 +1457,17 @@ fill_nfapi_uci_acknak(module_id_t module_idP,
     COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
 
     int ackNAK_absSF = get_pucch1_absSF(cc, absSFP);
-    nfapi_ul_config_request_body_t *ul_req =
-	&eNB->UL_req_tmp[CC_idP][ackNAK_absSF % 10].ul_config_request_body;
+    nfapi_ul_config_request_t *ul_req = &eNB->UL_req_tmp[CC_idP][ackNAK_absSF % 10];
+    nfapi_ul_config_request_body_t *ul_req_body = &ul_req->ul_config_request_body;
     nfapi_ul_config_request_pdu_t *ul_config_pdu =
-	&ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
+	&ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
 
     memset((void *) ul_config_pdu, 0,
 	   sizeof(nfapi_ul_config_request_pdu_t));
     ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE;
     ul_config_pdu->pdu_size =
 	(uint8_t) (2 + sizeof(nfapi_ul_config_uci_harq_pdu));
+    ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
     ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0;	// don't know how to use this
     ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti =
 	rntiP;
@@ -1473,7 +1484,11 @@ fill_nfapi_uci_acknak(module_id_t module_idP,
 	  ul_config_pdu->uci_harq_pdu.
 	  harq_information.harq_information_rel9_fdd.n_pucch_1_0);
 
-    ul_req->number_of_pdus++;
+    ul_req_body->number_of_pdus++;
+    ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
+
+    ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
+    ul_req->sfn_sf = (ackNAK_absSF/10) << 4 | ackNAK_absSF%10;
 
     return (((ackNAK_absSF / 10) << 4) + (ackNAK_absSF % 10));
 }
@@ -1513,6 +1528,7 @@ fill_nfapi_dlsch_config(eNB_MAC_INST * eNB,
     dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
     dl_config_pdu->pdu_size =
 	(uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
+    dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
     dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = length;
     dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = pdu_index;
     dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = rnti;
@@ -1567,6 +1583,7 @@ fill_nfapi_tx_req(nfapi_tx_request_body_t * tx_req_body,
     TX_req->num_segments = 1;
     TX_req->segments[0].segment_length = pdu_length;
     TX_req->segments[0].segment_data = pdu;
+    tx_req_body->tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
     tx_req_body->number_of_pdus++;
 
     return (((absSF / 10) << 4) + (absSF % 10));
@@ -1601,6 +1618,7 @@ fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *
     ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
     ul_config_pdu->pdu_size =
 	(uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
+    ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
     ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = handle;
     ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = rnti;
     ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start =
@@ -1635,6 +1653,7 @@ fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *
 	ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE;
 	ul_config_pdu->pdu_size =
 	    (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu));
+        ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG;
 	ul_config_pdu->ulsch_cqi_ri_pdu.
 	    cqi_ri_information.cqi_ri_information_rel9.report_type = 1;
 	ul_config_pdu->ulsch_cqi_ri_pdu.
@@ -1700,6 +1719,7 @@ fill_nfapi_ulsch_config_request_emtc(nfapi_ul_config_request_pdu_t *
 {
     // Re13 fields
 
+    ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG;
     ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ue_type;
     ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions =
 	total_number_of_repetitions;
@@ -2010,8 +2030,7 @@ get_aggregation(uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt)
 	LOG_W(MAC, "unsupported DCI format %d\n", dci_fmt);
     }
 
-    LOG_D(MAC, "Aggregation level %d (cqi %d, bw_index %d, format %d)\n",
-	  1 << aggregation, cqi, bw_index, dci_fmt);
+    LOG_D(MAC, "Aggregation level %d (cqi %d, bw_index %d, format %d)\n", 1 << aggregation, cqi, bw_index, dci_fmt);
 
     return 1 << aggregation;
 }
@@ -3082,9 +3101,9 @@ allocate_CCEs(int module_idP, int CC_idP, int subframeP, int test_onlyP)
     int nCCE = 0;
 
     LOG_D(MAC,
-	  "Allocate CCEs subframe %d, test %d : (DL PDU %d, DL DCI %d, UL %d)\n",
-	  subframeP, test_onlyP, DL_req->number_pdu, DL_req->number_dci,
-	  HI_DCI0_req->number_of_dci);
+          "Allocate CCEs subframe %d, test %d : (DL PDU %d, DL DCI %d, UL %d)\n",
+          subframeP, test_onlyP, DL_req->number_pdu, DL_req->number_dci,
+          HI_DCI0_req->number_of_dci);
     DL_req->number_pdcch_ofdm_symbols = 1;
 
   try_again:
@@ -3532,6 +3551,7 @@ CCE_allocation_infeasible(int module_idP,
 		  "Subframe %d: FAPI DL structure is full, skip scheduling UE %d\n",
 		  subframe, rnti);
 	} else {
+            dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
 	    dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
 	    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti;
 	    dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type =
@@ -3559,6 +3579,7 @@ CCE_allocation_infeasible(int module_idP,
 		  subframe, rnti);
 	} else {
 	    hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
+            hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
 	    hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti;
 	    hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level =
 		aggregation;
@@ -3644,6 +3665,8 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
 
 	uint8_t harq_pid = ((10 * frameP) + subframeP + 10236) & 7;
 
+        LOG_D(MAC,"frame %d subframe %d harq_pid %d mode %d tmode[0] %d num_ack_nak %d round %d\n",frameP,subframeP,harq_pid,harq_indication_fdd->mode,tmode[0],num_ack_nak,sched_ctl->round[CC_idP][harq_pid]);
+
 	switch (harq_indication_fdd->mode) {
 	case 0:		// Format 1a/b (10.1.2.1)
 	    AssertFatal(numCC == 1,
@@ -3652,8 +3675,8 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
 	    if (tmode[0] == 1 || tmode[0] == 2 || tmode[0] == 5 || tmode[0] == 6 || tmode[0] == 7) {	// NOTE: have to handle the case of TM9-10 with 1 antenna port
 		// single ACK/NAK bit
 		AssertFatal(num_ack_nak == 1,
-			    "num_ack_nak %d > 1 for 1 CC and single-layer transmission\n",
-			    num_ack_nak);
+			    "num_ack_nak %d > 1 for 1 CC and single-layer transmission frame:%d subframe:%d\n",
+			    num_ack_nak,frameP,subframeP);
 		AssertFatal(sched_ctl->round[CC_idP][harq_pid] < 8,
 			    "Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",
 			    harq_pid, UE_id, rnti);
@@ -4336,6 +4359,8 @@ cqi_indication(module_id_t mod_idP, int CC_idP, frame_t frameP,
 
     if (UE_id >= 0) {
 
+        LOG_D(MAC,"%s() UE_id:%d channel:%d cqi:%d\n", __FUNCTION__, UE_id, ul_cqi_information->channel, ul_cqi_information->ul_cqi);
+
 	if (ul_cqi_information->channel == 0) {	// PUCCH
 
 	    // extract pucch csi information before changing RI information
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
index 421eab7cd768f9c64997b280eba1a780a85359ea..def57639f626de3327e668e74494cb84e7604dca 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
@@ -62,6 +62,14 @@
 #define ENABLE_MAC_PAYLOAD_DEBUG
 #define DEBUG_eNB_SCHEDULER 1
 
+extern int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
+extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
+extern uint16_t sfnsf_add_subframe(uint16_t frameP, uint16_t subframeP, int offset);
+extern int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req);
+extern uint8_t nfapi_mode;
+
+extern uint8_t nfapi_mode;
+
 // This table holds the allowable PRB sizes for ULSCH transmissions
 uint8_t rb_table[34] =
     { 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32,
@@ -177,7 +185,7 @@ rx_sdu(const module_id_t enb_mod_idP,
 		    maxHARQ_Msg3Tx);
 
 	LOG_D(MAC,
-	      "[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, RA_id %d) ul_cqi %d\n",
+	      "[eNB %d][PUSCH %d] CC_id %d [RAPROC Msg3] Received ULSCH sdu round %d from PHY (rnti %x, RA_id %d) ul_cqi %d\n",
 	      enb_mod_idP, harq_pid, CC_idP, ra[RA_id].msg3_round,
 	      current_rnti, RA_id, ul_cqi);
 
@@ -203,10 +211,8 @@ rx_sdu(const module_id_t enb_mod_idP,
 		    first_rb_ul[harq_pid];
 		ra[RA_id].msg3_round++;
 		// prepare handling of retransmission
-		ra[RA_id].Msg3_frame +=
-		    ((ra[RA_id].Msg3_subframe > 1) ? 1 : 0);
-		ra[RA_id].Msg3_subframe =
-		    (ra[RA_id].Msg3_subframe + 8) % 10;
+		ra[RA_id].Msg3_frame    = (ra[RA_id].Msg3_frame + ((ra[RA_id].Msg3_subframe > 1) ? 1 : 0)) % 1024;
+		ra[RA_id].Msg3_subframe = (ra[RA_id].Msg3_subframe + 8) % 10;
 		add_msg3(enb_mod_idP, CC_idP, &ra[RA_id], frameP,
 			 subframeP);
 	    }
@@ -751,18 +757,22 @@ rx_sdu(const module_id_t enb_mod_idP,
     LOG_D(MAC,
 	  "Programming PHICH ACK for rnti %x harq_pid %d (first_rb %d)\n",
 	  current_rnti, harq_pid, first_rb);
-    nfapi_hi_dci0_request_body_t *hi_dci0_req =
-	&mac->HI_DCI0_req[CC_idP].hi_dci0_request_body;
+    nfapi_hi_dci0_request_t *hi_dci0_req = &mac->HI_DCI0_req[CC_idP];
+    nfapi_hi_dci0_request_body_t *hi_dci0_req_body = &hi_dci0_req->hi_dci0_request_body;
     nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu =
-	&hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci +
-				       hi_dci0_req->number_of_hi];
+	&hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi];
     memset((void *) hi_dci0_pdu, 0, sizeof(nfapi_hi_dci0_request_pdu_t));
     hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE;
     hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_hi_pdu);
+    hi_dci0_pdu->hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG;
     hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = first_rb;
     hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0;
     hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 1;
-    hi_dci0_req->number_of_hi++;
+    hi_dci0_req_body->number_of_hi++;
+    hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP,subframeP, 0);
+    hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
+    hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP,subframeP, 4);
+    hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST;
 
     /* NN--> FK: we could either check the payload, or use a phy helper to detect a false msg3 */
     if ((num_sdu == 0) && (num_ce == 0)) {
@@ -1024,7 +1034,6 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
 	// Msg3 is using 1 PRB so we need to increase first_rb accordingly
 	// not sure about the break (can there be more than 1 active RA procedure?)
 
-
 	for (i = 0; i < NB_RA_PROC_MAX; i++) {
 	    if ((cc->ra[i].state == WAITMSG3) &&
 		(cc->ra[i].Msg3_subframe == sched_subframe)) {
@@ -1073,19 +1082,19 @@ schedule_ulsch_rnti(module_id_t module_idP,
     if (sched_subframeP < subframeP)
 	sched_frame++;
 
-    nfapi_hi_dci0_request_body_t *hi_dci0_req =
-	&mac->HI_DCI0_req[CC_id].hi_dci0_request_body;
-    nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
+    nfapi_hi_dci0_request_t        *hi_dci0_req = &mac->HI_DCI0_req[CC_id];
+    nfapi_hi_dci0_request_body_t   *hi_dci0_req_body = &hi_dci0_req->hi_dci0_request_body;
+    nfapi_hi_dci0_request_pdu_t    *hi_dci0_pdu;
 
-    nfapi_ul_config_request_body_t *ul_req_tmp =
-	&mac->UL_req_tmp[CC_id][sched_subframeP].ul_config_request_body;
+    nfapi_ul_config_request_t *ul_req_tmp            = &mac->UL_req_tmp[CC_id][sched_subframeP];
+    nfapi_ul_config_request_body_t *ul_req_tmp_body  = &ul_req_tmp->ul_config_request_body;
 
-    LOG_D(MAC, "entering ulsch preprocesor\n");
+    //LOG_D(MAC, "entering ulsch preprocesor\n");
     ulsch_scheduler_pre_processor(module_idP, frameP, subframeP, first_rb);
 
-    LOG_D(MAC, "exiting ulsch preprocesor\n");
+    //LOG_D(MAC, "exiting ulsch preprocesor\n");
 
-    mac->HI_DCI0_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
+    hi_dci0_req->sfn_sf = (frameP << 4) + subframeP;
 
     // loop over all active UEs
     for (UE_id = UE_list->head_ul; UE_id >= 0;
@@ -1210,7 +1219,11 @@ schedule_ulsch_rnti(module_id_t module_idP,
 		if (status < RRC_CONNECTED)
 		    cqi_req = 0;
 		else if (UE_sched_ctrl->cqi_req_timer > 30) {
-		    cqi_req = 1;
+                    if (nfapi_mode) {
+                      cqi_req = 0;
+                    } else {
+                      cqi_req = 1;
+                    }
 		    UE_sched_ctrl->cqi_req_timer = 0;
 		} else
 		    cqi_req = 0;
@@ -1343,20 +1356,13 @@ schedule_ulsch_rnti(module_id_t module_idP,
 		    // save it for a potential retransmission
 		    UE_template->cshift[harq_pid] = cshift;
 
-		    hi_dci0_pdu =
-			&hi_dci0_req->hi_dci0_pdu_list[mac->HI_DCI0_req
-						       [CC_id].
-						       hi_dci0_request_body.
-						       number_of_dci +
-						       mac->HI_DCI0_req
-						       [CC_id].
-						       hi_dci0_request_body.
-						       number_of_hi];
+		    hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi];
 		    memset((void *) hi_dci0_pdu, 0,
 			   sizeof(nfapi_hi_dci0_request_pdu_t));
 		    hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
 		    hi_dci0_pdu->pdu_size =
 			2 + sizeof(nfapi_hi_dci0_dci_pdu);
+                    hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
 		    hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dci_format =
 			NFAPI_UL_DCI_FORMAT_0;
 		    hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level =
@@ -1383,8 +1389,13 @@ schedule_ulsch_rnti(module_id_t module_idP,
 		    hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index =
 			UE_template->DAI_ul[sched_subframeP];
 
-		    mac->HI_DCI0_req[CC_id].hi_dci0_request_body.
-			number_of_dci++;
+                    hi_dci0_req_body->number_of_dci++;
+                    hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP, subframeP, 4);
+                    hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
+
+                    hi_dci0_req->sfn_sf = frameP<<4|subframeP; // sfnsf_add_subframe(sched_frame, sched_subframeP, 0); // sunday!
+                    hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST;
+
 
 		    LOG_D(MAC,
 			  "[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n",
@@ -1392,7 +1403,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
 			  sched_frame, sched_subframeP);
 
 		    // Add UL_config PDUs
-		    fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], cqi_req, cc, UE_template->physicalConfigDedicated, get_tmode(module_idP, CC_id, UE_id), mac->ul_handle, rnti, first_rb[CC_id],	// resource_block_start
+		    fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus], cqi_req, cc, UE_template->physicalConfigDedicated, get_tmode(module_idP, CC_id, UE_id), mac->ul_handle, rnti, first_rb[CC_id],	// resource_block_start
 							 rb_table[rb_table_index],	// number_of_resource_blocks
 							 UE_template->mcs_UL[harq_pid], cshift,	// cyclic_shift_2_for_drms
 							 0,	// frequency_hopping_enabled_flag
@@ -1410,23 +1421,30 @@ schedule_ulsch_rnti(module_id_t module_idP,
 							  [rb_table_index]));
 #ifdef Rel14
 		    if (UE_template->rach_resource_type > 0) {	// This is a BL/CE UE allocation
-			fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], UE_template->rach_resource_type > 2 ? 2 : 1, 1,	//total_number_of_repetitions
+			fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus], UE_template->rach_resource_type > 2 ? 2 : 1, 1,	//total_number_of_repetitions
 							     1,	//repetition_number
 							     (frameP *
 							      10) +
 							     subframeP);
 		    }
 #endif
-		    ul_req_tmp->number_of_pdus++;
+                    ul_req_tmp->header.message_id = NFAPI_UL_CONFIG_REQUEST;
+		    ul_req_tmp_body->number_of_pdus++;
+                    ul_req_tmp_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
 		    mac->ul_handle++;
 
+                    uint16_t ul_sched_frame = sched_frame;
+                    uint16_t ul_sched_subframeP = sched_subframeP;
+
+                    add_subframe(&ul_sched_frame, &ul_sched_subframeP, 2);
+                    ul_req_tmp->sfn_sf = ul_sched_frame<<4|ul_sched_subframeP;
+
 		    add_ue_ulsch_info(module_idP,
 				      CC_id, UE_id, subframeP,
 				      S_UL_SCHEDULED);
 
-		    LOG_D(MAC,
-			  "[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n",
-			  module_idP, CC_id, frameP, subframeP, UE_id);
+		    //LOG_D(MAC, "[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP, CC_id, frameP, subframeP, UE_id);
+                    LOG_D(MAC,"[PUSCH %d] SFN/SF:%04d%d UL_CFG:SFN/SF:%04d%d CQI:%d for UE %d/%x\n", harq_pid,frameP,subframeP,ul_sched_frame,ul_sched_subframeP,cqi_req,UE_id,rnti);
 
 		    // increment first rb for next UE allocation
 		    first_rb[CC_id] += rb_table[rb_table_index];
@@ -1440,23 +1458,24 @@ schedule_ulsch_rnti(module_id_t module_idP,
 
 		    // fill in NAK information
 
-		    hi_dci0_pdu =
-			&hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->
-						       number_of_dci +
-						       hi_dci0_req->
-						       number_of_hi];
+		    hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi];
 		    memset((void *) hi_dci0_pdu, 0,
 			   sizeof(nfapi_hi_dci0_request_pdu_t));
 		    hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE;
 		    hi_dci0_pdu->pdu_size =
 			2 + sizeof(nfapi_hi_dci0_hi_pdu);
+                    hi_dci0_pdu->hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG;
 		    hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start =
 			UE_template->first_rb_ul[harq_pid];
 		    hi_dci0_pdu->hi_pdu.hi_pdu_rel8.
 			cyclic_shift_2_for_drms =
 			UE_template->cshift[harq_pid];
 		    hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0;
-		    hi_dci0_req->number_of_hi++;
+		    hi_dci0_req_body->number_of_hi++;
+                    hi_dci0_req_body->sfnsf = sfnsf_add_subframe(sched_frame, sched_subframeP, 0);
+                    hi_dci0_req->sfn_sf = frameP<<4|subframeP;
+                    hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST;
+
 		    LOG_D(MAC,
 			  "[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, round %d)\n",
 			  module_idP, harq_pid, rnti, CC_id, frameP,
@@ -1469,7 +1488,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
 			  "[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n",
 			  harq_pid, frameP, subframeP, UE_id, rnti,
 			  sched_frame, sched_subframeP);
-		    fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], cqi_req, cc, UE_template->physicalConfigDedicated, get_tmode(module_idP, CC_id, UE_id), mac->ul_handle, rnti, UE_template->first_rb_ul[harq_pid],	// resource_block_start
+		    fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus], cqi_req, cc, UE_template->physicalConfigDedicated, get_tmode(module_idP, CC_id, UE_id), mac->ul_handle, rnti, UE_template->first_rb_ul[harq_pid],	// resource_block_start
 							 UE_template->nb_rb_ul[harq_pid],	// number_of_resource_blocks
 							 UE_template->mcs_UL[harq_pid], cshift,	// cyclic_shift_2_for_drms
 							 0,	// frequency_hopping_enabled_flag
@@ -1484,16 +1503,23 @@ schedule_ulsch_rnti(module_id_t module_idP,
 							 TBS_UL[harq_pid]);
 #ifdef Rel14
 		    if (UE_template->rach_resource_type > 0) {	// This is a BL/CE UE allocation
-			fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], UE_template->rach_resource_type > 2 ? 2 : 1, 1,	//total_number_of_repetitions
+			fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus], UE_template->rach_resource_type > 2 ? 2 : 1, 1,	//total_number_of_repetitions
 							     1,	//repetition_number
 							     (frameP *
 							      10) +
 							     subframeP);
 		    }
 #endif
-		    ul_req_tmp->number_of_pdus++;
+		    ul_req_tmp_body->number_of_pdus++;
 		    mac->ul_handle++;
 
+                    ul_req_tmp_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
+
+                    ul_req_tmp->sfn_sf = sched_frame<<4|sched_subframeP;
+                    ul_req_tmp->header.message_id = NFAPI_UL_CONFIG_REQUEST;
+
+                    LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d cqi_req %d\n",
+                        harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP,cqi_req);
 		}		/*
 				   else if (round > 0) { //we schedule a retransmission
 
diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c
index 0bfad4e5b12366751b03cbeb6a1912b0ed3d57d0..2ad3e6a038beb82b26e41deb647add79ed44317c 100644
--- a/openair2/LAYER2/MAC/main.c
+++ b/openair2/LAYER2/MAC/main.c
@@ -47,6 +47,7 @@
 #include "common/ran_context.h"
 
 extern RAN_CONTEXT_t RC;
+extern void openair_rrc_top_init_ue( int eMBMS_active, char* uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
 
 void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char eNB_index, uint8_t first_sync)	//init as MR
 {
@@ -118,7 +119,7 @@ mac_top_init_ue(int eMBMS_active, char *uecap_xer,
 }
 
 
-void mac_top_init_eNB()
+void mac_top_init_eNB(void)
 {
 
     module_id_t i, j;
@@ -271,7 +272,7 @@ l2_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,
     return (1);
 }
 
-int l2_init_eNB()
+int l2_init_eNB(void)
 {
 
 
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
index a5f400b4c231e0db579eadb5495007b3479f1c91..88a26a289106d321f112f609cf68e4f90ca3a219 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
@@ -86,6 +86,8 @@ extern Packet_OTG_List_t *otg_pdcp_buffer;
 #  include "gtpv1u_eNB_defs.h"
 #endif
 
+extern int gtpv1u_new_data_req( uint8_t  enb_module_idP, rnti_t   ue_rntiP, uint8_t  rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP);
+
 /* Prevent de-queueing the same PDCP SDU from the queue twice
  * by multiple threads. This has happened in TDD when thread-odd
  * is flushing a PDCP SDU after UE_RX() processing; whereas
diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c
index ab6551f61c1cfc4801883a43d963e77ce819877d..d0b8e5755858bbaf3ac64711016a8debce09b04c 100644
--- a/openair2/PHY_INTERFACE/IF_Module.c
+++ b/openair2/PHY_INTERFACE/IF_Module.c
@@ -10,21 +10,29 @@
 IF_Module_t *if_inst[MAX_IF_MODULES];
 Sched_Rsp_t Sched_INFO[MAX_IF_MODULES][MAX_NUM_CCs];
 
+extern int oai_nfapi_harq_indication(nfapi_harq_indication_t *harq_ind);
+extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind);
+extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind);
+extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
+extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
+extern uint8_t nfapi_mode;
+extern uint16_t sf_ahead;
+
 void handle_rach(UL_IND_t *UL_info) {
   int i;
 
-  if (UL_info->rach_ind.number_of_preambles>0) {
+  if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) {
 
-    AssertFatal(UL_info->rach_ind.number_of_preambles==1,"More than 1 preamble not supported\n");
-    UL_info->rach_ind.number_of_preambles=0;
-    LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc\n",UL_info->frame,UL_info->subframe);
+    AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
+    UL_info->rach_ind.rach_indication_body.number_of_preambles=0;
+    LOG_D(MAC,"UL_info[Frame %d, Subframe %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->subframe, NFAPI_SFNSF2DEC(UL_info->rach_ind.sfn_sf));
     initiate_ra_proc(UL_info->module_id,
 		     UL_info->CC_id,
-		     UL_info->frame,
-		     UL_info->subframe,
-		     UL_info->rach_ind.preamble_list[0].preamble_rel8.preamble,
-		     UL_info->rach_ind.preamble_list[0].preamble_rel8.timing_advance,
-		     UL_info->rach_ind.preamble_list[0].preamble_rel8.rnti
+		     NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf),
+		     NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf),
+		     UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble,
+		     UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
+		     UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti
 #ifdef Rel14
 		     ,0
 #endif
@@ -32,24 +40,24 @@ void handle_rach(UL_IND_t *UL_info) {
   }
 
 #ifdef Rel14
-  if (UL_info->rach_ind_br.number_of_preambles>0) {
+  if (UL_info->rach_ind_br.rach_indication_body.number_of_preambles>0) {
 
-    AssertFatal(UL_info->rach_ind_br.number_of_preambles<5,"More than 4 preambles not supported\n");
-    for (i=0;i<UL_info->rach_ind_br.number_of_preambles;i++) {
-      AssertFatal(UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type>0,
+    AssertFatal(UL_info->rach_ind_br.rach_indication_body.number_of_preambles<5,"More than 4 preambles not supported\n");
+    for (i=0;i<UL_info->rach_ind_br.rach_indication_body.number_of_preambles;i++) {
+      AssertFatal(UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type>0,
 		  "Got regular PRACH preamble, not BL/CE\n");
       LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->subframe,
-	    UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type-1);
+	    UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type-1);
       initiate_ra_proc(UL_info->module_id,
 		       UL_info->CC_id,
 		       UL_info->frame,
 		       UL_info->subframe,
-		       UL_info->rach_ind_br.preamble_list[i].preamble_rel8.preamble,
-		       UL_info->rach_ind_br.preamble_list[i].preamble_rel8.timing_advance,
-		       UL_info->rach_ind_br.preamble_list[i].preamble_rel8.rnti,
-		       UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type);
+		       UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.preamble,
+		       UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.timing_advance,
+		       UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.rnti,
+		       UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type);
     }
-    UL_info->rach_ind.number_of_preambles=0;
+    UL_info->rach_ind_br.rach_indication_body.number_of_preambles=0;
   }
 #endif
 }
@@ -58,91 +66,164 @@ void handle_sr(UL_IND_t *UL_info) {
 
   int i;
 
-  for (i=0;i<UL_info->sr_ind.number_of_srs;i++) 
-    SR_indication(UL_info->module_id,
-		  UL_info->CC_id,
-		  UL_info->frame,
-		  UL_info->subframe,
-		  UL_info->sr_ind.sr_pdu_list[i].rx_ue_information.rnti,
-		  UL_info->sr_ind.sr_pdu_list[i].ul_cqi_information.ul_cqi);
+  if (nfapi_mode == 1)  // PNF
+  {
+    if (UL_info->sr_ind.sr_indication_body.number_of_srs>0)
+    {
+      oai_nfapi_sr_indication(&UL_info->sr_ind);
+    }
+  }
+  else
+  {
+    for (i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++)
+      SR_indication(UL_info->module_id,
+          UL_info->CC_id,
+          UL_info->frame,
+          UL_info->subframe,
+          UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
+          UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);
+  }
 
-  UL_info->sr_ind.number_of_srs=0;
+  UL_info->sr_ind.sr_indication_body.number_of_srs=0;
 }
 
 void handle_cqi(UL_IND_t *UL_info) {
 
   int i;
 
-  for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++) 
-    cqi_indication(UL_info->module_id,
-		   UL_info->CC_id,
-		   UL_info->frame,
-		   UL_info->subframe,
-		   UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti,
-		   &UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
-		   UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
-		   &UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
-
-  UL_info->cqi_ind.number_of_cqis=0;
+  if (nfapi_mode == 1)
+  {
+    if (UL_info->cqi_ind.number_of_cqis>0)
+    {
+      LOG_D(PHY,"UL_info->cqi_ind.number_of_cqis:%d\n", UL_info->cqi_ind.number_of_cqis);
+      nfapi_cqi_indication_t ind;
+
+      ind.header.message_id = NFAPI_RX_CQI_INDICATION;
+      ind.sfn_sf = UL_info->frame<<4 | UL_info->subframe;
+      ind.cqi_indication_body = UL_info->cqi_ind;
+
+      oai_nfapi_cqi_indication(&ind);
+
+      UL_info->cqi_ind.number_of_cqis=0;
+    }
+  }
+  else
+  {
+    for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++) 
+      cqi_indication(UL_info->module_id,
+          UL_info->CC_id,
+          UL_info->frame,
+          UL_info->subframe,
+          UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti,
+          &UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
+          UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
+          &UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
+
+    UL_info->cqi_ind.number_of_cqis=0;
+  }
 }
 
 void handle_harq(UL_IND_t *UL_info) {
 
   int i;
 
-  for (i=0;i<UL_info->harq_ind.number_of_harqs;i++) 
-    harq_indication(UL_info->module_id,
-		    UL_info->CC_id,
-		    UL_info->frame,
-		    UL_info->subframe,
-		    &UL_info->harq_ind.harq_pdu_list[i]);
+  if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) // PNF
+  {
+    //LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs);
+
+    int retval = oai_nfapi_harq_indication(&UL_info->harq_ind);
 
-  UL_info->harq_ind.number_of_harqs=0;
+    if (retval!=0)
+    {
+      LOG_E(PHY, "Failed to encode NFAPI HARQ_IND retval:%d\n", retval);
+    }
+
+    UL_info->harq_ind.harq_indication_body.number_of_harqs = 0;
+  }
+  else
+  {
+    for (i=0;i<UL_info->harq_ind.harq_indication_body.number_of_harqs;i++)
+      harq_indication(UL_info->module_id,
+          UL_info->CC_id,
+          NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf),
+          NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf),
+          &UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]);
+
+    UL_info->harq_ind.harq_indication_body.number_of_harqs=0;
+  }
 }
 
 void handle_ulsch(UL_IND_t *UL_info) {
 
   int i,j;
 
-  for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) {
-
-    for (j=0;j<UL_info->crc_ind.number_of_crcs;j++) {
-      // find crc_indication j corresponding rx_indication i
-      if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
-	  UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti) {
-	if (UL_info->crc_ind.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
-	  LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe);
-	  rx_sdu(UL_info->module_id,
-		 UL_info->CC_id,
-		 UL_info->frame,
-		 UL_info->subframe,
-		 UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti,
-		 (uint8_t *)NULL,
-		 UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.length,
-		 UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.timing_advance,
-		 UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
-	}
-	else {
-	  LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe);
-	  rx_sdu(UL_info->module_id,
-		 UL_info->CC_id,
-		 UL_info->frame,
-		 UL_info->subframe,
-		 UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti,
-		 UL_info->rx_ind.rx_pdu_list[i].data,
-		 UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.length,
-		 UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.timing_advance,
-		 UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
-	}
-	break;
-      } //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
-	//    UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti) {
-    } //    for (j=0;j<UL_info->crc_ind.number_of_crcs;j++) {
-    AssertFatal(j<UL_info->crc_ind.number_of_crcs,"Couldn't find matchin CRC indication\n");
-  } //   for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) {
-    
-  UL_info->rx_ind.number_of_pdus=0;
-  UL_info->crc_ind.number_of_crcs=0;
+  if(nfapi_mode == 1)
+  {
+    if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0)
+    {
+      //LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
+
+      oai_nfapi_crc_indication(&UL_info->crc_ind);
+
+      UL_info->crc_ind.crc_indication_body.number_of_crcs = 0;
+    }
+
+    if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0)
+    {
+      //LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
+      oai_nfapi_rx_ind(&UL_info->rx_ind);
+      UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
+    }
+  }
+  else
+  {
+    if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
+      for (i=0;i<UL_info->rx_ind.rx_indication_body.number_of_pdus;i++) {
+        for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) {
+          // find crc_indication j corresponding rx_indication i
+          LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti);
+          if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti ==
+              UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti) {
+            LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag);
+            if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
+              LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe);
+              rx_sdu(UL_info->module_id,
+                  UL_info->CC_id,
+                  NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
+                  NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe,
+                  UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
+                  (uint8_t *)NULL,
+                  UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
+                  UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
+                  UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
+            }
+            else {
+              LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe);
+              rx_sdu(UL_info->module_id,
+                  UL_info->CC_id,
+                  NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
+                  NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe,
+                  UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
+                  UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data,
+                  UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
+                  UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
+                  UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
+            }
+            break;
+          } //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
+          //    UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti)
+        } //    for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++)
+      } //   for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
+      UL_info->crc_ind.crc_indication_body.number_of_crcs=0;
+      UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
+    } // UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->subframe && UL_info->crc_ind.crc_indication_body.number_of_crcs>0
+    else if (UL_info->rx_ind.rx_indication_body.number_of_pdus!=0 || UL_info->crc_ind.crc_indication_body.number_of_crcs!=0) {
+      LOG_E(PHY,"hoping not to have mis-match between CRC ind and RX ind - hopefully the missing message is coming shortly rx_ind:%d(SFN/SF:%05d) crc_ind:%d(SFN/SF:%05d) UL_info(SFN/SF):%04d%d\n",
+          UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf),
+          UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf),
+          UL_info->frame, UL_info->subframe);
+    }
+  }
 }
 
 /****************************************************************************/
@@ -203,24 +284,24 @@ static void dump_ul(UL_IND_t *u)
   A("XXXX UL  mod %d CC %d f.sf %d.%d\n",
     u->module_id, u->CC_id, u->frame, u->subframe);
 
-  A("XXXX     harq_ind %d\n", u->harq_ind.number_of_harqs);
-      for (i = 0; i < u->harq_ind.number_of_harqs; i++) {
-        nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_pdu_list[i];
+  A("XXXX     harq_ind %d\n", u->harq_ind.harq_indication_body.number_of_harqs);
+      for (i = 0; i < u->harq_ind.harq_indication_body.number_of_harqs; i++) {
+        nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_indication_body.harq_pdu_list[i];
   A("XXXX         harq ind %d\n", i);
-  A("XXXX             rnti %d\n", v->rx_ue_information.rnti);
-  A("XXXX             tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1,
-                                        v->harq_indication_fdd_rel8.harq_tb2);
-  A("XXXX             number_of_ack_nack %d\n",
-                              v->harq_indication_fdd_rel9.number_of_ack_nack);
+  A("XXXX         rnti %d\n", v->rx_ue_information.rnti);
+  A("XXXX         tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1,
+                                    v->harq_indication_fdd_rel8.harq_tb2);
+  A("XXXX         number_of_ack_nack %d\n",
+                          v->harq_indication_fdd_rel9.number_of_ack_nack);
   A("XXXX             harq[0] = %d\n",
                                     v->harq_indication_fdd_rel9.harq_tb_n[0]);
   A("XXXX harq        ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi,
-                                               v->ul_cqi_information.channel);
+                                           v->ul_cqi_information.channel);
       }
 
-  A("XXXX     crc_ind  %d\n", u->crc_ind.number_of_crcs);
+  A("XXXX     crc_ind  %d\n", u->crc_ind.crc_indication_body.number_of_crcs);
 
-  A("XXXX     sr_ind   %d\n", u->sr_ind.number_of_srs);
+  A("XXXX     sr_ind   %d\n", u->sr_ind.sr_indication_body.number_of_srs);
 
   A("XXXX     cqi_ind  %d\n", u->cqi_ind.number_of_cqis);
       for (i = 0; i < u->cqi_ind.number_of_cqis; i++) {
@@ -230,11 +311,11 @@ static void dump_ul(UL_IND_t *u)
                                                v->ul_cqi_information.channel);
       }
 
-  A("XXXX     rach_ind %d\n", u->rach_ind.number_of_preambles);
+  A("XXXX     rach_ind %d\n", u->rach_ind.rach_indication_body.number_of_preambles);
 
-  A("XXXX     rx_ind   %d\n", u->rx_ind.number_of_pdus);
-      for (i = 0; i < u->rx_ind.number_of_pdus; i++) {
-        nfapi_rx_indication_pdu_t *v = &u->rx_ind.rx_pdu_list[i];
+  A("XXXX     rx_ind   %d\n", u->rx_ind.rx_indication_body.number_of_pdus);
+      for (i = 0; i < u->rx_ind.rx_indication_body.number_of_pdus; i++) {
+        nfapi_rx_indication_pdu_t *v = &u->rx_ind.rx_indication_body.rx_pdu_list[i];
   A("XXXX         rx ind %d\n", i);
   A("XXXX             timing_advance %d\n",
                                     v->rx_indication_rel8.timing_advance);
@@ -461,26 +542,29 @@ void UL_indication(UL_IND_t *UL_info)
   IF_Module_t  *ifi        = if_inst[module_id];
   eNB_MAC_INST *mac        = RC.mac[module_id];
 
-  LOG_D(PHY,"UL_Indication: frame %d, subframe %d, module_id %d, CC_id %d\n",
-	UL_info->frame,UL_info->subframe,
-	module_id,CC_id);
+  LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n",
+        UL_info->frame,UL_info->subframe,
+        module_id,CC_id,
+        UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
 
-  if (ifi->CC_mask==0) {
-    ifi->current_frame    = UL_info->frame;
-    ifi->current_subframe = UL_info->subframe;
-  }
-  else {
-    AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask);
-    AssertFatal(UL_info->subframe != ifi->current_subframe,"CC_mask %x is not full and subframe has changed\n",ifi->CC_mask);
+  if (nfapi_mode != 1)
+  {
+    if (ifi->CC_mask==0) {
+      ifi->current_frame    = UL_info->frame;
+      ifi->current_subframe = UL_info->subframe;
+    }
+    else {
+      AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask);
+      AssertFatal(UL_info->subframe != ifi->current_subframe,"CC_mask %x is not full and subframe has changed\n",ifi->CC_mask);
+    }
+    ifi->CC_mask |= (1<<CC_id);
   }
-  ifi->CC_mask |= (1<<CC_id);
- 
+
 
   // clear DL/UL info for new scheduling round
   clear_nfapi_information(RC.mac[module_id],CC_id,
 			  UL_info->frame,UL_info->subframe);
 
-
   handle_rach(UL_info);
 
   handle_sr(UL_info);
@@ -489,61 +573,68 @@ void UL_indication(UL_IND_t *UL_info)
 
   handle_harq(UL_info);
 
-  // clear HI prior to hanling ULSCH
+  // clear HI prior to handling ULSCH
   mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi                     = 0;
   
   handle_ulsch(UL_info);
 
-  if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
+  if (nfapi_mode != 1)
+  {
+    if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
 
-    eNB_dlsch_ulsch_scheduler(module_id,
-			      (UL_info->frame+((UL_info->subframe>5)?1:0)) % 1024,
-			      (UL_info->subframe+4)%10);
+      eNB_dlsch_ulsch_scheduler(module_id,
+          (UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024,
+          (UL_info->subframe+sf_ahead)%10);
 
-    ifi->CC_mask            = 0;
+      ifi->CC_mask            = 0;
 
-    sched_info->module_id   = module_id;
-    sched_info->CC_id       = CC_id;
-    sched_info->frame       = (UL_info->frame + ((UL_info->subframe>5) ? 1 : 0)) % 1024;
-    sched_info->subframe    = (UL_info->subframe+4)%10;
-    sched_info->DL_req      = &mac->DL_req[CC_id];
-    sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id];
-    if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
-	(is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+4)%10)>0)) 
-      sched_info->UL_req      = &mac->UL_req[CC_id];
-    else
-      sched_info->UL_req      = NULL;
+      sched_info->module_id   = module_id;
+      sched_info->CC_id       = CC_id;
+      sched_info->frame       = (UL_info->frame + ((UL_info->subframe>(9-sf_ahead)) ? 1 : 0)) % 1024;
+      sched_info->subframe    = (UL_info->subframe+sf_ahead)%10;
+      sched_info->DL_req      = &mac->DL_req[CC_id];
+      sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id];
+      if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
+          (is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+sf_ahead)%10)>0))
+        sched_info->UL_req      = &mac->UL_req[CC_id];
+      else
+        sched_info->UL_req      = NULL;
 
-    sched_info->TX_req      = &mac->TX_req[CC_id];
+      sched_info->TX_req      = &mac->TX_req[CC_id];
 
 #ifdef DUMP_FAPI
-    dump_dl(sched_info);
+      dump_dl(sched_info);
 #endif
 
-    AssertFatal(ifi->schedule_response!=NULL,
-		"UL_indication is null (mod %d, cc %d)\n",
-		module_id,
-		CC_id);
-    ifi->schedule_response(sched_info);
+      if (ifi->schedule_response)
+      {
+        AssertFatal(ifi->schedule_response!=NULL,
+            "schedule_response is null (mod %d, cc %d)\n",
+            module_id,
+            CC_id);
+        ifi->schedule_response(sched_info);
+      }
 
-    LOG_D(PHY,"Schedule_response: frame %d, subframe %d (dl_pdus %d / %p)\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu,
-	  &sched_info->DL_req->dl_config_request_body.number_pdu);
-  }						 
+      LOG_D(PHY,"Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu);
+    }
+  }
 }
 
 IF_Module_t *IF_Module_init(int Mod_id){
 
   AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES);
 
+  LOG_D(PHY,"Installing callbacks for IF_Module - UL_indication\n");
+
   if (if_inst[Mod_id]==NULL) {
     if_inst[Mod_id] = (IF_Module_t*)malloc(sizeof(IF_Module_t));
     memset((void*)if_inst[Mod_id],0,sizeof(IF_Module_t));
-    
+
     if_inst[Mod_id]->CC_mask=0;
     if_inst[Mod_id]->UL_indication = UL_indication;
 
     AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0,
-		"allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
+        "allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
   }
   return if_inst[Mod_id];
 }
diff --git a/openair2/PHY_INTERFACE/IF_Module.h b/openair2/PHY_INTERFACE/IF_Module.h
index e33a8291e2eab88969a790df5d3d2ffc09269643..7baae6c3b6f8e09c9eef43a77a207ac3989f99c5 100644
--- a/openair2/PHY_INTERFACE/IF_Module.h
+++ b/openair2/PHY_INTERFACE/IF_Module.h
@@ -61,30 +61,30 @@ typedef struct{
   sub_frame_t subframe;
 
   /// harq indication list
-  nfapi_harq_indication_body_t harq_ind;
+  nfapi_harq_indication_t harq_ind;
 
   /// crc indication list
-  nfapi_crc_indication_body_t crc_ind;
+  nfapi_crc_indication_t crc_ind;
 
   /// SR indication list
-  nfapi_sr_indication_body_t sr_ind;
+  nfapi_sr_indication_t sr_ind;
 
   /// CQI indication list
   nfapi_cqi_indication_body_t cqi_ind;
 
   /// RACH indication list
-  nfapi_rach_indication_body_t rach_ind;
+  nfapi_rach_indication_t rach_ind;
 
 #ifdef Rel14
   /// RACH indication list for BR UEs
-  nfapi_rach_indication_body_t rach_ind_br;
+  nfapi_rach_indication_t rach_ind_br;
 #endif
 
   /// SRS indication list
   nfapi_srs_indication_body_t srs_ind;
 
   /// RX indication
-  nfapi_rx_indication_body_t rx_ind;
+  nfapi_rx_indication_t rx_ind;
 
 } UL_IND_t;
 
diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c
index 504bf8ee9b9dd9f86852259927d331a59336ce52..3077b9ba80220d757f0f3cf091047b8b5c82be05 100644
--- a/openair2/RRC/LITE/L2_interface.c
+++ b/openair2/RRC/LITE/L2_interface.c
@@ -81,7 +81,6 @@ mac_rrc_data_req(
   uint8_t sfn                     = (uint8_t)((frameP>>2)&0xff);
 
 
-  
 #ifdef DEBUG_RRC
   int i;
   LOG_I(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id);
diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c
index 8ff04518be79d4de8f9c339f3625d62bf0a4899b..7550faf14ae69111767e63a14643b9422f7f650d 100644
--- a/openair2/RRC/LITE/rrc_common.c
+++ b/openair2/RRC/LITE/rrc_common.c
@@ -65,7 +65,7 @@ openair_rrc_on(
   int            CC_id;
 
   if (ctxt_pP->enb_flag == ENB_FLAG_YES) {
-    LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n",
+    LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" ENB:OPENAIR RRC IN....\n",
           PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
     for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
       rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
@@ -74,7 +74,7 @@ openair_rrc_on(
       RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1;
     }
   } else {
-    LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n",
+    LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" UE?:OPENAIR RRC IN....\n",
           PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
 
     for (i = 0; i < NB_eNB_INST; i++) {
diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c
index 5a127fdfd7d3d9d9c3095c7f421bd64083d4ba4e..e085f631bff0de188886bb2ec5b03f8f130861f2 100644
--- a/openair2/RRC/LITE/rrc_eNB.c
+++ b/openair2/RRC/LITE/rrc_eNB.c
@@ -133,6 +133,8 @@ init_SI(
   SystemInformationBlockType1_v1310_IEs_t *sib1_v13ext=(SystemInformationBlockType1_v1310_IEs_t *)NULL;
 #endif
 
+  LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__);
+
   RC.rrc[ctxt_pP->module_id]->carrier[CC_id].MIB = (uint8_t*) malloc16(4);
   // copy basic parameters
   RC.rrc[ctxt_pP->module_id]->carrier[CC_id].physCellId      = configuration->Nid_cell[CC_id];
@@ -280,6 +282,8 @@ init_SI(
   }
 #endif
 
+  LOG_D(RRC, "About to call rrc_mac_config_req_eNB\n");
+
   rrc_mac_config_req_eNB(ctxt_pP->module_id, CC_id,
 			 RC.rrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
 			 RC.rrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB,
@@ -4779,6 +4783,7 @@ rrc_eNB_decode_dcch(
       T(T_ENB_RRC_UL_INFORMATION_TRANSFER, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
         T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
 
+      LOG_D(RRC,"[MSG] RRC UL Information Transfer \n");
 #ifdef RRC_MSG_PRINT
       LOG_F(RRC,"[MSG] RRC UL Information Transfer \n");
 
diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c
index 2c66f79521dc870a2b60cc61a443339cabfcd330..948425e8daa27b45643b2bca6587953ea9b0beab 100644
--- a/openair2/UTIL/LOG/log.c
+++ b/openair2/UTIL/LOG/log.c
@@ -494,6 +494,338 @@ int logInit (void)
   return 0;
 }
 
+void nfapi_log(char *file, char *func, int line, int comp, int level, const char* format, va_list args)
+{
+  //logRecord_mt(file,func,line, pthread_self(), comp, level, format, ##args)
+  int len = 0;
+  log_component_t *c;
+  char *log_start;
+  char *log_end;
+  /* The main difference with the version above is the use of this local log_buffer.
+   * The other difference is the return value of snprintf which was not used
+   * correctly. It was not a big problem because in practice MAX_LOG_TOTAL is
+   * big enough so that the buffer is never full.
+   */
+  char log_buffer[MAX_LOG_TOTAL];
+
+  /* for no gcc warnings */
+  (void)log_start;
+  (void)log_end;
+
+  c = &g_log->log_component[comp];
+
+  // do not apply filtering for LOG_F
+  // only log messages which are enabled and are below the global log level and component's level threshold
+  if ((level != LOG_FILE) && ((level > c->level) || (level > g_log->level))) {
+    /* if ((level != LOG_FILE) &&
+          ((level > c->level) ||
+           (level > g_log->level) ||
+           ( c->level > g_log->level))) {
+    */
+    return;
+  }
+
+  //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LOG_RECORD, VCD_FUNCTION_IN);
+
+  // adjust syslog level for TRACE messages
+  if (g_log->syslog) {
+    if (g_log->level > LOG_DEBUG) {
+      g_log->level = LOG_DEBUG;
+    }
+  }
+
+  // make sure that for log trace the extra info is only printed once, reset when the level changes
+  if ((level == LOG_FILE) || (c->flag == LOG_NONE) || (level == LOG_TRACE)) {
+    log_start = log_buffer;
+    len = vsnprintf(log_buffer, MAX_LOG_TOTAL, format, args);
+    if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+    log_end = log_buffer + len;
+  } else {
+    if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) {
+      len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s",
+                      log_level_highlight_start[level]);
+      if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+    }
+
+    log_start = log_buffer + len;
+
+    if ( (g_log->flag & FLAG_COMP) || (c->flag & FLAG_COMP) ) {
+      len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]",
+                      g_log->log_component[comp].name);
+      if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+    }
+
+    if ( (g_log->flag & FLAG_LEVEL) || (c->flag & FLAG_LEVEL) ) {
+      len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]",
+                      g_log->level2string[level]);
+      if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+    }
+
+    if ( (g_log->flag & FLAG_THREAD) || (c->flag & FLAG_THREAD) ) {
+#     define THREAD_NAME_LEN 128
+      char threadname[THREAD_NAME_LEN];
+      if (pthread_getname_np(pthread_self(), threadname, THREAD_NAME_LEN) != 0)
+      {
+        perror("pthread_getname_np : ");
+      } else {
+        len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]", threadname);
+        if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+      }
+#     undef THREAD_NAME_LEN
+    }
+
+    if ( (g_log->flag & FLAG_FUNCT) || (c->flag & FLAG_FUNCT) ) {
+      len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s] ",
+                      func);
+      if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+    }
+
+    if ( (g_log->flag & FLAG_FILE_LINE) || (c->flag & FLAG_FILE_LINE) ) {
+      len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s:%d]",
+                      file, line);
+      if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+    }
+
+    //len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%08lx]", thread_id);
+    //if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+
+    len += vsnprintf(&log_buffer[len], MAX_LOG_TOTAL - len, format, args);
+    if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+    log_end = log_buffer + len;
+
+    if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) {
+      len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s",
+          log_level_highlight_end[level]);
+      if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+    }
+  }
+
+  va_end(args);
+
+  // OAI printf compatibility
+  if ((g_log->onlinelog == 1) && (level != LOG_FILE))
+#ifdef RTAI
+    if (len > MAX_LOG_TOTAL) {
+      rt_printk ("[OPENAIR] FIFO_PRINTF WROTE OUTSIDE ITS MEMORY BOUNDARY : ERRORS WILL OCCUR\n");
+    }
+
+  if (len > 0) {
+    rtf_put (FIFO_PRINTF_NO, log_buffer, len);
+  }
+
+#else
+  fwrite(log_buffer, len, 1, stdout);
+#endif
+
+#ifndef RTAI
+
+  if (g_log->syslog) {
+    syslog(g_log->level, "%s", log_buffer);
+  }
+
+  if (g_log->filelog) {
+    if (write(gfd, log_buffer, len) < len) {
+      // TODO assert ?
+    }
+  }
+
+  if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) {
+    if (write(g_log->log_component[comp].fd, log_buffer, len) < len) {
+      // TODO assert ?
+    }
+  }
+
+#else
+
+  // online print messges
+  if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) {
+    printf(log_buffer);
+  }
+
+#endif
+
+#if defined(ENABLE_ITTI)
+
+  if (level <= LOG_DEBUG) {
+    task_id_t origin_task_id = TASK_UNKNOWN;
+    MessagesIds messages_id;
+    MessageDef *message_p;
+    size_t      message_string_size;
+    char       *message_msg_p;
+
+    message_string_size = log_end - log_start;
+
+#if !defined(DISABLE_ITTI_DETECT_SUB_TASK_ID)
+
+    /* Try to identify sub task ID from log information (comp, log_instance_type) */
+    switch (comp) {
+    case PHY:
+      switch (log_instance_type) {
+      case LOG_INSTANCE_ENB:
+        origin_task_id = TASK_PHY_ENB;
+        break;
+
+      case LOG_INSTANCE_UE:
+        origin_task_id = TASK_PHY_UE;
+        break;
+
+      default:
+        break;
+      }
+
+      break;
+
+    case MAC:
+      switch (log_instance_type) {
+      case LOG_INSTANCE_ENB:
+        origin_task_id = TASK_MAC_ENB;
+        break;
+
+      case LOG_INSTANCE_UE:
+        origin_task_id = TASK_MAC_UE;
+
+      default:
+        break;
+      }
+
+      break;
+
+    case RLC:
+      switch (log_instance_type) {
+      case LOG_INSTANCE_ENB:
+        origin_task_id = TASK_RLC_ENB;
+        break;
+
+      case LOG_INSTANCE_UE:
+        origin_task_id = TASK_RLC_UE;
+
+      default:
+        break;
+      }
+
+      break;
+
+    case PDCP:
+      switch (log_instance_type) {
+      case LOG_INSTANCE_ENB:
+        origin_task_id = TASK_PDCP_ENB;
+        break;
+
+      case LOG_INSTANCE_UE:
+        origin_task_id = TASK_PDCP_UE;
+
+      default:
+        break;
+      }
+
+      break;
+
+    default:
+      break;
+    }
+
+#endif
+
+    switch (level) {
+    case LOG_EMERG:
+    case LOG_ALERT:
+    case LOG_CRIT:
+    case LOG_ERR:
+      messages_id = ERROR_LOG;
+      break;
+
+    case LOG_WARNING:
+      messages_id = WARNING_LOG;
+      break;
+
+    case LOG_NOTICE:
+      messages_id = NOTICE_LOG;
+      break;
+
+    case LOG_INFO:
+      messages_id = INFO_LOG;
+      break;
+
+    default:
+      messages_id = DEBUG_LOG;
+      break;
+    }
+
+    message_p = itti_alloc_new_message_sized(origin_task_id, messages_id, message_string_size);
+
+    switch (level) {
+    case LOG_EMERG:
+    case LOG_ALERT:
+    case LOG_CRIT:
+    case LOG_ERR:
+      message_msg_p = (char *) &message_p->ittiMsg.error_log;
+      break;
+
+    case LOG_WARNING:
+      message_msg_p = (char *) &message_p->ittiMsg.warning_log;
+      break;
+
+    case LOG_NOTICE:
+      message_msg_p = (char *) &message_p->ittiMsg.notice_log;
+      break;
+
+    case LOG_INFO:
+      message_msg_p = (char *) &message_p->ittiMsg.info_log;
+      break;
+
+    default:
+      message_msg_p = (char *) &message_p->ittiMsg.debug_log;
+      break;
+    }
+
+    memcpy(message_msg_p, log_start, message_string_size);
+
+    itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
+  }
+
+#endif
+#if 0
+  LOG_params log_params;
+  int        len;
+
+  len = vsnprintf(log_params.l_buff_info, MAX_LOG_INFO-1, format, args);
+
+  //2 first parameters must be passed as 'const' to the thread function
+  log_params.file = strdup(file);
+  log_params.func = strdup(func);
+  log_params.line = line;
+  log_params.comp = PHY;//comp;
+  log_params.level = 6; // INFO - level;
+  log_params.format = format;
+  log_params.len = len;
+
+  if (pthread_mutex_lock(&log_lock) != 0) {
+    return;
+  }
+
+  log_list_tail++;
+  log_list[log_list_tail - 1] = log_params;
+
+  if (log_list_tail >= 1000) {
+    log_list_tail = 0;
+  }
+
+  if (log_list_nb_elements < 1000) {
+    log_list_nb_elements++;
+  }
+
+  if(pthread_cond_signal(&log_notify) != 0) {
+    pthread_mutex_unlock(&log_lock);
+    return;
+  }
+
+  if(pthread_mutex_unlock(&log_lock) != 0) {
+    return;
+  }
+
+#endif
+}
+
 //log record: add to a list
 void logRecord(const char *file, const char *func, int line,  int comp,
                int level, const char *format, ...)
diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c
index a9b91f3226ade0b5295bc651a58cf3e1bf6d5e37..b18d2a25ffd714c778e16a96a971db1e081694d9 100644
--- a/openair2/UTIL/LOG/vcd_signal_dumper.c
+++ b/openair2/UTIL/LOG/vcd_signal_dumper.c
@@ -395,6 +395,17 @@ const char* eurecomFunctionsNames[] = {
 
   "compress_if",
   "decompress_if",
+
+  "nfapi_subframe",
+  "generate_pcfich",
+  "generate_dci0",
+  "generate_dlsch",
+  "generate_phich",
+  "pdcch_scrambling",
+  "pdcch_modulation",
+  "pdcch_interleaving",
+  "pdcch_tx",
+
 };
 
 struct vcd_module_s vcd_modules[] = {
diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h
index 2e7f7ee7928aac252ba7f1fd44807daa155875bf..a4c8cd2476e08f0b234e47540b54b89b1d6b52fd 100644
--- a/openair2/UTIL/LOG/vcd_signal_dumper.h
+++ b/openair2/UTIL/LOG/vcd_signal_dumper.h
@@ -376,6 +376,16 @@ typedef enum {
   VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF,
   VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF,
 
+  VCD_SIGNAL_DUMPER_FUNCTIONS_NFAPI,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PCFICH,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DCI0,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PHICH,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_MODULATION,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_INTERLEAVING,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,
+
   VCD_SIGNAL_DUMPER_FUNCTIONS_END
 } vcd_signal_dump_functions;
 
diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c
index f70fe9cf2b8120f9e369a8bc44abf343d8f26b08..aacfa561fd62190031d5ea2d0ca9603ea390f109 100644
--- a/openair3/GTPV1-U/gtpv1u_eNB.c
+++ b/openair3/GTPV1-U/gtpv1u_eNB.c
@@ -49,6 +49,7 @@
 #include "COMMON/platform_constants.h"
 #include "UTIL/LOG/vcd_signal_dumper.h"
 #include "common/ran_context.h"
+#include "gtpv1u_eNB_defs.h"
 
 #undef GTP_DUMP_SOCKET
 
diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c
index bd7b804a67e633abc9ca966932c0073dcbb2f772..868d86ad9cec84dcb97a55749ce8131256b296ca 100644
--- a/openair3/UDP/udp_eNB_task.c
+++ b/openair3/UDP/udp_eNB_task.c
@@ -427,7 +427,7 @@ on_error:
   return NULL;
 }
 
-int udp_enb_init()
+int udp_enb_init(void)
 {
   LOG_I(UDP_, "Initializing UDP task interface\n");
   STAILQ_INIT(&udp_socket_list);
diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
index 446e602f6de3ba91b22c808f7300ba94ab168286..9b1755954ae84655a75cbe25ba0570291d01097f 100644
--- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
@@ -419,10 +419,10 @@ static void trx_usrp_end(openair0_device *device) {
 
 /*! \brief Called to send samples to the USRP RF target
       @param device pointer to the device structure specific to the RF hardware target
-      @param timestamp The timestamp at whicch the first sample MUST be sent
+      @param timestamp The timestamp at which the first sample MUST be sent
       @param buff Buffer which holds the samples
       @param nsamps number of samples to be sent
-      @param antenna_id index of the antenna if the device has multiple anteannas
+      @param antenna_id index of the antenna if the device has multiple antennas
       @param flags flags must be set to TRUE if timestamp parameter needs to be applied
 */
 static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
@@ -1008,9 +1008,13 @@ extern "C" {
             //s->usrp->set_master_clock_rate(usrp_master_clock);
 
             openair0_cfg[0].rx_gain_calib_table = calib_table_x310;
+
 #if defined(USRP_REC_PLAY)
 	    std::cerr << "-- Using calibration table: calib_table_x310" << std::endl; // Bell Labs info
-#endif	    
+#endif
+
+            LOG_I(PHY,"%s() sample_rate:%u\n", __FUNCTION__, (int)openair0_cfg[0].sample_rate);
+
             switch ((int)openair0_cfg[0].sample_rate) {
             case 30720000:
                 // from usrp_time_offset
@@ -1153,6 +1157,8 @@ extern "C" {
                 s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i);
                 s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i);
                 s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[i],i);
+
+                LOG_I(PHY,"USRP TX_GAIN:%3.2lf gain_range:%3.2lf tx_gain:%3.2lf\n", gain_range_tx.stop()-openair0_cfg[0].tx_gain[i], gain_range_tx.stop(), openair0_cfg[0].tx_gain[i]);
             }
         }
 
diff --git a/targets/COMMON/create_tasks.c b/targets/COMMON/create_tasks.c
index 7d6ea9be0a6f159bab8c61143c067c54b3dd7e97..b911fbc5a4a38a7b322a218e3962ce29832240c1 100644
--- a/targets/COMMON/create_tasks.c
+++ b/targets/COMMON/create_tasks.c
@@ -42,6 +42,8 @@
 
 int create_tasks(uint32_t enb_nb, uint32_t ue_nb)
 {
+  LOG_D(ENB_APP, "%s(enb_nb:%d ue_nb:%d)\n", __FUNCTION__, enb_nb, ue_nb);
+
   itti_wait_ready(1);
   if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) {
     LOG_E(PDCP, "Create task for L2L1 failed\n");
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf
index f97cd0ad8ba0c0e4a82d1c11520dfea2a71634cc..9393872b308ad72f67f4128a47a64e5460193b02 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf
@@ -1,3 +1,20 @@
+log_config = {
+  global_log_level                      ="debug";
+  global_log_verbosity                  ="medium";
+  hw_log_level                          ="info";
+  hw_log_verbosity                      ="medium";
+  phy_log_level                         ="info";
+  phy_log_verbosity                     ="low";
+  mac_log_level                         ="info";
+  mac_log_verbosity                     ="medium";
+  rlc_log_level                         ="info";
+  rlc_log_verbosity                     ="medium";
+  pdcp_log_level                        ="info";
+  pdcp_log_verbosity                    ="medium";
+  rrc_log_level                         ="info";
+  rrc_log_verbosity                     ="medium";
+};
+
 L1s = (
     	{
 	num_cc = 1;
@@ -6,9 +23,9 @@ L1s = (
       	remote_n_address = "127.0.0.2";
     	local_n_address  = "127.0.0.1"; 
     	local_n_portc    = 50000;	
-    	remote_n_portc   = 50000;
-    	local_n_portd    = 50001;	
-    	remote_n_portd   = 50001;
+        remote_n_portc   = 50001;
+        local_n_portd    = 50010;
+        remote_n_portd   = 50011;
         }  
 );
 
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf
index c9102b9b08546c383d0324fbb20c1a1d1c571ef0..1c9ad09141dfed017836dd27a63c85d71f19a7d9 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf
@@ -156,8 +156,25 @@ eNBs =
         ENB_IPV4_ADDRESS_FOR_S1U                 = "127.0.0.5/24";
         ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
     };
+  }
+);
 
-    log_config :
+MACRLCs = (
+	{
+	num_cc = 1;
+      	local_s_if_name  = "lo";			  
+      	remote_s_address = "127.0.0.1";
+    	local_s_address  = "127.0.0.2"; 
+    	local_s_portc    = 50001;	
+    	remote_s_portc   = 50000;
+    	local_s_portd    = 50011;	
+    	remote_s_portd   = 50010;
+	tr_s_preference = "nfapi";
+	tr_n_preference = "local_RRC";
+        }  
+);
+
+log_config =
     {
       global_log_level                      ="info";
       global_log_verbosity                  ="medium";
@@ -174,21 +191,3 @@ eNBs =
       rrc_log_level                         ="info";
       rrc_log_verbosity                     ="medium";
    };
-  }
-);
-
-MACRLCs = (
-	{
-	num_cc = 1;
-      	local_s_if_name  = "lo";			  
-      	remote_s_address = "127.0.0.1";
-    	local_s_address  = "127.0.0.2"; 
-    	local_s_portc    = 50000;	
-    	remote_s_portc   = 50000;
-    	local_s_portd    = 50001;	
-    	remote_s_portd   = 50001;
-	tr_s_preference = "nfapi";
-	tr_n_preference = "local_RRC";
-        }  
-);
-
diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c
index 33e6b0684b4cb4d595bd855723ae698076d73985..79973d381414269d066e7bd29f5f3a85d805b0ba 100644
--- a/targets/RT/USER/lte-enb.c
+++ b/targets/RT/USER/lte-enb.c
@@ -121,11 +121,14 @@ extern int transmission_mode;
 
 extern int oaisim_flag;
 
+uint16_t sf_ahead=4;
+
 //pthread_t                       main_eNB_thread;
 
 time_stats_t softmodem_stats_mt; // main thread
 time_stats_t softmodem_stats_hw; //  hw acquisition
 time_stats_t softmodem_stats_rxtx_sf; // total tx time
+time_stats_t nfapi_meas; // total tx time
 time_stats_t softmodem_stats_rx_sf; // total rx time
 
 /* mutex, cond and variable to serialize phy proc TX calls
@@ -151,48 +154,147 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
 void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
 #endif
 
+extern uint8_t nfapi_mode;
+extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
+extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
+
+//#define TICK_TO_US(ts) (ts.diff)
+#define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
+
+
 static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
 
+  static double cpu_freq_GHz = 0.0;
+
+  if (cpu_freq_GHz == 0.0)
+    cpu_freq_GHz = get_cpu_freq_GHz();
+
+
   start_meas(&softmodem_stats_rxtx_sf);
 
+  // *******************************************************************
+
+  if (nfapi_mode == 1) {
+
+    // I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
+    uint16_t frame = proc->frame_rx;
+    uint16_t subframe = proc->subframe_rx;
+
+    //add_subframe(&frame, &subframe, 4);
+
+    //oai_subframe_ind(proc->frame_tx, proc->subframe_tx);
+    //LOG_D(PHY, "oai_subframe_ind(frame:%u, subframe:%d) - NOT CALLED ********\n", frame, subframe);
+    start_meas(&nfapi_meas);
+    oai_subframe_ind(frame, subframe);
+    stop_meas(&nfapi_meas);
+
+    if (eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus||
+        eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs ||
+        eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs ||
+        eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles ||
+        eNB->UL_INFO.cqi_ind.number_of_cqis
+       ) {
+      LOG_D(PHY, "UL_info[rx_ind:%05d:%d harqs:%05d:%d crcs:%05d:%d preambles:%05d:%d cqis:%d] RX:%04d%d TX:%04d%d num_pdcch_symbols:%d\n", 
+          NFAPI_SFNSF2DEC(eNB->UL_INFO.rx_ind.sfn_sf),   eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus, 
+          NFAPI_SFNSF2DEC(eNB->UL_INFO.harq_ind.sfn_sf), eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs, 
+          NFAPI_SFNSF2DEC(eNB->UL_INFO.crc_ind.sfn_sf),  eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, 
+          NFAPI_SFNSF2DEC(eNB->UL_INFO.rach_ind.sfn_sf), eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles,
+          eNB->UL_INFO.cqi_ind.number_of_cqis, 
+          proc->frame_rx, proc->subframe_rx, 
+      proc->frame_tx, proc->subframe_tx, eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols);
+    }
+  }
+
+  if (nfapi_mode == 1 && eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols == 0) {
+    LOG_E(PHY, "eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols == 0");
+    return 0;
+  }
+
   // ****************************************
   // Common RX procedures subframe n
 
   T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx));
 
   // if this is IF5 or 3GPP_eNB
-  if (eNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
+  if (eNB && eNB->RU_list && eNB->RU_list[0] && eNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
     wakeup_prach_eNB(eNB,NULL,proc->frame_rx,proc->subframe_rx);
 #ifdef Rel14
     wakeup_prach_eNB_br(eNB,NULL,proc->frame_rx,proc->subframe_rx);
 #endif
   }
+
   // UE-specific RX processing for subframe n
-  phy_procedures_eNB_uespec_RX(eNB, proc, no_relay );
+  if (nfapi_mode == 0 || nfapi_mode == 1) {
+    phy_procedures_eNB_uespec_RX(eNB, proc, no_relay );
+  }
 
   pthread_mutex_lock(&eNB->UL_INFO_mutex);
+
   eNB->UL_INFO.frame     = proc->frame_rx;
   eNB->UL_INFO.subframe  = proc->subframe_rx;
   eNB->UL_INFO.module_id = eNB->Mod_id;
   eNB->UL_INFO.CC_id     = eNB->CC_id;
+
   eNB->if_inst->UL_indication(&eNB->UL_INFO);
+
   pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+
   // *****************************************
-  // TX processing for subframe n+4
+  // TX processing for subframe n+sf_ahead
   // run PHY TX procedures the one after the other for all CCs to avoid race conditions
   // (may be relaxed in the future for performance reasons)
   // *****************************************
   //if (wait_CCs(proc)<0) return(-1);
   
-
-  
   if (oai_exit) return(-1);
   
   phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1);
-  
-  if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) return(-1);
 
   stop_meas( &softmodem_stats_rxtx_sf );
+
+  LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx);
+
+#if 0
+  LOG_D(PHY, "rxtx:%lld nfapi:%lld phy:%lld tx:%lld rx:%lld prach:%lld ofdm:%lld ",
+      softmodem_stats_rxtx_sf.diff_now, nfapi_meas.diff_now,
+      TICK_TO_US(eNB->phy_proc),
+      TICK_TO_US(eNB->phy_proc_tx),
+      TICK_TO_US(eNB->phy_proc_rx),
+      TICK_TO_US(eNB->rx_prach),
+      TICK_TO_US(eNB->ofdm_mod_stats),
+      softmodem_stats_rxtx_sf.diff_now, nfapi_meas.diff_now);
+  LOG_D(PHY,
+    "dlsch[enc:%lld mod:%lld scr:%lld rm:%lld t:%lld i:%lld] rx_dft:%lld ",
+      TICK_TO_US(eNB->dlsch_encoding_stats),
+      TICK_TO_US(eNB->dlsch_modulation_stats),
+      TICK_TO_US(eNB->dlsch_scrambling_stats),
+      TICK_TO_US(eNB->dlsch_rate_matching_stats),
+      TICK_TO_US(eNB->dlsch_turbo_encoding_stats),
+      TICK_TO_US(eNB->dlsch_interleaving_stats),
+      TICK_TO_US(eNB->rx_dft_stats));
+
+  LOG_D(PHY," ulsch[ch:%lld freq:%lld dec:%lld demod:%lld ru:%lld ",
+      TICK_TO_US(eNB->ulsch_channel_estimation_stats),
+      TICK_TO_US(eNB->ulsch_freq_offset_estimation_stats),
+      TICK_TO_US(eNB->ulsch_decoding_stats),
+      TICK_TO_US(eNB->ulsch_demodulation_stats),
+      TICK_TO_US(eNB->ulsch_rate_unmatching_stats));
+
+  LOG_D(PHY, "td:%lld dei:%lld dem:%lld llr:%lld tci:%lld ",
+      TICK_TO_US(eNB->ulsch_turbo_decoding_stats),
+      TICK_TO_US(eNB->ulsch_deinterleaving_stats),
+      TICK_TO_US(eNB->ulsch_demultiplexing_stats),
+      TICK_TO_US(eNB->ulsch_llr_stats),
+      TICK_TO_US(eNB->ulsch_tc_init_stats));
+  LOG_D(PHY, "tca:%lld tcb:%lld tcg:%lld tce:%lld l1:%lld l2:%lld]\n\n", 
+      TICK_TO_US(eNB->ulsch_tc_alpha_stats),
+      TICK_TO_US(eNB->ulsch_tc_beta_stats),
+      TICK_TO_US(eNB->ulsch_tc_gamma_stats),
+      TICK_TO_US(eNB->ulsch_tc_ext_stats),
+      TICK_TO_US(eNB->ulsch_tc_intl1_stats),
+      TICK_TO_US(eNB->ulsch_tc_intl2_stats)
+      );
+#endif
   
   return(0);
 }
@@ -218,7 +320,7 @@ static void* eNB_thread_rxtx( void* param ) {
   eNB_thread_rxtx_status = 0;
 
 
-  sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1);
+  sprintf(thread_name,"RXn_TXnp4_%d",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1);
   thread_top_init(thread_name,1,850000L,1000000L,2000000L);
 
   while (!oai_exit) {
@@ -228,13 +330,16 @@ static void* eNB_thread_rxtx( void* param ) {
 
     VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
 
-    
-  
     if (oai_exit) break;
 
     if (eNB->CC_id==0)
+    {
       if (rxtx(eNB,proc,thread_name) < 0) break;
 
+    }
+
+    if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
+
   } // while !oai_exit
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
@@ -278,21 +383,16 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string)
   proc->subframe_rx = subframe_rx;
 
   if (!oai_exit) {
-    LOG_D(PHY,"eNB_top in %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n",
-	  (void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
-
     T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
 
     proc_rxtx->subframe_rx = proc->subframe_rx;
     proc_rxtx->frame_rx    = proc->frame_rx;
-    proc_rxtx->subframe_tx = (proc->subframe_rx+4)%10;
-    proc_rxtx->frame_tx    = (proc->subframe_rx>5) ? (1+proc->frame_rx)&1023 : proc->frame_rx;
+    proc_rxtx->subframe_tx = (proc->subframe_rx+sf_ahead)%10;
+    proc_rxtx->frame_tx    = (proc->subframe_rx>(9-sf_ahead)) ? (1+proc->frame_rx)&1023 : proc->frame_rx;
     proc->frame_tx         = proc_rxtx->frame_tx;
     proc_rxtx->timestamp_tx = proc->timestamp_tx;
 
     if (rxtx(eNB,proc_rxtx,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id);
-    LOG_D(PHY,"eNB_top out %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n",
-	  (void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
   }
 }
 
@@ -318,6 +418,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
     }
   }
   if (proc->RU_mask != (1<<eNB->num_RU)-1) {  // not all RUs have provided their information so return
+    LOG_E(PHY,"Not all RUs have provided their info\n");
     pthread_mutex_unlock(&proc->mutex_RU);
     return(0);
   }
@@ -334,7 +435,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
 
   /* accept some delay in processing - up to 5ms */
   for (i = 0; i < 10 && proc_rxtx->instance_cnt_rxtx == 0; i++) {
-    LOG_W( PHY,"[eNB] Frame %d, eNB RXn-TXnp4 thread busy!! (cnt_rxtx %i)\n", proc_rxtx->frame_tx, proc_rxtx->instance_cnt_rxtx);
+    LOG_W( PHY,"[eNB] Frame %d Subframe %d, eNB RXn-TXnp4 thread busy!! (cnt_rxtx %i)\n", proc_rxtx->frame_tx, proc_rxtx->subframe_tx, proc_rxtx->instance_cnt_rxtx);
     usleep(500);
   }
   if (proc_rxtx->instance_cnt_rxtx == 0) {
@@ -342,7 +443,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
     return(-1);
   }
 
-  // wake up TX for subframe n+4
+  // wake up TX for subframe n+sf_ahead
   // lock the TX mutex and make sure the thread is ready
   if (pthread_mutex_timedlock(&proc_rxtx->mutex_rxtx,&wait) != 0) {
     LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", proc_rxtx->subframe_rx&1,proc_rxtx->instance_cnt_rxtx );
@@ -356,14 +457,14 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
   // TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired 
   // transmitted timestamp of the next TX slot (first).
   // The last (TS_rx mod samples_per_frame) was n*samples_per_tti, 
-  // we want to generate subframe (n+4), so TS_tx = TX_rx+4*samples_per_tti,
-  // and proc->subframe_tx = proc->subframe_rx+4
-  proc_rxtx->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_tti);
+  // we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti,
+  // and proc->subframe_tx = proc->subframe_rx+sf_ahead
+  proc_rxtx->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
   proc_rxtx->frame_rx     = proc->frame_rx;
   proc_rxtx->subframe_rx  = proc->subframe_rx;
-  proc_rxtx->frame_tx     = (proc_rxtx->subframe_rx > 5) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx;
-  proc_rxtx->subframe_tx  = (proc_rxtx->subframe_rx + 4)%10;
-  
+  proc_rxtx->frame_tx     = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx;
+  proc_rxtx->subframe_tx  = (proc_rxtx->subframe_rx + sf_ahead)%10;
+
   // the thread can now be woken up
   if (pthread_cond_signal(&proc_rxtx->cond_rxtx) != 0) {
     LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RXn-TXnp4 thread\n");
@@ -593,10 +694,12 @@ void init_eNB_proc(int inst) {
   pthread_attr_t *attr_prach_br=NULL;
 #endif
 
+  LOG_I(PHY,"%s(inst:%d) RC.nb_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_CC[inst]);
+
   for (CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) {
     eNB = RC.eNB[inst][CC_id];
 #ifndef OCP_FRAMEWORK
-    LOG_I(PHY,"Initializing eNB processes %d CC_id %d \n",inst,CC_id);
+    LOG_I(PHY,"Initializing eNB processes instance:%d CC_id %d \n",inst,CC_id);
 #endif
     proc = &eNB->proc;
 
@@ -652,6 +755,8 @@ void init_eNB_proc(int inst) {
     //    attr_te     = &proc->attr_te; 
 #endif
 
+    LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
+
     if (eNB->single_thread_flag==0) {
       pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, &proc_rxtx[0] );
       pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx, &proc_rxtx[1] );
@@ -787,6 +892,8 @@ void init_transport(PHY_VARS_eNB *eNB) {
   int j;
   LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
 
+  LOG_I(PHY, "Initialise transport\n");
+
   for (i=0; i<NUMBER_OF_UE_MAX; i++) {
     LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i);
     for (j=0; j<2; j++) {
@@ -795,8 +902,8 @@ void init_transport(PHY_VARS_eNB *eNB) {
 	LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
 	exit(-1);
       } else {
-	LOG_D(PHY,"dlsch[%d][%d] => %p\n",i,j,eNB->dlsch[i][j]);
 	eNB->dlsch[i][j]->rnti=0;
+	LOG_D(PHY,"dlsch[%d][%d] => %p rnti:%d\n",i,j,eNB->dlsch[i][j], eNB->dlsch[i][j]->rnti);
       }
     }
     
@@ -849,20 +956,33 @@ void init_eNB_afterRU(void) {
   int inst,CC_id,ru_id,i,aa;
   PHY_VARS_eNB *eNB;
 
+  LOG_I(PHY,"%s() RC.nb_inst:%d\n", __FUNCTION__, RC.nb_inst);
 
   for (inst=0;inst<RC.nb_inst;inst++) {
+    LOG_I(PHY,"RC.nb_CC[inst]:%d\n", RC.nb_CC[inst]);
     for (CC_id=0;CC_id<RC.nb_CC[inst];CC_id++) {
+
+      LOG_I(PHY,"RC.nb_CC[inst:%d][CC_id:%d]:%p\n", inst, CC_id, RC.eNB[inst][CC_id]);
+
       eNB                                  =  RC.eNB[inst][CC_id];
       phy_init_lte_eNB(eNB,0,0);
       // map antennas and PRACH signals to eNB RX
-      AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id);
+      if (0) AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id);
       LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id);
       eNB->frame_parms.nb_antennas_rx       = 0;
+
+      LOG_I(PHY,"Overwriting eNB->prach_vars.rxsigF[0]:%p\n", eNB->prach_vars.rxsigF[0]);
+
       eNB->prach_vars.rxsigF[0] = (int16_t**)malloc16(64*sizeof(int16_t*));
 #ifdef Rel14
-      for (int ce_level=0;ce_level<4;ce_level++)
-	eNB->prach_vars_br.rxsigF[ce_level] = (int16_t**)malloc16(64*sizeof(int16_t*));
+      for (int ce_level=0;ce_level<4;ce_level++) {
+        LOG_I(PHY,"Overwriting eNB->prach_vars_br.rxsigF.rxsigF[0]:%p\n", eNB->prach_vars_br.rxsigF[ce_level]);
+        eNB->prach_vars_br.rxsigF[ce_level] = (int16_t**)malloc16(64*sizeof(int16_t*));
+      }
 #endif
+
+      LOG_I(PHY,"eNB->num_RU:%d\n", eNB->num_RU);
+
       for (ru_id=0,aa=0;ru_id<eNB->num_RU;ru_id++) {
 	eNB->frame_parms.nb_antennas_rx    += eNB->RU_list[ru_id]->nb_rx;
 
@@ -884,6 +1004,36 @@ void init_eNB_afterRU(void) {
 	  eNB->common_vars.rxdataF[aa]     =  eNB->RU_list[ru_id]->common.rxdataF[i];
 	}
       }
+
+
+
+      /* TODO: review this code, there is something wrong.
+       * In monolithic mode, we come here with nb_antennas_rx == 0
+       * (not tested in other modes).
+       */
+      if (eNB->frame_parms.nb_antennas_rx < 1)
+      {
+        LOG_I(PHY, "%s() ************* DJP ***** eNB->frame_parms.nb_antennas_rx:%d - GOING TO HARD CODE TO 1", __FUNCTION__, eNB->frame_parms.nb_antennas_rx);
+        eNB->frame_parms.nb_antennas_rx = 1;
+      }
+      else
+      {
+        //LOG_I(PHY," Delete code\n");
+      }
+
+      if (eNB->frame_parms.nb_antennas_tx < 1)
+      {
+        LOG_I(PHY, "%s() ************* DJP ***** eNB->frame_parms.nb_antennas_tx:%d - GOING TO HARD CODE TO 1", __FUNCTION__, eNB->frame_parms.nb_antennas_tx);
+        eNB->frame_parms.nb_antennas_tx = 1;
+      }
+      else
+      {
+        //LOG_I(PHY," Delete code\n");
+      }
+
+
+
+
       AssertFatal(eNB->frame_parms.nb_antennas_rx >0,
 		  "inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
       LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
@@ -911,7 +1061,10 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
   int inst;
   PHY_VARS_eNB *eNB;
 
+  LOG_I(PHY,"[lte-softmodem.c] eNB structure about to allocated RC.nb_L1_inst:%d RC.nb_L1_CC[0]:%d\n",RC.nb_L1_inst,RC.nb_L1_CC[0]);
+
   if (RC.eNB == NULL) RC.eNB = (PHY_VARS_eNB***) malloc(RC.nb_L1_inst*sizeof(PHY_VARS_eNB **));
+  LOG_I(PHY,"[lte-softmodem.c] eNB structure RC.eNB allocated\n");
   for (inst=0;inst<RC.nb_L1_inst;inst++) {
     if (RC.eNB[inst] == NULL) RC.eNB[inst] = (PHY_VARS_eNB**) malloc(RC.nb_CC[inst]*sizeof(PHY_VARS_eNB *));
     for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) {
@@ -921,6 +1074,7 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
       eNB->single_thread_flag = single_thread_flag;
 
 
+      LOG_I(PHY,"Initializing eNB %d CC_id %d single_thread_flag:%d\n",inst,CC_id,single_thread_flag);
 #ifndef OCP_FRAMEWORK
       LOG_I(PHY,"Initializing eNB %d CC_id %d\n",inst,CC_id);
 #endif
@@ -937,10 +1091,10 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
       memset((void*)&eNB->UL_INFO,0,sizeof(eNB->UL_INFO));
       memset((void*)&eNB->Sched_INFO,0,sizeof(eNB->Sched_INFO));
       LOG_I(PHY,"Setting indication lists\n");
-      eNB->UL_INFO.rx_ind.rx_pdu_list   = eNB->rx_pdu_list;
-      eNB->UL_INFO.crc_ind.crc_pdu_list = eNB->crc_pdu_list;
-      eNB->UL_INFO.sr_ind.sr_pdu_list = eNB->sr_pdu_list;
-      eNB->UL_INFO.harq_ind.harq_pdu_list = eNB->harq_pdu_list;
+      eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list   = eNB->rx_pdu_list;
+      eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = eNB->crc_pdu_list;
+      eNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = eNB->sr_pdu_list;
+      eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = eNB->harq_pdu_list;
       eNB->UL_INFO.cqi_ind.cqi_pdu_list = eNB->cqi_pdu_list;
       eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
       eNB->prach_energy_counter = 0;
@@ -948,11 +1102,7 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
 
   }
 
-
   LOG_I(PHY,"[lte-softmodem.c] eNB structure allocated\n");
-  
-
-
 }
 
 
diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c
index 54693f43c81c4b2e75747d1766a13b60678224d3..9f67e75b1c8f59003009747345c221258e75762d 100644
--- a/targets/RT/USER/lte-ru.c
+++ b/targets/RT/USER/lte-ru.c
@@ -129,6 +129,7 @@ int attach_rru(RU_t *ru);
 
 int connect_rau(RU_t *ru);
 
+extern uint16_t sf_ahead;
 
 /*************************************************************/
 /* Functions to attach and configure RRU                     */
@@ -388,8 +389,8 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
   proc->frame_rx     = f;
   proc->timestamp_rx = ((proc->frame_rx * 10)  + proc->subframe_rx ) * fp->samples_per_tti ;
   //  proc->timestamp_tx = proc->timestamp_rx +  (4*fp->samples_per_tti);
-  proc->subframe_tx  = (sf+4)%10;
-  proc->frame_tx     = (sf>5) ? (f+1)&1023 : f;
+  proc->subframe_tx  = (sf+sf_ahead)%10;
+  proc->frame_tx     = (sf>(9-sf_ahead)) ? (f+1)&1023 : f;
  
   if (proc->first_rx == 0) {
     if (proc->subframe_rx != *subframe){
@@ -591,6 +592,7 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
   uint32_t symbol_number,symbol_mask,symbol_mask_full;
   int subframe_tx,frame_tx;
 
+  LOG_D(PHY, "%s(ru:%p frame, subframe)\n", __FUNCTION__, ru);
   symbol_number = 0;
   symbol_mask = 0;
   symbol_mask_full = ((subframe_select(fp,*subframe) == SF_S) ? (1<<fp->dl_symbols_in_S_subframe) : (1<<fp->symbols_per_tti))-1;
@@ -667,6 +669,7 @@ void fh_if4p5_north_out(RU_t *ru) {
   stop_meas(&ru->tx_fhaul);
 
 }
+
 void rx_rf(RU_t *ru,int *frame,int *subframe) {
 
   RU_proc_t *proc = &ru->proc;
@@ -678,7 +681,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
     
   for (i=0; i<ru->nb_rx; i++)
     rxp[i] = (void*)&ru->common.rxdata[i][*subframe*fp->samples_per_tti];
-  
+
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
 
   old_ts = proc->timestamp_rx;
@@ -693,8 +696,9 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
  
   proc->timestamp_rx = ts-ru->ts_offset;
 
-  AssertFatal(rxs == fp->samples_per_tti,
-	      "rx_rf: Asked for %d samples, got %d from USRP\n",fp->samples_per_tti,rxs);
+  //AssertFatal(rxs == fp->samples_per_tti,
+	      //"rx_rf: Asked for %d samples, got %d from USRP\n",fp->samples_per_tti,rxs);
+  if (rxs != fp->samples_per_tti) LOG_E(PHY, "rx_rf: Asked for %d samples, got %d from USRP\n",fp->samples_per_tti,rxs);
 
   if (proc->first_rx == 1) {
     ru->ts_offset = proc->timestamp_rx;
@@ -712,9 +716,9 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
   proc->subframe_rx  = (proc->timestamp_rx / fp->samples_per_tti)%10;
   // synchronize first reception to frame 0 subframe 0
 
-  proc->timestamp_tx = proc->timestamp_rx+(4*fp->samples_per_tti);
-  proc->subframe_tx  = (proc->subframe_rx+4)%10;
-  proc->frame_tx     = (proc->subframe_rx>5) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
+  proc->timestamp_tx = proc->timestamp_rx+(sf_ahead*fp->samples_per_tti);
+  proc->subframe_tx  = (proc->subframe_rx+sf_ahead)%10;
+  proc->frame_tx     = (proc->subframe_rx>(9-sf_ahead)) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
   
   LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, subframe %d\n",
 	ru->idx, 
@@ -751,10 +755,10 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
   VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
   
   if (rxs != fp->samples_per_tti)
-    exit_fun( "problem receiving samples" );
-  
-
-  
+  {
+    //exit_fun( "problem receiving samples" );
+    LOG_E(PHY, "problem receiving samples");
+  }
 }
 
 
@@ -777,7 +781,6 @@ void tx_rf(RU_t *ru) {
   if ((SF_type == SF_DL) ||
       (SF_type == SF_S)) {
     
-    
     int siglen=fp->samples_per_tti,flags=1;
     
     if (SF_type == SF_S) {
@@ -944,22 +947,24 @@ static void* ru_thread_prach( void* param ) {
 
   thread_top_init("ru_thread_prach",1,500000L,1000000L,20000000L);
 
+  while (RC.ru_mask>0) {
+    usleep(1e6);
+    LOG_I(PHY,"%s() RACH waiting for RU to be configured\n", __FUNCTION__);
+  }
+  LOG_I(PHY,"%s() RU configured - RACH processing thread running\n", __FUNCTION__);
+
   while (!oai_exit) {
     
     if (oai_exit) break;
     if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
     VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 1 );      
-    rx_prach(NULL,
-	     ru,
-	     NULL,
-             NULL,
-             NULL,
-             proc->frame_prach,
-             0
+    prach_procedures(
+        ru->eNB_list[0]
 #ifdef Rel14
-	     ,0
+        ,0
 #endif
-	     );
+        );
+
     VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 );      
     if (release_thread(&proc->mutex_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
   }
@@ -1109,21 +1114,29 @@ void wakeup_eNBs(RU_t *ru) {
   int i;
   PHY_VARS_eNB **eNB_list = ru->eNB_list;
 
-  LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d\n",ru->num_eNB,ru->idx);
+  LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top);
 
-  if (ru->num_eNB==1) {
+  if (ru->num_eNB==1 && ru->eNB_top!=0) {
     // call eNB function directly
 
     char string[20];
     sprintf(string,"Incoming RU %d",ru->idx);
-    LOG_D(PHY,"RU %d Waking up eNB\n",ru->idx);
+    LOG_D(PHY,"RU %d Call eNB_top\n",ru->idx);
     ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string);
   }
   else {
 
+    LOG_D(PHY,"ru->num_eNB:%d\n", ru->num_eNB);
+
     for (i=0;i<ru->num_eNB;i++)
-      if (ru->wakeup_rxtx(eNB_list[i],ru) < 0)
+    {
+      LOG_D(PHY,"ru->wakeup_rxtx:%p\n", ru->wakeup_rxtx);
+
+      if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
+      {
 	LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
+      }
+    }
   }
 }
 
@@ -1144,6 +1157,10 @@ static inline int wakeup_prach_ru(RU_t *ru) {
     ru->proc.frame_prach    = ru->proc.frame_rx;
     ru->proc.subframe_prach = ru->proc.subframe_rx;
 
+    // DJP - think prach_procedures() is looking at eNB frame_prach
+    ru->eNB_list[0]->proc.frame_prach = ru->proc.frame_rx;
+    ru->eNB_list[0]->proc.subframe_prach = ru->proc.subframe_rx;
+
     LOG_D(PHY,"RU %d: waking up PRACH thread\n",ru->idx);
     // the thread can now be woken up
     AssertFatal(pthread_cond_signal(&ru->proc.cond_prach) == 0, "ERROR pthread_cond_signal for RU prach thread\n");
@@ -1370,7 +1387,6 @@ static void* ru_thread( void* param ) {
         init_frame_parms(&ru->frame_parms,1);
         phy_init_RU(ru);
  
-
         ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
   }
   if (setup_RU_buffers(ru)!=0) {
@@ -1426,23 +1442,29 @@ static void* ru_thread( void* param ) {
       subframe++;
     }      
 
-    LOG_D(PHY,"RU thread (proc %p), frame %d (%p), subframe %d (%p)\n",
-	  proc, frame,&frame,subframe,&subframe);
-
-
     // synchronization on input FH interface, acquire signals/data and block
     if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&subframe);
     else AssertFatal(1==0, "No fronthaul interface at south port");
 
-
-    LOG_D(PHY,"RU thread (do_prach %d, is_prach_subframe %d), received frame %d, subframe %d\n",
-	  ru->do_prach,
-	  is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx),
-	  proc->frame_rx,proc->subframe_rx);
+    LOG_D(PHY,"AFTER fh_south_in - SFN/SF:%d%d RU->proc[RX:%d%d TX:%d%d] RC.eNB[0][0]:[RX:%d%d TX(SFN):%d]\n",
+        frame,subframe,
+        proc->frame_rx,proc->subframe_rx,
+        proc->frame_tx,proc->subframe_tx,
+        RC.eNB[0][0]->proc.frame_rx,RC.eNB[0][0]->proc.subframe_rx,
+        RC.eNB[0][0]->proc.frame_tx);
+
+      LOG_D(PHY,"RU thread (do_prach %d, is_prach_subframe %d), received frame %d, subframe %d\n",
+          ru->do_prach,
+          is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx),
+          proc->frame_rx,proc->subframe_rx);
  
-    if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) wakeup_prach_ru(ru);
+    if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) {
+      wakeup_prach_ru(ru);
+    }
 #ifdef Rel14
-    else if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)>1)) wakeup_prach_ru_br(ru);
+    else if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)>1)) {
+      wakeup_prach_ru_br(ru);
+    }
 #endif
 
     // adjust for timing offset between RU
@@ -1459,7 +1481,7 @@ static void* ru_thread( void* param ) {
     // wakeup all eNB processes waiting for this RU
     if (ru->num_eNB>0) wakeup_eNBs(ru);
 
-    // wait until eNBs are finished subframe RX n and TX n+4
+    // wait until eNBs are finished subframe RX n and TX n+sf_ahead
     wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread");
 
 
@@ -1472,7 +1494,6 @@ static void* ru_thread( void* param ) {
     if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru);
  
     if (ru->fh_north_out) ru->fh_north_out(ru);
-
   }
   
 
@@ -1662,6 +1683,10 @@ void init_RU_proc(RU_t *ru) {
     pthread_setname_np( proc->pthread_FH, name );
     
   }
+  else if (ru->function == eNodeB_3GPP && ru->if_south == LOCAL_RF) { // DJP - need something else to distinguish between monolithic and PNF
+    LOG_I(PHY,"%s() DJP - added creation of pthread_prach\n", __FUNCTION__);
+    pthread_create( &proc->pthread_prach, attr_prach, ru_thread_prach, (void*)ru );
+  }
 
   if (get_nprocs()>=2) { 
     if (ru->feprx) init_fep_thread(ru,NULL); 
@@ -1671,10 +1696,6 @@ void init_RU_proc(RU_t *ru) {
   
 }
 
-
-
-
-
 int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) {
 
   FH_fmt_options_t fmt = cap->FH_fmt;
@@ -1872,10 +1893,13 @@ void init_RU(char *rf_config_file) {
   RCconfig_RU();
   LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_L1_inst,RC.nb_RU,get_nprocs());
 
-  for (i=0;i<RC.nb_L1_inst;i++) 
-    for (CC_id=0;CC_id<RC.nb_CC[i];CC_id++) RC.eNB[i][CC_id]->num_RU=0;
+  if (RC.nb_CC != 0)
+    for (i=0;i<RC.nb_L1_inst;i++) 
+      for (CC_id=0;CC_id<RC.nb_CC[i];CC_id++) RC.eNB[i][CC_id]->num_RU=0;
 
+  LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU);
   for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
+    LOG_D(PHY,"Process RC.ru[%d]\n",ru_id);
     ru               = RC.ru[ru_id];
     ru->rf_config_file = rf_config_file;
     ru->idx          = ru_id;              
@@ -1883,24 +1907,47 @@ void init_RU(char *rf_config_file) {
     // use eNB_list[0] as a reference for RU frame parameters
     // NOTE: multiple CC_id are not handled here yet!
 
-    
-    eNB0             = ru->eNB_list[0];
-    if ((ru->function != NGFI_RRU_IF5) && (ru->function != NGFI_RRU_IF4p5))
-      AssertFatal(eNB0!=NULL,"eNB0 is null!\n");
+    LOG_D(PHY, "%s() RC.ru[%d].num_eNB:%d ru->eNB_list[0]:%p RC.eNB[0][0]:%p rf_config_file:%s\n", __FUNCTION__, ru_id, ru->num_eNB, ru->eNB_list[0], RC.eNB[0][0], ru->rf_config_file);
 
-    if (eNB0) {
-      LOG_I(PHY,"Copying frame parms from eNB %d to ru %d\n",eNB0->Mod_id,ru->idx);
-      memcpy((void*)&ru->frame_parms,(void*)&eNB0->frame_parms,sizeof(LTE_DL_FRAME_PARMS));
+    if (ru->eNB_list[0] == 0)
+    {
+      LOG_E(PHY,"%s() DJP - ru->eNB_list ru->num_eNB are not initialized - so do it manually\n", __FUNCTION__);
+      ru->eNB_list[0] = RC.eNB[0][0];
+      ru->num_eNB=1;
+      //
+      // DJP - feptx_prec() / feptx_ofdm() parses the eNB_list (based on num_eNB) and copies the txdata_F to txdata in RU
+      //
+    }
+    else
+    {
+    LOG_E(PHY,"DJP - delete code above this %s:%d\n", __FILE__, __LINE__);
+    }
 
-      // attach all RU to all eNBs in its list/
-      for (i=0;i<ru->num_eNB;i++) {
-	eNB0 = ru->eNB_list[i];
-	eNB0->RU_list[eNB0->num_RU++] = ru;
+    eNB0             = ru->eNB_list[0];
+    LOG_D(PHY, "RU FUnction:%d ru->if_south:%d\n", ru->function, ru->if_south);
+    LOG_D(PHY, "eNB0:%p\n", eNB0);
+    if (eNB0)
+    {
+      if ((ru->function != NGFI_RRU_IF5) && (ru->function != NGFI_RRU_IF4p5))
+        AssertFatal(eNB0!=NULL,"eNB0 is null!\n");
+
+      if (eNB0) {
+        LOG_I(PHY,"Copying frame parms from eNB %d to ru %d\n",eNB0->Mod_id,ru->idx);
+        memcpy((void*)&ru->frame_parms,(void*)&eNB0->frame_parms,sizeof(LTE_DL_FRAME_PARMS));
+
+        // attach all RU to all eNBs in its list/
+        LOG_D(PHY,"ru->num_eNB:%d eNB0->num_RU:%d\n", ru->num_eNB, eNB0->num_RU);
+        for (i=0;i<ru->num_eNB;i++) {
+          eNB0 = ru->eNB_list[i];
+          eNB0->RU_list[eNB0->num_RU++] = ru;
+        }
       }
     }
     //    LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function);
 
-    
+
+    LOG_D(PHY,"ru->if_south:%d\n", ru->if_south);
+
     switch (ru->if_south) {
     case LOCAL_RF:   // this is an RU with integrated RF (RRU, eNB)
       if (ru->function ==  NGFI_RRU_IF5) {                 // IF5 RRU
@@ -1979,7 +2026,8 @@ void init_RU(char *rf_config_file) {
       if (setup_RU_buffers(ru)!=0) {
 	printf("Exiting, cannot initialize RU Buffers\n");
 	exit(-1);
-      }*/
+      }
+      */
       break;
 
     case REMOTE_IF5: // the remote unit is IF5 RRU
diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c
index e90fc4335c5edd68369163e1cde3fcc9f474dc0b..792f16e92a1bcdf6aeb9f843170befeb4bb48962 100644
--- a/targets/RT/USER/lte-softmodem.c
+++ b/targets/RT/USER/lte-softmodem.c
@@ -101,7 +101,6 @@ unsigned short config_frames[4] = {2,9,11,13};
 #endif
 #include "lte-softmodem.h"
 
-
 #ifdef XFORMS
 // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
 // at eNB 0, an UL scope for every UE
@@ -113,9 +112,16 @@ unsigned char                   scope_enb_num_ue = 2;
 static pthread_t                forms_thread; //xforms
 #endif //XFORMS
 
+pthread_cond_t nfapi_sync_cond;
+pthread_mutex_t nfapi_sync_mutex;
+int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
+
+uint8_t nfapi_mode = 0; // Default to monolithic mode
+
 pthread_cond_t sync_cond;
 pthread_mutex_t sync_mutex;
 int sync_var=-1; //!< protected by mutex \ref sync_mutex.
+int config_sync_var=-1;
 
 uint16_t runtime_phy_rx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100]
 uint16_t runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100]
@@ -205,6 +211,12 @@ uint64_t num_missed_slots=0; // counter for the number of missed slots
 extern void reset_opp_meas(void);
 extern void print_opp_meas(void);
 
+extern PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
+			  uint8_t UE_id,
+			  uint8_t abstraction_flag);
+
+extern void init_eNB_afterRU(void);
+
 int transmission_mode=1;
 
 
@@ -839,7 +851,7 @@ void init_openair0() {
 
 void wait_RUs(void) {
 
-  LOG_I(PHY,"Waiting for RUs to be configured ...\n");
+  LOG_I(PHY,"Waiting for RUs to be configured ... RC.ru_mask:%02lx\n", RC.ru_mask);
 
   // wait for all RUs to be configured over fronthaul
   pthread_mutex_lock(&RC.ru_mutex);
@@ -848,6 +860,7 @@ void wait_RUs(void) {
 
   while (RC.ru_mask>0) {
     pthread_cond_wait(&RC.ru_cond,&RC.ru_mutex);
+    printf("RC.ru_mask:%02lx\n", RC.ru_mask);
   }
 
   LOG_I(PHY,"RUs configured\n");
@@ -860,19 +873,37 @@ void wait_eNBs(void) {
 
 
   while (waiting==1) {
-    printf("Waiting for eNB L1 instances to all get configured ... sleeping 500ms (nb_L1_inst %d)\n",RC.nb_L1_inst);
-    usleep(500000);
+    printf("Waiting for eNB L1 instances to all get configured ... sleeping 50ms (nb_L1_inst %d)\n",RC.nb_L1_inst);
+    usleep(50*1000);
     waiting=0;
-    for (i=0;i<RC.nb_L1_inst;i++)
-      for (j=0;j<RC.nb_L1_CC[i];j++)
+    for (i=0;i<RC.nb_L1_inst;i++) {
+
+      printf("RC.nb_L1_CC[%d]:%d\n", i, RC.nb_L1_CC[i]);
+
+      for (j=0;j<RC.nb_L1_CC[i];j++) {
 	if (RC.eNB[i][j]->configured==0) {
 	  waiting=1;
 	  break;
-	}
+        } 
+      }
+    }
   }
   printf("eNB L1 are configured\n");
 }
 
+static inline void wait_nfapi_init(char *thread_name) {
+
+  printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
+  pthread_mutex_lock( &nfapi_sync_mutex );
+  
+  while (nfapi_sync_var<0)
+    pthread_cond_wait( &nfapi_sync_cond, &nfapi_sync_mutex );
+  
+  pthread_mutex_unlock(&nfapi_sync_mutex);
+  
+  printf( "NFAPI: got sync (%s)\n", thread_name);
+}
+
 int main( int argc, char **argv )
 {
   int i;
@@ -974,6 +1005,7 @@ int main( int argc, char **argv )
     log_set_instance_type (LOG_INSTANCE_ENB);
   }
 
+  printf("ITTI init\n");
   itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, itti_dump_file);
 
   // initialize mscgen log after ITTI
@@ -993,6 +1025,7 @@ int main( int argc, char **argv )
   }
 
 #ifdef PDCP_USE_NETLINK
+  printf("PDCP netlink\n");
   netlink_init();
 #if defined(PDCP_USE_NETLINK_QUEUES)
   pdcp_netlink_init();
@@ -1026,6 +1059,7 @@ int main( int argc, char **argv )
 
 
 
+  printf("Before CC \n");
 
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
 
@@ -1090,6 +1124,7 @@ int main( int argc, char **argv )
 
   }
 
+  printf("Runtime table\n");
   fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
   cpuf=get_cpu_freq_GHz();
   
@@ -1097,6 +1132,7 @@ int main( int argc, char **argv )
   
 #ifndef DEADLINE_SCHEDULER
   
+  printf("NO deadline scheduler\n");
   /* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
   
   cpu_set_t cpuset;
@@ -1162,6 +1198,8 @@ int main( int argc, char **argv )
 #ifdef XFORMS
   int UE_id;
   
+  printf("XFORMS\n");
+
   if (do_forms==1) {
     fl_initialize (&argc, argv, NULL, 0, 0);
     
@@ -1217,7 +1255,36 @@ int main( int argc, char **argv )
 #endif
   
   rt_sleep_ns(10*100000000ULL);
+
+  if (nfapi_mode) {
+
+    printf("NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
+    pthread_cond_init(&sync_cond,NULL);
+    pthread_mutex_init(&sync_mutex, NULL);
+  }
   
+  const char *nfapi_mode_str = "<UNKNOWN>";
+
+  switch(nfapi_mode) {
+    case 0:
+      nfapi_mode_str = "MONOLITHIC";
+      break;
+    case 1:
+      nfapi_mode_str = "PNF";
+      break;
+    case 2:
+      nfapi_mode_str = "VNF";
+      break;
+    default:
+      nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
+      break;
+  }
+  printf("NFAPI MODE:%s\n", nfapi_mode_str);
+
+  if (nfapi_mode==2) // VNF
+    wait_nfapi_init("main?");
+
+  printf("START MAIN THREADS\n");
   
   // start the main threads
   if (UE_flag == 1) {
@@ -1238,15 +1305,18 @@ int main( int argc, char **argv )
   }
   else { 
     number_of_cards = 1;    
+    printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
     if (RC.nb_L1_inst > 0) {
-      printf("Initializing eNB threads\n");
+      printf("Initializing eNB threads single_thread_flag:%d wait_for_sync:%d\n", single_thread_flag,wait_for_sync);
       init_eNB(single_thread_flag,wait_for_sync);
       //      for (inst=0;inst<RC.nb_L1_inst;inst++)
       //	for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) phy_init_lte_eNB(RC.eNB[inst][CC_id],0,0);
     }
 
+    printf("wait_eNBs()\n");
     wait_eNBs();
 
+    printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
     if (RC.nb_RU >0) {
       printf("Initializing RU threads\n");
       init_RU(rf_config_file);
@@ -1256,10 +1326,30 @@ int main( int argc, char **argv )
       }
     }
 
+    config_sync_var=0;
+
+    if (nfapi_mode==1) { // PNF
+      wait_nfapi_init("main?");
+    }
+
+    printf("wait RUs\n");
     wait_RUs();
+    printf("ALL RUs READY!\n");
+    printf("RC.nb_RU:%d\n", RC.nb_RU);
     // once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
-    init_eNB_afterRU();
+    printf("ALL RUs ready - init eNBs\n");
+
+    if (nfapi_mode != 1 && nfapi_mode != 2)
+    {
+      printf("Not NFAPI mode - call init_eNB_afterRU()\n");
+      init_eNB_afterRU();
+    }
+    else
+    {
+      printf("NFAPI mode - DO NOT call init_eNB_afterRU()\n");
+    }
     
+    printf("ALL RUs ready - ALL eNBs ready\n");
   }
   
   
@@ -1293,38 +1383,35 @@ int main( int argc, char **argv )
     //p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
   } else {
     
-    
-    
-    
+    printf("eNB mode\n");
     
   }
   
-  
-  
-  
   printf("Sending sync to all threads\n");
   
-  
-  
   pthread_mutex_lock(&sync_mutex);
   sync_var=0;
   pthread_cond_broadcast(&sync_cond);
   pthread_mutex_unlock(&sync_mutex);
+  printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
   end_configmodule();
+  printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
 
   // wait for end of program
   printf("TYPE <CTRL-C> TO TERMINATE\n");
   //getchar();
 
-
 #if defined(ENABLE_ITTI)
   printf("Entering ITTI signals handler\n");
   itti_wait_tasks_end();
+  printf("Returned from ITTI signal handler\n");
   oai_exit=1;
+  printf("oai_exit=%d\n",oai_exit);
 #else
 
   while (oai_exit==0)
     rt_sleep_ns(100000000ULL);
+  printf("Terminating application - oai_exit=%d\n",oai_exit);
 
 #endif
 
@@ -1367,6 +1454,9 @@ int main( int argc, char **argv )
   pthread_cond_destroy(&sync_cond);
   pthread_mutex_destroy(&sync_mutex);
 
+  pthread_cond_destroy(&nfapi_sync_cond);
+  pthread_mutex_destroy(&nfapi_sync_mutex);
+
 
 
   // *** Handle per CC_id openair0
diff --git a/targets/RT/USER/pnf.gtkw b/targets/RT/USER/pnf.gtkw
new file mode 100644
index 0000000000000000000000000000000000000000..979d6321383e625d12369a7dfd8dcdfc0d482b6a
--- /dev/null
+++ b/targets/RT/USER/pnf.gtkw
@@ -0,0 +1,54 @@
+[*]
+[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
+[*] Tue Jul 25 20:26:12 2017
+[*]
+[dumpfile] "/tmp/openair_dump_eNB.vcd"
+[dumpfile_mtime] "Tue Jul 25 20:11:55 2017"
+[dumpfile_size] 19201475
+[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
+[timestart] 29023604000
+[size] 1236 578
+[pos] 309 0
+*-20.793451 29026062100 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+[sst_width] 386
+[signals_width] 262
+[sst_expanded] 1
+[sst_vpaned_height] 146
+@28
+functions.trx_read
+functions.trx_write
+@24
+variables.trx_ts[63:0]
+variables.trx_tst[63:0]
+@25
+variables.frame_number_RX0_RU[63:0]
+variables.subframe_number_RX0_RU[63:0]
+@25
+variables.frame_number_TX0_RU[63:0]
+variables.subframe_number_TX0_RU[63:0]
+@24
+functions.phy_procedures_ru_feprx0
+functions.phy_procedures_ru_feprx1
+functions.phy_procedures_eNb_rx_uespec0
+functions.phy_procedures_eNb_tx0
+functions.eNB_thread_rxtx1
+functions.phy_enb_prach_rx
+functions.phy_enb_rs_tx
+functions.phy_enb_pdcch_tx
+functions.nfapi_subframe
+functions.generate_pcfich
+functions.generate_dci0
+functions.pdcch_scrambling
+functions.pdcch_modulation
+functions.pdcch_interleaving
+functions.pdcch_tx
+functions.generate_dlsch
+functions.generate_phich
+functions.udp_enb_task
+functions.phy_procedures_ru_feptx_ofdm0
+functions.phy_procedures_ru_feptx_ofdm1
+functions.phy_procedures_ru_feptx_prec0
+functions.phy_procedures_ru_feptx_prec1
+functions.phy_enb_prach_rx
+[pattern_trace] 1
+[pattern_trace] 0
diff --git a/targets/RT/USER/rt_wrapper.c b/targets/RT/USER/rt_wrapper.c
index 8751e3c81646ed0c80be34785a9a20efd7c9219c..c1e5996d44375f4d40f3eeb433ebced1279810f9 100644
--- a/targets/RT/USER/rt_wrapper.c
+++ b/targets/RT/USER/rt_wrapper.c
@@ -345,6 +345,8 @@ void thread_top_init(char *thread_name,
     exit_fun("Error getting thread priority");
   }
 
+  pthread_setname_np(pthread_self(), thread_name);
+
   LOG_I(HW, "[SCHED][eNB] %s started on CPU %d, sched_policy = %s , priority = %d, CPU Affinity=%s \n",thread_name,sched_getcpu(),
                    (policy == SCHED_FIFO)  ? "SCHED_FIFO" :
                    (policy == SCHED_RR)    ? "SCHED_RR" :