diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index 147621b03bb0249b4e3048f7a8fd65a4d0b1bb4a..115eb04c377b273502c1ca8a2fd7cf3f9f0e80e6 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -2100,11 +2100,16 @@ endforeach()
 # force castxml and clang compilation with gnu89 standard
 # we can't use cXX standard as pthread_rwlock_t is gnu standard
 list(APPEND itti_compiler_options "-std=gnu89")
-
 set (ITTI_H ${ITTI_DIR}/intertask_interface_types.h)
+if(EXISTS /usr/bin/gccxml)
+   set(xml_command gccxml ${itti_compiler_options} -fxml=${OPENAIR_BIN_DIR}/messages.xml ${ITTI_H})
+else()
+   set(xml_command castxml --castxml-gccxml ${itti_compiler_options} ${ITTI_H} -o ${OPENAIR_BIN_DIR}/messages.xml)
+endif()
+
 add_custom_command (
   OUTPUT ${OPENAIR_BIN_DIR}/messages.xml
-  COMMAND gccxml ${itti_compiler_options} -fxml=${OPENAIR_BIN_DIR}/messages.xml ${ITTI_H}
+  COMMAND ${xml_command}
   DEPENDS ${S1AP_OAI_generated} ${RRC_FULL_DIR}/asn1_constants.h
   )
 
diff --git a/openair2/NAS/DRIVER/CELLULAR/NASMT/nasmt_device.c b/openair2/NAS/DRIVER/CELLULAR/NASMT/nasmt_device.c
index 7a8bd0f86788e94e7dccc31c20098806fa9c8710..77b3c28165f879f182c6204398cd3e0685fe1ca7 100644
--- a/openair2/NAS/DRIVER/CELLULAR/NASMT/nasmt_device.c
+++ b/openair2/NAS/DRIVER/CELLULAR/NASMT/nasmt_device.c
@@ -233,9 +233,12 @@ int nasmt_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
   }
 
   // End debug information
-
   netif_stop_queue(dev);
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+  netif_trans_update(dev);
+#else
   dev->trans_start = jiffies;
+#endif
 #ifdef NAS_DEBUG_SEND_DETAIL
   printk("nasmt_hard_start_xmit: step 1\n");
 #endif
@@ -307,7 +310,11 @@ void nasmt_tx_timeout(struct net_device *dev)
   printk("nasmt_tx_timeout: begin\n");
   //((struct nas_priv *)(dev->priv))->stats.tx_errors++;
   (gpriv->stats).tx_errors++;
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+  netif_trans_update(dev);
+#else
   dev->trans_start = jiffies;
+#endif
   netif_wake_queue(dev);
   printk("nasmt_tx_timeout: transmit timed out %s\n",dev->name);
 }
diff --git a/openair2/NAS/DRIVER/CELLULAR/NASRG/nasrg_device.c b/openair2/NAS/DRIVER/CELLULAR/NASRG/nasrg_device.c
index aaaa95754dcabe873ad8aea0e2a4fcbf18d52b77..970600de214357157b9546eec561d02a846de770 100644
--- a/openair2/NAS/DRIVER/CELLULAR/NASRG/nasrg_device.c
+++ b/openair2/NAS/DRIVER/CELLULAR/NASRG/nasrg_device.c
@@ -226,7 +226,11 @@ int nasrg_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
   // End debug information
   netif_stop_queue(dev);
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+  netif_trans_update(dev);
+#else
   dev->trans_start = jiffies;
+#endif
 #ifdef NAS_DEBUG_SEND_DETAIL
   printk("nasrg_hard_start_xmit: step 1\n");
 #endif
@@ -296,7 +300,11 @@ void nasrg_tx_timeout(struct net_device *dev)
   printk("nasrg_tx_timeout: begin\n");
   //  ((struct nas_priv *)(dev->priv))->stats.tx_errors++;
   (gpriv->stats).tx_errors++;
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+  netif_trans_update(dev);
+#else
   dev->trans_start = jiffies;
+#endif
   netif_wake_queue(dev);
   printk("nasrg_tx_timeout: transmit timed out %s\n",dev->name);
 }
diff --git a/openair2/NETWORK_DRIVER/LITE/device.c b/openair2/NETWORK_DRIVER/LITE/device.c
index 9579ebf249cecd5665a10c8493b4a96c45c4ab6a..616af5e14550c47e52f38c91b292ff64806bcab8 100644
--- a/openair2/NETWORK_DRIVER/LITE/device.c
+++ b/openair2/NETWORK_DRIVER/LITE/device.c
@@ -255,7 +255,11 @@ int oai_nw_drv_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
     // End debug information
     netif_stop_queue(dev);
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+    netif_trans_update(dev);
+#else
     dev->trans_start = jiffies;
+#endif
 #ifdef OAI_DRV_DEBUG_DEVICE
     printk("[OAI_IP_DRV][%s] step 1\n", __FUNCTION__);
 #endif
@@ -328,7 +332,11 @@ void oai_nw_drv_tx_timeout(struct net_device *dev)
   printk("[OAI_IP_DRV][%s] begin\n", __FUNCTION__);
   //  (struct oai_nw_drv_priv *)(dev->priv)->stats.tx_errors++;
   (priv->stats).tx_errors++;
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+  netif_trans_update(dev);
+#else
   dev->trans_start = jiffies;
+#endif
   netif_wake_queue(dev);
   printk("[OAI_IP_DRV][%s] transmit timed out %s\n", __FUNCTION__,dev->name);
 }
diff --git a/openair2/NETWORK_DRIVER/MESH/classifier.c b/openair2/NETWORK_DRIVER/MESH/classifier.c
index a982faac46b04266fd3cd94ed1b32b7e104b76ce..d477ba3ea907bd67ac9366e20c875871aa5b7058 100644
--- a/openair2/NETWORK_DRIVER/MESH/classifier.c
+++ b/openair2/NETWORK_DRIVER/MESH/classifier.c
@@ -790,7 +790,7 @@ void nas_CLASS_send(struct sk_buff *skb,int inst)
              dscp, sprotocol, sp->classref, sfct, sp->rab_id);
 #endif
 
-      sp->fct(skb, cx, sp,inst);
+      sp->fct(skb, cx, sp,inst, NULL);
 
     } // if classifier entry match found
 
@@ -808,7 +808,7 @@ void nas_CLASS_send(struct sk_buff *skb,int inst)
   if (no_connection == 1)
     printk("NAS_CLASS_SEND: no corresponding connection, so the message is dropped\n");
 
-#endif NAS_DEBUG_CLASS
+#endif /* NAS_DEBUG_CLASS */
 
 
   //  }   // while loop over connections
diff --git a/openair2/NETWORK_DRIVER/MESH/common.c b/openair2/NETWORK_DRIVER/MESH/common.c
index 0a4e3ddfed975167f8ca74180707c8e8b3e61de6..6d10abd3801f64f5b55297f9942a9835c224d80e 100644
--- a/openair2/NETWORK_DRIVER/MESH/common.c
+++ b/openair2/NETWORK_DRIVER/MESH/common.c
@@ -321,10 +321,9 @@ void nas_COMMON_receive(uint16_t dlen,
 
 //---------------------------------------------------------------------------
 // Delete the data
-void nas_COMMON_del_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *sp,int inst)
+void nas_COMMON_del_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *sp,int inst,struct nas_priv *gpriv)
 {
   struct nas_priv *priv=netdev_priv(nasdev[inst]);
-
   //---------------------------------------------------------------------------
   ++priv->stats.tx_dropped;
 }
@@ -332,7 +331,7 @@ void nas_COMMON_del_send(struct sk_buff *skb, struct cx_entity *cx, struct class
 //---------------------------------------------------------------------------
 // Request the transfer of data (QoS SAP)
 
-void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst)
+void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst, struct nas_priv *gpriv)
 {
   //---------------------------------------------------------------------------
   struct pdcp_data_req_header_s     pdcph;
diff --git a/openair2/NETWORK_DRIVER/MESH/device.c b/openair2/NETWORK_DRIVER/MESH/device.c
index f28b41fc6889ef0e531c9eed210e51261c55a7fe..393fe9f9e01fe3ffd4fe863a7b693ab5d309e4f8 100644
--- a/openair2/NETWORK_DRIVER/MESH/device.c
+++ b/openair2/NETWORK_DRIVER/MESH/device.c
@@ -124,11 +124,8 @@ void *nas_interrupt(void)
 int nas_open(struct net_device *dev)
 {
   //---------------------------------------------------------------------------
-  struct nas_priv *priv=netdev_priv(dev);
-
   printk("OPEN: begin\n");
   //  MOD_INC_USE_COUNT;
-
   // Address has already been set at init
 #ifndef PDCP_USE_NETLINK
 
@@ -250,7 +247,11 @@ int nas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
     // End debug information
     netif_stop_queue(dev);
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+    netif_trans_update(dev);
+#else
     dev->trans_start = jiffies;
+#endif
 #ifdef DEBUG_DEVICE
     printk("HARD_START_XMIT: step 1\n");
 #endif
@@ -311,7 +312,11 @@ void nas_tx_timeout(struct net_device *dev)
   printk("TX_TIMEOUT: begin\n");
   //  (struct nas_priv *)(dev->priv)->stats.tx_errors++;
   (priv->stats).tx_errors++;
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+  netif_trans_update(dev);
+#else
   dev->trans_start = jiffies;
+#endif
   netif_wake_queue(dev);
   printk("TX_TIMEOUT: transmit timed out %s\n",dev->name);
 }
@@ -406,8 +411,8 @@ void nas_init(struct net_device *dev)
     nas_TOOL_imei2iid(IMEI, dev->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
     nas_TOOL_imei2iid(IMEI, (uint8_t *)priv->cx[0].iid6);
 #else
-    nas_TOOL_imei2iid(nas_IMEI, dev->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
-    nas_TOOL_imei2iid(nas_IMEI, (uint8_t *)priv->cx[0].iid6);
+    nas_TOOL_imei2iid((uint8_t *)nas_IMEI, dev->dev_addr); // IMEI to device address (for stateless autoconfiguration address)
+    nas_TOOL_imei2iid((uint8_t *)nas_IMEI, (uint8_t *)priv->cx[0].iid6);
 #endif
     // this is more appropriate for user space soft realtime emulation
 #else
@@ -478,8 +483,8 @@ int init_module (void)
     if (nasdev[inst]) {
       nas_mesh_init(inst);
       //memcpy(nasdev[inst]->dev_addr,&nas_IMEI[0],8);
-      nas_TOOL_imei2iid(nas_IMEI, nasdev[inst]->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
-      nas_TOOL_imei2iid(nas_IMEI, (uint8_t *)priv->cx[0].iid6);
+      nas_TOOL_imei2iid((uint8_t *)nas_IMEI, nasdev[inst]->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
+      nas_TOOL_imei2iid((uint8_t *)nas_IMEI, (uint8_t *)priv->cx[0].iid6);
       // TO HAVE DIFFERENT HW @
       ((unsigned char*)nasdev[inst]->dev_addr)[7] = ((unsigned char*)nasdev[inst]->dev_addr)[7] + (unsigned char)inst + 1;
       printk("Setting HW addr for INST %d to : %X%X\n",inst,*((unsigned int *)&nasdev[inst]->dev_addr[0]),*((unsigned int *)&nasdev[inst]->dev_addr[4]));
diff --git a/openair2/NETWORK_DRIVER/MESH/ioctl.c b/openair2/NETWORK_DRIVER/MESH/ioctl.c
index 7d4bb10b1f841dc50c2be8d2bf065760d66a3cf7..4045908d93c372fc60bc7bb214eb0f40c6ea5d7e 100644
--- a/openair2/NETWORK_DRIVER/MESH/ioctl.c
+++ b/openair2/NETWORK_DRIVER/MESH/ioctl.c
@@ -853,7 +853,7 @@ int nas_CTL_ioctl(struct net_device *dev,
 //---------------------------------------------------------------------------
 void nas_CTL_send(struct sk_buff *skb,
                   struct cx_entity *cx,
-                  struct classifier_entity *gc)
+                  struct classifier_entity *gc, int inst, struct nas_priv *gpriv)
 {
   //---------------------------------------------------------------------------
   printk("NAS_CTL_SEND - void \n");
diff --git a/openair2/NETWORK_DRIVER/MESH/local.h b/openair2/NETWORK_DRIVER/MESH/local.h
index 8db2b550b0defecb5d42fb671f94818174f102b1..0e0a581cbc9590a0cda18fe29caba28a9e91e5b5 100644
--- a/openair2/NETWORK_DRIVER/MESH/local.h
+++ b/openair2/NETWORK_DRIVER/MESH/local.h
@@ -98,6 +98,26 @@ struct cx_entity {
   int provider_id[MAX_MEASURE_NB];
 
 };
+//#define NAS_RETRY_LIMIT_DEFAULT 5
+
+struct nas_priv {
+  int irq;
+  struct timer_list timer;
+  spinlock_t lock;
+  struct net_device_stats stats;
+  uint8_t retry_limit;
+  uint32_t timer_establishment;
+  uint32_t timer_release;
+  struct cx_entity cx[NAS_CX_MAX];
+  struct classifier_entity *rclassifier[NAS_DSCP_MAX]; // receive classifier
+  uint16_t nrclassifier;
+  int sap[NAS_SAPI_MAX];
+  struct sock *nl_sk;
+  uint8_t nlmsg[NAS_MAX_LENGTH+sizeof(struct nlmsghdr)];
+  uint8_t xbuffer[NAS_MAX_LENGTH]; // transmition buffer
+  uint8_t rbuffer[NAS_MAX_LENGTH]; // reception buffer
+};
+
 
 struct classifier_entity {
   uint32_t classref;
@@ -122,29 +142,7 @@ struct classifier_entity {
   struct rb_entity *rb_rx;   //pointer to rb_entity for receiving (in case of forwarding rule)
   nasRadioBearerId_t rab_id;            // RAB identification for sending
   nasRadioBearerId_t rab_id_rx;   // RAB identification for receiving (in case of forwarding rule)
-  void (*fct)(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst);
-};
-
-
-
-//#define NAS_RETRY_LIMIT_DEFAULT 5
-
-struct nas_priv {
-  int irq;
-  struct timer_list timer;
-  spinlock_t lock;
-  struct net_device_stats stats;
-  uint8_t retry_limit;
-  uint32_t timer_establishment;
-  uint32_t timer_release;
-  struct cx_entity cx[NAS_CX_MAX];
-  struct classifier_entity *rclassifier[NAS_DSCP_MAX]; // receive classifier
-  uint16_t nrclassifier;
-  int sap[NAS_SAPI_MAX];
-  struct sock *nl_sk;
-  uint8_t nlmsg[NAS_MAX_LENGTH+sizeof(struct nlmsghdr)];
-  uint8_t xbuffer[NAS_MAX_LENGTH]; // transmition buffer
-  uint8_t rbuffer[NAS_MAX_LENGTH]; // reception buffer
+  void (*fct)(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst, struct nas_priv *gpriv);
 };
 
 struct ipversion {
diff --git a/openair2/NETWORK_DRIVER/MESH/mesh.c b/openair2/NETWORK_DRIVER/MESH/mesh.c
index e934a6eb9501e60114d7d4112faf9c795d7d32ed..9817428c5e98d922d3618f46947239a15d60a858 100644
--- a/openair2/NETWORK_DRIVER/MESH/mesh.c
+++ b/openair2/NETWORK_DRIVER/MESH/mesh.c
@@ -155,9 +155,10 @@ void nas_mesh_start_default_sclassifier(struct cx_entity *cx,struct rb_entity *r
 }
 
 //---------------------------------------------------------------------------
-void nas_mesh_timer(unsigned long data,struct nas_priv *gpriv)
+void nas_mesh_timer(unsigned long data)
 {
   //---------------------------------------------------------------------------
+  struct nas_priv *gpriv=(struct nas_priv *) data;
   uint8_t cxi;
   struct cx_entity *cx;
   struct rb_entity *rb;
@@ -168,7 +169,7 @@ void nas_mesh_timer(unsigned long data,struct nas_priv *gpriv)
 
   (gpriv->timer).function=nas_mesh_timer;
   (gpriv->timer).expires=jiffies+NAS_TIMER_TICK;
-  (gpriv->timer).data=0L;
+  (gpriv->timer).data=data;
 
   return;
 
@@ -381,6 +382,7 @@ int nas_mesh_DC_send_cx_release_request(struct cx_entity *cx,
 void nas_mesh_DC_send_sig_data_request(struct sk_buff *skb,
                                        struct cx_entity *cx,
                                        struct classifier_entity *gc,
+                                       int inst,
                                        struct nas_priv *gpriv)
 {
   //---------------------------------------------------------------------------
diff --git a/openair2/NETWORK_DRIVER/MESH/proto_extern.h b/openair2/NETWORK_DRIVER/MESH/proto_extern.h
index 4c0b89f60fdec3c67ea3b3e97a4af6c8e73273ea..a362876f834fa8227619063bb0f54c0d93e004f9 100644
--- a/openair2/NETWORK_DRIVER/MESH/proto_extern.h
+++ b/openair2/NETWORK_DRIVER/MESH/proto_extern.h
@@ -96,7 +96,7 @@ void nas_COMMON_receive(unsigned short dlen,
  */
 void nas_COMMON_QOS_send(struct sk_buff *skb,
                          struct cx_entity *cx,
-                         struct classifier_entity *gc,int inst);
+                         struct classifier_entity *gc,int inst, struct nas_priv *gpriv);
 
 /**
 \fn void nas_COMMON_del_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst)
@@ -108,7 +108,7 @@ void nas_COMMON_QOS_send(struct sk_buff *skb,
  */
 void nas_COMMON_del_send(struct sk_buff *skb,
                          struct cx_entity *cx,
-                         struct classifier_entity *gc,int inst);
+                         struct classifier_entity *gc,int inst, struct nas_priv *gpriv);
 
 #ifndef PDCP_USE_NETLINK
 /**
@@ -195,19 +195,18 @@ void nas_mesh_init(int inst   //!< Instance ID
 
                   );
 
-void nas_mesh_timer(unsigned long data,
-                    struct nas_priv *gpriv);
+void nas_mesh_timer(unsigned long data);
 
 int  nas_mesh_DC_receive(struct cx_entity *cx,struct nas_priv *gpriv);
 int  nas_mesh_GC_receive(struct nas_priv *gpriv);
 int  nas_mesh_DC_send_cx_establish_request(struct cx_entity *cx,struct nas_priv *gpriv);
 int  nas_mesh_DC_send_cx_release_request(struct cx_entity *cx,struct nas_priv *gpriv);
-void nas_mesh_DC_send_sig_data_request(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,struct nas_priv *gpriv);
+void nas_mesh_DC_send_sig_data_request(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst, struct nas_priv *gpriv);
 
 // iocontrol.c
 void nas_CTL_send(struct sk_buff *skb,
                   struct cx_entity *cx,
-                  struct classifier_entity *gc);
+                  struct classifier_entity *gc,int inst, struct nas_priv *gpriv);
 //int nas_CTL_receive_authentication(struct ipv6hdr *iph, struct cx-entity *cx, unsigned char sapi);
 int nas_CTL_ioctl(struct net_device *dev,
                   struct ifreq *ifr, int cmd);
diff --git a/openair2/NETWORK_DRIVER/UE_IP/common.c b/openair2/NETWORK_DRIVER/UE_IP/common.c
index 1ea5df0d30c9600b0b3e9009639096350fe6d61c..8c3e4557d36d109efcf7198a41a033a906897108 100644
--- a/openair2/NETWORK_DRIVER/UE_IP/common.c
+++ b/openair2/NETWORK_DRIVER/UE_IP/common.c
@@ -123,9 +123,7 @@ skb_p->mark = rb_idP;
 
   // LG TEST skb_p->ip_summed = CHECKSUM_NONE;
   skb_p->ip_summed = CHECKSUM_UNNECESSARY;
-
-
-  ipv_p = (struct ipversion*)((void*)&(skb_p->data[hard_header_len]));
+  ipv_p = (ipversion_t *)((void *)&(skb_p->data[hard_header_len]));
 
   switch (ipv_p->version) {
 
diff --git a/openair2/NETWORK_DRIVER/UE_IP/device.c b/openair2/NETWORK_DRIVER/UE_IP/device.c
index cfd734286222ceeade640147df282ac8a8c32ab5..a4f714d4c5537218896398f5fd6d92dbee44a12e 100644
--- a/openair2/NETWORK_DRIVER/UE_IP/device.c
+++ b/openair2/NETWORK_DRIVER/UE_IP/device.c
@@ -243,7 +243,11 @@ int ue_ip_hard_start_xmit(struct sk_buff *skb_pP, struct net_device *dev_pP)
 
     // End debug information
     netif_stop_queue(dev_pP);
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+    netif_trans_update(dev_pP);
+#else
     dev_pP->trans_start = jiffies;
+#endif
 #ifdef OAI_DRV_DEBUG_DEVICE
     printk("[UE_IP_DRV][%s] step 1\n", __FUNCTION__);
 #endif
@@ -315,7 +319,11 @@ void ue_ip_tx_timeout(struct net_device *dev_pP)
   printk("[UE_IP_DRV][%s] begin\n", __FUNCTION__);
   //  (ue_ip_priv_t *)(dev_pP->priv_p)->stats.tx_errors++;
   (priv_p->stats).tx_errors++;
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+  netif_trans_update(dev_pP);
+#else
   dev_pP->trans_start = jiffies;
+#endif
   netif_wake_queue(dev_pP);
   printk("[UE_IP_DRV][%s] transmit timed out %s\n", __FUNCTION__,dev_pP->name);
 }