diff --git a/srsepc/hdr/mme/s1ap.h b/srsepc/hdr/mme/s1ap.h index ebedc9fec..61c78c664 100644 --- a/srsepc/hdr/mme/s1ap.h +++ b/srsepc/hdr/mme/s1ap.h @@ -31,6 +31,7 @@ #include "srslte/asn1/liblte_mme.h" #include "srslte/common/common.h" #include "srslte/common/log.h" +#include "srslte/common/s1ap_pcap.h" #include #include @@ -125,6 +126,9 @@ private: //FIXME the GTP-C should be moved to the MME class, when the packaging of GTP-C messages is done. mme_gtpc *m_mme_gtpc; + + //PCAP + srslte::s1ap_pcap m_pcap; }; inline uint32_t diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 180859f08..05949fa45 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -99,6 +99,8 @@ s1ap::init(s1ap_args_t s1ap_args, srslte::log_filter *s1ap_log, hss_interface_s1 //Initialize S1-MME m_s1mme = enb_listen(); + //Init PCAP + m_pcap.open("/tmp/epc.pcap"); m_s1ap_log->info("S1AP Initialized\n"); return 0; } @@ -130,6 +132,9 @@ s1ap::stop() s1ap_mngmt_proc::cleanup(); s1ap_nas_transport::cleanup(); s1ap_ctx_mngmt_proc::cleanup(); + + //PCAP + m_pcap.close(); return; } @@ -208,6 +213,8 @@ s1ap::handle_s1ap_rx_pdu(srslte::byte_buffer_t *pdu, struct sctp_sndrcvinfo *enb return false; } + m_pcap.write_s1ap(pdu->msg,pdu->N_bytes); + switch(rx_pdu.choice_type) { case LIBLTE_S1AP_S1AP_PDU_CHOICE_INITIATINGMESSAGE: m_s1ap_log->info("Received initiating PDU\n");