lte/gateway/c/core/oai/test/amf/amf_app_test_util.cpp
/* Create security mode complete response from ue */
Create security mode complete response from ue
Create security mode complete response from ue
int send_uplink_nas_ue_deregistration_request(
    amf_app_desc_t* amf_app_desc_p, amf_ue_ngap_id_t ue_id, const plmn_t& plmn,
    uint8_t* nas_msg, uint8_t nas_msg_length) {
  bstring uplink_nas_ue_dereg_req;
  tai_t originating_tai = {};
  int rc                = RETURNerror;
  tmsi_t ue_tmsi = htonl(amf_lookup_guti_by_ueid(ue_id));
  if (ue_tmsi == 0) {
    return (rc);
  }
  uplink_nas_ue_dereg_req = blk2bstr(nas_msg, nas_msg_length);
  memcpy(
      &(uplink_nas_ue_dereg_req->data[nas_msg_length - sizeof(tmsi_t)]),
      &ue_tmsi, sizeof(tmsi_t));
  originating_tai.plmn = plmn;
  originating_tai.tac  = 1;
  rc = amf_app_handle_uplink_nas_message(
      amf_app_desc_p, uplink_nas_ue_dereg_req, ue_id, originating_tai);
  return (rc);
}
int send_uplink_nas_ue_deregistration_request ( amf_app_desc_t * amf_app_desc_p , amf_ue_ngap_id_t ue_id , const plmn_t & plmn , uint8_t * nas_msg , uint8_t nas_msg_length ) { bstring uplink_nas_ue_dereg_req ; tai_t originating_tai = { } ; int rc = RETURNerror ; tmsi_t ue_tmsi = htonl ( amf_lookup_guti_by_ueid ( ue_id ) ) ; if ( ue_tmsi == 0 ) { return ( rc ) ; } uplink_nas_ue_dereg_req = blk2bstr ( nas_msg , nas_msg_length ) ; memcpy ( & ( uplink_nas_ue_dereg_req -> data [ nas_msg_length - sizeof ( tmsi_t ) ] ) , & ue_tmsi , sizeof ( tmsi_t ) ) ; originating_tai . plmn = plmn ; originating_tai . tac = 1 ; rc = amf_app_handle_uplink_nas_message ( amf_app_desc_p , uplink_nas_ue_dereg_req , ue_id , originating_tai ) ; return ( rc ) ; }
Create security mode complete response from ue
Create security mode complete response from ue
/* Last 4 bytes are 0. Replace with TMSI */