Make sure that the pcap is started before NGAP init, so that the NGSetupRequest is caught

master
Pedro Alvarez 3 years ago
parent 5e22e42762
commit 2fad9ded01

@ -22,6 +22,7 @@ class ngap_pcap
{
public:
ngap_pcap();
~ngap_pcap() = default;
ngap_pcap(const ngap_pcap& other) = delete;
ngap_pcap& operator=(const ngap_pcap& other) = delete;
ngap_pcap(ngap_pcap&& other) = delete;
@ -40,4 +41,4 @@ private:
} // namespace srsran
#endif // SRSRAN_NAS_PCAP_H
#endif // SRSRAN_NGAP_PCAP_H

@ -336,7 +336,7 @@ int LTE_PCAP_S1AP_WritePDU(FILE* fd, S1AP_Context_Info_t* context, const unsigne
return 1;
}
/* Write an individual PDU (PCAP packet header + s1ap-context + s1ap-pdu) */
/* Write an individual PDU (PCAP packet header + ngap-context + ngap-pdu) */
int LTE_PCAP_NGAP_WritePDU(FILE* fd, NGAP_Context_Info_t* context, const unsigned char* PDU, unsigned int length)
{
pcaprec_hdr_t packet_header;

@ -262,14 +262,6 @@ void parse_args(all_args_t* args, int argc, char* argv[])
("scheduler.nr_pusch_mcs", bpo::value<int>(&args->nr_stack.mac.sched_cfg.fixed_ul_mcs)->default_value(28), "Fixed NR UL MCS (-1 for dynamic).")
("expert.nr_pusch_max_its", bpo::value<uint32_t>(&args->phy.nr_pusch_max_its)->default_value(10), "Maximum number of LDPC iterations for NR.")
//NGAP section
("gnb.enb_id", bpo::value<uint32_t>(&args->nr_stack.ngap.gnb_id)->default_value(0), "gNodeB ID")
("gnb.name", bpo::value<string>(&args->nr_stack.ngap.gnb_name)->default_value("srsgnb01"), "gNodeB Name")
("gnb.amf_addr", bpo::value<string>(&args->nr_stack.ngap.amf_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connection")
("gnb.gtp_bind_addr", bpo::value<string>(&args->nr_stack.ngap.gtp_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for GTP connection")
("gnb.gtp_advertise_addr", bpo::value<string>(&args->nr_stack.ngap.gtp_advertise_addr)->default_value(""), "IP address of eNB to advertise for DL GTP-U Traffic")
("gnb.ngc_bind_addr", bpo::value<string>(&args->nr_stack.ngap.ngc_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for S1AP connection")
// VNF params
("vnf.type", bpo::value<string>(&args->phy.vnf_args.type)->default_value("gnb"), "VNF instance type [gnb,ue].")
("vnf.addr", bpo::value<string>(&args->phy.vnf_args.bind_addr)->default_value("localhost"), "Address to bind VNF interface.")

@ -98,17 +98,17 @@ int gnb_stack_nr::init(const gnb_stack_args_t& args_,
}
if (ngap != nullptr) {
if (args.ngap_pcap.enable) {
ngap_pcap.open(args.ngap_pcap.filename.c_str());
ngap->start_pcap(&ngap_pcap);
}
ngap->init(args.ngap, &rrc, nullptr);
gtpu_args_t gtpu_args;
gtpu_args.embms_enable = false;
gtpu_args.mme_addr = args.ngap.amf_addr;
gtpu_args.gtp_bind_addr = args.ngap.gtp_bind_addr;
gtpu->init(gtpu_args, &pdcp);
if (args.ngap_pcap.enable) {
ngap_pcap.open(args.ngap_pcap.filename.c_str());
ngap->start_pcap(&ngap_pcap);
}
}
// TODO: add SDAP

Loading…
Cancel
Save