This commit is contained in:
Manuel Requena
2012-06-19 14:02:09 +02:00
2 changed files with 108 additions and 22 deletions

View File

@@ -17,23 +17,23 @@
*
* Author: Nicola Baldo <nbaldo@cttc.es>
* Marco Miozzo <mmiozzo@cttc.es>
* Manuel Requena <manuel.requena@cttc.es>
*/
#include <ns3/fatal-error.h>
#include <ns3/log.h>
#include <ns3/abort.h>
#include "ns3/fatal-error.h"
#include "ns3/log.h"
#include "ns3/abort.h"
#include "ns3/pointer.h"
#include "ns3/object-map.h"
#include "ns3/object-factory.h"
#include "lte-enb-rrc.h"
#include "lte-rlc.h"
#include "lte-pdcp.h"
#include "lte-pdcp-sap.h"
#include "lte-radio-bearer-info.h"
#include "lte-radio-bearer-tag.h"
#include "ns3/object-map.h"
#include <ns3/ff-mac-csched-sap.h>
#include "ns3/lte-enb-rrc.h"
#include "ns3/lte-rlc.h"
#include "ns3/lte-pdcp.h"
#include "ns3/lte-pdcp-sap.h"
#include "ns3/lte-radio-bearer-info.h"
#include "ns3/lte-radio-bearer-tag.h"
#include "ns3/ff-mac-csched-sap.h"
// WILD HACK for UE-RRC direct communications
#include <ns3/node-list.h>
@@ -209,7 +209,8 @@ UeInfo::RemoveRadioBearer (uint8_t lcid)
NS_OBJECT_ENSURE_REGISTERED (LteEnbRrc);
LteEnbRrc::LteEnbRrc ()
: m_cmacSapProvider (0),
: m_x2SapProvider (0),
m_cmacSapProvider (0),
m_ffMacSchedSapProvider (0),
m_macSapProvider (0),
m_configured (false),
@@ -218,6 +219,7 @@ LteEnbRrc::LteEnbRrc ()
NS_LOG_FUNCTION (this);
m_cmacSapUser = new EnbRrcMemberLteEnbCmacSapUser (this);
m_pdcpSapUser = new LtePdcpSpecificLtePdcpSapUser<LteEnbRrc> (this);
m_x2SapUser = new EpcX2SpecificEpcX2SapUser<LteEnbRrc> (this);
}
@@ -233,6 +235,7 @@ LteEnbRrc::DoDispose ()
NS_LOG_FUNCTION (this);
delete m_cmacSapUser;
delete m_pdcpSapUser;
delete m_x2SapUser;
}
TypeId
@@ -282,6 +285,21 @@ LteEnbRrc::SetLastAllocatedRnti (uint16_t lastAllocatedRnti)
void
LteEnbRrc::SetEpcX2SapProvider (EpcX2SapProvider * s)
{
NS_LOG_FUNCTION (this << s);
m_x2SapProvider = s;
}
EpcX2SapUser*
LteEnbRrc::GetEpcX2SapUser ()
{
NS_LOG_FUNCTION (this);
return m_x2SapUser;
}
void
LteEnbRrc::SetLteEnbCmacSapProvider (LteEnbCmacSapProvider * s)
{
@@ -434,6 +452,50 @@ LteEnbRrc::SetForwardUpCallback (Callback <void, Ptr<Packet> > cb)
}
//
// User API
//
void
LteEnbRrc::SendHandoverRequest (Ptr<Node> ueNode, Ptr<Node> sourceEnbNode, Ptr<Node> targetEnbNode)
{
NS_LOG_FUNCTION (this << ueNode << sourceEnbNode << targetEnbNode);
NS_LOG_INFO ("Request to send HANDOVER REQUEST");
EpcX2SapProvider::HandoverRequestParams params;
params.ueNode = ueNode;
params.sourceEnbNode = sourceEnbNode;
params.targetEnbNode = targetEnbNode;
m_x2SapProvider->SendHandoverRequest (params);
}
//
// X2-User SAP
//
void
LteEnbRrc::DoRecvHandoverRequest (EpcX2SapUser::HandoverRequestParams params)
{
NS_LOG_FUNCTION (this);
NS_LOG_INFO ("Recv X2 message: HANDOVER REQUEST");
NS_LOG_INFO ("Send X2 message: HANDOVER REQUEST ACK");
EpcX2SapProvider::HandoverRequestAckParams ackParams;
m_x2SapProvider->SendHandoverRequestAck (ackParams);
}
void
LteEnbRrc::DoRecvHandoverRequestAck (EpcX2SapUser::HandoverRequestAckParams params)
{
NS_LOG_FUNCTION (this);
NS_LOG_INFO ("Recv X2 message: HANDOVER REQUEST ACK");
}
void
LteEnbRrc::DoReceiveRrcPdu (LtePdcpSapUser::ReceiveRrcPduParameters params)
{

View File

@@ -16,26 +16,25 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Nicola Baldo <nbaldo@cttc.es>
* Manuel Requena <manuel.requena@cttc.es>
*/
#ifndef LTE_ENB_RRC_H
#define LTE_ENB_RRC_H
#include <ns3/object.h>
#include <ns3/packet.h>
#include <ns3/lte-enb-cmac-sap.h>
#include <ns3/ff-mac-common.h>
#include <ns3/lte-pdcp-sap.h>
#include "ns3/object.h"
#include "ns3/packet.h"
#include "ns3/lte-enb-cmac-sap.h"
#include "ns3/lte-mac-sap.h"
#include "ns3/ff-mac-sched-sap.h"
#include "ns3/lte-pdcp-sap.h"
#include "ns3/epc-x2-sap.h"
#include <map>
namespace ns3 {
class FfMacSchedSapProvider;
class LteMacSapProvider;
class LteRadioBearerInfo;
class LtePdcpSapUser;
class LtePdcpSapProvider;
/**
@@ -97,6 +96,8 @@ class LteEnbRrc : public Object
friend class EnbRrcMemberLteEnbCmacSapUser;
friend class LtePdcpSpecificLtePdcpSapUser<LteEnbRrc>;
friend class EpcX2SpecificEpcX2SapUser<LteEnbRrc>;
public:
/**
* create an RRC instance for use within an eNB
@@ -115,6 +116,19 @@ public:
static TypeId GetTypeId (void);
/**
* Set the X2 SAP this RRC should interact with
* \param s the X2 SAP Provider to be used by this RRC entity
*/
void SetEpcX2SapProvider (EpcX2SapProvider* s);
/**
* Get the X2 SAP offered by this RRC
* \return s the X2 SAP User interface offered to the X2 entity by this RRC entity
*/
EpcX2SapUser* GetEpcX2SapUser ();
/**
* set the CMAC SAP this RRC should interact with
*
@@ -217,9 +231,16 @@ public:
* \param cb
*/
void SetForwardUpCallback (Callback <void, Ptr<Packet> > cb);
/**
* Send a HandoverRequest through the X2 SAP interface
*/
void SendHandoverRequest (Ptr<Node> ueNode, Ptr<Node> sourceEnbNode, Ptr<Node> targetEnbNode);
private:
void DoRecvHandoverRequest (EpcX2SapUser::HandoverRequestParams params);
void DoRecvHandoverRequestAck (EpcX2SapUser::HandoverRequestAckParams params);
void DoReceiveRrcPdu (LtePdcpSapUser::ReceiveRrcPduParameters params);
void DoRrcConfigurationUpdateInd (LteUeConfig_t params);
@@ -234,6 +255,9 @@ private:
Callback <void, Ptr<Packet> > m_forwardUpCallback;
EpcX2SapUser* m_x2SapUser;
EpcX2SapProvider* m_x2SapProvider;
LteEnbCmacSapUser* m_cmacSapUser;
LteEnbCmacSapProvider* m_cmacSapProvider;