add basic NAS configuration class

This commit is contained in:
Andre Puschmann 2017-08-07 13:17:11 +02:00
parent c58d2a4689
commit c474b24d32
3 changed files with 18 additions and 7 deletions

View File

@ -34,6 +34,17 @@
namespace srslte {
class srslte_nas_config_t
{
public:
srslte_nas_config_t(uint32_t lcid_ = 0)
:lcid(lcid_)
{}
uint32_t lcid;
};
class srslte_pdcp_config_t
{
public:

View File

@ -66,7 +66,7 @@ public:
rrc_interface_nas *rrc_,
gw_interface_nas *gw_,
srslte::log *nas_log_,
uint32_t lcid_);
srslte::srslte_nas_config_t cfg_);
void stop();
emm_state_t get_state();
@ -84,7 +84,7 @@ private:
rrc_interface_nas *rrc;
usim_interface_nas *usim;
gw_interface_nas *gw;
uint32_t default_lcid;
srslte::srslte_nas_config_t cfg;
emm_state_t state;

View File

@ -44,14 +44,14 @@ void nas::init(usim_interface_nas *usim_,
rrc_interface_nas *rrc_,
gw_interface_nas *gw_,
srslte::log *nas_log_,
uint32_t lcid_)
srslte::srslte_nas_config_t cfg_)
{
pool = byte_buffer_pool::get_instance();
usim = usim_;
rrc = rrc_;
gw = gw_;
nas_log = nas_log_;
default_lcid = lcid_;
cfg = cfg_;
}
void nas::stop()
@ -574,7 +574,7 @@ void nas::send_attach_request()
liblte_mme_pack_attach_request_msg(&attach_req, (LIBLTE_BYTE_MSG_STRUCT*)msg);
nas_log->info("Sending attach request\n");
rrc->write_sdu(default_lcid, msg);
rrc->write_sdu(cfg.lcid, msg);
}
void nas::gen_pdn_connectivity_request(LIBLTE_BYTE_MSG_STRUCT *msg)
@ -616,7 +616,7 @@ void nas::send_service_request()
uint8_t mac[4];
integrity_generate(&k_nas_int[16],
count_ul,
default_lcid-1,
cfg.lcid-1,
SECURITY_DIRECTION_UPLINK,
&msg->msg[0],
2,
@ -627,7 +627,7 @@ void nas::send_service_request()
msg->msg[3] = mac[3];
msg->N_bytes++;
nas_log->info("Sending service request\n");
rrc->write_sdu(default_lcid, msg);
rrc->write_sdu(cfg.lcid, msg);
}
void nas::send_esm_information_response(){}