Starting to fill the Attach Request message.

master
Pedro Alvarez 7 years ago
parent 9c54a8b7de
commit 7737acb970

@ -40,6 +40,7 @@
#include <map> #include <map>
#include "mme/s1ap_common.h" #include "mme/s1ap_common.h"
#include "mme/s1ap_mngmt_proc.h" #include "mme/s1ap_mngmt_proc.h"
#include "mme/s1ap_nas_transport.h"
#include "hss/hss.h" #include "hss/hss.h"
namespace srsepc{ namespace srsepc{
@ -83,6 +84,7 @@ private:
std::map<uint16_t,enb_ctx_t*> m_active_enbs; std::map<uint16_t,enb_ctx_t*> m_active_enbs;
s1ap_mngmt_proc m_s1ap_mngmt_proc; s1ap_mngmt_proc m_s1ap_mngmt_proc;
s1ap_nas_transport m_s1ap_nas_transport;
}; };

@ -23,8 +23,8 @@
* and at http://www.gnu.org/licenses/. * and at http://www.gnu.org/licenses/.
* *
*/ */
#ifndef S1AP_MNGMT_PROC_H #ifndef S1AP_NAS_TRANSPORT_H
#define S1AP_MNGMT_PROC_H #define S1AP_NAS_TRANSPORT_H
#include "srslte/asn1/liblte_s1ap.h" #include "srslte/asn1/liblte_s1ap.h"
#include "srslte/common/common.h" #include "srslte/common/common.h"
@ -35,12 +35,18 @@ namespace srsepc{
class s1ap_nas_transport class s1ap_nas_transport
{ {
public: public:
s1ap_mngmt_proc(srslte::logger s1ap_logger); s1ap_nas_transport();
virtual ~s1ap_nas_transport(); virtual ~s1ap_nas_transport();
void set_log(srslte::log *s1ap_logger);
bool unpack_initial_ue_message(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *msg, uint64_t *imsi); bool unpack_initial_ue_message(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *msg, uint64_t *imsi);
bool pack_authentication_request();
private:
srslte::log *m_s1ap_log;
}; };
} //namespace srsepc } //namespace srsepc
#endif //S1AP_MNGMT_PROC #endif //S1AP_NAS_TRANSPORT

@ -45,17 +45,16 @@ s1ap::init(s1ap_args_t s1ap_args, srslte::log *s1ap_log)
{ {
m_s1ap_args = s1ap_args; m_s1ap_args = s1ap_args;
srslte::s1ap_mccmnc_to_plmn(s1ap_args.mcc, s1ap_args.mnc, &m_plmn); srslte::s1ap_mccmnc_to_plmn(s1ap_args.mcc, s1ap_args.mnc, &m_plmn);
m_s1ap_log = s1ap_log; m_s1ap_log = s1ap_log;
m_s1ap_nas_transport.set_log(s1ap_log);
m_s1mme = enb_listen();
m_hss = hss::get_instance(); m_hss = hss::get_instance();
m_pool = srslte::byte_buffer_pool::get_instance(); m_pool = srslte::byte_buffer_pool::get_instance();
m_s1mme = enb_listen();
return 0; return 0;
} }
@ -370,7 +369,7 @@ s1ap::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *msg
return false; return false;
} }
m_s1ap_nas_transport->gen_auth_request(); m_s1ap_nas_transport.pack_authentication_request();
return true; return true;

@ -29,20 +29,58 @@
namespace srsepc{ namespace srsepc{
s1ap_nas_transport::s1ap_nas_transport(srslte::logger *s1ap_logger) s1ap_nas_transport::s1ap_nas_transport()
{ {
m_s1ap_logger=s1ap_logger; return;
} }
s1ap_nas_transport::~s1ap_nas_transport() s1ap_nas_transport::~s1ap_nas_transport()
{ {
return;
}
void
s1ap_nas_transport::set_log(srslte::log *s1ap_log)
{
m_s1ap_log=s1ap_log;
return;
} }
bool bool
s1ap_nas_transport::initial_ue_message(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *msg, uint64_t *imsi) s1ap_nas_transport::unpack_initial_ue_message(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *msg, uint64_t *imsi)
{ {
return true; return true;
} }
bool
s1ap_nas_transport::pack_authentication_request(uint8_t *autn,uint8_t *rand)
{
LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT pdu;
memcpy(pdu.autn , autn, 16);
memcpy(pdu.rand, rand, 16);
pdu.tsg_flag=LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_NATIVE;
pdu.nas_ksi=0;
return true;
//typedef struct{
// LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi;
// uint8 autn[16];
// uint8 rand[16];
//}LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT;
//typedef struct{
// LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM tsc_flag;
// uint8 nas_ksi;
//}LIBLTE_MME_NAS_KEY_SET_ID_STRUCT;
//typedef enum{
// LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_NATIVE = 0,
// LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_MAPPED,
// LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_N_ITEMS,
//}LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM;
}
} //namespace srsepc } //namespace srsepc

Loading…
Cancel
Save