Added attach request as a UL info trasnfer in the UE. Added interface to remove eps bearer map when going idle. Fixed bug in GW in assignment of IPv4 addresses. UE seems to rebound from the service reject now.

master
Pedro Alvarez 6 years ago committed by Andre Puschmann
parent 8a6c1ea826
commit 8f5ad55c4a

@ -129,14 +129,15 @@ public:
BARRING_MT,
BARRING_ALL
} barring_t;
virtual void leave_connected() = 0;
virtual void set_barring(barring_t barring) = 0;
virtual void paging(asn1::rrc::s_tmsi_s* ue_identiy) = 0;
virtual bool is_attached() = 0;
virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0;
virtual uint32_t get_k_enb_count() = 0;
virtual bool get_k_asme(uint8_t *k_asme_, uint32_t n) = 0;
virtual bool get_k_asme(uint8_t* k_asme_, uint32_t n) = 0;
virtual uint32_t get_ipv4_addr() = 0;
virtual bool get_ipv6_addr(uint8_t *ipv6_addr) = 0;
virtual bool get_ipv6_addr(uint8_t* ipv6_addr) = 0;
};
// NAS interface for UE

@ -54,14 +54,15 @@ public:
emm_state_t get_state();
// RRC interface
void leave_connected();
void paging(asn1::rrc::s_tmsi_s* ue_identiy);
void set_barring(barring_t barring);
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
uint32_t get_k_enb_count();
bool is_attached();
bool get_k_asme(uint8_t *k_asme_, uint32_t n);
bool get_k_asme(uint8_t* k_asme_, uint32_t n);
uint32_t get_ipv4_addr();
bool get_ipv6_addr(uint8_t *ipv6_addr);
bool get_ipv6_addr(uint8_t* ipv6_addr);
// UE interface
bool attach_request();

@ -1730,6 +1730,7 @@ void rrc::leave_connected()
drb_up = false;
security_is_activated = false;
measurements.reset();
nas->leave_connected();
pdcp->reset();
rlc->reset();
phy->reset();

@ -391,7 +391,7 @@ int gw::init_if(char* err_str)
// Delete link-local IPv6 address.
struct in6_addr in6p;
char addr_str[INET6_ADDRSTRLEN];
if(find_ipv6_addr(&in6p)){
if (find_ipv6_addr(&in6p)) {
log.debug("Found link-local IPv6 address: %s\n", inet_ntop(AF_INET6, &in6p, addr_str, INET6_ADDRSTRLEN));
del_ipv6_addr(&in6p);
} else {

@ -232,6 +232,10 @@ bool nas::detach_request() {
return false;
}
void nas::leave_connected() {
eps_bearer.clear();
return;
}
bool nas::is_attached() {
return state == EMM_STATE_REGISTERED;
@ -702,6 +706,7 @@ void nas::parse_attach_accept(uint32_t lcid, unique_byte_buffer_t pdu)
nas_log->warning("EMM Cause: %d\n", attach_accept.emm_cause );
}
if (LIBLTE_MME_PDN_TYPE_IPV4 == act_def_eps_bearer_context_req.pdn_addr.pdn_type) {
ip_addr = 0;
ip_addr |= act_def_eps_bearer_context_req.pdn_addr.addr[0] << 24;
ip_addr |= act_def_eps_bearer_context_req.pdn_addr.addr[1] << 16;
ip_addr |= act_def_eps_bearer_context_req.pdn_addr.addr[2] << 8;
@ -1077,7 +1082,7 @@ void nas::parse_service_reject(uint32_t lcid, unique_byte_buffer_t pdu)
LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT service_reject;
if (liblte_mme_unpack_service_reject_msg((LIBLTE_BYTE_MSG_STRUCT*)pdu.get(), &service_reject)) {
nas_log->error("Error unpacking service reject.\n");
goto exit;
return;
}
nas_log->console("Received service reject with EMM cause=0x%x.\n", service_reject.emm_cause);
@ -1088,8 +1093,18 @@ void nas::parse_service_reject(uint32_t lcid, unique_byte_buffer_t pdu)
// FIXME: handle NAS backoff-timers correctly
exit:
ctxt.rx_count++;
// Mark state as EMM-DEREGISTERED
state = EMM_STATE_DEREGISTERED;
// Reset security context
ctxt = {};
have_ctxt = false;
have_guti = false;
// Send attach request after receiving service reject
pdu->clear();
gen_attach_request(pdu.get());
rrc->write_sdu(std::move(pdu));
}
void nas::parse_esm_information_request(uint32_t lcid, unique_byte_buffer_t pdu)

Loading…
Cancel
Save