diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index d6f5a40da7d475a1f2a7d642819f987a627b3948..dbc90b34d97b7e317ad7ddbad53b6d96e6f323b0 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -62,10 +62,12 @@
 #endif
 
 
+#if defined(FLEXRAN_AGENT_SB_IF)
 //Agent-related headers
 #include "ENB_APP/flexran_agent_extern.h"
 #include "ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h"
 #include "LAYER2/MAC/flexran_agent_mac_proto.h"
+#endif
 
 //#define DIAG_PHY
 
@@ -1369,11 +1371,13 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
     eNB->dlsch_ra->active = 0;
   }
 
+#if defined(FLEXRAN_AGENT_SB_IF)
 #ifndef DISABLE_SF_TRIGGER
   //Send subframe trigger to the controller
   if (mac_agent_registered[eNB->Mod_id]) {
     agent_mac_xface[eNB->Mod_id]->flexran_agent_send_sf_trigger(eNB->Mod_id);
   }
+#endif
 #endif
 
   // Now scan UE specific DLSCH
diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c
index 386efec59682f5c3f9d6d9b767b9a34d2718f5d4..c5dc8c88b04465ab71f69033ae2cd83cdb753acb 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler.c
@@ -52,10 +52,12 @@
 //#include "LAYER2/MAC/pre_processor.c"
 #include "pdcp.h"
 
+#if defined(FLEXRAN_AGENT_SB_IF)
 //Agent-related headers
 #include "flexran_agent_extern.h"
 #include "flexran_agent_mac.h"
 #include "flexran_agent_mac_proto.h"
+#endif
 
 #if defined(ENABLE_ITTI)
 # include "intertask_interface.h"
@@ -103,7 +105,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
   void         *DLSCH_dci=NULL;
   int size_bits=0,size_bytes=0;
 
+#if defined(FLEXRAN_AGENT_SB_IF)
   Protocol__FlexranMessage *msg;
+#endif
 
   LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
 
@@ -137,14 +141,17 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
 
     eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].cqi_req_timer++;
     
+
     if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) {
 	//mac_remove_ue(module_idP, i, frameP, subframeP);
       //Inform the controller about the UE deactivation. Should be moved to RRC agent in the future
+#if defined(FLEXRAN_AGENT_SB_IF)
       if (mac_agent_registered[module_idP]) {
 	agent_mac_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP,
 									  rnti,
 									  PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
       }
+#endif
     }
     else {
       // check uplink failure
@@ -1081,11 +1088,13 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
   for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
     allocate_CCEs(module_idP,CC_id,subframeP,0);
 
+#if defined(FLEXRAN_AGENT_SB_IF)
 #ifndef DISABLE_CONT_STATS
   //Send subframe trigger to the controller
   if (mac_agent_registered[module_idP]) {
     agent_mac_xface[module_idP]->flexran_agent_send_update_mac_stats(module_idP);
   }
+#endif
 #endif
 
   /*
diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c
index 3f8e7c5f8378c54784c119c1d370e9f29890afee..2ce94ba26c26cbe033a1a485f51f24e21f9fa673 100644
--- a/openair2/RRC/LITE/rrc_eNB.c
+++ b/openair2/RRC/LITE/rrc_eNB.c
@@ -93,7 +93,9 @@
 
 #include "SIMULATION/TOOLS/defs.h" // for taus
 
+#if defined(FLEXRAN_AGENT_SB_IF)
 #include "flexran_agent_extern.h"
+#endif
 #define XER_PRINT
 
 #ifdef PHY_EMUL
@@ -4541,12 +4543,14 @@ rrc_eNB_decode_dcch(
           ue_context_p,
 	  ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
 
+#if defined(FLEXRAN_AGENT_SB_IF)
 	//WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future
 	if (mac_agent_registered[ctxt_pP->module_id]) {
 	  agent_mac_xface[ctxt_pP->eNB_index]->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
 										ue_context_p->ue_id_rnti,
 										PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_UPDATED);
 	}
+#endif
       }
 #if defined(ENABLE_ITTI)
 #   if defined(ENABLE_USE_MME)
@@ -4642,12 +4646,15 @@ rrc_eNB_decode_dcch(
           ue_context_p->ue_context.Status = RRC_CONNECTED;
           LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_CONNECTED \n",
                 PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
+	  
+#if defined(FLEXRAN_AGENT_SB_IF)
 	  //WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future
 	  if (mac_agent_registered[ctxt_pP->module_id]) {
 	    agent_mac_xface[ctxt_pP->eNB_index]->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
 										  ue_context_p->ue_id_rnti,
 										  PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED);
 	  }
+#endif
         }
       }