This commit is contained in:
mmiozzo
2012-12-13 18:46:05 +01:00
6 changed files with 29 additions and 4 deletions

View File

@@ -216,7 +216,7 @@ EpcUeNas::DoRecvData (Ptr<Packet> packet)
void
EpcUeNas::DoNotifyConnectionReleased ()
{
NS_FATAL_ERROR ("connection failed, it should not happen with the current model");
NS_LOG_FUNCTION (this);
}
void

View File

@@ -1097,6 +1097,11 @@ LteEnbRrc::GetTypeId (void)
BooleanValue (true),
MakeBooleanAccessor (&LteEnbRrc::m_admitHandoverRequest),
MakeBooleanChecker ())
.AddAttribute ("AdmitRrcConnectionRequest",
"Whether to admit a connection request from a Ue",
BooleanValue (true),
MakeBooleanAccessor (&LteEnbRrc::m_admitRrcConnectionRequest),
MakeBooleanChecker ())
.AddTraceSource ("ConnectionEstablished",
"trace fired upon successful RRC connection establishment",
MakeTraceSourceAccessor (&LteEnbRrc::m_connectionEstablishedTrace))
@@ -1273,7 +1278,18 @@ void
LteEnbRrc::DoRecvRrcConnectionRequest (uint16_t rnti, LteRrcSap::RrcConnectionRequest msg)
{
NS_LOG_FUNCTION (this << rnti);
GetUeManager (rnti)->RecvRrcConnectionRequest (msg);
if (m_admitRrcConnectionRequest == true)
{
GetUeManager (rnti)->RecvRrcConnectionRequest (msg);
}
else
{
NS_LOG_INFO ("rejecting connection request to rnti " << rnti);
LteRrcSap::RrcConnectionReject rejectMsg;
rejectMsg.waitTime = 3;
m_rrcSapUser->SendRrcConnectionReject (rnti, rejectMsg);
}
}
void

View File

@@ -574,6 +574,7 @@ public:
RLC_UM_ALWAYS = 2,
RLC_AM_ALWAYS = 3,
PER_BASED = 4};
private:
@@ -725,6 +726,7 @@ private:
bool m_reconfigureUes;
bool m_admitHandoverRequest;
bool m_admitRrcConnectionRequest;
// imsi cellid rnti
TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionEstablishedTrace;

View File

@@ -288,11 +288,13 @@ LteUeRrcProtocolReal::DoReceivePdcpPdu (Ptr<Packet> p)
RrcConnectionReestablishmentHeader rrcConnectionReestablishmentHeader;
RrcConnectionReestablishmentRejectHeader rrcConnectionReestablishmentRejectHeader;
RrcConnectionSetupHeader rrcConnectionSetupHeader;
RrcConnectionRejectHeader rrcConnectionRejectHeader;
// Declare possible messages
LteRrcSap::RrcConnectionReestablishment rrcConnectionReestablishmentMsg;
LteRrcSap::RrcConnectionReestablishmentReject rrcConnectionReestablishmentRejectMsg;
LteRrcSap::RrcConnectionSetup rrcConnectionSetupMsg;
LteRrcSap::RrcConnectionReject rrcConnectionRejectMsg;
// Deserialize packet and call member recv function with appropiate structure
switch ( rrcDlCcchMessage.GetMessageType () )
@@ -311,7 +313,9 @@ LteUeRrcProtocolReal::DoReceivePdcpPdu (Ptr<Packet> p)
break;
case 2:
// RrcConnectionReject
// ...
p->RemoveHeader (rrcConnectionReestablishmentRejectHeader);
rrcConnectionReestablishmentRejectMsg = rrcConnectionReestablishmentRejectHeader.GetMessage ();
m_ueRrcSapProvider->RecvRrcConnectionReject (rrcConnectionRejectMsg);
break;
case 3:
// RrcConnectionSetup

View File

@@ -99,7 +99,8 @@ const char* g_ueRrcStateName[LteUeRrc::NUM_STATES] =
"IDLE_CONNECTING",
"CONNECTED_NORMALLY",
"CONNECTED_REESTABLISHING",
"CONNECTED_HANDOVER"
"CONNECTED_HANDOVER",
"OFF"
};
std::string ToString (LteUeRrc::State s)
@@ -693,6 +694,7 @@ void
LteUeRrc::DoRecvRrcConnectionReject (LteRrcSap::RrcConnectionReject msg)
{
NS_LOG_FUNCTION (this);
SwitchToState (OFF);
}

View File

@@ -72,6 +72,7 @@ public:
CONNECTED_NORMALLY,
CONNECTED_REESTABLISHING,
CONNECTED_HANDOVER,
OFF,
NUM_STATES
};